Microsoft.RecoveryServices/vaults/backupPolicies backupManagementType field throws BCP036

Bicep version
Bicep CLI version 0.3.255 (589f0375df)
Describe the bug
The property "backupManagementType" expected a value of type "'AzureIaasVM' | 'AzureSql' | 'AzureStorage' | 'AzureWorkload' | 'GenericProtectionPolicy' | 'MAB'" but the provided value is of type "'AzureIaasVM' | 'AzureSql' | 'AzureStorage' | 'AzureWorkload' | 'GenericProtectionPolicy' | 'MAB'".bicep(BCP036)

To Reproduce
param recoveryServicesVaultName string
param backupPolicyName string

// This is the error
@allowed([
  'AzureIaasVM'
  'AzureSql'
  'AzureStorage'
  'AzureWorkload'
  'GenericProtectionPolicy'
  'MAB'
])
param backupManagementType string

resource backupPolicies 'Microsoft.RecoveryServices/vaults/backupPolicies@2019-06-15' = {
  name: '${recoveryServicesVaultName}/${backupPolicyName}'
  location: resourceGroup().location

  properties: {
    backupManagementType: backupManagementType  // <-- shows the above BCP036 error
    . . .
}

Additional context
I've tried wrapping in any() and get a similar error:
    backupManagementType: any(backupManagementType ) // <-- shows a different BCP036 error
//The property "backupManagementType" expected a value of type "'AzureIaasVM' | 'AzureSql' | 'AzureStorage' | 'AzureWorkload' | 'GenericProtectionPolicy' | 'MAB'" but the provided value is of type "any".bicep(BCP036)

This is another case of #1320

Closing as dup of #1320


How do I generate the thought experiment data?

Dear Professor,
Hello!
Thank you for developing this tool.
While using this tool, I was confused about the input data (Ztest.csv, Species_id.csv, Sample_id.csv )  used to compute the keystoneness.
I have the following questions:
(1) What do the values in the Ztest table represent? And I found that in the introduction of the tool, these values are all integers (0 or 1), but in the Ztest table of example data set , most of the values are decimals (e.g.,0.0204081632653061) .

(2) How do I generate the thought experiment data (Ztest.csv, Species_id.csv, Sample_id.csv ) from Ptrain.csv? Could you describe more about the specific process and tools used to generate these data?
(3) There are Ptest.csv and Ztest.csv in the example data set. What is the difference between the two tables? When using this tool to compute our own real data, should we use Ptest.csv or Ztest.csv? If I should use the Ptest table as input data, how do I generate this table?
I really appreciate your response.
If it is convenient for you, we can communicate by email. My email address is<EMAIL_ADDRESS>

Dear Professor,
Hello!
I have similiar question for this pool.
I really appreciate your response.
If it is convenient for you, we can communicate by email. My email address is<EMAIL_ADDRESS>


How to connect externally created IoT Hub  with the Digital twin..?

Document I am following is "Device connectivity and telemetry ingress"
https://docs.microsoft.com/en-us/azure/digital-twins/concepts-device-ingress
[Enter feedback here]

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

ID: ed7028fa-961b-c7da-212d-686ba8672130
Version Independent ID: 55d0fa05-72e8-47a0-660f-828fd0504e31
Content: Device connectivity and telemetry ingress - Azure Digital Twins
Content Source: articles/digital-twins/concepts-device-ingress.md
Service: digital-twins
GitHub Login: @alinamstanciu
Microsoft Alias: alinast

@ShreedharYashoda Thank you for your inquiry. We are investigating and will update you when we have additional information to share.

@ShreedharYashoda Thanks for your comment.
Please note that, Azure Digital Twins is in Public Preview. Currently, there is no way you can connect the external IoT Hub with Digital Twins. However, in GA we will have the ability for you to bring your own/directly create & associate your own hub.
Please provide your feedback on the UserVoice and upvote for this feature.

Hi Ashok,
Thanks for the reply, I just wanted to know is it possible to get the data
from raspberry pi to my digital twin through IoT Hub created by the digital
twin..?
thanks and regards
Shreedhar
On Wed, Apr 22, 2020 at 7:06 AM AshokPeddakotla-MSFT <
<EMAIL_ADDRESS>wrote:

@ShreedharYashoda https://github.com/ShreedharYashoda Thanks for your
comment.
Please note that, Azure Digital Twins is in Public Preview. Currently,
there is no way you can connect the external IoT Hub with Digital Twins.
However, in GA we will have the ability for you to bring your own/directly
create & associate your own hub.
Please provide your feedback on the UserVoice
https://feedback.azure.com/forums/916621-azure-digital-twins/suggestions/35996413-explain-how-to-access-the-iot-hub-created-by-the-s
and upvote for this feature.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/MicrosoftDocs/azure-docs/issues/52958#issuecomment-617738113,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AKL47D7GJ52CSN6KDLWM2HDRN3MVTANCNFSM4MNNA3BA
.

@ShreedharYashoda Yes, you can get the device connection string and then use the IoTHub sdk on the pi as usual.

YOUR_MANAGEMENT_API_URL/devices/YOUR_DEVICE_GUID?includes=ConnectionString

Follow the steps from the documentation Get the IoT Hub device connection string from the Management API for further details.
Hope this answers your query.

@AshokPeddakotla-MSFT Thanks for the response.
I got little confused while following https://docs.microsoft.com/en-us/azure/digital-twins/concepts-device-ingress
That should I use IoTHub sdk or Azure IoT device sdk to send data from raspberry pi to Digital twin using SendEventAsync or  SendEventBatchAsync call..??
And either ways are there any documents to follow how to implement the same..?
Thanks in advance..!!

@ShreedharYashoda Per this document, you can use the IoT Device SDK on Raspberry Pi to send data to your Digital Twins instance. Unfortunately, we don't have a sample/example for your complete scenario.
I think this question would be better suited for Stack Overflow where there is a development community that can help and also the product team does follow problems that people post and respond.
Please post the link here once you create an issue.
Hope this helps.
We will now proceed to close this thread. If there are further questions regarding this matter, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue.

@AshokPeddakotla-MSFT  Thanks alot..!!


the --connect-timeout is too short

in my network environment, resolving the DNS need more than 3 seconds.
curl --connect-timeout 3 -L 'https://github.com/rancherio/host-api/releases/download/v0.17.0/host-api.tar.gz?current='
curl: (28) Resolving timed out after 3520 milliseconds

Error logs:
[scripts.sh:59] call_curl -L 'https://github.com/rancherio/host-api/releases/download/v0.17.0/host-api.tar.gz?current='
[scripts.sh:43] local 'curl=curl -s --connect-timeout 3'
[scripts.sh:44] '[' false = false ']'
[scripts.sh:45] curl -s --connect-timeout 3 -L 'https://github.com/rancherio/host-api/releases/download/v0.17.0/host-api.tar.gz?current='
[scripts.sh:1] cleanup
[config.sh:9] EXIT=28
[config.sh:11] '[' -e /var/lib/cattle/download.g8IjTfT ']'
[config.sh:12] rm -rf /var/lib/cattle/download.g8IjTfT
[config.sh:15] return 28

Never really considered this.  Are you saying that DNS resolution is included in connect time?  We can increase this timeout I think.  I need to look back in the history to see if there was a specific reason why we set it so low.

Yes, because access the s3 service is slow in my country (many times url redirect and dns lookup).

i had the same issue on my local boot2docker test environment
my quick fix for the moment:
find /var/lib/docker/ -name "scripts.sh" -exec sed -i 's/connect-timeout 3/connect-timeout 42/g' {} ;

On master this has been changed to 20 seconds.  The next release which should be within a week will include the change.

Closed in favor of rancher/rancher#3868


TV showing as on, even when ping fails

The media player component shows the TV as ON/unavailable shortly after pressing the off button (Goes to off for 10-30 seconds and then the state changes back to on/unavailable, even through the TV is off and the ping is unreachable from my laptop)
I have a UA55NU7100 (2018)
My config:
  - platform: samsungtv_custom     host: <IP_ADDRESS>     port: 8002     mac: XXX     app_list: '{"Netflix": "11101200001", "YouTube": "111299001912", "Spotify": "3201606009684"}'

@parampatwala set update_method: "ping" in your config if you want it to rely on ping to see if the TV is on or off.

Thanks, that did mostly solve it - the network interface seems to stay online for 4-5 minutes after it powers on.
What does the default update method do? Is there a way to use that while ensuring the power state works as well?

@parampatwala
The default method sends KEY to the WebSocket server to see if it's alive. The ping method is better imo, there is no way of making any of these 2 update methods more accurate then they are.

Newest release includes the SmartThings API, you'll need to set api_key and device_id to enable it. The SmartThings API adds many new things, and also fixes this issue.


Sl/google test

The project is to move tests from CTest to GoogleTest, which takes advantage of the same input data e.g. for testing on CPU and GPU, and saves the intermediate results for later comparison. This would avoid computing repetitively on the same data set and thus reduce testing time.

Moved cache.cpp from /test to google test folder /test/gtest
Replace main() in cache.cpp with google test Macro TEST()

@xinlipn Is this PR ready for review? If not, then can you please convert this PR into draft?
Could you please also add some motivation to the PR description? This is important for sharing info with external collaborators who do not have access to AMD Jira. Thanks.

@xinlipn

GoogleTest, which takes advantage of the same input data e.g. for testing on CPU and GPU, and saves the intermediate results for later comparison.

Interesting feature. Can you please provide me with a link to the description of it?

[Note] Please also note that CTest is able to test whatever the user wants, while IIRC GoogleTest is suitable for testing of C++ programs only. Therefore all the "custom" tests will have to be left under CTest.

@pfultz2 Can you please glance at this PR? Thanks!

@pfultz2 Thank you, Paul.

Just curious, how does gtest handle passing parameters from CLI to tests?
Its not feasible to create tests cases for every combination of convolution, so we can enumerate the ones that are important and then we should be able to pass flags to run the combinations that were not listed. That is how the current test driver works, but it does a cartesian product of all configurations so it creates a lot of test cases.
From looking at the docs in gtest, it looks like we will still need argument parsing as gtest doesn't take care of that for us whereas catch2 lets us easily add our own command-line arguments:
https://github.com/catchorg/Catch2/blob/devel/docs/own-main.md#adding-your-own-command-line-options
What the rational for choosing gtest over catch? gtest/catch will work well for our unit tests, but not so well for our acceptance tests. I am not sure either one can do what are current acceptance test drivers do though, but it looks like catch might get us closer there(we could at least take advantage of Clara).

which takes advantage of the same input data e.g. for testing on CPU and GPU, and saves the intermediate results for later comparison

The current test driver uses the same data for the CPU and GPU as well and it can save the CPU results too, but it is too large for all the test cases we run(which why it is not enabled by default). I did try to use bzip2 but it seems uncompressing was just about as slow(or even slower) for most cases as recomputing the CPU version(zstd might be a better choice for this).
There are few cases where the same config produces different input values because we are calling the test differently and using std::rand in a lot of places.
To improve our current test drivers we need:

Enumerate the test config we want instead of cartesian product of all values
Stop using std::rand to generate values(an xorshf96_generator like what we use in migraphx is quite fast).

But using gtest/catch wont help fix any of these issues expect maybe forcing a refactoring of the tests(which is definitely needed).

@pfultz2

To improve our current test drivers we need:...

We can also use naive GPU implementations instead of CPU to compute reference data. This feature is implemented in the driver, but not in conv tests yet.

maybe forcing a refactoring of the tests(which is definitely needed).

😉

@xinlipn

GoogleTest, which takes advantage of the same input data e.g. for testing on CPU and GPU, and saves the intermediate results for later comparison.

Interesting feature. Can you please provide me with a link to the description of it?

Thanks everyone for reviewing and suggestions.
@atamazov, here's a link about GoogleTest FYI:
http://google.github.io/googletest/primer.html

@xinlipn If the idea behind re-using the same input and output data is based on fixture classes, then it requires serious redesign on existing tests.

Thank you @atamazov and @pfultz2 for your time and input.  Yes, TEST_F() offers the same data configurations for different tests.
I pushed some changes as below:

Macro EXPECT_EQ is replaced with EXPECT_TRUE per Paul's suggestion.

I also started refactoring activation.cpp for a simple "--float" test case, which may need further improvement to include the logic in test/CMakeLists.txt,

Macro EXPECT_EQ is replaced with EXPECT_TRUE per Paul's suggestion.

So doing EXPECT_TRUE(x == y) gtest will show what the values for the variables x and y are?

I also started refactoring activation.cpp for a simple "--float" test case, which may need further improvement to include the logic in test/CMakeLists.txt,

Is the plan to just have our test cases be gtests that just invoke the test driver? So we just keep the test driver and remove the --all option and lists in ctests?
Enumerating the tests in C++(with gtest or catch) does provide some nice filtering for running different subsets of tests. However, there is a compile-time cost that can grow as we add more tests or change existing tests.
A better option would be to have a json file with the different test configurations(its actually faster to parse json than to parse and compile C++). We would just need to provide our own filtering for this.

@xinlipn

Yes, TEST_F() offers the same data configurations for different tests.

Can you please elaborate the machinery you are going to use in the fixture classes to enable the "re-using the data" feature in tests? For example, what is the expected lifetime of the instances of fixture classes (and, consequently, what is expected lifetime of the re-usable data they own)?

Just curious, how does gtest handle passing parameters from CLI to tests?

Here's a thread discussing passing CLI parameters to gtest
https://github.com/google/googletest/issues/765

Just curious, how does gtest handle passing parameters from CLI to tests?
Its not feasible to create tests cases for every combination of convolution, so we can enumerate the ones that are important and then we should be able to pass flags to run the combinations that were not listed. That is how the current test driver works, but it does a cartesian product of all configurations so it creates a lot of test cases.
From looking at the docs in gtest, it looks like we will still need argument parsing as gtest doesn't take care of that for us whereas catch2 lets us easily add our own command-line arguments:
https://github.com/catchorg/Catch2/blob/devel/docs/own-main.md#adding-your-own-command-line-options
Whats the rational for choosing gtest over catch? gtest/catch will work well for our unit tests, but not so well for our acceptance tests. I am not sure either one can do what are current acceptance test drivers do though, but it looks like catch might get us closer there(we could at least take advantage of Clara).

which takes advantage of the same input data e.g. for testing on CPU and GPU, and saves the intermediate results for later comparison

The current test driver uses the same data for the CPU and GPU as well and it can save the CPU results too, but it is too large for all the test cases we run(which why it is not enabled by default). I did try to use bzip2 but it seems uncompressing was just about as slow(or even slower) for most cases as recomputing the CPU version(zstd might be a better choice for this).
There are few cases where the same config produces different input values because we are calling the test differently and using std::rand in a lot of places.
To improve our current test drivers we need:

Enumerate the test config we want instead of cartesian product of all values
Stop using std::rand to generate values(an xorshf96_generator like what we use in migraphx is quite fast).

But using gtest/catch wont help fix any of these issues expect maybe forcing a refactoring of the tests(which is definitely needed).

@xinlipn If the idea behind re-using the same input and output data is based on fixture classes, then it requires serious redesign on existing tests.

Yes, tests need to be redesigned.

@xinlipn

Yes, TEST_F() offers the same data configurations for different tests.

Can you please elaborate the machinery you are going to use in the fixture classes to enable the "re-using the data" feature in tests? For example, what is the expected lifetime of the instances of fixture classes (and, consequently, what is expected lifetime of the re-usable data they own)?

@atamazov Please correct me if I'm wrong. my understanding is current tests are individual executables and  the test data e.g. for activation test, exists during the lifetime of the test after they are initialized, e.g. get_input_tensor(tensor_elem_gen_integer{miopen_type{} == miopenHalf ? 5 : 17})); //activation.cpp
I'm thinking the lifetime of fixture class instances along with the data would also be the same of the test. Does this make sense?

For example, in migraphx doing:
TEST_CASE(expect)
{
    int x = 1;
    int y = 2;
    EXPECT(x == y);
}

It will print out:
[   RUN    ] expect
void expect()
AMDMIGraphX/test/main.cpp:30:
    FAILED: x == y [ 1 == 2 ]
[  FAILED  ] expect: Test failure
[==========] 1 tests ran
[  FAILED  ] 1 tests failed
[  FAILED  ] expect

Does gtest show something similiar?

@pfultz2, yes, it will have serial spew, here's an example for EXPECT_GT(0, 1);
...
MIOpen/test/gtest/hello_test.cpp:23: Failure
Expected: (0) > (1), actual: 0 vs 1
...

Just curious, how does gtest handle passing parameters from CLI to tests?

@pfultz2  Here's an example for passing parameters :)
https://stackoverflow.com/questions/9496730/can-i-pass-parameters-to-googletest-test-function

@xinlipn  Please make sure that the CI passes and that the newly added tests are run

The CI issue appears to be related to no response from nc -N jenkins-raptor-11.amd.com 6379
[2022-07-21T05:25:32.015Z] + nc -N jenkins-raptor-11.amd.com 6379
script returned exit code 1
Compared with previous build, below is expected
FOUND CCACHE SERVER: jenkins-raptor-11.amd.com
Jun has ping'd Nyamodi, Leon  and kakarparthi, omkar...

@xinlipn

my understanding is current tests are self contained individual executables and the test data e.g. for activation test, exists during the lifetime of the test after they are initialized

This is correct.

I'm thinking the lifetime of fixture class instances along with the data would also be the same of the test. Does this make sense?

Yes, it makes sense. Especially if you have tests that internally may re-use the same test data more than once. But currently all our tests use test data only once.
For example, the test of a convolution generates input tensors and reference output tensor -- these comprise the test data. Then the test runs the convolution from the library with the inputs, gets actual output and compares it with the reference. Then the test throws out all the tensors. If it wants to test some other convolution (the convolution that has different dimensions), then previous test data is useless and needs to be regenerated.
So maybe I am wrong but I do not see how the the "re-using the data" feature can improve the situation.

@atamazov  The rationale for using the GTest is to use a standardized testing framework which is thoroughly documented and comprehensive, allowing new team members to understand and contribute more easily. Furthermore, I believe it is more comprehensive and would reduce the size of our code base. However, the current testing framework is not going anywhere, however, new tests would only be added using the GTest to keep things uniform.
This PR only adds the dependency and a sample test as the stepping stone before we can add more tests or port some of the existing tests to GTest framework. Since GTest has a clean setup and tear down mechanism for test data I am hoping that porting some of the tests to GTest would enable us to correctly cache the test data and avoid recomputing it allowing us to extend our code coverage without increasing the testing time substantially. Attempts to do the same via existing framework have not been successful since the code paths there are non deterministic and I am hoping GTest would not suffer the same issue.
I hope this answers some of the questions you might have and help expedite the review.

@xinlipn [Note about the process] If you do not think that PR is ready for review/merging, then please convert it to draft. Thanks.

Thank you Artem and Jehandad for the input. The CI currently failed at an older version of CMake. Should be able to merge once this is fixed.

@JehandadKhan I am by no means opposed to continuing this research))

@xinlipn clang format issues can be fixed by the following script: https://github.com/ROCmSoftwarePlatform/MIOpen/wiki/How-to-format-code

@xinlipn clang format issues can be fixed by the following script: https://github.com/ROCmSoftwarePlatform/MIOpen/wiki/How-to-format-code

@junliume Thank you. Code from other branch was accidentally checked in to this branch. I'm cleaning up and will commit the changes soon.

@xinlipn Thanks! Some other tidy issues before the static check can run through: http://micimaster.amd.com/blue/rest/organizations/jenkins/pipelines/MLLibs/pipelines/MIOpen/branches/sl%252Fgoogle_test/runs/20/nodes/97/steps/311/log/?start=0
such as
/var/jenkins/workspace/MLLibs_MIOpen_sl_google_test/test/gtest/cache.cpp:157:24: warning: Argument 'marker==1' to function EXPECT_TRUE is always 1 [constArgument]

@xinlipn Thanks! Some other tidy issues before the static check can run through: http://micimaster.amd.com/blue/rest/organizations/jenkins/pipelines/MLLibs/pipelines/MIOpen/branches/sl%252Fgoogle_test/runs/20/nodes/97/steps/311/log/?start=0
such as
/var/jenkins/workspace/MLLibs_MIOpen_sl_google_test/test/gtest/cache.cpp:157:24: warning: Argument 'marker==1' to function EXPECT_TRUE is always 1 [constArgument]

@junliume , thank you for the reminder. This is actually caused by the code accidently checked in. It has been reverted.

@xinlipn CI has passed, please ping all reviewers for their opinions. Thanks!

CI has passed. Could @JehandadKhan @atamazov @pfultz2  take another look? Thank you
http://micimaster.amd.com/blue/organizations/jenkins/MLLibs%2FMIOpen/detail/sl%2Fgoogle_test/27/pipeline


Depreciated Readme

I think after upgrading to V2, the current readme (main branch )is depreciated, a lot of functions and structs are unavailable. It's tough for beginners to get a head start. Please check.

OK, We will update the readme on the main branch as soon as possible


Add ability to delete many series with predicate

#9639

@jacobmarble looks like the PR contains some commits from another branch? Maybe your feature branch just needs a rebase again a master and then a force push back up?

You're right, fixed.


Added nix check and pre commit hook for formatting

After making my first commits to this project in a while I was met with an angry CI that didn't like I did not run nix fmt before committing/pushing. So I thought a good idea would be to provide a pre-commit hook, so I and others don't forget to format before committing.
Thanks to cachix/pre-commit-hooks.nix this was quite easy to implement.
To install the pre commit hooks simply open the devShell in the repository (nix develop). Or if you have direnv it will load automatically.
This was also referenced a while back in another issue https://github.com/pta2002/nixvim/issues/114#issuecomment-1384582491
Edit:
On a second thought I am not sure if it is a good idea to have a check too. Since the CI now checks the formatting twice, however we could probably replace the nix fmt -- -c command with just checking the pre commit hook.

Yeah, I'd add the nix fmt -- -c to nix check in that case, and remove it from CI, it's probably for the best

Alright, do you want me to remove it from the CI?

Yeah, if you need help with that just say though


Update to ngx and support Angular 5

Hello,
this library still works on Angular 5, but produces a warning that no peer of Angular 4 is installed. Would be nice if you would officially support Angular 5.
Also the package should be named ngx-device-detector, since Angular 4 is supported.

seconded

Hello,
I have the same issue too (peer invalid<EMAIL_ADDRESS>required by ng2-device-detector@1.0.0).
Have you a roadmap to official migrate this module to a version compliant with Angular 5?
Thanks a lot

Hi @joGrim65 .
Yeah I plan to do it this weekend.
If anyone wants to take it and create PR instead, more than welcome !


Support wildcard domains

Microsoft publishes container images on mcr.microsoft.com for example. mcr.microsoft.com/dotnet/sdk:7.0
However, when building a Docker image using Github Actions, it appears that mcr.micrsoft.com resolves to multiple regions across different runs.
Observed:

westus.data.mcr.microsoft.com
westcentralus.data.mcr.microsoft.com

So instead of having to slowly track and whitelist individual regions, I'm hoping that you can just allowlist *.mcr.microsoft.com

Hi @jauderho, can you please share a link to a workflow where you observed this? Thanks!

Interesting, harden-runner does not actually capture the subdomain in the harden-runner output: https://app.stepsecurity.io/github/jauderho/dockerfiles/actions/runs/3965278228
But this can be see in the GHA output: https://github.com/jauderho/dockerfiles/actions/runs/3965278228/jobs/6794861825#step:20:51

This is for an unsuccessful run. I just enabled telemetry and set to block.

https://app.stepsecurity.io/github/jauderho/dockerfiles/actions/runs/3965404061
https://github.com/jauderho/dockerfiles/actions/runs/3965404061/jobs/6795095110#step:20:81

seeing the same issue after changing to block while allowlisting mcr.microsoft.com
https://github.com/Azure/eraser/actions/runs/4028112467/jobs/6924673782#step:10:31

Thanks for reporting, @sozercan! It looks like MCR decides at runtime what location to pull from.
Investigating this issue is in the backlog and we will get to it soon.
@h0x0er please investigate this next. Thanks!

@varunsh-coder, I found that  mcr.microsoft.com is used for content-discovery, whereas in order to download image blobs  various region specific content-delivery endpoints are used.
The structure of content-delivery endpoints is <region>.data.mcr.microsoft.com. List of regions can be found here.
On executing the below command you will notice;  a call to content-discovery endpoints redirects to region specific content-delivery endpoint.
curl https://mcr.microsoft.com/v2/dotnet/aspnet/blobs/sha256:ac9a37082c6dec16dd5bd45d54a08f2e479d37222f2732f5b464e9dd5d454f0a

Ref:

https://github.com/microsoft/containerregistry/blob/main/client-firewall-rules.md
https://github.com/microsoft/containerregistry/blob/main/docs/mcr-endpoints-guidance.md

I have updated the title to a more generic feature - Support wildcard domains.

@h0x0er is working on implementing this feature. We plan to release it in two week. I will share rc build to try out in a few days.

This feature is now available on the rc tag. Here are a couple of examples. Please try it out and let me know if you have any feedback or questions.
https://github.com/harden-runner-canary/secure-repo-1/blob/166fc181bd964106b97a7dfe5fb13c94b4f20d9d/.github/workflows/release.yml#L23
https://github.com/harden-runner-canary/nvm/blob/72beb77f654e5cdbfa5f259f36eec20f2ca95493/.github/workflows/lint.yml#L32

This has been released in v2.4.0
https://docs.stepsecurity.io/harden-runner/how-tos/block-egress-traffic#support-for-wildcard-domains


Add extension instead of Rule for Junit5

Junit5 doesnt now rules anymore, it has the concept of extensions:
@ExtendWith(TraceUnitExtension.class)

http://www.baeldung.com/junit-5-migration
As people start using it, the support would be great as I have mixed tests now

this would be a draft of a kotlin version of an extension function
class InjectionExtension(val scopeName: String = MAIN_SCOPE): AfterEachCallback, BeforeEachCallback {

    private var testModule: ToothPickTestModule? = null
    private var scope: Scope? = null

    override fun afterEach(context: ExtensionContext?) {
        Toothpick.reset(Toothpick.openScope(scopeName))
    }

    override fun beforeEach(context: ExtensionContext?) {
        testModule = ToothPickTestModule(context?.testInstance!!.get())
        scope = Toothpick.openScope(scopeName).apply {
            installTestModules(testModule)
        }
    }
}

you would need annotations to read the Scope value though for passing the scope, see https://github.com/junit-team/junit5/issues/1135

addon: Junit 5.1 supports @RegisterExtension, with this the scope name could be set

This is addressed in TP2.


Expressions defined in Mapping annotations generate invalid code in v4

With the following mappings defined
mappings = [
  Mapping(target = "submitter", expression = "it.submitterName"),
  Mapping(target = "commentCount", expression = "it.commentCount ?: 0"),
]

The generated code has changed in v4 in the below manner
@@ -23,8 +23,8 @@
   title = savedPost.title,
   url = savedPost.url,
   description = savedPost.description,
-  commentCount = savedPost.let { it.commentCount ?: 0 },
+  commentCount = savedPost.let { let { it.commentCount ?: 0 } },
   commentsUrl = savedPost.commentsUrl,
-  submitter = savedPost.let { it.submitterName },
+  submitter = savedPost.let { let { it.submitterName } },
   tags = savedPost.tags
 )

Which results in the it implicit field from savedPost.let being shadowed by the inner let that makes it bind to the class being konverted to rather than the one it's being konverted from.
I was able to fix the first mapping by using source instead of expression but there's no way to make the second one work.
You can find the source of the file here, the SavedPost class is generated by a different processor and looks like this:
public data class SavedPost(
  public val shortId: String,
  public val title: String,
  public val url: String,
  public val createdAt: String,
  public val commentCount: Int?,
  public val commentsUrl: String,
  public val submitterName: String,
  public val tags: List<String>,
  public val description: String,
)

That duplicate let looks very unintended, I will have a look later and write a unit test for that.

fixed with 4.0.1

Can confirm, thanks for the quick fix!


Zuul - dynamically route each user to user specific service

Hi, i'm struggling to figure out if the following is possible with Zuul:
each user has it's own bot behind zuul.
I'm trying to write some filter which extracts (from DB/configuration file/whatever) the specific bot URL for the specific user and then Zuul should acts as a proxy to the user's bot.
I've tried to use PRE_FILTER / ROUTE_FILTER with before/after PreDecFilter (all combinations) ctx.set(REQUEST_URI_KEY, "/userSpecificBotPath"); or ctx.setRouteHost(urlOfUserSpecificBot);
all failed to proxy so far.
Any direction would be appreciated.

It is possible. See https://github.com/spring-cloud-samples/sample-zuul-filters/blob/master/src/main/java/org/springframework/cloud/samplezuulfilters/QueryParamServiceIdPreFilter.java
Tho it is serviceId, not url, but it is similar.

Thanks @spencergibb ,
I tried it with eureka server and clients, and indeed it worked.
however, my bots are not configured with eureka clients, and each of them has a unique IP.
I'm trying for 3 days already to setup a filter that will proxy to the URL instead of serviceId, but it's not working.
I have 2 endpoints running:
http://<IP_ADDRESS>:8088/test
http://<IP_ADDRESS>:8089/test
This is my application.properties:
spring.application.name=zuul-server
server.port=8080
management.endpoints.web.exposure.include=*
zuul.routes.test.path=/test/**

And this is my filter:
  @Override
  public String filterType() {
    return PRE_TYPE;
  }
  @Override
  public int filterOrder() {
    return PRE_DECORATION_FILTER_ORDER - 1;
  }
  public boolean shouldFilter() {
   return true;
  }

 public Object run() {
   RequestContext ctx = getCurrentContext();
  try {
    ctx.put(REQUEST_URI_KEY, "http://<IP_ADDRESS>:8088/test/");
  } catch(MaformedURLException e) {
}
return null;
}

Tried to change the orderFilter from -1 to +1, from "pre" to "route",
use ctx.setRouteHost() , nothing works from me.
can you please suggest how to deal with it?
thanks

Finally got it working.
  @Override
  public String filterType() {
    return PRE_TYPE;
  }

  @Override
  public int filterOrder() {
    return PRE_DECORATION_FILTER_ORDER + 1; // run before PreDecoration
  }

  public Object run() {
    RequestContext ctx = getCurrentContext();
    ctx.put(REQUEST_URI_KEY, "/test/");
    try {
      if (new Random().nextInt(10) > 5) {
        ctx.setRouteHost(new URL("http://<IP_ADDRESS>:8088"));
      } else {
        ctx.setRouteHost(new URL("http://<IP_ADDRESS>:8089"));
      }
    } catch (MalformedURLException e) {
      log.error("", e);
    }
  return null;
  }


Requires bleeding-edge theano

Running the example in the README does not work with theano 0.7 but requires a bleeding-edge (requires at least PersistentCudaNdarrayID from misc/pkl_utils.py ). Could be good to mention this or make the main example compatible with 0.7.

Blocks unfortunately requires bleeding edge Theano itself, so making blocks-examples work with 0.7.0 is not tenable.


psycopg.errors.DuplicatePreparedStatement: prepared statement "_pg3_3" already exists

I've been getting the error below:
  File "/Users/aplchian/repos/FastAPI/./main.py", line 205, in demo_get_path_id
    collection = db.create_or_get_collection(collection_id)
  File "/Users/aplchian/opt/anaconda3/lib/python3.9/site-packages/pgml/database.py", line 70, in create_or_get_collection
    results = run_select_statement(
  File "/Users/aplchian/opt/anaconda3/lib/python3.9/site-packages/pgml/dbutils.py", line 80, in run_select_statement
    cur.execute(json_conversion_statement)
  File "/Users/aplchian/opt/anaconda3/lib/python3.9/site-packages/psycopg/cursor.py", line 723, in execute
    raise ex.with_traceback(None)
psycopg.errors.DuplicatePreparedStatement: prepared statement "_pg3_3" already exists

This seems to happen when I make two back to back calls to the search API hitting the same collection


Cleanup xaml page and added design time xaml

Thanks for that csproj fix. I still get confused how you're supposed to include XAML in sdk projects. Need a blog post ;-)


Bump Django to latest 1.11.6

Django 1.11.6 was released on October 5, 2017.
We are still using 1.11 released on April 4, 2017.
Also bump all Django-related dependencies.

Codecov Report

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

@@           Coverage Diff           @@
##           master     #573   +/-   ##
=======================================
  Coverage   80.53%   80.53%
=======================================
  Files          43       43
  Lines        2846     2846
  Branches      173      173
=======================================
  Hits         2292     2292
  Misses        495      495
  Partials       59       59

Continue to review full report at Codecov.

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


Sentry for Ionic Apps

From tenfour-archive created by mackers: ushahidi/tenfour-archive#1498
Clients are complaining of mobile app crashes.
@dalezak We should track app crashes in Sentry
https://docs.sentry.io/platforms/javascript/ionic/

@dalezak Please look at integrating Sentry crash reporting into the ionic app.

@dale can you look at this?


bluetooth: tester: Disable GATT auto-retry on security error

This is causing races with PTS WIDs. Lets explicitly handle security elevation when asked by PTS.

#AutoPTS run zephyr GAP GATT SM

Scheduled PR #https://github.com/zephyrproject-rtos/zephyr/pull/55502#issuecomment-1456985191 after 22:00:38.


libnd4j: depthwise_conv2d - CUDA forward pass does not match CPU

I'm pretty sure CPU is right, because it is passing gradient checks whereas CUDA is failing gradient checks.
(Though, when I check depthwise_conv2d_bp - it seems OK, same result for CPU and CUDA)
code and full results on both CPU and CUDA:
https://gist.github.com/AlexDBlack/ef074b9b15fc35ba5a741c8aeed76ffa
left - cpu
right - cuda

Confirmed fixed.


ProgressBarDialog - Indeterminate not working

The progressbar widget does not move at all when I set .progress(true, 0) it just shows the widget. Is there anyway to resolve this right now? I can change my accentColor fine but cannot seem to get indeterminate to work, do I have to set the animation myself?

I've tested it from API 14 to API 22 and it works fine. What Android version?

5.1.1 Nexus 6, it just sits there and does nothing, very strange. I was thinking it may be the device if anything but not sure how to resolve the issue.

I have Nexus 6 and it works completely fine. I actually don't modify anything about the Progress Bar for Lollipop and and above so there should be no issue.

That could be the issue, I am using this code:
defaultLoginProgressDialog = new MaterialDialog.Builder(login_activity)
.content("Authenticating...")
.progress(true, 0)
.cancelable(false).build();
defaultLoginProgressDialog.show();

Idk, I'm sorry, there's really not much I can do. This would be an issue of android.widget.ProgressBar not working correctly.


About real time

I have run Alphapose successfully, and I can also get the 2D information of keypoints directly. MotionBERT seems to deal with json. What if I let Alphapose send the information to MotionBERT directly? If this work, I can get the real time version of MotionBERT?
I wonder how to change the code to do this?
The code use "kpts_all" to collect the information from json and it seems to deal with all the data together. How to change the code to let MotionBERT deal the keypoints one by one?

Hi, did you manage to get the real time version of MotionBERT?

Hi, did you?


Usage and popularity of JS nowadays

Added information about usage of JS today not only in Web area but in developing desktop and mobile apps.

[x] I have read freeCodeCamp's contribution guidelines.
[x] My pull request has a descriptive title (not a vague title like Update index.md)
[x] My pull request targets the master branch of freeCodeCamp.
[x] None of my changes are plagiarized from another source without proper attribution.
[x] My article does not contain shortened URLs or affiliate links.

If your pull request closes a GitHub issue, replace the XXXXX below with the issue number.
Closes #XXXXX

Thank you for opening this pull request.
This is a standard message notifying you that we’ve reviewed your pull request and have decided not to merge it. We would welcome future pull requests from you.
Reason: This PR currently has merge conflicts and since you deleted the fork/branch, we can not easily resolve. Please create a new fork and review the file on master to see if the modifications made in this PR are still needed. If so, please create a new pull request.
Thank you and happy coding.


Optionally deny floating point operations

Closes #49

the thing that worries me is floats are still possible to use, e.g.:
(module
   (func (export "derp") (param f32) (result f32)
     get_local 0
   )
)

I didn't found a case where it would be a problem so far, at least in our specific use cases (i.e kovan-wasm). @NikVolf what do you think ?

@pepyakin Isn't that denied by denying F32Load?

Floats are already disabled by gas metering instrumentation in kovan-wasm, so feel free to postulate your own requirements for wasmi @pepyakin

No, that code will be allowed (will pass the deny_floating_point check) since it doesn't contain f32.load (or any other fp specific) operations: instructions such as get_local/get_global etc are generic and their type depends on the location they refer to.
In my understanding, without any floating point operations there is nothing the user can do with these values, only juggling with them with get_local/get_global/call/etc, this should be ok but i'm not 100% sure.

Floats are already disabled by gas metering instrumentation in kovan-wasm

Ah, indeed, this isn't currently a problem in kovan-wasm and I don't yet see any further uses of float ban. Do we actually need one in wasmi?

Isn't the reason that we want to deny floating point to avoid differences in rounding? I don't think it's a problem to allow get_{global,local}. I guess we can allow {f32,f64}.load too

WebAssembly scalar floating point has completely deterministic rounding. The parts that are nondeterministic are the bits of NaN values returned from arithmetic instructions, and support for subnormal values in proposed SIMD arithmetic instructions.

Hm, I had an impression that we want to deny floating point ops to avoid differences in bit patterns of NaN and I wasn't aware of anything regarding to rounding. The spec states that the rounding is fully defined operation (am I correct?)
And operations with NaN values aren't, their payload might be different on the input values and the exact operation. If you store this value with fN.store (or somehow observe their bitpattern, i guess  copysign?) you can have non deterministic result thus consensus problems.


Possible to use without Laravel?

Hi,
I use Eloquent models but I use homegrown framework so I don't use Laravel per se.
Can I still use your package?

@mtangoo yes it is, you're looking for this: https://github.com/nilportugues/php-json-api

I already use Symfony's HTTPFoundation to handle HTTP. can you help me understand how I can put that together? Should I open an issue in that specific repo?

@mtangoo using Symfony? Then how about using the Symfony version https://github.com/nilportugues/symfony-jsonapi ?

@mtangoo under the hood all uses PSR7 Response objects. Using the Symfony version, that requires the symfony psr7 bridge , will get all the problems solved for you.

using Symfony?

No. I use Symfony's HttpFoundation to power my Request/Response on my framework. So I was wondering how to go about.

Using the Symfony version, that requires the symfony psr7 bridge , will get all the problems solved for you.

Can you explain this?

@mtangoo yeah open issue on the https://github.com/nilportugues/php-json-api

cool thanks. I will do that


chore: update spin shim to v0.6.0

can I take this one? If so, would it make sense to switch from pinning a ref to pinning the desired tag?

I am trying to get a small website running using the Spin Shim and Fermyon's Bartholomew project. It looks like they recently updated the .wasm component they include to Spin version 0.6.0: https://github.com/fermyon/bartholomew-site-template/commit/a7624543ca607668405c8a34a4dec8a6d201578e
When I try to run a containerd image that includes that component I get the following error. Is this likely due to incompatible versions of Spin?
default       7s          Normal    ScalingReplicaSet         deployment/wasm-spin                           Scaled up replica set wasm-spin-5cc95bc6d8 to 1
default       7s          Normal    SuccessfulCreate          replicaset/wasm-spin-5cc95bc6d8                Created pod: wasm-spin-5cc95bc6d8-lffpc
default       6s          Normal    Scheduled                 pod/wasm-spin-5cc95bc6d8-lffpc                 Successfully assigned default/wasm-spin-5cc95bc6d8-lffpc to k3d-wasm-cluster-agent-1
default       6s          Normal    Pulled                    pod/wasm-spin-5cc95bc6d8-lffpc                 Successfully pulled image "mycluster-registry:12345/wasm-fyi:latest" in 41.070916ms
default       6s          Normal    Pulling                   pod/wasm-spin-5cc95bc6d8-lffpc                 Pulling image "mycluster-registry:12345/wasm-fyi:latest"
default       6s          Normal    Pulled                    pod/wasm-spin-5cc95bc6d8-lffpc                 Successfully pulled image "mycluster-registry:12345/wasm-fyi:latest" in 23.109417ms
default       6s          Normal    Created                   pod/wasm-spin-5cc95bc6d8-lffpc                 Created container testwasm
default       6s          Warning   Failed                    pod/wasm-spin-5cc95bc6d8-lffpc                 Error: failed to start containerd task "testwasm": Failed to prepare configuration: unknown
default       4s          Warning   BackOff                   pod/wasm-spin-5cc95bc6d8-lffpc                 Back-off restarting failed container

When I run through the example here, everything works correctly.

Nevermind ....  Tough to figure that out from the error message!

can I take this one? If so, would it make sense to switch from pinning a ref to pinning the desired tag?

sure! please go ahead! Yes, it makes sense to pin the version to the desired tag.

Is this likely due to incompatible versions of Spin?

I think that's possible.

Closed #55


Investigate possible improvements to the address pattern

What
Investigate whether there are improvements we can make to the address pattern.
Why
We've had a couple of questions from users about our address pattern recently. It's been a while since we reviewed it and it's a very popular guide.
More detail
This card is to do a 2 day investigation into the following:

whether or not the 'county' field can safely be removed in all cases
whether we could provide a coded example of a postcode lookup
whether there's any other useful feedback on the backlog for this pattern

The following are a good starting point for the investigation:

the postcode-lookup backlog item
the address backlog item - in particular this comment

Who needs to know
Chris T

I'd like to see all the address lines to have visible labels.
Visible labels are especially important to users of voice control assistive technology as it means they can go directly to an input.
Additionally as quite often beyond the first line, address line fields are optional, they require this information to be exposed as part of a visible label.
Currently the pattern has visibly hidden address fields and this causes confusioin in teams implementing this pattern.
I'd suggest updating this pattern to show the second address line marked as optional, but all having visible labels.

We use:
'Address line 1'
'Address line 2'
'Address line 3 (optional)'
'Address line 4 (optional)'
'Postcode'
This has several advantages:

Each field has a label
Eliminates the need to provide a different UI for screenreader
Eliminates debates about the purpose of each field and what can/cannot go in each ('building', 'house name', 'house number', 'town', 'county', etc)
Scalable
Simple guidance and simple to audit

Could this exploration include improvements to capturing non-UK addresses please? (I've already reviewed the thread at https://github.com/alphagov/govuk-design-system-backlog/issues/31)

One of the advantages of the above 'Address line 1' format is it works equally well for UK and non-UK addresses. The only issue is with the postcode field. You have the choice of:

make it mandatory for UK users
omit it for non-UK users
make it optional if you want a single field that works for both (we do this on one service)
Does that make sense?

Forgive me if this is a ridiculous solution, but what's the disadvantage in just using a <textarea> for this?

I'd still lean towards asking for the postcode (and country, if required) separately as they'll probably undergo validation.

I'm leaning towards using a similar pattern to that suggested by @peteryates above.
Our current pattern:

Our users are admins entering the addresses of trainees. Unlike users entering their own addresses, they're entering addresses that are already written down - copying from one system to another. We're finding that the majority of their other systems store the address as a single block with postcode. So to put in to separate fields as the design system recommend means many more copy and paste operations. Alternately they paste the entire address in to street line 1 - and then either cut bits out of it, or don't notice, and then things go wrong with the data.

It's really frustrating that there is no workable address capture when you don't know where the user lives in the world. It's all well and good offering a postcode lookup for UK users, but an overseas user is faced with either a multiple field entry asking for county and postcode (?!?), or a textarea which then doesn't allow you to target and use any part of the address later in a service, such as sending data to Notify.
On a past project we've used the postcode lookup pattern with a 'Enter your address manually' or 'Enter an overseas address' link which takes you to an address capture page with simple multiple text entries e.g. Line 1, Line 2, Line 3, Line 4, Line 5, Postcode (if UK), Country (if not UK) to try and cover all bases and still allow the data to be manipulated if necessary. There's other examples of services that have had to try and work round this issue with their own design. Surely we can come up with some sort of standard pattern that ends us having to use sometimes contradictory and often unworkable existing patterns?


Expanded support for CFUs.

The new Fomu variants are very hacked, so use carefully.   They have removed many safety checks (alignment, etc).   Also, they have a hard multiplier but no divider, so you would need to compile with "-march=rv32im -mabi=ilp32 -mno-div".

@tcal-x: This create lots of variants very specific to https://github.com/google/CFU-Playground project and I'm not sure this should be integrated here where we try to provide more generic variants. This would probably be better to integrate these variants directly in the CFU project or in a fork, as is doing Betrusted project for example for the specific variants that have been created for it: https://github.com/betrusted-io/pythondata-cpu-vexriscv.
Fomu is also not a good name for a variant (I imagine it has been created to limit resource usage on iCE40) since we would also want to use it on the iCEBreaker, so we could eventually integrate this one, but would probably have to find a proper name.
cc @mithro, @kgugala

@enjoy-digital - I think we might need a way to provide pythondata-cpu-vexriscv-XXX packages which add more options outside the base package. Having people have their own forks with the same name as the pythondata-cpu-vexriscv package create a huge number of issues.

@enjoy-digital - I think we might need a way to provide pythondata-cpu-vexriscv-XXX packages which add more options outside the base package. Having people have their own forks with the same name as the pythondata-cpu-vexriscv package create a huge number of issues.

@mithro: This could be that yes, people doing specialized variants would also have to ensure  they are not reusing existing names  to avoid confusion (Betrusted added a Betrusted suffix for example, similarly to whas is done with CFU variants). Another option would also be to do things similarly to VexRiscv-SMP where CPU parameters are directly exposed to the user and the CPU is automatically rebuilt when the variant is not found in the cached ones, but this requires SBT and VexRiscv toolchain installed on the machine. That's  what is used currently in Linux-on-LiteX-VexRiscv to avoid too much cached variants, which I'm  also trying to avoid here.

@tcal-x, @mithro: It seems the auto-build feature is already in place in CFU playground: https://github.com/google/CFU-Playground/pull/305 so it would probably be better to use it and cache some CPU variants if you want to ease access to users.

Hello @enjoy-digital , I agree with all of your points.   And thank you for keeping the change rate low in pythondata_cpu_vexriscv; it makes it easy to maintain my fork.  I guess I was so fed up with the CFU Playground dependency on my personal GitHub fork, which I desperately want to remove, that I didn't think through better alternatives.
One thing I now realize is that this wouldn't be the last update -- we are still iterating on the ideal CPU for our use case, so we continue to need somewhere to commit and share experimental variants.
I've now thought through some of the alternatives.

I could create a new org to host the CFU-specific fork (I hadn't realized that it was so easy to create an org, but I might not understand everything that comes along with that).

Could the "fork" instead be a non-master branch on litex-hub/pythondata_cpu_vexriscv?   I don't see that often in practice, but the README does show the possibliity of installing from a branch: pip install --user git+https://github.com/litex-hub/pythondata-cpu-vexriscv.git@<branch>

I could create a static directory inside of CFU-Playground that's essentially the same as the pythondata_cpu_vexriscv/pythong_cpu_vexriscv/verilog directory of my fork -- it wouldn't include the Python packaging stuff, so it couldn't be used that way; the pre-generated Verilogs would only be used directly by CFU-Playground.   A user with sbt installed could generate and experiment with new variants, and commit the ones they want to share.

One benefit is that new CPU variants would be part of the CFU Playground commit stream.
But, sharing outside of CFU Playground would be more difficult.
Also, breaking the fork relationship with pythondata_cpu_vexriscv means that it might be necessary to manually copy in upstream changes to build.sbt and GenCoreDefault.scala.

Dynamic generation of variants inside of CFU Playground (simply by requesting a new variant name that encodes the desired parameterization).   This would imitate to some degree what's done in pythondata_cpu_vexriscv_smp.   But we could have the generation and some pre-generated common variants directly within CFU Playground.   We'd need to be able to map all of the parameters from an encoded variant name -- for example, in Vex SMP, there's VexRiscvLitexSmpCluster_Cc1_Iw32Is4096Iy1_Dw32Ds4096Dy1_Ldw128_Cdma_Ood.v.   In CFU Playground, our list of VexRiscv parameters is even longer and still growing, but the name would only need to have the parameters that differed from the default.

@kgugala , I've realized that there are a number of problems with the implementation of https://github.com/google/CFU-Playground/pull/305 , so while parts of it might be adapted to one of the last two alternatives above, it won't go in as-is.

Perhaps https://github.com/google/CFU-Playground/issues/309 is a better place for any continued discussion / suggestions.

@tcal-x: My concern was mainly about the number of pre-generated variants added to the repository. A temporary approach could be to:

Integrate the CFU related changes to build.sbt and GenCoreDefault.scala to avoid having different version of this.
Also make sure to have the eventual CFU related changes integrated in LiteX/VexRiscv CPU wrapper.
Allow dynamic generation of variants in this repository when not already pre-generated (Which also be useful for non-CFU configuration).
While you are still refining the optimal CFU configurations, store the pre-generated variants in a different repository or branch. (Since pre-generated variants are large can pollute git repositories if just temporary).

For 4) if you are able in the end to limit the number of pre-generated versions you want to provide to user, I would be fine having them  directly in the main branch. But while this is still experimented, we could have the pre-generated version in a branch (that we could eventually delete later) or in a CFU specific dev fork that would be the main + just a different Makefile + more pre-generated variants.


Add a Python Library for parsing base64 url encoded strings

Feature request
Is your feature request related to a problem? Please describe.
I have a server running on a subdomain of my Supabase stack that wants to check that users are authenticated. I adapted the JS encoder/decoder repository to Python. Should it be kept around for others as a resource?
Describe the solution you'd like
Create a new supabase-community repository to keep a Python version of base64url-js.
Describe alternatives you've considered
None
Additional context
Here's my adaptation: https://gist.github.com/jfeaver/e67eaf5bb3a1f72ff7eb7d6563f380dc

A coworker just pointed out that this is probably already accomplished with the Python standard library and indeed it is.


arch: riscv: init all initial stack __esf members.

Initialize whole initial stack frame for thread.
This prevents from reading uninitialized data
when thread is scheduled in.
more info:
https://discord.com/channels/720317445772017664/733036686195294269/1229683697809363005

doesn't CONFIG_INIT_STACKS=y already do that?

doesn't CONFIG_INIT_STACKS=y already do that?

Isn't it only for interrupt stacks
In code I can see only
#ifdef CONFIG_INIT_STACKS
/* Populate z_interrupt_stacks with 0xaaaaaaaa */

doesn't CONFIG_INIT_STACKS=y already do that?

Isn't it only for interrupt stacks

It shouldn't be. This should apply to all stacks, and it initializes them to 0xaa, not 0x00:
https://github.com/zephyrproject-rtos/zephyr/blob/c2c95e18ed01b642b46b118f610b29f10a2227e3/kernel/thread.c#L469


How do I get proper highlighting (e.g. for python)?

I see that highlighting works if I replace
// replace this line
require('monaco-editor-core');
// with this line
import * as monaco from 'monaco-editor';

(and add monaco-editor as a dependency). But this breaks the client due to difference in interfaces.
This fails  even if I use monaco 0.12.0, same as used by monaco-languageclient.

@arogozhnikov Could you please show the errors caused by the “difference in interfaces”?

I'm using latest version of package
  "dependencies": {
    "express": "^4.15.2",
    "monaco-editor": "^0.12",
    "monaco-languageclient": "^0.6.3",
    "normalize-url": "^2.0.1",
    "reconnecting-websocket": "^3.2.2",
    "request-light": "^0.2.2",
    "vscode-json-languageservice": "^3.0.12",
    "vscode-languageserver": "^4.0.0",
    "vscode-uri": "^1.0.3",
    "vscode-ws-jsonrpc": "^0.0.2-1",
    "ws": "^5.0.0"
  },

ping. Any ideas?

Sorry, no. I have reproduced the problem but can't figure anything out off-hand. Hacking around it by casting it to any does work but that is of course not ideal.
const services = createMonacoServices(editor as any);

@rcjsuen ok, will try with casting.

i am facing the same issue. Syntax highlighting is not working when use monaco-editor-core with python language server. There is no basic languages support in monaco-editor-core. On replacing it with monaco-editor it is giving some weired error i.e. try appropiate loader
// replace this line
require('monaco-editor-core');
// with this line
require('monaco-editor');

Here is the error log -
ERROR in ../node_modules/monaco-editor/esm/vs/base/browser/ui/codiconLabel/codicon/codicon.ttf Module parse failed: Unexpected character '' (1:0) You may need an appropriate loader to handle this file type. (Source code omitted for this binary file)  @ ../node_modules/css-loader!../node_modules/monaco-editor/esm/vs/base/browser/ui/codiconLabel/codicon/codicon.css 7:463-487  @ ../node_modules/monaco-editor/esm/vs/base/browser/ui/codiconLabel/codicon/codicon.css  @ ../node_modules/monaco-editor/esm/vs/base/browser/ui/codiconLabel/codiconLabel.js  @ ../node_modules/monaco-editor/esm/vs/editor/standalone/browser/quickOpen/quickOutline.js  @ ../node_modules/monaco-editor/esm/vs/editor/edcore.main.js  @ ../node_modules/monaco-editor/esm/vs/editor/editor.main.js  @ ./lib/main.js error Command failed with exit code 2.
monaco-editor-core: 0.17.0
"monaco-editor": "0.19.0",

@rcjsuen Any update ?
Even i am getting this error

@rcjsuen Any update ?

@GNSubrahmanyam I am not actively looking at this issue so I have nothing to share.

Just in case anyone is searching for a solution for syntax highlighing without include the full monaco-editor:
// Replace lua with your language of choice :)

import { languages } from 'monaco-editor-core'
import { language, conf } from 'monaco-editor/esm/vs/basic-languages/lua/lua.js'

// To get the options, checkout the lanuage's contribution file. In case of lua:
//  `monaco-editor/esm/vs/basic-languages/lua/lua.contribution.js`
languages.register({
  id: 'lua',
  extensions: ['.lua'],
  aliases: ['Lua', 'lua'],
})
languages.setMonarchTokensProvider('lua', language)
languages.setLanguageConfiguration('lua', conf)

@arnoson thank you.


action: use multiple interpreters features from 'actions/setup-python@v4'

The nox action can be simplified now that setup-python allows to setup multiple interpreters natively.
This also adds support for ~ version specifier (e.g. ~3.12.0-0) which mostly should not be necessary as setup-python now supports allow-prereleases which transforms 3.12 into ~3.12.0-0 when searching for CPython 3.12.
The ~ specifier might be interesting for those who want a minimum patch version, e.g. ~3.11.1 <=> >=3.11.1 <3.12.

Awesome, thanks for doing this!


[Docs] User docs: Add 'Run as user' shortcut

Provide a description of requested docs changes
In PT v0.57.2 we have ne Features that requires an update of the user docs on docs.msft.

PowerToys Run page > Shortcut list: Add Run as different user shortcut Ctrl+Shift+U [#17283 , #1605]

@jaimecbernardo , @crutkas
Should this become a general issue?

What do you mean with general issue?
A list of all the doc changes needed?

A list of all the doc changes needed?

Yes. In the last releases we don't update docs continusly.

@jaimecbernardo
I decided to switch this into an issue for the shortcut only.

Can be marked as fix-committed.

Shipped with 0.58.0 (Hotfix for 0.57.2)


Experiencing crashing issues with beta1

Hi there,
I just thought I'd let you know I have had a number of crashing issues with the beta1 branch.

Despite the fact that it appears that SRWebSocketTransport is appropriately setting itself as the delegate of the SRWebsocket here, I periodically get a crash at this line, where it appears the delegate is now an NSDictionary instead of the SRWebSocketTransport, and since an NSDictionary doesn't respond to a selector of the form webSocket:didReceiveMessage: I get a crash. This is not consistently reproducible, it only happens every now and then.

Sometimes I get a crash on a particular line in SRLongPollingTransport, where for some reason the connectionToken is null, and since an NSDictionary is being created with a null object, we get a crash.

For these reasons I'm going to revert back to the alpha1 tag for the time being, which seems much more stable.

@tumatauenga we are in the process of adding test coverage and handling several error states in the transports.  You can find this progress on the feature-198 branch.

Seems to be resolved by bumping the version of SocketRocket.  SocketRocket was not maintaining a weak reference to the delegate
Should be resolved by https://github.com/DyKnow/SignalR-ObjC/commit/8af9694bc0f70b8540eb64e72325a682b8e18420

Please let us know if you have more success with feature-198

Thanks @abillingsley, I'm now on the beta3 branch, we're in regression for the next couple of weeks so I'll let you know how it goes.


README: broken description

README.md starts with:

This project contains Jakarta XML Web Services implementation, an implementation of Jakarta Web Services Metadata and Jakarta XML Web Services Specifications.

There must be 1 or 2 things wrong with that sentence.
By the way, the next sentence (This project is part of Eclipse Metro project.) also needs reviewing (presumably, just adding a "the").

Can you be more specific on what exactly do you think is wrong?

Not being in the author's mind, I cannot say what it should read, but I can certainly point out that for one thing, "Jakarta XML Web Services implementation" is not a nominal group. "Jakarta XML Web Services" or "[determiner] Jakarta XML Web Services implementation" would be, but that is not.
Considering the redundancy, perhaps the first occurrence of "implementation" is an error and should be removed, but at this point, I can't propose a concrete solution. Perhaps the most efficient way forward would be to have someone describe what metro-jax-ws is and someone (else) propose a way to phrase it.


doom daemon files gets changed after install

git change after install. Why?
-$HOME/.config/systemd/user/emacs.service
+/home/moritz/.config/systemd/user/emacs.service

Maybe the change is because doom asks for the env setup while installing?


dnx ef dbcontext scaffold json connection string?

Hi guys.
In EF6 I used edmx as I used database first. This then would let me update the database and have those changes reflect in the DB first classes with ease...
Now with EF7 dropping support for edmx I have had to move onto using the command:
dnx ef dbcontext scaffold "Data Source=:D"  EntityFramework.MicrosoftSqlServer -c "KudosDbContext" -o "Model" -p "Kudos.Data" -v -a
This works fine and scaffolds my models, but the connection string is hard coded into the generated file... I would right away go for the .json config file solution BUT I can't because if I re-generate the files it will wipe my configuration that replaces the hardcoded string.
Is there a proper way to do this?

Just found this article and now understand that they didn't just remove edmx... They've removed the concept of DB first and decided to go lightweight and pro code first.
http://blogs.msdn.com/b/adonet/archive/2014/10/21/ef7-what-does-code-first-only-really-mean.aspx
I feel like fighting the dev's design goals is probably a bad idea. I will move away from DB first and try to start working as a code first dev.
Feel free to leave any solutions to my problem in the comment section bellow though :)


WebMock failing on Codeship CI

@bblimke, I was having this same issue as here, only with CodeShip. All tests passing locally, but two failing when run in the CI app.
I added WebMock.disable_net_connect!(:allow_localhost => true), and my tests still passed locally, but nothing changed on CodeShip. I even reset the dependency cache and checked my test configurations and everything looked okay.
The strange thing is that I have four or five tests that are stubbing a request, yet only two of those tests are failing.
I am calling it with my my client_id and client_token from the API I'm using, but I'm not sure if that's what is causing the error or not, because why would some tests work and others not?
Any help would be much appreciated.

Solved, I'll respond later on what the issue was and my fix. It was on my side, which I kind of assumed from the beginning.

So it was a very trivial issue I was running into. All it had to do with was environment variables, and the fact that they were not getting called at all when run in production simply because I had not set them correctly.


extracting trajectory from images?

im trying to find a faster way to create orthomosaic maps from drone flight data. apparently map2dfusion is really nice for that, but it requires the trajectory of the images, so position (which i can get from gps) and the orientation as a quaternion. i tried using orb-slam but it doesnt cooperate at all.
so can i extract the trajectory using opensfm? (without doing the costly reconstruction step)

Finding the trajectory is the main task of the reconstruction process, so you can not get it without it.
For fast, real-time trajectory estimation you will need to use a SLAM tool. ORB-SLAM2 is a good one. That is assuming that you are capturing video.
I did not try the map2dfusion but I would assume that it does the reconstruction/SLAM part by itself. Could it be that only an approximate trajectory from the GPS is required as input?

i tried orb slam but the results are unusable, also its not a video, just random images taken with a drone.
it requires position and orientation. gps does not give me the orientation. and some images are taken horizontally, so i cant just say they all point down and hope for the best =/

ok, SLAM will not work for random images

Is there any way we can extract mosaic generated by Map2DFusion to external file?

No answer in a while, closing.


Support ChatML format and add GPT-NeoXT-Chat-Base-20B

ChatML format: https://github.com/openai/openai-python/blob/main/chatml.md
Prompting chatgpt and other chat models as follows:
<|im_start|>system
Translate from English to French
<|im_end|>
<|im_start|>user
How are you?
<|im_end|>
<|im_start|>assistant
Comment allez-vous?
<|im_end|>
<|im_start|>user
{{user input here}}<|im_end|>

Notes from discussion:

The open tag should really go in the prefix, not the suffix, but because of how the adapters work, it's not possible to get the indented result by doing this.

There are some scenarios that won't have the complete markup, because the scenario instance text can have structure that is opaque to us, we basically have to write a custom parser for each scenario. E.g. in quac we would like every answer to be marked as assistant, but we can't do this without writing a parser.

This generates malformed markup (i.e. unpaired tags) on some adapters and scenarios (particularly language_modeling), but that is fine because we're marking this as limited functionality, so those scenarios will be skipped.
We decided that chat models should not expose logprobs (for semantic reasons, not technical reasons), so this is a limited_functionality model, not a full_functionality model.

I'm okay with merging this PR as long as we're aware of the drawbacks.

Mypy type checking seems to be inferring the wrong type. You can fix this by adding a type annotation:
RUN_EXPANDER_SUBCLASSES: List[Type[RunExpander]] = [
    InstructionsRunExpander,
    PromptRunExpander,
    NewlineRunExpander,
    StopRunExpander,
    GlobalPrefixRunExpander,
    NumTrainTrialsRunExpander,
    MaxTrainInstancesRunExpander,
    NumOutputsRunExpander,
    ModelRunExpander,
    DataAugmentationRunExpander,
    TokenizerRunExpander,
    NumPromptTokensRunExpander,
    NumOutputTokensRunExpander,
    ChatMLRunExpander,
]

RUN_EXPANDERS = dict((expander.name, expander) for expander in RUN_EXPANDER_SUBCLASSES)

You'll also need to import Type from typing at the top of the file.
After making these changes, you can run mypy src and black src to run the type checker and linter respectively.

CI is saying:
src/helm/benchmark/run_expander.py:849:121: E501 line too long (123 > 120 characters)
Could you fix this and then rerun black src?
By the way, if you have a full developer environment set up, ./pre-commit.sh should catch these issues.

CI is saying: src/helm/benchmark/run_expander.py:849:121: E501 line too long (123 > 120 characters)
Could you fix this and then rerun black src?
By the way, if you have a full developer environment set up, ./pre-commit.sh should catch these issues.

CI is saying: src/helm/benchmark/run_expander.py:849:121: E501 line too long (123 > 120 characters)
Could you fix this and then rerun black src?
By the way, if you have a full developer environment set up, ./pre-commit.sh should catch these issues.

Sure! Thank you so much!

Thanks!


THRIFT-5570: update java lib document about gradle usage

update java lib document about gradle usage

[x] Did you create an Apache Jira ticket?  (not required for trivial changes)
[x] If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"?
[x] Did you squash your changes to a single commit?  (not required, but preferred)
[x] Did you do your best to avoid breaking changes?  If one was needed, did you label the Jira ticket with "Breaking-Change"?
[x] If your change does not involve any code, include [skip ci] anywhere in the commit message to free up build resources.

had to rebase to pickup fix from #2585


Fix deprecated attribute in terraform config

While working on #761, I came across the following warning about a deprecated attribute from terraform:

Warning: Deprecated Attribute
with google_container_node_pool.notebook["small"],
on cluster.tf line 199, in resource "google_container_node_pool" "notebook":
199:       node_metadata = var.config_connector_enabled ? "GKE_METADATA_SERVER" : "SECURE"
Deprecated in favor of mode.

This PR changes all (2) instances of the node_metadata attribute to mode and updates the values appropriately.
See terraform docs here: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster#mode

@damianavila That is an excellent question that I do not have the answer to. I think this came up as a "changes have happened outside terraform" though, so it may be that we only need to do a -refresh-only plan to get our state up-to-date.

Sorry @damianavila, do you mind reviewing again? I think I forgot to commit/push the changes I made to the values of node_metadata/mode as they changed with the new attribute too.

So at least for Pangeo, this would be a refresh-only change. That is to say, google has already made these updates upstream, and we are now making our terraform state match google's state. No redeploy is necessary.
Logs:
Note: Objects have changed outside of Terraform

Terraform detected the following changes made outside of Terraform since the last "terraform apply":
[snip]
  # google_container_node_pool.notebook["large"] has been changed
  ~ resource "google_container_node_pool" "notebook" {
        id                  = "projects/pangeo-integration-te-3eea/locations/us-central1-b/clusters/pangeo-hubs-cluster/nodePools/nb-large"
        name                = "nb-large"
        # (9 unchanged attributes hidden)

      ~ node_config {
            tags              = []
            # (12 unchanged attributes hidden)

          ~ workload_metadata_config {
              + mode          = "GKE_METADATA"
                # (1 unchanged attribute hidden)
            }
            # (1 unchanged block hidden)
        }

        # (3 unchanged blocks hidden)
[snip]
Unless you have made equivalent changes to your configuration, or ignored the relevant attributes using ignore_changes, the following plan may include
actions to undo or respond to these changes.

───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

No changes. Your infrastructure matches the configuration.

Your configuration already matches the changes detected above. If you'd like to update the Terraform state to match, create and apply a refresh-only plan:
  terraform apply -refresh-only

Steps to refresh the terraform state:
cd terraform/gcp
tf init -backend-config=../backends/<BACKEND_FILE> -reconfigure
tf plan -var-file=projects/<CLUSTER_FILE> -out=<PLAN_NAME> -refresh-only
tf apply <PLAN_NAME>

It is unfortunate that they also seem to have deprecated the SECURE setting 😕

Yep, I am worried about the implications of the new UNSPECIFIED setting...
@yuvipanda do you have any thoughts about this?
Btw, given this context: https://cloud.google.com/kubernetes-engine/docs/how-to/protecting-cluster-metadata#concealment, maybe we need to start thinking about abandoning the metadata concealment option?


fix: updated to<EMAIL_ADDRESS>in peerDependencies #12

Checklist

[x] commit message and code follows the Developer's Certification of Origin
and the Code of conduct

yup that is correct


viewer as cloud player

Hi
is it possible to make the viewer play successive point cloud frames ?
Thanks

+1

+1

+1

I got it to work by commenting the following lines in viewer.h (in void reply()):
qDebug() << "Viewer: received positions";

_points->loadPoints(positions);
// Comment the 3 following lines
//_camera = QtCamera(_points->getBox());
//_camera.setAspectRatio((float)width() / height());
//_floor_grid->setFloorLevel(_points->getFloor());
renderPoints();
renderPointsFine();
break;

I am not sure whether there are situations where it is necessary to reset the camera position after loading a new pointcloud. But this solution suits my use case.
After re-compiling, the following snippet will render a sequence of random pointclouds while maintaining the camera position:
import pptk
import numpy as np
import time

pointclouds = np.random.random([200, 1000, 3])

v = pptk.viewer(pointclouds)

for pc in pointclouds[1:]:
    time.sleep(0.1)
    v.load(pc)

(I share this as a workaround, not as a solution to the current issue)


Revamp - Change Entity Names

Change as follows
Tap -> Drink
Tap Location -> Tap
Brewery -> Brewery (no change)

The first attempt at this is complete. Will open this issue again if instances of the old names are found.


angular module

buggy semantics / feature request
What is the motivation / use case for changing the behavior?
(+) angular module is a singleton, it's constructor should behave as such;
(+) code clarity;
(-) the current implementation provides no benefit compared to the proposed one (on the contrary);
**tested with angular 1(.5.8) **
current behavior?
angular.module
the redeclaration of an angular.module is allowed, which goes against the fact that a module should be a singleton
var A=angular.module('moduleX',[]);
var B=angular.module('moduleX',[]);
console.log(A===B) //will print false

even worse -  redeclaring the module will render all the previous entities declared in this module inaccesible;
(function(){

	// factory moduleX.serviceA

	angular
	    .module('moduleX',[])
	    .factory('serviceA', serviceAInstanceGetter);

	function serviceAInstanceGetter() {
		return {
			func: func
		};

		function func() {
			return "serviceA.func"
		}
	}

})();

(function(){

	// factory moduleX.serviceB

	angular
	    .module('moduleX',[])
	    .factory('serviceB', serviceBInstanceGetter);

	function serviceBInstanceGetter() {
		return {
			func: func
		};

		function func() {
			return "serviceB.func"
		}
	}

})();
using moduleX as dependency in another module will return only what is contained in its latter declaration

/** test 1 **/
angular.module('test',['moduleX'])
.factory('testModuleX',["serviceA",function(serviceA){
return {test:function(){console.log(serviceA.func()) }}
}])
var moduleTest=angular.injector(['test']);
var test=moduleTest.get('testModuleX')
//will throw an error
// angular.js:4669 Uncaught Error: [$injector:unpr] http://errors.angularjs.org/1.5.8/$injector/unpr?p0=serviceAProvider%20%3C-%20serviceA%20%3C-%20testModuleX(…)

/** test 2 **/
angular.module('test2',['moduleX'])
.service('testModuleX',["serviceB",function(serviceB){
return {test:function(){console.log(serviceB.func()) }}
}])
var moduleTest=angular.injector(['test2']);
var test=moduleTest.get('testModuleX')

//this will print "serviceB.func" to the console
testB();

function testB(){
	var moduleX=angular.injector(['moduleX']);
	var serviceB=moduleX.get('serviceB');
	console.log(serviceB.func());
}

//this will throw an error upon retrieval of 'serviceA'
testA();

function testA(){
	var moduleX=angular.injector(['moduleX']);
	var serviceA=moduleX.get('serviceA')
	console.log(serviceA.func());
}

it is reasonable to expect that redeclaration of modules shouldn't work, they are sigletons ... aren't they ?
especially when one would divide entities for the same module across several files.
the (one) solution i'm currently using is
(function(){

/*to prevent redeclaration one has to use a construct like this one*/

	var module;
	try{
		module=angular.module('some.module');
	}catch(error){
		module=angular.module('some.module',['dependency1',,,'dependencyN']);
	}

/*and only here what is non trivial about this module*/

/*implementation*/
	module
		.directive('someDirective',someDirectiveConstructor)
		.directive('someOtherDirective',someOtherDirectiveConstructor);

	someDirectiveConstructor.$inject=["$http","$timeout"];
	someOtherDirectiveConstructor.$inject=["$interval","$window"];

/*implementation details*/
	/*@ngInject*/
	function someDirectiveConstructor($http,$timeout){
		//// ......
	}

	/*@ngInject*/
	function someOtherDirectiveConstructor($interval,$window){
		//// ......
	}
})()

however it will render the code less readable, one is forced to put implementation details in front. which would go (and for good reason i believe) against clean code principles ( see  john papa's angular style guide - section y023  )
take any angular directive that is published here (on github) and you would see how the non trivial meaning of a module is obscured by all the logic needed to get a hold of the target environment and eventualy the right module reference
proposed solution
prevent the redeclaration of the module
(function(){
	var _angularModule=angular.module;
	angular.module=createModuleIfNotExists;

	function createModuleIfNotExists(name,dependencies){
		var module;
		try{
			module=_angularModule('some.module');
		}catch(error){
			module=_angularModule('some.module',['dependency1',,,'dependencyN']);
		}
		return module;
	}
});

Thanks for this detailed issue @alfu32
We have talked before about the difficulties of the angular.module() method. In particular the danger of accidentally re-declaring the module (i.e. by including the dependency list), which as you point out deletes the previous module declaration completely.
Just to be clear - Angular 1 modules are not singletons. They are named containers of service, filters and directives, that are used to populate the injector. In this sense it is perfectly reasonable to create a new module with a given name, which would override any previous module. In this way they are more like ES6 modules than singletons. You would not expect to be able to import an ES6 module into your file and then be able to add more exports to that module, right?
I guess from reading your issue, that you like to write to your application code so that you just request the module that you care about and then add more stuff to it.  Personally I feel that this is an anti-pattern and I prefer to go the other way and make a rule that one should never "re-open" a module by calling angular.module() without the dependency list. Which I accept goes against the John Papa style guide.
This means that a module should only be accessed in one place in your application. The dependency mechanism helps a lot here as it means that you can always include a dependency upon another module rather than reopening it. I go further and ensure that I have a one-module to one-file bijection. Each module is wholly contained in exactly one file. If I find the file getting larger, I split the file, and so the module, into sub-files (and associated modules); then bring in those sub-modules via dependency.
This is what we did in https://github.com/angular-app/angular-app/tree/master/client/src and we found it worked well:

it reduces the effort to think about where things have to go
it makes it easier to move items around the project - or between projects - as everything is located in one place.
it makes it easier to see the dependencies between the different parts of the code base.
it also simplifies any build process you have as it doesn't require the files to be loaded into the browser in any particular order.

Regarding the suggested change to the current public API. This behaviour is how Angular 1 has worked for many years and it is well understood among most Angular 1 developers. I am afraid that changing this behaviour would be too much of a breaking change for Angular 1.

Thank you for being so kind to take the time to explain,
If I understood correctly  :
one should not declare a module that spans across several files ;
one module - one file.
example :
let's say i have a module 'tasklist', in a single file that had grown over an acceptable limit and accumulated to much responsibilities.
initial tasklist.js
(function(){
	angular
	.module('tasklist',[])
	.service('mailCnx',MailCnx)
	.directive('mailOnChange',MailOnChange)
	.service('dataStore',DataStore)
	.directive('storeOnChange',StoreOnChange)
	.provider('aceProvider',AceProvider)
	.directive('aceEditor',AceEditor)
		... injection and implementation details
})();

We decide to "split" it across several files :
-tasklist.js 				/*the initial module	*/
---tasklist.mail.js			/* 						*/
---tasklist.datastore.js	/* 	new modules			*/
---angular.ace.js			/* 						*/

keeping the original module in tasklist.js
(one solution) leave in the original file only the module declaration referencing the newly created  dependencies :
modified tasklist.js
	angular.module('tasklist',['tasklist.mail','tasklist.datastore','aceAngular']);

the other files
tasklist.mail.js
(function(){
	angular.module('tasklist.mail',[])
	.service('mailCnx',MailCnx).directive('mailOnChange',MailOnChange)
		... injection and implementation details
})();

tasklist.datastore.js
(function(){
	angular.module('tasklist.datastore',[])
	.service('dataStore',DataStore).directive('storeOnChange',StoreOnChange)
		... injection and implementation details
})();

angular.ace.js
(function(){
	angular.module('angular.ace',[])
	.provider('aceProvider',AceProvider).directive('aceEditor',AceEditor)
		... injection and implementation details
})();

That is right. By the way, you do not need the IIFE since you have no variables

one should not declare a module that spans across several files

"should" is probably a strong word here...just saying 😛

This is essentially a duplicate of https://github.com/angular/angular.js/issues/1779


Basket api

longclaw version: 0.1.0
Django version: 1.10.6
Python version: 3.6.0
Operating System: Linux (arch)

Description
Attempting to hack on the basket templates and api but seem to be unable to reach the api urls.
What I Did
I have tried sending POST and GET Requests to the few api commands that i felt i could use without having items in a basket yet. Im getting 404 errors.
from what i can tell the api url is just /api/ so the format of the url i am sending data to is localhost:8000/api/add_to_basket/
I have attached some of the command history from httpie tool
http://localhost:8000/products/> cd pencil/
http://localhost:8000/products/pencil/> get
HTTP/1.0 200 OK
Content-Type: text/html; charset=utf-8
Date: Wed, 29 Mar 2017 10:34:40 GMT
Server: WSGIServer/0.2 CPython/3.6.0
Set-Cookie:  csrftoken=ong9dNCJnKzs4X9DwkFDW36jRU5dyGbs45pd6rrCndOBO7qmk4UvPk9xGB2PV8W1; expires=Wed, 28-Mar-2018 10:34:40 GMT; Max-Age=31449600; Path=/
Vary: Cookie
X-Frame-Options: SAMEORIGIN

AttributeError: 'unicode' object has no attribute 'items'

Parse tree:
<Node called "action" matching "get">  <-- *** We were here. ***
    <RegexNode called "_" matching "">
    <Node called "method" matching "get">
        <RegexNode matching "get">
    <RegexNode called "_" matching "">
    <Node matching "">
    <Node matching "">
    <Node matching "">
    <RegexNode called "_" matching "">
http://localhost:8000/products/pencil/> cd /api/add_to_basket/
http://localhost:8000/api/add_to_basket/> X-CSRFToken:ong9dNCJnKzs4X9DwkFDW36jRU5dyGbs45pd6rrCndOBO7qmk4UvPk9xGB2PV8
W1
http://localhost:8000/api/add_to_basket/> post
HTTP/1.0 404 Not Found
Content-Type: text/html
Date: Wed, 29 Mar 2017 10:35:24 GMT
Server: WSGIServer/0.2 CPython/3.6.0
Vary: Cookie
X-Frame-Options: SAMEORIGIN

http://localhost:8000/api/add_to_basket/>

404 is unexpected, it suggest perhaps the longclaw urls are not registered? Have you setup the site using the longclaw project template (longclaw start) or otherwise included the longclaw URLs?
As a minimum add_to_basket should be passed variant_id in the request data. quantity can also be passed.
Some example JS I am using in my site (uses fetch)::
const csrf = JsCookie.get('csrftoken');
fetch(
'/api/add_to_basket/'
{
  method: 'POST',
  headers: {
      Accept: 'application/json, application/json, application/coreapi+json',
     'Content-Type': 'application/json',
     'X-CSRFToken': csrf
  },
  credentials: 'include',
  body: JSON.stringify({ variant_id: 1 })
})
   .then(...)

I will have a poke around with httpie and try to post an example.
The DRF interface is enabled, so you should be able to navigate to e.g. http://localhost:8000/api/add_to_basket/ to verify the URL is actually there.
If you want to change the prefix for the API urls, you can set API_URL_PREFIX in your settings.

I noticed you were using the django_rest_framework and that i should see the DRF Interface and im not on any of the api urls so i must have something wrong with my setup. I created this particular instance using the provided longclaw start. I will recreate my test project see if i can spot where i went wrong.

Okay so i have just tried to replicate the issue and i believe it may be with the project generated by ~longclaw start~, though I will have to integrate longlclaw into a base wagtail project to verify.
I have longclaw 0.1.0 installed in a local virtualenv.
longclaw start claw project is created.
./manage.py migrate make migrations and apply.
../manage.py createsuperuser - create superuser
./manage.py runserver run dev server on port 8000
server is running fine and display homepage template.
try to access any of the api urls and i get a 404.
I can verify that the project urls does seem to be importing the longlaw urls below
    url(r'', include(basket_urls)),
    url(r'', include(checkout_urls)),
    url(r'', include(shipping_urls)),
    url(r'', include(order_urls)),
]

Ok
I will compare the longclaw template with the setup for my own (working) project. I'll also setup the demo project (#17) which should highlight any issues to me

@Johnstone-Tech
Ok this is definitely a problem.
There are 2 things that need to be done which are not in the project template:

'rest_framework' needs to be added to the INSTALLED_APPS in your django settings
The longclaw URL's need to come before wagtail urls in your urls.py. I.e It should look something like:

    urlpatterns = [
    url(r'^django-admin/', include(admin.site.urls)),

    url(r'^admin/', include(wagtailadmin_urls)),
    url(r'^documents/', include(wagtaildocs_urls)),

    url(r'^search/$', search_views.search, name='search'),

    url(r'', include(longclaw_urls)),
    url(r'', include(wagtail_urls))
]

These are both currently neglected in the project template, so I will sort that out. I need to do further testing to make sure there arent any other related issues, but this should be get you up and running with testing the API.

@JamesRamm That did the trick, adding rest_framework and switching order of urls in settings.py got me going.

Great. I'll close this.
I have a slight concern about the ordering of installed apps (specifically whether the users products app should come before some longclaw apps), but I have not come across any issue yet in the demo project.


Use cross entropy loss function in the classification task.

Background
I am doing a binary classification task with BERT and I noticed that in the run_classifier.py file the loss function was not cross entropy. So I am re-writing the loss function with cross entropy but met minor issues of the dimension.
Codes concerning creating model
def custom_create_model(bert_config, is_training, input_ids, input_mask, segment_ids,labels, num_labels, use_one_hot_embeddings):
      model = modeling.BertModel(
      config=bert_config,
      is_training=is_training,
      input_ids=input_ids,
      input_mask=input_mask,
      token_type_ids=segment_ids,
      use_one_hot_embeddings=use_one_hot_embeddings)

    output_layer = model.get_pooled_output()

    hidden_size = output_layer.shape[-1].value

    output_weights = tf.get_variable(
      "output_weights", [num_labels, hidden_size],
      initializer=tf.truncated_normal_initializer(stddev=0.02))

    output_bias = tf.get_variable(
      "output_bias", [num_labels], initializer=tf.zeros_initializer())

    with tf.variable_scope("loss"):
        if is_training:
              # I.e., 0.1 dropout
            output_layer = tf.nn.dropout(output_layer, keep_prob=0.9)

        logits = tf.matmul(output_layer, output_weights, transpose_b=True)
        logits = tf.nn.bias_add(logits, output_bias)
        probabilities = tf.nn.softmax(logits, axis=-1)

#       Custom cross entropy loss function

        one_hot_labels = tf.one_hot(labels, depth=num_labels, dtype=tf.float32)

        print('Labels shape', tf.shape(labels))
        print('logits shape', tf.shape(logits))

        per_example_loss = tf.nn.softmax_cross_entropy_with_logits(labels=one_hot_labels, logits=logits)
        loss = tf.reduce_mean(per_example_loss)
        return (loss, per_example_loss, logits, probabilities)

Questions

why does BERT not use cross entropy in the classification task?
I want to penalizIe the false positives and false negatives so I used class weight calculator in Sklearn libraries to calculate the weights and broadcast to the loss

from sklearn.utils.class_weight import compute_class_weight
from sklearn.utils import class_weight
class_weights = class_weight.compute_class_weight('balanced',
                                                 np.unique(df['CII'].tolist()),
                                                 df['CII'].tolist())
...# in the create_model func:
per_example_loss = tf.nn.softmax_cross_entropy_with_logits(labels=one_hot_labels, logits=logits)
weighted_losses = per_example_loss * weights

loss = tf.reduce_mean(weighted_losses)

The weights become a parameter to be tuned anyway, not sure if anybody has some tactics on the tuning?

Hi, I am facing the same issue. Did you manage to find a solution for this problem. I want also to use cross entropy loss for a classification problem.

Hi, I am facing the same issue. Did you manage to find a solution for this problem. I want also to use cross entropy loss for a classification problem.

Yes, I just replaced the default loss function with a weighted cross entropy. What problems did you meet?


Insta banned lmao

you recomend a injector cuz i used extrem injector and i got insta banned when i went into a real match and if it was not the injector then idk the dll is detect

I use exloader most of the times to load cheats because it has VAC bypass but you should use any injector with stealth Injection/VAC bypass. I used the cheat on a non prime account  for over 2 months of cheating and it's still not banned.

I use exloader most of the times to load cheats because it has VAC bypass but you should use any injector with stealth Injection/VAC bypass. I used the cheat on a non prime account for over 2 months of cheating and it's still not banned.

ok i will try it (i used a prime account but it should not be a diff)

I use exloader most of the times to load cheats because it has VAC bypass but you should use any injector with stealth Injection/VAC bypass. I used the cheat on a non prime account for over 2 months of cheating and it's still not banned.

ok i will try it (i used a prime account but it should not be a diff)

You shouldn't use rage cheats on prime account because you will always get banned. Prime accounts are mainly targeted for vac bans.

I use exloader most of the times to load cheats because it has VAC bypass but you should use any injector with stealth Injection/VAC bypass. I used the cheat on a non prime account for over 2 months of cheating and it's still not banned.

ok i will try it (i used a prime account but it should not be a diff)

You shouldn't use rage cheats on prime account because you will always get banned. Prime accounts are mainly targeted for vac bans.

i mean i see people spin botting and doing all crazy stuff and it has been 2 months and they are still not banned so i am not worried

noob,add -allow_thirdparty_software to steam.but this cheat just only a piece of shit,even cant against common people^ ^


[REFACTOR] Move BWC tests to their own gradle build

Coming from https://github.com/opensearch-project/flow-framework/pull/551#discussion_r1516911231
Is your feature request related to a problem?
The build.gradle file is getting big and confusing to navigate.
What solution would you like?
Change our BWC setup (derived from AD and ML Commons setup) to the Security repo pattern.
See https://github.com/opensearch-project/security/blob/main/bwc-test/build.gradle
What alternatives have you considered?
Leave it as is, to reduce a lot of the duplication that will be required.
Refactor to a completely different model as some other plugins are doing.
Do you have any additional context?
It took several hours to get this working. I don't expect this will be a trivial exercise to move it.
Other possibilities mentioned in #551 review:

try to run on Windows
simplify some code in BWC test (and submit similar changes to AD and ML Commons)

KNN also has a good example of separating rolling and restart upgrade somewhere else: https://github.com/opensearch-project/k-NN/blob/2.x/qa/rolling-upgrade/build.gradle


Drag & Drop support on windows

yazi --debug output
-

Please describe the problem you're trying to solve
No file drag and drop support on Windows
Would you be willing to contribute this feature?

[ ] Yes, I'll give it a shot

Describe the solution you'd like
Would be great to support drag and drop on Windows platform
Additional context
No response
Validations

[X] I have searched the existing issues/discussions
[X] The latest nightly build doesn't already have this feature

Yazi is a TUI app, not a GUI, so drag-and-drop isn't possible, you would need to create a GUI window to make that work anyway.
To achieve it, you'd have to use third-party tools like ripdrag or dragon, but it seems they don't support Windows.
Closing as not doable in Yazi itself, yet there are no plans to create a completely new tool like ripdrag myself.