No apparent way to prevent redundant type checking against already-narrowed types?

TypeScript Version:  2.3.0-rc
I'm doing a whole lot of refactoring at the moment and going around trying to find places where, due to some structural changes in my application, I no longer need to be calling my isNotNull function, which I use to narrow the type to a non-null value. The narrowing part is fine, but I'd really like to only be allowed to call it if the argument could at least possibly be a nullable type, according to the type system. If the type system already knows the value is not null, I'd like it to prevent me from passing it to the type-narrowing function in the first place.
Code
// as per the return value, the compiler knows this function is designed to narrow the type:
function isNotNull<T>(value: T|null): value is T {
  return value !== null;
}

const x: string|null = getSomeStringOrNull();

// it's ok to try and narrow the type here because the compiler can't guarantee it's not null yet:
if(isNotNull(x)) {
  if(isNotNull(x)) { // how can I make this call a compile-time error?
    // ...
  }
}

// or an alternate example:

function printNumber(n: number): void {
  console.log(n);
}

const x = 3;

// I want an error or warning below. It's pointless narrowing an already-narrowed type:
if(isNotNull(x)) {
  printNumber(3);
}

Because this redundancy is apparently invisible to the compiler, I can't simply work through the error list to fix the places where it matters, and instead need to look through all calls to the function and manually analyse the surrounding code to determine if I still need the check.

@axefrog Actually there is a way to do this. It is a bit of a hack but it works.
function isNotNull(value: {}): value is never;
function isNotNull<T>(value: T | null): value is T;
function isNotNull<T>(value: T | null): value is T {
  // tslint:disable-next-line:no-null-keyword
  return value !== null;
}

declare const value: string | null;

if (isNotNull(value)) {
  if (isNotNull(value)) {
    // error on usage of value.
  }
}

It is not exactly the same as receiving an error on the second call but practically it comes close.

This relates to #4183

@aluanhaddad Heh, thanks, I'll give that a go. Might make a suitable stopgap solution in the mean time.

Doesn't quite work in this example:
export function isNotNull(value: {}): value is never;
export function isNotNull<T>(value: T|null): value is T;
export function isNotNull<T>(value: T|null): value is T {
  return value !== null;
}

function printNumber(n: number): void {
  console.log(n);
}

const n = Math.random();
if(isNotNull(n)) {
  printNumber(n); // no error - apparently it's ok to use `never` in this way.
}

Related?: https://github.com/Microsoft/TypeScript/issues/15211

Update: Partial/interim workaround is to enable noImplicitAny. It doesn't solve the problem directly, but it can generally be inferred that anywhere I'm checking for null, I'm probably going to be doing something with the narrowed type that contradicts the type's nature, and in doing so, causing the compiler to treat the behavior as implicit any, which will cause an error if the flag is enabled.

Do not think there is a way to make this work. in a sense you want to specify an overload and then make it an error. the language has no constructs to do such a thing.

@mhegazy I don't want to specify an overload; not sure if you were responding to @aluanhaddad 's workaround or the question that preceded it? (the latter being what I was actually asking).
To recap, I'd like the compiler to recognise the redundancy of passing a value of type A to a type-narrowing function where the narrowed type is already of the type being narrowed to.
function printNumber(n: number): void {
  console.log(n);
}

const x = 3;

// I want an error or warning below. It's pointless narrowing an already-narrowed type:
if(isNotNull(x)) {
  printNumber(3);
}

Not sure how that relates to overloading?

but you still want isNotNull to work on null | number, since number is a subtype of null| number, the only way i can think of "chose" one is overloads.

I'm not too familiar with TypeScript internals, but from what I can see the compiler knows, when it encounters a call to isNotNull(), both the type being narrowed to (number), and the actual type of the argument passed in.  So if the argument is known, at the call site, to be the same type as the target type (known-number as opposed to number | null), then the compiler could just generate a warning in that case, right?  No overload logic needed.

The isNotNull is just a function call. the compiler knows it does something extra, i.e. removing the null from the type of the input it it exists. not sure why this would be a warning, and other calls are not.

@mhegazy Could you clarify why you're not sure? As per the original question and what @fatcerberus said, the warning specifically relates to redundancy. The compiler can see that the return type is arg is number and has already resolved the type being passed in as having already been narrowed to the specific type that the function narrows to. If it were a different type being passed in, or a wider type, or the function is not a narrowing function, then the warning would of course not apply. The point is that TypeScript offers type narrowing through a very specific function syntax, and given that it's operating in the context of a statically-analysed input type, it stands to reason that a simple comparison between the function arg is whatever return type and the type of the passed-in argument could easily see that the type is already identical, and that, for a project written from the ground up in TypeScript, that the type check is redundant, given the surrounding context.

Looks like this the same request as https://github.com/Microsoft/TypeScript/issues/14977

Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.


remove forbidden character from metric name

The graphite.js backend removes all the '=' from the metric name, so we cannot use it to separate key / value.

+1

+1


Added sticky to README and sorted it in alphabetical order

Hi all, I think this ember add-on is useful and handy even for beginners in ember.js (like me), but when I started picking up this add-on, I found that the doc need a little improvement as I did not know there is sticky component available until I read into code.
So in this pull request I did two small changes:

Re-arranged the order of component description by alphabetical order
Added the description of sticky (!)

Regards,
Pui Yiu

FYI, the data-down-actions-up branch is kind of the master at this point. Although I'm not part of the repo in any way, I do know that they'll be merging that branch into master soon. Along with it comes a new documentation Website and a basic README.

@alexpyc thanks for making the changes. if you can change this pull request to merge into the 1.0 tag I will get it merged in. @Panman8201  is right that the data-down-actions-up branch is the unofficial master and will be merged in to create a beta release soon

2.0 beta has been released, if you would like to update the 1.0 tag, please update the pull request or close this out. Thanks

@aaronbhansen Hi, sorry that I didn't acknowledge the release of version 2.0. I have updated the pull request. The new PR is here: #123. Thanks for the help.
Thank you very much @Panman8201 !


An error occurred with the .NET AssemblyAnalyzer, is the dotnet 8.0 runtime or sdk installed?

Describe the bug
By scanning .net of the project I get the error:
[ERROR] An error occurred with the .NET AssemblyAnalyzer, is the dotnet 8.0 runtime or sdk installed?
The project is built on .NET 6.0
.NET 6 is installed, the --dotnet parameter specifying the path did not help.
In the old version ODC 8.3.1, there was no such problem using the analyzer.NET Assembly
Version of dependency-check used
The problem occurs using version 10.0.4
Log file
[INFO] Analysis Complete (16 seconds)
[INFO] Writing HTML report to: Z:\gitlab-runner\builds\tWZLEjHWQ\0\test.html
[ERROR] An error occurred with the .NET AssemblyAnalyzer, is the dotnet 8.0 runtime or sdk installed?

You can still analyze .NET 6 assemblies - you just need the .NET 8 runtime to do so.

dotnet 6 is EOL. As such, we upgraded to requiring dotnet 8. See https://github.com/dotnet/core/blob/main/release-notes/6.0/README.md

dotnet 6 is EOL. As such, we upgraded to requiring dotnet 8. See https://github.com/dotnet/core/blob/main/release-notes/6.0/README.md

Is there an alternative option?
If I install .NET 8 then it will break my build. Yes, this is a strange behavior, I have a fixed version in the project on .NET6, however, I have not solved this problem yet.


feat(@jest/environment, jest-runtime): allow requireActual and requireMock to take a type argument

From https://github.com/facebook/jest/issues/13199#issuecomment-1244019473
Summary
Currently jest.requireActual and jest.requireMock return unknown. It is possible to use as typeof import('../someModule') to cast the return value. At the same time, it is somewhat nicer to do this via generic type argument:
const original = jest.requireActual<typeof import('../someModule')>('../someModule');

Test plan
Type tests are added.

https://github.com/facebook/jest/releases/tag/v29.1.0


Better handle history 404 errors, so we don't have to trigger an error.

We have a couple cases where message history on deleted messages are pulled, and trigger 404 errors that may lead to harder crashing where they aren't captured proper.
Thus, let's add some 404-error protection for message history 404 errors.  If such an error happens we return nothing.  If it's any other type of 404 error in the message handling, raise that error.

Codecov Report

Merging #961 into master will decrease coverage by 0.15%.
The diff coverage is 28.57%.

@@            Coverage Diff             @@
##           master     #961      +/-   ##
==========================================
- Coverage   63.68%   63.52%   -0.16%
==========================================
  Files           6        6
  Lines        1776     1782       +6
==========================================
+ Hits         1131     1132       +1
- Misses        645      650       +5

Impacted Files
Coverage Δ

chatcommunicate.py
71.85% <28.57%> (-2.06%)
:arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 55e1fb0...aae6366. Read the comment docs.

Can you point to a scenario where this could be tested?

@triplee Kinda hard actually.  This was observed when you try and pull chat history links which apparently Smokey does, and then can't see because it was deleted or such.


TypeScript type checker

See https://github.com/dudykr/stc

I'm just looking at this: https://github.com/kdy1/swc/tree/e88e5e4c824926e5f3a5240986c33bb30f7508b5/typescript/checker
Won't re-writing the TS type checker in rust be a lot of work? There's so many edge cases! Why not just do what babel does and tell people to run the typescript type checker over the code with emitting? Alternatively, you could build something into the swc JS package that uses the typescript compiler api to do this as well.

What might be neat is something that converts swc AST nodes to TypeScript compiler api nodes. So you could parse the nodes with swc, send them over to JS, convert them to typescript compiler api nodes, then it could do the type checking.

@dsherret I'm porting tsc because it is wall-clock grade slow.

True, it could be faster, but there's a whole team of developers working on TypeScript daily. It will be very hard to get all the edge cases, but perhaps you could repurpose the tests the typescript team uses in the typescript repo.
Anyway, you have a long and continually expanding road ahead of you :)

I'm already using tests in typescript repository :)
I know that it's a very hard task, but it's fun for me.

That’s awesome. Well, you’ve done an excellent job with the library and you’re very fast at programming so good luck! 😀

@kdy1 what's the current status? What's the most up-to-date branch in your fork? I have a feeling you won't be able to pull this alone. Maybe we can create a plan to "move Mount Fuji" and get more people involved?

@kyegupov
As for the current state of affairs, type reasoning is somewhat implemented. Just look at my fork's dts Branch. To create a dts file, you need to know the type of exported function and variables, so type reasoning is required. There are many functions that have been implemented, but there is still a long way to go.
But I'm so busy these days that I don't have time to invest in SWC.
I want to make money. Although I think I will quit today due to pay issue, I got a job and I am preparing for my business. Unfortunately, in the case of type systems, you have to invest a lot of time, but you can't afford it. I expect some money if many people spend it later, but it takes too much time.
Also, the work is very difficult. It takes almost three days, 14 hours a day, to solve one type-inference test.

https://deno.land/v1#tsc-bottleneck

FYI: TypeScript team doesn't have any plan to port TSC to Rust for reasons explained in tweet thread https://twitter.com/drosenwasser/status/1260722414012358657

We need to recruit a few developers to achieve this.

I'm interested! I don't know if I'm up to the task, but I'll at least spend the next couple days poking around the code and getting up to speed.

We need to recruit a few developers to achieve this.

@sciepsilon I've formed a little team together with @wongjiahau to help @kdy1 work on this.
Fell free to email!

Hi! 👋 I'm also very interested in helping with a rust port of TSC 😄, is this project public?

@cakekindel Hi if you're interested you can join us at https://discord.gg/AN7QZs

Sorry the link above was temporary, I just update it with a permanent one.

The other approach you can use with babel is do just do compilation, and run the type checker without emitting in a separate thread so even if it's slower, your build still finishes fast. That might currently work with swc? But the idea of a much faster type checker is also very exciting!

i think this idea isn't useful for check errors (we can with the IDE) but is very cool for lib which depend on typechecks (metadata), for example in loopback there is 3 different results depending on what you use
ts-node with typecheck: it's okay (Function)
ts-node with transpile-only: error (Object)

swc: error (undefined)

Sample repo: https://github.com/mdbetancourt/ts-node-loopback you can try changing .mocharc ts-node/register to @swc-node/register

Current status, as someone asked about it on slack.
Typescript type system can be implemented in three steps. Those are namely type inference, .d.ts generation, and type checking.
Currently the type inference and .d.ts generation is almost there.
I’m applying it to the famous libraries like rxjs to find bugs.
There are some, but it's being improved steadily.
For type checking, it can only check very simple errors. As there are so many type checking rules, it will be time-consuming task.
But it’s not open sourced, and I’m not going to open source it.

@kdy1 i hope you can start some sort of business with this project and be able to compete with tsc, I would be happy to pay to have a faster tsc and tsl alternative
Wish you all the best!

@kdy1 I would be interested in helping you out with this project. The type-checking for TS - considering it will be the main thing most web-developers use in the next 5 years - is horrendously slow.
I also have buy-in from the company I work for to work on this for 2/3 months full-time. Please let me know if you're interested

@NoPhaseNoKill
Thank you, but the program has been implemented a lot and there are a lot of challenges to get help from others.
Of course, it would be great if it was completed quickly, but it's a proprietary software and I'm preparing a business with it.

No worries at all. If you need anyone at any stage to test anything on medium/larger sized repositories, please let me know.

@NoPhaseNoKill Thanks you for understanding. I would absolutely need tester. I'll ping you at the time.

Typescript type system can be implemented in three steps. Those are namely type inference, .d.ts generation, and type checking.

@kdy1 It would be awesome if you could add also transformer plugins that leverage the type system

We have a compilation step implemented as a TypeScript transformer that evaluates CSS in JS into static css.
Basically takes code like this:
function giveMeRed() {
  const red = 'red';
  return red;
}
const Comp = styled.div({ color: giveMeRed() });
const node = <Comp />;

And turns it into:
const node = <div className="a" />;

.a { color: red; }

It uses the TS type checker to go through great lengths to evaluate styles at compile time, and it would be really great if the type checker in swc would allow us to achieve the same results.
Important aspects of the TS type checker for us is being able to get a symbol from an identifier, and for it to work across modules.
Anyway, I understand how big of a task it is to recreate TypeScript, just thought that our use-case might be interesting to hear about.

@dsherret I'm porting tsc because it is wall-clock grade slow.

I literally decided to do this and landed here via my search journey. The discord link is dead, can you please share it again?
Thank you!

@s-kris It will be developed as a propriety software.

Ah! I just read this
But it is an excellent business case. Enterprises would love to pay, it'll save them a load of programmer-hours.
Wish you the best :)

Could you perhaps add a "X tests out of Y tests" to the status? To give a rough idea of how close you are to the finish line :D

It would also be cool to have a newsletter with new updates and progress made

It would also be cool to have a newsletter with new updates and progress made

There's already a blog with news on swc.rs/blog.

@pbadenski I'll do so :).
@remorses It seems good, but sometimes I don't have enough time to work on stc, so the mailing period might be strange.

@kdy1 It might be early, but are you seeing some encouraging performance numbers that you can share publicly?
If this is significantly faster and works well I can't imagine how anybody who writes TS professionally could pass on paying for something like this.

It might be early, but are you seeing some encouraging performance numbers that you can share publicly?

Yes, although I didn't do many optimizations, it's quite fast.
Compared to tsc, it's very fast.

Here's a random idea, what about crowd funding the effort? If it helps the
progress I'd definitely buy licenses up front on the back of amazing swc
experience.
On Thu, 27 May 2021, 16:15 강동윤, @.***> wrote:

It might be early, but are you seeing some encouraging performance numbers
that you can share publicly?
Yes, although I didn't do many optimizations, it's quite fast.
Compared to tsc, it's very fast.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/swc-project/swc/issues/571#issuecomment-849719330,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAAQY2OC37642LLHQVSZWFTTPZO2TANCNFSM4KDBDQIA
.

Here's a random idea, what about crowd funding the effort? If it helps the progress I'd definitely buy licenses up front on the back of amazing swc experience.
…

That's a good idea, Onivim 2 did something similar. Where the earlier you got in the cheaper the license was.

I love the idea of the earlier you got in, the cheaper the license was, but I'm not sure about the funding because it's too hard to estimate when I can finish it.
Thanks anyway!

@kdy1 It's okay. Just put a basic demo and open a payment page. I'm ready to purchase it as an early backer. If it goes viral it's for the best.

@kdy1 I have a large and heavily typed project. I would be more than willing to run some tests. Also if I can help in any way to make the development faster, please let me know. I'll buy your product day 1.

Also I second the idea of early backing.
I'm willing to put a couple thousands dollars on the table if that can help you spin up the whole thing.
I need this yesterday.

@JesusTheHun Thank you so much, but it's okay. I think I can match all tsc errors (few thousands test files) within a year even if I do it alone.

As @nayeemrmn mentioned, from TSC Bottleneck in Deno:

TSC must be ported to Rust. If you're interested in collaborating on this problem, please get in touch.

Compete or cooperate? Or are you a Deno guy already, @kdy1 ? :-)

@prantlf My tsc implementation is not related to deno and I don't think someone else is working on the typescript type checker.

Hey!
I'm really excited about the Rust port of tsc! 🔥
I'm still learning Rust, but if I can help with anything simple, I would love to contribute!

I'm sorry but it's a proprietary software.

Ah, sorry, missed the message about it
Good luck!

@lf94  I'm still working hard on it. I think few months are required to implement it fully.
TypeScript supports really weird use-cases, like returning an object literal from the constructor of a class.

TypeScript supports really weird use-cases, like returning an object literal from the constructor of a class.

Because it's valid JavaScript 🤣

We would have flying cars by now if JS wasn't so messy, good luck mate, I am hoping you can do this!

@lf94 I'm still working hard on it. I think few months are required to implement it fully.
TypeScript supports really weird use-cases, like returning an object literal from the constructor of a class.

May just ignore this cases in your compiler (or do it at first time)? I this this limitations isn't block main work flow... but missing this feature really block me to migrate all my projects to your compiler...

@sanchezweezer Yeah, I'm going to do it, but it's kinda hard to skip some of tests. I have to skip one by one.

Good luck @kdy1
We're really interested in your work, ain't we folks?
Yeah, is there anything you can share by now?

@kdy1 will it stay closed source even with the support from vercel?

@thomaschaaf I can't be sure at the moment. I decided to focus on making it work on simple real-world projects for now.
Previously I focused on implementing validation rules.

The status hasn't been updated for months. May we know the current progress?

@Songkeys Not so much progress in the number of passing tests. I had too much tasks related to swc.
I made some improvements anyway.

optimized the performance,

Now it takes less than 3 seconds to create 6648 errors, while 5621 of them is a correct error.

reduced the compile time,

Previously one module was so big and took 35+ seconds to compile in debug* mode, but it now takes less than 15 seconds.

resolved lots of tech debts

I restructured the project, resolved lots of lints.

I unassigned myself just because it shows up in the task list.
I got a question about this from discord server, and I'm writing this to prevent confusion

Is there any chance of this coming under a FoSS license? I’d be happy to land PRs getting more conformance tests passing if that were the case.
I’m not really sure that it will be possible to keep up to date with typescript itself if it’s just one guy working on it alone as an entire development team (backed by one of the richest companies in the world) forges ahead with changes to the language.
It’s almost backwards (in that I would expect the massive company to be the one with the proprietary project).

No, and I'll hire developer once I earn money out of it.
And it's the biggest reason - I can't maintain it by myself so FOSS is not an option.

I guess we could still help you (If you want to) build a pipeline that takes the output of your tests and updates https://stc.dudy.dev/docs/status/ automatically when you push code to your closed source repo.
I know for a fact maintaining progress status websites is a boring task, and you're getting a lot of attention from the community. We all want to see you achieve this kind of goals dude, SWC marked the start of a new era for web development.

@franco-roura
I didn't work on the new type checker recently because I was busy due to a commercial project.
That's why I didn't update the numbers.

Given that Vercel is leaning into SWC and an SWC-based typechecker would probably be the single biggest thing Vercel can do to speed up my NextJS builds, curious @leerob if there's any interest to provide resources to this effort.
Similarly, I can say the same thing RE:

typescript-eslint performance is slow and often gets issues about it, if SWC typechecking was there it would make it 100x better
As a result of that, VSCode also gets slow, so the biggest perf win I could think of for editing on a daily basis would be an SWC type checker, VSCode team ought to think about supporting this project

Osdiab, using SWC-Typechecker with VS Code is probably not as easy as it sounds, because building a language server requires a very different architecture from that of a compiler.

@osdiab, using SWC-Typechecker with VS Code is probably not as easy as it sounds, because building a language server requires a very different architecture from that of a compiler.

Yeah, specially if you’re not only looking for “compiled or failed” logs but also in-code error highlighting, autocompleting, actions applied when the file is saved, real-time detection per file and not per project, etc.

I'll also provide a fast IDE plugin, of course.
It requires some more work, but it definitely worths the effort.

I ultimately think that a commercial version won't gain as much traction as a FOSS project. @zackradisic is starting an open source alternative called tyty ( https://zackoverflow.dev/writing/tyty ), but it's still early in development.

@andyfleming  I already chatted with him. But still, I want fair rewards for my work and I'm sure open-sourcing the new typescript type checker will not give me enough rewards.

Have you thought of a gofundme (or similar) "give me X money and it will be released under a open-source license" ? Might be an interesting experiment even if it fails.

Honestly at this point, companies heavily invested in TypeScript that are profitable or have significant venture funding should be sponsoring this and making it OSS. Deno, and Vercel immediately come to mind. Deno especially, since the type checking is Deno is quite a bottleneck, if they could improve it, they would improve the developer experience, leading more people to adopt Deno, which would lead more devs to their paid hosting service. @kitsonk @ry
@kdy1 I want you to make money from this project, you deserves tons of money. But I think you're underestimating how lazy and unmotivated people are to change. The number of people that will pay for a faster type checker instead of just using the free one that's slower is a tiny tiny tiny fraction. I think it would be a hard sell in the corporate world as well. "You want the company to pay for a type checker that is 100x faster, but a free one is available? Just use the free one..."
You need sponsors, not licensors.
Also another route to consider is the fact that Microsoft has been adopting Rust lately, if you truly perfected the type checking with all the existing nuances and absolutely obliterated the performance of the JS-based TS type checker, they could easily be convinced through sheer community demand into adopting your project and sponsoring/hiring you to work on it full-time.

The communication between @kdy1 and the Deno project is common and frequent.  It just doesn't always occur in public forums.  Also, recognise that just because something is a good idea doesn't mean that everyone agrees on what the right approach and priority is for something.

https://kdy1.dev/posts/2022/1/tsc-go

@kdy1 Great to hear!
It's interesting you mention building a replacement bundler as well. Are there major shortcomings of esbuild today?

It's interesting you mention building a replacement bundler as well. Are there major shortcomings of esbuild today?

The bundler is this repo? It predates work on the typechecker.
@kdy1 I like the pragmatic choice here and am glad vercel is sponsoring the work!

We (Vercel) are very excited about all the amazing work @kdy1 is doing 🎉 🚀

@charrondev Compiler ≠ Bundler
The swc compiler, if I understand correctly, only strips the TypeScript types from the files. It doesn't bundle in the dependencies, tree-shake, and build output bundles.

The swc compiler, if I understand correctly, only strips the TypeScript types from the files. It doesn't bundle in the dependencies, tree-shake, and build output bundles.

Just to correct:
SWC have a bundler as well and it's work in progress for major improvement. SWC is set of the various tooling, transpilation is one of those part.
https://github.com/swc-project/swc/issues/3016

@leerob Can you comment on how this will interoperate with Microsoft's tsc proper? It is difficult to evaluation what this means for swc, tsc, and the Web without any indication of the dynamic between the two teams.
In particular, what does @DanielRosenwasser think of this effort?

I vaguely remember the TypeScript team saying they didn't plan on writing the compiler in a different language. I think part of the rationale has to do with dog-fooding.

I vaguely remember the TypeScript team saying they didn't plan on writing the compiler in a different language. I think part of the rationale has to do with dog-fooding.

I vaguely remember the TypeScript team saying they didn't plan on writing the compiler in a different language. I think part of the rationale has to do with dog-fooding.

I remember the same kind of argument. The thing is there is some merit to that, but no sane people would argue in favor of browsers implementing JS in JS, at some point the language becomes important enough that enormous effort is put into it to make it faster, I guess the TS maintainers believe TS is either not important enough, is fast enough, or they physically don't have the resources to make it faster..

@fabiospampinato see this comment

I have high expectation on this feature. I just replace the babel-loader and I saw huge performance benefits. I guess that having the other work in progress features detailed here tsc-go will have huge impacts as well.
Good job on that! 🚀

Hi, is there an update ? :)

So, I'm interested in contributing to this effort, and I have a few questions to ask the swc maintainers:

What would an ideal "TypeScript checker" do within the swc pipeline?
Is it mostly just to scan the AST/source and errors/warnings?
What about propagating type information within the core AST nodes?
Should type information be used to perform optimizations?
Should it have a public API?
Should the core AST implementation be changed to the TypeScript compiler AST, or should there be a conversion step to translate between them?

It would be a huge step forward to create an outline that addresses these and other questions.

@stavalfi No due to some internal issues.
@austindd

It verifies type
No
Not sure if I'll implement this
Maybe
Of course
Conversion is better

Also, I'm considering withdrawing the plan for open-sourcing it

You haven’t even shipped anything and you’re already saying “maybe I’ll just take my ball and go home”. Get out of here with that nonsense. You’re holding on to some delusion that everyone is going to pay you for this tool. They’re not. We're not entitled to you doing this work for free, but that doesn't mean that the community will accept a paid solution.
All you’re doing is delaying someone else leading the charge on this. This game is annoying and childish.
And what is Vercel paying you for? It’s in their best interest for you to contribute this as OSS, and here you are embarrassing them instead. ( @leerob ).
(That's the correct pattern for projects like this, in my opinion, by the way. A company that has a vested interest in a technology or stack should be sponsoring an effort like this. I assumed that was what was happening at this point.)

Maybe

If you're talking about optimising runtime code, then this won't be possible because TS types don't actually guarantee anything. There can't be assumptions about the code that would allow it to run faster, because all data types could be completely different from what TS believes.

Personally I'm much more interested in this project not getting abandoned then in what form it will be licensed. I'd really like to experience another esbuild type of step change where suddenly we realize that we have been actually writing it wrong, and it's possible to make it 50~100x faster. And type checking performance is a much bigger problem than bundling performance in my opinion, with HMR even WebPack is fast after a bit, but TS is just too slow, unacceptably slow.

If it's good I/my company would pay for it but if it comes in 5 years then TypeScript itself may have changed significantly/I might not even be using it anymore, so I'm more interested in this existing ASAP above how it ends up being licensed. Anything that increases the chance that this will materialize sooner in good quality, I am in favor of. But it's kdy1's project and so that's his decision to make.

Smaller companies might pay for a solution, but at big companies licensing software (even if a low price) can be complicated and a liability.
Regardless, there's clearly enough support for someone to tackle the project, but either work on it or don't
I'd rather see someone else take on the project at this point. Working without transparency and talking about changing the licensing on a whim are major red flags.

I'm sorry to confuse you. The TypeScript Type Checker will be released as an open-source.
I changed my mind thanks to one famous company that wanted to donate to the project.
(I forgot that Vercel wasn't the only sponsor)
Btw, I think tsc would be changed a lot while I stopped working on it...

@kdy1 if I understood you correctly, you've dropped the plan to port tsc to Rust and will port it to Go instead. Are you willing to share the source code of your abandoned attempt in Rust?

No, it's umm.. Too dirty?
In fact, there are some codes that are embarrassing to disclose as an open-source even though I wonder who will look at it. There are many rules that I didn't know, so I changed the code so often and the code became spaghetti.
e.g.
The Type enum has ClassInstance and Instance because I didn't know that the code below is valid.
class Factory {
    static create() {
        return new this()
    }
}

Haha that's fair, I think we all know what it's like to read old code of ourselves :D
I am mainly just asking out of interest. I am not too familiar with the code base of TSC so I'm intrigued how one would go about implementing it. As it's already clear that this approach won't turn out too useful, I doubt that I'll turn it into something useful. But hey, maybe I can learn something :)

@kdy1 are you sure you will have better performance by porting to go?
The theory here - because 90% of type checking is conditions checks, nodejs (after warming, classes compilations and optimisations) could be as much fast as go.
Maybe it make sense to explore multithreading instead.

Yep. The main problem is the cpu core it uses.
Problem is not optimization

So by porting you mean making it multithreaded too (using coroutines, channels, etc)?

Of course. What's the point of porting to go at the first place if we are going to use only 1 core?
If go is single-threaded or javascript was multi-threaded, I wouldn't start it. If then, contributing to tsc is the correct way.

This discussion about multi-threaded compilation might be relevant: https://github.com/microsoft/TypeScript/issues/30235

Just to join the dots for anyone unaware, there's a public repo where work on stc kdy1's type checker is taking place:
https://github.com/dudykr/stc

Closing as the stc is now abandoned. TypeScript was not something that I could follow up on in an alternative language.

Sorry to hear that, but respect you for your contributions and efforts here!


[RFE] Support cluster nodes using podman

What kind of request is this (question/bug/enhancement/feature request):
Feature Request
Would it be possible to have support for cluster nodes that aren't running a docker daemon and are using podman instead ? (For example RHEL 8 servers).
Regards.

Kubernetes has Container Runtime Interface (CRI) support, which allows using different container runtimes. Docker is the most used and mature runtime for kubernetes, but support for other container runtimes is available aswell in kubernetes.
Afaik Podman is a replacement/alternative for "standalone docker" in RHEL8 (and now in RHEL7 aswell), but podman is not actually required for kubernetes, as like said kubernetes has direct support for linux containers (without podman) via CRI, using other kubernetes container runtimes such as cri-o or containerd.
docker/podman/cri-o already use shared internal components/libraries, and (afaik) the plan is to share more components between podman and cri-o (for example libpod).
So maybe this request really should be about supporting other kubernetes CRI's directly, rather than trying to use the docker-CRI without docker? I know podman is mostly cli-compatible with docker, but I wouldn't be surprised to get many problems if trying to use kubernetes docker-CRI with podman.. it's probably better to use native alternative kubernetes CRI directly?
Just some random thoughts :)

On Rancher master node(s), Rancher could be launched using:
$ podman run -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher
instead of:
$ sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher
priviledged access (sudo) would not be required anymore, so less security concerns, less exposed surface

Podman doesn't support '--restart'.  Instead it's necessary to use systemd services as described here: https://www.redhat.com/sysadmin/podman-shareable-systemd-services
Running Rancher with podman does seem successful although so far my attempts to bring up a new cluster using podman have not successfully finished provisioning.  I haven't looked deeper into the failure yet.

Setting up a cluster (the rancher/rancher-agent image) apparently starts an etcd, but then the other components fail to connect to it.
I guess the missing docker socket /var/run/docker.sock is the first culprit.

interested in this feature

interested in this feature +1

interested in this feature +1

You can run podman with sockets, too.
But, since you want to build a kube cluster, your etcd will fail to load.
Rancher agent use rename docker API method in order to manage etcd pod, podman doesn't support
it at all, redhat say its better to rm and create it again...
Still thinking its a good idea to rancher support podman... even if.
Error coming from rancher ui :
This cluster is currently Provisioning; areas that interact directly with it will not be available until the API is ready.
[etcd] Failed to bring up Etcd Plane: Error response from daemon: Path /v1.24/containers/etcd/rename is not supported
 podman info host:   arch: amd64   buildahVersion: 1.18.0   cgroupManager: systemd   cgroupVersion: v1   conmon:     package: conmon-2.0.22-3.module+el8.3.1+9857+68fb1526.x86_64     path: /usr/bin/conmon     version: 'conmon version 2.0.22, commit: a40e3092dbe499ea1d85ab339caea023b74829b9'   cpus: 4   distribution:     distribution: '"rhel"'     version: "8.3"   eventLogger: file
Bien à vous,
J

Please add podman support. It's not sustainable to require docker when it has been dropped by Redhat and various forks.

Mr. Stale Bot, please don't close this ticket.
It is still quote relevant especially given that RKE2 supports not needing Docker. It would make sense that this feature should be placed into Rancher itself.

Given the latest Docker announcement podman support of podman became whole a lot more important.

Still interested.


[SPARK-43755][CONNECT] Move execution out of SparkExecutePlanStreamHandler and to a different thread

What changes were proposed in this pull request?

Move code related to execution from being done directly in the GRPC callback in SparkConnextStreamHandler, to it's own classes.
ExecutionHolder (renamed from ExecuteHolder) launches the execution in it's own thread using ExecuteThreadRunner
The execution pushes responses via ExecuteResponseObserver (running in the execution thread)
ExecuteResponseObserver notifies ExecuteGrpcResponseSender (running in the rpc handler thread) to send the responses.
The actual execution code is refactored into SparkConnectPlanExecution

This allows to improve query interruption, by making interrupt method interrupt the execution thread. This makes interrupt work also when no Spark Jobs are running.
The refactoring further opens the possibilities of detaching query execution from a single RPC execution. Right now ExecutionHolder is waiting for the execution thread to finish, and ExecutePlanResponseObserver is forwarding the responses directly to the RPC observer.
In a followup, we can design different modes of execution, e.g.
ExecutePlanResponseObserver buffering the responses. A client which lost connection could then reconnect and ask for the stream to be retransmitted.

ExecutionHolder returning the operationId to the client directly, and then client requesting results in separate RPCs, with more control over the response stream, instead of having it just pushed to it.

Why are the changes needed?

Improve the working of interrupt
Refactoring that opens up possibilities of detaching query execution from a single RPC.

Does this PR introduce any user-facing change?
No
How was this patch tested?
Existing Spark Connect CI covers the execution.

@hvanhovell @grundprinzip @LuciferYang

[info] *** 1 TEST FAILED ***
[error] Failed: Total 3649, Failed 1, Errors 0, Passed 3648, Ignored 10, Canceled 2
[error] Failed tests:
[error] 	org.apache.spark.storage.BlockManagerProactiveReplicationSuite

unrelated flake.
Will wait with retriggering CI for review comments.

Ignore for now - ExecutePlanResponseSender is unfinished, didn't go through nit comments yet.

Resolved conflict.
Previous CI run had 1 flaky test:
2023-07-14T00:42:34.1310770Z [info] *** 1 TEST FAILED ***
2023-07-14T00:42:34.1515215Z [error] Failed: Total 9369, Failed 1, Errors 0, Passed 9368, Ignored 27
2023-07-14T00:42:34.1681702Z [error] Failed tests:
2023-07-14T00:42:34.1682533Z [error] 	org.apache.spark.sql.execution.streaming.MicroBatchExecutionSuite

CI before the lint change was clean except for lint:
https://github.com/juliuszsompolski/apache-spark/actions/runs/5551730507

Thanks! Merged to master.


multiple ctrl service

Codecov Report

Merging #59 (2a96982) into main (a2e747b) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main      #59   +/-   ##
=======================================
  Coverage   22.22%   22.22%
=======================================
  Files          11       11
  Lines         666      666
=======================================
  Hits          148      148
  Misses        502      502
  Partials       16       16

Flag
Coverage Δ

macos-latest
22.22% <ø> (ø)

ubuntu-latest
?

Flags with carried forward coverage won't be shown. Click here to find out more.

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a2e747b...2a96982. Read the comment docs.


Sparrow crashes with GTK error when opening wallet

I'm trying to run Sparrow on Ubuntu but I'm running into an issue when I try to open a wallet. Sparrow crashes with the following error:
(Sparrow:3011905): Gtk-WARNING **: 09:30:06.766: Could not find the icon 'user-home-symbolic-ltr'. The 'hicolor' theme
was not found either, perhaps you need to install it.
You can get a copy from:
        http://icon-theme.freedesktop.org/releases

(Sparrow:3011905): Gtk-WARNING **: 09:30:06.767: Could not load a pixbuf from /org/gtk/libgtk/icons/16x16/status/image-missing.png.
This may indicate that pixbuf loaders or the mime database could not be found.
**
Gtk:ERROR:../../../../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /org/gtk/libgtk/icons/16x16/status/image-missing.png: Unrecognized image file format (gdk-pixbuf-error-quark, 3)
Bail out! Gtk:ERROR:../../../../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /org/gtk/libgtk/icons/16x16/status/image-missing.png: Unrecognized image file format (gdk-pixbuf-error-quark, 3)

It appears this was a result of my Sparrow instance being in a bad state. I deleted my data folder (~/.sparrow) and after starting from scratch it appears to work as expected.

I got a step further after starting from scratch but now it's crashing with the same error when I try to open the import file menu (File > Open Transaction > File).

I don't think this is a Sparrow issue specifically, but you can try the fixes mentioned here: https://bbs.archlinux.org/viewtopic.php?id=223801

I'm closing this off as a GTK-related issue for now.


Need tool to create api blueprint document from comments in multiple files

Hello! I really like api blueprint, but one thing stops me to use it in my projects. Could you please tell if there is a tool to create final api blueprint document from multiple files (from comments within each file)? Like apiDoc (http://apidocjs.com) already did.
Sure I can grep comments from files and concatenate them. But in this case i will need to support files order somehow (0_file1.js, 1_file2.js, etc).

@nbasov there are many, but my favorite is https://github.com/jamesramsay/hercule

@nbasov another good example would be here https://github.com/the-grid/apidocs.
Please check it out and feel free to comment / reopen if needed.


Make agent names case insensitive

Problem
Currently, if you want to provide display data, you have to match the agent name in the data file exactly, including having the proper casing. This is kinda annoying, especially as we move to autoconversion.
Link to ticket
Solution
Made casing for matching agent names for display data case insensitive
Type of change
Please delete options that are not relevant.

New feature (non-breaking change which adds functionality)
This change requires updated or new tests

Change summary:

For relevant trajectory converters, made changed the keys in the display data dict, which represent agent names, lowercase
When comparing those to the agent ids from the file, made sure to cast those to lower case
Adjusted some of the test files to use agent names with different casing in the display data dict

Codecov Report
Base: 91.74% // Head: 91.74% // Increases project coverage by +0.00% :tada:

Coverage data is based on head (b37f6e3) compared to base (d724518).
Patch coverage: 88.88% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #135   +/-   ##
=======================================
  Coverage   91.74%   91.74%
=======================================
  Files          97       97
  Lines        3996     3999    +3
=======================================
+ Hits         3666     3669    +3
  Misses        330      330

Impacted Files
Coverage Δ

simulariumio/readdy/readdy_converter.py
100.00% <ø> (ø)

...riumio/tests/converters/test_cellpack_converter.py
100.00% <ø> (ø)

...ulariumio/tests/converters/test_mcell_converter.py
100.00% <ø> (ø)

simulariumio/tests/converters/test_md_converter.py
100.00% <ø> (ø)

...lariumio/tests/converters/test_readdy_converter.py
100.00% <ø> (ø)

...ariumio/tests/converters/test_smoldyn_converter.py
100.00% <ø> (ø)

simulariumio/md/md_converter.py
95.87% <70.00%> (ø)

simulariumio/cellpack/cellpack_converter.py
83.24% <100.00%> (ø)

simulariumio/cellpack/cellpack_data.py
100.00% <100.00%> (ø)

simulariumio/cytosim/cytosim_converter.py
91.40% <100.00%> (+0.06%)
:arrow_up:

... and 9 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

Couldn't there be an agent type name "A" and "a" in the same trajectory?  Or even "AA" and "Aa" ?

Couldn't there be an agent type name "A" and "a" in the same trajectory? Or even "AA" and "Aa" ?

@toloudis that is a possibility, and basically with this change we're saying if the user provides display data for "aa", we're just going to apply that to all matching agents, regardless of casing. @blairlyons certainly is more familiar than I am, but I think the bad user experience of someone messing up the casing of an agent name during autoconversion and the display data not being applied is pretty significant, and the case of people having agent type names that are only different in casing is pretty rare.


Use defaults from Schema as base for Data Values

@cppforlife — if you get a moment, this is a good spot for review/feedback of all kinds.

@cppforlife — if you get a moment, this is a good spot for review/feedback of all kinds.

In the glossary we define "type checking" but our error messages call it "typechecking". Not directly related to this change set, but wanted to note it somewhere.

Thanks, @StevenLocke — noted in the upcoming story about taking a thorough charge at error messaging. 👍🏼

In the glossary we define "type checking" but our error messages call it "typechecking". Not directly related to this change set, but wanted to note it somewhere.

Thanks, @StevenLocke — noted in the upcoming story about taking a thorough charge at error messaging. 👍🏼


wpsoffice: no steam-run

Description of changes
It seems that wpsoffice now works well without steam-run, which increases the closure size and imcompatibility possibilities. Remove it here.
steam-run is introduced in #126302  to fix #125951, the crash seems not occuring now.
Things done

Built on platform(s)

[x] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

[ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
[ ] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[x] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[x] Tested basic functionality of all binary files (usually in ./result/bin/)
23.05 Release Notes (or backporting 22.11 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module

[x] Fits CONTRIBUTING.md.

libcef.sowill crash if don't use steam-run

The crash was caused by the missing libudev.so in libelf.so, now solved in ef8d71482ed09b4868fd7482feacdc355033910f

The formulas in the document are very strange.

but it can show correctly when using steam-run wps

The formulas in the document are very strange.

Missing runtime dependencies (pango), should fixed in https://github.com/NixOS/nixpkgs/pull/231607


Input formatted to to _astream incorrect

Hi there,
The input I receive into astream:
{'messages': [HumanMessage(content=[{'type': 'text', 'text': "What's in this image?"},
 {'type': 'image_url', 'image_url': {'url': 'data:image/jpeg;base64,/9j/4AAQSkAiIg//2Q=='}}],
  additional_kwargs={}, response_metadata={})]}

(Logged in langchain_core/language_models/chat_models.py/BaseChatModel)
        print(input)
        messages = self._convert_input(input).to_messages()

This leads to the error message
    |   File "/home/retep/.pyenv/versions/3.12.3/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py", line 268, in _convert_input
    |     raise ValueError(
    | ValueError: Invalid input type <class 'dict'>. Must be a PromptValue, str, or list of BaseMessages

The input I expect to receive as input into astream (logged via a direct call to LangChain):
[HumanMessage(content=[{'type': 'text', 'text': "What's in this image?"},
{'type': 'image_url', 'image_url': {'url': 'data:image/jpeg;base64,/9j/4AAQSVQiLoc4iIgIiICIiAiIgIiICIiAiIg//2Q=='}}],
additional_kwargs={}, response_metadata={})]

I call the bridge like so:
client = OpenAI(
    base_url="http://localhost:8000/openai/v1",
    api_key="unused"
)

arg = [
        {
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": "What's in this image?"
                },
                {
                    "type": "image_url",
                    "image_url": {
                        "url": f"data:image/jpeg;base64,{encoded_image}"
                    }
                }
            ]
        }
    ]
thread = client.beta.threads.create(
    messages=arg
)

stream = client.beta.threads.runs.create(
    thread_id=thread.id,
    stream=True,
    model="gpt-4o",
    temperature=0,
    assistant_id="any",
)

for event in stream:
    if event.event == "thread.message.delta":
        print(event.data.delta.content[0].text.value)

Why is the input format different than intended (this messages dict)? How do I fix this?

It looks like this line does this conversion: https://github.com/samuelint/langchain-openai-api-bridge/blob/895614d1242f5acd94764b81829b619d4533f927/langchain_openai_api_bridge/assistant/assistant_run_service.py#L44
Did I implement something wrong on the LangChain model side?

I think it's a bug.
class PerplexityWebUIOpenAICompatibleChatModel(PerplexityWebUIChatModel):
    def astream_events(self, input: Any, config: RunnableConfig | None = None, *, version: Literal['v1', 'v2'],
                             include_names: Sequence[str] | None = None,
                             include_types: Sequence[str] | None = None,
                             include_tags: Sequence[str] | None = None,
                             exclude_names: Sequence[str] | None = None,
                             exclude_types: Sequence[str] | None = None,
                             exclude_tags: Sequence[str] | None = None, **kwargs: Any) -> AsyncIterator[StandardStreamEvent | CustomStreamEvent]:
        if type(input) == dict:
            if 'messages' in input:
                input = input['messages']

        return super().astream_events(input=input, config=config, version=version, include_names=include_names, include_types=include_types, include_tags=include_tags, exclude_names=exclude_names, exclude_types=exclude_types, exclude_tags=exclude_tags, **kwargs)

Is my fix.

Hi @reteps, Thanks for your interest in this library.
It seem that you've fixed the problem by yourself :). I'll close this issue, please re-open if there's anything else.

I think that fix should be upstreamed to this repo @samuelint


Fix typo and formatting in app-bar docs

[x] I have followed (at least) the PR section of the contributing guide.

Thanks.


Passing algorithm specific arguments in getQuery and processAnswer

I ran into a use case today where @sumeetsk was developing an application where he had two different algorithms that needed a different set of parameters for getQuery and processAnswer (some elements common, others not).
To support this, I see three choices:

Enforce that all algs accept arbitrary keyword arguments (through def getQuery(..., **kwargs)). This is the current functionality, and is not preferred (why should an algorithm developer have to modify every other algorithm to get a special argument?)
Modify the wrapper. We can look at the function signature and see what optional arguments the algorithm function can accept and pass in those. This would mean that the app developer would be encouraged to pass in every argument that any algorithm needs (which may be expensive).
Modify myApp.py. We could provide an alg.name to the algorithm developer and they can write an if-statement to see which arguments they want to pass.

Daniel and I discussed this today, and we're not inclined to go with option 2. Our main motive for going with option 3 was that we were doing less and leaving more up to the user -- this provides more flexibility and an explicit explanation of what's going on.

The issue @summetsk is facing has to do with information about the query_uid. In App.py#L150 this is generated after myApp.getQuery for no real reason -- I don't see anything blocking passing the query_uid to myApp.py and editing base.yaml to reflect this.
In general, I still think option 3 is best and I'm sure another use case like Sumeet's will pop up. I still propose adding a name parameter to the alg wrapper we pass to myApp.py.

@sumeetsk's problem is addressed by bd3b1f472e426a46695fca2c3a5f2472e922dd1c


SQLite support

Starting to look into React Native... or even just Electron-esque things.
Work required...

[x] Refactor persistence layer into abstractions (still IDB only)

[x] Refactor metadata persistence
[x] Refactor Metadata class to use persistence layer
[x] Refactor metadata migrations
[x] Refactor queryable persistence
[x] Refactor queries to utilize persistence layer
[x] Refactor queryable migrations

[ ] Implement persistence abstractions in SQLite

[ ] Metadata
[ ] Document indexes
[ ] Files (with, I guess, local filestorage)

Mini-todo: refactor WIP to simplify persistence impl:

[ ] Make WIP change namespace during client init
[ ] Add "copy namespace to namespace" to persistence impls
[ ] Add "list all namespaces" to persistence impls
[ ] Rework WIP to be "copy default_ns to wip_ns, then open wip_ns"
[ ] Rework import to be "load data to temp_ns, then copy to default_ns"

For SQLite import/WIP copy, procedure is roughly...

Open original namespace at version N
Open target namespace at version N (migrate to N if needed)
Copy database file from o->t
Migrate target namespace to version M (if M!=N)


Add a clause field to the query rule

This will let us apply advanced rules based on the result of the database query. Need to make the db result available in args.result. This could will always be an array since the operation used by the query rule will be all

Done


Robbit stops following you once it picks up a drop

How to reproduce it:

Get yourself a robbit and set following true and pickup true.

Walk away bit, it will follow you. Now drop an item (e.g. pickaxe)

The robbit will move to pick it up (pickaxe is in there).

Walk away. Robbit will not follow you even though the following is true. (If you drop another item nearby, it will move slowly towards the item and pick it up).

I went back and disabled pickup. It follows me.

I re-enabled pickup. It moves/teleports back to where it had picked up the drop.

So, I have these issues:

The following+pickup mode only woks if the robbit hasn't picked up any drop. Once it picks up an item I have to disable the pickup if I want it to follow me.
The main problem: the pickup mode is available only where the robbit has last picked up a drop. If I want to use the pickup mode elsewhere, I have to break the robbit's charge pad to clear out the latest pickup point in its memory, otherwise it will attempt to teleport away back to the latest pickup point (except between dimensions).
It seems the issue is per-dimension. Changing dimensions clears the latest pickup point and the  following+pickup mode will work again until the robbit picks up an item, and the issue described above repeats.

Oops! I had set the mutex bits so that the follow and drop pickup AI tasks couldn't run concurrently.  Aside from that, I wasn't discontinuing the pickup task once the Robit actually consumed the item. Thanks for pointing this out, should be fixed!


daemon: fix minimum number of work threads unit test

The test failed with the following output when ran locally:
----------------------------------------------------------------------
FAIL: <autogenerated>:1: DaemonConsulSuite.TestMinimumWorkerThreadsIsSet

daemon_test.go:181:
    c.Assert(numWorkerThreads() >= 4, Equals, true)
... obtained bool = false
... expected bool = true

Fixes: 25f898609888 ("daemon: change minimal worker thread to 2")
Signed-off-by: Ian Vernon<EMAIL_ADDRESS>

This change is

test-me-please

Bizarre CI failure:
03:53:01 sh: echo: I/O error
03:53:02 # github.com/cilium/cilium/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1
03:53:02 compile: writing output: write $WORK/b202/_pkg_.a: no space left on device
03:53:02 go build github.com/cilium/cilium/vendor/k8s.io/api/policy/v1beta1: mkdir /tmp/go-build171083671/b264/: no space left on device
03:53:02 go build github.com/cilium/cilium/vendor/k8s.io/api/settings/v1alpha1: mkdir /tmp/go-build171083671/b269/: no space left on device
03:53:02 # github.com/cilium/cilium/vendor/k8s.io/api/autoscaling/v2beta1
03:53:02 compile: writing output: write $WORK/b256/_pkg_.a: no space left on device

Link: https://jenkins.cilium.io/job/Cilium-PR-Ginkgo-Tests-Validated/4533/

test-me-please

test-me-please

test-me-please


AzureResourceGroupDeploymentV2 - Escaping [ results in [[ after deployment.

Note
Deploying an ARM template using this extension gives a different result than deploying the ARM template using Powershell or Azure Portal.
Using this task, when I am deploying a parameter of type string with the following value [[someValue],  the value is deployed as [[someValue], however, if I use the same ARM template in Powershell or Azure Portal, the result is deployed as [someValue] (the ARM escape character is honored).
I think there's an issue in the extension when deploying values that are escaping the [ character for ARM expressions.
Required Information
Entering this information will route you directly to the right team and expedite traction.
Question, Bug, or Feature?
Type: Bug
Enter Task Name: AzureResourceGroupDeploymentV2
list here (V# not needed):
https://github.com/microsoft/azure-pipelines-tasks/blob/master/Tasks/AzureResourceGroupDeploymentV2/README.md
Environment

Server - Azure Pipelines

Account: ceespino
Project: ceespino-ms
Release definition name: Release to ceespino-CICD-Target
Issue Description
Deploying an ARM template using this extension gives a different result than deploying the ARM template using Powershell or Azure Portal.
Using this task, when I am deploying a parameter of type string with the following value [[someValue],  the value is deployed as [[someValue], however, if I use the same ARM template in Powershell or Azure Portal, the result is deployed as [someValue] (the ARM escape character is honored).
I think there's an issue in the extension when deploying values that are escaping the [ character for ARM expressions.
Task logs
[Enable debug logging and please provide the zip file containing all the logs for a speedy resolution]
Troubleshooting
Checkout how to troubleshoot failures and collect debug logs: https://docs.microsoft.com/en-us/vsts/build-release/actions/troubleshooting
Error logs
There's no error message since deployment succeeds, the problem is that the template deployment gives a different result than if deployed through PS or Azure portal.
Attached template to repro the problem.
ArmTemplate_BugRepro.txt

Hi @Ceespino , I was not able to repro this issue. I deployed the same template you attached, through the AzureResourceGroupDeploymentV2 task, and a trigger parameter with value [someValue] was created. Can you check once again that the values in your template are correct?

@tejasd1990
I just deployed the ARM template again using the task and still getting the parameter value with [[someValue].

Could you please walk me through how are you trying to repro the problem?
I basically have the task pointing to the ARM template file in a repo, then just deploying it to a data factory.

Hi @Ceespino ,
I deployed the template containing
"ScheduleTrigger_properties_waitPipeline2_parameters_pipelineParam": {
    "defaultValue": "[[someValue]",
    "type": "String"
},

After deployment, on the data factory resource,
Overview -> Author & Monitor.
This navigates to the data factory page. Inside the data factory,
Author -> Factory Resources -> Pipelines -> Select the pipeline -> Triggers -> Select the trigger -> Parameters -> pipelineParam
The value of the parameter is [someValue]

@tejasd1990
Is it possible that you are overriding the parameter during deployment in the ADO task? I still can deploy the attached ARM template and get the double [[. I can repro this consistently with the ADO task. It works fine with PS or Azure Portal.

@Ceespino , no the parameters are not getting overridden. Can you share the complete debug logs of the task(even if they are succeeding)?

As discussed offline, this is expected, and explained here. The defaultValue of a parameter in the template file will get escaped, but parameter values passed through command line, or through parameters file will not.
Closing this issue.

Guys this is still an issue. I'm the one who first reported it and have encountered it by embedding a JSON map within a JSON Object parameter on the trigger. To reproduce the issue simply configure a trigger with a JSON object parameter and then publish it in your GIT enabled ADF instance. You'll immediately see that the JSON template value in the adf_publish branch will now contain an extra [ bracket that then causes a failure when the value is actually used as a map in a copy activity.
Support.Example.json.zip

I also looked at your link and it does not address this issue. The data becomes corrupted by the publish task which then causes a copy activity to fail as the extra [[ is not removed from the execution payload when the trigger fires.
If you were to edit the trigger manually with the raw value and publish it using a non-git enabled ADF instance it does not add the extra square bracket, this happens with the transition to the adf_publish branch.


feat(kernel): popcount and clz

Codecov Report

Merging #76 into master will increase coverage by <.01%.
The diff coverage is 0%.

@@             Coverage Diff              @@
##             master      #76      +/-   ##
============================================
+ Coverage     46.93%   46.93%   +<.01%
  Complexity      849      849
============================================
  Files            57       57
  Lines          9386     9390       +4
  Branches       1527     1527
============================================
+ Hits           4405     4407       +2
- Misses         4538     4540       +2
  Partials        443      443

@shabanovd I just released 1.5.0 of aparapi that includes this feature. Thank you.


fix: import the type InjectionKey from vue3 in jsdoc

Fix: https://github.com/casdoor/casdoor-vue-sdk/issues/18

@leo220yuyaodog @jakiuncle plz review

Can you provider a release package for us to test? Now the sdk works well, after modifing, I can not confirm if it will work well.

Can you provider a release package for us to test? Now the sdk works well, after modifing, I can not confirm if it will work well.

Hello, here is the release package of this PR:
https://www.mediafire.com/file/628qe758scpv3dz/casdoor-vue-sdk-1.2.0.tgz/file

In a vue project,it is no problem

Can you provider a release package for us to test? Now the sdk works well, after modifing, I can not confirm if it will work well.

I have tested this PR with vue+ts and vue+js projects and pack these here:
https://www.mediafire.com/file/me15fir460qjxkl/example.tar.gz/file

Ok,  I test fine too.


Slow SSL handshake after jailbreak, what's the reason?

Describe the bug
when i jailbreak my ip7 on ios12, I found that my app's https api was load very slow (mostly over 1 second,even 3 seconds).
I try to reboot my device to unjailbreak state, but the issue still appear...
I try to uninstall all installed tweaks, but the issue still appear...
I try to reset and wipe device, the issue is disappear
when i rejailbreak again,the issue is back again.
i use tcpdump to capture 443 port packages at server, the packages log shows slowing is after server hello done , client key exchange laged, always so.
i can't fix this issue by server config, i even didn't know what cause it, maybe by some kernal plugin bug.
test url:
https://m.edaidao.com/
it appeared obviously when use AFNetworking(Implemented by Apple's NSURLSession) send request.
but in safari, it's almost normal
To Reproduce
Steps to reproduce the behavior:
Use AFNetworking to send https request
Screenshots

Device (please complete the following information):

iOS Version: IOS 12
iOS Device: iPhone7
unc0ver Version: b38

Place an "x" between the brackets if true:

[x ] this is a bug others will be able to reproduce
[ x] this issue is present with all tweaks uninstalled(except for default packages) or disabled
[ ] this issue is present after a rootfs restore
[x ] this issue is present on the latest version of unc0ver

Logs
If applicable, add logs or error messages here.

I also test it on a iphone5s with ios12.1.1 beta3 , this issue appears again...
Im sure it's related to jailbreak，In a pure unjaibreaked device it's ok
maybe also related to ssl certificate chain compatibility, but it's appear  after jailbreak

this issue disappeared in  unc0ver b46


Connections are dropped, even if peers are added to reserved nodes.

Issue: Connections are dropped, even if peers are added to reserved nodes.
Context: we are AlephZero and develop a substrate node with our custom finality gadget AlephBFT. We run at low block-time (1sec) and with AURA. Otherwise our spec is pretty standard. We currently depend on the polkadot-v0.9.13 branch.
We wrote our own layer of network on top of substrate network to ensure direct connection between validators. Our network has two protocols/peersets: Generic and Validator. First one allows communication and gossip between every two nodes (no matter what is their role). If they authenticate themselves in Generic protocol as validators for some session, they are added to Validator peerset as reserved nodes.
Recently, during tests of connecting 104 nodes (100 non-validators and 4 validators) we discovered that even if we always connect every possible peer as reserved, some of them cannot keep the connections. On the other hand, syncing blocks works so it shows that the default substrate protocol works.
I'm attaching 2 grep's of validator logs (Grep for every other peer is either healthy or looks exactly like one of those below):

non-validator with broken connections
other validator

Logs for 1 show that we are trying to connect such nodes around ~50 times. Logs for 2 are the weird ones, looks like we connected to some peers, only to disconnect and never retry. Those conclusions are based on lines from the “sub-libp2p” target.
Since validators cannot connect to each other in Generic peerset, they are never connecting to Validator peerset, which results in finalization not starting at all.
When we discovered this issue, we tried to change our logic a bit. We stopped adding every node as reserved to Generic and started to do this only for nodes that will manage to authenticate themselves as validators (if so, we add them as reserved to both peersets). But the problem escalated: in this version no one can send any message to anyone, since every call to sc_network::service::network.notification_sender(peer, protocol) for any peer and any protocol results in error.

Are there any restrictions on the number of reserved peers or conditions for adding them?
What could be the reason why our protocol doesn’t receive messages but the default network does, i.e. blocks are syncing?
Is it possible to create a notification_sender for a not reserved peer?

CC @tomaka

As soon as we get Event::SyncConnected we are adding a peer to reserved. Is it possible that, if one node will do it faster than the other, the connection want be established?

It turned out our problems were mostly caused by running on too weak machines. We are still unsure about some of the network abstractions, but this specific issue can be considered fixed.


CB-10485 Switch Gateway role to leader instance group in DDE templates.

See detailed description in the commit message.

retest this please

retest this please

Rather put this fix to master.

Rather put this fix to master.


Why basic types cannot be casted in return, while composite types can be?

Here is an example demonstrating the question:
package main

import (
	"fmt"
)

type Float float64
func convert(f Float) float64 {
	return f // ERROR: cannot use f (type Float) as type float64 in return
}

type FloatSlice []float64
func convertSlice(f FloatSlice) []float64 {
	return f // no error
}

func main() {
	fmt.Println("Hello, playground")
}

For your convenience you can find it here: https://play.golang.org/p/4WLrsYPo31L
Could anyone please point me to the language specification, where it defines (and maybe even explains) the compiler behavior in this case?
Thank you.
P.S. If there is no spec on that, what is at least the reason for this behavior?

Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.
For questions please refer to https://github.com/golang/go/wiki/Questions

Float, and float64 are named types, Go will not automatically convert from one named type to another, however it will convert from an anonymous type []float64 to a named type FloatSlice


Any examples on how to write custom key value to .git/config?

I'm having a hard time using this library to replicate this command:
git config branch.issues/404-is-this-working.customkey customvalue

Is the above possible?

You'll need to use something like repo.Config.Raw.SetOption(...), see https://godoc.org/gopkg.in/src-d/go-git.v4/plumbing/format/config#Config.SetOption


Debian Package

I've been using this package for a while now. I would like to package this project for Debian. Hope that's okay with the author. @snobb

Thanks, I am glad it’s been useful.
As long as I am mentioned as author, I do not mind at all.

Actually thinking more about it, adding runtime range check will significantly increase the complexity of the tool. There are similar tools (eg. xbacklight) that already do that. The purpose of this tool was to be simpler an so it will remain.
So you have my permission, but frankly I don't see how it would be practical to package it in xbright's present form.

This tool was inspired by suckless project where every project is configured via C source code and thus requires recompiling for reconfigure. Difficult as it sounds it really saves a lot of complexity and in this case it only needs to be done once.

I love suckless too. The reason I started using this was because it was easier and more minimal than xblacklight in my opinion. I'd like it to remain that way.

Maybe once you or someone else figure out a way to make this work everywhere. I'll package it.

what is the license this program?

what is the license this program?

It's MIT. I've just updated the repo to reflect that.

It's MIT. I've just updated the repo to reflect that.


Remove an Element from a Max Heap

Affected page

https://www.freecodecamp.org/learn/coding-interview-prep/data-structures/remove-an-element-from-a-max-heap
Your code

var MaxHeap = function() {
  this.heap = [null];
  this.insert = (ele) => {
    var index = this.heap.length;
    var arr = [...this.heap];
    arr.push(ele);
    while (ele > arr[Math.floor(index / 2)] && index > 1) {
      arr[index] = arr[Math.floor(index / 2)];
      arr[Math.floor(index / 2)] = ele;
      index = arr[Math.floor(index / 2)];
    }
    this.heap = arr;
  }
  this.print = () => {
    return this.heap.slice(1);
  }
  // Only change code below this line

  // Only change code above this line
};

Expected behavior

insert method to add according to maxheap rules
Screenshots

System

Device: laptop [e.g. iPhone6, Laptop]
OS: Windows 10[e.g. iOS 14, Windows 10, Ubuntu 20.4]
Browser: chrome [e.g. chrome, safari]
Version: [e.g. 22]

Additional context

change line 10
index = arr[Math.floor(index / 2)];
to
index = Math.floor(index / 2);

I believe you are correct there's something wonky with the code. This may apply to two other challenges involving heap as well. I'm not entirely sure just changing the line 10 is enough to make it behave as it should.

Is this still an issue??
I'm new to this community  and I'm still looking for my first contribution.

Hey @anshul2807
It is, issues labelled with help wanted or first timers only are open for contributions.
Please make sure you read our guidelines for contributing. Join us in our chat room or the forum if you need help contributing, our moderators will guide you through this.

ators will guide you through thi

Great...Now I can start working on this issue.

Code is running fine..
Can anybody tell me what's the issue..??
Here's the code --
var MaxHeap = function() {
  this.heap = [null];
  this.insert = (ele) => {
    var index = this.heap.length;
    var arr = [...this.heap];
    arr.push(ele);
    while (ele > arr[Math.floor(index / 2)] && index > 1) {
      arr[index] = arr[Math.floor(index / 2)];
      arr[Math.floor(index / 2)] = ele;
      index = arr[Math.floor(index / 2)];
    }
    this.heap = arr;
  }
  this.print = () => {
    return this.heap.slice(1);
  }
  // Only change code below this line
  this.remove = () => {
    this.heap = [...this.heap];
    let max = this.heap[1];
    let last = this.heap.pop();
    this.heap[1] = last;
    this.heapify(1);
    return max;
  }

  this.heapify = (i) => {
    let large = i;
    let l = 2 * i + 0;
    let r = 2 * i + 1;
    let length = this.heap.length;
    if (l < length && this.heap[l] > this.heap[large]) {
      large = l;
    }

    if (r < length && this.heap[r] > this.heap[large]) {
      large = r;
    }

    if (large != i) {
      let temp = this.heap[i];
      this.heap[i] = this.heap[large];
      this.heap[large] = temp;
      this.heapify(large);
    }
  }

};

Max Heap is supposed to keep the greatest value at the start of array (here that's index 1). However that's not happening in this version. For example:
const h = new MaxHeap();
h.insert(15);
h.insert(11);
h.insert(30);
h.insert(50);
h.insert(25);
h.insert(100);

console.log(h.heap) // [ null, 30, 50, 100, 11, 25, 15 ]

Max Heap is supposed to keep the greatest value at the start of array (here that's index 1). However that's not happening in this version. For example:
const h = new MaxHeap();
h.insert(15);
h.insert(11);
h.insert(30);
h.insert(50);
h.insert(25);
h.insert(100);

console.log(h.heap) // [ null, 30, 50, 100, 11, 25, 15 ]

OK I Understand...Now It's working Corectly...kindly See my code
class MaxHeap{
constructor(){
        // this is where the array that represents our heap will be stored
        this.values = [];
    }
      parent(index) {
          return Math.floor((index - 1) / 2);
      }

      // index of the left child node
      leftChild(index) {
          return (index * 2) + 1;
      }

      // index of the right child node
      rightChild(index) {
          return (index * 2) + 2;
      }
      isLeaf(index) {
        return (
            index >= Math.floor(this.values.length / 2) && index <= this.values.length - 1
        )
    }
  add(element) {
    // add element to the end of the heap
    this.values.push(element);
    // move element up until it's in the correct position
    this.heapifyUp(this.values.length - 1);
}
  heapifyUp = (index)=> {
    let currentIndex = index,
        parentIndex = this.parent(currentIndex);
    while (currentIndex > 0 && this.values[currentIndex] > this.values[parentIndex]) {
        this.swap(currentIndex, parentIndex);
        currentIndex = parentIndex;
        parentIndex = this.parent(parentIndex);
    }
}
swap  = (index1, index2)=> {
    [this.values[index1], this.values[index2]] = [this.values[index2], this.values[index1]];
}
  print = () => {
    return this.heap.slice(1);
  }
  // Only change code below this line

  // Only change code above this line
};
const h = new MaxHeap();
h.add(15);
h.add(5);
h.add(25);
h.add(35);
h.add(65);

console.log(h.values) // [ null, 30, 50, 100, 11, 25, 15 ]


Run tests using network-transport-inmemory

This patch provides an ability to test distributed-process using inmemory backend, this could reduce a change of network failures because of problem in n-t implementation.

According to semantics network failures is guaranteed to be
noticed by network-transport iff communication happened after
connection failure.

Is this documented? I don't remember anything of the sort.

We don't have any documentation for n-t semantics, this may be a good time to create that.
But this assumption us the only sane one.

Shouldn't we have tests built and run with both inmemory and TCP for now?

I think the idea was to make CI reliable, with tcp implementation 1 of 4 version fails, because of internal races (or possibly not well written test). I thinks I can leave 2 options, but disable tcp by default until it will not work reliably. Does that make sense?

In that case, perhaps it is better to have the tests fail until the problems are fixed.
Wouldn't disabling tcp tests give a false sense of reliability.

I think we should use inmemory by default, and have CI test both inmemory and tcp.

There is no semantics to refer to in this case. So we shouldn't be citing any.

This patch depend on https://github.com/haskell-distributed/distributed-process/pull/246

Only TestCHInTCP uses TCP? What about TestStats, TestMx, etc?

Those tests do not depend on network-backend implementation, I see to reason in testing them on multiple backends. Correct me if I'm wrong.

Alright. I'm not familiar with those. I gave them a look and testing with inmemory looks ok for now. This could change, say, if we ever find that the things they test don't work with tcp.

Addressed all comments, could merge?

threadDelay is so evil. Because it doesn't guarantee the absence of races. And slows tests down. Can we avoid this?

Yes we could  there are 2 approaches here:

use node monitoring, and run registerRemoteAsync after we have seen
that connection failed.

use loop in registerRemoteAsync operation

ref <- registerRemoteAsync
let loop = do mx <-  receiveTimeout n  [...]
                     maybe loop (return x) mx
loop

should I do that? This is needed because handling connection failure on d-p layer is an asynchronous operation.

Addressed all comments.

:+1:


fixup! refactor(cli): build command

I'm in favor of keeping using class methods for consistency between calls to sdkRun.

So you can remove the async and make it static


Point overrides edges at the proper abs nodes when aliasing is on [phab:D1882]

Created by zarko at 2017-08-16 19:52:27:

shahms accepted this revision at 2017-08-16 19:56:43

zarko closed via commit 0e4feff72320977364e6b88d07387a0f39084090 at 2017-08-16 19:57:45


Need a better icon for the desktop app

Currently it is this.

On Mac we do have an icon, but I think it's a bit too big so could be slightly improved. Can anyone check Linux?

Alright I have placed Icons in the design system ben. I checked on Google and what it said that for Taskbar where the icon appears on the desktop can go around to 16 pixels. So I have placed that size as well. We have variations of sizes.
https://www.figma.com/design/m5eMFTKD391AiJAXaEzgxB/Bitcoin-Keeper?node-id=0-1&t=SNAhVoz0yQC3V6l5-1

@ASN-BitHyve can you please check if this release resolves the issue?
https://github.com/bithyve/keeper-desktop/releases/tag/keeper-desktop-v0.1.0-dev

It does :thumbsup:


AlphaZero pseudo code available?

I know this isn't directly applicable to Open Spiel, so please just close the issue if it's an inappropriate ask, but I'm very curious to see the pseudo code mentioned in the AlphaZero Science paper. At the end of the paper is this information:

Data and materials availability
A full description of the algorithm in pseudocode as well as additional games between Alp-
haZero and other programs are available in the Supplementary Materials.
Supplementary Materials

110 chess games between AlphaZero and Stockfish 8 from the initial board position.
100 chess games between AlphaZero and Stockfish 8 from 2016 TCEC start positions.
100 shogi games between AlphaZero and Elmo from the initial board position.
Pseudocode description of the AlphaZero algorithm.
Data for Figures 1 and 3 in JSON format.
Supplementary Figures S1, S2, S3, S4 and Supplementary Tables S1, S2, S3, S4, S5, S6,
S7, S8, S9.
References (33-50)

The blog post about the paper (https://deepmind.google/discover/blog/alphazero-shedding-new-light-on-chess-shogi-and-go/) has a link labeled "Download 210 AlphaZero-Stockfish chess games and 100 AlphaZero-Elmo shogi games", but it's a dead link. Obviously, there's working code in this project! But I would still like to read the original pseudo code from the paper if possible.
Thanks!

Hi @tacertain,
No problem asking that here.
That pseudo-code is part of the supplementary materials of the Science paper, so you need access to the paper itself. It's not something that is widely accessible without a subscription to the journal, but you might have access if you have a University affiliation. If not, you can also buy a single issue for $15 which isn't too bad.
On the dead link to the games, my guess is the URL format is old and stopped working once the DeepMind and Google Brain merged into Google DeepMind last year (our web site structure changed at that point). I can check with some of my colleagues to see if it's still accessible somewhere and whether we can fix the link but might be better to do that by email. Reach out to me and we'll go from there.

Hi @lanctot. Thanks so much for the response. I only tried the link I noted because the target was to https://deepmind.com/research/open-source/alphazero-resources and it seemed like it might be a resource with all the supplemental materials (the other links to games are to zip files). I'm not really interested in the games, so don't go poking around on my behalf. I'll see about getting access to the science paper.
Thanks for the quick response!


Ocelot doens't work with Consul

Hello,
ocelot configuration,json:
{
"ReRoutes": [
{
"DownstreamPathTemplate": "/api/home",
"UpstreamPathTemplate": "/home",
"UpstreamHttpMethod": [ "Get", "Options" ],
"ServiceName": "web",
"LoadBalancer": "LeastConnection"
}
],
"GlobalConfiguration": {
"RequestIdKey": "OcRequestId",
"ServiceDiscoveryProvider": {
"Provider": "Consul",
"Host": "localhost",
"Port": 8500
}
}
}
consul k/v:
{"ReRoutes":[{"DownstreamPathTemplate":"/api/home","UpstreamPathTemplate":"/home","UpstreamHttpMethod":["Get","Options"],"AddHeadersToRequest":{},"AddClaimsToRequest":{},"RouteClaimsRequirement":{},"AddQueriesToRequest":{},"RequestIdKey":null,"FileCacheOptions":{"TtlSeconds":0,"Region":null},"ReRouteIsCaseSensitive":false,"ServiceName":"web","DownstreamScheme":null,"DownstreamHost":null,"DownstreamPort":0,"QoSOptions":{"ExceptionsAllowedBeforeBreaking":0,"DurationOfBreak":0,"TimeoutValue":0},"LoadBalancer":"LeastConnection","RateLimitOptions":{"ClientWhitelist":[],"EnableRateLimiting":false,"Period":null,"PeriodTimespan":0.0,"Limit":0},"AuthenticationOptions":{"AuthenticationProviderKey":null,"AllowedScopes":[]},"HttpHandlerOptions":{"AllowAutoRedirect":true,"UseCookieContainer":true},"UseServiceDiscovery":false}],"GlobalConfiguration":{"RequestIdKey":"OcRequestId","ServiceDiscoveryProvider":{"Host":"localhost","Port":8500},"AdministrationPath":null,"RateLimitOptions":{"ClientIdHeader":"ClientId","QuotaExceededMessage":null,"RateLimitCounterPrefix":"ocelot","DisableRateLimitHeaders":false,"HttpStatusCode":429}}}
http://localhost:8500/v1/health/service/web
"Service": {
"ID": "web_90_0_2_224_8080",
"Service": "web",
"Tags": [
"version-v1"
],
"Address": "localhost",
"Port": 8080,
"EnableTagOverride": false,
"CreateIndex": 20,
"ModifyIndex": 20
},
startup:
var builder = new Microsoft.Extensions.Configuration.ConfigurationBuilder();
builder.SetBasePath(env.ContentRootPath)
//add configuration.json
.AddJsonFile("configuration.json", optional: false, reloadOnChange: true)
.AddEnvironmentVariables();
        Configuration = builder.Build();

Action settings = (x) =>
{
x.WithMicrosoftLogging(log =>
{
log.AddConsole((Microsoft.Extensions.Logging.LogLevel) LogLevel.Debug);
            }).WithDictionaryHandle();
        };
        services
            .AddOcelot(Configuration)
            .AddStoreOcelotConfigurationInConsul()
            .AddCacheManager(settings);

When I access the url localhost:9000/home I have 404 error. What am I doing wrong?

@DiegoTondim sorry I cannot see anything from those logs. It looks like you might be using a version of Ocelot that had broken logging? What version are you using? Try Install-Package Ocelot -Version 2.0.11	if you are not using this version already.

@DiegoTondim also i have written a test that shows you how everything should be set up here https://github.com/TomPallister/Ocelot/blob/develop/test/Ocelot.AcceptanceTests/ServiceDiscoveryTests.cs
The test is called should_handle_request_to_consul_for_downstream_service_and_make_request
That might help!

Hello @TomPallister ,
I found the error, I configured the startup of application with example of asp net core version 1.0, but I'm using the asp net core 2.0. So, I changed the startup class and all works.
Thank you so much for attention.

@DiegoTondim awesome good stuff :)


Update golangci-lint

We can't update prow to 1.18 because golangci-lint is in an old version and can't recognize the newer format of some modules:
https://github.com/openshift/release/pull/34809
https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/openshift_release/34809/rehearse-34809-pull-ci-netobserv-goflow2-kube-enricher-main-lint/1603049581493358592
We need first to update golangci-lint here and in release-4.12 to unlock the situation

Merged without passing tests because there is a deadlock: Prow needs to be updated to Go 1.18 but can't be updated if we don't fix linting here.


Namespacing - certain elements (e.g. HTML/BODY) shouldn't be prefixed

When namespacing the Bootstrap framework with ouice, the Grunt tasks currently build the Bootstrap LESS files, and then import the resulting css file (as LESS) into the ouice namespace.
This prefixes all styles, including html, body etc - which causes a problem as these elements can never appear inside an element with the class ouice.

Suggested solution at present is to manually review all styling applied to html and body throughout the Bootstrap framework, and duplicate these styles inside a separate LESS file that is imported into ouice.less outside of the ouice namespace.


Status condition labels

Status / condition icons for policies: resolves https://github.com/Kuadrant/console-plugin/issues/72

TODO:

[x] Fix: show for gateways/routes as well, which should show more generic labels.

@david-martin would appreciate your 👀

@R-Lawton fyi - you might take a look?

Rebased

/lgtm


Smartystreets exploration

Benefit
Understanding of the capabilities of Smartystreets, who is using it in state government, what for and why it is being used, and how it compares and contrasts to the UGRC geocoding API.
Acceptance Criteria

[ ] Get a Smartystreets license from DTS
[ ] Explore its capabilities and compare to UGRC geocoder
[ ] Find out what agencies use Smartystreets
[ ] Connect with some of them to understand their use case, the results they're receiving from the Smartystreets API, and how they are using the data

Notes
No response
Risks

Time
Communication from Smartystreets users in state government

Issue Reference
refs #

I provided an API key last quarter so the first box can be checked.


Nd4j.diag() regression

Issue Description
the diag function was broken in commit that was part of #2641
Please describe your issue, along with:

expected behavior
When passing a matrix to diag, a vector is returned
encountered behavior
A HUGE matrix is returned

Version Information
Please indicate relevant versions, including, if relevant:

Nd4j 1.0.0-beta

diag function no longer checks if input is a vector or a matrix. Native op is directly called and [n,m] matrices are treated as [nm] vector which produces a [nm, nm] matrix.
The error was introduced in https://github.com/deeplearning4j/nd4j/commit/206199b295c1adfbd72388abdd0405f6f7c9b5c8#diff-329bd29dd155454c7a45684179eacdffL2824
NB. the old implementation does not seem correct for matrices if k != 0

This issue was moved to deeplearning4j/deeplearning4j#5482

Please use https://github.com/deeplearning4j/deeplearning4j for all issues from now on.
We've migrated to a mono-repository layout for our projects, and this repo will be locked soon.


Compile fails with SQL header

After changing the include directive from #include "feather.h" to #include "cinatra/include/cinatra.hpp", I am able to compile the example from the README with:
g++ -std=c++17 hello.cpp -pthread -lstdc++fs -luuid -lboost_system -o hello
I then tried returning the include directive to #include "feather.h" and using the following command:
g++ -std=c++17 $(mysql_config --cflags) $(mysql_config --libs) -pthread hello.cpp -lstdc++fs -luuid -lboost_system -o hello
On my system, $(mysql_config --cflags) returns -I/usr/include/mariadb -I/usr/include/mariadb/mysql and $(mysql_config --libs) returns -L/usr/lib/arm-linux-gnueabihf/ -lmariadb.
This, however, produces the following errors:
In file included from feather.h:10,
                 from hello.cpp:2:
ormpp/mysql.hpp:499:45: error: ‘MYSQL_BIND’ was not declared in this scope
   constexpr void set_param_bind(std::vector<MYSQL_BIND>& param_binds, T&& value) {
                                             ^~~~~~~~~~
ormpp/mysql.hpp:499:45: note: suggested alternative: ‘MSG_FIN’
   constexpr void set_param_bind(std::vector<MYSQL_BIND>& param_binds, T&& value) {
                                             ^~~~~~~~~~
                                             MSG_FIN
ormpp/mysql.hpp:499:55: error: template argument 1 is invalid
   constexpr void set_param_bind(std::vector<MYSQL_BIND>& param_binds, T&& value) {
                                                       ^
ormpp/mysql.hpp:499:55: error: template argument 2 is invalid
ormpp/mysql.hpp:553:29: error: expected ‘)’ before ‘*’ token
    guard_statment(MYSQL_STMT* stmt) :stmt_(stmt) {}
                  ~          ^
                             )
ormpp/mysql.hpp:554:4: error: ‘MYSQL_STMT’ does not name a type; did you mean ‘SOL_ATM’?
    MYSQL_STMT* stmt_ = nullptr;
    ^~~~~~~~~~
    SOL_ATM
ormpp/mysql.hpp:625:3: error: ‘MYSQL’ does not name a type
   MYSQL * con_ = nullptr;
...

What exactly am I doing wrong?
System:
uname     : Linux pi 5.4.51-v7+ #1327 SMP Thu Jul 23 10:58:46 BST 2020 armv7l GNU/Linux
g++       : gcc version 8.3.0 (Raspbian 8.3.0-6+rpi1)
Installed : mariadb-server-10.0, libmariadb-dev, default-libmysqlclient-dev, libmysqlcppconn-dev

you need include mysql connector,  'MYSQL' is from mysql connector.


CONNECTION REFUSED error when exposed label studio with ngrok

Hi all,
When start label studio and use ngrok to expose to public url. Sometime I received this notification. How can I fix this?
Thanks all
Screenshots

Environment (please complete the following information):

OS: Ubuntu 22.04 LTS
Label Studio Version: 1.8.0

I think this bug happened due to Chromium. :)


Update authentication_guide.md

Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Codecov Report

Merging #723 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #723   +/-   ##
=======================================
  Coverage   87.03%   87.03%
=======================================
  Files          74       74
  Lines        3495     3495
  Branches      668      668
=======================================
  Hits         3042     3042
  Misses        436      436
  Partials       17       17

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6916562...7456436. Read the comment docs.


Fix the location manager being nil after Swiftui view update.

Issue/Motivation
Fixed the location manager being nil after Swiftui view update.
Tasklist

[ ] Include tests (if applicable) and examples (new or edits)
[ ] If there are any visual changes as a result, include before/after screenshots and/or videos
[x] Add #fixes with the issue number that this PR addresses
[x] Update any documentation for affected APIs
[x] Update the CHANGELOG

This looks fine to me 👍


Error running two gulp processes simultaneously

I have two websites using gulp and gulp-ruby-sass which i need to run at the same time.
The other weird thing is that the error(s) don't persist when I run the second project again.
And to top things off: The errors it gives me always changes.
Sometimes is:
events.js:74
    throw TypeError('Uncaught, unspecified "error" event.');
          ^
TypeError: Uncaught, unspecified "error" event.

Sometimes is:
context.source = oldState.source;
TypeError: Cannot read property 'source' of undefined
    at tokenize (/Users/juanpa/Documents/[...]/node_modules/gulp-minify-css/node_modules/clean-css/lib/selectors/tokenizer.js:191:34)

Sometimes this other (where "streamline" is actually a .scss from the first project I run):
events.js:72
    throw er; // Unhandled 'error' event
          ^
Error: Broken @import declaration of "streamline"

This is the sass task of the first project
gulp.task('sass', function () {
gulp.src(paths.sass)
  .pipe(plumber({
    errorHandler: onError
  }))
  .pipe(rubySass({
    lineNumbers: true,
    bundleExec: false
  }))
  .pipe(header(banner, { pkg: pkg }))
  .pipe(size({title: 'main.css'}))
  .pipe(gulp.dest('../public/css/'))
  .pipe(rename('main.min.css'))
  .pipe(minifyCSS())
  .pipe(size({title: 'main.min.css'}))
  .pipe(gulp.dest('../public/css/'))
  .pipe(connect.reload())
});

And this is the gulp task of the second project
gulp.task('sass', function () {
  return sass(paths.sass, {
    lineNumbers: true,
    bundleExec: false
  })
  .pipe(gulp.dest('css/'))
  .pipe(rename('main.min.css'))
  .pipe(minifyCSS())
  .pipe(gulp.dest('css/'))
  .pipe(connect.reload())
});

I am not absolutely sure this is an specific gulp-ruby-sass issue but most of the errors point to that direction

Can you try the 2.x branch ?
It's a complete rewrite and should contain a libsass version that brings it to parity with ruby sass (afaik) which might make your use of ruby sass obsolete as well

I actually downgraded to ~0.7.1  and it seems to be responding. The npm install had this version set in the package.json ^1.0.0-alpha.3