Catching PHP Exceptions in Javascript?

I regularly have JS code executing in V8 which calls PHP code. If that PHP code raises an exception, I want to catch the exception in Javascript.
Is that possible at all?
Here's some example Javascript:
try {
  PHP.throwException();
}
catch (err) {
  // do something in javascript
}

Bump?

Sorry for not answering earlier.
It definitely should be possible, but haven't tried yet. I wonder whether V8Js should provide a config option, enabling this behaviour. So the extension user can decide whether the exception should be escalated to JS side, and then back to PHP side (if JS doesn't catch) ... or directly to PHP

Stepping forward to implement this I stumbled over the fact, that JS execution continues even after the PHP exception was thrown.
<?php

class Foo {
    function throwException() {
        throw new \Exception("Test-Exception");
    }
}

$v8 = new V8Js();
$v8->foo = new \Foo();

$JS = <<< EOT
try {
    PHP.foo.throwException();
    // the exception should abort further executing, hence
    // the print must not pop up
    print("after throwException\\n");
} catch(e) {
    // JS should not catch in default mode
    print("JS caught exception");
}
EOT;

try {
    $v8->executeString($JS);
} catch (Exception $e) {
    var_dump($e->getMessage());
    var_dump($e->getFile());
    var_dump($e->getLine());
}
?>

The text "after throwException" currently appears, so probably not expected :-)

Apparently Javascript execution continues, but any PHP-method won't be called. Strange.. I verified with an older version of V8Js that it's been "always" like that.

Oh wow, you're right.
I've been having some weirdness going on which I hadn't investigated fully, but this would be the cause.

On 21 Aug 2015, at 9:52 pm, Stefan Siegl<EMAIL_ADDRESS>wrote:
Stepping forward to implement this I stumbled over the fact, that JS execution continues even after the PHP exception was thrown.
foo = new \Foo();

$JS = <<< EOT
try {
    PHP.foo.throwException();
    // the exception should abort further executing, hence
    // the print must not pop up
    print("after throwException\\n");
} catch(e) {
    // JS should not catch in default mode
    print("JS caught exception");
}
EOT;

try {
    $v8->executeString($JS);
} catch (Exception $e) {
    var_dump($e->getMessage());
    var_dump($e->getFile());
    var_dump($e->getLine());
}
?>
The text "after throwException" currently appears, so probably not expected :-)
—
Reply to this email directly or view it on GitHub.

Hmm, tests/exception_propagation_2.phpt even relies on this. I'm currently a bit unsure on how to fix this...

the problem occurs if immediate exception propagation is disabled
currently if executeString exits it checks for pending exceptions from previous calls and throws these; however after the code itself was executed

So if we now make sure to immediately stop JS execution if a PHP exception is thrown, then ...
class Foo {
        private $v8 = NULL;

        public function __construct()
        {
                $this->v8 = new V8Js(null, array(), array(), false);
                $this->v8->foo = $this;
                $this->v8->executeString('fooobar', 'throw_0');
                var_dump($this->v8->getPendingException());
                $this->v8->executeString('try { PHP.foo.bar(); } catch (e) { print(e + " caught!\n"); }', 'trycatch1');
                $this->v8->executeString('try { PHP.foo.bar(); } catch (e) { print(e + " caught!\n"); }', 'trycatch2');
        }

        public function bar()
        {
                echo "To Bar!\n";
                $this->v8->executeString('throw new Error();', 'throw_1');
        }
}

try {
        $foo = new Foo();

... fails.

the first executeString call causes an JS error, which is stored as a pending exception
the getPendingException call displays it, however doesn't clear it
the succeeding executeString call provides a try/catch for and Error thrown and calls bar before exiting
... the bar function calls executeString to throw the Error; and executeString will exit now, hence tests for the pending exception, notices it and throws a PHP exception + stops execution there
hence the catch-part of the second executeString is now not executed anymore

Besides this test also actually tests that the third executeString in __construct isn't called, since a PHP exception is now pending.
This leads me to some options

consider the test borked, leave pending exception behaviour as before and terminate execution as described above
throw pending exceptions only on out-most executeString level (so that might absorb pending exceptions)
like 2, throw pending exceptions if further exceptions occur, otherwise don't
in pending exception mode JS execution should not be terminated

I think options 2 to 4 might feel a bit magic to the user; I tend to pick option 1 ... what do you think?
This will get particularly funny if we throw PHP exceptions to JS; in the example above the JS-catch wouldn't get the expected Error thrown by bar, but the pending exception from a prior executeString call ...
... which again would be kindof magic to the user; hence should we only throw any other PHP exceptions to JS?
What about other V8Js exceptions? e.g. V8 calls PHP code, that calls V8 code in turn, that causes some kind of script exception or timeout?  Shall the JS code be able to see other V8 instances errors then?
I tend to accept this behaviour, if the implementor enables PHP->JS exception passing, any exception is passed, even unhandled pending ones
enough stuff for discussion, what do you think? @tahpot, @rosmo and others?

and another question: how to propagate the exception at best?
Simply convert any exception to an Error object, run getMessage on the Exception object and simply propagate the message?  Or better prepend some text like "PHP Exception:"?
Export the complete exception object to JS, so further method calls on it are possible?
And if JS doesn't catch the exception, what then? Throw simply ScriptException? Or a ScriptException and attach the original exception as previous exception?

and another question: how to propagate the exception at best?

I think it's best to replicate the information available in the PHP exception as much as possible.
Unsure if this is possible, but something like follows would be nice:

PHP exception occurs
In JS, a new exception is thrown of type PHPError. This is a JS error object that matches as closely as possible the underlying PHP Exception. Alternatively PHPError just has the same message as the PHP Exception and stores the PHP Exception object within it as a variable "PhpException".
If the PHPError is uncaught in JS, throw a ScriptException.
If a JSError is uncaught (as is the case at this point in execution), can ScriptException have a new method getJSError()?

As per your propagation questions, I'm still trying to get my head around it...

the problem occurs if immediate exception propagation is disabled

What is the use case for disabling exception propagation? That's unclear to me, which makes it difficult to consider the most appropriate solution.

What about other V8Js exceptions? e.g. V8 calls PHP code, that calls V8 code in turn, that causes some kind of script exception or timeout? Shall the JS code be able to see other V8 instances errors then?

I've run into this quite a bit and vote yes. Ideally you want the most accurate as possible history of exceptions otherwise debugging becomes very painful and it limits your ability to properly handle exceptions.

@tahpot I don't really know what disabled exception reporting is really good for, after all this behaviour can easily be achieved by wrapping the executeString method calls with try/catch blocks (after all you need error handling no matter what).  It just was around when I took over maintainership.
@rosmo maybe you can tell why it was implemented?

@stesie, I can't really recall... probably for some sort of compatibility stuff. Obviously it's correct to stop the JS execution on exception, but I would like this to be configurable (by default on is good) to keep things for breaking on our end.

@rosmo I'm not sure if it's a good idea to keep all stuff, that was around once, forever.
Currently V8Js has no stuff marked as deprecated, and I agree that we need to have backwards compatibility for some time. But not forever, especially if it was marked as deprecated for a while.
Stuff that comes to my mind immediately

passing time & memory limits to executeString method -> preferred way is using setTimeLimit and setMemoryLimit calls
also deprecate flags on executeString method, after all they're stored globally anyways
maybe: disabled exception reporting alltogether (i.e. the flag to __construct, getPendingException & clearPendingException)
maybe: passing variables to __construct (preferred way: setting properties on V8Js object: especially since behaviour currently differs slightly)

I consider publishing V8Js in 0.3.x version with PHP 7 compatibility only and all that stuff removed.
And leaving 0.2.x around with PHP 5.x support and those features, but marked deprecated

@stesie, Yeah, that seems like a decent plan to me.


TypeError: '_GenericAlias' object cannot be converted to 'PyType'

Initial Checks

[X] I confirm that I'm using Pydantic V2

Description
A field cannot be a generic type even with arbitrary_types_allowed=True.
Example Code
from typing import TypeVar, Generic

from pydantic import BaseModel

T = TypeVar('T')

class GenType(Generic[T]):
    pass

class Model(BaseModel, arbitrary_types_allowed=True):
    # works
    obj: GenType[int]

    # works
    objs: list[GenType[int]]

    # fails: TypeError: '_GenericAlias' object cannot be converted to 'PyType'
    obj_type: type[GenType[int]]

Python, Pydantic & OS Version
pydantic version: 2.6.4
pydantic-core version: 2.16.3
pydantic-core build: profile=release pgo=true
python version: 3.11.8 | packaged by conda-forge | (main, Feb 16 2024, 20:49:36) [Clang 16.0.6 ]
platform: macOS-14.1-arm64-arm-64bit
related packages: mypy-1.9.0 typing_extensions-4.10.0 pydantic-settings-2.2.1

@gsakkis,
Indeed, looks like we don't support this yet. PRs welcome!

Would love to see this fixed, we are trying to store type information on a Pydantic object and right now we need to wrap generic types like list[str] or list[int] in a different model so that we can use them inside a type[my_type] annotation.


Hash Field Expiration Support

Feature Request

Is your feature request related to a problem? Please describe
Redis now supports Hash Field Expiration
Describe the solution you'd like
The Lettuce driver would need to support the following commands to enable this feature:

[x] HEXPIRE
[x] HEXPIREAT
[x] HEXPIRETIME
[x] HPERSIST
[x] HPEXPIRE
[x] HPEXPIREAT
[x] HPEXPIRETIME
[x] HPTTL
[x] HTTL
[ ] HGETF
[ ] HSETF

Describe alternatives you've considered
Not Applicable
Teachability, Documentation, Adoption, Migration Strategy
N/A

HGETF and HSETF are not to be implemented until further notice


info, courseInfo, entry, course

fixed typos in tests, added tests for entry, course, info, and course Info. also implemented info and courseInfo.

Looks good, Merging


CrowdLabs: Remove flash from mashups

We should implement vismashups in html5 to make crowdlabs flash-free.

This is fixed.


Selecting a Tilemap node and then creating a new scene causes editor to crash

Operating system or device, Godot version, GPU Model and driver (if graphics related):
Windows 7
Godot 3.0
Geforce GTX 760
Issue description:
When a tilemap is currently selected in the scene tree, attempting to create a new scene, either from the menu or by double clicking a blank area in the scene tabs section, causes the editor to crash without errors.
Steps to reproduce:
Download and load attached project
Select the tilemap node
Try to create a new blank scene, editor should crash
Link to minimal example project:
tilemap_bug.zip

Just tested this with latest master, didn't crash for me.

I'll update and give it another try tonight then

How did it go? :)

Sorry, completely forgot to actually test it again, I've made a note on my phone this time :D

Doesn't seem to crash now :+1:


.attach file removes Content of File during Post

	Request.post(URL_FILE_UPLOAD) 			.attach('uploadedfile', acceptedFiles[0], acceptedFiles[0].name) 			.on('progress', event => { 				console.log('Progress', event.percent); 			}) 			.then((response)=>{ 				console.log('reaponse',response); 			} 			);

Have you verified it using other sources? I think devtools just don't display the content.

PR welcome with failing test if still an issue


(BOLT-44) refactor result handling and implement human output

This commit implements the human output format for bolt and adds a
node_started event to outputters to support this.
It also refactors how results are passed simplifying the number of
result classes. Previously there were two sets of result classes one
that was used in the transport for control flow which was translated to
a result of the second type for display. Now there is only a single set
of result classes which are returned by the transport run_* functions
directly. There are no longer separate classes for success and failure
the success? method should be called to differentiate between the two.
Control flow in transport logic has been refactored to use
raise/rescue/ensure instead of result.then/result.ensure.
TODO:

In order to maintain compatibility with ExecutionResults the to_h
method of the result class has not been changed. The to_result method
should be moved to to_h in the future when ExecutionResult can be
updated
The transport methods currently catch exceptions and generate "Result"
instances from them. This is unecessary since Exceptions are caught in
the executor as well. The transport methods should raise
Bolt::Node::BaseError subclasses and let the executor handle them

CLA signed by all contributors.

I didn't look at tests yet, going to leave that for after initial feedback is addressed.


Fix detecting availability of Xdebug's stack trace

Q
A

Is bugfix?
✔

New feature?
❌

Breaks BC?
❌

Tests pass?
✔

Fixed issues
#18477

👍

👍


atk reload

when antakia is launched a 2nd time, a text is displayed

This text is displayed in place of displaying the splash screen. As a matter of fact, the text described the widget graph of the splash screen.
I need to further investigate


Equipment scale and OGI camera

A few important changes:

Incorporation of equipment scale functionality for screening technologies (option between equipment and site level measurement).
Addition of an OGI "camera" that can crew can call and use
Built an "aggregator" that aggregates emissions from leaks to equipment and sites called by any method

Outstanding:

Still need to incorporate SVL and MVL so that certain types of systems can do "instant follow up"

@tbarchyn @KeeganShaw-GIS @AkaMrmuffin Please review

@tbarchyn  Thanks for the approve


feat: Add root_block_device input for module self_managed_node_group

Description

Replace the root volume by specifying root_block_device as describe for module self_managed_node_group
Motivation and Context

Currently, we can achieve this purpose by declaring in the block_device_mappings but we must specify device_name correctly. device_name  depends on the root_block_device attribute of the AMI and it is /dev/xvda as usual.
With this feature, we won't worry about filling exactly device_name if we want to replace the root block device.
Replacing if the AMI supports ebs device type via the root_device_type attribute.

Breaking Changes

None
How Has This Been Tested?

[ x] I have updated at least one of the examples/* to demonstrate and validate my change(s)
[ x] I have tested and validated these changes using one or more of the provided examples/* projects

[ x] I have executed pre-commit run -a on my pull request

thank you - however, this is not a change that we will be accepting at this time


Update -gdiplus-font-flat.md

Updated documentation to include GdipPrivateAddFontFile and GdipPrivateAddMemoryFont

Making updates from two PR's to one a tweak.


Can't get it to work

What you need help with
Hi, so I was trying to connect my two servers and proxy on my local computer but I'm struggling to do it. I've asked about it on Skunity Discord but the two people what were helping me with it, didn't really know how to fix it.
What you've tried so far
I have set all the ports to 8000 and the Skungee host to <IP_ADDRESS>-3. When I try to send a signal to other server I get the error on the image below.
Specifications
Skungee Version: Skungee-2.0.0-BETA-4
Proxy Platform and Version: BungeeCord and I don't know the version but I have downloaded it a few days ago so I think the latest.
System/Panel (if applicable): Windows 11
The issue thread on Skunity: https://discord.com/channels/135877399391764480/1040865949823291443

same thing


Helm seems to apply custom resource before CRD

Output of helm version:
Client: &version.Version{SemVer:"v2.14.2", GitCommit:"a8b13cc5ab6a7dbef0a58f5061bcc7c0c61598e7", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.14.2", GitCommit:"a8b13cc5ab6a7dbef0a58f5061bcc7c0c61598e7", GitTreeState:"clean"}

Output of kubectl version:
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.0", GitCommit:"641856db18352033a0d96dbc99153fa3b27298e5", GitTreeState:"clean", BuildDate:"2019-03-25T15:53:57Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"13+", GitVersion:"v1.13.8-eks-a977ba", GitCommit:"a977bab148535ec195f12edc8720913c7b943f9c", GitTreeState:"clean", BuildDate:"2019-07-29T20:47:04Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}

Cloud Provider/Platform (AKS, GKE, Minikube etc.):
Amazon EKS
The following mini-repro creates a CRD for Kind=Test2 and then creates an object of type Kind=Test2. When executed in the correct order, the YAML is valid. However, when applied with helm, it appears as if the object is created before the CRD which defines it
The following is output:
UPGRADE FAILED
Error: unable to recognize "": no matches for kind "Test2" in version "group.name/v1"
Error: UPGRADE FAILED: unable to recognize "": no matches for kind "Test2" in version "group.name/v1"

The repro is as follows (executable in bash):
helm create order-test
echo "
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: tests2.group.name
spec:
  group: group.name
  versions:
    - name: v1
      served: true
      storage: true
  scope: Cluster
  names:
    plural: tests2
    singular: test2
    kind: Test2
    shortnames: []
  preservedUnknownFields: true
---
apiVersion: group.name/v1
kind: Test2
metadata:
  name: example
spec:
  foo: bar
" > order-test/templates/test.yaml
helm upgrade --install a-test order-test

I'm not sure if helm installs resources according to a particular order. But just to be safe, you might want to use a crd-install hook. This ensures the CRD definitions be applied prior to its resources.

Good pointer archelangelo.
Order is supposed to be guaranteed here https://github.com/helm/helm/blob/9ad53aac42165a5fadc6c87be0dea6b115f93090/pkg/tiller/kind_sorter.go#L133
and an unknown resource kind should be ordered last, which makes this repro seem like a bug unless I am missing something.
Although it does appear crd-install hooks are meant to solve this problem, I am surprised they would be necessary if the only dependency is an unknown kind given the order guarantees.

Ah! That's interesting. I didn't know this, though it makes perfect sense. I worked with CRD installation in helm couple weeks ago and clearly remember this kind of error are thrown pretty frequently (not to mention helm delete --purge doesn't remove CRDs). The only cause I can think of then is that the CRDs won't be ready right after being applied?

Im closing this because I think the issues are pretty well covered by #4697
Really this whole situation seems pretty messy. Will continue there.


Fix the metadata on 5 year aggregation

@marjy, can you (or someone familiar with the simulation) please go to this link:
https://github.com/ioos/comt_2/blob/master/cb_hypoxia/VIMS_CHesROMS-ECB/5year/test.yaml
and then click the pen icon (screen grab below) and edit the metadata for this simulation?:
When you are done editing, click the link at the bottom to submit a pull request.
I purposely cut-and-pasted a summary from a different simulation so that you will want to fix it!
Tough love!  :smiley_cat:

You bet! I edited it as you mentioned.
I did get a message saying that I was editing a project that I don’t have write access to. Apparently they’ve created a fork of this project for me to commit my proposed changes to. I’m not sure what it means when it says: “Submitting a change to this file will write it to a new branch in your fork, so you can send a pull request”?
But I tried!
I also changed “NSF” to “NASA” under acknowledgments, since NASA provided the funding for the model development.
Marjy
On Jul 22, 2015, at 4:05 PM, Rich Signell <notifications<EMAIL_ADDRESS>wrote:
@marjyhttps://github.com/marjy, can you please click the pen icon and edit this file:
https://github.com/ioos/comt_2/blob/master/cb_hypoxia/VIMS_CHesROMS-ECB/5year/test.yaml
When you are done editing, click the link at the bottom to submit a pull request.
I purposely cut-and-pasted a summary from a different simulation so that you will want to fix it!
Tough love! [:smiley_cat:]
—
Reply to this email directly or view it on GitHubhttps://github.com/ioos/comt_2/issues/1.


feat: Add offline payment methods

Details:

Add offline payment method details
Only add available payment methods

Fixes: #1839

UI screenshots?

I just realize there is a problem with this PR, I"m fixing it and I'll send the screenshot as well

UI:


Upgrade httpx

I had thought pretty long about whether to get the PR for removing httpx requirement (#1850), but that didn't seem quite appropriate just yet.
Because httpx is a fairly fast moving project, there were a number of changes needed to be made to some tests as well as the test client. Hopefully, we will get sanic-testing completed and then we will not need to deal with these changes here.

ReuseableSanicTestClient and DelayableHTTPConnection are some pretty hairy hacks I put together a couple of years ago in order to test the HTTP Keep-Alive mechanism, and Request Timeouts respectively.
They're a pain to maintain, but I don't know of any other way to test these features (unless httpx gets these features natively).
It might be worth considering pulling these out of the sanic test code and into the Sanic-Testing project, to keep all of that stuff together.

Black test failing:
would reformat /home/travis/build/huge-success/sanic/sanic/testing.py
would reformat /home/travis/build/huge-success/sanic/sanic/response.py

I agree. I have written and rewritten those several times because of the fast pace at which underlying libraries reorganize themselves. I do have a thought on how to handle, and this is actually THE reason I think we need to hold off on sanic-testing for now.
While I understand the desire to move them out to keep them closer, I think the test themselves need to stay here because it is Sanic functionality we need to worry about.
Therefore, I want to add the functionality into the core of sanic-testing so the tests can stay, but the hack clients can go.

Had to upgrade black and isort with the particular env I had running. Should be ready when done building.


Not able to view the shopping cart

Hello,
I'm new to Saleor. I have given it a try locally using docker. After I added a product to the bag, I tried to view the shopping cart. But it shows empty page. The errors in the console shows error below "line.variant.product is undefined".

Does anyone know what's wrong there?
Thanks,
Frank

Check out the lastest commit on saleor-storefront-master, the issue has been resolved.

Thanks for the quick response. The error still persists. Below is what I have done:
Pulled the latest code and cleared the browser cache.
`
% git pull origin master
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 1), reused 2 (delta 1), pack-reused 0
Unpacking objects: 100% (3/3), done.
From https://github.com/mirumee/saleor-platform

branch            master     -> FETCH_HEAD
119b3f1..4ee5fc2  master     -> origin/master
Fetching submodule saleor-storefront
Failed to add the RSA host key for IP address '<IP_ADDRESS>' to the list of known hosts (/Users/test/.ssh/known_hosts).
From github.com:mirumee/saleor-storefront
be376bd1..df3b2802  2.10                   -> origin/2.10
[new branch]        cover-inputs-with-datacy -> origin/cover-inputs-with-datacy
9ffc58e6..9c478313  master                 -> origin/master

7367c7c9...7f53550b merge-with-demo        -> origin/merge-with-demo  (forced update)
da8d3076...2e57dd47 ref/separate-sdk       -> origin/ref/separate-sdk  (forced update)
9fa444ac...704a1efc refactor/sdk-user-auth -> origin/refactor/sdk-user-auth  (forced update)

[new branch]        update-changelog       -> origin/update-changelog
[new tag]           2.10.2                 -> 2.10.2
Updating 119b3f1..4ee5fc2
Fast-forward
saleor-storefront | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
`

Add a product to the bag
Observe: the "1" sign shows up in the bag. But see 4 graphql errors reported as:
graphql.error.base.GraphQLError: Fields "quantityAvailable" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.

Click view the shopping cart
Observe: blank screen with the same error reported in console as reported initially.
Thanks

I'm not sure if they update the saleon- platform, but my local deployment works fine.
Make sure you log out recent login.

It works now. Thanks


Check JWT vulnerability

Can somebody tell me if this gem is affected by this vulnerability in some way?
Thanks

It may be depending on how you are using it.
If you disable verification when calling decode, you are vulnerable.
Assuming you do not disable verification, you may still be vulnerable. It is possible to specify the algorithm in the options passed to decode. If you enforce the algorithm, then your application will not be exposed to that vulnerability.
If you do not enforce the algorithm when decoding (or must allow more than one algorithm), depending on the implementation of your keyfinder algorithm passed in, your application may be vulnerable.

@danleyden I think the reliance on the alg header should be dropped and decode should accept a parameter for the algorithm like the author of the op's article suggests. What do you think?
I can patch this. I would replace decode's second parameter 'verify' with a string that specifies the algorithm. If a consumer wishes to skip verification they can use the algorithm "NONE". I can assume false means "NONE" to avoid a break (though if consumers specified true for verify I'd have to throw). I think the vulnerability should be fixed at the library level though, not application.

@thedeeno The alg header is really important and useful in some use cases and its use should not be dropped - it is an important (required) part of the spec.
Take for example the case where multiple algorithms are acceptable to the service receiving the token. In order to ensure that the token is valid, the library needs to know specifically which algorithm was used to generate the signature (or encrypt the token for that matter).
I do not believe that altering the semantics of the second parameter (verify) is a good idea. That would break backwards compatibility (including for myself) as that parameter controls all verification, not just the algorithm.
The functionality to allow the application to specify the algorithm is already in place via the options parameter. The consumer can (in most cases should) provide algorithm when calling decode using something along the lines of: JWT.decode(token, key, true, algorithm: 'RS512').
Given that this is already in place, it may be better to improve the documentation here to point consumers at best practice ways of using the library rather than break backwards compatibility. It may be a good idea to have this better practice more enforced in version 2 (which I know there has been some work on).

@danleyden I think this library should be secure by default. It makes me nervous that consumers need to use optional parameters to protect against vulnerabilities.
I think breaking backwards compatibility to close a security vulnerability is worth it. If this requires a major version bump, then so be it.
Most people will use the simplest API available when starting to use this library; making beginners the most vulnerable.
I suspect the spec is going to change to reflect Tim McLean's recommendation. Giving an attacker control of the verification algorithm is likely a mistake.
Just my 2cents.

@danleyden Hmm, it appears 1.4.1 doesn't support the :algorithm option. Master does. Perhaps a new release should be cut so users can work around this vulnerability without being forced to track head?

Sorry for the email spam. We can't track the head from Gemfile easily either, since there's no .gemspec in repo.


Add note about tiller RBAC on the quickstart guide

Add instructions on how to configure the default ServiceAccount on
the kube-system namespace so it acts as a cluster-admin.
While not recommended for production, it's good enough to give maesh a
try on an isolated environment.
Fixes: https://github.com/containous/maesh/issues/225

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

Thanks for your contribution @ereslibre


Fixed download configuration file for peer

In dashboard.py url path will be changed but not in template,

Hi I would like keep the download as part of the URL to be easier to recognize


changed default temperature from 0.0 to 0.02

Empirically, having a temperature not identically 0 works a bit nicer. This could be an option for the user to set, as I previously had but this is very temperamental so I think the user should only be able to change it if they are really sure.

I think this should be solved differently, see above. Suggest to close without merging.

Will refactor this, closing request


Demonstration of Showcase Submission

Showing how to add a showcase submission!

There seems to an issue with requiring npm run clean when showcase submissions are added. This preview for this pull request does not show the submission:
https://deploy-preview-154--codingtrain-preview.netlify.app/challenge/167-prime-spiral

When host the branch locally on my laptop, the submission shows up after I run npm run clean:

Any idea why this might be happening? @runemadsen Do you know if there is a netlify setting I can change to force npm run clean?
In theory, there maybe is not problem if the showcase project shows up upon merge but it would be really nice to be able to double-check a preview before merging!

Quick update, I tried this option—"Clear Cache and Retry Deploy"—on netlify and now it shows up! Seems like an extra unnecessary step, is there a way to force it to clear!?

Quick update, I tried this option—"Clear Cache and Retry Deploy"—on netlify and now it shows up! Seems like an extra unnecessary step, is there a way to force it to clear!?

How about setting npm run clean && npm run build in Netlify's site settings (Build and deploy)?

How about setting npm run clean && npm run build in Netlify's site settings (Build and deploy)?

Ok, I'm trying this!


Update READ.ME

I've added some links to Twitter accounts of astronomy scientists, astronomers and science communicators, among other useful links :)

Hi @JuliaBrazolim Awesome work!! 🚀 Great content. Thank you so much for your contribution! 🥇 Merged 🎉


Separate PCs and NPCs

Coverage remained the same at 100.0% when pulling ade865cf492155ebc4f17f00d4d1c35197ea1f0a on feature/23 into 2268399f8ec65e2e02a3e007af423ea2944d090d on master.


Specify bindings for notification discovery over various transports

When the notification spec was written we left the bindings to particular transports like BLE or Wi-Fi as an open issue. It's now time to close the issue.

Need to finish the section on how to switch from discovery to TLS and then need to review all the text I wrote before sending  it out for review.

10/26 - I finished and send out Android and iOS as well as TLS binding. Now need to do wi-fi ap binding and then I'm done with that spec.

Write proposal for how to fix our iOS issue for replication manager
Finish Wi-Fi Proposal to unblock Ville
Check out Android proposal to see if we can distinguish different unsecure RFComm connections
Add text about not properly binding TCP/IP ports and how we can fix if we care but probably won't and will use a HTTP proxy instead because how would you know what port to connect to anyway?
Completely change the iOS proposal in face of the problems with having two simultaneous MCSessions with the same peers.

Need to do a tiny bit of cleanup on SSDP

I'm going to close this in favor of a dedicated issue to rewrite the iOS binding


Add a dockerfile + a build GHA

Use repo2docker-action (https://github.com/jupyterhub/repo2docker-action) for familiar (to 2i2c) tagging behavior
Use python images as base, rather than micromamba because I could not get the micromamba image to work.
Push to quay.io, now that the repo is public (rather than a private GCP Artifact Registry)

Ref https://github.com/2i2c-org/unnamed-thingity-thing/issues/107

This is ready to go, and I've populated secrets accordingly. Since @rhoadesScholar has requested a review from @mzouink, I'll wait for that :)


Updated JSON3 dependency to 3.3.0

In our application we had issues with the JSON3 version used, so I've updated everything and bumped the release number.

I just wanted to let you know that we've stopped development on this project.


Visual Overhaul using BEM naming convention

Redesign some components.
index.php new classes

"main-filesource"
"main-footer"
"main-footer__warning"
"main-footer__extension"

info_v3.js reword "Synopses" to "Synopsis"
index_v3.js change width 640 to 642

Why change width from 640px to 642px?

I thought there will be some conflict on display "aesthetic". Well I don't see any problem, it can stay at 640 I guess.

Visual Overhaul
Home:

About:

Changelog:

FAQs:

Terms:

Some screenshot on new color.  Will be working next on dark mode switcher.

New mobile navigation v1

Update: Now using BEM naming convention
The new design:
https://i.gyazo.com/358ee3192a267f39de3a72a20356bb3c.gif

Per page:

Have you tried the search results layout? with anilist panel and thumbnail images previews

Update: Now using BEM naming convention
The new design:
https://i.gyazo.com/358ee3192a267f39de3a72a20356bb3c.gif

Per page:

Preferably I'd like to use the same color theme for all pages, like youtube is red in all pages, facebook is blue for all its pages.

It seems your css\app.css uses CSS variables which Internet Explorer 11 does not support
Can you test your layout on IE?

Sure i'll try it out

It seems your css\app.css uses CSS variables which Internet Explorer 11 does not support
Can you test your layout on IE?

Working on fallback version now.

Have you tried the search results layout? with anilist panel and thumbnail images previews

I can but it will take some time since all elements are in info_v3.js
PS: No thumbnail I just copy the source from trace.moe (Its the same after all)

Have you tried the search results layout? with anilist panel and thumbnail images previews

I can but it will take some time since all elements are in info_v3.js
PS: No thumbnail I just copy the source from trace.moe (Its the same after all)

It seems to me the top nav bar is too thick, taking too many vertical space. And the recent updates notification bar... seems occupying too much space too. But I'm not sure if there're better place to put it. Do you have better ideas?

Have you tried the search results layout? with anilist panel and thumbnail images previews

I can but it will take some time since all elements are in info_v3.js
PS: No thumbnail I just copy the source from trace.moe (Its the same after all)

It seems to me the top nav bar is too thick, taking too many vertical space. And the recent updates notification bar... seems occupying too much space too. But I'm not sure if there're better place to put it. Do you have better ideas?

working on it

Well I just adjust the thickness after all.

Style update for search, results list, info.
Search:

Update stylesheet to LESS (Includes non minified and minified version of CSS).
Update classes, design, texts, indentions, divs
Add terms in sitemap.txt
Change css links to app.min.css

Ready to merge anytime. If there's any problem or bug you can contact me anytime. Thank you.
Closing pull request.


Larky Third Party Applications

Proposing an interface for calling third party operations made available via the marketplace.
Assuming we provision an application that provides an operation for virus scanning we can invoke like this
Given an application defined like (see marketplace spec)
apiVersion: 1.0.0
kind: App
data:
  fqn: myCompany/virusScanner

and it has been provisioned onto a vault, it would become available to be invoked via larky like so:
# namespace/app-name/function-name
@loads('myCompany/virusScanner/scan')
def process(input, ctx):
    result = myCompany.virusScanner.scan(input, ctx)
    # do something with result
    if result.hasVirus:
       return abort(400, 'You have a virus')
    return input

Local development can be enabled by the app providing a basic mocked request/response that allows integrators to receive a static response without running a stand-alone server in their local environment.
We would need to publish a basic request/response somehow so that the api for the method call is available to the developer.

@mjallday did this get resolved with #71 ?


refactor(backend): unauthenticated user object

Motivation: We have in our resolvers every time we fetch the user from the context a test, that the user exists.
This is because of the type definition of the user in the context, which may be null. To get rid of the if statements, I created an unauthenticated user object with id -1, that is put in the context when the user is not authenticated.
The coverage of branches is now 9% higher, and we do not have that useless code anymore.
Please check for any authentication issues.

🍰 Pullrequest

Issues

None

Todo

[X] None

@roschaefer May you have a look again?


Implement some sort of heartbeat or analytics

e.g slack or GA

Merged.
Resolved with slack notifications and the existing GA on the designsystem.gov.au site.


#1326 tooltip in profile nuxt

Thank you for your contribution to the KodaDot NFT gallery.
👇  _ Do a quick check before the merge.
PR type

[ ] Bugfix
[ ] Feature
[ ] Refactoring

Before submitting Pull Request, please make sure:

[ ] My contribution builds clean without any errors or warnings
[ ] I've merged recent default branch -- main and I've no conflicts
[ ] I've tried respect high code quality standards
[ ] I've didn't break any original functionality
[ ] I've posted screenshot of demonstrated change in this PR

Optional

[ ] I've tested it at </rmrk/collection/26902bc2f7c20c546a-1FVG7>
[ ] I've tested PR on mobile and everything works
[ ] I found edge cases

What's new?

[ ] PR closes #1404
[ ] <brief_description_of_what_I've_added>

Had issue bounty label ?

[ ] Fill up your KSM address: Payout

Community participation

[ ] Are you at KodaDot Discord?

Screenshot

[ ] My fix has changed something on UI, a screenshot for others, is best to understand changes.

yeah works for me original feature,

but behaves broken, might not be related to this commit, might be

Hey! @prachi00 It seems that we still have the duplicated tabs here

Hey! @prachi00 It seems that we still have the duplicated tabs here

@roiLeo where? I am unable to see it

Hey! @prachi00 It seems that we still have the duplicated tabs here

@roiLeo where? I am unable to see it

See preview:
https://deploy-preview-1484--koda-nuxt.netlify.app/rmrk/u/HCWd8fTKDejDe8nq2qJXzF3U9J3DZx3SQXUNmwLxC1sLrso
Something went wrong.

Hey! @prachi00 It seems that we still have the duplicated tabs here

@roiLeo where? I am unable to see it

See preview: https://deploy-preview-1484--koda-nuxt.netlify.app/rmrk/u/HCWd8fTKDejDe8nq2qJXzF3U9J3DZx3SQXUNmwLxC1sLrso Something went wrong.

Have fixed this

Perfect, I’ve sent the payout
https://kusama.subscan.io/extrinsic/0x20b6b4092c333f579ea953c5b322924a4e1be8f7950b3abbd2185d1f1d15476d
Let’s grab another issue and get rewarded!
https://github.com/kodadot/nft-gallery/issues/


Document generator improvement

The current implementation of the document generator which generates a Word or Pdf document depending on the template requires manual unzipping a Word file and extracting a xml document. Generating a Word or Pdf file from a template is a common task that can be useful to many users. Therefore, this feature can be extracted in another independent library with the following API.
document_generator = DocumentGenerator(
    template='document_template.docx',
    name='my_document',
    output_dir='~/documents',
    variables={'variable1': 'value1', 'variable2': 'value2'}
)
word_path1 = document_generator.generate_docx()
# word_path1 = '/home/user/documents/my_document.docx'
word_path2 = document_generator.generate_docx(
    name='another_document',
    output_dir='~/another_documents/',
    variables={'variable1': 'value1', 'variable2': 'value2'}
)
# word_path2 = '/home/user/documents/another_document.docx'
pdf_path = document_generator.generate_pdf()
# pdf_path = '/home/user/documents/my_document.pdf'

Also, instead of our own solution, we should consider the python-docx-template library. If we use this library, we only need to implement the conversion from docx to pdf because there is no ready solution for Linux.
word_to_pdf(input_path='~/documents/document.docx', output_path='~/documents/document.pdf')

The only problem is that the library uses Jinja2 instead of Django templates.


Letv Incomplete download

Recent usage of youtube-dl with letv.com causes problems where the video is incompletely fetched. For example, using it on the following video:

youtube-dl -f 350 http://www.letv.com/ptv/vplay/1839416.html

will download a 24 MB file. But originally, the lowest resolution (at 350) should be 79 MB. The same goes for other resolutions. The video notably stops at around the 10 minute mark, even though the entire video should be much longer.
It may be that the videos by Letv are now split up like Youku and Tudou. The flvcd site, though, suggests this is not the case.

Confirmed.


About Reverse Conversion

First of all, thank you for providing this excellent project.
Can you provide a latex expression conversion formula

Can you please elaborate? Do you want to create an image directly from LaTeX instead of the simple text formula?

Sorry, my description was not accurate enough.
e.g.
I have expression LaTex, \left(\frac{{a}{1}}{{\left({b}{1}+\sqrt{c}\right)}^{2}}\right)+\sin{\left({a}{2}\cdot {b}{2}\right)}.
I want original formula, (a_1 / (b_1 + sqrt(c))^2) + sin(a_2 * b_2)
The scene has already recognized the Latex expression, and we hope it can be translated into a computable expression

I'm sorry but this is an entirely different task compared to what this package is about. Either you implement this from scratch or you find an existing LaTeX parser that can do something like this.


Add textlint tooling

After playing around with vale.sh for some time, I figured out that textlint might be the better tool for us, since it's config neatly fits into the package.json, so we don't need to add a huge list of additional files. Also there's some capability for "auto-fixing" which is nice if used in the visual code UI.
I still want to build this incrementally, so instead of pulling in a HUGE set of rules I wrote some terminology settings from scratch, mainly following the CNCF style guide, e.g. "open-source" vs "open source" or "K8s" vs "K8S" and the suggested check how CNCF projects prefer their naming (gRPC vs grpc vs GRPC).
There's two issues right now with textlint:

A bug that it does not catch wrong use of terms at the end of the line (will raise an issue for that with the project) now it works 🤷
It works well with markdown but has issues again with hugo

Additionally I added a cspell.json, so instead of having each and every word ignored in the file we can maintain a global set of words.

I removed the changes for the cpp docs

Yeah, I was on the fence for tabpane, but it feels ok for it to stay in the global file.


Percent complete

Note that this should be merged in parallel with matching PR in serval: https://github.com/sillsdev/serval/pull/78

This change is

This implements https://github.com/sillsdev/serval/issues/44.

src/SIL.Machine.AspNetCore/Services/ClearMLService.cs line 236 at r1 (raw file):

        return status;
    }

The code looks fine - see comments in https://github.com/sillsdev/serval/issues/44 primarily about supporting inferencing.  We need a plan that can work with it very shortly - and LastIteration won't work well.

@ddaspit - Should we put them all on the ClearML queue? How many can it handle? Should the be in both queues? What is the best mechanism for this? If we have 50 items in the ClearML queue, can we make one call to see everything in the queue instead of 50 calls? What about multiple instances of Serval using the same ClearML instance (QA, prod)? Should they have different project names such as Serval-<random 6 digit Hex ID> or, have them all in the same project but have the experiment name be -? Note that machine does not know what instance it is actually in...
One potential solution could be to query ClearML every 5 seconds once for all queued items that match a specific pattern (that corresponds with the specific instance of Serval) and query MongoDB once for all current builds - and if there is an update to make in MongoDB, make it. If any jobs have been cancelled, aborted or failed in one (ClearML or MongoDB), update the other.

Update after talking with @Enkidu93 - Let's make the following updates:

number to dequeue = number of clearML agents on the queue * 2
Number in the queue is a combination of Hangfire queue and ClearML queue
% complete can be 90/10 split training/inference - and inference progress can be posted through logging scalar values in ClearML and called from the API.

@ddaspit  - we made some more updates to the proposed algorithm here (see the last comment): https://github.com/sillsdev/serval/issues/44.  What do you think?

src/SIL.Machine.AspNetCore/Services/ClearMLNmtEngineBuildJob.cs line 138 at r2 (raw file):

                        }
                        previousClearMLTasks = currentClearMLTasks;
                        goto case ClearMLTaskStatus.InProgress;

Let's remove the queue logic for right now and commit it to a branch to be dealt with later.

src/SIL.Machine.AspNetCore/Services/ClearMLNmtEngineBuildJob.cs line 152 at r2 (raw file):

                                clearMLTask.LastIteration,
                                (clearMLTask.LastIteration / (float)_options.CurrentValue.MaxSteps) * 90.0
                                    + (inferencePercentComplete / 100.0f) * 10.0,

To account for potential early stopping, if inferencePercentComplete > 0, assume training is done and just put in the 90%.

src/SIL.Machine.AspNetCore/Services/ClearMLService.cs line 205 at r2 (raw file):

    )
    {
        var body = new JsonObject { ["id"] = taskId };

Can you add some comments as to why hashes are used and how the data is extracted?

src/SIL.Machine.AspNetCore/Services/ClearMLService.cs line 198 at r2 (raw file):

    }

    private async Task<string?> GetMetricAsync(

rename to GetTaskMetricAsyc

src/SIL.Machine.AspNetCore/Services/ClearMLService.cs line 267 at r2 (raw file):

                tasksAheadInQueue.Add(name);
        }
        return tasksAheadInQueue;

Remove this queue logic as specified above.

src/SIL.Machine.AspNetCore/Services/ClearMLService.cs line 236 at r1 (raw file):
Previously, johnml1135 (John Lambert) wrote…
The code looks fine - see comments in https://github.com/sillsdev/serval/issues/44 primarily about supporting inferencing.  We need a plan that can work with it very shortly - and LastIteration won't work well.

It should work for now - when inferencing is added, we can just have inferencing take all 100% of the progress.

src/SIL.Machine.AspNetCore/Services/IClearMLService.cs line 35 at r2 (raw file):

        CancellationToken cancellationToken = default
    );

Remove.

@johnml1135 I've removed the queue logic and, I believe, responded to the other reviews. Let me know if anything needs to be changed as you make alterations in machine.py.

src/SIL.Machine.AspNetCore/Services/ClearMLNmtEngineBuildJob.cs line 112 at r3 (raw file):
Previously, ddaspit (Damien Daspit) wrote…
Do we need a separate request to get this information? Can we get it in the GetTaskAsync call?

(Sorry for the delay). We could - if you're OK with me changing the ClearMLTask data class. I'm not sure if it would deserialize properly without some help since the metric is stored in a serialized hashmap of hashmaps. (Thus, MD5 popping up in the ClearML service). I can pursue that if you like; just give me a thumbs up.

Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @Enkidu93)

src/SIL.Machine.AspNetCore/Services/ClearMLNmtEngineBuildJob.cs line 112 at r3 (raw file):
Previously, Enkidu93 (Eli C. Lowry) wrote…
I think it is worth checking out. We want to minimize the number of requests we make to ClearML as much as possible.

I'll check it out.

@johnml1135 Are you still working on the machine.py end of this? Any updates?

Finished here.


language server Option::unwrap() on a None value

RestApi.roc:
module [get, post]

import json.Json

User : {
    name : Str,
    owes : Dict Str F64,
    owedBy : Dict Str F64,
    balance : F64,
}

Database : { users : List User }

get : Database, { url : Str, payload ? Str } -> Result Str _
get = \database, { url, payload ? "" } ->
    crash "Please implement the 'get' function"

post : Database, { url : Str, payload ? Str } -> Result Str _
post = \database, { url, payload ? "" } ->
    crash "Please implement the 'post' function"

main.roc:
# These tests are auto-generated with test data from:
# https://github.com/exercism/problem-specifications/tree/main/exercises/rest-api/canonical-data.json
# File last updated on 2024-09-09
app [main] {
    pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.15.0/SlwdbJ-3GR7uBWQo6zlmYWNYOxnvo8r6YABXD-45UOw.tar.br",
    json: "https://github.com/lukewilliamboswell/roc-json/releases/download/0.10.2/FH4N0Sw-JSFXJfG3j54VEDPtXOoN-6I9v_IA8S18IGk.tar.br",
}

main =
    Task.ok {}

import RestApi exposing [get, post]

standardizeResult = \result ->
    result
    |> Result.try \string ->
        string
        |> Str.replaceEach ".0," ","
        |> Str.replaceEach ".0}" "}"
        |> Str.toUtf8
        |> List.dropIf \c -> [' ', '\t', '\n'] |> List.contains c
        |> Str.fromUtf8

##
## user management
##

# no users
expect
    database = {
        users: [
        ],
    }
    result =
        database
        |> get {
            url: "/users",
        }
        |> standardizeResult
    expected = Ok "{\"users\":[]}"
    result == expected

# add user
expect
    database = {
        users: [
        ],
    }
    result =
        database
        |> post {
            url: "/add",
            payload: "{\"user\": \"Adam\"}",
        }
        |> standardizeResult
    expected = Ok "{\"balance\":0,\"name\":\"Adam\",\"owed_by\":{},\"owes\":{}}"
    result == expected

# get single user
expect
    database = {
        users: [
            {
                name: "Adam",
                owes: Dict.fromList [],
                owedBy: Dict.fromList [],
                balance: 0.0,
            },
            {
                name: "Bob",
                owes: Dict.fromList [],
                owedBy: Dict.fromList [],
                balance: 0.0,
            },
        ],
    }
    result =
        database
        |> get {
            url: "/users",
            payload: "{\"users\": [\"Bob\"]}",
        }
        |> standardizeResult
    expected = Ok "{\"users\":[{\"balance\":0,\"name\":\"Bob\",\"owed_by\":{},\"owes\":{}}]}"
    result == expected

##
## iou
##

# both users have 0 balance
expect
    database = {
        users: [
            {
                name: "Adam",
                owes: Dict.fromList [],
                owedBy: Dict.fromList [],
                balance: 0.0,
            },
            {
                name: "Bob",
                owes: Dict.fromList [],
                owedBy: Dict.fromList [],
                balance: 0.0,
            },
        ],
    }
    result =
        database
        |> post {
            url: "/iou",
            payload: "{\"amount\": 3.0, \"borrower\": \"Bob\", \"lender\": \"Adam\"}",
        }
        |> standardizeResult
    expected = Ok "{\"users\":[{\"balance\":3,\"name\":\"Adam\",\"owed_by\":{\"Bob\":3},\"owes\":{}},{\"balance\":-3,\"name\":\"Bob\",\"owed_by\":{},\"owes\":{\"Adam\":3}}]}"
    result == expected

# borrower has negative balance
expect
    database = {
        users: [
            {
                name: "Adam",
                owes: Dict.fromList [],
                owedBy: Dict.fromList [],
                balance: 0.0,
            },
            {
                name: "Bob",
                owes: Dict.fromList [
                    ("Chuck", 3.0),
                ],
                owedBy: Dict.fromList [],
                balance: -3.0,
            },
            {
                name: "Chuck",
                owes: Dict.fromList [],
                owedBy: Dict.fromList [
                    ("Bob", 3.0),
                ],
                balance: 3.0,
            },
        ],
    }
    result =
        database
        |> post {
            url: "/iou",
            payload: "{\"amount\": 3.0, \"borrower\": \"Bob\", \"lender\": \"Adam\"}",
        }
        |> standardizeResult
    expected = Ok "{\"users\":[{\"balance\":3,\"name\":\"Adam\",\"owed_by\":{\"Bob\":3},\"owes\":{}},{\"balance\":-6,\"name\":\"Bob\",\"owed_by\":{},\"owes\":{\"Adam\":3,\"Chuck\":3}}]}"
    result == expected

# lender has negative balance
expect
    database = {
        users: [
            {
                name: "Adam",
                owes: Dict.fromList [],
                owedBy: Dict.fromList [],
                balance: 0.0,
            },
            {
                name: "Bob",
                owes: Dict.fromList [
                    ("Chuck", 3.0),
                ],
                owedBy: Dict.fromList [],
                balance: -3.0,
            },
            {
                name: "Chuck",
                owes: Dict.fromList [],
                owedBy: Dict.fromList [
                    ("Bob", 3.0),
                ],
                balance: 3.0,
            },
        ],
    }
    result =
        database
        |> post {
            url: "/iou",
            payload: "{\"amount\": 3.0, \"borrower\": \"Adam\", \"lender\": \"Bob\"}",
        }
        |> standardizeResult
    expected = Ok "{\"users\":[{\"balance\":-3,\"name\":\"Adam\",\"owed_by\":{},\"owes\":{\"Bob\":3}},{\"balance\":0,\"name\":\"Bob\",\"owed_by\":{\"Adam\":3},\"owes\":{\"Chuck\":3}}]}"
    result == expected

# lender owes borrower
expect
    database = {
        users: [
            {
                name: "Adam",
                owes: Dict.fromList [
                    ("Bob", 3.0),
                ],
                owedBy: Dict.fromList [],
                balance: -3.0,
            },
            {
                name: "Bob",
                owes: Dict.fromList [],
                owedBy: Dict.fromList [
                    ("Adam", 3.0),
                ],
                balance: 3.0,
            },
        ],
    }
    result =
        database
        |> post {
            url: "/iou",
            payload: "{\"amount\": 2.0, \"borrower\": \"Bob\", \"lender\": \"Adam\"}",
        }
        |> standardizeResult
    expected = Ok "{\"users\":[{\"balance\":-1,\"name\":\"Adam\",\"owed_by\":{},\"owes\":{\"Bob\":1}},{\"balance\":1,\"name\":\"Bob\",\"owed_by\":{\"Adam\":1},\"owes\":{}}]}"
    result == expected

# lender owes borrower less than new loan
expect
    database = {
        users: [
            {
                name: "Adam",
                owes: Dict.fromList [
                    ("Bob", 3.0),
                ],
                owedBy: Dict.fromList [],
                balance: -3.0,
            },
            {
                name: "Bob",
                owes: Dict.fromList [],
                owedBy: Dict.fromList [
                    ("Adam", 3.0),
                ],
                balance: 3.0,
            },
        ],
    }
    result =
        database
        |> post {
            url: "/iou",
            payload: "{\"amount\": 4.0, \"borrower\": \"Bob\", \"lender\": \"Adam\"}",
        }
        |> standardizeResult
    expected = Ok "{\"users\":[{\"balance\":1,\"name\":\"Adam\",\"owed_by\":{\"Bob\":1},\"owes\":{}},{\"balance\":-1,\"name\":\"Bob\",\"owed_by\":{},\"owes\":{\"Adam\":1}}]}"
    result == expected

# lender owes borrower same as new loan
expect
    database = {
        users: [
            {
                name: "Adam",
                owes: Dict.fromList [
                    ("Bob", 3.0),
                ],
                owedBy: Dict.fromList [],
                balance: -3.0,
            },
            {
                name: "Bob",
                owes: Dict.fromList [],
                owedBy: Dict.fromList [
                    ("Adam", 3.0),
                ],
                balance: 3.0,
            },
        ],
    }
    result =
        database
        |> post {
            url: "/iou",
            payload: "{\"amount\": 3.0, \"borrower\": \"Bob\", \"lender\": \"Adam\"}",
        }
        |> standardizeResult
    expected = Ok "{\"users\":[{\"balance\":0,\"name\":\"Adam\",\"owed_by\":{},\"owes\":{}},{\"balance\":0,\"name\":\"Bob\",\"owed_by\":{},\"owes\":{}}]}"
    result == expected

The roc compiler and lsp on my path is from roc_nightly-linux_x86_64-2024-10-07-6cb2501
md5sum which roc
7d299380f5270497917f388af74292d3  /home/xxxx/bin/roc
md5sum which roc_language_server
32a158fc8ee775c874f535a41ed3e21e  /home/xxxx/bin/roc_language_server
I'm using Ubuntu 22.0.4:
cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.5 LTS"

When I open RestApi.rocin Zed (0.155.2) I get the following in LSP Logs:
Roc language server initialized.
stderr: thread 'tokio-runtime-worker' panicked at crates/language_server/src/analysis.rs:301:71:
stderr: called `Option::unwrap()` on a `None` value
stderr: note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
stderr: thread 'tokio-runtime-worker' panicked at crates/language_server/src/analysis.rs:301:71:
stderr: called `Option::unwrap()` on a `None` value

Full context: https://roc.zulipchat.com/#narrow/stream/231634-beginners/topic/load.3A.20UNRECOGNIZED.20PACKAGE.20.20opening.20Excerism.20file.20in.20Zed/near/475367369

Just tried on my MacBook and I can confirm that the same happens on apple silicon too.

Source of error is here, it does not look too difficult to solve.

I see the same error by opening this file within the larger project.

I get the same problem for the Exercism exercise noted in the opening comment, but this is the source of the error for me: https://github.com/roc-lang/roc/blob/d7825428df72e3685be7291284c5eeeb1300a7f6/crates/compiler/mono/src/ir.rs#L6166
This error occurs for me when attempting to call either Dict.fromList [] or Dict.empty {}:
thread '<unnamed>' panicked at crates/compiler/mono/src/ir.rs:6166:56:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


Abstract away resource (streams)

resources are not type-safe and are a PHPIsm. Some options are:

add support for directly using strings
omit support for now
use HH\Lib\Experimental\IO\Handle (https://github.com/hhvm/hsl-experimental)

My instinct would be both (1) and (3)

I will try 3 (+1), I am already using hsl-experimental for filesystem related things in UploadedFile.

b83a106

5baf46d6682a02331c533ec72782385a12bb7aa2


[HOLD] Create API commands: GetOlderActions and GetNewerActions

HOLD on https://github.com/Expensify/App/issues/23217
Part of the Comment Linking project
Main issue: https://github.com/Expensify/App/issues/20282
Doc section:
Project: Comment Linking

Add new API endpoints GetOlderActions and GetNewerActions to use the new auth commands of the same name.
Manual Test Steps
TBD
Automated Tests
TBD

I can grab this too since it's the logical follow up to adding the commands in Auth.

I think this should be done relatively quickly. Gonna try to get some tests written today and do some more testing to make sure the API endpoints are ready to go for Margelo.

This was merged I think we are just waiting for it to hit production.

This is on prod, so I'm going to close it out as I work on a project update. Thanks @marcaaron!


Fix remaining full-width '%' symbols in strings

I feel that this should be self-explanatory enough to not warrant as much scrutiny as normal, but feel free to tell me otherwise :)
Signed-off-by: Jeremy O'Brien<EMAIL_ADDRESS>

Thanks @neutralinsomniac for this update.
We will merge it once our translation tool (https://translate.riot.im/projects/riot-ios) is back to avoid merge conflicts.

Merged even if our translate.riot.im is not back yet


Grey/Spinner needed for delay time from Ready to Join to Whats in your kit

Expected behavior
When the client is logged into TS.com as a registered user, and the click to Join Us, and clicks to Get Started they should be taken directly to the Whats in your kit page.
I am wondering if we can either gray out the page with an overlay, or create a spinner to show its thinking before they are taken to the Whats in your kit page.
Actual behavior
They click to Get Started, and briefly see the Ready to Join-Login/Sign up page before being taken to the Whats in your kit page.

Steps to reproduce behavior
Client goes to TS.com and logs in as Registered user
Client clicks on JoinUs
Client clicks on Get Started
Client sees Ready to Join- Login/Sign up page.

Fixed- closing bug

Feels like this grayed out time has shrunk with this last change you made it isn't long enough now.

Added a delay

Thanks that is better, closing bug


Documentation updates based on psy4

Updates to include:

Updated docstrings for PSY structs
New glossary

Do you know which docstrings are missing? You mentioned some branch cases. Feel free to comment in this PR whatever you are seeing that is missing.

Update statetypes on enumerated_types docs, explain what are statetypes in glossary, and add reference in docstrings of each state_types (differential) to the enumerated_types,  and (states) to the glossary.


feat(starknet): implement space settings

Depends on: https://github.com/snapshot-labs/sx.js/pull/210
Depends on: https://github.com/snapshot-labs/sx-api/pull/184
Test plan

Modify space settings.

Hum I got this error when I try to change settings:

On this space: /#/sn-tn:0x04b1953ac6bbe7a162d1afca0065bc82ba707501acbc01774cc1cf59721da6df/settings

@bonustrack good catch, there was bug in voting delay handler.


added test for static credentials

Pull request type

Please check the type of change your PR introduces:

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, renaming)
[ ] Refactoring (no functional changes, no api changes)
[x] Build related changes
[ ] Documentation content changes
[ ] Other (please describe):

What is the current behavior?

Issue Number: #1550
What is the new behavior?

Other information

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

Project coverage is 43.51%. Comparing base (3014993) to head (0c8cb15).

:exclamation:  There is a different number of reports uploaded between BASE (3014993) and HEAD (0c8cb15). Click for more details.
HEAD has 379 uploads less than BASE

Flag
BASE (3014993)
HEAD (0c8cb15)

macOS
18
1

unit
54
1

go-1.21.x
34
1

go-1.22.x
36
0

ubuntu
73
0

go-1.23.x
39
0

windows
18
0

integration
50
0

ydb-23.3
18
0

ydb-24.2
16
0

ydb-24.1
16
0

ydb-nightly
5
0

experiment
5
0

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1551       +/-   ##
===========================================
- Coverage   70.91%   43.51%   -27.40%
===========================================
  Files         362      295       -67
  Lines       37545    31720     -5825
===========================================
- Hits        26625    13803    -12822
- Misses       9835    17443     +7608
+ Partials     1085      474      -611

Flag
Coverage Δ

experiment
?

go-1.21.x
43.51% <ø> (-26.78%)
:arrow_down:

go-1.22.x
?

go-1.23.x
?

integration
?

macOS
43.51% <ø> (+2.43%)
:arrow_up:

ubuntu
?

unit
43.51% <ø> (+2.43%)
:arrow_up:

windows
?

ydb-23.3
?

ydb-24.1
?

ydb-24.2
?

ydb-nightly
?

Flags with carried forward coverage won't be shown. Click here to find out more.

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


Support multiple toast-roots

react-native, react and native-base version
react-native: 0.48.4
react: 16.0.0
native-base: 2.3.1
Expected behaviour
rendering multiple <Root> components each containing a <Toast> should all render a scheduled toast.
E.g. this is relevant when using react-native-navigation's tab-based navigation. Here each app-screen has its on context and needs to render its own <Root> component.
Actual behaviour
Only the last rendered  component does show the toast, but not the other Roots. E.g. using tabs this results in the last tab showing the Toast, but not the other tabs. We would like all tabs to show the current toast.
Steps to reproduce (code snippet or screenshot)
We use a HOC wrapping all app-screens with Root. However, this overrides the root-ref of Toast.
The problem is the (singleton) static-instance of ToastContainer's toastInstance which is overridden when rendering a new Root component (s. here: https://github.com/GeekyAnts/NativeBase/blob/master/src/basic/Root.js#L15:L18 )
A solution would be to use an array of toast-instances and showing the toast within all of these instances.
Our wrapRoot function:
const wrapRoot = WrappedComponent => props => (
  <Provider store={store}>
    <StyleProvider style={getTheme(commonColor(palette))}>
      <Root> // <--- does override ToastContainer.toastInstance as a side effect
        <Container>
          <WrappedComponent {...props} /> // <-- somewhere does call Toast.show({...})
        </Container>
      </Root>
    </StyleProvider>
  </Provider>
);

Here, each call to wrapRoot instantiates a new Root component which ultimately overrides the Root-ref used by Toast.
Is the bug present in both ios and android or in any one of them?
yes
Any other additional info which would help us debug the issue quicker.
s. suggestion above. This static instance is problematic: https://github.com/GeekyAnts/NativeBase/blob/master/src/basic/Root.js#L15:L18

@RobertHeim Did you manage to work around this issue? I am facing the same problem, when using Tabs app with React-Native-Navigation.
Native-Base team, this is a valid issue. Could this be looked into please?

@gits-ram no, we ended up using a different lib for toasts.

@RobertHeim mind sharing which one?? I'm also having problems with this Toast

@leofontes We ended up rebuilding the whole navigation using https://github.com/wix/react-native-navigation and we build a custom Toast View around their (badly documented) notification system. We create one using the Navigator:
// ...
navigator.showInAppNotification({
  screen: 'OurCompany.ToastView',
  passProps: {
    text: msg,
    severity,
  },
  position: 'bottom',
  autoDismissTimerSec: duration / 1000,
});
// ...

and within the ToastView we put a btn to dismiss it:
<Button transparent onPress={() => navigator.dismissInAppNotification()}>
   // ...
</Button>


Decoupling packages

RE: https://github.com/GoogleCloudPlatform/gcloud-node/pull/1440/files#r73738579
There are a number of instances within our code where we (sort of) couple packages together. For example, in the NL package we offer optional support for annotating GCS objects. I think it would be great if we could remove the actual storage module dependency while still supporting this feature.
Possible solutions could include:

Using optionalDependencies
Check for inheritance of ServiceObject
Check the constructor name

This will fix issues like #1516.


A Documentation link doesn't work

Hi,
A Documentation link doesn't work
on this page.

Hi
Thanks for feedback, I've to update it to the new one


Document how to exclude files from analysis

I have a workspace with Python 8000 files, only 200 of which are part of the project. Pylance has been misbehaving in all sorts of ways until I found out that it's not respecting my vscode settings for ignoring paths. Please document that you need to add a file like
pyrightconfig.json
{
  "exclude": [
    "**/site-packages/**",
    ".vscode/*.py",
    "**/.venv/**",
    "**/.tox/**",
    "**/build/**",
    "perf/bench/**",
    "semgrep/tests/e2e/targets/**",
    "semgrep/tests/e2e/snapshots/**",
    "semgrep/tests/e2e/rules/syntax/**",
    "semgrep/semgrep/external/**",
    "semgrep-core/**/tests/**"
  ]
}

in the repository root for files to actually get ignored.

we have discussion on this - https://github.com/microsoft/pylance-release/discussions/2581 - please, upvote there.


Finish serial commands with [CR][LF] (Carriage-Return Line-Feed)

With OEM4 models, [CR][LF] (\r\n) is the sequence used to mark the end
of command. Without this commands cannot be properly sent through
serial port.
Not sure if it would cause problems with a OEM6 or more recent model.
Did not test if this change would cause problems with other connection types, like for instance TCP and UDP, that seems to be the other connections that make a call to NovatelGps::Configure.

Tested it on an OEM6 and it works for me.  Thanks!


fix segmentation fault when datetime module is invalid

Reported downstream in https://github.com/pydantic/pydantic-core/issues/1171
We aren't checking if PyDatetime_IMPORT() succeeds, which can lead to dereference of a null pointer and a crash if the import fails.
This PR fixes that crash by adding error checking. Where possible I return the error, otherwise I just panic.

Thanks for the review 👍

I guess an invalid module on the path is weird enough that this does not need an immediate backport and 0.20.x maintenance release? This module did change significantly since 0.20.x IIRC.

Yes, I think it is a weird edge case. I think it's also very likely that this will always just crash immediately without doing any harm, so it's just ugly UX rather than dangerous.
That said, I'm about to prepare a patch release for #3619, so if it's trivial to cherry-pick this I will.


Add methods in url module to parse and trim credentials

Signed-off-by: Hanlin Shi<EMAIL_ADDRESS>Introduce three methods in url module:

extract_username: to extract username in URL.
extract_password: to extract password in URL.
trim_credentials: to remove credentials in URL.

Closes #366.

/hold on the discussion of the url module interface in the issue.

/hold on the discussion of the url module interface in the issue.

i.e. this discussion: https://kubernetes.slack.com/archives/CH8KCCKA5/p1619033548435100?thread_ts=1619026581.416200&cid=CH8KCCKA5

Thanks for the thorough start here, @hanlins.
I'm thinking about an API that would be generalized, compact, and intuitive.
Looking around for how others have solved this same need, I see a number of standard libraries using the technique of parsing a string into an object that is then interrogated for the desired part(s). For example: https://golang.org/pkg/net/url/#Parse
FWIW, there's prior art within ytt for introducing new value types into the system: https://github.com/vmware-tanzu/carvel-ytt/blob/bc8782e60d1089a4781060d36811fea5bbbb608b/pkg/workspace/library_module.go#L128
Thoughts?

Hi @pivotaljohn, thanks for your replies! So do you mean instead of adding new methods ad-hoc into the url module, we should introduce a url type instead?

Hi @pivotaljohn, thanks for your replies! So do you mean instead of adding new methods ad-hoc into the url module, we should introduce a url type instead?

That is what I'm suggesting, yes. 👍🏼
... and I am intending this to be a discussion.
In the process I see something like this:

identify a want/need ✔
think big picture about what new/extended capability we could add that would not only solve for this use case, but the class of needs, generally.
converge on a solution that results in the most resilient design:

keeps interface and implementation complexity to only what's essential
keeps the API compact and features as orthogonal as possible

run with it, collaborating on the lower-level design decisions along the way

So, I'm jumping into step 2, there. Bringing up an idea and trying to "show my work" by articulating a rationale for that approach.
At this point, there may be other ideas. Anyone can chime in here. And we can bat around other thoughts.

Hi @pivotaljohn, this seems interesting, it seems to introduce a module-local type instead of a base type, is that correct? I think for a starting point, golang provides a nice implementation for URL already (https://github.com/golang/go/blob/e6ac2df2b198f583780277a7cf96e3b0b61fe0a1/src/net/url/url.go#L340-L369), maybe we parse a string to the golang URL and add methods to support existing use cases and add the new use cases we want to support.

Hi @pivotaljohn, this seems interesting, it seems to introduce a module-local type instead of a base type, is that correct? I think for a starting point, golang provides a nice implementation for URL already (https://github.com/golang/go/blob/e6ac2df2b198f583780277a7cf96e3b0b61fe0a1/src/net/url/url.go#L340-L369), maybe we parse a string to the golang URL and add methods to support existing use cases and add the new use cases we want to support.

That sounds really enticing: less code for us to maintain (and make sure we get right). So long as the contract with Go's url.URL doesn't break, that should be just fine... right?
... another factor we need to keep in mind is ensuring that we maintain the sandbox.
ytt very consciously prevents any access to the outside world from within templates: no network, no disk, no time, no RNG, no encryption.
We do this for two reasons:

so that the tool is safe to use — sensitive data likely flows through here. Last think you need as an operator is for the deployment tool chain to exfiltrate secrets.
so that when the same inputs are given, the exact same output is rendered — having this guarantee allows operators to gate potentially expensive operations so that they only execute if there was actually a change.

So, we'll want to make sure we don't inadvertently provide access to the outside world.
I'm not saying that I've spotted something like that yet, just putting it on your radar.

Are there any other viable (and meaningfully different) approaches we should consider?

Hi @pivotaljohn, I'm trying to wrap these ideas in my mind so correct me if I'm wrong, I'm trying to understand the https://github.com/vmware-tanzu/carvel-ytt/blob/bc8782e60d1089a4781060d36811fea5bbbb608b/pkg/workspace/library_module.go#L128 example you used above.
So, what we've been talking about is to introduce a new type namely urlValue in the url module. In the url module, we can have a method namely parse to parse the URL, and what it returns is a starlark value, which is of Module type. And we still need to selectively expose the methods that this object, is that correct?

Hi @pivotaljohn, I created https://github.com/vmware-tanzu/carvel-ytt/pull/372 which aggregates the methods into a url type, PTAL. If that is our direction then I'll close this one.

Closing this changeset in favor of https://github.com/vmware-tanzu/carvel-ytt/pull/372.


feat(frontend): Improved footer design ESP #471

Improve footer styles
What does this PR do?

resolves https://github.com/eoscostarica/guide.eoscostarica.io/issues/471

Note: react-icons was installed: npm install react-icons --save or yarn install react-icons
Steps to test

Navigate to the bottom of guias.eosio and see page footer

CheckList

[ ] Follow proper Markdown format
[ ] The content is adequate
[ ] The content is available in both english and spanish
[ ] I Ran a spell check

@AngeloCG97 mobile footer


Add session.debug to show debug-level messages

Closes #485. A logging function to show debug-level messages.

Seems like everything passed. Any suggestions or comments?

@cjolowicz feel free to merge this pull request. Or do you prefer to get the opinion from another maintainer?

Thanks @DiddiLeija :rocket:


A question about running WAA on Azure

Hi, this is a very outstanding project.
However, I ran into some issues while trying to use Azure, as I am not familiar with it. I hope to get some general advice to help me pinpoint the problem. I followed the steps in the readme strictly, but I changed the size of the ComputeInstance to Standard_D2a_v4, as it seems the free account does not have a quota for D8_V3. The error is as follows.
{
    "error": {
        "message": "Activity Failed:\n{\n    \"error\": {\n        \"code\": \"UserError\",\n        \"message\": \"UserErrorException:\\n\\tMessage: \\nError Code: ScriptExecution.StreamAccess.NotFound\\nNative Error: error in streaming from input data sources\\n\\tStreamError(NotFound)\\n=> stream not found\\n\\tNotFound\\nError Message: The requested stream was not found. Please make sure the request uri is correct.| session_id=3cae6541-8756-4a54-a0cf-1116939edff8\\n\\tInnerException None\\n\\tErrorResponse \\n{\\n    \\\"error\\\": {\\n        \\\"code\\\": \\\"UserError\\\",\\n        \\\"message\\\": \\\"\\\\nError Code: ScriptExecution.StreamAccess.NotFound\\\\nNative Error: error in streaming from input data sources\\\\n\\\\tStreamError(NotFound)\\\\n=> stream not found\\\\n\\\\tNotFound\\\\nError Message: The requested stream was not found. Please make sure the request uri is correct.| session_id=3cae6541-8756-4a54-a0cf-1116939edff8\\\"\\n    }\\n}\",\n        \"messageParameters\": {},\n        \"details\": []\n    },\n    \"time\": \"0001-01-01T00:00:00.000Z\",\n    \"componentName\": \"CommonRuntime\"\n}"
    }
}

You might want to ask for more compute quota for your region depending on your needs. You can do so by navigating to the Azure Quota page. As a reference, we currently use the Standard_D8_v3 VM size for our benchmarking, which falls under the Standard Dv3 Family Cluster Dedicated vCPUs category (each VM uses 8 cores). In any case, make sure that the VM support nested virtualization.

Thank you very much for your timely reply. I understand what you mean. I will try to apply for a quota adjustment. Thank you!

Everything is much better now, but I encountered this bug. Does the author have any suggestions? I'm not familiar with this.

Hi, this error is caused by the DNS service in the Azure ML Compute occupied network port 53, please add a line sudo systemctl stop named.service to the startup file (Users/<YOUR_USER>/compute-instance-startup.sh) in Notebooks of ML Studio like below to fix it:
#!/bin/bash

echo "Initializing Compute VM at startup..."

# Install dos2unix
sudo apt-get install -y dos2unix

# Stop dnsmasq running on port 53
sudo systemctl stop systemd-resolved

# Stop DNS service on port 53
sudo systemctl stop named.service

# Stop nginx running on port 80
sudo service nginx stop

I roughly understand what you mean, but doing this may not work for me. I will still encounter this issue. My final solution was to add a line of code in WindowsAgentArena/scripts/azure_files/run_entry.py to modify the port number of dnsmasq to resolve this problem.
print("display the content of /storage")
os.system("ls -l /storage")

# starts the VM and waits for it to fully load before proceeding
##### add this line
os.system('sed -i \'85s|.*|DNSMASQ_OPTS+=" --port 5353 --dhcp-range=$VM_NET_IP,$VM_NET_IP --dhcp-host=$VM_NET_MAC,,$VM_NET_IP,$VM_NET_HOST,infinite --dhcp-option=option:netmask,<IP_ADDRESS>"|\' /run/network.sh')
#####
os.system("/entry_setup.sh") # since it's in root we can just do /script.sh and don't need cd /

# launches the client script
os.system(f"cd /client && python run.py --agent_name {agent} --worker_id {worker_id} --num_workers {num_workers} --result_dir {result_dir} --test_all_meta_path {json_name} --model {model_name} --som_origin {som_origin} --a11y_backend {a11y_backend}")

print("Finished running entry script")

This does indeed allow me to run the WAA tests normally. Does the author think this is reasonable?

Glad you found a way to make it work by changing the DNSMASQ port to 5353. Note that if applications aren't configured to use this port, they may default to the standard DNS server on port 53, potentially leading to issues with resolving 'host.lan.' This could cause problems in dev, setup, or azure modes. Please verify that 'host.lan' resolves properly from the Windows VM. Just to clarify, I'm not the original author; these are just assumptions based on the code. :)

I roughly understand what you mean, but doing this may not work for me. I will still encounter this issue. My final solution was to add a line of code in WindowsAgentArena/scripts/azure_files/run_entry.py to modify the port number of dnsmasq to resolve this problem.
print("display the content of /storage")
os.system("ls -l /storage")

# starts the VM and waits for it to fully load before proceeding
##### add this line
os.system('sed -i \'85s|.*|DNSMASQ_OPTS+=" --port 5353 --dhcp-range=$VM_NET_IP,$VM_NET_IP --dhcp-host=$VM_NET_MAC,,$VM_NET_IP,$VM_NET_HOST,infinite --dhcp-option=option:netmask,<IP_ADDRESS>"|\' /run/network.sh')
#####
os.system("/entry_setup.sh") # since it's in root we can just do /script.sh and don't need cd /

# launches the client script
os.system(f"cd /client && python run.py --agent_name {agent} --worker_id {worker_id} --num_workers {num_workers} --result_dir {result_dir} --test_all_meta_path {json_name} --model {model_name} --som_origin {som_origin} --a11y_backend {a11y_backend}")

print("Finished running entry script")

This does indeed allow me to run the WAA tests normally. Does the author think this is reasonable?

When changing DNSMASQ port, please ensure that the training job can still connect to the internet. I remember taking this approach only to discover that our Chrome tasks were broken.
We’ll keep the issue open while we collect more data.


Stringify arrays in validation reports

Hi Samchon! First off, thank you for making this great library.
I am currently iterating over my collections and am validating all items in my database. With typia, this has been made very easy and it's easy to find instances where my data and types have diverged.
However, when it comes to nested arrays, the validation reporting is not terribly helpful, as it does not appear to serialize objects. Would it be possible to serialize the objects on validation printouts if not primitive? I suppose this may be problematic for recursive data structures, but perhaps an opt-in option to allow doing so would be helpful. Or perhaps object serialization is already handled and this is simple an issue with nested arrays.
sample script doing the validation:
import { Db, MongoClient } from 'mongodb'
import { createValidate, IValidation } from 'typia'
import { Element } from '../src/types/element'
import { TrainingAudience, TrainingEvaluation, TrainingGoal } from '../src/types/training'

const collectionValidators = {
  'training.audiences': createValidate<TrainingAudience>(),
  'training.goals': createValidate<TrainingGoal>(),
  'training.evaluations': createValidate<TrainingEvaluation>(),
  elements: createValidate<Element>(),
}

async function main() {
  console.log('Attempting to connect to DB')
  const client = await MongoClient.connect(
    'mongodb://admin:password@localhost:27017',
  )

  try {
    const db = client.db('database')

    for (const collectionValidator of Object.entries(collectionValidators)) {
      await validateCollection(db, ...collectionValidator)
    }
  } catch (error) {
    console.error(`Error: ${error}`)
  } finally {
    await client.close()
    console.log('DB connection closed')
  }
}

async function validateCollection(
  db: Db,
  collectionName: string,
  validate: (input: unknown) => IValidation,
) {
  console.log(`Validating ${collectionName}`)
  const cursor = db.collection(collectionName).find({})
  for await (const doc of cursor) {
    const res = validate(doc)
    if (!res.success) {
      console.error(`Validation failed for ${doc.metadata.uuid}`)
      console.log(res.errors)
    }
  }
}

main()

Output from validation errors:
Validation failed for 88b8efc0-3721-4484-8d46-62c3b18750e6
[
  {
    path: '$input.data[11].content',
    expected: '(Array<DataTextItem> | Array<DataImageItem>)',
    value: [
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array]
    ]
  }
]

Needs reproducible playground link or repo.

Needs reproducible playground link or repo.

I can get that to you very early next week!

Close due to too much time no reproduciple repo updating.


Create generic S3 protocol handler in UriSource and UriSink

We should have a generic S3 protocol handler for import/export, using the Hadoop S3 FileSystem implementation (the s3a one to be precise, since it's built on the AWS SDK, and hence among other things allows us to handle credentials securely). This is necessary for exporting any data to S3, and for importing any S3 data that isn't publicly readable (and thus accessible through HTTP). Specific optimizations for parallel S3 import/export will be addressed in separate issues.
This will require us to obtain credentials for calling into the AWS SDK. The most secure way to handle credentials is to require them to be present on an EC2 instance via an IAM role used to launch the instance: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html. This would require us to add support for IAM roles to the deployment script, which shouldn't be difficult, but would also require the AWS identity running the deployment script to have the PassRole permission for the IAM role they want to pass to their cluster. Alternatively, we could propagate the user's AWS credentials directly to the cluster by getting them from boto, passing them to our Ansible playbook, and writing them as files on the remote machine for use by envdir, then wrapping all launch commands for Myria executables in an envdir invocation with the location of the credentials. This isn't as secure as launching under an IAM role, but should be secure enough, provided we create a dedicated unprivileged user for the myria service, with exclusive read permissions on the envdir files containing AWS credentials. I favor the first approach (launching the cluster under an IAM role), since it's much simpler and more secure, but we have to evaluate the inconvenience to users who may have difficulty obtaining PassRole privileges. In any case, I think the first approach should be implemented first.
It appears that the s3a implementation was significantly improved in Hadoop 2.7, so we should probably upgrade to the latest 2.7 version before deploying this feature (unless it's incompatible with REEF, which is still at Hadoop 2.6.0).

@jingjingwang would appreciate your feedback.

Since the UriSink class is now going to contain separate, dedicated logic for HTTP(s), HDFS and now S3, it's probably worth having it delegate to specific strategies by scheme.

Depends on whether we can just pass the URI to FileSystem.get(). If we do have to implement specialized logic for each scheme, then I agree, but hopefully for now we can get away with the above for HDFS and S3 URIs (except we might want to munge the s3 scheme to s3a if we're using the new S3A filesystem).
What would be the application for exporting to an HTTP URI? Would this be a PUT or POST call, and we would just hope the server supports those verbs? Even if the server did support them, they would likely be expecting particular headers etc., so I don't see how we could generically support export to HTTP.

Seems the only possible disadvantage of the first approach is the difficulty of obtaining PassRole? I'm not very familiar with PassRole  but in my imagination the overhead should be negligible since the user needs to deal with AWS credentials anyway, and using IAM is recommended by Amazon.
I hope Hadoop 2.7 is compatible with REEF :) But if not then we may have to postpone the upgrade...

I think exporting to an HTTP URI is more like something that we can have easily and can reserve for future usage. For example, a data visualization service? Although we don't have an immediate use case for now.

I've added PassRole support to the deploy script/playbook and upgraded Hadoop to 2.7. I created a role myria-cluster under the Myria account which has full access to our S3 resources and no other permissions. That's enough for now, but probably won't be later. You can try this now: myria-deploy --role myria-cluster. Everything seems to work fine in my testing so far (I installed awscli on the coordinator with zero config so it was forced to use the IAM role credentials and tried some basic S3 operations).

Raco support for this feature will be implemented in https://github.com/uwescience/raco/issues/496

This is blocking on https://github.com/uwescience/myria/issues/802

@jortiz16 I didn't realize until I was testing the s3-uri-reef branch that S3 import wasn't part of this issue. I don't think it's worth opening a separate issue for the UriSource changes/new tests for S3 support because the changes are so similar. So I'd like to add UriSource support for the S3 protocol to this issue and associated PRs. (The linked Raco issue already covers IMPORT/EXPORT implementation.) Let me know if you feel differently.

This is ok. Should I then keep building on s3-uri-reef? I noticed you moved my commits there. On Friday, I tried pushing commits to add-s3-UriSink but the tests still did not work on Travis when I tried to export to S3 --  I would still get the "No FileSystem for scheme: s3a" as seen here. I don't have enough understanding of Travis to get a sense for what the problem is. Or is it that we don't have the correct Hadoop jars/dependencies on the Myria master branch for S3 to work?

I cherry-picked your commits from add-s3-UriSink into s3-uri-reef just so I could do my own testing on EC2 (I wanted to try load() with an S3 URL, which worked after I had fixed the YARN classpath to include the JAR containing the s3a code, and also made an analogous fix to DataSource to handle S3 URLs). I've pushed a commit to add-s3-UriSink which should fix your issue running S3 tests on Travis, but I haven't tested that yet. (I have tested S3 writes from Travis using boto with the encrypted credentials I added to .travis.yml.)

@jortiz16 testing in Travis is currently blocked by https://github.com/uwescience/myria/issues/809

Fixed in https://github.com/uwescience/myria/issues/811


Support Bank Interest Transactions

(Some?) Bank Interest transactions use the date format "07/16/2024 as of 07/15/2024".  Date conversion currently fails.
Example transaction:
"Date","Action","Symbol","Description","Quantity","Price","Fees & Comm","Amount"
"07/16/2024 as of 07/15/2024","Bank Interest","","BANK INT …9999-999999 SCHWAB BANK","","","","$0.80"

Sorry, the title may be bad since I found three other transaction types that use the same format...
"07/01/2024 as of 05/31/2024","REINVEST DIVIDEND","","FAKE STOCK LLC","73.56","$1.00","",""
"06/27/2024","Sell to Open","FAK 07/19/2024 135.00 C","CALL FAKE STOCK$135 EXP 07/19/24","2","$0.41","$1.33","$60.67"
"06/04/2024 as of 05/01/2024","Received","","FAKE STOCK LLC","4,000","$1.00","","
And by the way, I'm new to PP so I don't know yet if these transaction types are even useful to import. Just reporting import errors I'm finding as I use PP for the first time.

When I add the "Transactions for account..." first line from your example, I get the same result for these 'as of' dates.

@ipaulo I'm using the Pandas library to read CSV files. I'm pretty sure it doesn't support date strings like "date1 as of date2". That's why it fails. A workaround is to manually edit the raw Schwab CSV file so that only "date1"'s remain.
I don't have date strings like that in my Schwab CSV. What does date1 and date2 mean in relation to each other in the financial sense? I can write code easily to ignore one or the other, but I want to make sure it makes sense.
Thank you.


[i18nIgnore] i18n(zh-cn): Fix Chinese subtag

What kind of changes does this PR include?

Minor content fixes (broken links, typos, etc.)
Changes to Starlight code

Description

Fix Chinese subtag
Url: zh -> zh-cn
Built-in Translations: zh -> zh-CN
All link /zh/ -> /zh-cn/
Add redirect: /zh/*    /zh-cn/:splat

related PR: https://github.com/withastro/starlight/pull/475
discuss: https://discord.com/channels/830184174198718474/1160994417470079138

Some thoughts:

This change would be better to make after existing i18n PRs to docs are merged.
Links can be mass search-replaced in the same PR (/zh/ -> /zh-cn/).
A changeset is needed as this would be a breaking change.

@delucis Do you think the changeset is still needed, or it can be removed since this ended up mostly changing starlight's own docs? I suggested adding a changeset because I originally thought this would be a breaking change for existing users with Chinese docs in their project.

Great point @Genteure. Yes, this is now a 100% transparent change that doesn’t impact Starlight users really, so we can remove the changeset.

Great point @Genteure. Yes, this is now a 100% transparent change that doesn’t impact Starlight users really, so we can remove the changeset.

I removed it. It doesn’t impact existing users because we kept the built-in UI as zh


Nanobind for easy python <-> C++ binding

https://github.com/wjakob/nanobind

Pybind11 is probably more used in practice (more mature I guess, nanobind is a rewrite from the original author of pybind11 as you probably saw). It would be interesting to compare both though (and the previous tools you already showed).

FYI with pybind11, and I guess it should also be possible with nanobind (but I have never used it), you can easily bind an abstract class to a python class making a c++ interface available in python. So you can easily use polymorphism with user-defined (in python) types, see https://pybind11.readthedocs.io/en/stable/advanced/classes.html (they use a "trampoline" class).
I find it pretty cool ^^


Improvement Error Handling

SharingFlowError
https://github.com/JPMartha/EggsBenedict/blob/develop/EggsBenedict/SharingFlow.swift#L115-L116
And, I think it is not necessary to implement the following:
https://github.com/JPMartha/EggsBenedict/blob/develop/EggsBenedict/SharingFlow.swift#L125-L128

SharingFlowError
https://github.com/JPMartha/EggsBenedict/blob/develop/EggsBenedict/SharingFlow.swift#L115-L116
And, I think it is not necessary to implement the following:
https://github.com/JPMartha/EggsBenedict/blob/develop/EggsBenedict/SharingFlow.swift#L125-L128


Do you have any detailed paper about the algorithm

Do you have any detailed paper about the algorithm？
just  "Low-Cost Laser Range Scanner and Fast Surface Registration Approach".？
thanks

Yes that's the paper it all started from. I don't have any more details than this.


[Table card] Dashboard table header heights issue

Describe the bug
Table card in Dasboard renders large column headers on Firefox for Mac.
To Reproduce
Go to https://carbon-addons-iot-react.com/?path=/story/watson-iot-dashboard--basic-dashboard on Firefox for Mac.
Screenshot:

Environment/versions:
Mac Firefox  70.0.1

related to PR #630

@davidicus you fixed this already, good to close? works fine on FF 73

Closing


What's the correct way to interpret the results

is the actions means trading action for next trading day?
if the results has the following values (using APPL as an example)-

date: 2020-12-01
actions: [200]
close_price: 122.72

Does this mean the trading action for Dec. 2nd is to buy 100 APPL? Trying to understand how we can use the results from the models.
thanks

See section 5, here: https://github.com/AI4Finance-LLC/FinRL-Library/blob/master/FinRL_single_stock_trading.ipynb where it explains the environment setup.

is the actions means trading action for next trading day?
if the results has the following values (using APPL as an example)-

date: 2020-12-01
actions: [200]
close_price: 122.72

Does this mean the trading action for Dec. 2nd is to buy 100 APPL? Trying to understand how we can use the results from the models.
thanks

https://towardsdatascience.com/finrl-for-quantitative-finance-tutorial-for-multiple-stock-trading-7b00763b7530
Please refer to this blog, we explained all the steps and results, also provided a made-up example.