Proposal: Provide specialized collections aka Power Collections

@ViktorHofer commented on Thu Jul 19 2018
Proposal
We are hitting limitations with our in-built collections all over the places, either performance based (i.e. allocation) or feature based). After talking with @jkotas offline we agreed that it would be ideal if we would provide commonly used specialized collections (like a Dictionary<string, string> or a PriorityQueue) as a source based nuget package. That would allow us to provide basic enhanced functionality over the general purpose inbox types but still the ability to tweak them on demands.
Considerations:

What kind of collection types would benefit from specialization?
Where do we see gaps to our competition (again, performance or feature wise)?
Where would such a package be hosted and how would it be deployed? (corefx vs community corefx repo)
Is a source based nuget package feasible and are we easily able to use it inside corefx?

Example
Currently working in Regex to avoid allocation I stumbled upon places where Unicode categories are statically stored in a Dictionary<string, string>. Trying to get the value out of it involves allocation because there is currently no way to pass a ReadOnlySpan as a key in to get the value. Providing a specialized version would allow us to add an additional overload for ReadOnlySpan.
References
Dictionary/List ref api additions: https://github.com/dotnet/coreclr/pull/17405#issuecomment-378627247
PriorityQueue: https://github.com/dotnet/corefx/issues/574#issuecomment-308491122 & https://github.com/dotnet/corefxlab/pull/1850
OrderedDictionary<,>: https://github.com/dotnet/corefx/issues/26634
cc @jkotas @karelz @benaadams @danmosemsft

@danmosemsft commented on Thu Jul 19 2018
Perhaps we could have a Dictionary implementation specialized for keys of type int -- that would be used by k-nucleotide (given they accept use of Long2IntOpenHashMap by Java 😕 ).
Why do you propose a source based package?
@stephentoub

@danmosemsft commented on Thu Jul 19 2018
cc @AnthonyLloyd for that.

@prajaybasu commented on Thu Jul 19 2018
I hope adding OrderedDictionary<TKey, TValue> is also being considered. (Related: #26634)

@ViktorHofer commented on Thu Jul 19 2018

OrderedDictionary<TKey, TValue> would also be nice. (Related: #26634)

Thanks I added it to the links.

Why do you propose a source based package?

One of the requirements for such a package would be that we can change it frequently for our inbox stuff (i.e. adding new apis that accept types that we just added in master) but still have a stable version that ideally targets netstandard. We did the same with Span by cross-compiling for netstandard and netcoreapp. That is definitely an approach we can think about but during my discussion with @jkotas he pointed out that source based nuget packages are more versatile as consumer will always want to fine-tune their collections which is easily possible with that approach.

@AnthonyLloyd commented on Fri Jul 20 2018
Possibly:

A counting Dictionary<K,int> (or even Dictionary<int,int>) with Increment(K key) and Decrement(K key). For reference counting etc.
An aggregating Dictionary<K,V,R>(Func<V,R> seed, Func<R,V,R> accum) with Add(K v, V v).

Possibly 2) could be used in Enumerable.GroupBy.

@benaadams commented on Thu Jul 19 2018
A fast Type Dictionary<Type, ...> e.g. https://github.com/benaadams/Ben.TypeDictionary
For DI etc

@AnthonyLloyd commented on Fri Jul 20 2018
@benaadams I always assumed the following through some magic had good perf
static class TypeHolder<T>
{
    public static string Value;
}

TypeHolder<int>.Value = "int";
TypeHolder<string>.Value = "string";

@benaadams commented on Fri Jul 20 2018
@AnthonyLloyd alas the generic is a process wide singleton (can be only one); and doesn't work well with GC

@benaadams commented on Fri Jul 20 2018

Where would such a package be hosted and how would it be deployed?

corefxlab, myget; graduate to corefx, nuget
Being in corefx doesn't mean it can't be a nuget only package

community corefx repo

Only if MS doesn't want to support it going forward and/or wants to hand commit/management rights over to non-MS. Don't think that necessarily helps the .NET OSS community as now you have an officially sanctioned OSS section; where does that leave regular repos?

@shaggygi commented on Sun Jul 22 2018
I still think it would be beneficial to have Immutable Parent/Child Collection, but understand it is not specifically related to this thread.
@ViktorHofer, @jkotas to expand on what I'm looking for, it appears @sharwell was working on something similar here... https://github.com/tunnelvisionlabs/dotnet-trees
Few links:
https://stackoverflow.com/questions/9304404/how-to-create-a-completely-immutable-tree-hierarchy-construction-chicken-and-eg
http://concurrencyfreaks.blogspot.com/2013/10/immutable-data-structures-are-not-as.html

@AndyAyersMS commented on Sun Jul 22 2018
For fast dictionaries consider different hash -> bucket mapping strategies. The current dictionary's modulo a prime is slow (about 1/3 the cycle cost for a successful TKey=int lookup these days).
Custom vs/default comparators should be supported via subtyping or parameterization and not by options passed to the constructor, so the jit doesn't need heroics to inline comparators. If via subyping, the fast dictionary classes should be sealed.
For types where hash recomputation is cheap (ints), avoid storing the hash.
.Net settled long ago on the parallel array setup but different approaches may have appeal, eg a chunked array setup that is able to avoid LOH and should be cheaper to grow. Maybe also consider approaches that allow some mutate on read so if there are collisions frequently accessed elements can be made cheaper to find by migrating them earlier in the collision chains.

@ViktorHofer commented on Mon Jul 23 2018
Thanks Andy, whoever is going to implement a fast dictionary will benefit a lot from your info.
I propose we talk about this in the Design/API review meeting. If we agree to provide these collections either inbox or as a nuget package I believe we could implement them (together with community members who are interested) fairly quick.

@Zhentar commented on Tue Jul 24 2018
There are two specialized hash maps I'd like to see.

Fast ulong keyed map. Basically, applying all the optimizations Andy mentioned. My use case is string atomization while parsing Utf8 streams; when I've got a token I need to stringify, I hash the raw bytes with a high quality 64-bit hash function so that the risk of collision is low enough (even accounting for the birthday paradox) that I can treat hash equality as value equality. I'd also prefer an open addressing hash table algorithm that only takes one cache miss on random lookups ( unfortunately this last part is incompatible with a fast K-Nuc dictionary mentioned in dotnet/coreclr#15419 because K-Nuc benefits tremendously from coalesced chaining preserving insertion order locality)

string keyed map which assumes reference equality for equal values. As long as my strings are atomized it would be nice to get an extra bit of efficiency out of dictionaries using them as keys.

@danmosemsft commented on Tue Jul 24 2018
Last time we discussed this it got wedged on the discussion of whether there should be a new repo. @joshfree @weshaggard is corefxlab a suitable place to put experimental code that has some infrastructure (CI) and the ability to package for nuget and might graduate to corefx later?
@karelz

@ViktorHofer commented on Tue Jul 24 2018
If we ship this as a normal nuget package (not source based) this should live in corefx as we want to use it internally in master. Also as a buid from source requirement I believe we must live build netcoreapp asset.

@joshfree commented on Tue Jul 24 2018
@danmosemsft yes corefxlab is the appropriate place for something like this to begin while we’re unsure if it should be promoted to corefx or not.

@mikedn commented on Wed Jul 25 2018

string keyed map which assumes reference equality for equal values

How's that different from a normal dictionary using an appropriate key comparer? (apart from the cost of interface calls that the normal dictionary incurs).

@Zhentar commented on Wed Jul 25 2018

(apart from the cost of interface calls that the normal dictionary incurs).

In a sufficiently tight loop, that's enough :) (combined with the assumption that it's worthwhile to store both the key and the hash code and check for the equality of both)

@danmosemsft commented on Mon Jul 30 2018
Here's what we are going to do. We do want such a package for extended collections. I will move this issue to corefxlab. We will create a package with a name something like System.Collections.Extensions  (or System.Collections.Experimental) and put types in a temporary namespace (eg System.Collections.Extensions.Experimental) so we have the option of moving some into the BCL if they prove worthy. This will publish to myget to start.
The goal of this is to develop useful collections, but it would be nice if the kNucleotide maintainer would allow it also.

We may want to consider resurrecting the MultiValueDictionary corefxlab prototype as part of a System.Collections.Specialized / Power Collections package

I'm a big fan of supporting B+-trees for storage density, low worst-case allocation rates, and ability to avoid the large object heap. I'm not sure about the source-based distribution though.

I'm generally supportive, provided:

We don't use the System namespace. Otherwise, we'll run into trouble if we ever have to put collection types proven to be useful into the product. Yes, we can type forward down, but I'd rather have a clean-split to avoid having to deal with that level of fragility.

We shouldn't be using a source distribution model. For starters, this means supporting any other language but C# is virtually impossible. And second, we're investing in linker technology right now. We should make sure it plays nicely with it, which should be doable as there shouldn't be any crazy, statically undiscoverable interdependencies.

@danmosemsft @joshfree Can we ship signed packages out of CoreFxLab?

Should be able to design a single writer multiple reader dictionary. This is a pattern that comes up to and time again for caches but concurrent dictionary adds a decent overhead.

Can we ship signed packages out of CoreFxLab?

@dagood can maybe answer that. For now what matters is that corefxlab already supports packaging and pushing to myget automatically.

@terrajobst what is the API review process like for this work. My assumption is that it does not come into play unless and until we want to graduate types into CoreFX. Is that right?

Can we ship signed packages out of CoreFxLab?

We did for the SignalR alpha releases.

I don't know about corefxlab, but it's really just another signing submission with a different cert.

@dagood @mmitche we can chat offline

double-ended-list (dequeue) based on a buffer (but without copy-down semantics, and without needing a doubly-linked-list)

pool based collections

How about specialized concurrent collections? Bounded vs unbounded, single producer/consumer vs multiple ones.

Would be nice to remove some of MSBuild's custom collections:
https://github.com/Microsoft/msbuild/blob/master/src/Build/Collections/PropertyDictionary.cs
https://github.com/Microsoft/msbuild/blob/master/src/Build/Collections/RetrievableEntryHashSet/HashSet.cs

@cdmihai I'm quite proud of those two!

@terrajobst I'm thinking we drive  this as follows:

Solicit issues in this repo for proposed types, using roughly the API review format. Some already have had good discussion in Corefx that we can build from.
We select two or three to start with that have clear value and a reasonably clear shape, and invite volunteers to offer PR's, with tests, perf measurements etc
Iterate over time based on feedback on the experimental package. Add more types.
Where types seem proven and worthy, graduate them to CoreFX proposals where they would go through formal API review for the BCL.
@jfree @ahsonkhan is that roughly the pattern Span, Pipeline,... followed? Without formal API review until graduation? Was that a good model?

Where types seem proven and worthy, graduate them to CoreFX proposals where they would go through formal API review for the BCL.
@jfree @ahsonkhan is that roughly the pattern Span, Pipeline,... followed? Without formal API review until graduation? Was that a good model?

We had architects guiding the project along within corefxlab (stewards), but yes, that is the pattern that Span, Pipelines, etc., followed especially during the experimentation and prototype phase. Yes, it worked relatively well. If the API sets starts getting too large, I would stage the graduation to CoreFX and the formal API review by splitting into components.

And I think it helped with community involvement as the early stages could take heavy contributions from the community without large upfront debates.

Solicit issues in this repo for proposed types, using roughly the API review format

Do you have a template or examples? I'd be willing to get something started for a low overhead hashmap.

@zhentar look at the API review markdown doc in the corefx repo, or prismatic easier to look at active issues in corefx marked with API-ready-for-review label. Top post on those will be examples of the format.

As a datapoint, I made a dump of the types that were in the Wintellect PowerCollections https://gist.github.com/danmosemsft/aa88e4ad837a98ab786e679e446a28ea
Amongst those there were Deque. MultiDictionary, OrderedBag, OrderedDictionary, OrderedSet. Some are since obsolete (Triple, Set)

@danmosemsft  From the list, RedBlackTree, and link (http://www.jot.fm/issues/issue_2005_03/column6/) is interesting.  This might be something similar I link above.  🤞🤞🤞

@shaggygi that is an internal implementation type for the OrderedBag, etc. You can browser with ILSPY if you are interested: https://www.nuget.org/packages/SoftUni.Wintellect.PowerCollections/

A string "intern" dictionary; that you give it Spans and it gives strings back and has Least frequent recently used discards (possibility with ageing so they stay away from Gen2)

@benaadams I think a collection optimized for string interning would be interesting. We added HashSet<T>.TryGetValue to help but that wouldn't help if you had a Span. The policy and how to configure it seems like the hard part. There was some discussion here and in my comment below. Perhaps you'd like to start an issue and sketch a proposal? I can't find an existing one. It seems like potentially a good fit for this package.

@benaadams @danmosemsft  one of the use cases I intended to include in #2415 (but apparently left out, updated now) was to support my own string intern collection, although I didn't include any sort of expiration mechanism (for my usage keeping all of the strings for the life of the collection is suitable).

@benaadams While not a true string "interndictionary, my proposal for aStringKeyedDictionary` type may work for what you want.

Regarding the string cache, that would be quite interesting for MSBuild. We have a complicated string cache (bucketed MRU lists) which is addressed via a very Span looking interface. Many of my recent Span-ification attempts died because at some point, I needed to put the span in some lookup dictionary, and many times that lookup dictionary was the string cache.
It would be really awesome if I could change the string lookup to be able to be addressed by spans. Most of our Span.ToStrings, come from small atoms representing function names or types, which are highly re-ocurring, so being able to cache the Span.ToStrings would probably save a bunch of strings. https://github.com/dotnet/corefx/issues/31302 would help me write a ROM based comparer. The only drawback would be calling ROM.Span a million times.

I was seeing something like:
public partial class InternDictionary
{
    public string this[ReadOnlySpan<char> key] { get; }
}

So you'd always get a string back; if it already existed you'd get that one, if it was new it would add the ROS.ToString() and give you it back.
Having ReadOnlyMemory keys would be problematic as the would retain the whole chunk of data that they referred to the window of; rather than just the window, which might be quite undesirable.

For my own intern dictionary, I just use an xxHash64 of the UTF8 bytes as the key, to avoid keeping the bytes around and to cut the cost of comparing equality of UTF8 bytes against UTF16 strings.

So you'd always get a string back; if it already existed you'd get that one, if it was new it would add the ROS.ToString() and give you it back.

Essentially that's the desired data structure that made me write up the proposal to begin with ;)

@Zhentar With that approach, what happens when there is a collision?

@svick theoretically speaking, you would get the wrong string back. But the reason I use a 64-bit hash function is that it makes the probability of collision negligible.

"Negligible" worries me a lot. That's not safe enough for anything except
demo scenarios, IMO. "You'll probably get the right string" is ... nope.
Sorry.
On Tue, 21 Aug 2018, 19:13 Zhentar<EMAIL_ADDRESS>wrote:

@svick https://github.com/svick theoretically speaking, you would get
the wrong string back. But the reason I use a 64-bit hash function is that
it makes the probability of collision negligible.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/dotnet/corefxlab/issues/2406#issuecomment-414770545,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABDsPKcci98X3yZ-JeOKmGNIS0gPxGPks5uTE3CgaJpZM4Vmx9j
.

@Zhentar I've actually seen that approach go painfully wrong in a commercial third party library.

It's basically a non starter for this approach for any system or application I have ever written. Performance is important but correctness is usually more so.

The package is now live, containing MultiValueDictionary as the only type as of now:
https://dotnet.myget.org/feed/dotnet-corefxlab/package/nuget/Microsoft.Experimental.Collections
I guess it is a good start. I will close this issue, since the purpose of it was to track the package addition and have some discussion regarding interesting types. But to have better isolated/specialized discussions I think we should open separate issues for type proposals to discuss them and then if agreed, add them to the new package :smile:

64-bit hash function is that it makes the probability of collision negligible

For those who like maths, from table courtesy of 'https://en.wikipedia.org/wiki/Birthday_attack'
You have a 50% chance of a collision within 5.1 × 10^9 entries. And that's definitely not a negligible chance, at a dictionary size which is quite achievable on modern hardware.


Update connectivity.proto

Thanks mate. Do you know how the other platforms Linux, iOS, Android get their client tokens?

Do you know how the other platforms Linux, iOS, Android get their client tokens?

Yes, everything looks almost the same, with one request or two (with hashcash challenge)

Do you have some sample protobuf requests with the values to put in? I'd prefer to send a proper platform request instead of always the Windows request.

Do you have some sample protobuf requests with the values to put in?

Have for android, two requests and responses, easly decoded with Cyberchef
clienttoken_android.zip

At work and not much time too look into this, but what's in the bin files? The binary protobufs? Do you know the values for the protobuf fields so I can build the message in Rust?

Also I guess librespot isn't run on Android that often. Mostly Linux I think but no protobufs for that, right. I wonder which protobufs Spotify's own Linux and Mac clients use.

ut what's in the bin files? The binary protobufs? Do you know the values for the protobuf fields so I can build the message in Rust?

Packed protobuf messages so you can just copy the values from it, the only change required is to change NativeWindowsData to NativeAndroidData and fill out the request

no protobufs for that, right

Unfortunately, I might get it later.

Got payload for Linux, I'll update it later


Write unit tests and remove test.py file

We need automated tests to test whether or not the application is working as expected. This would be a huge improvement over the current way of testing using a test.py file in our project.

This has been completed in #24.


Warning: 1.3 deprecated function in Introduction.Ipynb

WARNING:root:Deprecation Warning: Layout.collate will be deprecated after version 1.3.0.
Use HoloMap.collate instead (see HoloViews homepage for example usage)

Thanks, will fix that now.

will all that still work with coming Matplotlib 1.5 at the end of the month ?
(they did add a lot of interactivity, maybe there could be some issues ?)

I'll test everything with the current matplotlib dev version in the coming days but I see no reason why it shouldn't. The added features for interactivity should actually be a good thing for us as it will allow us to significantly speed up certain things in HoloViews.

Certainly. nice talk at scipy.

Thanks! Just pushed the fix to the Tutorial (7b043b87). Will close the issue now.


Hydration mismatch error

Environment

Operating System: Linux
Node Version:     v16.9.0
Nuxt Version:     3-3.0.0-27235989.d52b1e8
Package Manager:  Yarn
Bundler:          Webpack
User Config:      -
Runtime Modules:  -
Build Modules:    -

Describe the bug
I was eager to try out the nuxt 3 beta. And simply followed the installation instructions from https://v3.nuxtjs.org/getting-started/installation . But on running yarn dev -o or yarn dev I get a console error saying 'Hydration completed but contains mismatches.' Not sure if I'm missing something. I've just started with nuxt
Reproduction
Just following the installation steps should reproduce it:
npx nuxi init nuxt3-app
code -r nuxt3-app
yarn install
yarn dev -o
Additional context
The error was generated via @vue/runtime-core:
function createHydrationFunctions(rendererInternals) {
    ....
    if (hasMismatch && !false) {
                // this error should show up in production
                console.error(`Hydration completed but contains mismatches.`);
    }
}

Logs
No response

Getting the same error log only on the prod version.
Local and dev work fine.

If you're using the dynamic component import feature (enabled by default in Nuxt 3), we need to be careful with our lazy components.
According to the Nuxt documentation, every async component needs to have a "LAZY" prefix in its name.
The problem occurs when you programmatically define a component without the "LAZY" prefix to be async using the async components of Vue 3 (is the default way to do it if this feature is disabled).
When this feature is enabled and this scenario occurs, there is a mismatch in page hydration, causing Vue to discard all the HTML received from the server and recreate everything from scratch. This results in a flickering effect on the initial page load for the user.
At least in my case the behavior was very similar and the solution was this

The cloudflare email scrapper is enabled by default (it would be nice if we could avoid the hydration error when it's enabled though maybe with a runtime option that adds the script when nuxt renders the page)
And this was causing hydration errors which caused my  tag and page content to be displayed twice

I am getting the same error - is dev everything works and in prod deployment i get the hydration error (digitalocean)


fix(linter) Fix false positives in prefer string start, ends with, port more test cases

closes #1687 - uses intersection instead of ||:

this improves performance as it combines the flags into a single bitmask instead of doing two seperate checks

Adds missing test cases from eslint-plugin-unicorn

Current dependencies on/for this PR:

main

PR #1689   👈

This stack of pull requests is managed by Graphite.

Draft - waiting for #1688 to be merged first

Merge activity

Dec 15, 12:08 PM: @@camc314 merged this pull request with Graphite.


ignore post-terminator flags

As per the request over at #20.

@jbnicolai should be fixed now.

:+1: awesome, thanks for the effort!

Awesome! :)


Coverage of various dimensions for tax parameter inputs

Lines 351 to 398 of parameters.py attempt to make the tax parameters conform with the model dimensions for those parameters (TxSxnum params) from variously shaped inputs (e.g., if one gives a single number, it's assumed they want constant rates across model periods and ages, or if a list of length S is input, it is assumed they want age varying tax rates that are constant across time periods).  This all got more difficulty when moving the parameter contain from Numpy arrays to lists and there is an if statement that is missing that extends along the age dimension if it's not equal to S.
This has caused issues, such as this one in the OG-ZAF project.

Resolved with merge of PR #878


Improve TYPOGRAPHY of Every Page

Change the TYPOGRAPHY of every page with fonts that suits the most

hello can you explain how i contribute to open source. can you show me the way around!

Hey @akshad113 , ping me here: https://www.linkedin.com/in/rohan-das-3423a5184/

@kanisht09 @rohan26062001 , some of my suggestions for the typography are Merienda for headers/announcements and Montserrat for other general, used them in ImgSlider
https://fonts.google.com/specimen/Merienda
https://fonts.google.com/specimen/Montserrat

@Rahul-Roy-21 as far as the slidebar is concerned , the typography which u choose was perfect , and for navbar and footer we can decide the typography now because they are the components which are ready till yet and then maybe we can decide the typography based on the content .

Yes, @HimaghnaDas you can contribute here. @HimaghnaDas and @Vivek-kumar21 , you both will solve this issue. If you face any kind of problem ping us in the whatsapp group.


Aqara Door Sensor stay off

Hello,
All in title.

Is it fixed in the latest release?

Yes it's done. thx


tompd_63lw_breaker, entity None is implicitly using device name by not setting its name

I don't understand what should I do?
Logger: homeassistant.helpers.entity
Source: helpers/entity.py:375
First occurred: 9:33:56 AM (1 occurrences)
Last logged: 9:33:56 AM

Entity None (<class 'custom_components.tuya_local.switch.TuyaLocalSwitch'>) is implicitly using device name by not setting its name. Instead, the name should be set to None, please report it to the custom integration author.

tuya_local-04af1652d2a1f1a20788ab10b185eea3-Circuit breaker energy meter-1968c6386062d92c6a9db7affea88ffb.json(9).txt

The string you put a question mark by is the "Manufacturer" reported by the device.  In the case of Tuya Local, the manufacturer is currently always reported as Tuya.

Are you planning to specify something like tompd_63lw_breaker as the model?

Long term. But currently it is not possible to distinguish different devices that share the same config.


[Bug]: interface-specific requirements.txt files are vestigial and confusing

What happened?
After the switch to pyproject.toml for modality dependencies (#1118), the interface-specific requirements.txt files don't do anything and should be removed.
Steps to Reproduce
...

Traceback
No response
Operating System
macOS
Python Executable
Conda
Python Version
3.12
Package Versions
No response
Code of Conduct

[X] I agree to follow this project's Code of Conduct
[X] Have you ensured this bug was not already reported?

They should. I was leaving them a bit longer in case we had to revert but I guess they we could be recovered from the git repo history if we were to needed which is unlikely now.
Let's remove them. Thanks for opening and issue.


feat(sdk-node): configure trace exporter with environment variables

Which problem is this PR solving?
Spec says a user can set an exporter via environment variable with OTEL_TRACES_EXPORTER and specify otlp protocol with OTEL_EXPORTER_OTLP_PROTOCOL or signal specific protocol.
This exporter configuration has been added to the sdk-node package and only applies when the user hasn't set up an exporter or span processor with code (in their tracing.js file).
If a user doesn't set up an exporter in code or a span processor in code or doesn't provide a custom exporter via env vars, the sdk-node will set up a default otlp exporter with a http/protobuf protocol.
Fixes #2873
Short description of the changes

Added trace exporter env vars and protocol env vars to environment.ts file
Added code configuring the trace exporter in the sdk-node package in sdk.ts file

Type of change
Please delete options that are not relevant.

[x] New feature (non-breaking change which adds functionality)
[x] This change requires a documentation update

How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

[x] Unit tests
[x] Integration tests

Checklist:

[x] Followed the style guidelines of this project
[x] Unit tests have been added
[x] Documentation has been updated

ToDo

[ ] Clarify use of _buildExporterFromEnv() in the BasicTracerProvider

I have a question I wanted to ask @open-telemetry/javascript-approvers  and @open-telemetry/javascript-maintainers before I can change this draft pr to ready for review.
I want to remove the following code since it looks like it was an older attempt at configuring exporters from env:

 _buildExporterFromEnv()
setting up an active span processor
_getSpanExporter()

But I'm not 100% sure if this code is necessary here (especially items 2 and 3 above) and if it'll cause breaking changes if I remove that code. Any info/details you can share with me would be much appreciated!

Is it feasible to configure the OTLP exporter based on that mechanism?

Adding on this, this is definitly for this use case that i implemented this back then so that would be cleaner. The way it was supposed to be used is  that the sdk extends the node tracer provider with its own exporters/propagators that can then be configured by the env

I've tested using this new feature locally with a sample app as well and it works as expected.

i'm not sure about the CI failure, the cache would maybe create failure for 3rd party modules but i find it weird that its modifying the code that is being checked out, did you try building from a fresh install ?

I tried fresh install and it didn't fix it. Then I realized that the file named was not updated on github even though I updated the file name locally and push it up to this branch. So I had to manually update the file name on github and it works now.

I tried fresh install and it didn't fix it. Then I realized that the file named was not updated on github even though I updated the file name locally and push it up to this branch. So I had to manually update the file name on github and it works now.

On systems that are case insensitive like windows or macOS, git can not recognize file renames that are just changing cases.

Sorry for the delay on this. I was traveling for work.
I've refactor the code to set up the span processors in the TracerProviderWithEnvExporters constructor and updated/added tests.
However, I have a question regarding this code:

Am I using the NoopSpanProcessor correctly here?

I'm trying to only call register when/if TracerProviderWithEnvExporters or NodeSDK set up any span processors and there is a situation in the TracerProviderWithEnvExporters where there are no span processors set up if a user provided incorrect env values or they chose not set up any exporters. In that case, a NoopSpanProcessor is setup (in the inherited BasicTracerProvider class I believe). If I call register without using an if statement  then some of existing tests setup in the past don't pass such as the checks around the context manager found here.

Is it worth adding a comment above line 216 that was mentioned in item 1 above that explains the purpose of checking if a tracer provide has an NoopSpanProcessor?

I've been looking into the code in a bit more detail regarding your questions @svetlanabrennan :slightly_smiling_face:
As far as I can see, we could override the register() method in the TracerProviderWithEnvExporters class. Then, we can only call the superclass's register() method when SpanProcessor have been added. We can also override the addSpanProvider() method, call super.addSpanProvider() to keep track of any calls to that method.
  // part of TracerProviderWithEnvExporters

  override addSpanProcessor(spanProcessor: SpanProcessor) {
    super.addSpanProcessor(spanProcessor);
    this._hasSpanProcessors = true;
  }

  override register(config?: SDKRegistrationConfig) {
    if (this._hasSpanProcessors) {
      super.register(config);
    }
  }

If I am not mistaken, this way it should be possible to call register() without checking for NoopSpanProcessor. :slightly_smiling_face:

I've been looking into the code in a bit more detail regarding your questions @svetlanabrennan 🙂
As far as I can see, we could override the register() method in the TracerProviderWithEnvExporters class. Then, we can only call the superclass's register() method when SpanProcessor have been added. We can also override the addSpanProvider() method, call super.addSpanProvider() to keep track of any calls to that method.
  // part of TracerProviderWithEnvExporters

  override addSpanProcessor(spanProcessor: SpanProcessor) {
    super.addSpanProcessor(spanProcessor);
    this._hasSpanProcessors = true;
  }

  override register(config?: SDKRegistrationConfig) {
    if (this._hasSpanProcessors) {
      super.register(config);
    }
  }

If I am not mistaken, this way it should be possible to call register() without checking for NoopSpanProcessor. 🙂

This is great feedback. This does remove the need to check for the NoopSpanProcessor. Thank you.
I think just overriding the register method will work and no need to override the addSpanProcessor method because I can use the spanProcessors property to check if any span processors were added before calling register if a selected tracer provider is TracerProviderWithEnvExporters, like this:
// in the TracerProviderWithEnvExporters
  override register(config?: SDKRegistrationConfig) {
    if (this._spanProcessors) {
      super.register(config);
    }
  }


Version 0.3.1

https://github.com/JuliaLang/julia/pull/51475

Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 59.05%. Comparing base (107d32c) to head (819488c).

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #43      +/-   ##
==========================================
+ Coverage   58.30%   59.05%   +0.74%
==========================================
  Files          15       15
  Lines         355      359       +4
==========================================
+ Hits          207      212       +5
+ Misses        148      147       -1

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


fix: rework dispose

Description

Add PlayerState.disposed (closes #1450)
Add AudioPool.dispose() (closes #1478)
Dispose players in tests
Properly handle dispose on all platforms (closes #1475)
Fix running method calls on non UI threads causes PlatformException (closes #1481)

Checklist

[x] The title of my PR starts with a [Conventional Commit] prefix (fix:, feat:, docs:, chore: etc).
[x] I have read the [Contributor Guide] and followed the process outlined for submitting PRs.
[x] I have updated/added tests for ALL new/updated/fixed functionality.
[x] I have updated/added relevant documentation and added dartdoc comments with ///, where necessary.
[x] I have updated/added relevant examples in [example].

Breaking Change

[ ] Yes, this is a breaking change.
[x] No, this is not a breaking change.

Related Issues
Closes #1450
Closes #1478
Closes #1475
Closes #1481

Any idea when the next release that includes this fix might be?

I probably need to fix the pipeline first, and support Android AGP 8. Hopefully soon, but can't give any promises.

Is there a way to manually use the version on main until then (I'm running into this issue in production and would like to use the fix as soon as I'm able to)?
I've tried using audioplayers as a git dependency (as opposed to fetching from pub dev), but it seems that it depends on the versions of audioplayers_android, audioplayers_darwin etc. that are published (and therefore aren't compatible).

Add to your pubspec.yaml:
dependency_overrides:
  audioplayers:
    git:
      url: https://github.com/bluefireteam/audioplayers.git
      path: 'packages/audioplayers'
  audioplayers_platform_interface:
    git:
      url: https://github.com/bluefireteam/audioplayers.git
      path: 'packages/audioplayers_platform_interface'
  audioplayers_web:
    git:
      url: https://github.com/bluefireteam/audioplayers.git
      path: 'packages/audioplayers_web'
  audioplayers_linux:
    git:
      url: https://github.com/bluefireteam/audioplayers.git
      path: 'packages/audioplayers_linux'
  audioplayers_android:
    git:
      url: https://github.com/bluefireteam/audioplayers.git
      path: 'packages/audioplayers_android'
  audioplayers_darwin:
    git:
      url: https://github.com/bluefireteam/audioplayers.git
      path: 'packages/audioplayers_darwin'
  audioplayers_windows:
    git:
      url: https://github.com/bluefireteam/audioplayers.git
      path: 'packages/audioplayers_windows'

Thank you so much, that helps a lot! 🙏

Looking forward to the fix!

@Gustl22 Hi, I wonder which commit will be the stable one (to be published)? I want to use it in production, so I hope not to use the unstable master branch.

We don't really differentiate main and stable. We always try to keep the library free from bugs with help of tests. We don't have the customers and the resources to provide multiple channels. The most stable is the last minor version before a major update I guess, but the last commit on main tackles the most bugs. So it's your choice what you consider as the most appropriate for you.
We make a release, when we think all major issues are resolved by then.

@Gustl22
Whenever i try to run ios build on simulator i got this
@import audioplayers_darwin;
Module
audioplayers_darwin not found

@adigujjar Plz try out the example and work out the differences:
https://github.com/bluefireteam/audioplayers/tree/main/packages/audioplayers/example


Multiple syntax, invalid, & missing related error during compilation

I am using JSP on my system. One of my objective is to provide reports generated by the system. So i decided to use PDF.js, the prebuild stable one (Stable v2.0.943) to render the PDF file. During the rendering process a multiple error appears coming from ha pdf.js script. So i decided to download the latest yuicompressor from [https://github.com/yui/yuicompressor/releases] version 2.4.8. From the terminal i run:
java -jar yuicompressor-2.4.8.jar pdf.js -o pdf.min.js
and it resulted to a multiple lines of error messages related to syntax.. Sample output:
[ERROR] in pdf.js
22943:9:invalid return
[ERROR] in pdf.js
22944:1:syntax error
[ERROR] in pdf.js
22946:7:syntax error
[ERROR] in pdf.js
22967:86:invalid property id
[ERROR] in pdf.js
23007:40:missing name after . operator
[ERROR] in pdf.js
23385:25:missing name after . operator
[ERROR] in pdf.js
23387:34:missing name after . operator
[ERROR] in pdf.js
23388:19:missing ; before statement
[ERROR] in pdf.js
23389:50:missing ; before statement
Is there any link for a solution or related problem with solution to this?

[...] the latest yuicompressor from [https://github.com/yui/yuicompressor/releases] version 2.4.8.

This points to a bug in a particular minifier, since it probably doesn't support modern JavaScript features, which is a bug in the minifier itself and not in the PDF.js library. Hence this issue is INVALID here, and needs to be reported to the developers of the minifier instead.
The only minifier that the PDF.js project currently supports is https://github.com/terser-js/terser, as can be seen in build scripts: https://github.com/mozilla/pdf.js/blob/83f6de3cf8bcb39e05847321f45b44446bd9a858/gulpfile.js#L798-L800 a pre-built minified version of the PDF.js library can be found in https://github.com/mozilla/pdfjs-dist/tree/master/build (files with .min in their names).


(DNM) Add TableView expandable rows docs

✅ Pull Request Checklist:

[ ] Included link to corresponding React Spectrum GitHub Issue.
[ ] Added/updated unit tests and storybook for this change (for new code or code which already has tests).
[ ] Filled out test instructions.
[ ] Updated documentation (if it already exists for this component).
[ ] Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:
https://reactspectrum.blob.core.windows.net/reactspectrum/9bd8f9fba7c90ace28faa4fd98d682b8bf3f5467/docs/react-spectrum/TableView.html#expandable-rows
🧢 Your Project:

oh also what do you think about moving the entire section up before the props table?

Reminder not to merge this PR for now. Running idea is that the docs built from this PR will be used as the alpha docs for the team using expandable rows, then we'll revisit when doing the full release


Make loading synchronous.

Rip out all vim.schedule and luv-callbacks from loaders.
The problem with asynchronous loading is that race-conditions may occur when snippets are added after a call to load() (see #281)
@uga-rosa @leiserfg Could you take a look at these changes? I'm not completely sure if it's okay to remove the vim.schedule, but we don't call any vim.api in there so I guess it is..?

Nice, okay.
Loading the entirety of vim-snippets does introduce a noticeable delay on startup, so we should probably notify users to switch to lazy_load or the method described in the wiki before this is merged.

Is this really asynchronous?

It's possible I mixed the two up, I looked at a definition and assumed that it's the same in CS, but it seems like you're right.
I'll change the title, ty👍

As @L3MON4D3 said above, even if this change slows down the startup time, we can use lazy load, so I don't think it will be a problem.

Another idea to speed up loading:
Don't actually parse the snippets while loading, just store the string-representation into the snippet-table. The snippet will be parsed when it is triggered.

That's an interesting idea. I'd like to try it with larger snippets and see if the latency is a problem. (Considering the speed of Lua, I don't think it will be a problem)

You can get a pretty close approximation by binding ls.lsp_expand(snippet_body) to some key.
In my experience it's instantaneous.

I tested it a bit and it seems to be fine.
Do you want to implement this feature in this PR?

Yup, although I won't have time for a few weeks

On master, load()ing honza/vim-snippets takes 1ms of startuptime (everything loaded asynchronally), here the startup is delayed by the full 55ms (3ms with lazy_load()).
What does work, however, is wrapping load() in vim.schedule. That allows one to both have <1ms delay during startup and do some work on the loaded snippets.
vim.schedule(function()
	require("luasnip.loaders.from_snipmate").load()
end)

I'm going to post as much in Breaking Changes, that way users/maintainers of neovim-configs already know what's going on/can prepare for when this PR is merged.

@L3MON4D3  try
vim.cmd [[au BufRead * ++once require("luasnip.loaders.from_snipmate").load() ]]

Right, or like that 👍
(Does the autocommand have any additional benefit with load? I'll change the recommendation to it, if it has)

It should take the same amount of time but should be less noticeable for the user (and won't appear in the startup time for those that are in that kind of competition).

Ah sorry, I meant benefit compared to wrapping load in vim.schedule.


A section to address token timeout would be beneficial.  I believe Az Context for Powershell is ~1hr. but not confirmed.  How to set it would help as well.  Thanks!

[Enter feedback here]

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: bf4da869-3f32-d2bb-d804-62679c1c3cbd
Version Independent ID: 49ec3073-a31e-a0ab-882d-17d3a7a420b0
Content: Runbook execution in Azure Automation
Content Source: articles/automation/automation-runbook-execution.md
Service: automation
Sub-service: process-automation
GitHub Login: @MGoedtel
Microsoft Alias: magoedte

Thanks for bringing this to our attention. Your feedback has been shared with the content owner for further review.

With the number of updates we've implemented to the Automation content as it relates to using PowerShell runbooks and how to authenticate with Managed Identity, I believe the primary point has been addressed (that is, how to set context with Set-AzContext & Get-AzContext).  I'm going to proceed with closing this GitHub issue. #please-close


Add binary types for MySQL and SQLite

Add the following type for SQLite:

Binary

Add the following types for MySQL:

Char
Binary
Varbinary
Blob
Tinyblob
Mediumblob
Longblob

Also fix some clippy lints.

cool. lgtm


Not working for Devise gem validations

Hi,
I am using devise gem for authentication and for signup, but this gem is not showing the error messages for the fields whose validations are written inside devise gem.
E.g validates_presence_of :email is not working initially but if write the same in user model it shows the error message. Do i need to override all the validations in user model ?? or is there any other work around for this ?

I just hit this issue, albeit slightly differently: I see this error in the javascript log.
GET http://<IP_ADDRESS>:3000/validators/uniqueness?case_s...e=true&user[email]=justin.gordon%40gmail.com
404 Not Found
25ms
jquery.js?body=1 (line 8103)
"NetworkError: 404 Not Found - http://<IP_ADDRESS>:3000/validators/uniqueness?case_sensitive=true&user[email]=justin%40gmail.com"

The uniqueness validator is doing a request for a given resource. If it is found a 200 is returned as the resource is available but it is not unique so he validator fails. If it is not found a 404 is returned as the resource is not available but that means it is unique.
While what I have done is semantically correct it is annoying having to answer this question all of the time. In the next version I will be changing this so it doesn't throw the browser error. The issue is what browsers show errors when they shouldn't.

Yes, that would be annoying. Now the mystery is why the submit button seems to do nothing.

What versions are you using?

I just pulled from github:
gem 'client_side_validations' , :git => "https://github.com/bcardarella/client_side_validations.git"
gem 'client_side_validations-formtastic', :git => "https://github.com/dockyard/client_side_validations-formtastic.git"
but failed to recopy the assets with
rails g client_side_validations:copy_assets
The bug was that validateElement of rails.validations has a brace in the wrong position, causing the method to return false data has not changed, which is clearly what you don't want. Probably related to incorrect spaces in coffeescript.
Once I updated with copy_assets, it works perfectly!
AWESOME!


install error on Solaris

Similar issue to #23 on Solaris. Worked around by creating azblob/zc_mmf_solaris.go with following contents (from some searching/copy/pasting – I don't know Go).
// +build solaris

package azblob

import (
        "os"
        "syscall"
        "golang.org/x/sys/unix"
)

type mmf []byte

func newMMF(file *os.File, writable bool, offset int64, length int) (mmf, error) {
        prot, flags := unix.PROT_READ, syscall.MAP_SHARED // Assume read-only
        if writable {
                prot, flags = syscall.PROT_READ|syscall.PROT_WRITE, syscall.MAP_SHARED
        }
        addr, err := unix.Mmap(int(file.Fd()), offset, length, prot, flags)
        return mmf(addr), err
}

func (m *mmf) unmap() {
        err := unix.Munmap(*m)
        *m = nil
        if err != nil {
                panic("if we are unable to unmap the memory-mapped file, there is serious concern for memory corruption")
        }
}

I think we can just add the solaris build tag to the existing file right?
Opened a PR to do so 👍

No, it's a new file that uses golang.org/x/sys/unix instead of the syscall package; at least on the version of Go I have, syscall.Mmap and syscall.Munmap are unavailable on Solaris. The version below avoids mixing the two packages.
// +build solaris

package azblob

import (
        "os"
        "golang.org/x/sys/unix"
)

type mmf []byte

func newMMF(file *os.File, writable bool, offset int64, length int) (mmf, error) {
        prot, flags := unix.PROT_READ, unix.MAP_SHARED // Assume read-only
        if writable {
                prot, flags = unix.PROT_READ|unix.PROT_WRITE, unix.MAP_SHARED
        }
        addr, err := unix.Mmap(int(file.Fd()), offset, length, prot, flags)
        return mmf(addr), err
}

func (m *mmf) unmap() {
        err := unix.Munmap(*m)
        *m = nil
        if err != nil {
                panic("if we are unable to unmap the memory-mapped file, there is serious concern for memory corruption")
        }
}

(Above goes in zc_mmf_solaris.go.)

Yep, I just realised that after the build failed. IIRC syscall is now frozen so switching to the "golang.org/x/sys/unix" makes sesnse

I just hit this on an illumos system while trying to build Hugo, the static site generator.  In the upcoming Go 1.13, there will be an illumos build tag.  It'll imply the solaris build tag, though, so fixing this for solaris will fix it for both.
Does it make sense to just use sys/unix instead of syscall for all UNIX platforms?  Can I help somehow with testing (e.g., on illumos systems) to get this over the line?  Thanks.

Support for Solaris has been released in v0.10.0.

Thanks!


LEGO: Pull request from lego/hb_04604851-bac4-4681-9f74-73de611d6e48_20220216124027223 to main

LEGO: Pull request from lego/hb_04604851-bac4-4681-9f74-73de611d6e48_20220216124027223 to main with localized lcls

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

0 of 0   changed or added relevant lines in 0 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage remained the same at 48.261%

Totals

Change from base Build<PHONE_NUMBER>:
0.0%

Covered Lines:
14816

Relevant Lines:
29137

💛  - Coveralls


useInlineViewWhenSpaceIsLimited should have a 'smart' option

The diff editor should dynamically switch between inline and side by side mode based on the nature of the diff, e.g diff dominated by insertions/removals are easy to read inline but complex edits are simpler to digest in side by side mode

Verification steps:

Use inline chat to insert code

Click on "View in chat"
Verify the diff is shown inline (not side-by-side)
Use inline chat to modify code significantly
Click on "View in chat"
Verify the diff is shown side-by-side

Verify that the diff switches to inline if the sidebar width is really small

The diff doesn't seem to render properly in the chat view.
The first diff doesn't make sense to me, and the second diff doesn't show any added or removed lines.

The inline chat diff is fine:

Same issue after reverting my inline chat settings to default values

versus

Fixed by https://github.com/microsoft/vscode/pull/223477


invocable mixin

Hey,
I've recently started using your library and I love the simplicity and extensibility. But I wonder why no invocable mixin exists, as this is probably something one could use a lot. I wrote one for myself, which may be a good baseline (it's mainly tedious repetition).
Any comments?
struct invocable
{
	template <typename Strong>
	struct modifier
	{
		template <class... Args>
			requires std::invocable<const strong::underlying_type_t<Strong>&, Args...>
		constexpr decltype(auto) operator ()(
			Args&&... args
		) const & noexcept(std::is_nothrow_invocable_v<const strong::underlying_type_t<Strong>&, Args...>)
		{
			return std::invoke(as_underlying(), std::forward<Args>(args)...);
		}

		template <class... Args>
			requires std::invocable<strong::underlying_type_t<Strong>&, Args...>
		constexpr decltype(auto) operator ()(
			Args&&... args
		) & noexcept(std::is_nothrow_invocable_v<strong::underlying_type_t<Strong>&, Args...>)
		{
			return std::invoke(as_underlying(), std::forward<Args>(args)...);
		}

		template <class... Args>
			requires std::invocable<const strong::underlying_type_t<Strong>&&, Args...>
		constexpr decltype(auto) operator ()(
			Args&&... args
		) const && noexcept(std::is_nothrow_invocable_v<const strong::underlying_type_t<Strong>&&, Args...>)
		{
			return std::invoke(std::move(as_underlying()), std::forward<Args>(args)...);
		}

		template <class... Args>
			requires std::invocable<strong::underlying_type_t<Strong>&&, Args...>
		constexpr decltype(auto) operator ()(
			Args&&... args
		) && noexcept(std::is_nothrow_invocable_v<strong::underlying_type_t<Strong>&&, Args...>)
		{
			return std::invoke(std::move(as_underlying()), std::forward<Args>(args)...);
		}

	private:
		[[nodiscard]]
		constexpr const strong::underlying_type_t<Strong>& as_underlying() const noexcept
		{
			return value_of(static_cast<const Strong&>(*this));
		}

		[[nodiscard]]
		constexpr strong::underlying_type_t<Strong>& as_underlying() noexcept
		{
			return value_of(static_cast<Strong&>(*this));
		}
	};
};

It's not there because I haven't thought of it, and no one has expressed an interest in it, until now. I can see why you'd want to be able to differentiate callback types with the same signatures, so I think this would be a good addition. This would be so much shorter in C++23 with explicit object parameter ("deducing this"), but we're not there yet.
If you'd like to submit a PR (with docs please) that'd be awesome. Unfortunately I have to ask you to back-port to C++14 if you do, so SFINAE constraints instead of requires, and no std::invocable and friends either.
I'm out traveling the rest of the week, so I may not be quick to respond.

Back from traveling. I'll try to get this done today. Thanks for the suggestion.

There, have a look at branch invocable and tell me if it does what you think it should.

Hey, thank you for your work. I had a very busy week, so didn't find much time for this issue. Your implementation does fine and complies to my personal unit-tests. Thank you!
I wonder how the additional template args Tag and Ms are working. I used your example optional implementation as a reference, where they do not appear. Do you supply them conditionally?

It's not necessary to use type<T, Tag, Ms...> as I did, it just gives direct access to T as the underlying type. Tag and Ms... are of no use in the template, but have to be spelled out when specializing the template this way.


fix tini and python for alpine changes

fixes #387

Codecov Report

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

@@           Coverage Diff           @@
##           master     #388   +/-   ##
=======================================
  Coverage   97.15%   97.15%
=======================================
  Files          25       25
  Lines        1651     1651
  Branches      100      100
=======================================
  Hits         1604     1604
  Misses         26       26
  Partials       21       21

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 ab6c1c2...1347cd4. Read the comment docs.


Include area to npm package

First of all thanks for your package, it's really helpful.
I was messing around with it and I noticed that the area folder wasn't included in the npm dependency.
This PR aims to include it.

Thank you!

Thank you for the quick merge (and the lib itself) !
Are you planning to do a release or should I install it from the sources ?

Pushed<EMAIL_ADDRESS>now!


Fix Criteria Subquery#getSelection() returns null when it has not any…

… select expression

Thanks @beikov for the review


Update patterns-and-practices-overview.md

Adding community call info, I feel like this would be helpful. But let me know if this feels not "docs" like enough.

Docs Build status updates of commit 7acf8e0:
:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs/overview/patterns-and-practices-overview.md
:white_check_mark:Succeeded
View

For more details, please refer to the build report.
Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.
For any questions, please:Try searching in the Docs contributor and Admin GuideSee the frequently asked questionsPost your question in the Docs support channel

Docs Build status updates of commit 7acf8e0:
:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs/overview/patterns-and-practices-overview.md
:white_check_mark:Succeeded
View

For more details, please refer to the build report.
Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.
For any questions, please:Try searching in the Docs contributor and Admin GuideSee the frequently asked questionsPost your question in the Docs support channel


Module 'contacts_service' not found need Serious help.

When i am getting build from Android studio as dev build it's working fine but when i am trying to run from Xcode this error occurs.

Hi there, can you please provide additional details and console log output?

I am just getting this error message when I try to run project from xcode
when I run from Android for IOS it works fine.
On Thu, Jul 8, 2021, 8:28 AM Lukas Dickie @.***> wrote:

Hi there, can you please provide additional details and console log output?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/lukasgit/flutter_contacts/issues/234#issuecomment-876094353,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AQHNLSGK3XLZJKF3T3LC2L3TWULM3ANCNFSM47622G3A
.

/Users/thuandh/base_flutter/ios/Runner/GeneratedPluginRegistrant.m:10:9: Module 'contacts_service' not found i have same error. here my log from xcode

just recreate new project and paste lib,assets,ios plits files,menifest,ymal and all required file.
then cd ios,pub install,pub update,flutter build ios.
it will work and generate the build.

just recreate new project and paste lib,assets,ios plits files,menifest,ymal and all required file. then cd ios,pub install,pub update,flutter build ios. it will work and generate the build.

how is that a solution? some projects are SO extremely large and impossible to just move everything into a new project. how do i actually fix this problem within my existing project?


Error while running pipeline using a docker container

Hi,
I followed the instructions for running this pipeline with the docker container and the dataset that comes with the github repo.  The pipeline stopped at the assembly step.  I believe it may be a path issue with the 4.assembly subfolder.  I am including the log file for further details.
$ docker pull jmelody/pangaea:std

$ git clone https://github.com/ericcombiolab/Pangaea.git

$ nohup docker run -v $PWD/Pangaea/example/:/example -u $(1769 -u):$(1769 -g) jmelody/pangaea:std /bin/bash /app/run_test.sh -1 /example/reads1.fq.gz -2 /example/reads2.fq.gz -sp /example/contigs.fa -lc /example/flye-input-contigs.fa -at /example/athena.asm.fa -o /example/pangaea -c 5 --threads 12

-system-specific: 1769: command not found
-system-specific: 1769: command not found
nohup: ignoring input and appending output to 'nohup.out'

$ ls Pangaea/example/pangaea
1.features
2.vae
3.clustering
4.assembly
log

$ tail Pangaea/example/pangaea/log

2024-10-22 03:01:06 (INFO): mapping reads to contigs
2024-10-22 03:01:06 (INFO): command started: /app/bin/bin_assembly.sh /example/pangaea/3.clustering /example/pangaea/4.assembly 12 /example/reads1.fq.gz /example/reads2.fq.gz
2024-10-22 03:01:32 (ERROR): command failed: /app/bin/bin_assembly.sh /example/pangaea/3.clustering /example/pangaea/4.assembly 12 /example/reads1.fq.gz /example/reads2.fq.gz

I also checked that my UID and GID were correctly set; however, there was a warning issued by the docker container as shown below:
$ docker run -v $PWD/Pangaea/example/:/example -u $(1769 -u):$(1769 -g) jmelody/pangaea:std /bin/bash -c "echo 'Inside Container:' && echo 'User: $(whoami) UID: $(id -u) GID: $(id -g)'"
-system-specific: 1769: command not found
-system-specific: 1769: command not found

Inside Container:
User: grendon UID: 1769 GID: 1769

Could you please take a look and let me know how to resolve this issue?
Thanks in advance
log.txt

Hi @grendon ,
Thank you for using Pangaea.
You could just set -u $(id -u):$(id -g). No need to substitute 'id' with your own id.


bug with multi datepicker on hijri formate

When I add  class "hijri-date-input" to 2 input for example:
$(".hijri-date-input").hijriDatePicker();
It works only for the first input. and return console error:

confirmed, thank you
a new release will ship soon to fix some issues

okay, thank you.
also, I hope to support the date range, so when I set one input date "from" & another input date "to".
like this attached photo:

issue has been resolved in release v1.0.0
Thanks


Revert "Make Uglifier behave nicely when compressing ES6 JS"

Reverts studentinsights/studentinsights#1028
Addressing site outage:
Errors in IE:

cc @alexsoble

Thanks for rescuing the site while I was offline Kevin! Sent many more details in an email to you Uri and Justin just now.


[BUG] No Cache icon showing up for cached MapTasks

In flyteconsole 0.19.4 it does look like the map task is caching even though the little swirly isn't present in the ui
Issue is reproduced by @eugenejahn on flyteconsole 1.1.1
Notify on completion:
https://flyte-org.slack.com/archives/CNMKCU6FR/p1655303400482879

Eugene reproduced issue locally. Regular tasks locally had cache icon.
Code example used:
import typing
import pandas as pd
import numpy as np
from flytekit import Resources, map_task, task, workflow

@task
def coalesce(b: typing.List[str]) -> str:
    coalesced = "".join(b)
    return coalesced

@task(cache=True, cache_version="1.0")
def a_mappable_cache_task(a: int) -> str:
    inc = a + 2
    stringified = str(inc)
    return stringified

@task(cache=True, cache_serialize=True, cache_version="1.0")
def square(n: int) -> int:
    """
     Parameters:
        n (int): name of the parameter for the task will be derived from the name of the input variable.
                 The type will be automatically deduced to Types.Integer

    Return:
        int: The label for the output will be automatically assigned, and the type will be deduced from the annotation

    """
    return n * n

@workflow
def wf2(a: int) -> int:
    out = square(n=a)
    return out

Just double-check with @hamersaw, for now, map tasks will require the task_executions endpoint to get cache information (along with phase, etc) and all other tasks should continue using the node_executions endpoint. In the future, we would certainly like the change this so that map task execution is exactly the same as regular tasks. So you could use the same API.
Since our frontend use node_executions endpoint to check the cache status, we can't detect the cache status for maptaks, and that's why no cache icon show up. To fix this, we need to use the task_executions endpoint to check the cache status for map tasks.


Failed to get list of devices from web API: 0

Nuki 3 pro, no bridge.
trying to set it up with API key
getting the following:
Logger: custom_components.nuki_ng.config_flow
Source: custom_components/nuki_ng/config_flow.py:51
Integration: Nuki Lock (documentation, issues)
First occurred: 1:10:58 PM (2 occurrences)
Last logged: 1:11:06 PM
Failed to get list of devices from web API: 0
Traceback (most recent call last):
File "/config/custom_components/nuki_ng/config_flow.py", line 51, in find_nuki_devices
title = response[0]["name"]
KeyError: 0
API key is set correctly with all rights.
Any suggestions?
Thanks.

yes. upgrade to the latest version 0.3.8

i am on 0.3.8 :(

Yeah, more changes == more bugs.
Please update to 0.3.9. Should be fixed

Yeah, more changes == more bugs.
Please update to 0.3.9. Should be fixed

Works like a charm!
Awesome stuff man, appreciate that.


Don't verify ssl certificates.

This should close #3

Thank you for the PR!

Hey, can you add hacktoberfest-accepted label to this PR


Install TagBot as a GitHub Action

You're receiving this pull request because the now-deprecated Julia TagBot GitHub App is installed for this repository. This pull request installs TagBot as a GitHub Action.
If this PR does not belong in this repository for any reason, feel free to close it.
See this Discourse thread for more details and to ask questions.
Please do not comment on this pull request, because it is unlikely that I (@christopher-dG) will see it.

Codecov Report

Merging #68 into master will increase coverage by 0.34%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master      #68      +/-   ##
==========================================
+ Coverage   93.22%   93.57%   +0.34%
==========================================
  Files          13       13
  Lines         974      980       +6
==========================================
+ Hits          908      917       +9
+ Misses         66       63       -3

Impacted Files
Coverage Δ

src/prettyprint.jl
97.43% <0%> (+0.06%)
:arrow_up:

src/mutation/size.jl
91.52% <0%> (+0.49%)
:arrow_up:

src/mutation/select.jl
96.32% <0%> (+0.8%)
:arrow_up:

src/mutation/graph.jl
97.01% <0%> (+1.56%)
: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 f8c6957...2afc9ec. Read the comment docs.


Fixes null checks in SvgCanvas2D #107

Summary
In order to resolve TS errors, I previously added null checks to some of the functions.
However, this has brought some unintentional side-effects mentioned in #107 .
So, I removed those null checks and used non-null assertion operator instead.
It's not optimal, but I think it's ok for now.
Description for the changelog
Fixes null checks in SvgCanvas2D.
Other info
Other files may also contain such null checks. I assume the most of them won't cause problems, but there could be similar side-effects.

I confirmed this PR fixes the rounded rectangle issue. I have update the ts-example to restore the rounded rectangle in the custom shape.
I will run new tests with the stories soon.

I have tests the stories with the changes proposed in this PR. Everything run fine.
So I am merging the PR.


[WIP] [BugFix] add ScanRows and ScanBytes to auditlog in pipeline-mode

What type of PR is this：

[x] bug
[ ] feature
[ ] enhancement
[ ] others

Which issues of this PR fixes ：

Fixes #5810
Problem Summary(Required) ：

Add scanRows and scanBytes to auditlog in pipeline-mode.

In non-pipe mode, the query statistic is collected bottom-up from scan node
In pipe mode, the query statistic is recorded at QueryContext directly

@Mergifyio backport branch-2.2

@Mergifyio rebase


filtering option should auto create GQL custom scalars

Example
model User {
  id String   @id @unique @default(cuid())
  d DateTime
}

objectType({
  name: 'User',
  definition(t) {
    t.model.id()
  },
})
  queryType({
    definition(t) {
      t.crud.users({ filtering: true })
    },
  })

### This file was autogenerated by GraphQL Nexus
### Do not make changes to this file directly

input DateTimeFilter {
  equals: NEXUS__UNKNOWN__TYPE
  gt: NEXUS__UNKNOWN__TYPE
  gte: NEXUS__UNKNOWN__TYPE
  in: [NEXUS__UNKNOWN__TYPE!]
  lt: NEXUS__UNKNOWN__TYPE
  lte: NEXUS__UNKNOWN__TYPE
  not: NEXUS__UNKNOWN__TYPE
  notIn: [NEXUS__UNKNOWN__TYPE!]
}

type Mutation

"""

    This scalar should never make it into production. It is used as a placeholder for situations
    where GraphQL Nexus encounters a missing type. We don't want to error immedately, otherwise
    the TypeScript definitions will not be updated.

"""
scalar NEXUS__UNKNOWN__TYPE

type Query {
  users(after: String, before: String, first: Int, last: Int, skip: Int, where: UserWhereInput): [User!]!
}

input StringFilter {
  contains: String
  endsWith: String
  equals: String
  gt: String
  gte: String
  in: [String!]
  lt: String
  lte: String
  not: String
  notIn: [String!]
  startsWith: String
}

type User {
  id: ID!
}

input UserWhereInput {
  AND: [UserWhereInput!]
  dd: DateTimeFilter
  id: StringFilter
  NOT: [UserWhereInput!]
  OR: [UserWhereInput!]
}

Error:
- Missing type DateTime, did you forget to import a type to the root query or mean DateTimeFilter?

Use-Case
User might not want to project a Prisma scalar field onto a GQL Object but want to be able to filter by that Prisma scalar field.
Work-around

Project t.model.d()
Define custom scalar in GQL schema

Notes

Auto-creating custom GQL scalars is behaviour we have today for when projecting Prisma scalar fields.
Example shows DateTime but applies to any Prisma scalar that is a custom Scalar in GQL (e.g. UUID)

I think this is rather a bug. It should work :/


InfluxDb2.InfluxDbMetricsReporter FlushAsync failed

Seems this does not work with InfluxDB 2.1.1. Does the package support latest InfluxDB?
[10:38:06 ERR] Failed to write to InfluxDB - Status: 400 (Bad Request)
[10:38:06 WRN] Reporter App.Metrics.Reporting.InfluxDb2.InfluxDbMetricsReporter FlushAsync failed

same problem, any insight?

Tested with InfluxDB 2.5 and everything worked ok.
Nevertheless, updated to version 4.3.0, enriched error logging, added test project.
And please, check your setting "BaseUri": "http://localhost:8086/api/v2/" - make sure url ends with /api/v2/

i ran the docker version influxdb 2.5.1 instead of the ubuntu package version and it started working correctly. not sure why but thank you for your help!

works on InfluxDB 2.5+


feat: Update Volanbusz GTFS feed URL and contact info [SOURCES]

Update Volanbusz GTFS feed to the one published daily by Volanbusz.
More information at: https://www.volanbusz.hu/hu/menetrendek/gtfs

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.


Error in rule MAGContigNames

Hi @dportik ,
I am getting the below error, and because of this error within the 8-summary folder, its not creating figures and files:
‘SAMPLE.All-DASTool-Bins.pdf’, ‘SAMPLE.Complete.txt’,  ‘SAMPLE.Completeness-Contamination-Contigs.pdf’, ‘SAMPLE.GenomeSizes-Depths.pdf’, ‘SAMPLE.ReadsMapped.pdf’, ‘SAMPLE.ReadsMapped.txt’
grep: /home/sak/pb-metagenomics-tools-3.2.0/HiFi-MAG-Pipeline/8-summary/MDBG661/MAGs*.fa: No such file or directory
Error in rule MAGContigNames:
    jobid: 32
    input: /home/sak/pb-metagenomics-tools-3.2.0/HiFi-MAG-Pipeline/8-summary/MDBG661/MDBG661.HiFi_MAG.summary.txt, /home/sak/pb-metagenomics-tools-3.2.0/HiFi-MAG-Pipeline/8-summary/MDBG661/MAGs
    output: /home/sak/pb-metagenomics-tools-3.2.0/HiFi-MAG-Pipeline/2-bam/MDBG661.MAG_contigs.txt
    log: /home/sak/pb-metagenomics-tools-3.2.0/HiFi-MAG-Pipeline/logs/MDBG661.MAGContigNames.log (check log file(s) for error message)
    shell:
        grep -h '>' /home/sak/pb-metagenomics-tools-3.2.0/HiFi-MAG-Pipeline/8-summary/MDBG661/MAGs*.fa | cut -d'>' -f2 1> /home/sak/pb-metagenomics-tools-3.2.0/HiFi-MAG-Pipeline/2-bam/MDBG661.MAG_contigs.txt 2> /home/sak/pb-metagenomics-tools-3.2.0/HiFi-MAG-Pipeline/logs/MDBG661.MAGContigNames.log
        (one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)

Removing output files of failed job MAGContigNames since they might be corrupted:
/home/sak/pb-metagenomics-tools-3.2.0/HiFi-MAG-Pipeline/2-bam/MDBG661.MAG_contigs.txt
Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
Complete log: .snakemake/log/2024-09-03T135927.270485.snakemake.log

Also, when I checked log file: ‘MDBG661.MAGContigNames.log’ was completely empty.
Could you please advise how to solve this?

Hi,
I have the same issue. Dere you able to solve it?
Best


Provide a prebuilt iOS OCaml cross compiler for at least one architecture

Adding iOS should be very simple. The main thing that's blocking us is Esy tooling with cross compilation. What we could do though is simply compiling a cross compiler for iOS that would be distributed as a binary and add esy.json to its repo. Is it possible?
Having at least one cross compiler would allow us to develop the platform while we're waiting for proper cross compilation support in esy.
Also, if we figure this out, we can do the same with Android.

The cross-compiler itself won't give us much as we'll need build configs to correctly compile target dependencies and target dependencies' target dependencies.
Hopefully, esy/esy#732 will be merged by the end of the week and we could start adapting our bindings for iOS. I already have a feature branch for esy that gives us the cross-compiler for dune, we'll be able to experiment with it soon.


record types ignore type-variable constraints

Given:
//    a :: Type
const a = $.TypeVariable('a');

//    Foo :: { x :: a, y :: a }
const Foo = $.RecordType({x: a, y: a});

//    def :: (String, StrMap [Type], [Type], Function) -> Function
const def = $.create(true, $.env.concat([Foo]));

//    id = Foo -> Foo
const id = def('id', {}, [Foo, Foo], x => x);

This should be a type error:
id({x: 'abc', y: 123});

As should this:
id({x: ['foo', false], y: ['foo', false]});

I did some work on this issue: https://github.com/plaid/sanctuary-def/compare/master...dc-35.
I got to the point of enforcing type-variable constraints within a single value (argument or return value), then realized we should also enforce the constraints from one value to another. Currently a is completely unconstrained in { x :: a } -> { x :: a } -> { x :: a }.
Resolving this issue is not a priority, so I'll let this new information percolate through my subconscious for a few weeks. :)


pdm: 2.18.2 -> 2.19.1

Changelog: https://github.com/pdm-project/pdm/releases/tag/2.19.1
closes https://github.com/NixOS/nixpkgs/issues/345393
Description of changes

Things done

Built on platform(s)

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

For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)

[x] sandbox = relaxed
[ ] sandbox = true

[x] Tested, as applicable:

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

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

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

[x] Fits CONTRIBUTING.md.

Add a :+1: reaction to pull requests you find important.

Result of nixpkgs-review pr 345513 at 971c0ce5 run on x86_64-linux 1

:white_check_mark: 1 package built:

pdm


ngAnimateRef: can it be used with ui-router ui-view?

Is this compatible? I'm trying to copy the examples from the documentation, and it just doesn't work. Get some very strange behavior that I'm not even sure how to describe.

+1

Actually I just tested it and it looks like it works.
See my reply in this issue - https://github.com/angular-ui/ui-router/issues/2024

Looks like this is resolved.


Determine channel sms

This PR was successfully deployed to production by CircleCI build 200 at 2017-04-03 14:40 BST.


Adapting to VSS 4.0

Adapting to VSS 4.0 based on release candidate.
Not to be merged until VSS 4.0 released

Now things seems to work, but some refactoring in ddsprovider required to support use-cases where we cannot use "latest master" of databroker. I think this one is ready for an internal review. I have verified ddsprovider and dbcfeeder.

@lukasmittag - could you check my answers above - if there is any remaining fixes to do?


The database is not cleared cleanly

Describe the bug
After the memo entry is deleted, the entry is still maintained in the database. It is speculated that the comment may not have been deleted.
Also, can comments be indexed?
Many thanks to the developers for their hard work.
Steps to reproduce
.....
The version of Memos you're using
22.0
Screenshots or additional context
No response

This PR https://github.com/usememos/memos/pull/3491 I think should fix it


Strange behaviour of strings.TrimLeft

Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
go1.7.3
What operating system and processor architecture are you using (go env)?
windows/amd64
What did you do?
I executed following test:
import (
	"testing"
	"strings"
)

func TestTrimLeft(t *testing.T) {
	trimed := strings.TrimLeft("record:edocument", "record:")

	if trimed != "edocument" {
		t.Fatalf("Expected 'edocument' got '%s' ", trimed)
	}
}

What did you expect to see?
This test failed. I wouldn't expect this. Could someone explain this to me?
What did you see instead?
I got following output from this test:
Expected 'edocument' got 'ument'

@pikoscielniak you want TrimPrefix and not TrimLeft
Please also consider asking questions like this in the go-nuts mailing list or other help forums as a first port of call. If the behaviour you are seeing is then confirmed as a bug/issue it can easily be re-raised here in the issue tracker.

Thanks a lot. This is what I was looking for.


Added a csv to the repo, it still has some blanks

Will fill in the rest of the blanks after we have the spawn point selection menu in game, it will be much faster than the current process of editing code, rebuilding, and relaunching.

lgtm!


Crash in kernel test: hello.c

Seen once on TravisCI, running tests/kernel/hello.c (in the emulator).

I saw a similar crash in the user_copy_fault test.

vprintfs is a vararg function, so the format string was be passed on the stack. This suggests stack corruption may be the cause.


Cards overlap on older browsers, causing the site to be unusable

When cards are put into row, {col, card}(repeat) they all overlap on older browsers like IE 11 and older versions of iOS ~10 (I'm waiting for info on which iOS version my customer is having the issue with).
Here's the difference between Chrome (top) and IE11 (bottom) using Chrome 64.0.3282.119 and IE 11 on Windows 10. Bootstrap 4 (non-beta). You can see this code in action here in my simplified example.
This is a shortened version of the code. (It doesn't look as wrong as it does without pictures though).

            test test test

            test test test

            test test test

            test test test

Live examples (screenshots were on beta 3):

Screenshot on Chrome 64.0.3282.119, Win10 [working]

Screenshot on IE 11, Win 10 [garbled]

Screenshot on Old iPad [garbled]

Live example (BS4)  - However it is using a Bootswatch 4 theme. There is also some added CSS there for evening out card sizes.

I hate these old browsers, but I've just rolled out some sites that seem to attract people using old technology...

Minor update: I forgot there was a "col-xl" size (derp). That makes it very close to the way the new "col" looked previously, it just can't do the sort of automated figure-each-card-size-out thing it was doing before, like when a new row popped up it would make a bigger card (which wasn't always the nicest looking either).

@yatahaze you don't really need col-md-6

Another example of not working on screens/viewports at 570px or smaller, on modern browsers (Chrome 68.0.3440).
example: https://booxia.com/book/20000-leagues-under-the-sea/m9u96ctuz2c
Cards overlap:

Closing as stale—for the card columns, we know this is a disastrous implementation due to browser constraints. We've dropped it in v5 due to these problems and encouraged folks to use the grid. Same thing here applies to the original problem—it appears flex wrapping is not kicking in, and depending on the exact implementation, could be a flex bug or just a missed class.


Fix cookie authentication in the browser

As per https://github.com/redgeoff/slouch/blob/da7ca1123e50549df5c828ec39a6dc78db585271/test/spec/user.js#L134

authenticate() and authenticated() are not working properly in the browser. For now, we have to fake the responses as it appears that the session cookie is not being propagated from the session post to the session get.

It appears that neither request nor needlejs (via browserify) are capable of propagating a cookie for subsequent requests even after CouchDB responsds with the Set-Cookie header. I've tried toggling cookies jar: true, using withCredentials, etc... and none of these options appears to work.
One option (documenting here, but not my preference) is to use PouchDB's custom request routines. I've verified that this will work:
// Source: Unmodified from PouchDB
function xhRequest(options, callback) {

  var xhr, timer;
  var timedout = false;

  var abortReq = function () {
    xhr.abort();
    cleanUp();
  };

  var timeoutReq = function () {
    timedout = true;
    xhr.abort();
    cleanUp();
  };

  var ret = {abort: abortReq};

  var cleanUp = function () {
    clearTimeout(timer);
    ret.abort = function () {};
    if (xhr) {
      xhr.onprogress = undefined;
      if (xhr.upload) {
        xhr.upload.onprogress = undefined;
      }
      xhr.onreadystatechange = undefined;
      xhr = undefined;
    }
  };

  if (options.xhr) {
    xhr = new options.xhr();
  } else {
    xhr = new XMLHttpRequest();
  }

  try {
    xhr.open(options.method, options.url);
  } catch (exception) {
    return callback(new Error(exception.name || 'Url is invalid'));
  }

  xhr.withCredentials = ('withCredentials' in options) ?
    options.withCredentials : true;

  if (options.method === 'GET') {
    delete options.headers['Content-Type'];
  } else if (options.json) {
    options.headers.Accept = 'application/json';
    options.headers['Content-Type'] = options.headers['Content-Type'] ||
      'application/json';
    if (options.body &&
        options.processData &&
        typeof options.body !== "string") {
      options.body = JSON.stringify(options.body);
    }
  }

  if (options.binary) {
    xhr.responseType = 'arraybuffer';
  }

  if (!('body' in options)) {
    options.body = null;
  }

  for (var key in options.headers) {
    if (options.headers.hasOwnProperty(key)) {
      xhr.setRequestHeader(key, options.headers[key]);
    }
  }

  if (options.timeout > 0) {
    timer = setTimeout(timeoutReq, options.timeout);
    xhr.onprogress = function () {
      clearTimeout(timer);
      if(xhr.readyState !== 4) {
        timer = setTimeout(timeoutReq, options.timeout);
      }
    };
    if (typeof xhr.upload !== 'undefined') { // does not exist in ie9
      xhr.upload.onprogress = xhr.onprogress;
    }
  }

  xhr.onreadystatechange = function () {
    if (xhr.readyState !== 4) {
      return;
    }

    var response = {
      statusCode: xhr.status
    };

    if (xhr.status >= 200 && xhr.status < 300) {
      var data;
      if (options.binary) {
        data = createBlob([xhr.response || ''], {
          type: xhr.getResponseHeader('Content-Type')
        });
      } else {
        data = xhr.responseText;
      }
      callback(null, response, data);
    } else {
      var err = {};
      if (timedout) {
        err = new Error('ETIMEDOUT');
        err.code = 'ETIMEDOUT';
      } else if (typeof xhr.response === 'string') {
        try {
          err = JSON.parse(xhr.response);
        } catch(e) {}
      }
      err.status = xhr.status;
      callback(err);
    }
    cleanUp();
  };

  if (options.body && (options.body instanceof Blob)) {
    readAsArrayBuffer(options.body, function (arrayBuffer) {
      xhr.send(arrayBuffer);
    });
  } else {
    xhr.send(options.body);
  }

  return ret;
}

xhRequest({
  url: url + '/_session',
  method: 'POST',
  headers: {},
  json: true,
  body: {
    name: 'admin',
    password: 'admin'
  },
  processData: true
}, function (err, response, body) {
  if (err) {
    console.log('err=', err);
    done();
  } else {
    console.log('response=', response);
    // console.log('response.headers=', response.headers);
    console.log('body=', body);
    return xhRequest({
      url: url + '/_users/_all_docs',
      method: 'GET',
      headers: {}
    }, function (err, response, body) {
      if (err) {
        console.log('err=', err);
        done();
      } else {
        console.log('response=', response);
        // console.log('response.headers=', response.headers);
        console.log('body=', body);
        done();
      }
    });
  }
});

Instead, I think a better approach would be to use fetch and a pollyfill. It would also be nice to use fetch in node and completely remove the dependency on request.
I've verified that the following works:
return fetch(url + '/_session', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    name: 'admin',
    password: 'admin'
  }),
  credentials: 'include'
}).then(function (response) {
  console.log('response', response);
  return response.json();
}).then(function (json) {
  console.log('session create json=', json);

  return fetch(url + '/_users/_all_docs', {
    method: 'GET',
    headers: { 'Content-Type': 'application/json' },
    credentials: 'include'
  });
}).then(function (response) {

  response.body.on('data', function (data) {
    console.log('data');
  });

  return response.json();
}).then(function (json) {
  console.log('all_docs json=', json);
});

Another note: it appears that in the latest version of Chrome you need to use HTTPS in order for the cookie to propagate over requests.

I think the best first phase would be to create something like FetchToRequest that is a drop in replacement for request, which uses fetch underneath. This would also need to be used in quelle layer. Then as a second phase (if it is really needed), all calls to request can be replaced with fetch.

Just wondering if there was any progress on this issue.  I tried out Slouch today and it looked pretty neat, but then I hit this authentication problem.

Sorry, I haven’t had time to devote to this and I’m not sure when I will. PRs are welcome and I can assist you if you wanted to take on this task :)

Thanks for the update.  If we take this on then I'll be sure to make s pull request with our solution.

Does this mean slouch is not usable in browser as authentication doesn't work?
I don't understand this issue. In browser, set-cookie response from couchdb server is handled by the browser and subsequent request from browser will automatically include cookie. I tested this in Chrome browser using a Rest client. First I POST to /_session with username and password. Eventhough the response doesn't have set-cookie (stopped by browser), subsequent GET request to /_all_dbs works because browser automatically sends the cookie. If couchdb updates set-cookie on a subsequent response, then browser will automatically update cookie.

Found this PR: https://github.com/request/request/pull/3103
Probably not the best way to inject withCredentials: true, but this is what I have done:
scripts\request-wrapper.js:
RequestWrapper.prototype.requestFactory = function () {
  var self = this;
  return function (opts) {
    arguments[0] = self._setCookieHeader(opts);
    ////////////////////////////////////////////
    arguments[0].withCredentials = true;
    ////////////////////////////////////////////
    return request.apply(request, arguments);
  };
};

With that modification, the following code works in browser:
const client = new Slouch("https://test.com")
client.user.logIn("testuser", "supersecret")
          .then(() => {
            client.user.create("abc","def", ["xyz"])
          })
          .then(() => {
            client.db.create("testdb")
          })
          .then(() => {
            client.user.logOut();
          })

Cool, I’ll take a closer look in a bit!
On Sun, Mar 3, 2019 at 1:24 PM Jeffrey Layanto<EMAIL_ADDRESS>wrote:

Found this PR: request/request#3103
https://github.com/request/request/pull/3103
Probably not the best way to inject withCredentials: true, but this is
what I have done:
scripts\request-wrapper.js:
RequestWrapper.prototype.requestFactory = function () {
var self = this;
return function (opts) {
arguments[0] = self._setCookieHeader(opts);
////////////////////////////////////////////
arguments[0].withCredentials = true;
////////////////////////////////////////////
return request.apply(request, arguments);
};
};
With that modification, the following code works in browser:
const client = new Slouch("https://test.com")
client.user.logIn("testuser", "supersecret")
.then(() => {
client.user.create("abc","def", ["xyz"])
})
.then(() => {
client.db.create("testdb")
})
.then(() => {
client.user.logOut();
})
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/redgeoff/slouch/issues/10#issuecomment-469065863, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ADOPKs6cdME1UE9Nx5kVLzALYl8JWSLSks5vTD2SgaJpZM4OcEWG
.

And cookie authentication renew to extend the sliding window as per https://stackoverflow.com/a/10359837/2831606


References support needed.

We currently do not support the references section of the API, which we should redress. This can act as a meta-issue for references support, and can be closed once the all of the sub-issues have been resolved.

Choose an alternative (pip installable) FASTA file parsing library, for data driven tests.
Implement toProtocolElement for ReferenceSet and Reference in ga4gh/datamodel/references.py, and add data driven tests for this functionality (using the library chosen above).
Implement getBases (or whatever seems appropriate) in datamodel/references.py as the low-level equivalent of the ListReferenceBasesRequest method. This should have start and end parameters, and return a string. Create datadriven tests for this functionality, and check corner cases. Add lots of examples of FASTA files.
Add a ReferenceSimulator that generates random sequence in a reproducible manner.
Add support for the ListReferenceBases queries in backend.py. Add tests for this functionality in all the appropriate places.
Update the ga4gh-example-data to include the relevant subsets of the GRC references for the 1000G data (but see #312).

Wrt (1):
$ pip search fasta
...
fastavro            - Fast iteration of AVRO files
pyfaidx             - pyfaidx: efficient pythonic random access to fasta
                      subsequences
pyfasta             - fast, memory-efficient, pythonic (and command-line) access
                      to fasta sequence files
fastools            - FASTA/FASTQ analysis and manipulation toolkit.
multifastadb        - present a collection of indexed fasta files as a single
                      source
pyfastaq            - Script to manipulate FASTA and FASTQ files, plus API for
                      developers
tfasta              - Parses fasta files using templates and creates formatted
                      fasta.
fastinterval        - Interval class and fasta access
oldowan.fasta       - Read and write FASTA format.
nebfa               - Fasta file parser.
fastaq              - fastAQ is a very and super lightweight package for working
                      with FASTA/FASTQ sequences
fastac              - Compiler for FASTA files and a FASTA-based DNA scripting
                      language.
fasta               - The fasta python package enables you to deal with
                      biological sequence files easily
phytab_splitter     - Splits Phytab files into FASTA

Do we have any reason for picking one of these over the other?

PageRank says this one https://pypi.python.org/pypi/pyfasta/

I'd try out pyfasta and see how it goes. We're looking for:

Gives us access to FASTA stuff;
Is maintained (has a recent release) and mature;
Installs cleanly on pypi without requiring lots of dependencies.
It's not horrible to work with.

Ok, where should we get / how should we generate example FASTA data for the datadriven tests?

Here's an example:
ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/technical/reference/phase2_reference_assembly_sequence/hs37d5.fa.gz
We can snip out a few bits of this as a place to start. It should be straightforward enough to get your hands on some other FASTAs at UCSC!

That website seems to be down.  Any other examples?

It looks like we have an example FASTA file in the tree already, tests/data/references/example_1/test.fa.gz.  Unfortunately, it doesn't work with pyfasta (but the library may just suck; going to try others).
>>> f = pyfasta.Fasta('tests/data/references/example_1/test.fa.gz')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/dannyc/ga4gh/bug/lib/python2.7/site-packages/pyfasta/fasta.py", line 73, in __init__
    flatten_inplace)
  File "/Users/dannyc/ga4gh/bug/lib/python2.7/site-packages/pyfasta/records.py", line 57, in prepare
    for i, (seqid, seq) in enumerate(seqinfo_generator):
  File "/Users/dannyc/ga4gh/bug/lib/python2.7/site-packages/pyfasta/fasta.py", line 110, in gen_seqs_with_headers
    seqs.append(line)
AttributeError: 'NoneType' object has no attribute 'append'

@jeromekelleher can you add a README to ~/ga4gh/server/tests/data/references/example_1 to say how you generated these files?
Also, should we prefer using FAI or GZI files to FA.GZ files?

I can't remember to be honest @dcolligan --- I think I just manually snipped a bit out of GRCH37. I have no idea whether we should prefer FAI or GZI.
@macieksmuga --- you must be dealing with a bunch of FASTA files for the graph reference stuff. Any ideas here on how to create some good testing examples?

Fixed in #390


##[error]invalid json response body at https://*****.mongo.cosmos.azure.com:443/ reason: Unexpected end of JSON input

Hi I am getting this error type for all json file I am trying:
[{"name":"John", "age":30, "car":null}]  --example 1 json array
{"name":"John", "age":30, "car":null}    -- example 2 json string
{                                                                   -- example 3 regular json
"name":"John",
"age":30,
"car":null
}
can you please help me with the correct format this task would like to receive? can you please provide for me an example of a simple json that works with this task

I saw the same error message when using port 443 in the connection string. My cosmos account supplies 10255 as the port. I believe SSL is required for connections to all CosmosDB accounts, but I think you should use port 10255 instead of 443.
That gets me past the error message you saw, but I am seeing errors stating that the request to my cosmos account "...failed, reason: socket hang up". That seems like a connection issue when the Azure SDK client code of the pipeline task attempts to make a request to the CosmosDB account in the await client.databases.createIfNotExists({ id: inputDatabase}); call on line 69 of index.ts of this task's code. I'm not sure what to do there.


Move version into MRL

Change-Id: Iafa45f59cf966d8134b2cc127d1243767513132b
Description
Brief description of what this PR is about

If this change is a backward incompatible change, why must this change be made?
Interesting edge cases to note here

Codecov Report

Merging #1114 (d091a1b) into master (1f0c1a9) will decrease coverage by 0.04%.
The diff coverage is 94.71%.

@@             Coverage Diff              @@
##             master    #1114      +/-   ##
============================================
- Coverage     70.02%   69.97%   -0.05%
+ Complexity     5277     5276       -1
============================================
  Files           514      513       -1
  Lines         23489    23497       +8
  Branches       2516     2516
============================================
- Hits          16447    16443       -4
- Misses         5705     5722      +17
+ Partials       1337     1332       -5

Impacted Files
Coverage Δ

...ain/java/ai/djl/basicdataset/cv/CocoDetection.java
0.00% <0.00%> (ø)

...main/java/ai/djl/basicdataset/cv/ImageDataset.java
73.33% <ø> (ø)

...i/djl/basicdataset/cv/classification/ImageNet.java
0.00% <0.00%> (ø)

...main/java/ai/djl/basicdataset/nlp/TextDataset.java
72.13% <ø> (ø)

...c/main/java/ai/djl/repository/LocalRepository.java
70.83% <66.66%> (ø)

...pi/src/main/java/ai/djl/repository/Repository.java
81.81% <75.00%> (-3.90%)
:arrow_down:

api/src/main/java/ai/djl/repository/MRL.java
91.30% <92.59%> (ø)

...src/main/java/ai/djl/repository/JarRepository.java
89.13% <100.00%> (ø)

.../main/java/ai/djl/repository/RemoteRepository.java
90.24% <100.00%> (ø)

.../main/java/ai/djl/repository/SimpleRepository.java
81.01% <100.00%> (ø)

... and 34 more

Continue to review full report at Codecov.

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