Are batch Actions and Functions supported?

Hi,
I am wondering if batch Actions and Functions are supported?
For example,
var client = new ODataClient("http://services.odata.org/V4/TripPinServiceRW/");
IList resultList = new List();
var batch = new ODataBatch(client);
        batch += async x =>
        {
            var result = await x.For("People")
                .Key("scottketchum")
                .NavigateTo("Trips")
                .Key(0)
                .Function("GetInvolvedPeople")
                .ExecuteAsEnumerableAsync();
            resultList.Add(result);
        };

await batch.ExecuteAsync();
Thanks!

Sure, it should work, any problems with that statement?

I am getting the error below:
{"error":{"code":"InternalServerError","message":"BatchSegment translation is not supported","innererror":{"message":"BatchSegment translation is not supported","type":"System.NotImplementedException","stacktrace":"   at Microsoft.Test.OData.Services.ODataWCFService.PathSegmentToExpressionTranslator.Translate(BatchSegment segment)\r\n   at Microsoft.OData.Core.UriParser.Semantic.BatchSegment.TranslateWith[T](PathSegmentTranslator`1 translator)\r\n   at Microsoft.Test.OData.Services.ODataWCFService.QueryContext.ResolveQuery(IODataDataSource dataSource, Int32 level)\r\n   at Microsoft.Test.OData.Services.ODataWCFService.Handlers.QueryHandler.Process(IODataRequestMessage requestMessage, IODataResponseMessage responseMessage)\r\n   at Microsoft.Test.OData.Services.ODataWCFService.Handlers.RequestHandler.Process(Stream requestStream)\r\n   at Microsoft.Test.OData.Services.ODataWCFService.Handlers.RootRequestHandler.Process(Stream requestStream)"}}}
I am guessing in this case, the TripService is not supporting it?

I just tested similar code (only with typed syntax), and it worked fine against sample TripPin service at odata.org. I will check your code now.

No, it works fine for me. This is payload from Fiddler:
POST http://services.odata.org/V4/(S(ozr3zphuz0ptbrrzc23kb121))/TripPinServiceRW/$batch HTTP/1.1
Content-Type: multipart/mixed; boundary=batch_b80abd80-5383-4556-9cee-8f57378b1b13
Host: services.odata.org
Content-Length: 358
Expect: 100-continue
--batch_b80abd80-5383-4556-9cee-8f57378b1b13
Content-Type: application/http
Content-Transfer-Encoding: binary
GET http://services.odata.org/V4/(S(ozr3zphuz0ptbrrzc23kb121))/TripPinServiceRW/People(%27scottketchum%27)/Trips(0)/Microsoft.OData.SampleService.Models.TripPin.GetInvolvedPeople() HTTP/1.1
--batch_b80abd80-5383-4556-9cee-8f57378b1b13--

Looks like I am getting 2 different batch calls are being made and it is failing on the second call. Do you think I am running the batch above incorrectly?
First payload:
POST http://services.odata.org/V4/TripPinServiceRW/$batch HTTP/1.1
Content-Type: multipart/mixed; boundary=batch_222cb962-296c-446f-aba3-8b378f286ed0
Host: services.odata.org
Content-Length: 328
Expect: 100-continue
--batch_222cb962-296c-446f-aba3-8b378f286ed0
Content-Type: application/http
Content-Transfer-Encoding: binary
GET http://services.odata.org/V4/TripPinServiceRW/People('scottketchum')/Trips(0)/Microsoft.OData.SampleService.Models.TripPin.GetInvolvedPeople() HTTP/1.1
--batch_222cb962-296c-446f-aba3-8b378f286ed0--
Second payload:
GET http://services.odata.org/V4/(S(5tmpzxar450dlw1jgk5w2rsr))/TripPinServiceRW/$batch HTTP/1.1
Content-Type: multipart/mixed; boundary=batch_222cb962-296c-446f-aba3-8b378f286ed0
Host: services.odata.org
Cookie: ARRAffinity=7f4cfe00ce16676343cb49cea0f403e97155c6d542bba19d699062aa8aee04c6

The second call causes the WebRequestException to be thrown from RequestRunner.cs.
private async Task PostExecute(HttpResponseMessage responseMessage)
{
if (_session.Settings.AfterResponse != null)
_session.Settings.AfterResponse(responseMessage);
        if (!responseMessage.IsSuccessStatusCode)
        {
            throw await WebRequestException.CreateFromResponseMessageAsync(responseMessage);
        }
    }

Exception message is: Internal Server Error
Exception reponse is:
{"error":{"code":"InternalServerError","message":"BatchSegment translation is not supported","innererror":{"message":"BatchSegment translation is not supported","type":"System.NotImplementedException","stacktrace":"   at Microsoft.Test.OData.Services.ODataWCFService.PathSegmentToExpressionTranslator.Translate(BatchSegment segment)\r\n   at Microsoft.OData.Core.UriParser.Semantic.BatchSegment.TranslateWith[T](PathSegmentTranslator`1 translator)\r\n   at Microsoft.Test.OData.Services.ODataWCFService.QueryContext.ResolveQuery(IODataDataSource dataSource, Int32 level)\r\n   at Microsoft.Test.OData.Services.ODataWCFService.Handlers.QueryHandler.Process(IODataRequestMessage requestMessage, IODataResponseMessage responseMessage)\r\n   at Microsoft.Test.OData.Services.ODataWCFService.Handlers.RequestHandler.Process(Stream requestStream)\r\n   at Microsoft.Test.OData.Services.ODataWCFService.Handlers.RootRequestHandler.Process(Stream requestStream)"}}}

I also forgot to add that when it returns to this line:
resultList.Add(result);
result is an empty enumeration.

Can you move the line resultList.Add(result) out of the batch scope? Just to see if it changes anything. Since I am not able to reproduce the error you can also send me a small example that fails in this manner (my mail is vagif.abilov at gmail).

Hi,
I have just emailed you the source code to reproduce.
Thanks.

I tested it. The problem occurs because that site rewrites the original URL and gives back something like http://services.odata.org/V4/(S(dejg0qsxxm4cj1m1sraqen34))/TripPinServiceRW/, so in my integration tests I first execute a request, check response and correct URI accordingly. Then subsequent requests work. If you try to execute batch POST request, the service will return HTTP 302 to redirect request to a new URL, but then the next request issues batch in a GET request instead of POST. And this causes 500 error. If you change base service URI as I am doing in my tests, it should work.

That does make sense. Thanks for your precious time in helping me work that out!

Hi,
I do have another question related to the above. When performing the following:
batch += async x =>
{
var result = await x.For("People")
.Key("scottketchum")
.NavigateTo("Trips")
.Key(0)
.Function("GetInvolvedPeople")
.ExecuteAsEnumerableAsync();
resultList.Add(result);
};
why is "result" always assigned with an empty enumerable before coming back with the "real" enumerable? It's as if the method is being called once but results are being returned twice. So, if I have a for loop as below,
for (int i = 0; i < 2; i++)
{
batch += async x =>
{
var result = await x.For("People")
.Key("scottketchum")
.NavigateTo("Trips")
.Key(0)
.Function("GetInvolvedPeople")
.ExecuteAsEnumerableAsync();
resultList.Add(result);
};
}
resultList would have 4 sets of enumerables rather than 2.
Thanks in advance!

Although this behavior is incorrect, it has its reasons. Batch actions are executed twice but in a different manner: when you build a batch with "+=" operator, the actions are recorded but not executed. Then when you call batch.ExecuteAsync() the program sends the request to the server, receives response and finally executes actions for real. I will check why resultList.Add(...) is executed both times instead of being skipped during recording phase, but as a simple workaround you can just move it from the batch scope.

Does the workaround mean that if I have a for loop that returns the results x amount of times, I would need x number of different variables to store each result? It seems that all your examples for batch in your unit tests stores them in separate variables such as product1 and product2.

Yes it does but I will look into how to allow the syntax you were using.

Thank you!

I investigated this case more, and apparently there is nothing I can do using current implementation. All batch actions are executed twice: first time recording the batch steps, then processing batch results. The batch "+=" operator just accumulates lambdas, they are obscure, so if the lambda includes some custom actions (not related to OData HTTP operations), there is no way to prevent them, and they will be executed twice. So the workaround is to use the style I am using in my tests and restrict batch action steps to method calls on IODataCleint interface.

Ok. I will workaround it then. Thanks for your time.


[FEATURE] Introduce a pipeline to use the HPC architecture

Using distribute2mp for sct_pipeline so parallel computing is the same on localhost and HPC

I have also added "Status Legend - " in the report output, it is less confusing that "Status :" alone.

Tested on guillimin (centos HPC) /bireli (debian) and my laptop (ubuntu).
Need to install the sct with the new --mpi (or -p) option.

I've tested version poq_issue_1181/199eeb7cf4d4147100609658e46181832a11bb04, and I see a problem with the passing of output in case of error happening in the test_XXX file. Example below:
sct_pipeline -f sct_propseg -d ~/sct_example_data/ -p \"-i t2.nii.gz -c t2\"

--
Spinal Cord Toolbox (poq_issue_1181/199eeb7cf4d4147100609658e46181832a11bb04)
Running /Users/julien/code/sct/scripts/sct_pipeline.py -f sct_propseg -d /Users/julien/sct_example_data/ -p "-i t2.nii.gz -c t2"
Check folder existence...
Testing started on: 2017-06-05 13:05:24
SCT commit/branch: 199eeb7cf4d4147100609658e46181832a11bb04/poq_issue_1181
OS: osx (Darwin-14.5.0-x86_64-i386-64bit)
Hostname: julien-macbook.neuro.polymtl.ca
CPU cores: 8
RAM: Primary memory available: 16.00 gigabytes

Command: "sct_propseg -i t2.nii.gz -c t2
Dataset: /Users/julien/sct_example_data/

GLOBAL RESULTS:
Duration: 0s
Passed: 0/4
Crashed: 4/4
Mean: {'dice_segmentation': nan}
STD: {'dice_segmentation': nan}

DETAILED RESULTS:
  subject  dice_segmentation  status
0    dmri                NaN       1
1      mt                NaN       1
2      t1                NaN       1
3      t2                NaN       1
Status Legend - 0: Passed | 1: Crashed | 99: Failed | 200: Input file(s) missing | 201: Ground-truth file(s) missing

In this example, the following error should be displayed:
ERROR: when extracting the contrast folder from input file in command line: t2.nii.gz for XXX

@poquirion: when testing on Compute Canada, how many CPU should you ask for in the qsub? Can you please send us a dummy example for the qsub script?

@jcohenadad
You can ask for N+1 cpu for the N cores requested by sct_pipeline. That is, on guillimin
[...]
#PBS -l procs=N+1
[...]
sct_pipeline  -f sct_propseg -d data  -p  \"-i t2s/t2s.nii.gz  -c t2\" -cpu-nb N

@poquirion:
I've tried this:
#!/bin/bash
#PBS -l procs=N+1
#PBS -A rrp-355-aa
#PBS -m bea
#PBS -M<EMAIL_ADDRESS>#PBS -o output.txt
#PBS -e error.txt
export PATH_DATA="/home/jcohen/data/sct_test_function/"
cd $SCRATCH
sct_pipeline -f sct_propseg -d $PATH_DATA -p \"-i t2/t2.nii.gz -c t2\" -cpu-nb N

It gave me this:
qsub: submit error (Illegal attribute or resource value for Resource_List.procs)

Any idea what went wrong?
Thx

Well N should be a number ;)! Let say half or a fourth the numbers of subjects you have in $PATH_DATA.

oooops... that's why i asked for a dummy qsub batch --> for dummy people like me ;-)
anyways, it worked, but i am wondering what the "CPU cores: 12" refers to with the mpi activated, since it doesn't seem to match the asked number of cores (8 here). Here is my qsub batch:
#!/bin/bash
#PBS -l procs=9
#PBS -A rrp-355-aa
#PBS -m bea
#PBS -o output.txt
#PBS -e error.txt
export PATH_DATA="/home/jcohen/data/sct_test_function/"
cd $SCRATCH
sct_pipeline -f sct_propseg -d $PATH_DATA -p \"-i t2/t2.nii.gz -c t2\" -cpu-nb 8

And here is the result:
Spinal Cord Toolbox (poq_issue_1181/182b5d9e3c01c609e7325ff2f0ac551374b5fdde)
Sourcing sct_laucher in your environement /home/jcohen/sct
Check folder existence...
Testing started on: 2017-06-06 16:27:40
SCT commit/branch: 182b5d9e3c01c609e7325ff2f0ac551374b5fdde/poq_issue_1181
OS: linux (Linux-2.6.32-642.13.1.el6.x86_64-x86_64-with-centos-6.6-Final)
Hostname: sw-2r10-n31
CPU cores: 12
RAM: MemTotal:       37003668 kB
total       used       free     shared    buffers     cached
Mem:         36136       9591      26545          0         88       1784
-/+ buffers/cache:       7718      28418
Swap:        42711         76      42635

Command: "sct_propseg -i t2/t2.nii.gz -c t2
Dataset: /home/jcohen/data/sct_test_function/

GLOBAL RESULTS:
Duration: 72s
Passed: 3/5
Crashed: 1/5
Mean: {'dice_segmentation': 0.8974604931058585, 'duration [s]': 54.27739925384522}
STD: {'dice_segmentation': 0.08983015356685584, 'duration [s]': 7.992110587842794}

DETAILED RESULTS:
             subject  dice_segmentation  duration [s]  status
0         200_005_s2           0.945733     59.337154       0
1    20150910_joshua           0.762903     52.957869      99
2           amu_G1_6                NaN           NaN     200
3           amu_G1_7                NaN           NaN     200
4           amu_G1_8                NaN           NaN     200
5           bwh_CIS1                NaN           NaN     200
6           bwh_CIS2                NaN           NaN     200
7           errsm_42           0.945600     59.769126       0
8            sct_002           0.935606     58.475603       0
9            sct_004                NaN           NaN     201
10           sct_005                NaN           NaN     201
11           sct_006                NaN           NaN     201
12     vanderbilt_05                NaN     40.847244       1
13  xuanwu_chenxi_01                NaN           NaN     200
Status Legend - 0: Passed | 1: Crashed | 99: Failed | 200: Input file(s) missing | 201: Ground-truth file(s) missing

The CPU cores: 12 is just the number of core on the machine where the master process is started. On Guillimin this number will always be 12 or 16, no matter how many core you request. We should perhaps not print that entry in mpi mode.

indeed, we should not print that in mpi mode (or print the correct number of cores used)

i will approve this PR, but please address those two points in the future:

systematic redirection of "output" in case of error, and creation of subject-specific log file (done at the parent process instead of within testing)
display the correct CPU core in case using --mpi
doc
add template files for easy testing


First cut at including Thorntail

Please especially @kenfinnigan have a look

@kenfinnigan You know TT so much better than I do. I found this as a solution to set the context root, so I used it.
How/were would I use the project-defaults.yml? Is that a TTv2 thingy?

so project-defaults.yml can be added to src/main/resources with content like:
swarm:
  context:
    path: '/mp-servicemesh-sample/serviceA'

That should do what you need, and it works in v2

@kenfinnigan The "downside" of project-defaults.yml in src/main/resources/is that this would also be copied into a liberty (or other server) deployment, while the current approach has the file in src/main/profiles/thorntail/ and is thus more 'isolated'.

Sorry, I wasn't necessarily meaning the file had to be in src/main/resources but that it needs to be processed like it is.
Having it in a custom Thorntail folder that gets added to the /target directory on build is fine.


df.apply has problems storing tuples into new column

I am quite perplexed about this:
A function applied to rows of dataframes that returns a tuple throws an error if the result is stored into a new column, but does not if the column already exists? This does not happen if I return just a number.
Get the example notebook here:
https://gist.github.com/a83ed19c43fe2eaac6a4
or see it here:
https://nbviewer.jupyter.org/gist/michaelaye/a83ed19c43fe2eaac6a4
Using master pandas. ('0.16.2+442.g24c147a', 24c147a369d4)

you asked the same question here: https://github.com/pydata/pandas/issues/10399
my answer stands. I find this odd that you are trying to shoe-horn a tuple into a column anyhow. Just use a loop and concat if you really want to do that. .apply is already way over complicated.

I'm sorry, forgot about the older issue.
I don't understand your shoe-horn comment. I need to store tuples because they, together, define the status of an observation. This is not a weird way to create Series, I need to store the tuples themselves.

So, from the older issue it is clear that the re-interpretation as a Series is what throws off the apply process. How can I prevent that interpretation and let pandas know to just store the tuple? Interestingly, it works when the column exists without a problem, which is why I reported it as an oddity.

Just do this. I mean .apply will see that you are returning an iterable, which violates what .apply does.
In [42]: df['new_col'] = [ tuple(row[col] for col in ['SPE_OFS', 'SPE_SIZE', 'SPA_OFS', 'SPA_SIZE']) for _, row in df.iterrows() ]

In [43]: df
Out[43]:
   SPE_OFS  SPE_SIZE  SPA_OFS  SPA_SIZE       new_col
0        3         1        4         1  (3, 1, 4, 1)
1        3         4        1         1  (3, 4, 1, 1)
2        2         3        1         1  (2, 3, 1, 1)
3        4         3        2         2  (4, 3, 2, 2)
4        3         2        3         4  (3, 2, 3, 4)
5        4         2        3         1  (4, 2, 3, 1)
6        4         2        4         3  (4, 2, 4, 3)
7        3         2        2         3  (3, 2, 2, 3)
8        1         1        3         4  (1, 1, 3, 4)
9        2         2        2         3  (2, 2, 2, 3)

ah darn, thanks. Sometimes it's easier than one thinks.


Fix preserve ordering

@GuanLuo  I see why this is more complex than I originally thought... I'm also thinking that there is something more fundamental that needs to be added to request/response to more easily support this case. Let me think about this some more and I might take over this PR next week.


[Bug]: Termius version is not correct

Prerequisites

[X] I have written a descriptive issue title.
[X] I have searched all issues/PRs to ensure it has not already been reported or fixed.
[X] I have verified that I am using the latest version of Scoop and corresponding bucket.

Package Name
termius
Expected/Current Behaviour
The version is not the latest version but the hash is correct. Users cannot update the app but can fresh install the app.
Checkver.ps1 works and can auto update the manifest file. It seems that the bot had not update this app. #10602 updated the hash but did not update the app version.
Steps to Reproduce
scoop update termius

Possible Solution
Update the manifest file and change the version to 7.56.3.
Scoop and Buckets Version
PS> scoop --version
Current Scoop version:
v0.3.1 - Released at 2022-11-15

'extras' bucket:
a94065816 (HEAD -> master, origin/master, origin/HEAD<EMAIL_ADDRESS>Fix hash (Closes #10620)

'java' bucket:
8ac344ed (HEAD -> master, origin/master, origin/HEAD) temurin19-nightly-jdk: Update to version 19.0.2-7.0.202302250348

'main' bucket:
5e254d482 (HEAD -> master, origin/master, origin/HEAD) x265: Update to version 3.5+95-38cf1c3

'nonportable' bucket:
bfb3c02 (HEAD -> master, origin/master, origin/HEAD) spotx-np: Update to version 1.7-20230226-02533c

'versions' bucket:
e0ee459ae (HEAD -> master, origin/master, origin/HEAD) firefox-nightly: Update to version 112.0a1.20230226094119

Scoop Config
PS> scoop config

shim                  : kiennq
last_update           : 2023/2/27 0:10:50
aria2-enabled         : True
aria2-warning-enabled : False
scoop_branch          : master
scoop_repo            : https://github.com/ScoopInstaller/Scoop

PowerShell Version
PS> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.3.3
PSEdition                      Core
GitCommitId                    7.3.3
OS                             Microsoft Windows 10.0.22623
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           <IP_ADDRESS>
WSManStackVersion              3.0

Additional Softwares
No response

https://github.com/ScoopInstaller/GithubActions/issues/32

Termius is now at the correct version, https://github.com/ScoopInstaller/Extras/blob/master/bucket/termius.json


Vector expression functions cross, dot, maybe others, don't work on 2D data

Describe the bug
The expression system has vector functions to perform dot-product, cross-product, etc. These appear to not give valid results for 2D mesh inputs. Even if you elevate a 2D mesh with zero height, making it a bonified 3D plot, you don't get expected results. You either get error messages during expression evaluation or you get a blank plot (not a plot yielded no data plot but just a blank window)
A user can work-around this problem by coding the expressions manually. But, that is a pain.
To Reproduce

Open noise2d.silo
PC plot hardglobal
Create a vector variable with a non-zero Z component. This might be from crossing electric and magnetic fields in 2D mesh for example.
Vector plot of the vector variable you created in 3

You get either an error message or a blank plot

Transform the 2D mesh by either elevate or rotating around x axis 90 degrees. Then, you get the 3D vector result you expect.

In re-reading this, it hadn't occurred to me that maybe the problem is NOT with the expressions but is instead with the 2D view/window being able to plot objects with non-zero Z coordinate. So, maybe the expression system works fine and what is failing is the plotting part.


BTW, looking at the previous code, it seems odd to randomly kill() or int(). It would be better to signal first, and terminate after a moment (say 5 * time.Millisecond). I would also use SIGTERM signal instead of SIGINT, since SIGINT means: "interrupted from the keyboard".

Right, the kill timeout should be 2 * timeout. I feel bad for breaking this. Could you make that change as well please?
You could handle TERM and INT if you like, but we do use INT while running locally.

Fixed in #1827


11-add-support-for-aws-awsmanagedrulesbotcontrolruleset-overrides

closes: #11
Objective
Add support for new overrides for regex_match_statement.
Type

[ ] Bug Fix
[x] New Feature
[ ] Performance Tweaks
[ ] Style Tweaks
[x] Code Refactoring
[ ] Documentation
[ ] Tests

Work Done
Added additional dynamic blocks to support inputs for regex_match_statement.
Tested
Deployed and verified settings in console.

@tsaucier-sf
Lookup functions is deprecated which is been shown in tflint. There is a GH issue already created for that
https://github.com/sourcefuse/terraform-aws-arc-waf/issues/10


⚠ Processors has degraded performance

In 661c390, Processors ($STATUS_URL) experienced degraded performance:

HTTP code: 200
Response time: 56 ms

Resolved: Processors performance has improved in 1e499c2.


I corrected the translation so it makes sense

I corrected some of the translation since some of the words were on bad order
There was a word (lightness) that was translated in different ways so it was confusing to read the instructions for the challenge so I choose one translation and stick the instructions to it

[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 the contribution. Previous PRs modified this file and fixed a bunch of issues. If you still see any, please open a PR against the latest version of the file — I'm closing this one.


Add LinearRegressionExampleGenerator

Codecov Report
Attention: 1 lines in your changes are missing coverage. Please review.

Files
Coverage Δ

src/startorch/example/__init__.py
100.00% <100.00%> (ø)

src/startorch/example/regression.py
98.11% <96.96%> (-1.89%)
:arrow_down:

:loudspeaker: Thoughts on this report? Let us know!.


Refactor DispatcherEnv our of the Reactor

This introduces a new Scheduler module that that takes much of the code previously in the Dispatcher and removes the channel interface between the reactor and the dispatcher. Instead, explicitly calls to the Scheduler are made to queue requests.
closes #835

@alanz are you ok with merging this?

I would like to take a proper look, when I can concentrate.  It may be a few days.

@lorenzo is this up to date? I want to start looking at it.

Yes, it is up to date, a few commits behind, but nothing relevant in master that would affect this @alanz

LGTM, thanks. I reckon we can merge when the CI passes

I'll merge now, tests passed for circle-ci


Remove bower directory creation

@czue

this just wasn't needed?

nvm saw https://github.com/dimagi/commcarehq-ansible/commit/25c1aefa06a8fe3218af5b50a4fd0e4ccdbf09f8#commitcomment-13907064


Update Getting started Doc, rename docker-compose.yml to docker-stack.yml

File: get-started/part3.md, CC @johndmulhausen
The docker-compose.yml is usually used with docker-compose, so seeing this name used for docker stack confuses people.
Even I no more know what to think!
Is docker-compose project deprecated? or we can still use it with newest docker version?
can we use the example of docker-compose.yml file shown in this documentation with docker-compose or no?

I know that it is a bit confusing, but think about it this way:

docker-compose.yml is a specification
docker-compose is a tool that can receive a docker-compose.yml file as input and do things based on what the file describes
docker stack deploy is also a tool that can receive a docker-compose.yml file as input and do things based on what the file describes

Both docker-compose and docker stack deploy support a subset of the docker-compose.yml specification, so there's a few keywords that will be ignored or create warnings depending if you're using one tool or the other.
The other thing to know is that docker-compose doesn't leverage swarm features. As an example, if your docker-compose.yml file describes several services, all of them will be deployed in the same node.
Contrast this with docker stack deploy. It is aware of all the nodes that are part of your swarm and as such will spread your services through all your nodes.

Thanks for explanation. I think it would be good to make some clarification in that documentation too, to make it more clear and less confusing.

@joaofnfernandes @Lev09 I've added an explanation per the referenced PR ^^. I tried to make it brief so as not to interrupt the flow of the tutorial, but with enough context to help clarify things. See what you think.

@londoncalling thanks for addressing this, since I've had to explain this to a lot of people. The whole docker-compose, compose file, stack, ... is confusing when you're getting started, and it doesn't help that we use the same names for different things.

@joaofnfernandes , agreed


When project runs I get a blank page without wordpress wizard

I have followed the installation, is there any additional step that I should do?

What version of node are you running? I recommend v7+
Screencast Installation

My version is 7.10.0

Maybe I need a database but I don't know how to connect at the project...

If you follow the installation correctly there are no issues.


Al compilar para web desaparece el boton de impresoras

Hello Rogerio,
I just compile triagem-touch for web ( npm run build:web)
Then I opened index.html and noticed that printer select list have dissapeared.
Any clue about it?
Regards,
Juan

The printer list is a native feature (Electron), doesn't work on web browser.

How can I use Triagem Touch Web, it does not print from Firefox.


add support for region prompts

The new UNet wrapper used for alternatives has most of the code necessary to track views/tiles and switch prompts for certain regions of the image. This is the second pipeline described in the multidiffusion paper, but should probably be implemented as part of panorama, so that very large images can be prompted in parts.

This has been added and documented in the user guide.


Add translator credits

Also updated README.md, added info about po/CREDITS.json and how to test translation in GNOME Builder.

Could you add the credits for the Spanish translation that was just merged?

Could you add the credits for the Spanish translation that was just merged?

Done :)


[Idea]: Allow upload avatars for admin accounts.

As storage, we can use S3 or store base64 in DB, because the image size is too small and it must fast load with base64.

@LWJerri - By the end of March, we will have moved the admin project to our core monorepo, and maintenance of this repository will come to a halt shortly after. Therefore, please move your feature request (if still relevant) to our GitHub Discussions - not issues - to centralize requested improvements for all our projects.
Could I ask you to re-open your request here: https://github.com/medusajs/medusa/discussions/categories/feature-requests
Thanks!


Place chooser recognizes a, A, and á but not Á

The place chooser doesn't seem to be able to find places that start with Á such as 'Área de Protección de Flora y Fauna Cuatro Ciénegas'

@loarie looks like this might be working now. Could you confirm?

Doesn't look like it - https://www.inaturalist.org/places/66912 has name:
Área de Protección de Flora y Fauna Cuatro Ciénegas
But I can't get the place search to return it

Yeah I guess you're right. I was able to search with that character and found this place and rushed to assume it was the same.

Since this one starts with that same character, there must be some other problem indexing that place name.


[Coverity CID :190957]Incorrect expression in /tests/kernel/fatal/src/main.c

Static code scan issues seen in File: /tests/kernel/fatal/src/main.c
Category: Incorrect expression
Function: check_stack_overflow
Component: Tests
CID: 190957
Please fix or provide comments to square it off in coverity in the link: https://scan9.coverity.com/reports.htm#v32951/p12996

I set this in Coverity as a false positive, it thought there might be side effects of reading a volatile variable (in case it was some MMIO thing) but that wasn't the case here.


⚠ Bofrost.lu has degraded performance

In 80058e0, Bofrost.lu (https://www.bofrost.lu) experienced degraded performance:

HTTP code: 200
Response time: 1450 ms

Resolved: Bofrost.lu performance has improved in ab36c9d after 6 minutes.


Invalid chain segment tracker

Describe the feature
Currently we have the InvalidHeaderCache:
https://github.com/paradigmxyz/reth/blob/5595ae9a7838dfa7b2e485e2b56715e062c3b604/crates/consensus/beacon/src/engine/mod.rs#L964-L967
This is good for tracking individual invalid headers, but we need a way to track entire invalid chain segments, for example consider the following chain:
A (valid) -> B (invalid) -> C -> D -> E

If a forkchoiceUpdated is sent with E as the head block, we should execute up to B. Once we learn that it's invalid, we need to mark it as invalid, as well as [C, D, E]. The pipeline should then unwind to its previous state, before the fork choice update was issued.
If a newPayload is sent with C as a parentHash, or if a forkchoiceUpdated is sent with any of these blocks as head, safe, or finalized fields, we need to return an INVALID engine API response.
Additionally, when crafting the newPayload response, we need to make sure we populate the correct latestValidHash, which should be A according to the Engine API spec:

If validation fails, the response MUST contain {status: INVALID, latestValidHash: validHash} where validHash MUST be:

The block hash of the ancestor of the invalid payload satisfying the following two conditions:

It is fully validated and deemed VALID
Any other ancestor of the invalid payload with a higher blockNumber is INVALID

Currently, the InvalidHeadersCache does not have the capability to track the first invalid ancestor. This would be needed to populate latestValidHash correctly. Currently, we just populate the latestValidHash with the parent hash of the invalid block:
https://github.com/paradigmxyz/reth/blob/5595ae9a7838dfa7b2e485e2b56715e062c3b604/crates/consensus/beacon/src/engine/mod.rs#L318-L326
This is incorrect: If the invalid block is C, then its parent is B, which is also invalid.
Geth accomplishes this with an InvalidTipsets map:
https://github.com/ethereum/go-ethereum/blob/c57b3436f4b8aae352cd69c3821879a11b5ee0fb/eth/catalyst/api.go#L96-L117
Depending on where the block is being validated, we may or may not have the entire chain of invalid child hashes available in memory, or the chain segment could be very large, so this requires some design.
We could either attempt to keep the LRU cache property of our InvalidHeadersCache data structure, or find some other way to limit its size.
cc @mattsse
Additional context
No response

maybe we can just do this:
/// Keeps track of invalid headers.
struct InvalidHeaderCache {
    /// This maps a header hash to its own header, and a reference to its invalid ancestor.
    headers: LruMap<H256, (Header, Arc<Header>)>,
}

and return the parent of the Arc'd header as the latestValidHash

we only use the values here for the latestValidHash, so it might be simpler:
/// Keeps track of invalid headers.
struct InvalidHeaderCache {
    /// This maps a header hash to a reference to its invalid ancestor.
    headers: LruMap<H256, Arc<Header>>,
}

so this is <child, ancestor>?
yep!
let's do SealedHeader instead
#2939 has just Header for now, but can change to SealedHeader pretty easily


Fix json data response formatter

Q
A

Is bugfix?
✔

New feature?
❌

Breaks BC?
✔

Fixed issues
https://github.com/yiisoft/yii-web/issues/320

👍


Question about pre-trian model

Dear authors, I have another small question. When I tested your pre-trained model on the Kings dataset, the results were very poor, with an error of about 30m. Is it normal to have significant errors when using a different environment? I am currently retraining, and fortunately, the results are gradually approaching the content in the paper.

I don't think it is correct to have such big errors. Could you please check if you have put the configuration files in the data folder?https://github.com/ActiveVisionLab/DFNet/tree/1389760f770851a77e601af1312f19fe065bd185/data/Cambridge/KingsCollege

Notice that our pre-trained model is trained in OpenGL conventions (same as NeRF). The conversion code is here:

Thank you for your reminder. I retested using your pre-trained model and obtained the following results:
Median error: 0.7324 meters and 2.3696 degrees.
Mean error: 1.0838 meters and 2.5473 degrees.
Are these results acceptable? I am in the process of retraining the model, hoping to achieve better results.

I apologize for another question. I retrained the DFNet model and obtained the following results: Median error is 1.4927213191986084 meters and 7.708547592163086 degrees. The mean error is 2.1420175386891422 meters and 8.970675379124744 degrees. There is still some deviation from the results in the paper. Worth mentioning is that the training stopped at the 127th epoch and achieved the best results at the 107th epoch. Is there a problem during my training process, or is it normal to encounter such errors on a new device?

I apologize for another question. I retrained the DFNet model and obtained the following results: Median error is 1.4927213191986084 meters and 7.708547592163086 degrees. The mean error is 2.1420175386891422 meters and 8.970675379124744 degrees. There is still some deviation from the results in the paper. Worth mentioning is that the training stopped at the 127th epoch and achieved the best results at the 107th epoch. Is there a problem during my training process, or is it normal to encounter such errors on a new device?

Notice that our pre-trained model is trained in OpenGL conventions (same as NeRF). The conversion code is here:

Thank you for your reminder. I retested using your pre-trained model and obtained the following results:
Median error: 0.7324 meters and 2.3696 degrees. Mean error: 1.0838 meters and 2.5473 degrees.
Are these results acceptable? I am in the process of retraining the model, hoping to achieve better results.

Hi, it is the correct result, as we reported on the paper.

I apologize for another question. I retrained the DFNet model and obtained the following results: Median error is 1.4927213191986084 meters and 7.708547592163086 degrees. The mean error is 2.1420175386891422 meters and 8.970675379124744 degrees. There is still some deviation from the results in the paper. Worth mentioning is that the training stopped at the 127th epoch and achieved the best results at the 107th epoch. Is there a problem during my training process, or is it normal to encounter such errors on a new device?

Not sure what happened here. There might be some randomness with new devices and seeds when using early stopping. Please try to see if using longer --patience leads to better results. Stopping at 20 epochs after the best might be too soon.

I apologize for another question. I retrained the DFNet model and obtained the following results: Median error is 1.4927213191986084 meters and 7.708547592163086 degrees. The mean error is 2.1420175386891422 meters and 8.970675379124744 degrees. There is still some deviation from the results in the paper. Worth mentioning is that the training stopped at the 127th epoch and achieved the best results at the 107th epoch. Is there a problem during my training process, or is it normal to encounter such errors on a new device?

Not sure what happened here. There might be some randomness with new devices and seeds when using early stopping. Please try to see if using longer --patience leads to better results. Stopping at 20 epochs after the best might be too soon.

Thank you! I will try it later.


New management

Sorry guys but I don't have bandwidth to serve as the sole curator on this project, and give due consideration to everyone's issues and PRs, and fair consideration of PRs with changes that conflict with my own. I think that requires someone independently to mediate. So I've removed myself as a collaborator. Perhaps ibab can appoint someone willing to serve the role.

No worries, @jyegerlehner.
I've been extremely busy during the past few weeks and didn't have enough time to take care of the repo :(
Thanks for putting in so much work 👍

So who is in charge of the repo at the moment?
Last update to master branch is 3 month ago and it seems like most of activity is only on the forum.
I'm currently studying code from this repo and training models using other forks (like the one from global conditioning PR by @jyegerlehner). If there are no volunteers among current contributors, I can spare some time for repo management.

@ibab and myself are the current maintainers, although it seems we are both too busy (I'm dealing with my thesis and several freelancing gigs ATM). New volunteers would be greatly appreciated. @ibab is the owner so it's up to him, but in the past we requested that maintainers perform a couple of code reviews before giving them write access, to ensure a consistent quality standard.

Hi @akademi4eg!
I've been super busy the past few months and didn't have time to maintain
the project.
I'll add maintainers later today once I'm back at my computer.
It would be nice to keep the code quality standard high, but keeping the
project going is more important IMO.
I'd also like to get the repo out of my namespace and into an organization
to encourage more people to contribute.
On Tue, Jan 10, 2017, 14:22 Quim Llimona<EMAIL_ADDRESS>wrote:

@ibab https://github.com/ibab and myself are the current maintainers,
although it seems we are both too busy (I'm dealing with my thesis and
several freelancing gigs ATM). New volunteers would be greatly appreciated.
@ibab https://github.com/ibab is the owner so it's up to him, but in
the past we requested that maintainers perform a couple of code reviews
before giving them write access, to ensure a consistent quality standard.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/ibab/tensorflow-wavenet/issues/183#issuecomment-271587345,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA2Wo1bSQ-ryz5wG6Ig2hrkV2iL2iKJYks5rQ5QMgaJpZM4K3teW
.


GROUP BY's on emacsql-sqlite

How do we do group-by's using emacsql?
I use emacsql-sqlite in Org-roam, and it seems that the return result only takes one value from my sqlite database, rather than the grouped result. Here's an example query-result pair:
With group-by:
(pp (emacsql (org-roam-db) [:select [from, to, properties] :from links
                                   :where (= to $s1)
                                   :group-by from]
             "/home/jethro/Dropbox/org/braindump/org/zettelkasten.org"))

"((\"/home/jethro/Dropbox/org/braindump/org/20200213174749.org\" \"/home/jethro/Dropbox/org/braindump/org/zettelkasten.org\"
  (:content \"If we flip this process in [[file:/home/jethro/Dropbox/org/braindump/org/zettelkasten.org][Zettelkasten]], and make the notes the\\nthinking process rather than /a record of/ of the thinking process.\" :point 493))
 (\"/home/jethro/Dropbox/org/braindump/org/arguments_against_zettelkasten.org\" \"/home/jethro/Dropbox/org/braindump/org/zettelkasten.org\"
  (:content \"[[file:/home/jethro/Dropbox/org/braindump/org/zettelkasten.org][§zettelkasten]]\" :point 82))
 (\"/home/jethro/Dropbox/org/braindump/org/how_to_take_smart_notes.org\" \"/home/jethro/Dropbox/org/braindump/org/zettelkasten.org\"
  (:content \"In [[file:/home/jethro/Dropbox/org/braindump/org/zettelkasten.org][Zettelkasten]], the most time-consuming portion is determining /the\\norder/ for the notes in which to write about.\" :point 1330))
 (\"/home/jethro/Dropbox/org/braindump/org/para_method.org\" \"/home/jethro/Dropbox/org/braindump/org/zettelkasten.org\"
  (:content \"This seems to be in contrast with other techniques like [[file:/home/jethro/Dropbox/org/braindump/org/zettelkasten.org][Zettelkasten]].\\nwhich propose no such organization, instead using links between\\ndifferent information.\" :point 1321))
 (\"/home/jethro/Dropbox/org/braindump/org/roam_research.org\" \"/home/jethro/Dropbox/org/braindump/org/zettelkasten.org\"
  (:content \"Roam research is a tool for networked-thought, created by [[file:/home/jethro/Dropbox/org/braindump/org/conor_white_sullivan.org][Conor\\nWhite-Sullivan]]. Roam adopts methods from [[file:/home/jethro/Dropbox/org/braindump/org/zettelkasten.org][Zettelkasten]].\" :point 256)))
"

without group-by:
(pp (emacsql (org-roam-db) [:select [from, to, properties] :from links
                                   :where (= to $s1)]
             "/home/jethro/Dropbox/org/braindump/org/zettelkasten.org"))

"((\"/home/jethro/Dropbox/org/braindump/org/20200213174749.org\" \"/home/jethro/Dropbox/org/braindump/org/zettelkasten.org\"
  (:content \"If we flip this process in [[file:/home/jethro/Dropbox/org/braindump/org/zettelkasten.org][Zettelkasten]], and make the notes the\\nthinking process rather than /a record of/ of the thinking process.\" :point 493))
 (\"/home/jethro/Dropbox/org/braindump/org/arguments_against_zettelkasten.org\" \"/home/jethro/Dropbox/org/braindump/org/zettelkasten.org\"
  (:content \"[[file:/home/jethro/Dropbox/org/braindump/org/zettelkasten.org][§zettelkasten]]\" :point 82))
 (\"/home/jethro/Dropbox/org/braindump/org/how_to_take_smart_notes.org\" \"/home/jethro/Dropbox/org/braindump/org/zettelkasten.org\"
  (:content \"Hence, use the [[file:/home/jethro/Dropbox/org/braindump/org/zettelkasten.org][Zettelkasten]] method. To get around this idea of\\nnote-taking, it is important to understand that:\" :point 1021))
 (\"/home/jethro/Dropbox/org/braindump/org/how_to_take_smart_notes.org\" \"/home/jethro/Dropbox/org/braindump/org/zettelkasten.org\"
  (:content \"In [[file:/home/jethro/Dropbox/org/braindump/org/zettelkasten.org][Zettelkasten]], the most time-consuming portion is determining /the\\norder/ for the notes in which to write about.\" :point 1330))
 (\"/home/jethro/Dropbox/org/braindump/org/para_method.org\" \"/home/jethro/Dropbox/org/braindump/org/zettelkasten.org\"
  (:content \"Contrasting with [[file:/home/jethro/Dropbox/org/braindump/org/zettelkasten.org][Zettelkasten]]\" :point 1261))
 (\"/home/jethro/Dropbox/org/braindump/org/para_method.org\" \"/home/jethro/Dropbox/org/braindump/org/zettelkasten.org\"
  (:content \"This seems to be in contrast with other techniques like [[file:/home/jethro/Dropbox/org/braindump/org/zettelkasten.org][Zettelkasten]].\\nwhich propose no such organization, instead using links between\\ndifferent information.\" :point 1321))
 (\"/home/jethro/Dropbox/org/braindump/org/roam_research.org\" \"/home/jethro/Dropbox/org/braindump/org/zettelkasten.org\"
  (:content \"Roam research is a tool for networked-thought, created by [[file:/home/jethro/Dropbox/org/braindump/org/conor_white_sullivan.org][Conor\\nWhite-Sullivan]]. Roam adopts methods from [[file:/home/jethro/Dropbox/org/braindump/org/zettelkasten.org][Zettelkasten]].\" :point 256)))
"

With the group-by, I see that one entry for "how_to_take_smart_notes.org" is missing from the SQL result.

That's the correct way to construct a GROUP BY query, and that's also a
correct SQL result for GROUP BY based on the rows you've listed. Your
query doesn't make sense, though, probably because you've misunderstood
the purpose of GROUP BY.
When using GROUP BY, each result column should either be one of the
columns given by the GROUP BY, or the result of an aggregate function
(count(), sum(), max(), min(), etc.). For anything else, you'll just get
a value from an arbitrary row in the group. So in your case you're just
getting arbitrary values for "properties" in your result set. The "to"
result column is consistent because of the WHERE clause, but, for the
same reason, you don't actually need it in the result set. That's why I
said it's "a" correct result, not "the" correct result: Your query is
non-deterministic.
https://www.sqlite.org/lang_select.html#resultset
As an extra note, SQL schemas design generally avoids keywords as column
names, including "from" and "to". These are not forbidden, but they
require extra quoting (double quotes), making queries harder to read
when in SQL format.

Sorry for getting back so late, and thanks for the reply! That was very helpful.


rpc: checkblock

RPC for checking weak blocks (reduced proof of work) and block templates (no proof of work) against all consensus rules.
Very much not production ready.

this can be useful for Sv2 JDS to check template validity
cc @gitgab19

Simplified things by just calling ConnectBlock instead of copy-pasting it.

Also added checkBlock() to the Mining interface. If the JDS can speak cap&proto this should be more performant than using the RPC. Though it's probably not a huge difference.

I got rid of StateCatcher indirection. With a little bit more cleanup I can probably open a PR to the main repo.

Moving to #31564.


KeyError:'nonce'

Pulled down the repo and ran the commands as given on the README.md on a clean install of Ubuntu 14.04 and am given a KeyError after running the setup.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1473, in full_dispatch_request
    rv = self.preprocess_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1666, in preprocess_request
    rv = func()
  File "/opt/ctfd/CTFd/views.py", line 32, in csrf
    if session['nonce'] != request.form.get('nonce'):
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/local.py", line 368, in <lambda>
    __getitem__ = lambda x, i: x._get_current_object()[i]
KeyError: 'nonce'

Thanks for bringing this up. Sorry about that.
On an unrelated note, Github should probably allow "Closes issue #52" to close the issue although I wasn't hopeful.


[AnVIL DX] Update GTM outbound link configuration

Need
Outbound links should track the source URL and capture the fragment if any.
Definition of Done
Additional outbound link information is accessible in the query manager for prod and staging:

[ ] AnVIL DX - GA4
[ ] AnVIL DX CC Staging - GA4

Working on prod & staging @MillenniumFalconMechanic
Prod:

Staging:

Thanks Jonah!


Read files to backup from a file

I had the need to backup a lot of files that where pre filtered by another command. I tried using xargs but that only would lead to multiple executions of restic and thus multiple snapshots.
This pull request adds a new flag that will read the files to backup from a file instead of the command line.
Usage example:
restic -r /tmp/backups backup --files-file /tmp/input_files

Current coverage is 51.40% (diff: 36.36%)

Merging #657 into master will decrease coverage by 0.04%

@@             master       #657   diff @@
==========================================
  Files            95         95
  Lines          7450       7463    +13
  Methods           0          0
  Messages          0          0
  Branches          0          0
==========================================
+ Hits           3833       3836     +3
- Misses         3069       3079    +10
  Partials        548        548

Powered by Codecov. Last update 6b88d3b...d346071

Thanks for your contribution! Unfortunately, I'm not convinced that we need this function. The command xargs can be used as follows to achieve what you're after. Suppose the files/dirs to be backed up are saved in /tmp/list, call xargs and restic as follows:
$ cat /tmp/list | xargs -d '\n' restic backup

You can test that with the command ruby -e 'puts ARGV.inspect', which prints out the arguments as an array. For example if you have a line in the list file which contains white space, that will be handled gracefully:
$ cat /tmp/list
1
2
3
4
foo bar baz
end

$ xargs -d '\n' ruby -e 'puts ARGV.inspect' < /tmp/list
["1", "2", "3", "4", "foo bar baz", "end"]

On the other hand I think that --files-file is not a good name for the command-line option.

I've had a look at tar and rsync, both have an option called --files-from to read a list of files/dirs from a file.

I'm gonna try again maybe I just got confused by the interface. Thx

And yeah i wasn't sure what the naming should be so i just oriented myself by the excludes-file flag. What tar and rsync do looks more reasonable.
I still would think that an option like this would me more convenient for users instead of the xargs approach.

Turns out, for very long argument lists this is not sufficient and using xargs in this way will not work for all cases. I've thought about this and changed my mind: We should add an option like this.
Would you like to rework your PR, or should I have a look first?

I will rework it.

Let me know if you're ready for a review

This should be fine the big if that differentiates between reading from file or not seems a bit ugly but not sure how to fix that.

What about the following: Add a new function func readFromFile(filename string) ([]string, error). If filename is the empty string, just return nil, nil. Then use this function to append the filenames read from the file to args like this (at the beginning of runBackup()):
func runBackup(opts BackupOptions, gopts GlobalOptions, args []string) error {
   target, err := readFromFile(opts.FilesFrom)
   if err != nil {
      return err
   }

   target = append(target, args)

   if len(args) == 0 {
     return errors.Fatalf("wrong number of parameters")
   }

You can also squash the commits into one then.

Ok I made the changes and squashed the commits. Seems good.

I also updated the documentation.

Looks good, thanks! :+1:


Would it possible to update it and upload in in Chrome Store again? thanks in advance

FYI, Microsoft Office supports inserting LaTex code:
https://tex.stackexchange.com/questions/498814/whats-the-best-and-quickest-way-to-insert-latex-equations-into-powerpoint


Open Source Helps!

Thanks for your work to help the people in need! Your site has been added! I currently maintain the Open-Source-COVID-19 page, which collects all open source projects related to COVID-19, including maps, data, news, api, analysis, medical and supply information, etc. Please share to anyone who might need the information in the list, or will possibly contribute to some of those projects. You are also welcome to recommend more projects.
http://open-source-covid-19.weileizeng.com/
Cheers!

Thanks @WeileiZeng!

@WeileiZeng, thank's for sharing the website, I went through some of the projects you found and recommended, it's awesome!
For this one (coronastatus), it may be more appropriate to put the project in part "API, data", since the first purpose is a crowdsourcing!
Best!

@WeileiZeng, thank's for sharing the website, I went through some of the projects you found and recommended, it's awesome!
For this one (coronastatus), it may be more appropriate to put the project in part "API, data", since the first purpose is a crowdsourcing!
Best!

Thanks. Changed.


BioSignal-Recorder 1.0

. Can plot any biopotential signal from desired ADC pin.
. Frontend referred from: https://github.com/BojanJurca/Esp32_oscilloscope.
. Uses ftp protocol to transfer html file.
. Uses SPIFFS for storing HTML.
Demonstration:

e

@Jamm02 This looks like a pretty good start :)
Thank you for your contribution, I'll go ahead and merge the changes now :)


Add the support for dynamic routing table

Add support for dynamic approach for building a routing table
Refactoring routing table builders
Fix the metric for no serving host to emit only during the external view computation

Codecov Report

Merging #3434 into master will decrease coverage by 0.02%.
The diff coverage is 92.02%.

@@             Coverage Diff              @@
##             master    #3434      +/-   ##
============================================
- Coverage     70.57%   70.54%   -0.03%
  Complexity        4        4
============================================
  Files           997      997
  Lines         45610    45627      +17
  Branches       6108     6107       -1
============================================
- Hits          32187    32186       -1
- Misses        11310    11321      +11
- Partials       2113     2120       +7

Impacted Files
Coverage Δ
Complexity Δ

...lder/PartitionAwareOfflineRoutingTableBuilder.java
69.33% <ø> (ø)
0 <0> (ø)
:arrow_down:

...om/linkedin/pinot/common/config/RoutingConfig.java
45.45% <ø> (ø)
0 <0> (ø)
:arrow_down:

...not/broker/routing/RoutingTableBuilderFactory.java
45.76% <ø> (ø)
0 <0> (ø)
:arrow_down:

...uting/builder/LargeClusterRoutingTableBuilder.java
47.05% <100%> (-18.66%)
0 <0> (ø)

...der/PartitionAwareRealtimeRoutingTableBuilder.java
85.18% <100%> (ø)
0 <0> (ø)
:arrow_down:

.../broker/routing/HelixExternalViewBasedRouting.java
90.39% <100%> (ø)
0 <0> (ø)
:arrow_down:

...ing/builder/BalancedRandomRoutingTableBuilder.java
100% <100%> (ø)
0 <0> (ø)
:arrow_down:

...ng/builder/DefaultRealtimeRoutingTableBuilder.java
61.9% <100%> (ø)
0 <0> (ø)
:arrow_down:

...ing/builder/DefaultOfflineRoutingTableBuilder.java
47.05% <66.66%> (ø)
0 <0> (ø)
:arrow_down:

...builder/BasePartitionAwareRoutingTableBuilder.java
72.97% <75%> (+1.92%)
0 <0> (ø)
:arrow_down:

... and 19 more

Continue to review full report at Codecov.

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

#2715


Add mysql grant visitor for DCLStatement

Add mysql grant visitor for DCLStatement

Pull Request Test Coverage Report for Build 9348

0 of 19 (0.0%)  changed or added relevant lines in 1 file are covered.
3 unchanged lines in 1 file lost coverage.
Overall coverage decreased (-0.08%) to 64.684%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/MySQLDCLVisitor.java
0
19
0.0%

Files with Coverage Reduction
New Missed Lines
%

sharding-orchestration/sharding-orchestration-core/src/main/java/org/apache/shardingsphere/orchestration/internal/util/IpUtils.java
3
76.0%

Totals

Change from base Build 785:
-0.08%

Covered Lines:
10960

Relevant Lines:
16944

💛  - Coveralls

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@d75f0c1). Click here to learn what that means.
The diff coverage is 0%.

@@           Coverage Diff            @@
##             master   #4190   +/-   ##
========================================
  Coverage          ?   60.8%
  Complexity        ?     352
========================================
  Files             ?    1012
  Lines             ?   16937
  Branches          ?    2983
========================================
  Hits              ?   10298
  Misses            ?    5987
  Partials          ?     652

Impacted Files
Coverage Δ
Complexity Δ

...dingsphere/sql/parser/visitor/MySQLDCLVisitor.java
0% <0%> (ø)
0 <0> (?)

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 d75f0c1...1eb8a41. Read the comment docs.


Fix minor typos in documentation

Fixed minor typos and incorrect links in README.md and STANDARDS.md

Looking at the failing CI tests for mac OS, looks like it is failing here: https://github.com/open-quantum-safe/oqs-provider/blob/mb-newpolicy/.circleci/config.yml#L304 and L307 while trying to pre-install OpenSSL v3.1. Currently the stable version supported for brew install openssl@3 is v3.2. The supported versions for brew install are openssl@3 (which is v3.2), openssl<EMAIL_ADDRESS>I can open another PR to fix it, if that helps.

For reference, this is the PR where the changes were made.

I just added the [skip ci] tag to skip all CI tests since this is a doc change. So all looks good now but the other issue with the CI tests on mac still exists. OpenSSL v3.2 was just released last week.

I can open another PR to fix it, if that helps.

That would be appreciated. Our approach is to immediately fix issues if we know there'd be something breaking (new, full) CI runs: Those should test new oqsprovider contributions, not the CI system.

@baentsch @thb-sb I will go ahead and submit a PR right away to fix it. Thank you.


Validation during training produces unsupported keys

❓ Questions and Help
During training once in 20 iterations I perform inference for my validation set.
is same manner as described in  tools/test_net.py. In my case I have only one class but during prediction of the validation set I get some other label than 1, usually happening to at first 100 iterations.
mapped_labels = [dataset.contiguous_category_id_to_json_id[i] for i in labels]
KeyError: 15

Problem is that error occurring randomly.
am I doing something wrong?
How can one overcome this issue?

I did not, sorry for dummy question but how do I do that?

You need to follow the instructions in https://github.com/facebookresearch/maskrcnn-benchmark/issues/15

Thank you!

I'm closing this issue, but let me know if you have other problems

@fmassa Hello, I encountered the same issue, I have changed in defaults.py --> _C.MODEL.ROI_BOX_HEAD.NUM_CLASSES = 25, but when I started training, I still encountered this issue. My output class num is 25 including the background. My issues are:
 2020-04-21 14:44:26,720 maskrcnn_benchmark.inference INFO: Model inference time: 0:00:00.999555 (0.08329623937606812 s / img per device, on 1 devices) 2020-04-21 14:44:26,725 maskrcnn_benchmark.inference INFO: Preparing results for COCO format 2020-04-21 14:44:26,725 maskrcnn_benchmark.inference INFO: Preparing bbox results Traceback (most recent call last):   File "tools/train_net.py", line 201, in <module>     main()   File "tools/train_net.py", line 197, in main     run_test(cfg, model, args.distributed)   File "tools/train_net.py", line 128, in run_test     output_folder=output_folder,   File "/home/drl/workspace/spikelet/4/graindetection2/maskrcnn-benchmark/maskrcnn_benchmark/engine/inference.py", line 120, in inference     **extra_args)   File "/home/drl/workspace/spikelet/4/graindetection2/maskrcnn-benchmark/maskrcnn_benchmark/data/datasets/evaluation/__init__.py", line 22, in evaluate     return coco_evaluation(**args)   File "/home/drl/workspace/spikelet/4/graindetection2/maskrcnn-benchmark/maskrcnn_benchmark/data/datasets/evaluation/coco/__init__.py", line 23, in coco_evaluation     expected_results_sigma_tol=expected_results_sigma_tol,   File "/home/drl/workspace/spikelet/4/graindetection2/maskrcnn-benchmark/maskrcnn_benchmark/data/datasets/evaluation/coco/coco_eval.py", line 44, in do_coco_evaluation     coco_results["bbox"] = prepare_for_coco_detection(predictions, dataset)   File "/home/drl/workspace/spikelet/4/graindetection2/maskrcnn-benchmark/maskrcnn_benchmark/data/datasets/evaluation/coco/coco_eval.py", line 88, in prepare_for_coco_detection     mapped_labels = [dataset.contiguous_category_id_to_json_id[i] for i in labels]   File "/home/drl/workspace/spikelet/4/graindetection2/maskrcnn-benchmark/maskrcnn_benchmark/data/datasets/evaluation/coco/coco_eval.py", line 88, in <listcomp>     mapped_labels = [dataset.contiguous_category_id_to_json_id[i] for i in labels] KeyError: 18.0
Could you please help me.


Proper BdrFaceIntegrator version for BoundaryNormalLFIntegrator?

Due to the issue #2320 , BoundaryNormalLFIntegrator cannot be just used for L2_FECollection. Its DG equivalent--- AssembleRHSElementVect with FaceElementTransformation needs to be defined.
Now I devised its DG equivalent as follows, trying to be consistent with other dg face integrators:
void BoundaryNormalLFIntegrator::AssembleRHSElementVect(
   const FiniteElement &el, FaceElementTransformations &Tr, Vector &elvect)
{
   int dim = el.GetDim();
   int dof = el.GetDof();
   Vector nor(dim), Qvec;

   shape.SetSize(dof);
   elvect.SetSize(dof);
   elvect = 0.0;

   const IntegrationRule *ir = IntRule;
   if (ir == NULL)
   {
      int intorder = 2 * el.GetOrder();  // <----------
      ir = &IntRules.Get(el.GetGeomType(), intorder);
   }

   for (int i = 0; i < ir->GetNPoints(); i++)
   {
      const IntegrationPoint &ip = ir->IntPoint(i);

      Tr.SetAllIntPoints(&ip);

      // Access the neighboring element's integration point
      const IntegrationPoint &eip = Tr.GetElement1IntPoint();

      if (dim == 1)
      {
         nor(0) = 2*eip.x - 1.0;
      }
      else
      {
         CalcOrtho(Tr.Jacobian(), nor);
      }
      Q.Eval(Qvec, *Tr.Elem1, eip);

      el.CalcShape(eip, shape);

      elvect.Add(ip.weight*(Qvec*nor), shape);
   }
}

However, I found out this does not work with triangle elements (but with quadrilaterals).
Here is how I tested this:

With a prescribed VectorFunctionCoefficient Q and (also prescribed) test function, I check if the inner product defined by this function \( L(v) = (g \cdot n, v) \) gives the expected value on the straight line boundary of a unit-square, uniform cartesian mesh with Mesh::MakeCartesian2D.
With quadrilateral elements, it works just fine:

Num. Refine.    Rel. Error           Product            Product_expected
0                       1.29859E-03     2.47621E-01     2.47943E-01

With triangle elements, it converges to its half value:

Num. Refine.    Rel. Error           Product            Product_expected
0                       5.27715E-01     1.17100E-01     2.47943E-01

For second order, for quadrilaterals, ir->GetNPoints() == 4 and ip.weight = 0.25 for each &ip = ir->IntPoint(i), adding up to 1. However, for triangles,  ir->GetNPoints() == 3 and ip.weight = 0.1667, adding up to 0.5.
I set the segment length to be the same for both cases, and the normal vector nor are confirmed to be the same for both cases.
This affects the actual fem system, so when I solve a system with quadrilateral mesh, it works just fine, but not with triangle meshes.

Observing this, I see the way I perform the numerical quadrature is wrong somewhere, probably in using these weights, but I'm not so clear how to set up a proper integration for this. Any comments or suggestions would be appreciated!

Hi all,
FYI, this is the test routine I used for the BoundaryNormalLFIntegrator::AssembleRHSElementVect written above.
// With BoundaryNormalLFIntegrator::AssembleRHSElementVect implemented
#include "mfem.hpp"
#include <stdio.h>

using namespace std;
using namespace mfem;

// Given exact vector function
void uFun_ex(const Vector & x, Vector & u);
// Given exact scalar function
double pFun_ex(const Vector & x);
// Evaluate the product \( g \cdot n, v \)
double EvalWithRefinement(const int num_refinement, const int &order);

int main(int argc, char *argv[])
{
   int num_refine = 3;

   double Lx = 1.0, Ly = 1.0;
   double product_ex = sin(Lx) * cos(Lx) * (Ly - 0.5 * sin(2.0 * Ly));  // expected value of the product.
   printf("(p, n dot u_d)_ex = %.5E\n", product_ex);

   printf("Num. Refine.\tRel. Error\tConv Rate\tProduct\tProduct_ex\n");

   Vector conv_rate(num_refine);
   conv_rate = 0.0;
   double error1 = 0.0;
   for (int r = 0; r < num_refine; r++)
   {
      int order = 1;
      double product = EvalWithRefinement(r, order);

      double error = abs(product - product_ex) / abs(product_ex);

      if (r > 0)
         conv_rate(r) = error1 / error;
      printf("%d\t%.5E\t%.5E\t%.5E\t%.5E\n", r, error, conv_rate(r), product, product_ex);

      // reported convergence rate
      if ((r > 0) && (conv_rate(r) > pow(2.0, order+1) - 0.1))
         printf("The product is not converging properly!\n");

      error1 = error;
   }

   return;
}

void uFun_ex(const Vector & x, Vector & u)
{
   double xi(x(0));
   double yi(x(1));
   assert(x.Size() == 2);

   u(0) = cos(xi)*sin(yi);
   u(1) = - sin(xi)*cos(yi);
}

double pFun_ex(const Vector & x)
{
   double xi(x(0));
   double yi(x(1));

   assert(x.Size() == 2);

   return 2.0 * sin(xi)*sin(yi);
}

double EvalWithRefinement(const int num_refinement, const int &order)
{
   // 1. Parse command-line options.
   std::string mesh_file = "./uniform.mesh"; // mesh filename to use.
   bool use_dg = false;  // use DG finite-element space or H1 finite-element space.

   Mesh *mesh = new Mesh(mesh_file.c_str(), 1, 1);
   int dim = mesh->Dimension();

   for (int l = 0; l < num_refinement; l++)
   {
      mesh->UniformRefinement();
   }

   FiniteElementCollection *dg_coll(new DG_FECollection(order, dim));
   FiniteElementCollection *h1_coll(new H1_FECollection(order, dim));

   FiniteElementSpace *fes;
   if (use_dg)
   {
      fes = new FiniteElementSpace(mesh, dg_coll);
   }
   else
   {
      fes = new FiniteElementSpace(mesh, h1_coll);
   }

   Array<int> p_ess_attr(mesh->bdr_attributes.Max());
   // evaluate the product on only one side of the mesh.
   p_ess_attr = 0;
   p_ess_attr[1] = 1;

   VectorFunctionCoefficient ucoeff(dim, uFun_ex);
   FunctionCoefficient pcoeff(pFun_ex);

   // 12. Create the grid functions u and p. Compute the L2 error norms.
   GridFunction p(fes);

   p.ProjectCoefficient(pcoeff);

   LinearForm *gform = new LinearForm(fes);
   if (use_dg)  // This currently fails for triangular mesh.
      // With BoundaryNormalLFIntegrator::AssembleRHSElementVect implemented.
      gform->AddBdrFaceIntegrator(new BoundaryNormalLFIntegrator(ucoeff), p_ess_attr);
   else // This works for both triangular/quadrilateral mesh, but not for DG finite-element space.
      gform->AddBoundaryIntegrator(new BoundaryNormalLFIntegrator(ucoeff), p_ess_attr);
   gform->Assemble();

   double product = p * (*gform);

   // 17. Free the used memory.
   delete gform;
   delete fes;
   delete dg_coll;
   delete h1_coll;
   delete mesh;

   return product;
}

@dreamer2368 sorry for the late reply.
Your code seems to work ok when you change
ir = &IntRules.Get(Tr.GetGeometryType(), intorder);
(you were getting the geometry of the volumetric element instead of the face to create the face quad rule)

Thank you for the comment, @vladotomov . Reflecting the fix solved the problem!


[Bug] RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking argument for argument mat1 in method wrapper_CUDA_addmm)

Describe the bug
File "/workspace/speechbrain/speechbrain/inference/ASR.py", line 93, in transcribe_file
    predicted_words, predicted_tokens = self.transcribe_batch(
  File "/workspace/speechbrain/speechbrain/inference/ASR.py", line 162, in transcribe_batch
    predicted_tokens, _, _, _ = self.mods.decoder(*inputs)
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
  File "/workspace/speechbrain/speechbrain/decoders/seq2seq.py", line 1591, in forward
    ) = self.init_beam_search_data(enc_states, wav_len)
  File "/workspace/speechbrain/speechbrain/decoders/seq2seq.py", line 1235, in init_beam_search_data
    memory, scorer_memory = self._update_reset_memory(enc_states, enc_lens)
  File "/workspace/speechbrain/speechbrain/decoders/seq2seq.py", line 1034, in _update_reset_memory
    scorer_memory = self.scorer.reset_scorer_mem(enc_states, enc_lens)
  File "/workspace/speechbrain/speechbrain/decoders/scorer.py", line 1263, in reset_scorer_mem
    memory[k] = impl.reset_mem(x, enc_lens)
  File "/workspace/speechbrain/speechbrain/decoders/scorer.py", line 241, in reset_mem
    logits = self.ctc_fc(x)
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
  File "/workspace/speechbrain/speechbrain/nnet/linear.py", line 89, in forward
    wx = self.w(x)
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/linear.py", line 114, in forward
    return F.linear(input, self.weight, self.bias)
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking argument for argument mat1 in method wrapper_CUDA_addmm)

Expected behaviour
Should not throw a Runtime Error
To Reproduce
from speechbrain.inference.ASR import EncoderDecoderASR
asr_model = EncoderDecoderASR.from_hparams(source="speechbrain/asr-wav2vec2-transformer-aishell", savedir="pretrained_models/asr-wav2vec2-transformer-aishell",  run_opts={"device":"cuda"})
asr_model.transcribe_file("speechbrain/asr-wav2vec2-transformer-aishell/example_mandarin.wav")

When I run the program on the CPU, it does not produce any errors, but when I run it on the GPU, it encounters an error. The reference link is: https://huggingface.co/speechbrain/asr-wav2vec2-transformer-aishell
Environment Details
I installed SpeechBrain using the following command:
git clone https://github.com/speechbrain/speechbrain.git
cd speechbrain
pip install -e .

Relevant Log Output
No response
Additional Context
No response

The same as https://github.com/speechbrain/speechbrain/issues/2516


Stripe.js v3

How would one integrate this with Stripe.js v3?

Well, as it turns out it is not possible using v3. Here is what I was told by Stripe support.
Due to the way Elements works, you cannot get the card numbers into your frontend Javascript in order to use with a component such as Card. Doing so exposes you to a stricter set of PCI requirements.
We've designed Elements as the best way to build customized payment flows that are both secure and optimized for conversion. We will use Elements as the base to launch more improvements, including support for more payment methods, better fraud detection, and more. In addition to those benefits, if you use Stripe Elements, you'll continue to be eligible for the simplest PCI validation method, Self-Assessment Questionnaire A (SAQ A).
For some context, the PCI Council has published a series of changes to eligibility requirements for SAQ A. These require that businesses use input fields hosted by a payments provider in order to be eligible for SAQ A. We've designed Elements with these changes in mind so that you can continue to validate using SAQ A without losing much of the flexibility and customizability of a form hosted on your website. You are absolutely right, though, that there can be some compromise when it comes to customizability with this approach.[1]
That being said, you can continue using Stripe.js/v2 as we will continue to support it indefinitely. However, please note that you'll need to start validating your PCI compliance annually using the long-form PCI Self-Assessment Questionnaire A-EP (SAQ A-EP) [2]. There may be additional security controls to implement to validate PCI compliance using SAQ A-EP. The changes you might need to make will depend on your current security practices.
If you choose to continue with Stripe.js/v2 and you need help filling out the SAQ A-EP, we can put you in touch with one of our preferred PCI Qualified Security Assessors (QSA) who deeply understands the various Stripe integration methods.
I hope this helps. If you've any further questions or concerns, please do let me know.
[1] https://stripe.com/docs/security#validating-pci-compliance
[2] https://www.pcisecuritystandards.org/documents/PCI-DSS-v3_2-SAQ-A_EP.pdf

Hey Tyler,
You can somewhat fudge it (I'm using a different payment processor but a similar setup)
Essentially, you won't be able to populate the "card" with any values outside of the card holder name. Instead, using the events that the script exposes, you can adjust the brand, and flip the card when the user focuses/blurs on the cvc field. It's not perfect, but a decent compromise.
To select a brand (assuming jquery here:)
$('.jp-card').addClass('jp-card-identified');
$('.jp-card').addClass('jp-card-' + CARD_BRAND);
Flipping the card to the back-side follows a similar pattern. (The class is "jp-card-flipped")
You still get a nice card, and you can even have the elements on the card light up when the user focuses and blurs the respective fields. And you still get SAQ-A!
Just my two cents, hope that helps someone!
https://stripe.com/docs/stripe.js#element-on

Hey Leebran, thanks for posting that, took me a while to figure out that it's not going to work with v3. Any chance you can post your solution/fudge in context? I'm having difficulty getting it working. Thanks!!

Anyone? I know I'm not the only person who's going to have this issue ;)

Hi @LeebranZadwell
Sadly I don't think this workaround is still supported by Stripe right now. As far as I can tell, the latest change is that the focus event now no longer emits any field properties, and the only field property passed to the change event is just brand.
So now:
// focus event
checkout_script.on('focus', function(event) {
    console.log( event.field ) // <-- this yielded 'undefined' for me
})

// change event
checkout_script.on('change', function(event) {
    console.log( event.field ) // <-- this yielded 'undefined' still
    console.log( event.brand ) // <-- this yielded the brand, as expected
})

Thankfully there is yet another hack though: Stripe still passes the error messages. It's not clean, but using this could still work:
// change event, using error messages
checkout_script.on('change', function(event) {
      if ( event.error !== undefined && event.error.code.toLowerCase() === 'incomplete_number' ) {
          console.log( "User is currently entering/changing their card number. Highlight on Card")
      };
      if ( event.error !== undefined && event.error.code.toLowerCase() === 'incomplete_expiry' ) {
          console.log( "User is currently entering/changing their expiry date. Highlight on Card")
      };
      if ( event.error !== undefined && event.error.code.toLowerCase() === 'incomplete_cvc' ) {
          console.log( "User is currently entering/changing their CVC. Highlight on Card")
      };
})

The above example is not the cleanest of hacks, but I do hope it helps as pointer in the right direction for someone else who may stumble on to this.
You'll have to look through other possible error codes that Stripe could throw to come up with something more robust:
https://stripe.com/docs/error-codes
All the best!

@DeoluA,
The 'change' event for Stripe v3 only fires for 4 types of events:

Card brand changes
An error exists after input an input is blurred (not on keyup)
Postal code change (on keyup)
Card info is complete or empty

Unfortunately, I was not able to use the errors to detect which input field the user is focused in, other than the postal code. The only time the errors give you a good indication of this is if the input is blurred with an error remaining in the input value.
I'll keep messing around and report back if I can figure out another solution.

Hi @PriceFallin
I hope you have a better outcome than I did. You're right about the blur: what I ended up settling for was only using card.js as a visual guide for the user if they happened to make an error after they filled any of the inputs, viz:
// checking
var card_errors = ["incomplete_number", "invalid_number"];
var expiry_errors = ["incomplete_expiry", "invalid_expiry_month_past", "invalid_expiry_year_past"];
var cvc_errors = ["incomplete_cvc", "invalid_cvc", "incorrect_cvc"];

stripe_card.on('change', function(event){
      // monitor the brand
      var cardLogo = 'none';
      var card_class = 'unknown';

      if (event.brand && event.brand !== 'unknown') {
            var filePath = 'https://cdn.na.bambora.com/downloads/images/cards/' + event.brand + '.svg';
            cardLogo = 'url(' + filePath + ')';

            card_class = 'jp-card-' + event.brand;

            $('.jp-card').attr('class', 'jp-card');
            $('.jp-card').addClass('jp-card-identified');
      };

      if ( card_class === 'unknown' ) {
            $('.jp-card').removeClass('jp-card-identified');
      };

      $('.jp-card').addClass(card_class);

      // highlight all initially
      $('.jp-card-name').addClass('jp-card-focused');
      $('.jp-card-number').addClass('jp-card-focused');
      $('.jp-card-expiry').addClass('jp-card-focused');
      $('.jp-card-cvc').addClass('jp-card-focused');

      // if there's an error with the card number input, let them know after blur by dimming its input
      if ( event.error !== undefined && card_errors.indexOf(event.error.code.toLowerCase()) > -1 ) {
            $('.jp-card').removeClass('jp-card-flipped');
            $('.jp-card-number').removeClass('jp-card-focused');
      };
      // ...error with the expiry input, let them know after blur...
      if ( event.error !== undefined && expiry_errors.indexOf(event.error.code.toLowerCase()) > -1 ) {
            $('.jp-card').removeClass('jp-card-flipped');
            $('.jp-card-expiry').removeClass('jp-card-focused');
      };
      // error with the cvc...
      if ( event.error !== undefined && cvc_errors.indexOf(event.error.code.toLowerCase()) > -1 ) {
            $('.jp-card').addClass('jp-card-flipped');
            $('.jp-card-cvc').removeClass('jp-card-focused');
      };
});

The above, again, is not a complete and total solution, but it was enough to suffice for my case. Stripe v3 does a good job of not letting you know card details as they're being inputted - which is what it's supposed to do anyway. Just a bit sad that it's causing this workaround. Perhaps there should be a new warning/disclaimer added to the card.js documentation for anyone who may want to use this with Stripe v3?
Anyway, hope my method above works, or at least sheds more light towards a better one. Also hoping you're more successful @PriceFallin ! 🤞


finished pipelines setup

Pipelines are building and deploying to https://tringo-dev.azurewebsites.net/


Covariant quantifiers are specialized to widest possible type in conditional types, should be narrowest

🔎 Search Terms
Generics, variance, conditional types, inference
🕗 Version & Regression Information
This is the behavior in every version I tried, and I reviewed the FAQ for entries about conditional types (specifically the note about falling through to never and "distributive conditional types", which is not what's happening in my example)
⏯ Playground Link
Playground link with relevant code
💻 Code
type Fail<msg extends string> = { error: msg, imaginary: never }
type MixtureOf<r> = r[keyof r]
type VariantOf<r> = MixtureOf<{ [k in keyof r]: { tag: k, value: r[k] } }>

// A type constructor with a *covariant* type parameter
type Thunk<o> = () => readonly o[]

// Some examples
const stringThunk: Thunk<string> = () => ["foo", "bar"]
const numberThunk: Thunk<number> = () => [1, 2]
const polyThunk: <a>() => readonly a[] = () => [] // This one is polymorphic!

type TerminalThunk = Thunk<unknown> // For any x, a Thunk<x> is assignable to TerminalThunk
const someThunks: readonly TerminalThunk[] = [polyThunk, stringThunk, numberThunk]

type InitialThunk = Thunk<never> // For any x, an InitialThunk is assignable to Thunk<x>
const initialThunk: InitialThunk = polyThunk
const theAllThunk: typeof polyThunk & typeof stringThunk & typeof numberThunk = initialThunk

// We can use a (distributive) conditional type to extract the type parameter of a Thunk
type OutputOf<thunk> = thunk extends Thunk<infer x> ? x : Fail<'whoops'>
// ... and to extract the type parameters of a number of Thunks
type OutputsOf<thunks> = { [k in keyof thunks]: OutputOf<thunks[k]> }

// We'd like to be able to work with the sum of the (covariant) parameters of a number of Thunk<_> types, some of which may be polymorphic.
type collect = <thunks extends Record<string, TerminalThunk>>(thunks: thunks) => Thunk<MixtureOf<OutputsOf<thunks>>>
const collect: collect = thunks => () =>
  // @ts-ignore
  Object.values(thunks).flatMap(v => v())

// Inferred as Thunk<MixtureOf<OutputsOf<...>>>
const test1 = collect({ stringThunk, numberThunk })
const test1_: readonly (string | number)[] = test1() // Good!

// Inferred as readonly unknown[]
const test2 = collect({ polyThunk, stringThunk, numberThunk })
const test2_: readonly (string | number)[] = test2() // Bad! Type 'readonly unknown[]' is not assignable to type 'readonly (string | number)[]'.

// The runtime results are identical
console.log(test1())
console.log(test2())

🙁 Actual behavior
The assignment failed with the type error:
Type 'readonly unknown[]' is not assignable to type 'readonly (string | number)[]'.
  Type 'unknown' is not assignable to type 'string | number'.
    Type 'unknown' is not assignable to type 'number'.(2322)

🙂 Expected behavior
I expect the assignment in test2_ to succeed without any further type annotation.
I'm not completely certain, but I suspect the problem arises from the fact that OutputOf<typeof polyThunk> = unknown, which is then summed with and absorbs string and number (due to MixtureOf).
As near as I can figure out, for covariantly quantified generic functions, a (distributive) conditional type seems to simply specialize all the quantifiers to their respective upper bounds before unifying with the RHS of the extends operator (the default upper bound being unknown). So for example:
type Test0 = OutputOf<<x extends unknown>() => readonly x[]> // Test0 = unknown
type Test1 = OutputOf<<x extends string>() => readonly x[]>  // Test1 = string
type Test2 = OutputOf<<x extends number>() => readonly x[]>  // Test2 = number

But even this rule doesn't seem to hold in general, :shrug: :
type Test3<ub> = OutputOf<<x extends ub>() => readonly x[]>  // Test3<ub> = unknown ???

Regardless, at least in the special case of unbounded covariant quantifiers, does it make any sense to instead produce never? I haven't thought about it super hard, but since all of TypeScript's inference problems are in "positive position" (i.e. you never try to infer the types of parameters), it seems like specializing any generic function to the narrowest possible type would do something good.
Cue the counterexamples of where this is nonsense...

I'm not sure what angle to approach this from, so I'll be a bit verbose here and list a bunch of things I think are facts to see where we're disconnected.
If we write collect({ polyThunk }), this expression should produce () => unknown[], same as if you had written this:
// p: Thunk<unknown>
const p = polyThunk();

wherein an inference with zero candidates is correctly defined to produce unknown.
A covariant mixing of readonly string[] and readonly unknown[] should produce readonly unknown[], since a readonly unknown[] might be inhabited by anything.
The inference of collect({ polyThunk, stringThunk, numberThunk }) is correctly () => readonly unknown[] because we have no evidence of what polyThunk's return type should be (*).
The assignment of test2_() to test2 is clearly unsound given the existing inferences, so is correctly an error.
Given the initializer to polyThunk, I think its correct definition is this, which gives the desired behavior.
const polyThunk: () => readonly never[] = () => []

* Perhaps critically, not a footnote - in general our inference algorithm is not philosophically compatible with functions like polyThunk, since they claim to be able to manufacture the correct type out of thin air, but our inference algorithm approaches generics as if they relate input values to output values via plausible runtime means. When no input positions exist to inform possibly-correct inferences, we default to the soundest choice unknown.
Choosing never over unknown in the absence of any candidates is incorrect; if you wrote a function like this
function fn<T>(arg?: T) {
  return arg;
}
const m = fn();

It would be a true unsoundness to let never inhabit m in a program that's still running.

I'm not sure what angle to approach this from, so I'll be a bit verbose here and list a bunch of things I think are facts to see where we're disconnected.
If we write collect({ polyThunk }), this expression should produce () => unknown[], same as if you had written this:
// p: Thunk<unknown>
const p = polyThunk();

wherein an inference with zero candidates is correctly defined to produce unknown.
A covariant mixing of readonly string[] and readonly unknown[] should produce readonly unknown[], since a readonly unknown[] might be inhabited by anything.
The inference of collect({ polyThunk, stringThunk, numberThunk }) is correctly () => readonly unknown[] because we have no evidence of what polyThunk's return type should be (*).
The assignment of test2_() to test2 is clearly unsound given the existing inferences, so is correctly an error.
Given the initializer to polyThunk, I think its correct definition is this, which gives the desired behavior.
const polyThunk: () => readonly never[] = () => []

* Perhaps critically, not a footnote - in general our inference algorithm is not philosophically compatible with functions like polyThunk, since they claim to be able to manufacture the correct type out of thin air, but our inference algorithm approaches generics as if they relate input values to output values via plausible runtime means. When no input positions exist to inform possibly-correct inferences, we default to the soundest choice unknown.
Choosing never over unknown in the absence of any candidates is incorrect; if you wrote a function like this
function fn<T>(arg?: T) {
  return arg;
}
const m = fn();

It would be a true unsoundness to let never inhabit m in a program that's still running.

@RyanCavanaugh Thanks, that's a good way to approach this. I think I already disagree with you when it comes to:

If we write collect({ polyThunk }), this expression should produce () => unknown[], same as if you had written this:

I think it should produce readonly never[]. Could we focus in on that one and talk about why unknown[] vs never[]? I'm still thinking about the rest of your comment but it's probably easier to talk about it once we're on the same page wrt the first thing.

@RyanCavanaugh Thanks, that's a good way to approach this. I think I already disagree with you when it comes to:

If we write collect({ polyThunk }), this expression should produce () => unknown[], same as if you had written this:

I think it should produce readonly never[]. Could we focus in on that one and talk about why unknown[] vs never[]? I'm still thinking about the rest of your comment but it's probably easier to talk about it once we're on the same page wrt the first thing.

I mean of course inferring unknown[] is sound, but in general inferring the type of any expression to be unknown is sound; it's just not very useful. Strictly speaking it's the soundest thing to do in any specific inference problem, but unsoundness follows because the user now has to do unsafe casts to do anything useful with the result, and the more unsafe casting you do the more mistakes you can make, lying to yourself and to the typechecker.
Now that I've thought a bit more about your function fn example (sorry, i'm jumping around a bit) I think I disagree with that as well. We need to explicitly write the return type of fn to see why:
function fn<T>(arg?: T): T | undefined {
  return arg;
}
const m = fn(); // I believe the best thing to infer here is not `unknown | undefined`, but rather `never | undefined`

I mean of course inferring unknown[] is sound, but in general inferring the type of any expression to be unknown is sound; it's just not very useful. Strictly speaking it's the soundest thing to do in any specific inference problem, but unsoundness follows because the user now has to do unsafe casts to do anything useful with the result, and the more unsafe casting you do the more mistakes you can make, lying to yourself and to the typechecker.
Now that I've thought a bit more about your function fn example (sorry, i'm jumping around a bit) I think I disagree with that as well. We need to explicitly write the return type of fn to see why:
function fn<T>(arg?: T): T | undefined {
  return arg;
}
const m = fn(); // I believe the best thing to infer here is not `unknown | undefined`, but rather `never | undefined`

There's a less imprecise way for me to motivate why I think the result should be never. When we apply fn(), the most straightforward thing to infer is neither unknown | undefined nor never | undefined: it's just <T> (T | undefined), in an imaginary type syntax for #17574. But absent the ability to actually model  ...anything but a function...`, we should pick the closest equivalent.
So for some covariant type constructor X<_>, and the type <T> X<T> which we cannot (currently) represent in TypeScript, what should we pick as its closest equivalent: X<unknown> or X<never>?
My understanding is that if X is covariant, <T> X<T> is equivalent to X<never>. I don't know how to define "covariant" precisely in a type theory context, but I can try to "define" it by many examples:

type X<V> = V
type X<V> = V | undefined
type X<V> = readonly V[]
type X<V> = (i: I) => V
type X<V> = (i: I) => readonly (V | undefined)[]

I can also define it roundaboutly by saying that if it's possible to implement: <a, b>(f: (a: a) => b) => (fa: F<a>) => F<b>, then F<_> is covariant. Can you think of some examples where F<_> is covariant but F<never> is not semantically equivalent to <T> F<T>?
We can look to other type systems for inspiration too. In e.g. Haskell there is the type Void which has no inhabitants (similar to never). It is also possible in Haskell to construct the "generic" type forall x. F x, where F is some type constructor besides a function. The relevant fact is that in Haskell the types forall x. F x and F Void are isomorphic whenever F is covariant. I understand that Haskell lacks subtyping, and it's not a one to one analogy to our current discussion, so we should take all this with a grain of salt. But I do think this confirms at a semantic level the soundness of inferring never in the situations we were discussing above.

There's a less imprecise way for me to motivate why I think the result should be never. When we apply fn(), the most straightforward thing to infer is neither unknown | undefined nor never | undefined: it's just <T> (T | undefined), in an imaginary type syntax for #17574. But absent the ability to actually model  ...anything but a function...`, we should pick the closest equivalent.
So for some covariant type constructor X<_>, and the type <T> X<T> which we cannot (currently) represent in TypeScript, what should we pick as its closest equivalent: X<unknown> or X<never>?
My understanding is that if X is covariant, <T> X<T> is equivalent to X<never>. I don't know how to define "covariant" precisely in a type theory context, but I can try to "define" it by many examples:

type X<V> = V
type X<V> = V | undefined
type X<V> = readonly V[]
type X<V> = (i: I) => V
type X<V> = (i: I) => readonly (V | undefined)[]

I can also define it roundaboutly by saying that if it's possible to implement: <a, b>(f: (a: a) => b) => (fa: F<a>) => F<b>, then F<_> is covariant. Can you think of some examples where F<_> is covariant but F<never> is not semantically equivalent to <T> F<T>?
We can look to other type systems for inspiration too. In e.g. Haskell there is the type Void which has no inhabitants (similar to never). It is also possible in Haskell to construct the "generic" type forall x. F x, where F is some type constructor besides a function. The relevant fact is that in Haskell the types forall x. F x and F Void are isomorphic whenever F is covariant. I understand that Haskell lacks subtyping, and it's not a one to one analogy to our current discussion, so we should take all this with a grain of salt. But I do think this confirms at a semantic level the soundness of inferring never in the situations we were discussing above.

Let me try to TL;DR: When T<U> appears in a function's return type when we're inferring U, the variance of T should inform the zero-candidate inference of U:

Covariant: never
Contravariant: unknown
Invariant: (??)
Unmeasurable: (??)

Is that right?

@RyanCavanaugh Yes, that's exactly right, at least when there's no extends clauses.

I found a bug that looks like similar to this one, but I am unsure, so I post it here. Consider the following code:
type StringMap = { [key: string]: string };

const a: StringMap = {
    'a': 'aData',
    'b': 'bData'
};

function f<T extends StringMap>(m: T) {
    for (const k in m) {
        const keyOfM: keyof T = k;
        const v1: string = m[keyOfM];
        const v2: string = m[k];
    }
}

f(a);

Surprisingly, the line assigning v1 compiles, but the line assigning v2 does not, although the first has a wider type for the indexing variable than the second.

As an interesting note, the following works (assuming same a):
type S<SMK extends string> = {
	[K in SMK]: string;
};

function f<SMK extends string>(m: S<SMK>) {
    for (const k in m) {
        const v2: string = m[k];
    }
}

f(a);

I've been simulating this with with a type-level map, and I know of one other library that's actively using a similar technique to provide variances to higher order kinds.
I would love to see support for Covariance/Contravariance either implicitly or explicitly defined.


Center main content body

[ ] Proper width on Toolbars
[ ] Proper width on Fabric Grid
[ ] Proper width on All Tables
[ ] Proper width on Service Summary
[ ] Proper width on Grid pages, charts and tables
[ ] Proper width on Explorer

Closed by #809


Convert to UTF-8

@pjbehr87  Hi,
I don't know why it's not able to automatically merge, but this file is now in UTF-8.

There, should be able to merge now. @pjbehr87

That did it. You're changes are live, and appear to be working correctly. Thanks again for all your work in making this sheet available to translators on top of also adding the French translation!

Thanks ! It is indeed working.
While I got you, I could not find a good way to translate the RollTemplate, without breaking everything.
If you have a couple of minute, I'll really appreiciate if you could take a look at this post : https://app.roll20.net/forum/post/3762625/policy-change-for-alternate-translation-character-sheets/?pageforid=4457866#post-4457866
You guys are doing an amazing job with Roll20, thank you so much for all you work. I am living in Colombia right now and Roll20 allows me to continue to play with my French friends, even from the other side of the world. It's amazing.


Continue playing when changing clips in Workflow Extension

Daniel Horvath reports:

2nd small issue w playback. When I switch clips to playback the 'play' button doesn't show up. So I have to 'play' with the 'stop' then stop and the play button shows up.

This will be added in 1.0.1.


Revert "Revert "(PUP-6141) Move from forgeapi.puppetlabs.com to forgeapi.puppet.com""

Reverts the revert of puppetlabs/puppet#5020
The certificate issue with our testing forge instance has been resolved. This update and its tests have passed preliminary smoke tests on RHEL-7 and OSX-1011.

Waiting for CLA signature by @web-flow
@web-flow - We require a Contributor License Agreement (CLA) for people who contribute to Puppet, but we have an easy click-through license with instructions, which is available at https://cla.puppet.com/
Note: if your contribution is trivial and you think it may be exempt from the CLA, please post a short reply to this comment with details. http://docs.puppet.com/community/trivial_patch_exemption.html


PIR: variables are values

As in PLC. The place where this matters is deciding whether we need to
do a lazy match, so this removes a few of those.

Okay, done.