text:
No notifications for FOLDING subscription in analysis server

I've added FOLDING to my subscriptions, but I don't seem to get any notifications with the folding data:
[10:23:43]: Spawning /Users/dantup/Dev/dart-sdk/dart-2.0.0-dev.40.0/bin/dart with args ["/Users/dantup/Dev/dart-sdk/dart-2.0.0-dev.40.0/bin/snapshots/analysis_server.dart.snapshot","--client-id=Dart-Code.dart-code","--client-version=2.13.0-dev"]
[10:23:44]: <== {"event":"server.connected","params":{"version":"1.20.0","pid":9717,"sessionId":""}}
[10:23:44]: ==> {"id":"12","method":"analysis.setAnalysisRoots","params":{"excluded":[],"included":["/Users/dantup/Desktop/Dart Sample"]}}
[10:23:44]: ==> {"id":"13","method":"analysis.updateContent","params":{"files":{"/Users/dantup/Desktop/Dart Sample/bin/folding_test.dart":{"edits":[{"offset":0,"length":0,"replacement":"","id":""}],"type":"change"}}}}
[10:23:44]: ==> {"id":"14","method":"analysis.setPriorityFiles","params":{"files":["/Users/dantup/Desktop/Dart Sample/bin/folding_test.dart"]}}
[10:23:44]: ==>
  {
    "id": "15",
    "method": "analysis.setSubscriptions",
    "params": {
      "subscriptions": {
        "CLOSING_LABELS": [
          "/Users/dantup/Desktop/Dart Sample/bin/folding_test.dart"
        ],
        "FOLDING": [
          "/Users/dantup/Desktop/Dart Sample/bin/folding_test.dart"
        ],
        "OCCURRENCES": [
          "/Users/dantup/Desktop/Dart Sample/bin/folding_test.dart"
        ],
        "OUTLINE": [
          "/Users/dantup/Desktop/Dart Sample/bin/folding_test.dart"
        ]
      }
    }
  }
[10:23:44]: <== {"id":"12"}
[10:23:44]: <== {"id":"13","result":{}}
[10:23:44]: <== {"id":"14"}
[10:23:44]: <== {"id":"15"}
[10:23:44]: <== {"event":"server.status","params":{"analysis":{"isAnalyzing":true}}}
[10:23:44]: <== {"event":"analysis.errors","params":{"file":"/Users/dantup/Desktop/Dart Sample/bin/folding_test.dart","errors":[{"severity":"INFO","type":"HINT","location":{"file":"/Users/dantup/Desktop/Dart Sample/bin/folding_test.dart","offset":21,"length":6,"startLine":2,"startColumn":7},"message":"The value of the local variable 'unused' isn't used.","correction":"Try removing the variable, or using it.","code":"unused_local_variable","hasFix":false}]}}
[10:23:44]: <== {"event":"analysis.occurrences", // ...
[10:23:44]: <== {"event":"analysis.closingLabels" // ...
[10:23:44]: <== {"event":"analysis.outline", // ...
[10:23:45]: <== {"event":"server.status","params":{"analysis":{"isAnalyzing":false}}}

Removing/re-adding the file to priority files doesn't help, nor does making edits the file.

(cc @bwilkerson @scheglov)

There are no FoldingContributor implementations for Dart in analysis server.

Well that explains that! =)
Am I right in thinking this would be very similar to the Closing Labels implementation I did? If so I might have a stab at it. People have complained about VS Code's poor folding many times, and also asked for the ability to collapse directives. I'd been telling people once VS Code supports custom folding (which it does in vNext) it'll be easy. Whoops!

I've made a start on this:
https://dart-review.googlesource.com/c/sdk/+/54232

A more complete implementation: https://dart-review.googlesource.com/c/sdk/+/54402

Some outstanding things:

[ ] Tweaks to FoldingKind (eg. we don't currently have a good category for nested functions); pending comments on https://dart-review.googlesource.com/c/sdk/+/54402
[ ] Update version number for AS (especially if we're changing FoldingKind)
[ ] Annotations (look for Angular example)

@bwilkerson @scheglov gonna land that other review so probably easiest to discuss FoldingKind here. I think we have options of either adding a LOCAL_DECLARATION or similar, or changing the existing kinds (probably not breaking if nobody can be using this yet) to be more like this list (that list seems to make more sense to me that categories top-level and class-level things differently).

Annotations are done at https://dart-review.googlesource.com/c/sdk/+/54580
I need some opinions on FoldingKinds to tidy them up though. My suggestion would maybe be to change the TOP_LEVEL_DECLARATION to CLASS and METHOD (though I'm not sure about METHOD vs FUNCTION?). Since things can be nested, I think grouping based on being top-level or nested might be a bit weird.

If it's an opinion you want ... :-)
The first question is: what do clients want to use FoldingKind for?
Based on the image, I'm guessing that at least one use case is to enable or disable the use of certain kinds of regions. If that's the only use case, then we only need to consider what users are likely to want to fold. Again, based on the list from IntelliJ, it seems reasonable to assume that users will want to fold

file header comments
documentation comments
directives
class bodies
function bodies (block or expression, whether at the top-level, in classes, or local to other functions)
annotations (presumably sequences of)

I don't know what "Dart parts" refers to, but I'm guessing it means part directives, which I would include in "directives" (that is, I would fold all directives unless we get feedback requesting that we fold different kinds of directives separately). I'm also not sure what "Dart generic parameters" does.
Another case suggested by the IntelliJ list is non-documentation comments (block comments and sequences of contiguous end of line comments). I don't know how useful that would be, but it's something to consider.
Is there any reason to subdivide any of those groups?
Is there any other use case for the kind?
If not, I'd be fine having the list of kinds updated to match the above.

The list you gave seems good to me. We do currently have a kind for (non-doc) Comments, do you think we should remove it?
I presume we're putting class methods in with functions?

annotations (presumably sequences of)

Do you mean for us to collapse them all into one region? Currently I'm just collapsing the bit inside the parens:
@something(/*...*/)
@something(/*...*/)
main() {}

How should we decide what's a "file header comment"? Should it be any comment that starts at offset 0 and has a blank line after it, so we don't capture comments on a method like this?
// this is
// my main method
main() {}

?

We do currently have a kind for (non-doc) Comments, do you think we should remove it?

Unless we're going to support folding of non-documentation comments, yes. I'd remove anything we're not currently using.

I presume we're putting class methods in with functions?

I would. I can't think why users would want to differentiate between different kinds of functions, but if you can think of a reason then we can split them out.

Do you mean for us to collapse them all into one region?

I can think of two possible reasons for wanting to fold annotations. The first is long annotations, which covers the Angular use case. The second is a code base with a prolific use of annotations. Consider something like
@experimental
@mustCallSuper
@nonNullable
@protected
@visibleForOverriding
@visibleForTesting
String getSomeData(...) ...

I could imagine users wanting to fold a list like that.

How should we decide what's a "file header comment"? Should it be any comment that starts at offset 0 and has a blank line after it, so we don't capture comments on a method like this?

The only thing I would allow before the comment is a script tag ("#! /usr/bin/dart").
I suspect that nearly everyone uses a sequence of end of line comments rather than a block comment, so we could limit it in that way.
I'm not sure whether we want to prevent blank lines before the file header, but I suspect that it's always at offset 0 unless there's a script tag.

We do currently have code for non-doc comments, but I don't know if it triggers (if each line of the comments if considered its own comment, probably not). I'll remove for now and we can revisit if required.
I think functions+methods together makes sense, I was just confirming in case some think it weird to put a method inside a category called functions.
Collapsing multiple annotations makes sense too, so I'll add that; plus the file header stuff (probably be next week now though).

... if each line of the comments if considered its own comment ...

Every end of line comment is a separate token, and there are only AST nodes created for documentation comments.

I think functions+methods together makes sense, I was just confirming in case some think it weird to put a method inside a category called functions.

Yeah, I tend to think in terms of the language grammar, in which case methods, constructors, top-level and local functions all have a function body. (And I'm assuming we're folding the body and not the whole method / function declaration.)

methods, constructors, top-level and local functions all have a function body

Aha, then it fits perfectly :-)

I'm assuming we're folding the body and not the whole method / function declaration

Yep! In the first cut I incorrectly included more than I should. The later pushes only included the bit you'd want to disappear when you collapse (eg. inside of the braces for a block).

Any opinions on the range we should return for collapsing multiple annontations? Normally we collapse the bit between braces/parents, for example:
@myAnnotation(/*START*/arg1, arg2, arg3/*END*/)

This means if the editor was to replace the region with ... it'd look good (sadly that's not how Code works, but I think it's logical to return the data that way).
I'm not sure where we should start/end the region for multiple lines of annotations, like:
@myAnnotation1
@myAnnotation2(arg1, arg2, arg3)

I'm tempted to say we start after the name of the first annotation (eg. after the 1) and end at the end of the last annotation (after the closing )). WDYT?

Any opinions on the range we should return for collapsing multiple annontations?

What do we do for directives? This seems fairly analogous.

... do we want to replace the existing annotation folds ...

I'm not sure. That might depend on how we answer the question above.
I don't think it would be good if we have both kinds and the visual presentation is the same under some circumstances. My initial guess is that we only want one kind of fold, so folding multiple annotations would replace the existing folds.
If we do keep both, then I think they should have different kinds. (And nested regions isn't a problem. We already do that with classes and methods within classes.)

What do we do for directives? This seems fairly analogous.

Currently we collapse after the first import keyword, so for:
import "x";

import "x";

export "x";

You'd get:
import[...]

My initial guess is that we only want one kind of fold, so folding multiple annotations would replace the existing folds

I think this feels most sensible to me. Although we nest inside methods it seems like that's more useful (you might want to collapse a nested method while looking at the containing method) it doesn't seem so useful for annotations (collapse one while looking at others).
So for now, I'll replace the old behaviour with a single fold around the edges unless anybody objects.
The FoldingKinds changes are at https://dart-review.googlesource.com/c/sdk/+/54920, I'll make the remaining changes (grouping annotations and implementing the file header) until that ones landed in case there are any changes.

Currently we collapse after the first import keyword ...

Not as helpful as I'd hoped :-). If we followed that pattern we'd get @..., but I think that would be hard to read. Probably after the name of the first annotation, as you suggested, is best.

Yeah, it's unfortunate that for imports showing the first keyword is less specific than annotations. We could always tweak the directives code to come before the first semi-colon if you want it to feel a bit more consistent; that way it'd look like:
import "first_file.dart"[...]

I'm not sure if it's any more correct, but maybe feels a little more consistent. LMK if you'd like me to change.

I don't think we want to change the directives behavior. There's a much bigger chance of a URI being long enough to require a line break between the import and the URI than there is for there being a line break between the @ and the annotation name. And I think we want a fold to start on the same line as the construct being folded.

This is done :-)

authors: DanTup bwilkerson scheglov


text:
Dart Analyzer ErrorEncountered a Dart Analysis Server error

Analyzer Feedback from IntelliJ
Version information

IDEA AI-173.4819257
2.0.0-edge.c080951d45e79cd25df98036c4be835b284a269c
AI-173.4819257, JRE 1.8.0_152-release-1024-b02x64 JetBrains s.r.o, OS Windows 7(amd64) v6.1 Service Pack 1, screens 1920x1080

Exception
Please append the contents of:
file://C:\Users\admin\AppData\Local\Temp\report14609.txt
Dart analysis server, SDK version 2.0.0-edge.c080951d45e79cd25df98036c4be835b284a269c, server version 1.20.2, error: Analysis failed: C:\Users\admin\Desktop\pt2\lib\drawer\home.dart
NoSuchMethodError: The getter 'libraryNameOffset' was called on null.
Receiver: null
Tried calling: libraryNameOffset
#0      Object.noSuchMethod (dart:core-patch/dart:core/object_patch.dart:46)
#1      FileState.isPart (package:analyzer/src/dart/analysis/file_state.dart:232)
#2      AnalysisDriver._computeAnalysisResult (package:analyzer/src/dart/analysis/driver.dart:1165)
<asynchronous suspension>
#3      AnalysisDriver.performWork (package:analyzer/src/dart/analysis/driver.dart:1023)
<asynchronous suspension>
#4      AnalysisDriverScheduler._run (package:analyzer/src/dart/analysis/driver.dart:1940)
<asynchronous suspension>
#5      AnalysisDriverScheduler.start (package:analyzer/src/dart/analysis/driver.dart:1883)
#6      new AnalysisServer (package:analysis_server/src/analysis_server.dart:395)
#7      SocketServer.createAnalysisServer (package:analysis_server/src/socket_server.dart:79)
#8      StdioAnalysisServer.serveStdio (package:analysis_server/src/server/stdio_server.dart:37)
#9      Driver.start.<anonymous closure> (package:analysis_server/src/server/driver.dar

https://github.com/dart-lang/sdk/issues/33387

source: gharchive/issue

repo: dart-lang/sdk

license_type: permissive

license_source: github-api


text:
Analyzer: Odd treatment of promoted type

Consider the following program:
class A {}
class B extends A {}

void f<X extends A, Y extends B>(X x) {
  if (x is Y) {
    A a = x;
    B b = x;
    X x2 = x;
    Y y = x;
  }
}

dartanalyzer version 2.2.0-dev.0.0 reports errors for this program as follows:
  error • A value of type 'X' can't be assigned to a variable of type 'A' at n006.dart:10:11 • invalid_assignment
  error • A value of type 'X' can't be assigned to a variable of type 'B' at n006.dart:11:11 • invalid_assignment
  error • A value of type 'X (/usr/local/google/home/eernst/lang/dart/scratch/201812/n006.dart)' can't be assigned to a variable of type 'X (/usr/local/google/home/eernst/lang/dart/scratch/201812/n006.dart)' at n006.dart:12:12 • invalid_assignment

First, promotion of x does not take place, even though Y is guaranteed to be a type which is a subtype of the bound of X (so x should have been promoted to have type X & Y).
The most surprising error is that a value of type X can't be assigned to a value of type X. Presumably there is some additional structure to those types that make them spuriously different.
Next, if we really trust x to have type X, the fact that X has bound A should justify assignment to a variable of type A: It's a plain upcast.
If we had promoted x to have type X & Y then we would also have allowed the assignment to a variable of type B, because X & Y <: Y <: B, again a plain upcast.
Finally, the assignment to Y should be allowed with a promotion (to Y!), but given that promotion did not take place we have a variable of type X and a target type Y, and they are unrelated. So we have at least an inconsistency here.

@stereotype441 I believe that strong mode promotion should promote x to have type X extends Y (which @eernstg is writing X & Y) because Y extends B and B extends A and hence while we cannot promote x from X to Y, we allow promotion of the bound of X to Y.  See line 1296 of type_system.dart.
I believe that given such a promotion, all of the assignments in that example should be valid (no errors).

It looks like we don't use TypeSystem in this, but call type.isMoreSpecificThan. That is dart 1 semantics. This is probably the cause.

About the terminology, I'd be a little bit worried about saying...

The analyzer associates bounds not with the declaration of a type variable (alone) but with each reference to a type variable.  Not the way I'm used to thinking about it, but it's reasonable.  So in the terminology above, when I say "the bound of X", I don't mean the bound on the declaration of X, I mean the bound on the specific instance of X which classifies x.

"the bound of X [means] the bound on the specific instance of X which classifies x.

As far as I can see, this means that the declared bound of X will be inaccessible if a variable v of type X is promoted to a type of the form X extends S (which is a notation for X & S that emphasizes that S is simply considered to be the bound of X).
In that case it's essential that promotion to a type X & S is only allowed when S is a subtype of the declared bound of X. This is also a constraint that I have had in mind, and it is indeed what we have specified in the upcoming CL 85921.
This is one of the properties that makes types of the form X & S different from intersection types in a general form.
But it's not reflected in the current behavior of the analyzer, which will allow promotion from X to X & S in some cases where S is not a subtype of the bound of X (cf. #35305). But I expect that we will just get that fixed.
Another matter is that  we may make other mistakes if we just use a promoted type variable type X extends S as evidence that X has bound S. Consider this example, which is accepted by dartanalyzer (versions 2.2.0-dev.0.0 as well as a fresh one from commit 5451ac62e26caeacd8a8c4a660ac320bdf9c84f3) without errors:
class A<X extends int> {
  A() { print(X); }
}

A<X> g<X extends int>(X x) => A<X>();

void f<X extends num, Y extends X>(Y y) {
  if (y is int) {
    g(y); // This is the interesting statement!
  }
}

main() {
  f<num, num>(42);
}

In this example, an invocation of g is accepted, which means that some type parameter U was inferred. The type U must satisfy U <: int in order to satisfy the declared bound on the type parameter of g, and it must also be a type which is assignable to the type of y (otherwise it would be an error to pass y as an actual argument). Given that y is actually promoted to Y extends int, it looks like the inferred type argument U was Y extends int, which could hardly mean anything else than Y, except that we have the extra assumption that Y <: int.
Of course, if this program were allowed to run, the actual value of Y would be num, and we would then, presumably, create an instance of type A<num>, which is a soundness violation (because the body of A can contain code that relies on X <: int). In particular, there is no evidence at the point of creation (that is, the body of g) that there is a need to check that the value of X is a subtype of int.
So it looks like it is not just the promoted variable which is treated as if it had type Y extends int, it is actually also the type variable Y itself which is, in some contexts, considered to have that bound.
This brings us back to something which is closely related to #35100, albeit from a different angle (in that issue, the focus was on having one value of a type argument for static analysis, and another one at run time; in this context the issue is that we make unsound assumptions about the bound of a type variable).
This makes me conclude that it is, at least, necessary to be rather careful if one wants to think that promotion to a type of the form X & S actually yields a type variable with a modified bound.

authors: MichaelRFairhurst eernstg leafpetersen


text:
JIT-DebugSIMARM compile-time crash

KBC-INT-ReleaseX64 - JIT-DebugSIMARM: !DIVERGENCE! 1.2:4023176434 (output=false)
fail2:
../../runtime/vm/object.cc: 20680: error: Fatal error in OneByteString::New: invalid len 536870912

Reproducible, stack trace:
../../runtime/vm/object.cc: 19564: error: Fatal error in OneByteString::New: invalid len 536870912
thread=61329, isolate=fuzz4023176434.dart:main()(0x23b4b00)
[0x0169fbac] dart::Profiler::DumpStackTrace(void*)
[0x0169fbac] dart::Profiler::DumpStackTrace(void*)
[0x01936144] Dart_DumpNativeStackTrace
[0x019380cb] dart::Assert::Fail(char const*, ...)
[0x0165f131] dart::OneByteString::New(int, dart::Heap::Space)
[0x01661d7d] dart::OneByteString::Concat(dart::String const&, dart::String const&, dart::Heap::Space)
[0x015dfd7e] dart::String::Concat(dart::String const&, dart::String const&, dart::Heap::Space)
[0x014b4580] dart::BootstrapNatives::DN_String_concat(_Dart_NativeArguments*)
[0x017254de] dart::Simulator::SupervisorCall(dart::Instr*)
[0x017265f1] dart::Simulator::DecodeType7(dart::Instr*)
[0x01729fc6] dart::Simulator::Execute()
[0x0172a673] dart::Simulator::Call(int, int, int, int, int, bool, bool)
[0x015613d0] dart::DartEntry::InvokeFunction(dart::Function const&, dart::Array const&, dart::Array const&, unsigned int)
[0x01560f88] dart::DartEntry::InvokeFunction(dart::Function const&, dart::Array const&)
[0x015644aa] dart::DartLibraryCalls::HandleMessage(dart::Object const&, dart::Instance const&)
[0x0159de5a] dart::IsolateMessageHandler::HandleMessage(dart::Message*)
[0x015d8f81] dart::MessageHandler::HandleMessages(dart::MonitorLocker*, bool, bool)
[0x015d9bf4] dart::MessageHandler::TaskCallback()
[0x015db0ec] Unknown symbol
[0x017597ef] dart::ThreadPool::Worker::Loop()
[0x01759387] dart::ThreadPool::Worker::Main(unsigned int)


text:
Add Iterable.+

If it's ever feasible to add new methods on Iterable, a + method would be useful as a way to lazily concatenate two (or more) iterables without having to first copy their contents to a list.

Do you mean as an alias for followedBy?

I didn't realize followedBy exists, but yes. Now that List.+ exists, I think users (like me) will naturally look for an Iterable equivalent.

Since List is also an Iterable, it is probably best that the lazy sequence concatenation has a different name to the existing List concatenation called +. It would be too easy for someone to implement List but end up inheriting a + operation that had a .length with O(N) runtime.

When you were looking for Iterable.+ did you find some place where adding a sentence to the documentation would have helped find followedBy?

Not unless the search bar had redirected me...


text:
List setRange/replaceRange doesn't re-hash the list.

Reproducible in dartpad:
void main() {
  final list = [1,2,3];
  print("hash1 ${list.hashCode} | $list");
  list.setRange(0,1,[5]); // also happens with replaceRange.
  print("hash1 ${list.hashCode} | $list");
}

Expected: hash result should be different after list is edited.
Reality: hash result is exactly the same as before. This makes really hard to edit lists without bugs, since hash is essential for a lot of usages. Example: my UI wasn't' refreshing because Flutter wasn't detecting any change even though the list was different.
I am using Dart 2.7.0 locally with Flutter, dartpad uses 2.6.0. This issue affects both.

This is working as intended. List's hashCode is an identity hash code, not a hash code based on contents.

Flutter wasn't detecting any change even though the list was different.

I don't think Flutter has any builtin change detection (unlike for example Angular). If you want widget to rebuild you need to tell Flutter that state is changing by calling setState.

Expected: hash result should be different after list is edited.

This expectation is in contradiction with how hashes work. Hashes have collisions (when two unequal objects have the same hash) so it is entirely possible that say [1, 2, 3] and [5, 2, 3] have the same hash even if List hash actually took contents into account.

Thanks! (regarding Flutter, I was using the list's own hash to auto-calculate the diff in blocs. But as you just mentioned, I thought it was the hash of the elements. I'll change that, thanks!)

authors: bernaferrari mraleph


text:
[Gardening] dart_api_create_lightweight_isolate_test causing failures

For example: https://ci.chromium.org/p/dart/builders/ci.sandbox/vm-kernel-win-debug-x64/10533
and https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8863821357325980736/+/steps/vm_tests_shard_13/0/logs/task_stdout_stderr:_vm_tests_shard_13/0

Thanks, @bkonyi . Will take a look at it.

Test is failing on all reload bots.

@dcharkes Could you approve the failures? The JIT / reload support for isolate groups is not still in development.

I already did, pointing to this issue.

Closing this one. This is all part of https://github.com/dart-lang/sdk/issues/36097.

authors: bkonyi dcharkes mkustermann


text:
diagnostic should be produced when a deferred element is used in a constant context

For example:
a.dart:
class A {
  const A();
}

const aa = A();

b.dart:
import 'a.dart' deferred as a;

class B {
  const B(Object a);
}

main() {
  var b = const B(a.aa); // SHOULD PRODUCE DIAGNOSTIC
}

The front-end produces a warning like this:
Error: 'aa' can't be used in a constant expression because it's marked as 'deferred' which means it isn't available until loaded.

But analyzer does not.

https://dart-review.googlesource.com/c/sdk/+/244281 adds a test to make sure the LinterContext handles this case.

See also: b/230089181

@scheglov

I was not able to fix it quickly and easily.
As we noticed somewhere else, constants evaluation is a mess.

authors: bwilkerson pq scheglov


text:
Override toString on Endian

The Endian class doesn't override Endian. As a result, toString always returns "Instance of 'Endian'".
I'd find it more helpful if it returned the actual value in a format similar to "little endian"/"big endian".

/cc @lrhn

Easy to do.
My only worry is that it's not that useful, and toString methods are notoriously hard to tree-shake.
So we'd end up with two strings compiled into every program, an almost nobody will use them for anything (evidenced by them not having been used so far, since they aren't there).
I'm not sold on a toString which works differently between development and production.
(But with this argument, we could remove a lot of toString implementations that are only useful for debugging. So why should this be special.)
Then there's the question which string to use. Just "big"/"little", or "big endian"/"little endian".
Or "Big" and "Little"? Or just "BE" and "LE"?
(Definitely not doing a parse function to go the other direction.)

Definitely not doing a parse function to go the other direction.

I feel like this is the easy part 😉: No, I can't imagine a scenario where I'd want to parse an endianness from a string. My use case is a set of unit test suites where I'm iterating over the two possible endian values, baking them into the test names and making sure my code supports both. Here's where a meaningful toString implementation would help.

I'm not sold on a toString which works differently between development and production.

I agree. There's little more annoying than code that works in tests but not in production. And I can certainly see uses for Endian.toString in production, if only for logging purposes.

Then there's the question which string to use.

Skimming the SDK code, it seems that toString implementations returning a prose-like string tend to use sentence case; also, implementations tend to describe the entire value rather than just the distinguishing feature. So I'm proposing "Big endian"/"Little endian".

My only worry is that it's not that useful, and toString methods are notoriously hard to tree-shake.

I can't judge that. I certainly agree that anything endian-related is rather a niche case. Then again, one of the things I value about Dart is that things tend to just work the way you'd expect them to.

authors: DanielSWolf lrhn mraleph


text:
Failures on riscv64 configurations

There are new test failures
The tests
vm/cc/Assembler_BitClear Crash (expected Pass)
vm/cc/Assembler_BitClearImmediate2 Crash (expected Pass)
vm/cc/Assembler_BitExtract Crash (expected Pass)
vm/cc/Assembler_BitExtractImmediate Crash (expected Pass)
vm/cc/Assembler_BitSet Crash (expected Pass)
vm/cc/Assembler_BitSetImmediate2 Crash (expected Pass)
vm/cc/Assembler_CarrylessMultiply Crash (expected Pass)
vm/cc/Assembler_CarrylessMultiplyHigh Crash (expected Pass)
vm/cc/Assembler_CarrylessMultiplyReversed Crash (expected Pass)
vm/cc/Assembler_CountPopulationWord Crash (expected Pass)
vm/cc/Assembler_CountTrailingZeroesWord Crash (expected Pass)
vm/cc/Assembler_Shift2Add Crash (expected Pass)
vm/cc/Assembler_Shift2AddUnsignedWord Crash (expected Pass)
vm/cc/Assembler_Shift3AddUnsignedWord Crash (expected Pass)
vm/cc/IsolateReload_PendingStaticCall_DefinedToNSM Fail (expected Pass)
vm/cc/IsolateReload_PendingUnqualifiedCall_InstanceToStatic Fail (expected Pass)

are failing on configurations
vm-linux-debug-simriscv64
vm-linux-release-riscv64-qemu

cc @rmacnak-google

This was triggered by downgrading the builder from Noble to Jammy, hence an older version of QEMU that doesn't support the bit-manipulation extension but also avoids some internal QEMU crash. Fixing the crashes also unmasks a known hot reload defect that occurs in all modes.
https://github.com/dart-lang/sdk/issues/49791 / https://github.com/dart-lang/sdk/issues/32981

authors: mraleph rmacnak-google


text:
Memory leak when drawing 100 sprites (maybe dependency bug?)

I have small .png as sprite for stars and this drawing code:
fn draw_stars(world: &WorldBounds, stars: &Vec<Star>, bg_stars: &Vec<Star>) {
    for star in stars {
        draw_sprite(
            texture_id(TEX_STAR),
            star.pos,
            BLUE * 5.0, // TODO: other color?
            0,
            Vec2::splat(star.size),
        );
    }
}

Expected:
no mem leaks when running above in update()
Actual:
When I run it, memory increases about 50MB/second - waited until 10GB were used.
Note: If I comment it out, the memory growth stops.

Update: could be a dependency (Accrete) bug, looks like some sort of memory corruption possibly.
Updating with example from comfy/examples/sprite.rs:

Add accrete to comfy/Cargo.toml:

accrete = "0.2.0" # for planet system generation https://crates.io/crates/accrete

Update examples/sprite.rs like so:

use accrete::Accrete;
use comfy::*;

simple_game!("Sprite Example", setup, update);

fn setup(c: &mut EngineContext) {
    c.load_texture_from_bytes(
        // Every texture gets a string name later used to reference it.
        "comfy",
        include_bytes!(concat!(
            env!("CARGO_MANIFEST_DIR"),
            "/../assets/comfy.png"
        )),
    );
}

fn update(_c: &mut EngineContext) {
    for _ in 1..10000 {
        draw_sprite(
            // Drawing sprites/textures requires a TextureHandle which can be calculated from its
            // string name. This incurs a non-measurable overhead in hashing the string, but saves
            // a lot of boilerplate in user code that would have to store asset handles.
            texture_id("comfy"),
            Vec2::ZERO,
            WHITE,
            0,
            splat(5.0),
        );
    }
}

Run cargo run --example sprite

Expected: no memory leak
Actual: memory leak depending on how many sprites we draw.

Looks like accrete depends on wee_alloc which may be causing this problem rather than the default allocator.

repo: darthdeus/comfy


text:
bump coveralls to address high severity sec vuln

The older version of coveralls includes a version of cryptiles which is
vulnerable according to https://nvd.nist.gov/vuln/detail/CVE-2018-1000620

We should probably bump version and release after this is merged.

source: gharchive/pull-request

repo: dashevo/dashd-rpc

license: MIT


text:
Backport 11651

Contains #10286, which will be dropped once PR9 is merged

scripted-diff: Replace #include "" with #include <> (ryanofsky) 64a79b0 is broken - should remove leading whitespaces in the title. Also missing 37580b0 and 1c0acbe from #3353 (which should be dropped on rebase later) to fix the included 10286.

Needs rebase

force pushed, I think I fixed the problem with the scripted diff

Looks like 8d15df8 is incomplete, changes in quite a few files are missing a83e72a (which is why scripted-diff fails).

fixed https://github.com/dashpay/dash/commit/8d15df8ef3ac85982a781ec7ae9f2b5abf742d5e and forcepushed

Alrighty... Building + tests passing locally, plus scripted diffs verify locally
For some reason, I wasn't able to figure it out, the changes done in https://github.com/bitcoin/bitcoin/pull/11651/commits/138016bf9275692995d37f707e5b83e0d7fed1a9 resulted in an empty commit, so that commit has been dropped

Gitlab is failing, however, it shouldn't be. See travis here https://github.com/PastaPastaPasta/dash/runs/508439966

Changes from the commit you dropped as well as changes to .moc files and other generated-on-compile files should NOT go into scripted-diff and should be applied in a separate commit.

I don't see any .moc files being changed in either of the scripted diffs. The scripted diff commit was created by running the script, followed by git add *.h git add *.cpp

Oh, sorry, I mean changes mentioning those files, not changes to them

So... Why did those changes occur when executing the script??

Because you are running the script in a non-clean folder? Do make clean before running the script and it should give you the right set of changes.

Alrighty. Created a new branch backport-11651-t which started out as develop, I ran make clean then executed the upstream script and created the scripted diff commit, then did the same for the dash scripted diff. Then I cherry-picked all of the other commits from backport-11651 then I cherrypicked test: refactor: Use absolute include paths for test data files which was dropped from backport-11651 and resolved conflicts. Then I cherry-picked the remaining commits from backport-11651. Then I checked-out backport-11651 then git reset --hard backport-11651-t. Scripted diffs pass locally
I haven't build it locally yet (depends is messed up so I'm building that rn) but I have no reason to believe it wont build

Nice, both scripted diffs have "ok" status on gitlab too 👍 Need (at least) a couple more fixes now it seems, pls see bbe6779a11e61ef8c545f4a8a7cc79a4032de6d0, 9ff4164281f3af3f9410168f130cd335135b0983, 65cc460e65f9450d1f826c03c1e70ba59f7d9055

cherry-picked

Gitlab passing

Merge?

repo: dashpay/dash

license: mit

license_source: bigquery


text:
How to load Kmeans model

Hi, I use dask_ml Kmeans to traing a model (I use dask on yarn), and I just dump the model when fit finished, like the following code snippet:
    from dask_ml.cluster import KMeans
    from sklearn.externals import joblib
    km = KMeans(n_clusters=500, max_iter=500)
    km.fit(fea_arr)
    joblib.dump(km, './kmeans_model.pkl')

And I get the kmeans_model.pkl file, when I load the model in python interpreter it throw some error like the following:
>>> from sklearn.externals import joblib
>>> joblib.load('kmeans_model.pkl')
Traceback (most recent call last):
  File "/home/ubuntu/data/richard/py3/lib/python3.5/site-packages/distributed/comm/core.py", line 190, in connect
    quiet_exceptions=EnvironmentError)
  File "/home/ubuntu/data/richard/py3/lib/python3.5/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
    raise self._exception
tornado.util.TimeoutError: Timeout

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ubuntu/data/richard/py3/lib/python3.5/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 598, in load
    obj = _unpickle(fobj, filename, mmap_mode)
  File "/home/ubuntu/data/richard/py3/lib/python3.5/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 526, in _unpickle
    obj = unpickler.load()
  File "/usr/lib/python3.5/pickle.py", line 1039, in load
    dispatch[key[0]](self)
  File "/home/ubuntu/data/richard/py3/lib/python3.5/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 339, in load_build
    Unpickler.load_build(self)
  File "/usr/lib/python3.5/pickle.py", line 1510, in load_build
    setstate(state)
  File "/home/ubuntu/data/richard/py3/lib/python3.5/site-packages/distributed/client.py", line 338, in __setstate__
    c = get_client(address)
  File "/home/ubuntu/data/richard/py3/lib/python3.5/site-packages/distributed/worker.py", line 2577, in get_client
    return Client(address, timeout=timeout)
  File "/home/ubuntu/data/richard/py3/lib/python3.5/site-packages/distributed/client.py", line 636, in __init__
    self.start(timeout=timeout)
  File "/home/ubuntu/data/richard/py3/lib/python3.5/site-packages/distributed/client.py", line 759, in start
    sync(self.loop, self._start, **kwargs)
  File "/home/ubuntu/data/richard/py3/lib/python3.5/site-packages/distributed/utils.py", line 277, in sync
    six.reraise(*error[0])
  File "/home/ubuntu/data/richard/py3/lib/python3.5/site-packages/six.py", line 693, in reraise
    raise value
  File "/home/ubuntu/data/richard/py3/lib/python3.5/site-packages/distributed/utils.py", line 262, in f
    result[0] = yield future
  File "/home/ubuntu/data/richard/py3/lib/python3.5/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/home/ubuntu/data/richard/py3/lib/python3.5/site-packages/tornado/gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "/home/ubuntu/data/richard/py3/lib/python3.5/site-packages/distributed/client.py", line 847, in _start
    yield self._ensure_connected(timeout=timeout)
  File "/home/ubuntu/data/richard/py3/lib/python3.5/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/home/ubuntu/data/richard/py3/lib/python3.5/site-packages/tornado/gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "/home/ubuntu/data/richard/py3/lib/python3.5/site-packages/distributed/client.py", line 885, in _ensure_connected
    connection_args=self.connection_args)
  File "/home/ubuntu/data/richard/py3/lib/python3.5/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/home/ubuntu/data/richard/py3/lib/python3.5/site-packages/tornado/gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "/home/ubuntu/data/richard/py3/lib/python3.5/site-packages/distributed/comm/core.py", line 201, in connect
    _raise(error)
  File "/home/ubuntu/data/richard/py3/lib/python3.5/site-packages/distributed/comm/core.py", line 182, in _raise
    raise IOError(msg)
OSError: Timed out trying to connect to 'tcp://172.31.17.12:46586' after 3 s: in <distributed.comm.tcp.TCPConnector object at 0x7efeeb7650b8>: ConnectionRefusedError: [Errno 111] Connection refused

I think the model contains some information about the dask worker and try to restore the model object in the worker, but the worker process is already exit, all the worker exit.
How can I load the model? and can I load the model in single machine like it is trained in a single machine? Thank you for you help!

My first guess is that the KMeans.labels_ are to blame, since IIRC they're the only delayed value. I'm not really sure why they would have a reference to the client though. LMK if you want to debug this further, and I could help guide you.

yes, you are right, I check the dask_ml doc and sklearn doc again
dask_ml:
cluster_centers_ : np.ndarray [n_clusters, n_features]
    A NumPy array with the cluster centers

labels_ : da.array [n_samples,]
    A dask array with the index position in cluster_centers_ this sample belongs to.

intertia_ : float
    Sum of distances of samples to their closest cluster center.

n_iter_ : int
    Number of EM steps to reach convergence

sklearn:
cluster_centers_ : array, [n_clusters, n_features]
    Coordinates of cluster centers. If the algorithm stops before fully converging (see tol and max_iter), these will not be consistent with labels_.

labels_ :
    Labels of each point

inertia_ : float
    Sum of squared distances of samples to their closest cluster center.

n_iter_ : int
    Number of iterations run.

It's the dask_ml Kmeans.lables_ to blame, it's a delayed value, so i just recreate my sklearn kmeans object to solve the problem, like the following code snippet:
    sk_km = sklearn.cluster.KMeans(n_clusters=500, max_iter=500)
    sk_km.cluster_centers_ = km.cluster_centers_
    sk_km.inertia_ = km.inertia_
    sk_km.n_iter_ = km.n_iter_
    joblib.dump(sk_km, './sk_km_model.pkl')

and it works, i can joblib.load sk_km_model.pkl now. I ignore the lables_ attribute, because i don't need it in my project. Also i think if you need it you can compute the labels_ and assign it to sklearn kmeans object. Thank you for your help, Tom!

@wanyikang can you provide a reproducible example? I'm having trouble with a simple one. http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports

authors: TomAugspurger wanyikang

repo: dask/dask-ml


text:
docs: Fix a few typos

There are small typos in:

dask/dataframe/io/parquet/arrow.py
dask/dataframe/io/parquet/core.py
dask/dataframe/io/tests/test_parquet.py
dask/utils.py

Fixes:

Should read predicates rather than predictates.
Should read statistics rather than statistiscs.
Should read scenarios rather than scenerios.
Should read ordered rather than orderd.
Should read constant rather than constatn.

Semi-automated pull request generated by
https://github.com/timgates42/meticulous/blob/master/docs/NOTE.md

Can one of the admins verify this patch?

repo: dask/dask


text:
Method create_client() is failing

What happened:
s3 = S3FileSystem(client_kwargs={'aws_access_key_id': 'foo', 'aws_secret_access_key': 'bar'})

TypeError: create_client() got multiple values for keyword argument 'aws_access_key_id'

What you expected to happen:
This should be working as 0.5.1
Environment:

s3fs version: 0.5.2
Python version: 3.8
Operating System: Ubuntu
Install method (conda, pip, source): pip

Because those args are among the most commonly seen, they are handled at the top level:
s3 = S3FileSystem(key='foo', secret='bar')

authors: jcunhafonte martindurant


text:
listr -g option doesn't appear to recognize locally hosted refgenieserver genome names

This may be a potential refgenieserver error, however, when attempting to restrict a listr command to a single genome with the -g option, it appears to not understand how to recognize a Remote genomes:  if that remote genomes is on a locally hosted refgenieserver.
$ refgenie listr -c test_multiple_servers.yaml -g hg19_cdna
Querying available assets from server: http://refgenomes.databio.org/v2/assets
Remote genomes: hg19_cdna
Remote assets:
           hg19_cdna/   fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, kallisto_index:default, salmon_index:default

Querying available assets from server: http://0.0.0.0:80/v2/assets
Remote genomes: test
Remote assets:
                test/   fasta.chrom_sizes:default, fasta.fai:default, fasta:default

Querying available assets from server: http://staging.refgenomes.databio.org/v2/assets
Remote genomes: hg19_cdna
Remote assets:
           hg19_cdna/   fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, kallisto_index:default, salmon_index:default

So, it's working to check multiple refgenieservers when listing assets. But, if I restrict by a genome present on the public servers (refgenomes.databio.org and staging...) it works, while still displaying the assets on the local host.  Conversely, if I try to restrict to the localhost genome ("test"), it instead displays all assets for all servers. See below:
$ refgenie listr -c test_multiple_servers.yaml -g test
Querying available assets from server: http://refgenomes.databio.org/v2/assets
Remote genomes: hg19, hg19_cdna, hg38, hg38_cdna, hg38_chr22, hg38_noalt_decoy, hs38d1, human_alphasat, human_alu, human_rDNA, human_repeats, mm10, mm10_cdna, mouse_chrM2x, rCRSd, rn6, rn6_cdna
Remote assets:
                hg19/   bismark_bt1_index:default, bismark_bt2_index:default, bowtie2_index:default, bwa_index:default, ensembl_gtf.ensembl_gene_body:default, ensembl_gtf.ensembl_tss:default, ensembl_gtf:default, fasta.chrom_sizes:default, fasta.fai:default, fasta:default, gencode_gtf:default, hisat2_index:default, refgene_anno.refgene_exon:default, refgene_anno.refgene_intron:default, refgene_anno.refgene_pre_mRNA:default, refgene_anno.refgene_tss:default, refgene_anno:default, star_index:default
           hg19_cdna/   fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, kallisto_index:default, salmon_index:default
                hg38/   bismark_bt1_index:default, bismark_bt2_index:default, bowtie2_index:default, bwa_index:default, dbnsfp.tabix:default, dbnsfp:default, ensembl_gtf.ensembl_gene_body:default, ensembl_gtf.ensembl_tss:default, ensembl_gtf:default, ensembl_rb:default, fasta.chrom_sizes:default, fasta.fai:default, fasta:default, feat_annotation:default, gencode_gtf:default, refgene_anno.refgene_exon:default, refgene_anno.refgene_intron:default, refgene_anno.refgene_pre_mRNA:default, refgene_anno.refgene_tss:default, refgene_anno:default
           hg38_cdna/   fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, kallisto_index:default, salmon_index:default
          hg38_chr22/   bismark_bt1_index:default, bismark_bt2_index:default, bowtie2_index:default, bwa_index:default, fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, star_index:default
    hg38_noalt_decoy/   bismark_bt1_index:default, bismark_bt2_index:default, bowtie2_index:default, bwa_index:default, fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, star_index:default
              hs38d1/   bismark_bt1_index:default, bismark_bt2_index:default, bowtie2_index:default, bwa_index:default, fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, star_index:default
      human_alphasat/   bismark_bt1_index:default, bismark_bt2_index:default, bowtie2_index:default, bwa_index:default, fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, star_index:default
           human_alu/   bismark_bt1_index:default, bismark_bt2_index:default, bowtie2_index:default, bwa_index:default, fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default
          human_rDNA/   bismark_bt1_index:default, bismark_bt2_index:default, bowtie2_index:default, bwa_index:default, fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, star_index:default
       human_repeats/   bismark_bt1_index:default, bismark_bt2_index:default, bowtie2_index:default, bwa_index:default, fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, star_index:default
                mm10/   bismark_bt1_index:default, bismark_bt2_index:default, bowtie2_index:default, bwa_index:default, ensembl_gtf.ensembl_gene_body:default, ensembl_gtf.ensembl_tss:default, ensembl_gtf:default, ensembl_rb:default, fasta.chrom_sizes:default, fasta.fai:default, fasta:default, feat_annotation:default, gencode_gtf:default, hisat2_index:default, refgene_anno.refgene_exon:default, refgene_anno.refgene_intron:default, refgene_anno.refgene_pre_mRNA:default, refgene_anno.refgene_tss:default, refgene_anno:default, star_index:default
           mm10_cdna/   fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, kallisto_index:default, salmon_index:default
        mouse_chrM2x/   bismark_bt1_index:default, bismark_bt2_index:default, bowtie2_index:default, bwa_index:default, fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, star_index:default
               rCRSd/   bismark_bt1_index:default, bismark_bt2_index:default, bowtie2_index:default, bwa_index:default, fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, star_index:default
                 rn6/   bismark_bt1_index:default, bismark_bt2_index:default, bowtie2_index:default, bwa_index:default, fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, refgene_anno.refgene_exon:default, refgene_anno.refgene_intron:default, refgene_anno.refgene_pre_mRNA:default, refgene_anno.refgene_tss:default, refgene_anno:default, star_index:default
            rn6_cdna/   fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, kallisto_index:default, salmon_index:default

Querying available assets from server: http://0.0.0.0:80/v2/assets
Remote genomes: test
Remote assets:
                test/   fasta.chrom_sizes:default, fasta.fai:default, fasta:default

Querying available assets from server: http://staging.refgenomes.databio.org/v2/assets
Remote genomes: hg19, hg19_cdna, hg38, hg38_cdna, hg38_chr22, hg38_noalt_decoy, hs38d1, human_alphasat, human_alu, human_rDNA, human_repeats, mm10, mm10_cdna, mouse_chrM2x, rCRSd, rn6, rn6_cdna
Remote assets:
                hg19/   bismark_bt1_index:default, bismark_bt2_index:default, bowtie2_index:default, bwa_index:default, ensembl_gtf.ensembl_gene_body:default, ensembl_gtf.ensembl_tss:default, ensembl_gtf:default, fasta.chrom_sizes:default, fasta.fai:default, fasta:default, gencode_gtf:default, hisat2_index:default, refgene_anno.refgene_exon:default, refgene_anno.refgene_intron:default, refgene_anno.refgene_pre_mRNA:default, refgene_anno.refgene_tss:default, refgene_anno:default, star_index:default
           hg19_cdna/   fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, kallisto_index:default, salmon_index:default
                hg38/   bismark_bt1_index:default, bismark_bt2_index:default, bowtie2_index:default, bwa_index:default, dbnsfp.tabix:default, dbnsfp:default, ensembl_gtf.ensembl_gene_body:default, ensembl_gtf.ensembl_tss:default, ensembl_gtf:default, ensembl_rb:default, fasta.chrom_sizes:default, fasta.fai:default, fasta:default, feat_annotation:default, gencode_gtf:default, refgene_anno.refgene_exon:default, refgene_anno.refgene_intron:default, refgene_anno.refgene_pre_mRNA:default, refgene_anno.refgene_tss:default, refgene_anno:default
           hg38_cdna/   fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, kallisto_index:default, salmon_index:default
          hg38_chr22/   bismark_bt1_index:default, bismark_bt2_index:default, bowtie2_index:default, bwa_index:default, fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, star_index:default
    hg38_noalt_decoy/   bismark_bt1_index:default, bismark_bt2_index:default, bowtie2_index:default, bwa_index:default, fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, star_index:default
              hs38d1/   bismark_bt1_index:default, bismark_bt2_index:default, bowtie2_index:default, bwa_index:default, fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, star_index:default
      human_alphasat/   bismark_bt1_index:default, bismark_bt2_index:default, bowtie2_index:default, bwa_index:default, fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, star_index:default
           human_alu/   bismark_bt1_index:default, bismark_bt2_index:default, bowtie2_index:default, bwa_index:default, fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default
          human_rDNA/   bismark_bt1_index:default, bismark_bt2_index:default, bowtie2_index:default, bwa_index:default, fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, star_index:default
       human_repeats/   bismark_bt1_index:default, bismark_bt2_index:default, bowtie2_index:default, bwa_index:default, fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, star_index:default
                mm10/   bismark_bt1_index:default, bismark_bt2_index:default, bowtie2_index:default, bwa_index:default, ensembl_gtf.ensembl_gene_body:default, ensembl_gtf.ensembl_tss:default, ensembl_gtf:default, ensembl_rb:default, fasta.chrom_sizes:default, fasta.fai:default, fasta:default, feat_annotation:default, gencode_gtf:default, hisat2_index:default, refgene_anno.refgene_exon:default, refgene_anno.refgene_intron:default, refgene_anno.refgene_pre_mRNA:default, refgene_anno.refgene_tss:default, refgene_anno:default, star_index:default
           mm10_cdna/   fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, kallisto_index:default, salmon_index:default
        mouse_chrM2x/   bismark_bt1_index:default, bismark_bt2_index:default, bowtie2_index:default, bwa_index:default, fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, star_index:default
               rCRSd/   bismark_bt1_index:default, bismark_bt2_index:default, bowtie2_index:default, bwa_index:default, fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, star_index:default
                 rn6/   bismark_bt1_index:default, bismark_bt2_index:default, bowtie2_index:default, bwa_index:default, fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, refgene_anno.refgene_exon:default, refgene_anno.refgene_intron:default, refgene_anno.refgene_pre_mRNA:default, refgene_anno.refgene_tss:default, refgene_anno:default, star_index:default
            rn6_cdna/   fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, kallisto_index:default, salmon_index:default

ok, that's what it looks like on dev now:
[mstolarczyk@MichalsMBP test_genomes_new]: refgenie listr -c genomes.yaml -g hg19_cdna
Querying available assets from server: http://refgenomes.databio.org/v2/assets
Remote genomes: hg19_cdna
Remote assets:
           hg19_cdna/   fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, kallisto_index:default, salmon_index:default

Querying available assets from server: http://staging.refgenomes.databio.org/v2/assets
Remote genomes: hg19_cdna
Remote assets:
           hg19_cdna/   fasta.chrom_sizes:default, fasta.fai:default, fasta:default, hisat2_index:default, kallisto_index:default, salmon_index:default

Querying available assets from server: http://0.0.0.0:80/v2/assets
Genomes do not include: hg19_cdna

[mstolarczyk@MichalsMBP test_genomes_new]: refgenie listr -c genomes.yaml -g test
Querying available assets from server: http://refgenomes.databio.org/v2/assets
Genomes do not include: test
Querying available assets from server: http://staging.refgenomes.databio.org/v2/assets
Genomes do not include: test
Querying available assets from server: http://0.0.0.0:80/v2/assets
Remote genomes: test
Remote assets:
                test/   fasta.chrom_sizes:default, fasta.fai:default, fasta:default

Great. Yes, that's looking perfect.

repo: databio/refgenie


text:
Implement repeat() for Series, Index, and MultiIndex.

Adding repeat() for Series, Index, and MultiIndex.

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.repeat.html
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Index.repeat.html

Codecov Report

Merging #1328 into master will increase coverage by 0.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #1328      +/-   ##
==========================================
+ Coverage   95.23%   95.25%   +0.01%
==========================================
  Files          34       34
  Lines        7373     7401      +28
==========================================
+ Hits         7022     7050      +28
  Misses        351      351

Impacted Files
Coverage Δ

databricks/koalas/missing/indexes.py
100% <ø> (ø)
:arrow_up:

databricks/koalas/missing/series.py
100% <ø> (ø)
:arrow_up:

databricks/koalas/series.py
96.73% <100%> (+0.03%)
:arrow_up:

databricks/koalas/indexes.py
96.5% <100%> (+0.16%)
:arrow_up:

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 a849249...269c775. Read the comment docs.

LGTM, except for just one short question. 👍

Thanks for the replies, LGTM.

authors: codecov-io itholic ueshin

repo: databricks/koalas


text:
Parse row as failed when it contains chars not in defined charset

I got the error below when processing an XML file and only one of the entries had an invalid UTF8 character. The whole DF was failed with exception as below:
Job aborted due to stage failure: Task 40 in stage 100.0 failed 4 times, most recent failure: Lost task 40.3 in stage 100.0 (TID 6343, hadoop-38.backend): [com.ctc.wstx.exc.WstxLazyException] com.ctc.wstx.exc.WstxIOException: Invalid UTF-8 character 0xfffe at char #790, byte #-1)
	at com.ctc.wstx.exc.WstxLazyException.throwLazily(WstxLazyException.java:45)
	at com.ctc.wstx.evt.FilteredEventReader.hasNext(FilteredEventReader.java:72)
	at com.databricks.spark.xml.parsers.StaxXmlParserUtils$.skipUntil(StaxXmlParserUtils.scala:14)
	at com.databricks.spark.xml.parsers.StaxXmlParser$$anonfun$parse$1$$anonfun$apply$4.apply(StaxXmlParser.scala:90)
	at com.databricks.spark.xml.parsers.StaxXmlParser$$anonfun$parse$1$$anonfun$apply$4.apply(StaxXmlParser.scala:82)

I think code below should be changed to add Exception at the end , so any exception happens we don't throw away the whole XML file, but only the affected record:
StaxXmlParser:
iter.flatMap { xml =>
        // It does not have to skip for white space, since `XmlInputFormat`
        // always finds the root tag without a heading space.
        val reader = new ByteArrayInputStream(xml.getBytes)
        val eventReader = factory.createXMLEventReader(reader)
        val parser = factory.createFilteredReader(eventReader, filter)
        try {
          val rootEvent =
            StaxXmlParserUtils.skipUntil(parser, XMLStreamConstants.START_ELEMENT)
          val rootAttributes =
            rootEvent.asStartElement.getAttributes.map(_.asInstanceOf[Attribute]).toArray
          Some(convertObject(parser, schema, options, rootAttributes))
            .orElse(failedRecord(xml))
        } catch {
          case _: java.lang.NumberFormatException =>
            failedRecord(xml)
          case _: java.text.ParseException | _: IllegalArgumentException =>
            failedRecord(xml)
          case _: XMLStreamException =>
            failedRecord(xml)
          **case _: Exception =>
            failedRecord(xml)**
        }
      }

I see. Would we able to resemble CSV's way in Spark (https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVRelation.scala#L138) and use
case NonFatal(e) =>
  ...

instead for
case _: java.lang.NumberFormatException =>
  failedRecord(xml)
case _: java.text.ParseException | _: IllegalArgumentException =>
  failedRecord(xml)
case _: XMLStreamException =>
  failedRecord(xml)

?
BTW, there are similar logics InferSchema we should fix too.

Please go ahead and open a PR if you are interested in this and able to do this. It would be great if we check using NonFatal is safe ahead to doubly make sure and then leave some notes about this.

Looks like this was already done in https://github.com/databricks/spark-xml/pull/261

authors: HyukjinKwon srowen tonizzz

repo: databricks/spark-xml


text:
Some Walkabout icons showing up

In Santa Monica

These appear to be gone

repo: datadesk/web-map-maker


text:
Introduce parquet file format for bulk filesystem

Closes https://github.com/O2-Czech-Republic/proxima-platform/issues/186

Would it be possible to add comments to review and send the complete review as single message? Would help a lot to reduce email spamming. :-)

authors: LesTR je-ik

repo: datadrivencz/proxima-platform


text:
Correction for raw affiliation CEPRISCA - Centre de droit privé et de sciences criminelles d'Amiens - UR UPJV 3911 (Université de Picardie Jules Verne - UFR de Droit et de Sciences Politiques - 10 Placette Lafleur - 80027 AMIENS CEDEX 1 - France); CUREJ - Centre Universitaire Rouennais d’Études Juridiques (UFR de Droit, Sciences économiques et Gestion - 3 avenue Pasteur - CS 46186 - 76186 Rouen cedex 1 - France); IHD - Institut d'histoire du droit Jean Gaudemet (12 place du Panthéon 75006 Paris - France)

Correction needed for raw affiliation CEPRISCA - Centre de droit privé et de sciences criminelles d'Amiens - UR UPJV 3911 (Université de Picardie Jules Verne - UFR de Droit et de Sciences Politiques - 10 Placette Lafleur - 80027 AMIENS CEDEX 1 - France); CUREJ - Centre Universitaire Rouennais d’Études Juridiques (UFR de Droit, Sciences économiques et Gestion - 3 avenue Pasteur - CS 46186 - 76186 Rouen cedex 1 - France); IHD - Institut d'histoire du droit Jean Gaudemet (12 place du Panthéon 75006 Paris - France)
raw_affiliation_name: CEPRISCA - Centre de droit privé et de sciences criminelles d'Amiens - UR UPJV 3911 (Université de Picardie Jules Verne - UFR de Droit et de Sciences Politiques - 10 Placette Lafleur - 80027 AMIENS CEDEX 1 - France); CUREJ - Centre Universitaire Rouennais d’Études Juridiques (UFR de Droit, Sciences économiques et Gestion - 3 avenue Pasteur - CS 46186 - 76186 Rouen cedex 1 - France); IHD - Institut d'histoire du droit Jean Gaudemet (12 place du Panthéon 75006 Paris - France)
new_rors: 03nhjew95;01gyxrk03
previous_rors: 03nhjew95;01gyxrk03;05fe7ax82
works_examples: W4393301419;W4393301446
contact: 2e9a61886f832c2a9f2d90c82b61ea1c:7f9fbb32ddf9791bd9748d9c5ab20f2f @ u-picardie.fr

This issue was accepted and ingested by the OpenAlex team on 2024-10-09. The new affiliations should be visible within the next 7 days.

repo: dataesr/openalex-affiliations


text:
Correction for raw affiliation ISIR UMR 7222, Sorbonne Université, CNRS, Inserm; Univ. Bordeaux, CNRS, INCIA, UMR 5287

Correction needed for raw affiliation ISIR UMR 7222, Sorbonne Université, CNRS, Inserm; Univ. Bordeaux, CNRS, INCIA, UMR 5287
raw_affiliation_name: ISIR UMR 7222, Sorbonne Université, CNRS, Inserm; Univ. Bordeaux, CNRS, INCIA, UMR 5287
new_rors: 057qpr032;01a6zh966;02feahw73;02vjkv261;02en5vm52;05neq8668
previous_rors: 057qpr032;01a6zh966;02feahw73;02vjkv261;02en5vm52
works_examples: W4387705771
contact: dfcb2954005d714d3b0f270fcddc2446:a8eca463571c5422bbf0e31309 @ sorbonne-universite.fr

This issue was accepted and ingested by the OpenAlex team on 2024-11-01. The new affiliations should be visible within the next 7 days.


text:
Correction for raw affiliation Oncology Unit, Macerata Hospital, Macerata, Italy

Correction needed for raw affiliation Oncology Unit, Macerata Hospital, Macerata, Italy
raw_affiliation_name: Oncology Unit, Macerata Hospital, Macerata, Italy
new_rors: 019jb9m51
previous_rors: 0001fmy77
works_examples: W4385514684;W4315701757;W4317915622;W4376114230;W4317492019;W4385077222;W4327919414;W4385142864;W4387893935;W4388979773;W4384576159;W4362601271;W4365135206
contact: d3e3180dcd08125b3cdd0a3f2eb8008f:cb9c5869cc81262042aebd823598786c @ sirisacademic.com

This issue was accepted and ingested by the OpenAlex team on 2024-12-19. The new affiliations should be visible within the next 7 days.


text:
TIFF support

Hello @dataflowg.  Any plans or interest in TIFF support?
This would be great for scientific/engineering applications.
Thanks for your great tools and many community contributions!

Hi @jimkring, thanks for the feature suggestion (and supportive comments!)
I'll have a look at what's involved in adding support (probably with libtiff). It might also be a good opportunity to add some metadata VIs and EXIF support.

There's a new library called LV-TIFF by Simon Klein which provides TIFF support for LabVIEW. It's still under development, but already looks pretty good.

authors: dataflowg jimkring

repo: dataflowg/g-image

license: Unlicense


text:
Keep URI during import

The purpose is to keep Platform's ID within the data available at prototype level.

3H

authors: RachL simonLouvet


text:
add documents for histogram aggregate functions

I think we should add documents for histogram aggregate functions, it would be proper to assign it to me.
References:

https://github.com/datafuselabs/databend/pull/14839
https://github.com/datafuselabs/databend/issues/14588

There you go

https://github.com/datafuselabs/databend-docs/pull/680

repo: datafuselabs/databend-docs


text:
Chem | Scaffold tree coloring: improvements

[x] Coloring for child structures - it's very inconvenient that you can't click the icon again to return to the custom color (you have to click the palette again and choose the custom child color again)
[x] The custom coloring should override the default one (from Structure search)
[x] Add the icon for removing the specific node of the scaffold tree

Chem 1.8.2

repo: datagrok-ai/public


text:
feat(notebook): add data models for Notebook entity

This PR is to add pegasus schema to model Notebook data entity. RFC: https://github.com/datahub-project/datahub/pull/4237
Checklist

[x] The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
[ ] Links to related issues (if applicable)
[ ] Tests for the changes have been added/updated (if applicable)
[ ] Docs related to the changes have been added/updated (if applicable)

While making the above change, could you try merging latest master to see if the build issue gets resolved? Seems irrelevant to this change.

Yes! So aspects and entity-registry.yaml. We want to start making this clear going forward so we can iterate faster on these new entities while not increasing our support load.

repo: datahub-project/datahub


text:
feat(ingest/presto-on-hive): Extracting all the table properties from Hive Metastore

Extracting all the table properties from Hive Metastore  and not just the description

Checklist

[ ] The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
[ ] Links to related issues (if applicable)
[ ] Tests for the changes have been added/updated (if applicable)
[ ] Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
[ ] For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@treff7es looks like there's a bunch of conflicts on this PR


text:
🛑 Passport User Registration Page is down

In 793bfef, Passport User Registration Page (https://portal2.passportindia.gov.in/AppOnlineProject/user/RegistrationBaseAction?request_locale=en) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Passport User Registration Page is back up in 96f8ebd after 3 hours, 3 minutes.

repo: datameet/upptime


text:
Adds contribution docs to understand how to run the tests

The tests didn't run out of the box, so whilst I was working out how to run them I wrote the steps down.
Perhaps it will help others.

Docs are always good, LGTM!

authors: doublethefish laurentS

repo: datamill-co/target-postgres


text:
added better check for chunksha, fixed issue with reloading page on f…

…ailed jobs

@aboudreault

added key check and logging to sha error
fixed issue with refreshing page when test is in error state


text:
JAVA-2297: Add a NettyOptions method to set socket options

Motivation:
Setting socket options on the bootstrap is currently hardcoded in
ChannelFactory. This can cause warnings if the transport is overridden
with an implementation that does not support some of these options (ex:
TCP_NODELAY for Unix domain sockets).
Modifications:
Add NettyOptions#setSocketOptions.
Note that this overlaps with afterBootstrapInitialized. If I had thought
about this earlier, I would have done it in
DefaultNettyOptions.afterBootstrapInitialized. But since we're adding
this in a minor version, I kept it separate so that existing
NettyOptions implementations don't suddenly stop setting socket options.
Result:
NettyOptions implementor can customize which socket options are set.

Force-pushed to do it in afterBootstrapInitialized. I added a note in the upgrade guide since this is still a relatively high-level feature.

repo: datastax/java-driver


text:
[HW] Kamlesh Mali

Name: Kamlesh Mali
Email: kamleshmali81@gmail.com
Linkedin Profile: https://www.linkedin.com/in/kamleshmali81/
Attach the homework step I screenshots below:

Attach the homework step II screenshots below:

Hey Kamlesh Mali, great job! Congrats! Here is your badge! https://api.badgr.io/public/assertions/illGWlKYT8SbUnH9MOpnYg

repo: datastaxdevs/workshop-spring-stargate


text:
fix ranger-hbase

Fixed the problem of invalid permissions caused by hbase enabling ranger to execute enable-hbase-plugin.sh error.

缺少配置执行enable脚本报错如下
******* ERROR: unable to process xml configuration changes due to error:org.apache.ranger.utils.install.XmlConfigChanger$ValidationException: ERROR: configuration token [XAAUDIT.AMAZON_CLOUDWATCH.ENABLE] is not defined in the file: [/opt/datasophon/hbase/ranger-hbase-plugin/install.properties]
java.lang.RuntimeException: org.apache.ranger.utils.install.XmlConfigChanger$ValidationException: ERROR: configuration token [XAAUDIT.AMAZON_CLOUDWATCH.ENABLE] is not defined in the file: [/opt/datasophon/hbase/ranger-hbase-plugin/install.properties]
at org.apache.ranger.utils.install.XmlConfigChanger.run(XmlConfigChanger.java:198)
at org.apache.ranger.utils.install.XmlConfigChanger.main(XmlConfigChanger.java:77)
Caused by: org.apache.ranger.utils.install.XmlConfigChanger$ValidationException: ERROR: configuration token [XAAUDIT.AMAZON_CLOUDWATCH.ENABLE] is not defined in the file: [/opt/datasophon/hbase/ranger-hbase-plugin/install.properties]
at org.apache.ranger.utils.install.XmlConfigChanger.replaceProp(XmlConfigChanger.java:458)
at org.apache.ranger.utils.install.XmlConfigChanger.run(XmlConfigChanger.java:195)
... 1 more

repo: datavane/datasophon


text:
Set skip_on_upstream_skip = False

Hoe configureer je task parameters als je geen @task decorator gebruikt?
https://docs.prefect.io/core/concepts/tasks.html#overview

@task is syntactic sugar for task()
so you can write your_task = task(your_func, skip_on_upstream_skip = False)

repo: dataverbinders/nl-open-data


text:
[Bug] When zoomed in and at the border of an image, moving your finger down will call requestDisallowInterceptTouchEvent(false)

So just to reclarify:

Zoom in an image
Move to the left or right edge of the image
Swiping / moving your finger down will allow the parent to intercept the touch event

The expected behaviour is:

Zoom in an image
Move to the left or right edge of the image
Swiping / moving your finger down will do nothing
Swiping / moving your finger left / right will allow the parent to intercept the touch event

I assume this would happen because when you swipe down there's still a small horizontal component to the swipe in most cases. The simple fix is probably to only call requestDisallowInterceptTouchEvent(false) if dx > dy at line 824. I don't have an app I can test this in easily, if I made that change would you be able to test it?

Yup, if you dump it in a gist or here I'll test straight away. Cheers.

Change line 824 from } else if (dx > offset) { to } else if (dx > offset && dx > dy) {. This is partly guesswork!

Hmm not quite.
This stops the described issue but now swiping down will never pass on the touch event...

Okay, so it needs the same edge detection on the Y axis as it has on the X axis? That would allow a vertical scrolling view pager.

I think so.

Fixed by PR #302, will be in the next version.

authors: davemorrissey laurencedawson


text:
Automate bringing up tailscale on a new node

Assuming a public key has been deployed, bring up tailscale.
This'll force the issue of dealing with secrets.

May be blocked by #10 for non-Pi nodes

https://tailscale.com/kb/1085/auth-keys/ for using --auth_key
https://forum.tailscale.com/t/automating-enrollment-configuration-using-ansible/824/3 has some useful script fragments

Consider using tagging
https://tailscale.com/kb/1068/acl-tags/#generate-an-auth-key-with-an-acl-tag

repo: davewsmith/homelab


text:
Portfolio: desktop version

here is the version of my desktop site built with media queries as well as HTML and CSS

ok I fixed the margin problem on the right,  I fixed the placeholder text, I fixed the buttons, I fixed the margin on the project section, and I improved my readme

hi @mgmediaweb I am happy to make changes could you please be a little more specific i only have one code review left

Ok I remade my entire middle section to make it more responsiveness  I hope that is enough

as well as change other projects with the desktop page

ok I fixed the overlapping of text,  I created more empty spaces on both sides (left and right) of your work sections, and i improved my readme


text:
Dynamic height

For carousels with various height slides, and option to recalculate/change height of view-port would be beneficial. Often images comes with captions of various heights, for example.

Hello @henrijs,
Than you for your feature request. This is a duplicate of issue #57

If you're interested in my reasoning about this feature request, read the whole issue here.
If not, jump directly to the solution.

Kindly,
David

Duplicate of #113.

authors: davidcetinkaya henrijs

repo: davidcetinkaya/embla-carousel


text:
Can't get Embla working in Angular

Hi, I found your lib after looking at many carousel libraries. I like yours because it's clean and light weight.
I've made an Angular wrapper around it and it works for static content. But I can't seem to get it working with content that's dynamically generated from an api request.  Using the ngFor loop to generate the slides Embla returns empty node array and nothing works.
I guess it's only for static content? or am I doing something wrong?

Hello @alxv2016,
Thank you for opening this issue and your kind words.
Actually, I created issue #18 some time ago called Build an Angular wrapper but at the time it didn't get any traction. At the time of writing there are 2 packages available for Embla:

embla-carousel - Vanilla Javascript
embla-carousel-react - React

I use React every day at work so it was kind of natural for me to build the React Wrapper for Embla. It works with dynamic content in React so I'm thinking that pretty much anything you can do with React should be possible to achieve with Angular?
I'm not familiar with Angular component lifecycles like ngAfterViewInit() and similar. Without knowing exactly how it works I'm guessing two things that could be causing the issue:
1. Embla is initialised before the slides has been generated
Maybe it's initialised before the API response has finished. Or maybe it's initialised in the wrong component lifecycle method. Basically you could try to tweak where you initialise the carousel.
2. Embla is not aware that something has changed
If something changes after the carousel already have been initialised (like an API response affecting the number of slides or similar), you have to tell this to Embla. I think there should be a component lifecycle method that's appropriate for this like ngOnChanges?
This is one way to tell Embla that something has changed:
// Initialise Embla
const options = { loop: false };
const embla = EmblaCarousel(emblaNode, options);

// As described in the API documentation:
// https://github.com/davidcetinkaya/embla-carousel#changeoptionsoptions
// Applies passed options by doing all the necessary calculations and initialising the carousel from scratch.
embla.changeOptions(options);

👉 Preferable solution?
I'd be happy if someone would want to build an Angular wrapper by looking at how other carousel wrappers like Angular Flickity have solved this. I'm going to add the label help wanted and see if someone can help us out with this.

Hello @alxv2016,
Thank you for opening this issue and your kind words 👍.
Actually, I created issue #18 some time ago (Build an Angular wrapper) but at the time it didn't get any traction. At the time of writing there are 2 packages available for Embla:

embla-carousel - Vanilla Javascript
embla-carousel-react - React

I use React every day at work so it was kind of natural for me to build the Embla React Wrapper. It works with dynamic content in React so I'm thinking that pretty much anything you can do with React should be possible to achieve with Angular?
I'm not familiar with Angular component lifecycles like ngAfterViewInit() and similar. Without knowing exactly how it works I'm guessing two things that could be causing the issue:
1. Embla is initialised at the wrong time
Maybe it's initialised before the API response has finished and before the slides are generated. Or maybe in the wrong component lifecycle method. Basically you could try to tweak where you initialise the carousel.
2. Embla is not aware that something has changed
If something changes after the carousel already have been initialised (like an API response affecting the number of slides or similar), you have to tell this to Embla. I think there should be a component lifecycle method that's appropriate for this like ngOnChanges()?
This is one way to tell Embla that something has changed:
// Initialise Embla
const options = { loop: false };
const embla = EmblaCarousel(emblaNode, options);

// As described in the API documentation:
// https://github.com/davidcetinkaya/embla-carousel#changeoptionsoptions
// Applies passed options by doing all the necessary calculations and initialising the carousel from scratch.
embla.changeOptions(options);

👉 Preferable solution?
I'd be happy if someone would want to build an Angular wrapper (maybe by looking at how other carousel wrappers like Angular Flickity have solved this). I'm going to add the label help wanted and see if someone can help us out with this.

Thanks I appreciate the quick response, I will investigate this from the sounds of it I'm guessing Embla is not aware of the changes so option 2 is probably the fix I need.

I hope this helps @alxv2016. I'd be happy if you let me know how it goes.
Cheers!
David

So the only way I could get Embla running was to use an "asyncScheduler" in RXJS which is pretty much a "setTimeOut" method the RXJS way.
I've tried all the Angular lifecycles and they won't work for some reason, Embla will always init before the dynamic api content is loaded. This is because thought my Embla component is a child component to be used in multiple other components.
With the asyncScheduler Embla is initiated after the api responses so the carousel is up and running, however now in my other component I cannot access the Embla instance and it's properties it will always return undefined. The only work around to this was for me to create an RXJS Subject to subscribe too in other components.
Wondering if there's a better way?

Hey @alxv2016,
I'm by no means an Angular expert by I'm guessing that using RXJS to solve the issue could be overdoing it. Would you mind sharing your API request code and how you're populating the container slides upon the response?

Hello @alxv2016,
Not to rush you or anything, but do you have an updates on this issue?
Kindly,
David

Closing due to inactivity. Feel free to re-open this issue if you’d like to proceed with this.
Thank you!

I'm not sure if I should close my issue or not. I can confirm that setting a setTimeOut "fixes" it. My issue contains a bit more of info regarding the error displayed when trying to drag but I think it's essentially the same issue reported here.

authors: alxv2016 davidcetinkaya nnvnzndrvn


text:
Confusing error message when arguments in trycast functions are swapped

Consider the following MRE where within the print function, I've swapped the argument position in the trycast function:
# script.py

from trycast import trycast
from typing import TypedDict

class Person(TypedDict):
    name: str
    age: float

p: Person = {"name": "mike", "age": 61.0}

print(trycast(p, Person))

Here, the first argument of the trycast function is the object (instead of the type) and the second argument is the type (instead of the object). It invokes the following error:
Traceback (most recent call last):
  File "/home/rednafi/workspace/personal/demo/script.py", line 12, in <module>
    print(trycast(p, Person))
  File "/home/rednafi/workspace/personal/demo/.venv/lib/python3.9/site-packages/trycast.py", line 232, in trycast
    if isinstance(value, type):  # type: ignore
TypeError: isinstance() arg 2 must be a type or tuple of types

IMHO, this is a leaky abstraction and the error should be handled in a graceful manner.  To fix this, we can take some inspiration from the typing.cast function. If we swap the argument position in the typing.cast function, mypy throws the following error:
# script.py
from typing import cast
from typing import TypedDict

class Person(TypedDict):
    name: str
    age: float

p : Person = {'name': "hello", "age": 11.0}

print(cast(p, Person))               # Notice we're using `typing.cast` instead of `trycast`

script.py:14: error: Variable "script.p" is not valid as a type

This error is concise and less confusing.
Test Bench:
Python Version: 3.9.5
Operating System: Ubuntu 20.04

Agreed that the error could be improved in this case.
I expect a challenge may be some difficulty in recognizing whether the first argument is actually a "valid type". Likely the implementation of cast could be consulted as a pointer.
I don't expect to have the bandwidth to make this improvement myself for the next few months, so I will welcome PRs from others in this area. :)

I'm looking into the internals and will start working once I'm confident enough to make the changes. Thank you for your prompt response. Until then, let's keep this open.

I think this can be fixed using typing._type_check(), which is used internally for things like Optional, eg.
>>> a: Optional[p]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.9/typing.py", line 275, in inner
    return func(*args, **kwds)
  File "/usr/lib/python3.9/typing.py", line 352, in __getitem__
    return self._getitem(self, parameters)
  File "/usr/lib/python3.9/typing.py", line 475, in Optional
    arg = _type_check(parameters, f"{self} requires a single type.")
  File "/usr/lib/python3.9/typing.py", line 164, in _type_check
    raise TypeError(f"{msg} Got {arg!r:.100}.")
TypeError: typing.Optional requires a single type. Got {'name': 'mike', 'age': 61.0}.

This check could be implemented with
# (from typing import _type_check)

_type_check(tp, "trycast() requires a type as its first argument.")

which would throw
TypeError: trycast() requires a type as its first argument. Got {'name': 'mike', 'age': 61.0}.

I wonder how you think about importing a "private" function in trycast.

I wonder how you think about importing a "private" function in trycast.

It's not really a problem so long as there is test coverage. There's some additional maintenance burden if the function disappears or has an unstable implementation, but I don't think either of those will likely be the case for this function.

authors: d-k-bo davidfstr rednafi

repo: davidfstr/trycast


text:
Docs: Add target option (Wheel Gestures Plugin)

add info about the newly added target option

Thank you for updating the docs @xiel ⭐.

authors: davidjerleke xiel

repo: davidjerleke/embla-carousel


text:
Linting rules

Would you be opposed to a PR implementing AirBnB's eslint rules? https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb

I'd love to add AirBNB's eslint config into RRF and start linting, sure! I'll add it soon.

I can give it a go if you'd like. If/when you have time, send me a message on discord's reactiflux.

Closed via https://github.com/davidkpiano/react-redux-form/pull/30

authors: chrisblossom davidkpiano

repo: davidkpiano/react-redux-form


text:
XState Viz crashing

Description
When i try the paste code below it crashes and the screen goes white.
I get a "Uncaught TypeError: Cannot read property 'indexOf' of undefined" error.
Reproduction
post below xstate.
It seems to be something with the actions?
I removed them and it worked fine.
I dont think the problem is on my end (im a newb so maybe idk)

const questMachine = Machine({
    id: 'quest',
    initial: 'posted',
    context: {
        creator: 'hello2',
        receiver: 'world2'
    },
    states: {
        posted: {
            on: {
                PICKEDUP: 'active'
            },
            entry: {
                actions: 'addReceiverID'
            }
        },
        active: {
            on: {
                TURNIN: 'turnedin',
            },
            initial: 'unstarred',
            states: {
                unstarred: {
                    on: {
                        STAR: 'starred'
                    }
                },
                starred: {
                    on: {
                        UNSTAR: 'unstarred'
                    }
                }
            },
            entry: {
                actions: 'addCreatorID'
            }
        },
        turnedin: {
            on: {
                ACCEPTED: 'completed'
            }
        },
        completed: {
            type: 'final'
        },
    }

},
{
    actions: {
        addCreatorID: assign({
            creator: 'hello'
        }),
        addReceiverID: assign({
            receiver: 'world'
        })
    }
})

I think your entry keys should be a string or an array of strings.

The problem is not what's wrong in this code, the problem is that while I was making a state machine the XState Viz crashed and I lost all my progress. I know it's my fault but still is worth noting it.

Yep, makes sense. Of course we can have problems on the code of the machine itself, but the viz shouldn't break because of this!
I just pointed the problem there to help to actually fiz that specific issue on the machine config.

Closing - this will be fixed soon and issues with XState Viz (the current visualizer) should be moved to github.com/statecharts/xstate-viz

authors: Iskereat davidkpiano ivorpad marceloadsj

repo: davidkpiano/xstate


text:
before bots working , now not?

I had the proxies of a page.
but ,any new proxy now does not work.
even check proxies , but not.
I do not change any settings
I only get closed shocks

Get proxies from good sites like http://proxybag.blogspot.com/ or www.vipsocks24.net or both


text:
Fix pnpm lockfile

pnpm install
I guess this got broken by a recent dependabot PR (maybe because of a badly handled merge conflict (or something that wasn't actually surfaced as a merge conflict but which disagreed between two PRs)).

Yeah, I think there might have been a bad merge between #3585 and #3586.


text:
[question] is obfuscating code makes it slower in any ways ?

is obfuscating code makes it slower in any ways ?

Yes obfuscation will slow down a script as well as use more memory. However, in most cases the slower speed is negligible compared to the code you may be obfuscating such as a game which loading images would probably take longer.

repo: davidteather/python-obfuscator


text:
NotificationEvent in Examples?

Hi David,
is it planed to handle notification events from ebay with the sdk-examples?

No

authors: JProof davidtsadler

repo: davidtsadler/ebay-sdk-examples


text:
Missing Threads::Threads target when using static dlib and dlibConfig*.cmake

Expected Behavior
No cmake error.
Current Behavior
Target "my_target" links to target "Threads::Threads" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?

Steps to Reproduce
I use dlib in my cmake project the following way:
find_package(dlib CONFIG REQUIRED)
# [...]
target_link_libraries(my_target dlib::dlib)

As far as I understand this is a limitation of how cmake handles "transitive dependencies" (dependencies of dependencies that become direct dependencies of a target). This is usually only an issue with static linking.
When linking with a static library, the target has to link to the dependencies of that library. When dlib links statically with CUDA, the Threads::Threads dependency is added by FindCUDA.
When my_target links statically with dlib, it has to link dlib's dependencies, including the ones inherited from CUDA. dlib's cmake config file only lists the Threads::Threads dependency but does not find it like FindCUDA does.
As a workaround it's possible to fix the error by adding find_package(Threads) as the cmake error suggests. This way my_target finds the Threads::Threads dependency for dlib, even if my_target doesn't use Threads::Threads directly.
This could be a duplicate of issue #2107.

Version: 19.22
Where did you get dlib: emerge dlib (distribution package manager)
Platform: Gentoo linux
Compiler: gcc (Gentoo 11.2.0 p1) 11.2.0
Cmake version: 3.22.2

Gentoo isn't a platform that's officially supported (https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html) and my experience is that they are pretty serious about really not supporting other platforms.  I know people make it work sometimes anyway.  So this isn't surprising that there are issues.
Anyway, if there is some PR you can make that works around this I'm cool with it so long as it doesn't break or harm other dlib users in some way.

The problem isn't with CUDA. FindCUDA isn't even a part of CUDA, it's part of cmake (It's also deprecated). It's a problem with dlib's cmake config.
The problem should be visible on unix platforms (FindCUDA only adds the Threads dependency on unix), when dlib was linked statically with CUDA (the default) and is being linked statically (also default) and when using the cmake config file.
The dlib examples do not use the generated dlib cmake config file. Building like that would not trigger the error (when including dlib's CMakeLists.txt directly, FindCUDA will call find_package(Threads) and cmake will know about the target, but when dlib's cmake config is used FindCUDA is not used).
If a cmake project already depends on Threads the error would also be no error as the Threads::Threads target would already be known to cmake (essentially the same as the workaround, but find_package(Threads) isn't being called for dlib).
The solution is to make dlib config call find_package(Threads) when it's required. (Stackoverflow example). When cmake generates the config file it adds the required targets, but does not actually generate the find_package calls to find the targets.

authors: APTX davisking

repo: davisking/dlib


text:
Topic Classifier Changes

App with old classifier

App with new classifier

The code changes LGTM, pls fix the lint errors.

repo: daxa-ai/pebblo


text:
Testing

Testing library is already set up, just need to do the things
Things to test:

[x] Skus maintains this shape

{
    sku_abc123: 1,
    sku_xyz456: 4,
}

This is the source of truth formatCheckoutData. When addItems is fired, the related sku ID updates the quantity (the number next to it)

[x] Checkout data is formatted to maintain this shape:

[
    {
        sku: 'sku_abc123',
        quantity: 1
    }
]

The function formatCheckoutCart is what handles this.This might mean writing tests for formatCheckoutCart as well, which actually relies on the skus object

[x] Delete Item deletes specific item from cart.skus

[x] Store last clicked Stores the value of the last clicked item (saves skuID)

[ ] redirectToCheckout gets the required data to go to Stripe's checkout experience. The items array, successUrl after successful purchase and cancelUrl for cancelled payments.

[x] Handle quantity change handles updating the skus object after an item is added or removed via updateQuantity function. If the quantity drops to 0 or if quantity doesn't exist, the sku is removed from the skus object

[x] toggleRightMenu should be refactored to something like, "shouldDisplayCart" or something. This would be a boolean

[ ] Total Price totals up all prices of all products properly

@all-contributors please add @doingandlearning for tests
@all-contributors please add @theianjones for tests

@all-contributors please add @theianjones for tests

@all-contributors please add @doingandlearning for tests

@all-contributors please add @dayhaysoos for being dayhaysoos

@all-contributors please add @dayhaysoos for test

@all-contributors please add @dayhaysoos for test

wtf 😡

@all-contributors please add @dayhaysoos for test

@all-contributors please add @dayhaysoos for tests

@all-contributors please add @dayhaysoos for test

FFFFFFFFFFFFFFFFF

@all-contributors please add @dayhaysoos for tests

I was looking into writing tests for redirectToCheckout:

[ ] redirectToCheckout gets the required data to go to Stripe's checkout experience. The cartItems, successUrl after successful purchase, and cancelUrl for canceled payments.

But it looks like the code is currently using hardcoded http://localhost:8080 URLs instead of successUrl and cancelUrl.
https://github.com/dayhaysoos/use-stripe-cart/blob/5e24747a2837e8d94db68f30ae0bb17c20df9dd2/src/index.js#L269-L278
Perhaps you meant to pass the successUrl and cancelUrl from the CartContext like so:
const { error } = await stripe.redirectToCheckout({
  items: checkoutData,
  successUrl,
  cancelUrl,
});

What should be tested
Alongside the concerns above, what is it exactly that the tests that need to be written will be testing? As far as I can tell, redirectToCheckout should always get cartItems, successUrl, and cancelUrl because those variables are in scope for it.

Also, I believe that in the above code for redirectToCheckout, the error object should be returned so that the developer can handle notifying their user that an error occurred instead of simply logging it where the average user won't know to check.

Yes, the success and cancel urls should be passed from CartContext the way you described it. We should account for two more things:
billingAddressCollection I believe this could be a boolean, if the seller wanted to collect billing address.
there's also shippingAddressCollection which is supposed to be an object of an array of countries that the seller will ship to.
    allowedCountries: ['US', 'CA'],
  }```

From the docs: https://stripe.com/docs/payments/checkout/customization

We can probably give the Provider the array only, so:

<CartProvider
allowedCountries: ['US', 'CA']
/>

Also, I believe that in the above code for redirectToCheckout, the error object should be returned so that the developer can handle notifying their user that an error occurred instead of simply logging it where the average user won't know to check.

Totally agree, I really appreciate your help!

@all-contributors please add @ChrisBrownie55 for test

@all-contributors please add @ChrisBrownie55 for test

@all-contributors please add @ChrisBrownie55 for code

@all-contributors please add @dayhaysoos for test

@all-contributors please add @dayhaysoos for code

@all-contributors please add @doingandlearning for code

Is this ready to be closed or should we open up a new testing issue that includes the relevant sections of code that need to be tested now?

@ChrisBrownie55 I think this could be closed, I think we have full test coverage, yeah? We might as well just include tests as part of feature releases. Good work everyone!!!!

repo: dayhaysoos/use-stripe-cart


text:
No module named schedule.main; 'schedule' is a package and cannot be directly executed

Hello,
This is the message i had from vs code debug. i have installed schedule 1.0.0 in a virtual env python 3.9.1 version. if i run it with jupyterlab, i have no problem.
I have checked that my python interpreter is correctly configured (Python 3.9.1 64-bit ('venvp39') and that scheduler is installed in my 'venvp39' folder.
What should I do with VSC (version1.54.1) please ? i haven't found a solution on google or stackoverflow for the moment.
Thanks for your help ;-)

wrong image

Works perfectly in jupyterlab

Hi @joris-devdata, I'm glad to hear you are giving schedule a try. The problem you are experiencing seems to be caused by visual studio code since schedule works fine in jupterlab. I think you will be getter much better help by asking the VSC community, either on Github, Reddit or Stackoverflow.

Allright, i will. As soon as i have an answer, i will share ;-)

authors: SijmenHuizenga joris-devdata

repo: dbader/schedule


text:
Remove the tool. part of the pyproject.toml section

Hey @dbatten5, first of all, thanks for the package, it's awesome :)
Would it be possible that instead of using [tool.acme] we could use directly [acme]?
Thanks!

hey @lyz-code, thanks for raising an issue. just wondering why you prefer [acme] instead of [tool.acme]? i ask as having [tool.x] seems to be the standard practice, looking at big name tools like isort, black and pytest (although admittedly they use [tool.pytest.ini_options]

Ouch, ignore the issue, I don't know why I had in my mind that black, pytest and isort didn't use the tool. prefix.

https://www.python.org/dev/peps/pep-0518/#tool-table
@lyz-code PEP 518 defines the tool table in pyproject.toml

authors: dbatten5 lyz-code wwuck


text:
Improve SQL folding perfomance

As of DBeaver 7.2.5 EA, when a ton of SQL statements are folded, the overall typing experience in the SQL editor is severely compromised. We need to improve that.

SQL折叠，无法实现 if endif的对应，还有一些其他语法的对应，建议优化

SQL folding, unable to achieve if ENDIF correspondence, there are some other syntax corresponding, it is recommended to optimize

Read and debug stored procedures like the toad tool

Performance on large scripts has been massively improved. The only weak spot left is the situations like opening a multiline comment in the middle of the file.

verified

authors: akilovich uslss wmdeepsea

repo: dbeaver/dbeaver


text:
Date type is recognized as Varchar during the import from CSV

System information:

Operating system (distribution) and version Win10
DBeaver version 7.3.3

Connection specification:

Database name and version Informix

Cannot be reproduced anymore


text:
"Sort proposals alphabetically" does not work, version 22.3

Description
I've clicked the checkbox in settings to sort column proposals but it has no effect.
I cannot update the installation, this is software provided by my employer. I work in fintech, security restrictions are tight.
I regularly work with tables that have 40 or more columns.
Is there a workaround or anything I could try to get this working. My current workaround is to use dbeaver v5.
DBeaver Version
CE 22.3
Operating System
Win 10
Database and driver
DB2
No connection issues
Steps to reproduce
Hit ctrl-space in any sql, look at column sort order.
Additional context
No response

At the moment we're intentionally don't apply alphabetical sorting to column names. It was done in #12140

Thank you for your report.

authors: E1izabeth arhayka tongeha