ApplicationInsights:Could not decode the auth cookie with error

SDK Version: 2.9.6
Express version: 4.21.1
The above version of the SDK is in use with an Express application, installed on Windows Server.

ApplicationInsights:Could not decode the auth cookie with error:  [
"[object Error]{ stack: 'URIError: URI malformed\n" +
'    at decodeURI ()\n' +
'    at HttpRequestParser._getId (\node_modules\applicationinsights\out\AutoCollection\HttpRequestParser.js:217:26)\n' +
'    at HttpRequestParser.getRequestTags (\node_modules\applicationinsights\out\AutoCollection\HttpRequestParser.js:118:110)\n' +
'    at AutoCollectHttpRequests.endRequest (\node_modules\applicationinsights\out\AutoCollection\HttpRequests.js:232:55)\n' +
'    at ServerResponse. (\node_modules\applicationinsights\out\AutoCollection\HttpRequests.js:192:41)\n' +
'    at Object.onceWrapper (node:events:631:28)\n' +
'    at ServerResponse.clsBind (\node_modules\cls-hooked\context.js:172:17)\n' +
'    at ServerResponse.emit (node:events:529:35)\n' +
'    at ServerResponse.emitted (\node_modules\emitter-listener\listener.js:134:21)\n' +
"    at onFinish (node:_http_outgoing:1008:10)', message: 'URI malformed', name: 'URIError'"
]

Could you advise / provide some context as to why this might occur? the Module is being loaded relatively simply using the application insights connection string

const appInsights = require('applicationinsights')
appInsights
.setup()
appInsights.defaultClient.context.tags[appInsights.defaultClient.context.keys.cloudRole] = 'our-name'
appInsights.start()

I wouldn't be surprised if a malformed request had caused the error (most day to day requests are not causing the error), however I don't understand what the auth cookie aspect refers to.
Many thanks

@DevRCRun We try to parse some values from cookies in the HttpRequestParser. This warning comes from a function concerned with parsing the ai_authUser from the request's cookies. We run decodeURI() on the cookie when trying to get this value. If that function throws an error we catch and log the warning you're seeing above. As the exception is handled and just a warning is logged, this shouldn't impact export of request telemetry.


numpyro and blackjax samplers producing different results

Bug Description
I followed the use-with-numpyro notebook to get a model that works with numpyro's sampler running on blackjax. The model runs (quickly) but the values it produces are well off. It is suspected this is due to a poor choice of step size and mass matrix.
Steps/Code to Reproduce
The code requires external data, so it is best to clone the repo if the problem isn't immediately solvable. The working numpyro code is here and the attempt using blackjax is here. The numpyro model and blackjax code is also below.
def model(home_id, away_id, score1_obs=None, score2_obs=None):
    # priors
    alpha = numpyro.sample("alpha", dist.Normal(0.0, 1.0))
    sd_att = numpyro.sample(
        "sd_att",
        dist.FoldedDistribution(dist.StudentT(3.0, 0.0, 2.5)),
    )
    sd_def = numpyro.sample(
        "sd_def",
        dist.FoldedDistribution(dist.StudentT(3.0, 0.0, 2.5)),
    )

    home = numpyro.sample("home", dist.Normal(0.0, 1.0))  # home advantage

    nt = len(np.unique(home_id))

    # team-specific model parameters
    with numpyro.plate("plate_teams", nt):
        attack = numpyro.sample("attack", dist.Normal(0, sd_att))
        defend = numpyro.sample("defend", dist.Normal(0, sd_def))

    # likelihood
    theta1 = jnp.exp(alpha + home + attack[home_id] - defend[away_id])
    theta2 = jnp.exp(alpha + attack[away_id] - defend[home_id])

    with numpyro.plate("data", len(home_id)):
        numpyro.sample("s1", dist.Poisson(theta1), obs=score1_obs)
        numpyro.sample("s2", dist.Poisson(theta2), obs=score2_obs)

rng_key = random.PRNGKey(0)

# translate the model into a log-probability function
init_params, potential_fn_gen, *_ = initialize_model(
    rng_key,
    model,
    model_args=(
        train["Home_id"].values,
        train["Away_id"].values,
        train["score1"].values,
        train["score2"].values,
    ),
    dynamic_args=True,
)

logprob = lambda position: -potential_fn_gen(
    train["Home_id"].values,
    train["Away_id"].values,
    train["score1"].values,
    train["score2"].values,
)(position)

initial_position = init_params.z
initial_state = nuts.new_state(initial_position, logprob)

# run the window adaptation (warmup)
kernel_factory = lambda step_size, inverse_mass_matrix: nuts.kernel(
    logprob, step_size, inverse_mass_matrix
)

last_state, (step_size, inverse_mass_matrix), _ = stan_warmup.run(
    rng_key, kernel_factory, initial_state, 1000
)

@partial(jax.jit, static_argnums=(1, 3))
def inference_loop(rng_key, kernel, initial_state, num_samples):
    def one_step(state, rng_key):
        state, info = kernel(rng_key, state)
        return state, (state, info)

    keys = jax.random.split(rng_key, num_samples)
    _, (states, infos) = jax.lax.scan(one_step, initial_state, keys)

    return states, infos

# Build the kernel using the step size and inverse mass matrix returned from the window adaptation
kernel = kernel_factory(step_size, inverse_mass_matrix)

# Sample from the posterior distribution
states, infos = inference_loop(rng_key, kernel, last_state, 100_000)

Expected Results
As an example, for the "home" parameter, should be around 0.2-0.3. The "sd_att" and "sd_def" parameters should be constrained by the model to be positive (using FoldedDistribution()).
Actual Results
The parameter values are well off:

Versions

BlackJAX 0.2.1
numpyro 0.7.2
Python 3.8.0 | packaged by conda-forge | (default, Nov 22 2019, 19:11:19)
[Clang 9.0.0 (tags/RELEASE_900/final)]
Jax 0.2.17
Jaxlib 0.1.67

Thanks for reporting! likely it is related to https://github.com/blackjax-devs/blackjax/issues/116 so assigning to @rlouf rlouf

Hello!
I'm just wondering if this is still an issue, or has this been fixed by recent releases?

@theorashid id be interested to know if this works with the latest version !

Hey both, so I left this stale because of the pymc.sampling_jax.sample_blackjax_nuts function which is less fiddly than using numpyro's initialize_model.
But I rewrote my model for the new blackjax API with numpyro. There's good news and bad news:
Good news: the model is converging nicely
Bad news: the standard deviation parameters are negative. I'm not sure how this is happening because it's the same model and a working numpyro version which uses the FoldedDistribution to keep things positive. I tried replacing the priors with HalfNormals and it still persists.
This is a weird one. Any ideas?
Code is here.

Yay, great news! The values are negative because in the model you've specified a folded transformation. The logpdf that numpyro returns works in the /unconstrained/ space, so blackjax will return values of the parameters in the unconstrained space and you need to apply the original transformation to get results in the original space (with the folder transformation).

Also did you run the code with the latest version on master or the last release on Pypi ?

Okay great, I was wondering how numpyro was sampling a normal with negative sigma. Glad to hear it all makes sense.
I ran this using the latest pypi release – 0.7.0
blackjax                  0.7.0                    pypi_0    pypi
numpyro                   0.9.0              pyhd8ed1ab_0    conda-forge

Great, thank you for rerunning the example!

Is there a general method to know which inverse transformation to apply to return the constrained parameter in the case of Numpyro while using Blackjax? In the case of sigma, it can be both absolute and exponential. How to decide which one it is?

I am also seeing a poor performance when using numpyro.initialize_model and looking at the samples I think it might also be related to some transfromation? Was there a solution to this found in the end?

No, I wasn't able to find a solution it :(

For numpyro, default transformation are associated with each bounded distribution at init time. e.g., for LogNormal the default transformation is Exp:
https://github.com/pyro-ppl/numpyro/blob/ca96eca8e8e1531e71ba559ef7a8ad3b4b68cbc2/numpyro/distributions/continuous.py#L1152-L1154

There should be a way to get all the transformation being applied using numpyro's effect handler, maybe @fehiepsi know?

Hi all, managed to get what I think is a solution! In the end I made use of the util function
init_params_unconstrained, potential_fn_gen, post_proc_fun, model_trace = numpyro.infer.util.initialize_model(
    rng_key=...,
    model=...,
    model_args=...
    dynamic_args=..,
)

Then you can return a function that undoes the transformations as:
unmapper = post_proc_fun(None)

samples_constrained = unmapper(samples_unconstrained)

Hope this helps!


I'm using 'UBUNTU 16.04 LTS' and I've a problem on this

https://ripple.com/build/build-run-rippled-ubuntu/
I was processing on 2nd chapter, 12 paragraph and i'm having a trouble on 'scons' error.
How can i solve this problem?(underline text is build process)

-Isrc/beast/extras -Isrc/nudb/include -Ibuild/proto -Isrc/soci/src -Isrc/soci/include src/ripple/beast/unity/beast_insight_unity.cpp
In file included from src/ripple/beast/net/IPAddressV4.h:23:0,
from src/ripple/beast/net/IPAddress.h:23,
from src/ripple/beast/net/IPEndpoint.h:23,
from src/ripple/beast/insight/StatsDCollector.h:26,
from src/ripple/beast/insight/Insight.h:35,
from src/ripple/beast/unity/beast_insight_unity.cpp:22:
src/ripple/beast/hash/hash_append.h:42:40: fatal error: boost/container/flat_set.hpp: No such file or directory
compilation terminated.
scons: *** [build/gcc.release/src/ripple/beast/unity/beast_insight_unity.o] Error 1
scons: building terminated because of errors.

If you still have issues with building, please open an new issue. Thanks!


[BUG] VisualStudioCredential fails with AADSTS65002 when accessing Application Insights

Library name and version
Azure.Identity 1.10.1
Describe the bug
I am trying to get a token for Application Insights using DefaultAzureCredential.  The code setup is like this
var credential = new DefaultAzureCredential(new DefaultAzureCredentialOptions {
    ExcludeEnvironmentCredential = true,
    ExcludeManagedIdentityCredential = true,
    ExcludeSharedTokenCacheCredential = true,
    ExcludeAzureDeveloperCliCredential = true,
    ExcludeAzurePowerShellCredential = true,
    ExcludeInteractiveBrowserCredential = true,
    ExcludeVisualStudioCodeCredential = true,
    ExcludeVisualStudioCredential = false,
    ExcludeWorkloadIdentityCredential = true,
    ExcludeAzureCliCredential = true
});
var token =  credential.GetTokenAsync(new TokenRequestContext(new string[] { "https://api.applicationinsights.io/.default" } ));

Expected behavior
The token should be returned.
Actual behavior
VisualStudioCredential throws an exception:
{
              "ClassName": "Azure.Identity.CredentialUnavailableException",
              "Message": "Process \"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\Asal\\TokenService\\Microsoft.Asal.TokenService.exe\" has failed with unexpected error: TS003: Error, TS004: Unable to get access token.  'AADSTS65002: Consent between first party application '04f0c124-f2bc-4f59-8241-bf6df9866bbd' and first party resource 'f5c26e74-f226-4ae8-85f0-b4af0080ac9e' must be configured via preauthorization - applications owned and operated by Microsoft must get approval from the API owner before requesting tokens for that API.\r\nTrace ID: 032456dc-f4a7-4ec5-ae65-33cc6c183d00\r\nCorrelation ID: 6e665b78-4ede-44f4-8fba-da34bf3e4a04\r\nTimestamp: 2023-10-09 09:17:06Z'.",
              "Data": null,
              "InnerException": {
                "ClassName": "System.AggregateException",
                "Message": "One or more errors occurred.",
                "Data": null,
                "InnerException": {
                  "ClassName": "Azure.Identity.CredentialUnavailableException",
                  "Message": "Process \"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\Asal\\TokenService\\Microsoft.Asal.TokenService.exe\" has failed with unexpected error: TS003: Error, TS004: Unable to get access token.  'AADSTS65002: Consent between first party application '04f0c124-f2bc-4f59-8241-bf6df9866bbd' and first party resource 'f5c26e74-f226-4ae8-85f0-b4af0080ac9e' must be configured via preauthorization - applications owned and operated by Microsoft must get approval from the API owner before requesting tokens for that API.\r\nTrace ID: 032456dc-f4a7-4ec5-ae65-33cc6c183d00\r\nCorrelation ID: 6e665b78-4ede-44f4-8fba-da34bf3e4a04\r\nTimestamp: 2023-10-09 09:17:06Z'.",

Reproduction Steps
So the code above is a minimal reproduction of the issue.  However to see the error it must be part of a website, which is started from the command line with dotnet run:

When I run this code in a unit test in Visual Studio it works fine (I just don't understand this)

When running the website, if I authenticate via the command line using az login, that works fine

If I authenticate in Visual Studio 2019, that works fine

When the website is deployed into Azure, so using ManagedIdentity, that works fine

If I authenticate using Visual Studio 2022, but access Azure Storage, that works fine

The issue looks very similar to this one VisualStudioCredential fails with AADSTS65002
Environment
Visual Studio 2022

Thank you for reporting the issue. Tagging and assigning to the team member best able to assist you.
@christothes could you please take a look at this.
/cc: @schaabs as FYI

I believe this is a client application pre-auth issue that VS needs to address. //cc: @crmann1

We have requested pre-authorization. It will roll out when the team completes their roll out procedures. There is no ETA at the moment but I have requested one from them.

Please try again now, the pre-authorization request has gone through.  Locally I can now get a token for that resource using visual studio and the change has been applied globally so it should work.

/unresolve
Hi @crmann1,
I have been testing the fix today with a colleague and it does not appear to be resolved.
The exception we are getting now is slightly different in it's detail, but is still along the same lines about preauthorization:
Thanks
Mat
{
  "ClassName": "Azure.Identity.CredentialUnavailableException",
  "Message": "Process \"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\Asal\\TokenService\\Microsoft.Asal.TokenService.exe\" has failed with unexpected error: TS003: Error, TS004: Unable to get access token.  'WAM Error  \r\n Error Code:<PHONE_NUMBER> \r\n Error Message: IncorrectConfiguration \r\n WAM Error Message: V2Error: invalid_request AADSTS65002: Consent between first party application '04f0c124-f2bc-4f59-8241-bf6df9866bbd' and first party resource 'f5c26e74-f226-4ae8-85f0-b4af0080ac9e' must be configured via preauthorization - applications owned and operated by Microsoft must get approval from the API owner before requesting tokens for that API.\r\nTrace ID: 009467c0-7958-4ac2-8dec-9f027b528900\r\nCorrelation ID: 1875a508-8687-4164-98f4-e5e907f89b30\r\nTimestamp: 2023-10-30 11:24:16Z \r\n Internal Error Code: 557973643 \r\n Possible causes: \r\n- Invalid redirect uri - ensure you have configured the following url in the application registration in Azure Portal: ms-appx-web://microsoft.aad.brokerplugin/04f0c124-f2bc-4f59-8241-bf6df9866bbd \r\n'.",
  "Data": null,
  "InnerException": {
	"ClassName": "System.InvalidOperationException",
	"Message": "TS003: Error, TS004: Unable to get access token.  'WAM Error  \r\n Error Code:<PHONE_NUMBER> \r\n Error Message: IncorrectConfiguration \r\n WAM Error Message: V2Error: invalid_request AADSTS65002: Consent between first party application '04f0c124-f2bc-4f59-8241-bf6df9866bbd' and first party resource 'f5c26e74-f226-4ae8-85f0-b4af0080ac9e' must be configured via preauthorization - applications owned and operated by Microsoft must get approval from the API owner before requesting tokens for that API.\r\nTrace ID: 009467c0-7958-4ac2-8dec-9f027b528900\r\nCorrelation ID: 1875a508-8687-4164-98f4-e5e907f89b30\r\nTimestamp: 2023-10-30 11:24:16Z \r\n Internal Error Code: 557973643 \r\n Possible causes: \r\n- Invalid redirect uri - ensure you have configured the following url in the application registration in Azure Portal: ms-appx-web://microsoft.aad.brokerplugin/04f0c124-f2bc-4f59-8241-bf6df9866bbd \r\n'",
	"Data": null,
	"InnerException": null,
	"HelpURL": null,
	"StackTraceString": "   at Azure.Identity.VisualStudioCredential.RunProcessesAsync(List`1 processStartInfos, Boolean async, CancellationToken cancellationToken)",
	"RemoteStackTraceString": null,
	"RemoteStackIndex": 0,
	"ExceptionMethod": null,
	"HResult": -2146233079,
	"Source": "System.Private.CoreLib",
	"WatsonBuckets": null
  },
  "HelpURL": null,
  "StackTraceString": "   at Azure.Identity.VisualStudioCredential.RunProcessesAsync(List`1 processStartInfos, Boolean async, CancellationToken cancellationToken)\r\n   at Azure.Identity.VisualStudioCredential.GetTokenImplAsync(TokenRequestContext requestContext, Boolean async, CancellationToken cancellationToken)\r\n   at Azure.Identity.CredentialDiagnosticScope.FailWrapAndThrow(Exception ex, String additionalMessage, Boolean isCredentialUnavailable)\r\n   at Azure.Identity.VisualStudioCredential.GetTokenImplAsync(TokenRequestContext requestContext, Boolean async, CancellationToken cancellationToken)\r\n   at Azure.Identity.VisualStudioCredential.GetTokenAsync(TokenRequestContext requestContext, CancellationToken cancellationToken)\r\n   at Azure.Identity.DefaultAzureCredential.GetTokenFromSourcesAsync(TokenCredential[] sources, TokenRequestContext requestContext, Boolean async, CancellationToken cancellationToken)",
  "RemoteStackTraceString": null,
  "RemoteStackIndex": 0,
  "ExceptionMethod": null,
  "HResult": -2146233088,
  "Source": "System.Private.CoreLib",
  "WatsonBuckets": null
},

I can get a token for https://api.applicationinsights.io internally now where as when this was first reported I got the same pre-authorization message.   I will follow up with the application insights service team to see if they only deployed the change internally and when they expect to deploy it to everyone.  Since normally when a change like this is deployed it works within a short period of time.

Ok, I just looked at their service metadata they only enabled it for the microsoft tenant to test that it worked. Last week I indicated to them that it worked and should be deployed but that has not happened. I will let ask them again today to deploy it.  I also looked at the permissions given.  Right now they are only adding Data.Read permissions are there other permissions that you need to complete your operations?

Hi @crmann1 ,
I think Data.Read should be enough for what we are doing.
Thanks for your help.
Mat

Hi @crmann1 @christothes
We tested this morning on several different developer machines and it all seems to be working now.
Thank you very much for your help.
Cheers
Mat


Slack invite link is no longer active

Summary
The slack invitation has expired: https://argoproj.github.io/community/join-slack
Same as #2224, #1789 and #1706

Message from the maintainers:
Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.

I pinged our webmaster to update our link. Will close this when it's working again. Thanks!

Link should work now!

I can confirm it works, thank you


Paths can be overridden using environment variables on Linux, but not MacOS?

Thanks for creating platformdirs. I was surprised to learn that while on Linux, user_data_dir() can be overridden with $XDG_DATA_HOME (unix.py), it cannot be overridden on MacOS (macos.py).
It would be very useful if a single environment variable could be used to override the OS-specific default chosen by platformdirs. My assumption was that this is what platformdirs did until I tested it. Perhaps this could be made clearer to avoid confusion? I'm happy to PR the readme if welcomed.

Duplicate of https://github.com/platformdirs/platformdirs/issues?q=is%3Aissue+sort%3Aupdated-desc+XDG_DATA_HOME+is%3Aclosed

Hi @gaborbernat, evidently this path is well trodden, but did you read the final sentence?

Perhaps this could be made clearer to avoid confusion? I'm happy to PR the readme if welcomed.

I simply asked if clarification of the readme is welcome as a PR. That way fewer people will be surprised by the library not working as they expected. The extent of activity related to #4 shows that a lot of people are confused by this.
Also, the Readme says:

On Linux (and other Unices), according to the XDG Basedir Spec, it should be:

This is somewhat misleading since MacOS is a Unix-based OS, but is not covered by the behaviours this setence references. This sentence led me to believe the intended behaviour is a bug.
Would you in principle be happy to merge clarification of MacOS/Windows behaviour in the Readme?

Would you in principle be happy to merge clarification of MacOS/Windows behaviour in the Readme?

Definitely 😊 while macOS claims to be POSIX-compliant, in practice at no point their docs encourage or document the use of the XDG_DATA_HOME env var and such would surprise some user if we'd add support.

Thank you, I understand the rationale for lack of support having read #4.
Perhaps the best place to introduce a clarification is in the section
platformdirs to the rescue? Perhaps just a sentence early on, in order to
signpost users.
On Wed, 6 Mar 2024 at 00:01, Bernát Gábor @.***> wrote:

Would you in principle be happy to merge clarification of MacOS/Windows
behaviour in the Readme?
Definitely 😊 while macOS claims to be POSIX-compliant, in practice at no
point their docs encourage or document the use of the XDG_DATA_HOME env var
and such would surprise some user if we'd add support.
—
Reply to this email directly, view it on GitHub
https://github.com/platformdirs/platformdirs/issues/269#issuecomment-1979838183,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAHWAABIH5KDKTLDGP5ER5DYWZMGTAVCNFSM6AAAAABEH26OQKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZZHAZTQMJYGM
.
You are receiving this because you authored the thread.Message ID:
@.***>

Agreed, please put in a PR with that.

Thank you, I understand the rationale for lack of support having read #4. Perhaps the best place to introduce a clarification is in the section platformdirs to the rescue? Perhaps just a sentence early on, in order to signpost users.
…
On Wed, 6 Mar 2024 at 00:01, Bernát Gábor @.***> wrote: Would you in principle be happy to merge clarification of MacOS/Windows behaviour in the Readme? Definitely 😊 while macOS claims to be POSIX-compliant, in practice at no point their docs encourage or document the use of the XDG_DATA_HOME env var and such would surprise some user if we'd add support.

I am stuck in circular readathon between issue #4 the comments in this issue... and I hate to "beat a dead horse", but are you saying that platformdirs will not support the XDG_* environment variables?
Why?  Why would you not allow a developer to have the choice?   You say, "...such would surprise some user if we'd add support."  What kind of user would be surprised?  Only a software developer would be using those XDG_* variables, not a non-technical user, so where is the surprise?  I was definitely surprised by lack of support!
My use-case is having the reference platform for our code base using VSCode dev-container which is based on Linux, thus follows the XDG conventions.  Sometimes we want to do a build outside the dev-container on MacOS  so it would be much better to have the directory structure harmonized with Linux via the XDG environment variable overrides.   Even the platformdirs says:

"On Linux (and other Unices), according to the XDG Basedir Spec, it should be:

...and certainly MacOS is a UNIX variant.  I think you're making some kind of argument that because MacOS is not precisely POSIX-compliant you must not consider allowing respect for XDG environment variable overrides, therefore only follow the rigid Apple directory guidelines -  but then I look at the source code for macos.py and noticed that you're totally accommodating Homebrew and their non-POSIX, non-Apple recommended directory guidelines!  i.e. /opt/homebrew and /opt/homebrew/share.
If you want to be consistent with not allowing us to override directory base names with XDG environment variables, then you should remove all support for Homebrew and Homebrew directories and update the README.md to state, "because Homebrew directories don't follow the Apple directory naming standards, we can't support Homebrew, sorry."  ...or... you could just add support for overriding base directories via XDG environment variables! (I would happily provide a PR)

I am stuck in circular readathon between issue #4 the comments in this issue... and I hate to "beat a dead horse", but are you saying that platformdirs will not support the XDG_* environment variables on MacOS?

Yes.

Why?

Because macOS has its protocol on application and configuration data that we follow instead. If you show me an Apple doc that says that XDG should work on macOS I will change my mind.

MacOS is a UNIX variant

This is only partially true, when and how it suits Apple, but not in general.

If you show me an Apple doc that says that XDG should work on macOS I will change my mind.

Where in the Apple documentation does it mention those Homebrew directories that you currently support? macOS Library Directory Details
It's up to you, but I think it's more important to serve the needs of the users of your library rather than Apple.  I understand that if a developer uses your library in an application that will potentially be made a available on the App Store, that you want to precisely follow their guidelines (even if Homebrew is not mentioned in macOS Library Directory Details)
What about having a special environment variable like DEVELOPER_MODE=1 or something like that to enable the functionality of respecting XDG?


boost::signals2 deadlock with pthread

Hello,
This issue seems to be back on version 1.65
https://svn.boost.org/trac10/ticket/10721
If the code is compiled with pthread then this will block on the first assert, if it is not build with pthread it will not block,
g++ deadlock-boost-signals2.cpp -pthread -o output
g++ deadlock-boost-signals2.cpp -o output2
deadlock-boost-signals2.zip
Thank you,
Adrian Radu

It should be fixed on the develop branch now.  I also added your test to the signals2 test suite.

merged to master


Remove deprecated support for -psm argument

It was replaced by --psm and deprecated in commit 92d981b93.
Signed-off-by: Stefan Weil<EMAIL_ADDRESS>

Another two:
https://github.com/tesseract-ocr/tesseract/search?q="save_raw_choices"
https://github.com/tesseract-ocr/tesseract/search?q="segment_penalty_ngram_best_choice"

I just hope we won't get multiple complaints on this change soon...

We got the first complaint.
https://github.com/tesseract-ocr/tesseract/commit/ee201e1f4fa277
I suggest to partly revert this PR.
If '-psm' is used, print this error message:

The form '-psm NUM' is not supported anymore, use '--psm NUM'

and then exit.


Enums are not converted from snake_case

Based on my brief testing, it does not seem that enum keys are converted from snake_case to PascalCase. (I presume that PascalCase should be used over camelCase, since it is idiomatic.)
For example, I would expect the following proto code:
enum Status {
  launched = 1;
  init_game = 2;
  in_game = 3;
  in_replay = 4;
  ended = 5;
  quit = 6;
  unknown = 99;
}

To be converted to:
enum Status {
  Launched = 1,
  InitGame = 2,
  InGame = 3,
  InReplay = 4,
  Ended = 5,
  Quit = 6,
  Unknown = 99,
}

But instead, the enum keys are unchanged, and remain snake_case.

True, we don't change enum value case - haven't considered that TBH. However:
Following the style guide, you should use:
enum Status {
  LAUNCHED = 1;
  INIT_GAME = 2;
  // ...
}

Which generates as:
enum Status {
  LAUNCHED = 1,
  INIT_GAME = 2,
  // ...
}

And I think that's not terrible. If you scroll down a bit in the TypeScript handbook, you'll notice an example with uppercase enum values as well.
By the way, all protobuf enums should really have a UNSPECIFIED = 0 value in proto3 syntax, and all values should be prefixed by the enum name to prevent collisions. I recommend a linter like buf. So your enum should really be:
enum Status {
  STATUS_UNSPECIFIED = 0;
  STATUS_LAUNCHED = 1;
  STATUS_INIT_GAME = 2;
  // ...
}

(protobuf-ts drops the shared enum value prefix, so you aren't bothered by it in JS)

Tim, thanks for the quick reply.

And I think that's not terrible. If you scroll down a bit in the TypeScript handbook, you'll notice an example with uppercase enum values as well.

That's true! However, the LogLevel enum is the only exception on the page - all the other enums are PascalCase.

Most TypeScript Code uses PascalCase over SHOUTING_SNAKE_CASE
For TypeScript, I think that Basarat's style guide is pretty popular, and it says to use PascalCase for enum members. He gives the following reason:

Reason: Convention followed by TypeScript team i.e. the language creators e.g SyntaxKind.StringLiteral. Also helps with translation (code generation) of other languages into TypeScript.

This is confirmed by looking at code in the TypeScript repository. We can also see PascalCase enums when we look at code in the Angular repository, or the VSCode repository, or BabylonJS, to name a few big ones.

PascalCase has functional advantages over SHOUTING_SNAKE_CASE
To be fair, I did notice some SHOUTING_SNAKE_CASE enums in these repos, but they are much less frequent. I think that this is for historical reasons.
In JavaScript, enum members have historically been SHOUTING_SNAKE_CASE for the same reason that it is conventional to write constants in SHOUTING_SNAKE_CASE - it represents non-immutability, communicating to the reader: "don't modify this variable!"
However, now that we have TypeScript, immutability no longer needs to be communicated via the variable name. We can just hover over the variable to find out that it is immutable / a constant. And the compiler will immediately notify us if we attempt to modify/mutate it.
In other words, it communicates more information to the reader when  you say that "this variable is a type" rather than "this variable is a constant".

lower_snake_case
Additionally, consider the case where the authors of the protobuf file do not follow the Google protobuf style guide that you linked above. This happens to be the case for me: I'm using the protobuf files for StarCraft 2. These proto files use lower_snake_case enums, which results in protobuf-ts generating the following TypeScript code:
export enum Status {
    UNSPECIFIED$ = 0,
    launched = 1,
    init_game = 2,
    in_game = 3,
    in_replay = 4,
    ended = 5,
    quit = 6,
    unknown = 99
}

I can't influence the style in which the source proto files are written. I just need to use them as a base to try and generate idiomatic TypeScript code.
Maybe we could agree that:

PascalCase enum members are idiomatic TypeScript.
SHOUTING_SNAKE_CASE enum members are slightly non-idiomatic TypeScript.
lower_snake_case enum members are really non-idiomatic TypeScript.

Having protobuf-ts make an enum with lower_snake_case is confusing / off-putting for TypeScript end-users.  It must be bugged!"
I think that the tool should automatically convert both lower_snake_case and SHOUTING_SNAKE_CASE to PascalCase. But if it absolutely needs to leave alone SHOUTING_SNAKE_CASE for whatever reason, I think it should definitely at least convert snake_case to PascalCase.

By the way, all protobuf enums should really have a UNSPECIFIED = 0 value in proto3 syntax

No worries - that was just a quick example that I manually typed out to showcase the casing.

Thanks for your thoughts, @Zamiell.
I do agree that PascalCase fits well, and consistent naming rules are very nice to have. However, we need the original names for the JSON format - currently, we simply use them as is (and restore the shared prefix we strip). For message field names, we have a technique that allows arbitrary names for the generated properties, while still retaining small code size.
But we don't have that for enumerations. The implementation takes code size pretty seriously, but if people are interested in consistent PascalCase, and we find a good technique to implement that without taking up much code size, this could be a nice change for a major release.

The implementation should be trivial, right? I can submit a PR if you'll accept it.


Possible bug in string

When the last character in text is " and escaped, it might lead to string succeeding when it should not.

There is also another bug here which prevents escaping from turning false.


Update sentiment-analysis-tutorial for Python

Companion: https://github.com/fermyon/ai-examples/pull/51

It does, and I'll keep cranking on the rest of the examples and the article to get it up to date. Stay tuned!


AI in UX | Automation

AI in UX | Automation in UX

9 tips for automating your usability testing process
How do you speed up your usability testing? We take a look at how automation can help.
Mark Sherrod, Lead Research Partner at UserZoom
2022-10-19
https://www.userzoom.com/ux-blog/9-tips-for-automating-your-usability-testing-process/?utm_source=userweekly.com&utm_medium=referral&utm_campaign=userweekly.com&ref=User+Weekly-newsletter

Beginner Series, Part 3: Understanding the Role of AI in User Research
Michael Knauer
https://bootcamp.uxdesign.cc/beginner-series-part-3-understanding-the-role-of-ai-in-user-research-97936a1989b3

How User Research Can Unlock The Full Potential of AI Tools
Mallika Chawla
https://mallika-chawla.medium.com/how-user-research-can-unlock-the-full-potential-of-ai-tools-4c2e4df11c53


ToDoApp - BackEnd - Flask

I want to look at this issue..
Please assign it to me for Hacktoberfest.

@MishraTanishq619  Sure

@MishraTanishq619 Do let me know if this PR gets accepted or not?


skeletal animations bugged

not all load correctly
there are bone issues that happen on some models
might have something to do with multi-meshes and animations

likely due to mismatched bone and model issues when loading. In other words, user error. closing


[Enhancement] Forge 1.16.5?

As the title says, I think 1.16.5 also needs the help of this mod. Much appreciated!

Wrong repo, sorry

Added in be5be67. You can download the 1.16 version from Github Releases or CurseForge.


Sparky.watch - browser auto-reloading

It would be great to be able to manually reload a browser window whenever the defined files are changed using Sparky.watch. The browser reloading could be done by some build-in functionality or external package.
Here is an example of how to do this by gulp and browser-sync and having a similar functionality would be nice.
var gulp        = require('gulp');
var browserSync = require('browser-sync').create();
var reload      = browserSync.reload;

// Save a reference to the `reload` method

// Watch scss AND html files, doing different things with each.
gulp.task('serve', function () {

    // Serve files from the root of this project
    browserSync.init({
        server: {
            baseDir: "./"
        }
    });

    gulp.watch("*.html").on("change", reload);
});

If this is already possible now, please, let me know how to do it.

@jezikk , yes we have planned for that. for now, you can do like u suggested.
but also take note, that with Fusebox HMR,  Fuse will update the browser with changes of your files. so you get this partially :)

I'd like this feature where I rely on a node server (Angular Universal) as my web server (not HMR)

hey @jezikk how are you? meanwhile you can do something like this...
// ...your fuse configuration...

const PORT = process.env.PORT || 3000;

fuse.dev(
  {
    open: true,
    port: PORT
  },
  server => {
    browserSync.init({
      proxy: `localhost:${PORT}`
    });
  }
);

const vendor = fuse.bundle('vendor').instructions('~index.js');
const app = fuse.bundle('app').instructions('!>[index.js]');

vendor.watch();
app.watch().completed(() => browserSync.reload());

return fuse.run();

This is possible now with http://fuse-box.org/page/development#auto-reload-page :)

Ok that is great news, but how this feature works? My settings is as follows:
const {
    FuseBox,
    Sparky,
    SassPlugin,
    CSSPlugin,
    CSSResourcePlugin
} = require('fuse-box');

let fuse, app;

const sassPaths = [
    'node_modules/foundation-sites/scss',
    'node_modules/font-awesome/scss',
    'node_modules/motion-ui/src'
];

Sparky.task('config', () => {
    fuse = FuseBox.init({
        homeDir: 'src',
        output: 'dist/$name.js',
        sourceMaps: true,
        plugins: [
            [
                SassPlugin({
                    includePaths: sassPaths,
                    outputStyle: 'compressed',
                    importer: true
                }),
                CSSResourcePlugin({
                    dist: 'dist/resources',
                    resolve: f => `/dist/resources/${f}`
                }),
                CSSPlugin({
                    group: 'app.css',
                    outFile: `dist/app.css`,
                    inject: false
                })
            ]
        ],
        shim: {
            jquery: {
                source: 'node_modules/jquery/dist/jquery.js',
                exports: '$'
            },
            foundation: {
                source: 'node_modules/foundation-sites/dist/js/foundation.js',
                exports: 'Foundation'
            }
        }
    });

    fuse.dev({ root: './', httpServer: true, hmr: true, port: 3000 });

    app = fuse
        .bundle('app')
        .watch()
        .hmr({ reload: true })
        .instructions('> js/index.ts');
});

Sparky.task('clean', () => {
    return Sparky.src('dist/').clean('dist/');
});

Sparky.task('default', ['clean', 'config'], () => fuse.run());

and If I make a change in any *.scss file, the browser page is not automatically reloaded. Is it any issue in my settings?

@nchanged  do we have a bug here or he is missing something?

Please install the latest beta

@nchanged I tried, but maybe there is some bug #836 in beta version.

@jezikk do you think you can reproduce this issue? I would be great to fix that before the release

@nchanged  I have created a new issue for that: https://github.com/fuse-box/fuse-box/issues/836. All you need to do is to clone and start the project and you see errors in console or do you need anything else?

@jezikk bug confimed ;_) fixing it

After updating to beta version the auto-reloading works fine. Thank you.


Create v0.6.0 release of containerd-shim and shim-protos

This releases the containerd-shim and shim-protos packages which contain several dependencies updates, new features and bug fixes (not all inclusive):

#206
#212
#211
#213
#194
#201

LGTM. Thanks

https://github.com/containerd/rust-extensions/releases/tag/shim-protos-v0.6.0
https://github.com/containerd/rust-extensions/releases/tag/shim-v0.6.0


[DOC] Routing and URL Creation

In guide in the section "Routing and URL Creation" I believe there is a mistake, the view is missing in example below:

these are just examples of how the URL might look like dependend on the config. you can create a config that includes view but this is not necessary.

Depending on the urlManager configuration, the created URL may look like one of the following (or other format)
http://www.yiiframework.com/doc-2.0/guide-runtime-routing.html


Write a GO program to find cube root of a number

Description
Write a GO program to find cube root of a number
Input  : 27
Output : 3

How to contribute

Save the solution in program/find_cube_root_of_a_number.go file
Add find_cube_root_of_a_number.go file in find-cube-root-of-a-number folder

!assign


Security - Week - 1

📝 Weekly Report For TNB Team
Basic Details
🏟 Name of the TNB Team: Security
📅 Report Date: [02-19-2021]
📜 Team Work Report
✅ Accomplishments this week

Was working on Discord fraud .. why it was happened?
Spoke with bucky and chuy regarding new implantation of safe escrow

🚩 Goals for next week

Discord Security Research

🔭 Long term goals

Secure Code Review

❗❓ Concerns
[ANSWER]
👨💻👩💻 Team Members Contribution Details
codedevloper: 5859a20b3839ad7de53c340b90207766e7a57ba83e377880844c297480377cf1

@itsnikhil please pay Amol for week 1.
Acc. Number: 5859a20b3839ad7de53c340b90207766e7a57ba83e377880844c297480377cf1

paid!


Any items in the Armor/Utility slots are lost if you die with a full inventory.


Avoid exposing identityClientOptions

Instead of making this field protected we'll access it with reflection from the new broker builder.

API change check
APIView has identified API level changes in this PR and created following API reviews.
azure-identity

approving to unblock


Add support for v128 to the typed function API

This commit adds a Rust type V128 which corresponds to the wasm v128 type. This is intended to perhaps one day have accessors for lanes of various sizes but in the meantime only supports conversion back and forth between u128. The intention of this type is to allow platforms to perform typed between to functions that take or return v128 wasm values.
Previously this was not implemented because it's a bit tricky ABI-wise. Typed functions work by passing arguments in registers which requires the calling convention to match in both Cranelift and in Rust. This should be the case for supported platforms and the default calling convention, especially now that the wasm calling convention is separate from the platform calling convention. This does mean, however, that this feature can only be supported on x86_64 and AArch64. Currently neither s390x nor RISC-V have a means of supporting the vector calling convention since the vector types aren't available on stable in Rust itself. This means that it's now unfortunately possible to write a Wasmtime embedding that compiles on x86_64 that doesn't compile on s390x for example, but given how niche this feature is that seems like an ok tradeoff for now and by the time it's a problem Rust might have native stable support for vector types on these platforms.
prtest:full

I should also mention before I forget, it is theoretically possible to support v128 on all platforms. We are in control of our own ABI and we could say that the v128 type always maps to memory or a pair of u64 values. This would require rejiggering not only the Cranelift trampolines generated but additionally the WasmTy trait and how arguments are passed in the ABI. I figured that was a big lift for now where it'd be "much easier" to wait for Rust to add stable support for vector types on s390x and RISC-V in theory (in the assumption that users desiring that will coincide with a much later date in the future)


[XR] No need to clear (depth) in utility layer

This scene fails when in XR:
https://playground.babylonjs.com/#HJZBRG#253
Forum reference - https://forum.babylonjs.com/t/button3d-in-vr-is-rendered-on-top-of-everything/30772
I am not 100% sure why it was needed until now, so I am going to wait for reviews first before merging this.

This is so weird. I have no idea why it was required. Maybe with WebVR?

I don't think this is for native? We need to try to be sure I guess.

Will you be able to check without merging this PR?

Will you be able to check without merging this PR?

Yes, but I don't have time to do it soon. Maybe @CedricGuillemet @PolygonalSun @sergiomasellis can try it?

I can take a look @bghgary .

I was able to validate that it is working with XR on mobile platforms, but it would be good to also test on a HMD.  @PolygonalSun can you test it on your device?

ping @PolygonalSun


Lost channels in the left sidebar

Please see the bug on video: http://dropmefiles.com/Pv07t
This bug i see on Windows 10 and Windows 7
Desktop version app: Version 2.10.5
Linux rc 4.9.0-6-amd64 #1 SMP Debian 4.9.88-1 (2018-04-29) x86_64 GNU/Linux
| SERVER RUNNING |
+-------------------------------------------+
| |
| Rocket.Chat Version: 0.64.1 |
| NodeJS Version: 8.9.3 - x64 |
| Platform: linux |
| Process Port: 3000 |
| Site URL: https://domain |
| ReplicaSet OpLog: Disabled |
| Commit Hash: 54738c0 |
| Commit Branch: HEAD |
| |
[32m+-------------------------------------------+

Hey @ispryt, thanks for your report. I'll move this issue to the main repository as this seems like an issue with the web app.

Issue moved to RocketChat/Rocket.Chat #10774 via ZenHub


Has anyone made a profit using this method?

I just set it up an hour ago and I've seen opportunities where there was a possible trade to take place but there was none ever placed, I'm gonna wait another 12-24 hours before I ask questions to see if it's working properly or not

The bot will execute a trade that matches your specified parameters. Make sure you understand what they mean by reading the readme


fix issue with empty fields at the beginning of a line

funny enough I realised there is this issue today, fixed it, and then realised it was already found yesterday by  Elavarasan83

Wow nice work! Thanks!
-Resolves #10


Better variant product support

Variant products have been second class citizens in Oscar for a while and it's time to rectify this.  We need to ensure that products which have variations along one or more dimensions are supported properly with the right data being passed into the template to allow custom widgets to be used.
Example: A T-shirt is available in range of colours and sizes.  We need to be able to support widgets like this one (from gap.com):

Sometimes all variants will be the same price but sometimes they will be different.  We need to think about how we handle both scenarios.
Related tickets: https://github.com/tangentlabs/django-oscar/issues/481, https://github.com/tangentlabs/django-oscar/issues/379
Related mailing list thread: https://groups.google.com/forum/#!topic/django-oscar/nKVelLiVQmI, https://groups.google.com/forum/?fromgroups=#!topic/django-oscar/PXs6jgdgdWs

I've started some basic work on this.

Here's some of the interesting bits:
# templatetags.py

def _get_variant_descriptors(product, timeout=DEFAULT_TIMEOUT):

    descriptors = {}

    for attribute_value in ProductAttributeValue.objects.filter(product=product.children.all()).select_related('product', 'attribute'):

        attribute_name, value = attribute_value.attribute.name, attribute_value.value

        descriptors.setdefault( attribute_name, {}).setdefault(value, set()).add(attribute_value.product_id)

    # In general, we want things sorted when we output them
    return sorted( (attribute, sorted(value_map.items())) for attribute, value_map in descriptors.items() )

@register.inclusion_tag('catalogue/variant_descriptors.html')
def render_variant_descriptors(product):
    return {
        'product': product,
        'descriptors': _get_variant_descriptors(product)
    }

Output of _get_variant_descriptors looks like this:
[
    (u'Filler', [
        (u'Down Feather', set([26064, 26062])),
        (u'Poly Fiber', set([26065, 26063]))
    ]),
    (u'Size', [
        (u'18" x 18"', set([26062, 26063])),
        (u'22" x 22"', set([26064, 26065]))
    ])
]

Variant attribute detection is on a per-product basis and supports arbitrary numbers of dimensions. I'm sure there are lots of edge cases to fix.

{% for attribute, value_map in descriptors %}

{{ attribute }}

		{% for label, ids in value_map %}
			<button type="button" class="btn btn-default" data-product-ids="{{ ids|join:"," }}">{{ label }}</button>
		{% endfor %}

{% endfor %}

Need to implement some kind of VariantDetailView to display variant-specific information (price, stock, attributevalues, images).

Here's the branch I'm working on: https://github.com/john-parton/django-oscar/tree/issue/675/per_variant_image_support

Here's documentation from Magento on how they handle some of these issues. http://www.magentocommerce.com/knowledge-base/entry/ee1141-ce191-configurable-swatches
There are some screenshots of the backend that might be helpful.

@john-parton that looks fantastic! I'm currently working on a shop where we plan to sell 3D prints in different sizes, colors and materials. This change would be perfect for us.

Another idea: It would be great if some variant dimensions could be managed independently from the products.
Regarding the 3D printing example, we can offer the same colors for all 3D prints. So it's much nicer if we can update the currently available colors in one place instead of updating all products.

Something like this: http://beta.dadagraphix.com/catalogue/joker-cat_41/ ?
This is build using django-oscar==0.7.2.

The UI looks pretty good. Is this done in a relatively domain-agnostic way?

Yes, I'm using django.contrib.sites.

I'm sorry, I didn't mean domain as in the URL. I meant problem domain. http://en.wikipedia.org/wiki/Problem_domain
Does the implementation assume that the dimensions are are colors? For instance, can you swap it out so that the dimensions are "T-shirt size" or "product weight"?

No, it's using classic product attributes for size, which is of type "Option" and it gets its values from Catalogue » Attribute Option Groups.
I had no final idea for implementing anything else at the time and I was also waiting for the new official django-oscar releases to see their approach/implementation.

Hello, There are several problems with the current system attributes and variants.
For example, we sell an iPhone that has multiple colors and multiple ROM .
Before remember that each variant has a differential stock , they are never equal , so there can be or not a color or not.
Property
Colors: Green, Black
ROM: 16GB , 32GB, 64GB , 128GB
Issue
Green Color is available in the following ROM: 16GB, 128GB, but not in ['32', '64']
Color Black is available in the following ROM: 16GB , 32GB, 64GB, but not in ['128']
Another example , we sell shirt-T , which has multiple colors and multiple sizes,
Property:
Colors: White, Black, Red
Size : S , M , L , XL
Issue
White available in the following sizes : S, M, but not in ['L', 'XL']
Color Black Available in following the vessel sizes: M, XL, but not in ['S', L']
.....
I think this should be a priority speak this this since 2013 and we have not made any progress in this regard. If someone uncomfortable sorry, the idea is to help, so if the initiative is already working on this subanlo to a branch to collaborate.

You'll need to create a variant for each combination of properties.
In your T-shirt example, you'll need 12 variants: S White, M White, L White, XL White, S Red, M Red, etc.
Each variant should have its own stock record.

The real issue is that it's tedious for a user to go through a list of 12 variants, and would be much better to select variants by attributes.

Yeah, Shopify and LFS has the similar method. It created MxN. Where M is Varients. N is options.

I've created a few diagrams to aid in discussion.
One issue that I've found is that the placement of attributes can be very confusing. If you're trying to write a query to find all products that have a given attribute value, you have to check on the child as well as on the parent. For instance, if you have one parent, one child, and 3 attribute values, there are actually 8 different ways that they can be configured. Here's 3 of them:

Obviously, if you have multiple children, it gets even more complicated.
Because attribute values can be placed on the parent, what does it "mean" when you create a child? Should that child silently "inherit" the attribute values of the parent? Here's a concrete example. Imagine you have a T-shirt that comes in a large, so you create a parent-child relationship with the "Large" attribute value on the parent. Later, you add a medium size as a child, but you leave the "Large" attribute value on the parent. Is that new child implicitly a large size? Does it inherit the attribute value on the parent? Even more confusingly, what if you add a a "Medium" attribute value to the new child? Now you have some potentially conflicting attribute values on both the parent and child.

Lastly, a parent-child relationship with a single child is functionally identical to a standalone product. So, you might create a standalone product, only later to realize that you needed to add another variant. So you have to remove the stockrecord, add a child for the old stockrecord, add a new instance of the old stockrecord to the first child, and then you can actually add a new child. This is confusing and error prone.

One solution is to remove the concept of a standalone product, and enforce that every product follows the parent-child product. In addition, you move the attribute value relationship to be only on the child, it fixes pretty much all of the attribute value issues.
So that's what I did. Here's my branch: https://github.com/john-parton/django-oscar/tree/issue/675/product_to_parent
This is more than a simple proof of concept. Every test passes. (Some had to be tweaked or rewritten, but they're all there.)
On the frontend, it's functionally identical, if not slightly better. For instance, in the old way, if a product is standalone, you can have an "add to cart" button directly under the product. (Neat, that's one fewer step in the funnel.) However, if you had a parent-child relationship with a single child, you don't get that button, even though it's functionally identical to a standalone product. In my new way, you automatically get that button if there's only one child.
The Product model has been broken out into two models Product and ChildProduct. (I would slightly prefer a name like "ProductVariant", but the term "child" is used throughout the code base, so I made it that for consistency.) https://github.com/john-parton/django-oscar/blob/issue/675/product_to_parent/src/oscar/apps/catalogue/abstract_models.py#L241-L593
If you look at the clean methods for the models, you should immediately notice something versus the old way: there really isn't anything to them.
There are caveats, of course (there are always caveats):

I haven't provided any migrations.
If a overrode the product app, things will probably break.
If a user has a custom model with a relation to Product, it'll probably break.
Minimal changes were necessary to the templates, but again, there might be some edge cases.

@john-parton How are these things going?
What is recommended way to use your custom abstract_model in catalogue app?

@taedori81 I ended up using a combination of database triggers and custom validation rules to prevent the insertion of standalone products as well as enforcing that all attributes reference child products.  I wouldn't necessarily recommend using the abstract_model unless you're willing to maintain a fork.

So, if i have 3 product attributes with 5, 4, 10 variants i need to create 200 childs?

If every single combination of those attributes is allowable, then yes. If only certain combinations are allowed, then significantly fewer.
From what I understand, this is pretty similar to most ecommerce solutions: you would need to create 200 "products" and then one "configurable product." (to use magento's terminology)

@john-parton i have been written such script, so now i have more that 1500 SQL queries (and duplacates) on product page. :)

Until now i see that variant product are handled very good, but haven't enough documentation, i had to search in stack over flow and test some ways and i can now create product variants.
I think that only a good documentation and extern variables missing for the better performances.
By variables i think that a way to get the variant attributes out and can render in templates as we want, as color or sizes.

@john-parton  i have followed your code (get_variant_description) and im trying to implement that for a client that wants color and size as button choices as you have. I've added the code you showed in this thread but I can't get it to work quite well. Right now i'm in the middle of writing some jquery hacky stuff to see if the data-option-ids are valid. Each color have a set of ids, for example 1,2,3 and these 3 ids represents what sizes are available for that color. So i'm guessing I could write some javascript that checks if you select a color or size it checks the other sizes and colors and disable/enables them.
I was wondering how you got this working? Since the code you posted seems like it needs some more work but I can't find your final solution to this problem.

I've implemented variant functionality for partners in permission based dashboard.

@albinantony2904 How did you it?

@albinantony2904 I'd be interested in seeing that as well.

For those people starting brand-new project with oscar, I think Saleor is giving a good example for variants scenarios.
With below alignments in django-oscar

No more  standalone structures
ProductClass's attributes starting with v_ exclusive for Child products, other non-v attributes for common attributes for all Parent products
Parent products only get non-v attributes filled
Child products only get v_ attributes filled
Front can build sth similar to @john-parton 's _get_variant_descriptors on v_ attributes only

Anything on this ? It is too long since the issue opened. This functionality is there in most of the ecommerce platforms. We can't tell clients that Oscar doesn't support it as a excuse to not to implement.  :(

My 2cts,
The whole parent/child nomenclature should go imo. It is a poor/incomplete tree-like implementation with unfortunate semantic connotations.
Grouping of multiple discrete products should not be implemented in a hierarchical model. All products are created equal. If an hierarchy is used, lets please use a real and well supported one, like treebeard.
Grouping of products are generally based on a limited number of traits. Please do not assume that such traits are simply attributes.

color is a simple attribute

material is probably a simple attribute

weight, size, length etc are definitely not simple attributes. The ERP world has this wonderful concept called Unit of Measurement that should be used for such 'composite' traits.

weight: UoM { unit: si-gram, quant: 500 }
length: UoM { unit: si-meter, quant: 0.65 }
size: UoM { unit: US-shoesize, quant: 9 }

Such UoM types can be enriched with methods to transform them from one unit to another, i.e. US-shoesize <-> EU-shoesize, etc...
How products are grouped is domain-specific, though generally color and size will be sufficient for many if not most use-cases related to e-commerce.
Product-grouping (canonical representations along one or more grouping dimensions) can occur at multiple levels:
considering a product, i.e. a woolen blanket with variations in color, weight/thickness, and size:

Question is mainly how the 'top-level' grouping is implemented.
The old parent/child setup could be used for that, but as I mentioned, I'm not a fan.
One idea is used by a big enterprise e-commerce solution we also work with:
Assign a single product in a (sub)group as canonical for that level of grouping, and let all variants contain a pointer to that canonical product. Every canonical can point to another 'sibling' to denote a higher grouping level.
Goal should be to have single queries to retrieve all variants at a grouping-level with a single query.
I'll try to come up with a model design....

To me this is quite ridiculous that Oscar doesn't support multi-variants, as described in many posts above. This surely must be a massive deal-breaker for many of us trying to run an e-commerce platform?
I have spent many hours/$ setting up Oscar assuming this would definitely not be an issue, all wasted. And now I must find another system with better product support. Does anyone have good suggestions for a new platform?

Side note: That is ridiculous how demanding people are sometime in open source projects. If you are missing feature - make a PR. If you've lost some money because platform does not fit your needs - it's entirely your fault, you simply haven't made a proper research before using a tool. Again, it's an open source project - if you need a feature I believe you can sponsor or develop yourself.

Any update on this?

closing all issues that are feature requests that don't have open PR's attached.


Adding 6.0 ServiceFabric specification

This checklist is used to make sure that common issues in a pull request are addressed. This will expedite the process of getting your pull request merged and avoid extra work on your part to fix issues discovered during the review process.
PR information

[ ] The title of the PR is clear and informative.
[ ] There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
[ ] Except for special cases involving multiple contributors, the PR is started from a fork of the main repository, not a branch.
[ ] If applicable, the PR references the bug/issue that it fixes.
[ ] Swagger files are correctly named (e.g. the api-version in the path should match the api-version in the spec).

Quality of Swagger

[ ] I have read the contribution guidelines.
[ ] My spec meets the review criteria:

[ ] The spec conforms to the Swagger 2.0 specification.
[ ] The spec follows the guidelines described in the Swagger checklist document.
[ ] Validation tools were run on swagger spec(s) and have all been fixed in this PR.

@samedder,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

@samedder can you update the readme file to have a tag for this version of swagger and include the updated readme in this PR?

@samedder any update?

Sorry for the delay, @anuchandy, we're going to send a new PR with some changes that were missed in this PR.


rootston: fix segfault in view_at

Make sure the view is mapped.
@dos1: can you try this patch?
Fixes https://github.com/swaywm/wlroots/issues/1333

Thanks! SDL2 still doesn't really work, but rootston doesn't segfault anymore, so I guess #1333 is fixed. I'll open a new ticket ;)

Tried with 0AD which also makes rootston crash, and it fixes the issue.

Oh, I spoke too early - it just segfaulted. Let me recheck.

Thread 1 "rootston" received signal SIGSEGV, Segmentation fault.
0x000055555589d590 in ?? ()
(gdb) bt
#0  0x000055555589d590 in  ()
#1  0x000055555555ed99 in view_move (view=view@entry=0x55555589d490, x=<optimized out>, y=<optimized out>) at ../rootston/desktop.c:141
#2  0x0000555555563441 in render_output (output=0x5555557d5450) at ../rootston/output.c:460
#3  0x00007ffff7f9afae in wlr_signal_emit_safe (signal=0x5555557cb620, data=0x5555557cb5c0) at ../util/signal.c:29
#4  0x00007ffff7f9afae in wlr_signal_emit_safe (signal=signal@entry=0x5555557ca150, data=data@entry=0x5555557ca030) at ../util/signal.c:29
#5  0x00007ffff7f8f467 in wlr_output_send_frame (output=output@entry=0x5555557ca030) at ../types/wlr_output.c:542
#6  0x00007ffff7f9d39a in signal_frame (data=0x5555557ca030) at ../backend/x11/output.c:13
#7  0x00007ffff7f3001a in  () at /usr/bin/../../../../../../../lib64/libwayland-server.so.0
#8  0x00007ffff7f30702 in wl_event_loop_dispatch () at /usr/bin/../../../../../../../lib64/libwayland-server.so.0
#9  0x00007ffff7f2f2ac in wl_display_run () at /usr/bin/../../../../../../../lib64/libwayland-server.so.0
#10 0x000055555555a24a in main (argc=<optimized out>, argv=0x7fffffffd9d8) at ../rootston/main.c:74
(gdb)

FWIW, SDL also outputs zxdg_surface_v6@21: error 3: xdg_surface has never been configured, which doesn't happen on KWin.

Hmm, can you run bt full? This one is more tricky.

It's non-deterministic :(
Now got this one:
(gdb) bt
#0  0x000055555555df2b in view_at
    (view=0x5555559d78f0<EMAIL_ADDRESS>ly=ly@entry=95, surface=surface@entry=0x7fffffffd440, sx=sx@entry=0x7fffffffd4a0, sy=sy@entry=0x7fffffffd4a8)
    at ../rootston/desktop.c:575
#1  0x000055555555f287 in desktop_view_at (sy=0x7fffffffd4a8, sx=0x7fffffffd4a0, surface=0x7fffffffd440, ly=95, lx=59.999999999999993, desktop=0x555555736120)
    at ../rootston/desktop.c:650
#2  0x000055555555f287 in desktop_surface_at
    (desktop=0x555555736120, lx=59.999999999999993, ly=95, sx=sx@entry=0x7fffffffd4a0, sy=sy@entry=0x7fffffffd4a8, view=view@entry=0x7fffffffd4b0) at ../rootston/desktop.c:714
#3  0x000055555555c26d in roots_passthrough_cursor (cursor=0x55555580a870, time=65122483) at ../rootston/cursor.c:113
#4  0x000055555555d162 in roots_cursor_handle_motion_absolute (cursor=0x55555580a870, event=0x7fffffffd620) at ../rootston/cursor.c:363
#5  0x00007ffff7f9afae in wlr_signal_emit_safe (signal=0x55555580aa78, data=0x7fffffffd620) at ../util/signal.c:29
#6  0x00007ffff7f9afae in wlr_signal_emit_safe (signal=0x5555557ca2c0, data=data@entry=0x7fffffffd620) at ../util/signal.c:29
#7  0x00007ffff7f9d0b0 in x11_handle_pointer_position (output=<optimized out>, x=<optimized out>, y=<optimized out>, time=65122483) at ../backend/x11/input_device.c:41
#8  0x00007ffff7f9d261 in handle_x11_input_event (x11=x11@entry=0x555555584770, event=event@entry=0x5555559ad0f0) at ../backend/x11/input_device.c:122
#9  0x00007ffff7f9c86b in handle_x11_event (event=0x5555559ad0f0, x11=0x555555584770) at ../backend/x11/backend.c:85
#10 0x00007ffff7f9c86b in x11_event (fd=<optimized out>, mask=<optimized out>, data=0x555555584770) at ../backend/x11/backend.c:85
#11 0x00007ffff7f3077f in wl_event_loop_dispatch () at /usr/bin/../../../../../../../lib64/libwayland-server.so.0
#12 0x00007ffff7f2f2ac in wl_display_run () at /usr/bin/../../../../../../../lib64/libwayland-server.so.0
#13 0x000055555555a24a in main (argc=<optimized out>, argv=0x7fffffffd9d8) at ../rootston/main.c:74
(gdb) bt full
#0  0x000055555555df2b in view_at
    (view=0x5555559d78f0<EMAIL_ADDRESS>ly=ly@entry=95, surface=surface@entry=0x7fffffffd440, sx=sx@entry=0x7fffffffd4a0, sy=sy@entry=0x7fffffffd4a8)
    at ../rootston/desktop.c:575
        view_sx = <optimized out>
        view_sy = <optimized out>
        state = <optimized out>
        box = <optimized out>
        _sx = 6.9533491518004593e-310
        _sy = 59.999999999999993
        _surface = <optimized out>
#1  0x000055555555f287 in desktop_view_at (sy=0x7fffffffd4a8, sx=0x7fffffffd4a0, surface=0x7fffffffd440, ly=95, lx=59.999999999999993, desktop=0x555555736120)
    at ../rootston/desktop.c:650
        output = 0x5555557d5460
        wlr_output = <optimized out>
        view = <optimized out>
        surface = 0x0
        wlr_output = 0x5555557ca040
        roots_output = 0x5555557d5460
        ox = 59.999999999999993
        oy = 95
        _view = <optimized out>
#2  0x000055555555f287 in desktop_surface_at
    (desktop=0x555555736120, lx=59.999999999999993, ly=95, sx=sx@entry=0x7fffffffd4a0, sy=sy@entry=0x7fffffffd4a8, view=view@entry=0x7fffffffd4b0) at ../rootston/desktop.c:714
        surface = 0x0
        wlr_output = 0x5555557ca040
        roots_output = 0x5555557d5460
        ox = 59.999999999999993
        oy = 95
        _view = <optimized out>
#3  0x000055555555c26d in roots_passthrough_cursor (cursor=0x55555580a870, time=65122483) at ../rootston/cursor.c:113
        focus_changed = <optimized out>
        sx = 95
        sy = -6.2193935599955454e+235
        view = 0x0
        seat = 0x55555580a310
        desktop = <optimized out>
        surface = <optimized out>
        client = <optimized out>
        drag_icon = <optimized out>
#4  0x000055555555d162 in roots_cursor_handle_motion_absolute (cursor=0x55555580a870, event=0x7fffffffd620) at ../rootston/cursor.c:363
        lx = 59.999999999999993
        ly = 95
#5  0x00007ffff7f9afae in wlr_signal_emit_safe (signal=0x55555580aa78, data=0x7fffffffd620) at ../util/signal.c:29
        pos = 0x55555580a910
        l = 0x55555580a910
        cursor = {link = {prev = 0x55555580a910, next = 0x7fffffffd560}, notify = 0x7ffff7f9af20 <handle_noop>}
--Type <RET> for more, q to quit, c to continue without paging--c
        end = {link = {prev = 0x7fffffffd540, next = 0x55555580aa78}, notify = 0x7ffff7f9af20 <handle_noop>}
#6  0x00007ffff7f9afae in wlr_signal_emit_safe (signal=0x5555557ca2c0, data=data@entry=0x7fffffffd620) at ../util/signal.c:29
        pos = 0x5555559251f8
        l = 0x5555559251f8
        cursor = {link = {prev = 0x5555559251f8, next = 0x7fffffffd5d0}, notify = 0x7ffff7f9af20 <handle_noop>}
        end = {link = {prev = 0x7fffffffd5b0, next = 0x5555557ca2c0}, notify = 0x7ffff7f9af20 <handle_noop>}
#7  0x00007ffff7f9d0b0 in x11_handle_pointer_position (output=<optimized out>, x=<optimized out>, y=<optimized out>, time=65122483) at ../backend/x11/input_device.c:41
        x11 = 0x555555584770
        wlr_output = <optimized out>
        event = {device = 0x5555557ca2f8, time_msec = 65122483, x = 0.54545454545454541, y = 0.40425531914893614}
#8  0x00007ffff7f9d261 in handle_x11_input_event (x11=x11@entry=0x555555584770, event=event@entry=0x5555559ad0f0) at ../backend/x11/input_device.c:122
        ev = 0x5555559ad0f0
        output = <optimized out>
#9  0x00007ffff7f9c86b in handle_x11_event (event=0x5555559ad0f0, x11=0x555555584770) at ../backend/x11/backend.c:85
        e = 0x5555559ad0f0
        x11 = 0x555555584770
#10 0x00007ffff7f9c86b in x11_event (fd=<optimized out>, mask=<optimized out>, data=0x555555584770) at ../backend/x11/backend.c:85
        e = 0x5555559ad0f0
        x11 = 0x555555584770
#11 0x00007ffff7f3077f in wl_event_loop_dispatch () at /usr/bin/../../../../../../../lib64/libwayland-server.so.0
#12 0x00007ffff7f2f2ac in wl_display_run () at /usr/bin/../../../../../../../lib64/libwayland-server.so.0
#13 0x000055555555a24a in main (argc=<optimized out>, argv=0x7fffffffd9d8) at ../rootston/main.c:74
        __PRETTY_FUNCTION__ = "main"
        socket = <optimized out>
(gdb)

Another one:
(gdb) bt
#0  0x00005555555624ba in view_accept_damage (view=view@entry=0x5555559212c0, output=<optimized out>) at ../rootston/output.c:590
#1  0x0000555555563cc7 in output_damage_whole_view (output=output@entry=0xfffffffffffffff1, view=view@entry=0x5555559212c0) at ../rootston/output.c:670
#2  0x000055555555e61c in view_damage_whole (view=view@entry=0x5555559212c0) at ../rootston/desktop.c:530
#3  0x000055555555ed08 in view_update_position (view=0x5555559212c0, x=52.5, y=80.5) at ../rootston/desktop.c:539
#4  0x000055555555edcd in view_move (view=view@entry=0x5555559212c0, x=<optimized out>, y=<optimized out>) at ../rootston/desktop.c:143
#5  0x0000555555563441 in render_output (output=0x5555557d5460) at ../rootston/output.c:460
#6  0x00007ffff7f9afae in wlr_signal_emit_safe (signal=0x5555557cb630, data=0x5555557cb5d0) at ../util/signal.c:29
#7  0x00007ffff7f9afae in wlr_signal_emit_safe (signal=signal@entry=0x5555557ca160, data=data@entry=0x5555557ca040) at ../util/signal.c:29
#8  0x00007ffff7f8f467 in wlr_output_send_frame (output=output@entry=0x5555557ca040) at ../types/wlr_output.c:542
#9  0x00007ffff7f9d39a in signal_frame (data=0x5555557ca040) at ../backend/x11/output.c:13
#10 0x00007ffff7f3001a in  () at /usr/bin/../../../../../../../lib64/libwayland-server.so.0
#11 0x00007ffff7f30702 in wl_event_loop_dispatch () at /usr/bin/../../../../../../../lib64/libwayland-server.so.0
#12 0x00007ffff7f2f2ac in wl_display_run () at /usr/bin/../../../../../../../lib64/libwayland-server.so.0
#13 0x000055555555a24a in main (argc=<optimized out>, argv=0x7fffffffd9d8) at ../rootston/main.c:74
(gdb) bt full
#0  0x00005555555624ba in view_accept_damage (view=view@entry=0x5555559212c0, output=<optimized out>) at ../rootston/output.c:590
#1  0x0000555555563cc7 in output_damage_whole_view (output=output@entry=0xfffffffffffffff1, view=view@entry=0x5555559212c0) at ../rootston/output.c:670
        data = {layout = {x = 1.4821969375237396e-323, y = 6.9533558072879748e-310, width = -10896, height = 32767, rotation = -1.01143099e+34}, output = 0x7fffffffd370}
#2  0x000055555555e61c in view_damage_whole (view=view@entry=0x5555559212c0) at ../rootston/desktop.c:530
        output = 0xfffffffffffffff1
#3  0x000055555555ed08 in view_update_position (view=0x5555559212c0, x=52.5, y=80.5) at ../rootston/desktop.c:539
#4  0x000055555555edcd in view_move (view=view@entry=0x5555559212c0, x=<optimized out>, y=<optimized out>) at ../rootston/desktop.c:143
        before = {x = 0, y = 0, width = 0, height = 0}
#5  0x0000555555563441 in render_output (output=0x5555557d5460) at ../rootston/output.c:460
        view = 0x5555559212c0
        view_box = {x = 0, y = 0, width = 0, height = 0}
        view_x = <optimized out>
        view_y = <optimized out>
        wlr_output = 0x5555557ca040
        desktop = 0x555555736120
        server = 0x555555573060 <server>
        renderer = 0x555555726c90
        __PRETTY_FUNCTION__ = "render_output"
        now = {tv_sec = 65819, tv_nsec = 710998574}
        clear_color = {0.25, 0.25, 0.25, 1}
        output_box = 0x5555557cbca0
        needs_swap = false
        damage = {extents = {x1 = -153258576, y1 = 32767, x2 = 0, y2 = 0}, data = 0x7ffff6dd7490 <ffi_type_pointer>}
        data =
          {layout = {x = 0, y = 0, width =<PHONE_NUMBER>, height = 21845, rotation = 3.58732407e-43}, output = 0x55555589c7f0, when = 0x7ffff7f34b89, damage = 0x110, alpha = -4.93661118e+33}
        nrects = 4
        rects = <optimized out>
#6  0x00007ffff7f9afae in wlr_signal_emit_safe (signal=0x5555557cb630, data=0x5555557cb5d0) at ../util/signal.c:29
        pos = 0x5555557d5550
        l = 0x5555557d5550
        cursor = {link = {prev = 0x5555557d5550, next = 0x7fffffffd5f0}, notify = 0x7ffff7f9af20 <handle_noop>}
        end = {link = {prev = 0x7fffffffd5d0, next = 0x5555557cb630}, notify = 0x7ffff7f9af20 <handle_noop>}
#7  0x00007ffff7f9afae in wlr_signal_emit_safe (signal=signal@entry=0x5555557ca160, data=data@entry=0x5555557ca040) at ../util/signal.c:29
        pos = 0x5555557cb6c8
        l = 0x5555557cb6c8
        cursor = {link = {prev = 0x5555557cb6c8, next = 0x7fffffffd660}, notify = 0x7ffff7f9af20 <handle_noop>}
        end = {link = {prev = 0x7fffffffd640, next = 0x5555557ca160}, notify = 0x7ffff7f9af20 <handle_noop>}
#8  0x00007ffff7f8f467 in wlr_output_send_frame (output=output@entry=0x5555557ca040) at ../types/wlr_output.c:542
#9  0x00007ffff7f9d39a in signal_frame (data=0x5555557ca040) at ../backend/x11/output.c:13
        output = 0x5555557ca040
#10 0x00007ffff7f3001a in  () at /usr/bin/../../../../../../../lib64/libwayland-server.so.0
#11 0x00007ffff7f30702 in wl_event_loop_dispatch () at /usr/bin/../../../../../../../lib64/libwayland-server.so.0
#12 0x00007ffff7f2f2ac in wl_display_run () at /usr/bin/../../../../../../../lib64/libwayland-server.so.0
#13 0x000055555555a24a in main (argc=<optimized out>, argv=0x7fffffffd9d8) at ../rootston/main.c:74
        __PRETTY_FUNCTION__ = "main"
        socket = <optimized out>
(gdb)

@dos1 can you try compiling with ASAN enabled, then redirect stdout & stderr to a file and try to reproduce the crash?

2018-10-28 21:55:51 - [types/wlr_surface.c:626] New wlr_surface 0x61800000b480 (res 0x60c00002b900)
2018-10-28 21:55:51 - [rootston/cursor.c:505] Denying request to set cursor from unfocused client
2018-10-28 21:55:51 - [types/wlr_surface.c:626] New wlr_surface 0x61800000b880 (res 0x60c00002be40)
2018-10-28 21:55:51 - [types/xdg_shell_v6/wlr_xdg_surface_v6.c:485] new xdg_surface 0x612000164ec0 (res 0x60c00002bf00)
2018-10-28 21:55:51 - [rootston/xdg_shell_v6.c:411] new xdg toplevel: title=(null), app_id=animatch
libEGL warning: FIXME: egl/x11 doesn't support front buffer rendering.
error in client communication (pid 18276)
=================================================================
==18211==ERROR: AddressSanitizer: heap-use-after-free on address 0x612000165268 at pc 0x5594650e7bb7 bp 0x7ffce5adbd60 sp 0x7ffce5adbd50
READ of size 8 at 0x612000165268 thread T0
    #0 0x5594650e7bb6 in render_output ../rootston/output.c:464
    #1 0x7fc2c2362eaa in wlr_signal_emit_safe ../util/signal.c:29
    #2 0x7fc2c2362eaa in wlr_signal_emit_safe ../util/signal.c:29
    #3 0x7fc2c2368cb1 in signal_frame ../backend/x11/output.c:13
    #4 0x7fc2c2269019  (/usr/bin/../../../../../../../lib64/libwayland-server.so.0+0xa019)
    #5 0x7fc2c2269701 in wl_event_loop_dispatch (/usr/bin/../../../../../../../lib64/libwayland-server.so.0+0xa701)
    #6 0x7fc2c22682ab in wl_display_run (/usr/bin/../../../../../../../lib64/libwayland-server.so.0+0x92ab)
    #7 0x5594650cb660 in main ../rootston/main.c:74
    #8 0x7fc2c1a0d222 in __libc_start_main (/usr/bin/../../../../../../../lib64/libc.so.6+0x24222)
    #9 0x5594650cba0d in _start (/usr/bin/rootston+0xda0d)

0x612000165268 is located 168 bytes inside of 312-byte region [0x6120001651c0,0x6120001652f8)
freed by thread T0 here:
    #0 0x7fc2c24d1c19 in __interceptor_free /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:66
    #1 0x7fc2c2362eaa in wlr_signal_emit_safe ../util/signal.c:29
    #2 0x7fc2c232595d in destroy_xdg_surface_v6 ../types/xdg_shell_v6/wlr_xdg_surface_v6.c:100
    #3 0x7fc2c2267c7e  (/usr/bin/../../../../../../../lib64/libwayland-server.so.0+0x8c7e)
    #4 0x7fc2c2267cee in wl_resource_destroy (/usr/bin/../../../../../../../lib64/libwayland-server.so.0+0x8cee)
    #5 0x7fc2c23244b0 in xdg_client_v6_handle_resource_destroy ../types/xdg_shell_v6/wlr_xdg_shell_v6.c:72
    #6 0x7fc2c2267c7e  (/usr/bin/../../../../../../../lib64/libwayland-server.so.0+0x8c7e)
    #7 0x7fc2c226c051  (/usr/bin/../../../../../../../lib64/libwayland-server.so.0+0xd051)
    #8 0x7fc2c226c55e  (/usr/bin/../../../../../../../lib64/libwayland-server.so.0+0xd55e)
    #9 0x7fc2c2267dfe in wl_client_destroy (/usr/bin/../../../../../../../lib64/libwayland-server.so.0+0x8dfe)
    #10 0x7fc2c2267eda  (/usr/bin/../../../../../../../lib64/libwayland-server.so.0+0x8eda)
    #11 0x7fc2c2269701 in wl_event_loop_dispatch (/usr/bin/../../../../../../../lib64/libwayland-server.so.0+0xa701)
    #12 0x7fc2c22682ab in wl_display_run (/usr/bin/../../../../../../../lib64/libwayland-server.so.0+0x92ab)
    #13 0x5594650cb660 in main ../rootston/main.c:74
    #14 0x7fc2c1a0d222 in __libc_start_main (/usr/bin/../../../../../../../lib64/libc.so.6+0x24222)
    #15 0x5594650cba0d in _start (/usr/bin/rootston+0xda0d)

previously allocated by thread T0 here:
    #0 0x7fc2c24d2231 in __interceptor_calloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:95
    #1 0x5594650d5aa9 in view_create ../rootston/desktop.c:38
    #2 0x5594650f9adc in handle_xdg_shell_v6_surface ../rootston/xdg_shell_v6.c:443
    #3 0x7fc2c2362eaa in wlr_signal_emit_safe ../util/signal.c:29
    #4 0x7fc2c2326346 in handle_xdg_surface_v6_commit ../types/xdg_shell_v6/wlr_xdg_surface_v6.c:402
    #5 0x7fc2c2356bb9 in surface_commit_pending ../types/wlr_surface.c:402
    #6 0x7fc2c23576ec in surface_commit ../types/wlr_surface.c:474
    #7 0x7fc2c0f351c7 in ffi_call_unix64 (/usr/bin/../../../../../../../lib64/libffi.so.6+0x61c7)
    #8 0x7fc2c0f34c29 in ffi_call (/usr/bin/../../../../../../../lib64/libffi.so.6+0x5c29)
    #9 0x7fc2c226b6fe  (/usr/bin/../../../../../../../lib64/libwayland-server.so.0+0xc6fe)
    #10 0x7fc2c22680a2  (/usr/bin/../../../../../../../lib64/libwayland-server.so.0+0x90a2)
    #11 0x7fc2c2269701 in wl_event_loop_dispatch (/usr/bin/../../../../../../../lib64/libwayland-server.so.0+0xa701)
    #12 0x7fc2c22682ab in wl_display_run (/usr/bin/../../../../../../../lib64/libwayland-server.so.0+0x92ab)
    #13 0x5594650cb660 in main ../rootston/main.c:74
    #14 0x7fc2c1a0d222 in __libc_start_main (/usr/bin/../../../../../../../lib64/libc.so.6+0x24222)
    #15 0x5594650cba0d in _start (/usr/bin/rootston+0xda0d)

SUMMARY: AddressSanitizer: heap-use-after-free ../rootston/output.c:464 in render_output
Shadow bytes around the buggy address:
  0x0c24800249f0: fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa
  0x0c2480024a00: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x0c2480024a10: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c2480024a20: fd fd fd fd fd fd fd fd fd fd fa fa fa fa fa fa
  0x0c2480024a30: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
=>0x0c2480024a40: fd fd fd fd fd fd fd fd fd fd fd fd fd[fd]fd fd
  0x0c2480024a50: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fa
  0x0c2480024a60: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c2480024a70: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c2480024a80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c2480024a90: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==18211==ABORTING

Pushed a fix, can you try again?
You'll now likely hit the
zxdg_surface_v6@21: error 3: xdg_surface has never been configured

error, which is likely a SDL issue. We're more strict than KWin when it comes to Wayland protocol conformance.

ASAN doesn't complain anymore and rootston hasn't segfaulted so far :+1:
The window doesn't appear at all and SDL shows that xdg_surface error as predicted, but yeah, that's a different issue.

While SDL2 apps work fine on KWin and Mutter, they fail the same way like on Sway/rootston also on Weston, so I guess you're right and it's likely a protocol violation on SDL2 side.
Other than that, the segfaults seem to be fixed now, thanks! :)

Turns out SDL 2.0.9 already fixes that as well, so everything works great now \o/

Thanks!


Initial ideas for new Encryption interface

Looking for design feedback on a new encryption interface.  My thinking was to do something pluggable and seamless, similar to the way CompactionStrategy was done.
If encryption is enabled call EncryptionStrategy.encryptStream() and EncryptionStrategy.decryptStream(), otherwise proceed normally. A DefaultEncryptionStrategy would be provided with basic encryption behavior.  Seems doable for BCFile, not so sure about the WALs.
Feedback PR only, not merging.

Closing this PR for now... will create another when I'm further along.


delegate functions like Action and Func break the minifier when called (workaround)

First of all, thanks for creating this project.  It is awesome!  I forked it to add a command line version of the app.  I'm using it to minify code for the game Space Engineers which uses C# for in game programming and it has a character limit.
The issue I have been having is that the minifier fails to detect that when you call a delegate function it is the same as the variable it is stored in.  For example, in the following code, the "op" and "callback" variables are minified when they are used as variables, but when they are used like a function in the handle method they don't get minified, so it causes errors.
public class EasyEvent
{
    private Func<EasyBlock,bool> op; // The comparison function

    private EasyBlock obj; // Object to pass through to the callback when the event is triggered

    private Func<EasyBlock,bool> callback; // What to call when the event occurs

    public EasyEvent(EasyBlock obj, Func<EasyBlock,bool> op, Func<EasyBlock,bool> callback)
    {
        this.op = op;
        this.callback = callback;
        this.obj = obj;
    }

    public bool handle()
    {
        if(this.op(this.obj))
        {
            return this.callback(this.obj);
        }

        return true;
    }
}

Don't worry about fixing this anytime soon unless you want to.  There is an easy workaround.  If you put parenthesis around the variable when it is used as a function like this: "(this.op)(this.obj)" it convinces the parser that it is a variable and then it works. :-)

Great, command line version will be good!
Ok, I'll check you issue when I will have more free time.


How to exit a command line

Hi,
I am sorry for that question as it might be a bit stupid. I read the documentation and I can't find how to stop a command line to run.
I am using this code:
val commandLine = CommandLine("python3",
                "-u",
                "my-script.py")
commandLine.exec.async.logging()

I would like to be able to do something like:
commandLine.exit()

But I can't find anything about it, do you have any lead for me?
Thank you

I found my mistake... sorry for bothering


Unhandled exception after swapping markets

Description
Unhandled exeception when i try to open a new market while using locally served console (develop branch)
Steps to Reproduce

Build and Serve console (develop branch)
Click on 'market selector
Click on a different market
See error
ag-grid-community.auto.esm.js:35980 Uncaught TypeError: Cannot read properties of null (reading 'getColId')  at HeaderCellCtrl.getColId (ag-grid-community.auto.esm.js:35980:1)  at HeaderCellComp (headerCellComp.js:42:1)  at renderWithHooks (react-dom.development.js:16305:1)  at updateFunctionComponent (react-dom.development.js:19588:1)  at updateSimpleMemoComponent (react-dom.development.js:19425:1)  at beginWork (react-dom.development.js:21678:1)  at beginWork$1 (react-dom.development.js:27426:1)  at performUnitOfWork (react-dom.development.js:26557:1)  at workLoopSync (react-dom.development.js:26466:1)  at renderRootSync (react-dom.development.js:26434:1)  at performSyncWorkOnRoot (react-dom.development.js:26085:1)  at flushSyncCallbacks (react-dom.development.js:12042:1)  at commitRootImpl (react-dom.development.js:26959:1)  at commitRoot (react-dom.development.js:26682:1)  at finishConcurrentRender (react-dom.development.js:25981:1)  at performConcurrentWorkOnRoot (react-dom.development.js:25809:1)  at workLoop (scheduler.development.js:266:1)  at flushWork (scheduler.development.js:239:1)  at MessagePort.performWorkUntilDeadline (scheduler.development.js:533:1)

@bwallacee can this possibly impact mainnet?  If not we're going to push out


Improve error message when acorn image copy fails to copy because of image already existing

acorn version v0.8.0-rc4-47-g80dd7169+80dd7169
Steps to reproduce the problem:

Attempt to use acorn image copy when the destination image tag already exists.
Following is the error message presented to the user:

acorn image copy ghcr.io/sangee2004/testsignature:v0.0.1 docker.io/sangeetha/mytestacorn:v0.0.1
  ✗  ERROR:  websocket: close 1011 (internal server error): not copying image to docker.io/sangeetha/mytestacorn:v0.0.1 since it already exists

In the above error message , "websocket: close 1011 (internal server error)" can be removed. We could also guide users to use "-f" option if they do want to Overwrite the destination image in this case.

Tested with acorn version - v0.8.0-rc4-58-gbe49d0bd+be49d0bd
This issue is addressed:
acorn image copy ghcr.io/sangee2004/testsignature:v0.0.2 docker.io/sangeetha/mytestacorn:v0.0.1
  ✗  ERROR:  not copying image to docker.io/sangeetha/mytestacorn:v0.0.1 since it already exists (use --force to override)


Don't extend until constructor

This allows you to use require to include this without getting an error that google is not defined if it beats the Maps API to load (say you're loading it asynchronously or via https://www.npmjs.com/package/google-maps). It won't extend until the constructor.

Excellent addition! Thanks @ethanclevenger91.

Published in v1.1.14

I had roll this back due to #9. I've published a fix in v2.0.0 which solves the same problem. Let me know if you have any issues with that :)

Ho jeez sorry about that. Yeah, definitely okay with rolling back.
On May 23, 2016 8:34 PM, "Jess Telford"<EMAIL_ADDRESS>wrote:

I had roll this back due to #9
https://github.com/jesstelford/node-MarkerWithLabel/issues/9. I've
published a fix in v2.0.0 which solves the same problem. Let me know if
you have any issues with that :)
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/jesstelford/node-MarkerWithLabel/pull/7#issuecomment-221143314


Issue 33393: hide “Change Email” button from trial instance (or any instance set as to auto redirect to SSO auth)

BVTs all passed and the UserTest passed as well on this branch. Ready to merge.


Flashing when scrolling

When using Ctrl+D and Ctrl+U to scroll there is a visible flash for maybe like one frame. It looks like a little darker background color flash. It is especially visible, when i set my line numbering to relative and use 'j' and 'k' to scroll.
Short example of how it looks: https://i.imgur.com/Q97YQtA.mp4
I'm on the Windows 10, and didn't change anything beside the font in the configuration.
Emacs installed from here https://alpha.gnu.org/gnu/emacs/pretest/windows/emacs-27/emacs-27.0.91-x86_64-installer.exe

I cannot reproduce this on Linux or macOS, so I assume it's a windows issue.
You could try adding this to ~/.doom.d/config.el:
(add-to-list 'default-frame-alist '(inhibit-double-buffering . t))

I have a similar issue. Also more severe when numbers are relative. I run Gardu Linux, Alacritty and emacs-nox.

Because I can't reproduce this, no new leads have come up in nearly a year, and I have little reason to suspect this is a Doom issue (more likely a Emacs issue), I will close this. Feel free to create another issue if you have reason to believe otherwise.


feat: support heap profiling from risedev

I hereby agree to the terms of the Singularity Data, Inc. Contributor License Agreement.
What's changed and what's your intention?

Add the profiling and stats feature of tikv-jemallocator
Allow users to enable profiling from risedev via setting env var RISEDEV_ENABLE_HEAP_PROFILE

Checklist

[x] I have written necessary rustdoc comments
[x] I have added necessary unit tests and integration tests
[x] All checks passed in ./risedev check (or alias, ./risedev c)

Documentation
N/A
Refer to a related PR or issue link (optional)
helpful to #4819

Should profile be an optional feature for jemalloc? I’ll check if there’s performance drop / code path difference for jemalloc later. May get this merged first.

Profiling is disabled by default, and it can be enabled by setting prof:true in _RJEM_MALLOC_CONF, which is exactly what we did when setting RISEDEV_ENABLE_HEAP_PROFILE


docker import fails to load tar file due to problem with chmod

$ xzcat result/tarball/nixos-system-x86_64-linux.tar.xz | docker import -
FATA[0010] Error: Untar exit status 1 chmod /nix/store/vn2xa15s3l4r3djn2hri7jmhv6a6m7zr-xz-5.0.7/bin/lzegrep: no such file or directory`

lzegrep is a symlink to ./xzgrep
Looks like docker tries to chmod(3) lzegrep before xzgrep is unpacked and saved to disk, so that causes ENOENT

strace -qqyff -e trace=chmod -p $(pidof docker) shows this
[pid 19573] chmod("/nix/store/vn2xa15s3l4r3djn2hri7jmhv6a6m7zr-xz-5.0.7/bin/lzegrep", 0777) = -1 ENOENT (No such file or directory)

Typeflag field of this file in archive is '1' (hardlink) and in header lzegrep is linked to xzfgrep (which is actually symlink).
Looks like we have to check at https://github.com/docker/docker/blob/master/pkg/archive/archive.go#L352, that target of unpacked hardlink is not actually symlink (in GNU tar actually temporary placeholder file is created).


docker-compose documentation version

hochan@hochan-node:~/Desktop/pfc/dockercompose$ sudo docker-compose up --build
ERROR: Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a version of "2" (or "2.0") and place your service definitions under the services key, or omit the version key and place your service definitions at the root of the file to use version 1.

Proposed changes
Due to the evolution of version, '3' no longer matches version in docker-compose.

Unreleased project version (optional)

Related issues (optional)
docker-compose documentation version #10451
docker-compose documentation version #10450
docker-compose documentation version #10449
docker-compose documentation version #10433 [Merged]

@ulyssessouza I don't understand this change; I tried this example with version 3, and that worked without issues; was this problem occurring on an outdated version of docker compose?

@ulyssessouza I don't understand this change; I tried this example with version 3, and that worked without issues; was this problem occurring on an outdated version of docker compose?

My version is,
docker-compose version 1.8.0, build unknown
According to the documentation in the current version, you need to specify the version as x.x.
https://docs.docker.com/compose/compose-file/compose-versioning/
Versioning
There are currently three versions of the Compose file format:
Version 1, the legacy format. This is specified by omitting a version key at the root of the YAML.
Version 2.x. This is specified with a version: '2' or version: '2.1', etc., entry at the root of the YAML.
Version 3.x, the latest and recommended version, designed to be cross-compatible between Compose and the Docker Engine’s swarm mode. This is specified with a version: '3' or version: '3.1', etc., entry at the root of the YAML.
Note: When specifying the Compose file version to use, make sure to specify both the major and minor numbers. If no minor version is given, 0 is used by default and not the latest minor version. As a result, features added in later versions will not be supported. For example:
version: "2"
is equivalent to:
version: "2.0"
So I fixed it because I thought it was correct to add .0 to the back.

My version is,
docker-compose version 1.8.0, build unknown

Wow, compose 1.8.0 is really old; that version was released four years ago; https://github.com/docker/compose/releases/tag/1.8.0. I'd definitely recommend installing a more current version: https://docs.docker.com/compose/install/

Note: When specifying the Compose file version to use, make sure to specify both the major and > minor numbers. If no minor version is given, 0 is used by default and not the latest minor version.

That's correct (although there's a proposal to change the behaviour: https://github.com/docker/compose/issues/7201)
While there are some features that are not supported by the v3.x format, most features are supported, and I'd prefer the examples to use the v3 format where possible, because it's currently the most portable format (supported both by docker-compose (standalone), and docker stack deploy (to deploy to kubernetes or swarm services).
I think we could change these to use;
version: "{{ site.compose_file_v3 }}"

So that the latest supported v3 compose file format is filled in automatically.
@ulyssessouza @usha-mandya wdyt?

Actually the link made me accept thinking it was just a V2 feature.
But checking the docs, looks like it's supported in V3 too.
If that's correct, I think we should revert that change.


Euclidean algorithm in brainfuck

So I basically wrote Euclidean algorithm in brainfuck
Currently, the input is ascii and output is ascii, maybe I can parse a numerical input and print numerically? Not sure which is better

I think it would be nice to include the explanation into the main markdown file for the chapter in the language switching method. That way, when BF is chosen, it comes with an appropriate explanation.

For the record, this is awesome.

Oh yeah, you haven't included the code in the chapter. Also you need to add brainfuck to book.json

Ok so I've added a subtraction algorithm that was way longer than expected and an explanation


Update version to 0.7.3

Signed-off-by: shaoyue.chen<EMAIL_ADDRESS>
Checklist

[x] Used a personal fork of the feedstock to propose changes
[x] Bumped the build number (if the version is unchanged)
[x] Reset the build number to 0 (if the version changed)
[x] Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
[x] Ensured the license file is being packaged.

Hi! This is the friendly automated conda-forge-linting service.
I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

seems pgzip is not provided in conda-forge channel

conda-forge/staged-recipes#19866


[CI] Use a different version of pyopencl depending on wheel availability

I made the wheel for pyopencl 2018.1 for python3.6, let's try to use it....

LGTM