List inheritance

I have a lot of cases where I would rather replace the values of a list when inheriting, instead of prepending to it. For instance: I have an object that defines a bounding polygon as a list of points, prepending points in the heir would end up breaking the bounding polygon.
A possible solution could be a special sign, possibly at the beginning of a list, to denote where to put the heirs' nodes, such that omitting the special sign would replace the heirs' list completely. E.g.
Thing *handle Base
{
    List  [ Value1 ; Value2 ]
}

Thing2 *source Base
{
    List  [ Value3; *; Value4 ] #result is [ Value3; Value1; Value2; Value4 ]
}

Thing2 *source Base
{
    List  [ Value2 ] #result is [ Value2 ]
}

Possible issues would be unpredictable behavior when several heirs in a tree wants to replace the same list. I would argue that is for the application to solve, though. E.g.
Thing *handle Base
{
    List  [ Value1 ]
}

Thing2 *source Base *handle Base2
{
    List  [ *; Value2 ] #result is [ Value1; Value2 ]
}

Thing3 *source Base2 *handle Base3
{
    List  [ Value3 ] #result is [ Value3 ]
}

Thing4 *source Base3
{
    List  [ *; Value4 ] #We have now lost Value1 and Value2
}

I might just be dense, but on further inspection, isn't the inheritance relationship reversed in TyD?
For instance:
Thing *handle Base
{
	Value BaseValue
}

Thing2 *source Base
{
	Value NewValue
}

Thing2's Value will be replaced with "BaseValue", meaning whatever you define in an heir is never used and just redundant? Shouldn't it be the other way around?

You're right about the issues with list inheritance. What we did on RimWorld was just a simple "Inherit=false" XML attribute on the inheriting list. I was thinking there should be a similar attribute in the TyD spec too. I think it's better to just have a simple "noinherit" and then rewrite the whole list; having arbitrary placement of parent data is getting too complex IMO to be worth the typically small reduction in data duplication.
As for reversal of inheritance relationship, the heir's data should take precendence over the source. I'll have to check to make sure the spec actually says that.
Will address these in a spec update.

Ok, I reworked the spec based on this.
The noinherit attribute is specced but not in TyDSharp yet. However, it is a battle-tested design used in RimWorld for years so I think it should work. Very open to other ideas here though.

The arbitrary placement of source data is definitely overkill, thinking about it. The *noinherit attribute seems a bit verbose, though, it kind of breaks the neat record value structure. Couldn't it be a special character before or after the record name instead?

There's going to be other attributes using the star-attribute syntax. Plus
noinherit is pretty rare, so I think consistency and readability beats
absolutely compressing the number of characters to the tiniest possible.
On Sun, 19 May 2019 at 12:23, Kenneth<EMAIL_ADDRESS>wrote:

The arbitrary placement of source data is definitely overkill, thinking
about it. The *noinherit attribute seems a bit verbose, though, it kind of
breaks the neat record value structure. Couldn't it be a special character
before or after the record name instead?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/tyd-lang/TyD/issues/1?email_source=notifications&email_token=ABUZ7YJE4IC7J2OJUGGYSCLPWFBDJA5CNFSM4HMXTRFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVXBA4Y#issuecomment-493752435,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABUZ7YIHYO5OBTULKNNUYW3PWFBDJANCNFSM4HMXTRFA
.

Just as a reference, I just checked the RimWorld data. It's quite a large game with a lot of data, but despite all that volume, the Inherit="False" tag only appears 20 times.

Considering this will only apply to collections, which usually have data after a new line, my comment regarding file layout was irrelevant.
I don't use inheritance for any data internally in Software Inc., but the default behavior for mods is to not inherit list data, as in my boundary example, you would either want to replace the values or keep them intact. In cases where you would, though, having a noinherit attribute is infinitely better than having to copy paste the source data over manually.
Just spitballing here, of course, but you could call it *replace instead, and use *noinherit on source records to disallow prepending its value(s) to heirs. It could protect data and avoid misunderstandings, like accidentally appending points to a polygon, which would be an easy mistake to make.

*Replace is definitely a valid idea. I'll watch to see if it comes up repeatedly enough to be desired in the spec. Though in RimWorld we never needed something like that.
Anyway, I'll close it since this is slipping to other topics. Thanks very much!


add codecov test coverage report

add upload of coverage report to codecov
add badges in readme
add python 3.9 and 3.12 (oldest and current newest) instead of only 3.11 to actions. 3.9 is the one rasperry-debian runs on, so we should test on it imho

Welcome to Codecov :tada:
Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.
Thanks for integrating Codecov - We've got you covered :open_umbrella:

do you have any best practices as to how high code coverage should minimally be in order to be useful?  I currently set the failure-threshold to 80, although that's kind of arbitrary. Also, I activated branch coverage because it's imho more important than line coverage as such, at least when line coverage is not close to full?


Missing containerID info EKS 1.21.2 ContainerD

In some scenarios it was reported that the containerID reported by the agent was missing
Description
In EKS 1.21.2 having the ContainerD as runtime, the reported container label is always empty causing the integration to fail when fetching the containerID.
Example
container_tasks_state{container="",id="/kubepods/burstable/podb9bac7ec-7264-4c8b-a6e9-cf177ffcdd7c/21241cbb20ab776dc87b05bb27c9912ba70f5fcfdfaadbbc400c5b4da89576a5",image="",name="",namespace="",pod="",state="iowaiting"}

Expected Behavior
containerID always present
In an identical EKS 1.21.2  having Docker as container runtime the everything works as expected
Example
container_threads_max{container="newrelic-logging",id="/kubepods/burstable/pod88a4c57f-5619-47b4-9c9b-70f4a28b8aec/83ce33548d81da5aaa4154568cde74c9d736932a6a79abf44d4a74e9b59b04a8",image="newrelic/newrelic-fluentbit-output@sha256:e64b37e642f233f20abd1655ace5655d419d4ca34e14d6c84a59506c14d1bd74",name="k8s_newrelic-logging_newrelic-bundle-newrelic-logging-p6x5l_newrelic_88a4c57f-5619-47b4-9c9b-70f4a28b8aec_0",namespace="newrelic",pod="newrelic-bundle-newrelic-logging-p6x5l"}

Steps to Reproduce
Create a cluster having:
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
  name: ${CLUSTER_NAME}
  region: ${AWS_REGION}
  version: "${EKS_VERSION}"
managedNodeGroups:
  - name: containerd
    ami: ${AMI_ID}
    overrideBootstrapCommand: |
      #!/bin/bash
      /etc/eks/bootstrap.sh ${CLUSTER_NAME} --container-runtime containerd

Install the integration and run:
kubectl exec  [newrelic-infra-pod] curl -- -kH "Authorization: Bearer "$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)"" https://localhost:10250/metrics/cadvisor > logs.txt

causing the integration to fail when fetching the containerID
Other metrics derived from cAdvisor will also be missing, namely: https://github.com/newrelic/nri-kubernetes/blob/92e4f3b0520565bc120e7635a5ad59cc9feec757/src/metric/definition.go#L844-L857

Currently we are not sure if it is an issue on kubelet/cadvisor or if we cannot assume that the container label is populated

This might be related
https://github.com/awslabs/amazon-eks-ami/issues/764


location of bibcop.pl is broken

@rultor release, tag is 0.0.6

@rultor release, tag is 0.0.6

@rultor release, tag is 0.0.6

@yegor256 OK, I will release it now. Please check the progress here

@rultor release, tag is 0.0.6

@yegor256 Done! FYI, the full log is here (took me 19min)


corsproxy migration

simulator corsproxy issue:

the issue is that corsproxy not able to run with node with version >= 13, and the reason is the existing corsproxy is outdated for 5 years and is rely on old version dependencies:

specific error:

the error in the case is that corsproxy is reply on hapi v9 which utilizes Os.tmpDir() which is not supported anymore for node >= v13.

candidate fixes:

there are folks who nicely suggested updating hapi version singly but because other dependencies of corsproxy are also pretty old, so based on some draft testings only some specific versions of hapi (a subset of v16, v17) will work; updating all corsproxy dependencies also brings problems because corsproxy itself is outdated for 5 years.
one ad-hoc solution without updating the dependency versions is to add line Os.tmpDir = Os.tmpdir; into ./node_modules/hapi/lib/defaults.js after the line of requiring os package through a pre-start script, it will work with the current dependencies but is pretty hacky.

proposed fix:

as Nick (theoutlander) suggested, we probably would like to migrate from utilizing the deprecated corsproxy to utilizing up-to-date cors proxy and keep the simulator project having the same functionalities. This PR is trying to utilize cors-anywhere and is working with various node versions by a quick verification.

actions needed and are ongoing for now:

more tests on more envs / node versions need to be done for validating the update.
security problems need to be fixed across the dependencies.
5 mocha test cases are not able to be passed, although probably are not related to cors proxy but we would fix them to ensure quality.
while doing above will update this PR accordingly.

Nice! I'm glad you found an alternative that seems to be as simple!

Nice! I'm glad you found an alternative that seems to be as simple!
Thanks, Keshia! Nick suggests this change. More testings are ongoing.

@chenteng2016 are you waiting on fixing travis before merging this change?

@chenteng2016 please merge once tests/travis-ci is passing

Thanks for Nick's instructions and review.


Added an Architecture doc

Addressed @chenxiao0228 's feedback from an older PR

Thanks for the docs!


Support shared sessions

Redesign for https://github.com/c42f/RemoteREPL.jl/pull/45
Novelties and summary
In #45 we discussed that it would be better to use the underlying protocol to change the module.
It became clear that this is easier done if shared sessions were supported.
So instead of directly solving my problem I tried to introduce multiple shared sessions.
As a result, module update for Pluto is now also more straightforward.
1. session_id
Basically I introduced a session_id that characterizes every ServerSideSession.
The server holds all the sessions in a Dict{UUID, ServerSideSession}.
Everytime a client connects, it send the session UUID it wants to connect to as the first thing.
2. SessionSideSession
Now SessionSideSession is not described by a single Socket but a vector of Sockets, which is kept up to date.
3. @remoterepl
I need a way to still connect remotely and change the module, i.e. %module ..., without having a REPL available (like Pluto).
@remote support only command execution. Therefore I introduced @remoterepl which gives access to the REPL magic commands for all clients.
The question is.. why not collapse @remote to @remoterepl, since the second is a superset ?
4. Structural changes
I put all the using dependencies on the src/RemoteREPL.jl file.
I find it much more readable this way and it also follows community conventions.
Pluto side
Pluto notebook should look something like this gist.
I am not sure how to avoid the updating every second, but don't focus on that; this is a Pluto issue/discussion.
Basically Pluto just uses @remoterepl to upgrade the module in a specific session.
The core code boils down to
server = Sockets.listen(Sockets.localhost, 27765)

@async serve_repl(server)

session_id = UUID("f03aec15-3e14-4d58-bcfa-82f8d33c9f9a")

con2server = connect_remote(Sockets.localhost, 27765; session_id=session_id)

# define function to get more recent module
takemodulesymbol() = Symbol("workspace#" ,PlutoRunner.moduleworkspace_count[])

# get module
mod = eval(takemodulesymbol())

# use `@remoterepl` to update module
@eval(@remoterepl $"%module $mod")

Test
Run the pluto notebook.
Open a julia kernel, add dependencies and do:
julia> using RemoteREPL, Sockets, UUIDs

julia> connect_repl(Sockets.localhost, 27765; session_id=UUID("f03aec15-3e14-4d58-bcfa-82f8d33c9f9a"))
[ Info: Using session id f03aec15-3e14-4d58-bcfa-82f8d33c9f9a
REPL mode remote_repl initialized. Press > to enter and backspace to exit.
"Prompt(\"julia@localhost:27765> \",...)"

julia@localhost:27765> temp
1

julia@localhost:27765> @__MODULE__
Main.var"workspace#1261"

julia@localhost:27765> @__MODULE__
Main.var"workspace#1265"

julia> # uncomment "# anewvar = 2"

julia> @remote(anewvar)
2

As you can see the remote client closely follows the changes in the Pluto notebook.
Let me know how that looks and I am happy to hear your thoughts!

Some summary for the force-push:
I generally agree with your comments, so I removed @remoterepl and I overloaded run_remote_repl_command
run_remote_repl_command
I think it's better to keep the same name and not unnecessarily introduce breaking changes.
Now it's a bit more welcoming to use as I exported it and added docs.
Because of the argument order, we need to manually overload by defining the other two methods.
However everything could be simplified to a single function signature like the following:
function run_remote_repl_command(cmdstr::String, conn::Connection=_repl_client_connection, out_stream::IO=Base.stdout)

but it would be breaking.
Maybe we could make a list of desired breaking changes and include this one (?)
mutex
I implemented the design as shown in https://github.com/c42f/RemoteREPL.jl/pull/55#discussion_r1249529472
Let me know if you have a different implementation in mind.
remote_module!
I also implemented the RemoteREPL.remote_module! function you were saying. The function is exported.
The Pluto notebook now also uses remote_module! instead.
docs/Manifest.toml
Currently CI.yml Pkg.develops the current directory.
Since the Manifest.toml is already checked in, we can have dev .. there.
This is also easier for local docs generation, where the CI.yml is unusable.
I also added some docs for session_id and the workflow with Pluto.
tests
It would be nice to develop some tests about the sessions sharing, but currently nothing is implemented.
If you don't consider it urgent, maybe in a following PR ?

Because of the argument order, we need to manually overload by defining the other two methods

No problems. I like the current argument ordering anyway by analogy to other functions like show etc which take the IO as an initial argument.  And also I feel like the Connection is the "primary argument" so should go first.

but it would be breaking.

Well run_remote_repl_command is not documented anywhere as part of the public API.  So I think it would be ok to rename it.  Also it would probably be ok to just release version 1.0 if we were worried. This package seems somewhat stable at this point :woman_shrugging:

[Tests] If you don't consider it urgent, maybe in a following PR ?

Mmm I'd prefer tests added as part of the PR. Tests can kind of be a pain but they're so essential in the long run. It's easier to write them when the new stuff is fresh in mind and to be motivated to do it if you want to use the feature they are testing.
Testing shouldn't need to be super extensive for this feature.  Just a few tens of lines should be enough and the client-server setup already exists in runtests.jl.

It would probably be ok to just release version 1.0 if we were worried.

before going to 1.0, it would be nice to talk a bit about https://github.com/c42f/RemoteREPL.jl/issues/56
Update summary

Renamed run_remote_repl_command to remotecmd
Added some further docs
reordered remote_module! function's arguments to resemble to remotecmd etc.
Added tests. Also the test server now uses TestEnv, because otherwise the registry version of RemoteREPL is used rather the developed https://github.com/c42f/RemoteREPL.jl/pull/55/commits/d9b836925d5384e2450b5da77612bb39f460d316#diff-3b9314a6f9f2d7eec1d0ef69fa76cfabafdbe6d0df923768f9ec32f27a249c63R117
I think I successfully added TestEnv in the dependencies of the GHAction-julia, and shouldn't be a problem https://github.com/c42f/RemoteREPL.jl/pull/55/commits/d9b836925d5384e2450b5da77612bb39f460d316#diff-3ab46ee209a127470fce3c2cf106b1a1dbadbb929a4b5b13656a4bc4ce19c0b8R76
Could you try running the test please ?

@c42f Hi Claire. If there are no issues with the PR, could you please merge it and maybe make a new release ?

@c42f Are there any blocking points? Do you think we can merge that soon?

I've fixed the conflicts by rebasing and pushing to the pull request branch.
That also seems to have triggered CI.  Can you have a look at what's gone wrong there?

ouf. that's gonna be hard. Locally using TestEnv I get the tests passed, but with the ] test something fails with a different error from the CI. Also sometimes (mostly when I exit the kernel) I get a non fatal error printing the following
error in running finalizer: Base.IOError(msg="write: broken pipe (EPIPE)", code=-32)
uv_write at ./stream.jl:1066
unsafe_write at ./stream.jl:1120
write at ./strings/io.jl:248 [inlined]
writeheader at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/usr/share/julia/stdlib/v1.10/Serialization/src/Serialization.jl:703
serialize at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/usr/share/julia/stdlib/v1.10/Serialization/src/Serialization.jl:776
unknown function (ip: 0x7fa575ae73b9)
_jl_invoke at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gf.c:2895 [inlined]
ijl_apply_generic at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gf.c:3077
close at /u/home/wima/fchrstou/GitProjects/RemoteREPL.jl/src/client.jl:166
unknown function (ip: 0x7fa575ad01e5)
_jl_invoke at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gf.c:2895 [inlined]
ijl_apply_generic at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gf.c:3077
run_finalizer at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gc.c:318
jl_gc_run_finalizers_in_list at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gc.c:408
run_finalizers at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gc.c:454
ijl_atexit_hook at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/init.c:299
jl_repl_entrypoint at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/jlapi.c:732
main at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/cli/loader_exe.c:58
unknown function (ip: 0x7fa581eb1249)
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)

I will have to look closer to that when I find some time. Btw thanks for making me a collaborator :)

Oof. I suspect I've seen that finalizer error before. Probably not your fault! It's hard to clean up the ssh tunnel cleanly when the process exists. (Unless there's a way to hook the REPL shutdown more cleanly?)
This is a relatively hard package to test.

As said. The problem was very obscure and I still don't understand what was the issue. include("test/runtests.jl") was working but ] test was not. I just removed all the TestEnv stuff and now it seems that the tests consistently pass. @c42f can we merge ?

@c42f pushed an update. magic protocol is checked first now.

Should we make a v0.3.0 release ? If I have permissions and it's fine by you I can make one.

This PR seems to have broken the SSH tunnel tests :-(
They work for me before this PR, but not after.
I can't remember exactly, but I think the SSH tests are not enabled in CI because getting the SSH server working in the CI environment wasn't finished.


Format assignment expressions (FormatExprNamedExpr)

Assignment expressions are those using the "walrus operator" :=:
if x := f():
    g(x)

In general, they are easy to format, they are a sequence of target, space, :=, space, value with optional parentheses.
The difficulty is that there are a list of exceptional cases in PEP 572 where the parentheses are mandatory based on the surrounding node, e.g. keyword argument values need parentheses. So for implementing this each node in the list in PEP 572 needs to have a special case where it checks whether the expression it is about to format is a ExprNamedExpr and in that cases sets the parentheses to always.

If the named expression needs to be parenthesized, won’t it already have been parenthesized in the parsed source? (Otherwise it would’ve been invalid syntax in the first place.) So would those “exceptions” be solved by preserving original parentheses? May be misunderstanding.

Good point, i filed this because i tried the naive solution and failed, but you're right, the tuple way of checking if there are parentheses in range is likely better

Implemented this differently because unlike tuples even mandatory parentheses are not part of the range


[3.x] Clarify String.get_slice behavior

Clarify that the function returns the whole string if there is no instances of the delimiter in the string.

4.x version: #78463

Thanks!

Thank you!

Cherry-picked for 3.5.3.


(Upgrade): Update the esm-patient-common-lib version.

Requirements

[ ] This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes the ticket number in the format OHRI-123 My PR title.
[ ] My work includes tests or is validated by existing tests.

Summary

This PR updates the openmrs and common-lib versions, this necessitated some changes since some workspace functions were moved to other places or are no longer being exported. But this fixes the workspace bugs we have been seeing.
This PR also updates the openmrs and common lib versions inside the ohri-esm-commons-lib.

Screenshots
Uploading Workspaces-fix.mov…
Related Issue

No ticket

Other

@hadijahkyampeire please run yarn again and commit the updated lockfile.


Downloading target from archive returns data for a different, nearby star

It's trying so hard to do a good job, but accidentally grabs a star 4 arcsec away (both have defined and downlinked apertures, which happen to touch each other)
from lightkurve import KeplerTargetPixelFile, LightCurve
tpf = KeplerTargetPixelFile.from_archive(6507433, quarter=8)

> Found 1 File(s)
> Downloading URL https://mast.stsci.edu/api/v0/download/file?uri=mast:Kepler/url/missions/kepler/target_pixel_files/0065/006507427/kplr006507427-2011073133259_lpd-targ.fits.gz to ./mastDownload/Kepler/kplr006507427_lc_Q011111111111111111/kplr006507427-2011073133259_lpd-targ.fits.gz ...

The star it gets is one pixel away from the one I want. My guess is that there's a radius search behind the scenes, and there's some bad conversations to and from RA and Dec and it's not accounting for the fact that it knows the true KIC of the target I want? But that's just a guess on my part.
Still <3 Lightkurve!

Thank you for reporting this @benmontet!  I believe your diagnosis is spot on.
We may be able to solve this by explicitely passing target_name to the astroquery.mast interface when something looks like an EPIC or KIC id. I believe we didn't do this because we thought this may never be an issue.  Identifying an EPIC for which this is an issue is super helpful. Let's make it a unit test!

@benmontet This bug fix is now live on pypi as part of lightkurve v1.0b7.  Can you let us know whether you are, indeed, a happy Ben?

It is working for me locally on v1.0b7. I am indeed a happy Ben. But let's be honest, I am already happy every time I get a chance to interact with your lovely team!

True!  I am happy every day I get to interact with our lovely team!


[BUG]: Parsing an NVME response fails for list-subsys

Bug Description

CSI Driver fails to complete GetSession()

Logs
 END: NVMeConnector.validateNVMeVolumeInfo
START: NVMeConnector.checkNVMeSessions
START: NVMeConnector.getSessionByTargetInfo
{"level":"error","msg":"JSON-encoded parsing error: json: cannot unmarshal array into Go value of type gonvme.Response","time":"2024-06-26T06:03:23.694699034Z"}

Screenshots
No response
Additional Environment Information
No response
Steps to Reproduce
Install CSI Powerstore on a node with NVMe client
Expected Behavior
CSI Driver should able to parse response for: "nvme list-subsys -o json"
CSM Driver(s)
CSI Powerstore v2.10
Installation Type
No response
Container Storage Modules Enabled
Resiliency
Container Orchestrator
K8s 1.30
Operating System
RH

/sync


Dangerous state after canceling trapezoidal control

If a trapezoidal motion is interrupted by setting axis state to AXIS_STATE_IDLE (eg. some kind of emergency stop) resuming operation is dangerous.
I've tried both
axis.controller.move_to_pos(pos)
axis.requested_state=AXIS_STATE_CLOSED_LOOP_CONTROL

and
axis.requested_state=AXIS_STATE_CLOSED_LOOP_CONTROL
axis.controller.move_to_pos(pos)

but there is always a massive non-trapezoidal motion. Looks like the old motion was still dry-running in IDLE state and the new one is taking over a position that does not match reality.
I've also tried adding axis.controller.pos_setpoint=axis.encoder.pos_estimate first, as there is some position error after interrupting the control of course, but there is still some non-trapezoidal motion.
Is there any safe procedure for recovering?

Seems the following sequence will mitgate the problem:
axis.controller.pos_setpoint=axis.encoder.pos_estimate
axis.controller.move_to_pos(axis.encoder.pos_estimate)
axis.requested_state=AXIS_STATE_CLOSED_LOOP_CONTROL
axis.controller.move_to_pos(pos)

It seems that the trajectory is always planned starting at pos_setpoint, not the real world state. Is this on purpose?

What version is this on?

I think the code line in doubt is https://github.com/madcowswe/ODrive/blob/ffbeaed61b74cb23c522681b062a0337c601330d/Firmware/MotorControl/controller.cpp#L53
which is still in master. planTrapezoidal initializes on pos_setpoint_, which may be far away from encoder pos_estimate after idling.

Yeah, this is taken care of in devel, it initializes pos_setpoint = pos_estimate upon entering closed loop.


microsoft latest interview questions for freshers

Hi @realabbas,
I really like your repository of interview questions. I am also preparing for the same for which your repository is really helpful.
I came accross one of the source for latest Microsoft Interview questions and would like to get it added here if you like.
Thanks.

Hi @realabbas,
I really like your repository of interview questions. I am also preparing for the same for which your repository is really helpful.
I came accross one of the source for latest Microsoft Interview questions and would like to get it added here if you like.
Thanks.

Thanks @utkarshverma11 Yeah sure, just create a PR and will merge it after review.


use promise syntax when handling $http result

using angular 1.6.0 with angular-swagger-ui 0.3.5, I got the following error
failed to load swagger: undefined    b(...).success is not a function

this commit fixes the issue. Tested.
(I did not test with angular < 1.6.0)
cf. https://docs.angularjs.org/api/ng/service/$http

see also 'Deprecation Notice' in https://code.angularjs.org/1.5.9/docs/api/ng/service/$http

The $http legacy promise methods success and error have been deprecated. Use the standard then method instead. (...)

thanks for sharing ! fixed in 0.4.0
sorry i didn't take your fix as another one was proposed without pom.xml #67


Support JavaScriptNext ?

@Benvie has written a sublime text 3 syntax highlighting tmLanguage file for ES6 ( https://github.com/Benvie/JavaScriptNext.tmLanguage )
I tried copying the block list over from this project but it doesn't filter out everything I think.
I'm not sure how to find out what symbols to add to the block list. Any advice?

Ping?


How to validate against json schema containing circular $ref?

Hi, thanks for this great work. I found that there is a new major version released to support $ref. However, where can I find the usage example about it?
Now I have json schema files, which some of them contains circular $ref. Namely, schema-A.json has a $ref to schema-B.json, schema-B.json has a $ref to schema-A.json.
Any help is appreciated and thanks in advanced.

For an example of $ref usage, I would take a look here: http://json-schema.org/example2.html. Circular $ref, like circular references, or arguments for that matter, will probably cause issues. The idea behind using $ref is to have reusable "modules" of information that can be used elsewhere. A circular reference would mean that you are referencing a parent object within a child object?

@csimplestring The schema can have circular dependencies which are resolved by the RefResolver. It will create an object graph in the memory. This schema in memory can be used to validate your data against. So this library can handle all $ref cases.

Can you give me an example code? Thanks!
---Sent from Boxer | http://getboxer.com
On 28 May 2016 09:56:56 CEST, Joost Nijhuis<EMAIL_ADDRESS>wrote:@csimplestring The schema can have circular dependencies which are resolved by the RefResolver. It will create an object graph in the memory. This schema in memory can be used to validate your data against. So this library can handle all $ref cases.  —You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.

@jojo1981 Thanks for your work. I just try it by using it. When I want to validate against a circular reference json schema, it seems to fail due to infinite recursion loop and use up all memory. Do I use the RefResolver in a wrong way?
I just use the RefResolver as the example in readme, also I notice there is a big change in API. So I guess maybe it is better to give me a demonstration or example in a correct way?

Yes, RefResolver inlines all refs, so you get an infinite loop if you have recursion in your schema

It's necessary to rethink schema compilation to avoid this problem

@csimplestring and @psafarov The RefResolver should be able to handle this. Can verify you're using the newest version of this library? Also an you add the schema you're using? Then I can try to reproduce this.

@jojo1981 unfortunately, I cant publish the schema I used, but what I found is that it occurs because object with reference to itself inside gets to ObjectIterator which iterate object recursively

#277 the issue is solved in this pull request

Hi, @jojo1981  Sorry for late response. After checking with my colleages, we found that the RefResovler should not be re-used in a for-loop.
In our code, we want to cache all the resolved schemas, so we write like this:
// This will cause infinite looping and crash
$refResolver = new RefResolver(new UriRretriever(), new UriResolver());
for ($schemas as $schema) {
  $resolved = $refResolver->resolver($schema);
  $cache[] = $resolved;
}

// but this will work ok
for ($schemas as $schema) {
  $refResolver = new RefResolver(new UriRretriever(), new UriResolver());
  $resolved = $refResolver->resolver($schema);
  $cache[] = $resolved;
}

I guess the RefResolver maintains a cache internally, could you explain a bit?

Circular references came in #277 and are available in 3.0.0


[HelpDot] Fix URL case

Details

Fixed Issues

$ https://github.com/Expensify/App/issues/45716
PROPOSAL:
Tests

cd docs && npm run createDocsRoutes && bundle exec jekyll serve --livereload --safe
Go to new expenisfy > connections
Verify structure is as per https://github.com/Expensify/App/issues/45716

[x] Verify that no errors appear in the JS console

Offline tests

QA Steps

[x] Verify that no errors appear in the JS console

PR Author Checklist

[x] I linked the correct issue in the ### Fixed Issues section above
[x] I wrote clear testing steps that cover the changes made in this PR

[x] I added steps for local testing in the Tests section
[x] I added steps for the expected offline behavior in the Offline steps section
[x] I added steps for Staging and/or Production testing in the QA steps section
[x] I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
[x] I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
[x] I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).

[x] I included screenshots or videos for tests on all platforms
[x] I ran the tests on all platforms & verified they passed on:

[x] Android: Native
[x] Android: mWeb Chrome
[x] iOS: Native
[x] iOS: mWeb Safari
[x] MacOS: Chrome / Safari
[x] MacOS: Desktop

[x] I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
[x] I followed proper code patterns (see Reviewing the code)

[x] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
[x] I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
[x] I verified that comments were added to code that is not self explanatory
[x] I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
[x] I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method

[x] If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:

[x] I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
[x] I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
[x] I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
[x] I verified the JSDocs style guidelines (in STYLE.md) were followed

[x] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
[x] I followed the guidelines as stated in the Review Guidelines
[x] I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
[x] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
[x] I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
[x] I verified that if a function's arguments changed that all usages have also been updated correctly
[x] If any new file was added I verified that:

[x] The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory

[x] If a new CSS style is added I verified that:

[x] A similar style doesn't already exist
[x] The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))

[x] If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
[x] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
[x] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
[x] If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
[x] If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:

[x] I verified that all the inputs inside a form are aligned with each other.
[x] I added Design label and/or tagged @Expensify/design so the design team can review the changes.

[x] If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
[x] If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos
https://github.com/user-attachments/assets/7f07f55a-aac1-408e-90b5-7f7ba4b48807

@ikevin127 kindly approve to assign internal

@ikevin127 please approve again

@rushatgabhane Can't approve again - assigned internal is @arosiclair.

The folder name for integrations was in the wrong case.
eg: Netsuite instead of netsuite.
This caused the URLs to break

I'm confused I don't see any files or folders renamed in this PR?

@arosiclair sorry that has been fixed. Git is case insensitive 😅

The failing test is a false positive. Good to merge

See here

🚀 Deployed to staging by https://github.com/arosiclair in version: 9.0.15-0 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
success ✅

🕸 web 🕸
success ✅

🚀 Deployed to production by https://github.com/roryabraham in version: 9.0.15-9 🚀

platform
result

🤖 android 🤖
failure ❌

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
success ✅

🕸 web 🕸
success ✅


fix panel resizing bug

Fixes #2832.

[ ] Added an entry to CHANGELOG.md if this change could be valuable to users

Is there a reason why we resize other side panel when touching side panel size?

btw. ignore clippy for now, since new rust just releases, we get new failing lints unfortunately

Could you rebase or merge latest master?

Is there a reason why we resize other side panel when touching side panel size? @MinusGix @dzhou121

Oh, this reminds me of the real bug.

Now it works as expected.

Nice, thanks for fixing both.


Attack Option in Wilderness

Current Behavior
Players cannot attack each other in Wilderness, because there is currently no attack option in the Wilderness.
Expected Behavior
When player enters Wilderness, they should have Attack option.
Steps to Reproduce the Problem

Make an alt account
Enter Wilderness with an alt account.

Addressed in https://github.com/Tomm0017/rsmod/commit/37609153adca0b20ebfc443ecc8278633819f89f


Docker: fix exposed port to be 8071.

I don't think exposing 8080 ever did anything as the server is listening on 8071. It looks like a customer has been facing issues with their docker setup not letting them map the port because it doesn't match the exposed from the dockerfile. I'm not sure how it works for everyone else but not here though anyhow it should be fixed.
Ref: https://x.com/0xblacklight/status/1872430388158533871

Thanks for the quick fix, guys!


Feature: Allow multiple instances of middleware

PR to address Issue #260

scope pino loggers to lambda closures instead of function properties
set request and response log property to first middleware pino logger but capture additional middleware pino loggers in new allLogs request and response property
unit tests to confirm each middleware redact properties are independent

@mcollina Whenever you have a free moment would you mind kicking off the workflow again? I don't seem to have permission but hoping that my fix has addressed the CICD issue. 🙏

@mcollina Oof; okay so what is the saying? Third time is the charm? I was worried that perhaps my removal of the prettyPrint property typescript test may have been premature and although it wasn't passing for me locally perhaps it would pass on CICD -- so I restored the line while fixing the ??= operator compiler error. However, it looks like the prettyPrint issue is not only an issue for me locally but also an issue on CICD so I went ahead and removed it again. I think now everything should be good to go and hopefully the next run will be a clean CICD run. 🤞

@mcollina I just realized that I can enable the same GitHub Actions CICD pipeline on my fork. So I went ahead and did that and found another ??= that I needed to replace and verified that the CICD all passes on my forked repo

So feel free to start the CICD workflow whenever you are ready we should be green. =)

@mcollina Latest failure seems to be a problem with how the test was written. The test assumes the sample server will always result in a 0 latency response time but in this particular test run. The response time turned out to be 1. I'll go ahead and update the test to match any digits instead of just 0 which should make the test more robust.
            --- expected
            +++ actual
            @@ -1,1 +1,1 @@
            -Response time is: 0 GET
            +Response time is: 1 GET

Yay, finally an all green CICD run. Guess it's up to y'all (@mcollina) to decide when to merge and cut a release. Thanks again for releasing this project to OSS, it's proven very beneficial for our request / response logging. 🎉

People modify the req.log to add properties into log. #30 With this change, the properties are no longer logged.


Task "show-sbom" raises this error: level=fatal msg="Exactly one argument expected"

Issue
The Task "show-sbom" raises an error when executed with this PipelineRun - https://github.com/redhat-buildpacks/builder-ubi-base/blob/main/.tekton/pipelinerun-builder-ubi-base.yaml#L37-L50
Error
builder-ubi-base-9dbgl-show-sbom[Duration: 15 seconds]

builder-ubi-base-9dbgl-show-sbom
[prepare] 2024/09/11 16:06:40 Entrypoint initialization

[place-scripts] 2024/09/11 16:06:41 Decoded script /tekton/scripts/script-0-fxckb

[show-sbom] time="2024-09-11T16:06:43Z" level=fatal msg="Exactly one argument expected"
[show-sbom] /tekton/scripts/script-0-fxckb: line 25: [: ==: unary operator expected
[show-sbom] Failed to get SBOM after 5 tries
[show-sbom] Error: accepts 1 arg(s), received 7
[show-sbom] main.go:74: error during command execution: accepts 1 arg(s), received 7
[show-sbom] Error: accepts 1 arg(s), received 7
[show-sbom] main.go:74: error during command execution: accepts 1 arg(s), received 7
[show-sbom] Error: accepts 1 arg(s), received 7
[show-sbom] main.go:74: error during command execution: accepts 1 arg(s), received 7
[show-sbom] Error: accepts 1 arg(s), received 7
[show-sbom] main.go:74: error during command execution: accepts 1 arg(s), received 7
[show-sbom] Error: accepts 1 arg(s), received 7
[show-sbom] main.go:74: error during command execution: accepts 1 arg(s), received 7

%!s(<nil>)

What did you pass as the IMAGE_URL? It looks like it was 7 different whitespace-separated items
[show-sbom] Failed to get SBOM after 5 tries
[show-sbom] Error: accepts 1 arg(s), received 7

Here is a recent job executed : https://console.redhat.com/application-pipeline/workspaces/cmoullia/applications/buildpack-remote/pipelineruns/builder-ubi-base-cpffn
IMAGE_URL populated is the following and don't include white spaces
quay.io/redhat-user-workloads/cmoullia-tenant/buildpack-remote/builder-ubi-base:c5c33d9829696a26e807e745dc56aa983fc2fc0f

We won't really be able to reproduce this since you have a highly custom pipeline. Could you try running a modified version of the show-sbom task (e.g. add set -x to the bash script) in your pipeline and debugging what is going wrong?


Inserting a datetime in DB using param attribuut formatstring

Describe the bug
When trying to use the build in function to format a datetime unexpected result produced
Reporter
Tarik
Category

Frank Framework

To Reproduce
try using a param with formatstring to make a datetime insertion into a db
Expected behavior
I expect the output as stated in fornatString to be leading
Screenshots

param name="EVENT_TYDST" xpathExpression="*/HEKJE_Q/HEKJE_Q_TIMSTMP" type="timestamp" formatString="yyyyMMddHHmmssSSS"/>
Which has a value of<PHONE_NUMBER>1626169 as input
after the use of this param the result is : Sat Sep 12 08:16:27 CEST 2020
I would expect at least for the miliseconds to be still present

Environment:
all
Additional context

The printed result is caused by java.util.Date#toString(). Somewhere in the Testtool Report.java I found this:
if(testTool.getMaxMessageLength() > 0 && message != null && message.toString().length() > testTool.getMaxMessageLength()) {
	checkpoint.setMessage(truncateMessage(checkpoint, message.toString()));
}

In case the message is of type Message Then in the toString, there should be a check to validate if the type is an instance of java.util.Date and if so, print it according to the DateUtils.fullIsoFormat format.
Even though this sounds like a fix, it needs to be reproduced to validate if this will actually solve the issue. If not an additional change is required in the ibis-ladybug project. See ibissource/ibis-ladybug#14 for more info.

This is not only in the testtool, but also in adapters this is happening. When we do a select using sqlplus, we get the timestamp with milliseconds as it has been stored, when we do the exact same select from the GUI or from an adapter, we are missing the milliseconds.

@ricardovh you can set the property jdbc.timestampFormat to display the milliseconds in the gui, by default milliseconds will not be visible.

https://github.com/ibissource/ibis-ladybug/pull/51 will format the displayed date as yyyy-MM-dd HH:mm:ss.SSS


Run fleet agent for local cluster in cattle-fleet-local-system

Relevant issue: https://github.com/rancher/fleet/issues/531

https://github.com/rancher/rancher/issues/34716


HTTPS server support

Has the option to run an https server off of hyper been removed in the latest version because of all of the SSL restructuring? You used to simply be able to specific a certificate and a key and have an https server running. It was pretty convenient. If it has been removed, is it planned to be added back in soon?

It is not removed, just requires that you pick a Ssl implementation
yourself. You can use the Openssl one, and it includes a function to accept
a cert and key. http://hyper.rs/hyper/hyper/net/struct.Openssl.html
On Fri, Jun 26, 2015, 9:20 PM Josh Leverette<EMAIL_ADDRESS>wrote:

Has the option to run an https server off of hyper been removed in the
latest version because of all of the SSL restructuring? You used to simply
be able to specific a certificate and a key and have an https server
running. It was pretty convenient. If it has been removed, is it planned to
be added back in soon?
—
Reply to this email directly or view it on GitHub
https://github.com/hyperium/hyper/issues/586.

alright, thanks!


[video_player] fix: #40429

resolves this issue: https://github.com/flutter/flutter/issues/40429
Description
on iOS:

The local file path is not encoded correctly, so I had to replace spaces with %20
The local file path must have an extension, say ".mp4"

Related Issues
Replace this paragraph with a list of issues related to this PR from the issue database. Indicate, which of these issues are resolved or fixed by this PR. Note that you'll have to prefix the issue numbers with flutter/flutter#.
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

[ ] I read the Contributor Guide and followed the process outlined there for submitting PRs.
[ ] My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
[ ] All existing and new tests are passing.
[ ] I updated/added relevant documentation (doc comments with ///).
[ ] The analyzer (flutter analyze) does not report any problems on my PR.
[ ] I read and followed the Flutter Style Guide.
[x] The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
[ ] I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
[ ] I updated CHANGELOG.md to add a description of the change.
[x] I signed the CLA.
[ ] I am willing to follow-up on review comments in a timely manner.

Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?

[ ] Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
[x] No, this is not a breaking change.

Hello @p30arena - thank you for the PR. Can you think of a way to test it in the example/test_driver (as it seems to be iOS platform specific)? That would surely help to get it landed.

Hello @p30arena - thank you for the PR. Can you think of a way to test it in the example/test_driver (as it seems to be iOS platform specific)? That would surely help to get it landed.

@mklim @ened
is it necessary to add tests?
it seems that android handles the encoding of the Uri itself, but iOS leaves it to the programmer.
I rathered to encode it on the dart side, so the debug process will be easier in the future.

hi @p30arena , there is no problem in encoding the URI on the Dart side. If anything, it will be helpful to client programmers to see what a Flutter plugin is doing.
However, we do need tests. No matter how small the change is, it changes plugin behaviour.
We can easily ramp up a lot of untested behaviour changes if we leave such things untested. Therefore, let's stay on the safe side and add a test. There should also be a line of documentation to explain the URL encoding behaviour.
It may be enough to write a widget test (and listen to the URLs send to the video player method channel).
Can you think of any case where the URL encoding may not be desired?

hi @p30arena , there is no problem in encoding the URI on the Dart side. If anything, it will be helpful to client programmers to see what a Flutter plugin is doing.
However, we do need tests. No matter how small the change is, it changes plugin behaviour.
We can easily ramp up a lot of untested behaviour changes if we leave such things untested. Therefore, let's stay on the safe side and add a test. There should also be a line of documentation to explain the URL encoding behaviour.
It may be enough to write a widget test (and listen to the URLs send to the video player method channel).
Can you think of any case where the URL encoding may not be desired?

@ened
File Paths don't require Uri Encoding, so The user is passing the correct path.
File Path must end with an extension, so I've included an assert.
I can't think of a proper way to write a test for The File Path Passed By The User/Developer.
We just have to make sure that on the native side, we don't encode the path.
Can I write a test for that?

@ened
File Paths don't require Uri Encoding, so The user is passing the correct path.

Based on the code submitted, the URI encoding happens for iOS App.

File Path must end with an extension, so I've included an assert.

I think the assert is good.

I can't think of a proper way to write a test for The File Path Passed By The User/Developer.
We just have to make sure that on the native side, we don't encode the path.
Can I write a test for that?

I think the key test is to check what is transferred from Dart to Native.
So, your tests would try to use a MockPlatform (path_provider should have a example, or see https://github.com/flutter/plugins/blob/b76fe5d58024f479df4057920289c04277c30632/packages/android_intent/test/android_intent_test.dart) for FakePlatform, then check if the value is checked on Dart (Assetions) and also the transformation (URI encoding) when it is sent from Dart to Native.
The tests should cover:

on iOS: 'requires the path to contain a file extension'
on iOS: 'requires the path to be URI encoded'

And you can write a test (in dart only, no need for a driver implementation I think) to check those 2 points.
As a side note: Could we also encode the URI for the Android side? What happens if we encode the URI on Dart side and pass to Android? Will Android "double encode"? If not, could you remove the if/else for that and just encode every time?

@p30arena thank you for your contribution! Unfortunately the structure of the plugin has changed lately to support implementations on more platforms. Mainly the plugin was moved to a new subdirectory and now uses a common platform interface. Adapting your PR to the new structure should be straight forward. If you have questions please ask!
E2E tests are currently skipped on iOS but I think we could at a test for this already to https://github.com/flutter/plugins/blob/master/packages/video_player/video_player/example/test_driver/video_player_e2e.dart.

Oh, do you mind changing the title to something more descriptive?

Thanks for the contribution. Since there hasn't been any update on adding the tests described above in over a year, I'm going to close this to get it off our our review queue, but if you are still interested in moving forward with it please re-open it once the PR is updated.

After year and a half I can confirm this is still an issue. Newest video_player so far is 2.4.7 and if you have spaces in the local file name or remote URL the video won't load on iOS.


[Snyk] Security upgrade @backstage/core-plugin-api from 0.0.0-use.local to 0.1.0

Snyk has created this PR to fix 1 vulnerabilities in the yarn dependencies of this project.
Snyk changed the following file(s):

plugins/code-coverage/package.json

Note for zero-installs users
If you are using the Yarn feature zero-installs that was introduced in Yarn V2, note that this PR does not update the .yarn/cache/ directory meaning this code cannot be pulled and immediately developed on as one would expect for a zero-install project - you will need to run yarn to update the contents of the ./yarn/cache directory.
If you are not using zero-install you can ignore this as your flow should likely be unchanged.

⚠ Warning
Failed to update the yarn.lock, please update manually before merging.

Vulnerabilities that will be fixed with an upgrade:

Issue
Score

Regular Expression Denial of Service (ReDoS) SNYK-JS-PATHTOREGEXP-7925106
  67

[!IMPORTANT]

Check the changes in this PR to ensure they won't cause issues with your project.
Max score is 1000. Note that the real score may have changed since the PR was raised.
This PR was automatically created by Snyk using the credentials of a real user.

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.
For more information:
🧐 View latest project report
📜 Customise PR templates
🛠 Adjust project settings
📚 Read about Snyk's upgrade logic

Learn how to fix vulnerabilities with free interactive lessons:
🦉 Regular Expression Denial of Service (ReDoS)

🎉 Snyk hasn't found any issues so far.
✅ code/snyk check is completed. No issues were found. (View Details)


User Assigned Managed Identity + ACI + Azure.Identity: ManagedIdentityCredential authentication unavailable. No Managed Identity endpoint found

Is it supported to use ManagedIdentityCredential to access ServiceBus? Is there any setup needed? Please help take a look.
Here's the details:
Packages
    <PackageReference Include="Azure.Identity" Version="1.3.0" />
    <PackageReference Include="Azure.Messaging.ServiceBus" Version="7.1.2" />

Container: mcr.microsoft.com/dotnet/aspnet:3.1
Code
ManagedIdentityCredential cred = new ManagedIdentityCredential(_authority.StampManagedIdentityClientId);
ServiceBusClient sbClient = new ServiceBusClient(sbNamespace, cred);

Some investigation

Curl <IP_ADDRESS> works, for example

curl 'http://<IP_ADDRESS>/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https%3A%2F%2Fvault.azure.net' -H Metadata:true -s

Returns the access token successfully from within the running container;

There no variables set any endpoints (checking by using printenv).

Checked the source code a bit, it seems like some ENDPOINTS are needed. I tried to setup on manually in resource explorer for the container instance:

          {
            "name": "IDENTITY_ENDPOINT",
            "value": "http://<IP_ADDRESS>"
          },
          {
            "name": "IDENTITY_HEADER",
            "value": "Metadata:true"
          }

That got me another error:
Azure.Identity.AuthenticationFailedException: ManagedIdentityCredential authentication failed: Service request failed.
Status: 404 (Not Found)

Content:
404 page not found

Headers:
X-Content-Type-Options: REDACTED
Date: Fri, 16 Apr 2021 05:52:12 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 19

 ---> Azure.RequestFailedException: Service request failed.
Status: 404 (Not Found)

Content:
404 page not found
...

Hi @xiaomi7732.  Thank you for your feedback and we regret that you're experiencing difficulties.  With respect to Service Bus, both the service and the client library support Managed Identity.   I can't speak to what setup may be required for the namespace, but your snippet for instantiating the client looks correct to me.
I've looped in the folks that represent Azure.Identity, as they're best able to assist with any nuances around setup and use of the ManagedIdentityCredential.

Hi @xiaomi7732 - Can you clarify what error you were getting before making any configuration changes using the code below?
ManagedIdentityCredential cred = new ManagedIdentityCredential(_authority.StampManagedIdentityClientId);
ServiceBusClient sbClient = new ServiceBusClient(sbNamespace, cred);

One possible problem you could be hitting is that the IMDS endpoint can sometimes take a few seconds to initialize in container. You could validate this by reproducing this with logging enabled. The output should indicate what error was encountered and whether the IMDS endpoint was found.

Hi @christothes Thanks for the asking. The initial exception was:
ManagedIdentityCredential authentication unavailable. No Managed Identity endpoint found.

I know about the issue that it could takes a few for the IMDS to show up in ACI and I don't believe it was the cause here because my service is a message pump that keeps trying to fetch a message out of a sb topic/sub - it will keep retrying when it failed.
Now that I look into it more, there are something that I noticed for what it worth:
What I tried but does NOT work

The scopes on the TokenRequestContext comes with '/.default' (form ADAL?), for example

"https://servicebus.azure.net/.default"

To invoke the IMDS endpoint, the resource query needs to be:

resource=UrlEncoded("https://servicebus.azure.net/")   // No './default'

I haven't got a chance to look into the SDK code to see if that is handled - derive and overriding GetTokenAsync for ManagedIdentityCredential to remove the .default from the TokenRequestContext didn't work. I guess that is not it.
What I tried and worked for me

I got it work by invoking the endpoint manually so that there's no other issues:

using System;
using System.Linq;
using System.Net.Http;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
using Azure.Core;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Logging;
using Microsoft.TraceManager.Models;

namespace Microsoft.TraceManager.Service
{
    public class ManualManagedIdentityCredential : TokenCredential
    {
        private static readonly string CacheKeyPrefix = new Guid("db9b9f68-223a-4034-be20-4f97bf7e048a").ToString();

        private readonly HttpClient _httpClient;
        private readonly IMemoryCache _memoryCache;
        private readonly JsonSerializerOptions _serializerOptions;
        private readonly ILogger _logger;

        public ManualManagedIdentityCredential(
            HttpClient httpClient,
            IMemoryCache memoryCache,
            JsonSerializerOptions serializerOptions,
            ILogger<ManualManagedIdentityCredential> logger)
        {
            _logger = logger ?? throw new ArgumentNullException(nameof(logger));
            _httpClient = httpClient ?? throw new ArgumentNullException(nameof(httpClient));
            _memoryCache = memoryCache ?? throw new ArgumentNullException(nameof(memoryCache));
            _serializerOptions = serializerOptions ?? throw new ArgumentNullException(nameof(serializerOptions));
        }
        public override AccessToken GetToken(TokenRequestContext requestContext, CancellationToken cancellationToken)
        {
            // Not used.
            _logger.LogDebug("[{method}]{requestContext}", nameof(GetToken), JsonSerializer.Serialize(requestContext));
            throw new NotImplementedException();
        }

        public override async ValueTask<AccessToken> GetTokenAsync(TokenRequestContext requestContext, CancellationToken cancellationToken)
        {
            _logger.LogTrace("[{method}]{requestContext}", nameof(GetToken), JsonSerializer.Serialize(requestContext));

            string resource = string.Join(',', requestContext.Scopes.Select(s => s.Replace(".default", "")));
            if (string.IsNullOrEmpty(resource))
            {
                throw new InvalidOperationException("No target resource for authentication.");
            }

            var cacheKey = GetCacheKey(resource);
            try
            {
                AccessToken accessToken = await _memoryCache.GetOrCreateAsync(cacheKey, GetAccessTokenAsync).ConfigureAwait(false);
                _logger.LogDebug("Access token fetched.");
                _logger.LogTrace("Access token: {accessToken}", accessToken);
                return accessToken;
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "Error getting access token from cache");
                _memoryCache.Remove(cacheKey);
            }
            return default;
        }

        private async Task<AccessToken> GetAccessTokenAsync(ICacheEntry cacheKeyEntry)
        {
            (string Prefix, string Key) entryValue = ((string Prefix, string Key))cacheKeyEntry.Key;
            string resource = entryValue.Key;
            string resourceEncoded = HttpUtility.UrlEncode(resource);
            string targetUrl = $@"http://<IP_ADDRESS>/metadata/identity/oauth2/token?api-version=2018-02-01&resource={resourceEncoded}";
            Uri identityUri = new UriBuilder(targetUrl).Uri;
            HttpRequestMessage identityRequest = new HttpRequestMessage(HttpMethod.Get, identityUri);
            identityRequest.Headers.TryAddWithoutValidation("Metadata", "true");
            HttpResponseMessage response = await _httpClient.SendAsync(identityRequest).ConfigureAwait(false);
            response.EnsureSuccessStatusCode();
            string responseBody = await response.Content.ReadAsStringAsync();
            ManagedIdentityResponse managedIdentityResponse = JsonSerializer.Deserialize<ManagedIdentityResponse>(responseBody, _serializerOptions);
            cacheKeyEntry.SetAbsoluteExpiration(managedIdentityResponse.Expiry.AddSeconds(-10));
            return new AccessToken(managedIdentityResponse.AccessToken, managedIdentityResponse.Expiry);
        }

        private (string Prefix, string Key) GetCacheKey(string resource)
        {
            return (CacheKeyPrefix, resource);
        }
    }
}

@xiaomi7732 The credential should work without having to do any manual configuration. Just out of curiosity, does it work if you use the DefaultAzureCredential as shown in this example?

@christothes That was my understanding too. If I understand correct, DefaultAzureCredentical is just a chain of credentials. For a service deployed to ACI, only managed identity will possibly working. In that sense, how is it different than using ManagedIdentityCredential directly? Thanks.

It shouldn't be different, other than it constructs the ManagedIdentityCredential for you with the client option set from the ManagedIdentityCredentialOptions. I don't expect that it will make a difference.  Actually, what would be more interesting is the logging output suggested initially.
Details on how to enable logging can be found here.


samples: sockets: echo_async: Don't include <sys/fcntl.h>

POSIX doesn't mandate such a header, only <fcntl.h>. <sys/fnctl.h>
is just an internal implementation detail of Newlib on which we should
not rely.
This makes it possible to build this sample against minimal libc.
Signed-off-by: Paul Sokolovsky<EMAIL_ADDRESS>

Codecov Report

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

@@           Coverage Diff           @@
##           master   #12047   +/-   ##
=======================================
  Coverage   48.05%   48.05%
=======================================
  Files         281      281
  Lines       43414    43414
  Branches    10404    10404
=======================================
  Hits        20862    20862
  Misses      18403    18403
  Partials     4149     4149

Continue to review full report at Codecov.

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


Improved modeling of tank dynamics (Issue # 165)

The option to use an IMPLICIT method (instead of the traditional EXPLICIT method) for updating tank levels was added that produces more stable results. How to use it is described in the updated v. 2.2 Release Notes. A test example can be found here:
Todini1.txt. The results for this example, illustrating more stable tank dynmaics, are shown here

This update will fail the reg tests for those files that request an input summary be written to EPANET's Status Report since it adds a new line to the summary that lists the method use to model tank dynamics.

@LRossman also curious why not totally switch over to the implicit solution and deprecate the explicit solution.

@michaeltryby I'm perfectly fine with replacing the explicit method with the implicit one if people won't mind seeing different (but more realistic) results. In most cases where tanks are not hydraulically connected to one another the difference will be negligible. When they are hydraulically connected the results will be better. If there is consensus on just going with the implicit method then I will cancel this PR (how do I do that?) and submit a new commit that replaces the explicit method with the implicit one instead of creating two options.

@LRossman I am fine switching over to the implicit method. What do other people think?

I am all for it. Out with the old!
Jim Uber •<PHONE_NUMBER> • www.citilogics.com

On Aug 27, 2018, at 4:26 PM, Michael Tryby<EMAIL_ADDRESS>wrote:
@LRossman I am fine switching over to the implicit method. What do other people think?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

You can close a pull request without merging it. Then you can start a new one. Be sure to update your fork first. Here is a link that explains how:
https://help.github.com/articles/syncing-a-fork/

Closing this PR to re-work tank dynamics.


Data Augmentation？

Should I need to process original dataset to get the data augmentation？I can't find the the code of data augmentation in this respo.

@amazon-auto Any info on this?

Hello, our data augmentation is obtained via https://github.com/makcedward/nlpaug
Specifically, you may wanna check nlpaug.augmenter.word.ContextualWordEmbsAug

OK Thanks

@Dejiao2018  In the code:
train_text = train_data['text'].fillna('.').values
train_text1 = train_data['text1'].fillna('.').values
train_text2 = train_data['text2'].fillna('.').values

Could you public same of  datas or  subdata ?

In nlpaug.augmenter.word.ContextualWordEmbsAug there are two parameters？
aug = naw.ContextualWordEmbsAug(model_path='bert-base-uncased', action="substitute")

What model_path do you choose ？ @Dejiao2018

"We augment the data via word substitution, and we choose Bertbase and Roberta to generate the augmented pairs"


feat: add valid_url_strict rule

Description
Supersedes #4658
Fixes #3156
The current valid_url is too loose.
I referred to https://github.com/codeigniter4/CodeIgniter4/pull/4658#issuecomment-838524347
Checklist:

[x] Securely signed commits
[x] Component(s) with PHPDoc blocks, only if necessary or adds value
[x] Unit testing, with >80% coverage
[x] User guide updated
[x] Conforms to style guide

How about these?

remove mailto,tel,sms from the default valid schemes

I can't imagine use cases for validating mailto, tel, and sms URLs.

add using FILTER_VALIDATE_URL to the user guide

Yes, I agree that we should get rid of mailto,tel,sms. I was searching why we added these and it seems like we took it because laravel helper had it. Maybe there is some use case, but I don't see a reason to have these as allowed protocols by default.
I was thinking about it a little more and maybe we should go a step further and assume that the majority of users would like to validate a "normal" URL address - with a valid TLD name in it? I believe that would be the most common use case (we have a separate rule for validating IP addresses).
We could validate TLD based on a list e.g: https://github.com/umpirsky/tld-list. It would be an additional step in url validation. Thoughts?

I was thinking about it a little more and maybe we should go a step further and assume that the majority of users would like to validate a "normal" URL address - with a valid TLD name in it? I believe that would be the most common use case (we have a separate rule for validating IP addresses).

I also think the majority of users would like to validate web addresses.
But if users really need to check the URL, they need to check not only TLD, but also domain name.
Is there much value in checking only the TLDs? I'm not sure.
If we check the hostname in a URL, there are a lot of tasks to do.
See https://docs.laminas.dev/laminas-validator/validators/hostname/
And even if we use laminas-validator, we can't check if  the URL really exists.

I think sticking with validating the "format" is the way to go. I'm not opposed to something larger, like verifying domains and whatnot, but I don't think that belongs in the Format Rules but perhaps an extension of URI class or a separate Validation rule in its own library.

Thanks, guys!


Manual common-files update

Please provide a description of this PR:
Manual common-files update since the automated PR did not gen this.

This is replaced by https://github.com/istio/istio/pull/39084


Limitation

Can not visualize 3D land surface.

ref: https://librenepal.com/article/reading-srtm-data-with-python/


Ability to control press-hold time dynamically for Bots

I'd like to be able to dynamically control how long a press happens for each push signal.
TL;DR Waiting a period of time between switching it on/off while in Switch mode is not the same as specifying a "Press-hold Time" in the app.
Press-hold Time can be configured in the official app, but via this integration (or even the official app) you can't control this duration for each press.
This behavior could be somewhat achieved with this integration by putting the Bot in Switch mode, sending a signal to turn the switch on, and then waiting a dynamic period of time before sending another signal to turn the switch off. There are two problems with this approach though.

I believe this would still require use of the app to set the mode and it would be nice to work completely independently of the app.
The Press-hold Time seems to work independently of whether the button is being pressed where it remains in a depressed state for the period of time specified in the app.

To elaborate on # 2, there seem to be 3 relevant states when in Switch mode:

The button is in an up state (it's sticking out slightly from the front of the button)
A press-hold state which it will stay in for the period of time that's specified for the Press-hold Time setting in the app. In this state the lever is depressed slightly below the bottom of the button.
A hold state where the lever is down and perpendicular to it's default resting position inside the Bot.

Waiting a period of time does not keep the button in a press-hold state where it's depressed, but rather just perpendicular to the Bot. The time the Bot is in a press-hold state is only for the duration of time specified in the app.
So if I want the button to wait in a "held" state for a period of time, there's no way to do this dynamically.
I'm pretty sure this is possible to do client-side because I've done it using their official node-switchbot library. You can see in the example for moving the arm of the Bot where they call switchbot.wait(5000) after device.down(). When "down", it's in the fully depressed "press-hold" state.
Sorry if this was a bit long winded. I have a use case where a perpendicular lever is not adequate and I need it to go to the more obtuse angle where it's below the bottom plain of the Bot.
What are your thoughts? Happy to elaborate more if needed :)

Great thanks. I think I was looking for something native with the HA integration, but this sounds like it should work. Will give it a shot.

you can also set the switchbot mode (press vs switch) from the esp32
Here you will want it in press mode. you will most likely not need to change the mode once initially sent through the switchbot app or the esp32

@ScottG489 I forgot to mention that the esp32 code also supports simulating on/off while the bot is in 'press' mode and will use different hold times for on vs off. Which might be more what u want
example: Coffee maker has one button. Holding 5 secs turns it on. Holding 0 secs turns it off
if the esp32 loses power it will use an mqtt retained message to set the last state
if the state gets messed up, you need to mqtt call set STATEON or STATEOFF
on/off 'switch' mode is a push/pull style and probably not what you want from your description
use this in the code ...
/*** Bots in PRESS mode to simulate ON/OFF - ESP32 will try to keep track of the ON/OFF state of your device while in PRESS mode***/
      // Add bots while in PRESS mode that will simulate ON/OFF. Default state will be used if no MQTT retained on state topic
      // false = default state = OFF
      // true = default state = ON
      // If the state is incorrect, call set STATEOFF or STATEON
      static std::map<std::string, bool> botsSimulateONOFFinPRESSmode = {
        /*{ "switchbotone", false },
          { "switchbottwo", false }*/
      };

      //Add bots OFF hold time for simulated ON/OFF, if not in list, the current hold value will be used. Device must be in botsSimulateONOFFinPRESSmode list
      static std::map<std::string, int> botsSimulatedOFFHoldTimes = {
        /*{ "switchbotone", 0 },
          { "switchbottwo", 10 }*/
      };

      //Add bots ON hold time for simulated ON/OFF, if not in list, the current hold value will be used. Device must be in botsSimulateONOFFinPRESSmode list
      static std::map<std::string, int> botsSimulatedONHoldTimes = {
        /*{ "switchbotone", 15 },
          { "switchbottwo", 1}*/
      };


⚠ DesiTorrents has degraded performance

In 755720e, DesiTorrents ($DST) experienced degraded performance:

HTTP code: 200
Response time: 9265 ms

Resolved: DesiTorrents performance has improved in 4f8bda1.


Tag registration

The section named "How to register a design-variation axis tag" does not, in the end, describe how to register a design-variation axis tag... "Microsoft welcomes nominations for new design-variation axis tag registration." is as close as it comes. How should such nominations be submitted?

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

ID: 6cafec77-2f87-b614-3502-243b361ce877
Version Independent ID: e002a131-e1ad-1a81-4e50-0b3ce56f605f
Content: OpenType Design-Variation Axis Tag Registry (OpenType 1.8.4) - Typography
Content Source: typographydocs/opentype/spec/dvaraxisreg.md
Product: typography
GitHub Login: @PeterCon
Microsoft Alias: alib

@simoncozens  Was this intended to be in relation to registration of design-variation axis tags or, rather, to registration of language system tags (a request for which you also opened an issue at about the same time as this issue)?

Yes and no. When hoping to register a language tag, I went looking for how it should be done. Since I didn’t find any clarity on how to register a language tag, I looked at the other tag registry pages, and found that unlike other tags, the axis tag page does discuss how to register an axis tag - but doesn’t give details of the nomination process.

For OT 1.9, I'll add something to the Language System Tags page. (I think this was made clear at some point in the past, but got dropped along the way as communication channels also changed.)
For axis tags, it's a bit different since that's somewhat more involved.

For registering design axis tags, we tried setting up a process using a dedicated repo, https://github.com/microsoft/OpenTypeDesignVariationAxisTags. But it didn't really succeed, mainly because we didn't fully anticipate what would be needed to iterate on proposals to get at (i) what would be broadly useful and likely to be supported in apps, and (ii) how to spec details like the axis scale.
The dvaraxisreg page could point to that other repo, but I'm not sure that would be most useful right at this time (until we work out better processes). That page could simply suggest opening an issue in the typography-issues repo (as I've added for languagetags), but I'm still not sure if that would help much—it's not like many people are proposing new registered axes (much narrower group than for language system tags).

it's not like many people are proposing new registered axes

Maybe it's because they don't know how. ;-)

The initial process presumed something like that which resulted in registration of the five initial OT variation axes, i.e. the submission of a formal axis specification with appropriate details of axis scale units, intended software interactions, and so forth. This failed early because, unlike those five initial axes—for which existing scale unit models and software interaction already existed—, new axes were being invented from scratch, and no one knew exactly how they should work because no one had worked with them or with non-variable equivalents in the same way they had with weight, width, etc.
On the fringes of the TYPO Labs event in Berlin, a group of us talked about re-fashioning the axis registration repo as a sandbox, i.e. a place to collect and develop ideas and proof-of-concept fonts for new axes, where the formal axis specification would be at the end of the process, rather than at the beginning. I still think that would have been a good idea, but since MS owns the repo, it is up to them to decide whether to do that work.
In the meantime, I understand Type Network and Google Fonts have created an ad hoc registry for custom variation axes, along the lines of the sandbox idea. So maybe what we should look at is a path from that sandbox into the OT specification stream?
[That said, I am not sure it makes much sense to formally register more axes in the OT spec registry until the model for axis interaction—the avar2/xvar concepts—is agreed on and spec’d, because that may determine how some aspects of future low level parametric and user-facing optical axes are defined.]

Addressed in OpenType 1.9. Closing.


Introduce --dirty for Git projects

This introduces a --dirty option to only run pint against changed files.
Motivation
Yes, this could be done with other tools. However, that requires intimate knowledge of Git and system commands, as well as some kind of automated runner (e.g. pre-commit hook).
Since pint is a CI tool, having this built-in provides an out-of-the-box solution to this common developer use case. While not the primary motivation, it also improves performance by running against a subset of files.
Caveats

This has an underlying requirement of the project being within a Git repository. If used outside of a Git repository, an error is output.
When --dirty is used, the path argument is ignored. I consider these two use cases mutually exclusive. However, a possible use case may exist where dirty files could be filtered to other those within path when used together.
changed means any tracked file with a status of added, modified, copied, or renamed since the last commit. Basically it ignores deleted and untracked files. The latter may be a technicality. If so, the underlying git command could be altered to include untracked files.

Merging this to feat/pint so I can apply a few changes locally. Thank you for your work on this.

Awesome. Feel free to ping me after the changes. It'll help me make better contributions in the future.


Self-contained screening of train and batch-transform permissions

Issue #, if available: N/A
Description of changes: Self-contained notebook to validate that notebook's role has the necessary permissions to run processing, train, create model, and batch transform.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Love this idea @verdimrc.
Two questions:

What are your thougths on including the smallmatter package? I wonder if it is something that some folks might not have access to and how much we could make this fully self-contained.
Do you think we could put all of this great content in its own subfolder (in notebooks) e.g., notebooks/sagemaker-screen

Love this idea @verdimrc.
Two questions:

What are your thougths on including the smallmatter package? I wonder if it is something that some folks might not have access to and how much we could make this fully self-contained.
Do you think we could put all of this great content in its own subfolder (in notebooks) e.g., notebooks/sagemaker-screen

What are your thougths on including the smallmatter package? I'm just wondering if it is something that some folks might not have access to and how much we could make this fully self-contained.

That's a valid concern.
How about we document it clearly about the dependencies, and remind users with restricted access to bring in this smallmatter repo with the exact same way they did to mlmax repo? As for the rest users, they can still follow the same steps, or just install directly from github.
Other alternatives I can think off:

git submodule => to signal to users with restricted access that they need to bring in an additional repo, but bear in mind we'll be asking users to use different mechanics: one to bring in mlmax (however they want to do it), and then git submodule steps for the dependencies.

snapshot just the relevan portion of smallmatter (for now only two functions are used). In the long term, there may be risk of code divergence with the upstream.

Do you think we could put all of this great content in its own subfolder (in notebooks) e.g., notebooks/screening

+1 on this.

What are your thougths on including the smallmatter package? I'm just wondering if it is something that some folks might not have access to and how much we could make this fully self-contained.

That's a valid concern.
How about we document it clearly about the dependencies, and remind users with restricted access to bring in this smallmatter repo with the exact same way they did to mlmax repo? As for the rest users, they can still follow the same steps, or just install directly from github.
Other alternatives I can think off:

git submodule => to signal to users with restricted access that they need to bring in an additional repo, but bear in mind we'll be asking users to use different mechanics: one to bring in mlmax (however they want to do it), and then git submodule steps for the dependencies.

snapshot just the relevan portion of smallmatter (for now only two functions are used). In the long term, there may be risk of code divergence with the upstream.

Do you think we could put all of this great content in its own subfolder (in notebooks) e.g., notebooks/screening

+1 on this.

How about we document it clearly about the dependencies, and remind users with restricted access to bring in this smallmatter repo with the exact same way they did to mlmax repo?

Sounds good! Thanks @verdimrc.

How about we document it clearly about the dependencies, and remind users with restricted access to bring in this smallmatter repo with the exact same way they did to mlmax repo?

Sounds good! Thanks @verdimrc.

Suggest to have a readme to describe the objective of this folder to encourage people to look into it.

Suggest to have a readme to describe the objective of this folder to encourage people to look into it.

Tested to work with private VPC configuration.

Tested to work with private VPC configuration.


1Password 5: "Cannot Fill Item in Web Browser"

OS X 10.10 and 1Password 5.0.1.
Running sudolikeaboss displays the 1Password Mini window, but when I select an item it displays this error message:
Cannot Fill Item in Web Browser
Web Browser is connected but its code signature could not be verified. Filling and other features are disabled until this configuration issue is resolved.
At first I thought maybe I could disable "Verify browser code signature" in the 1Password Preferences. But it didn't make any difference.

Nothing happens when I try my keyboard shortcut in iTerm2.
Not surprisingly, when I run SUDOLIKEABOSS_WEBSOCKET_URI="ws://<IP_ADDRESS>:16263/slab" /usr/local/bin/sudoleaboss at the command-line, it doesn't return. I have installed the sudolikeaboss-workaround, and ran sudolikeaboss-setup-workaround, and restarted Chrome.
I noticed that after I run sudolikeaboss-setup-workaround, the 1Password extension is disabled in Chrome and Chrome reports: "This extension may have been corrupted." If I click on "Repair" it is re-enabled, but SUDOLIKEABOSS_WEBSOCKET_URI="ws://<IP_ADDRESS>:16263/slab" /usr/local/bin/sudoleaboss still hangs.
Note running /usr/local/bin/sudolikeaboss brings up 1Password, but then I get the "Cannot Fill Item in Web Browser" dialog.

/usr/local/bin/sudolikeaboss works great (at the command-line and as the iTerm2 coprocess) with 1Password 5 Version 5.1.BETA-34 (510034), once I disabled "Verify browser code signature" in the Advanced tab of the 1Password preferences.

@yacitus I think chrome has been making updates that may render the workaround non-functional. I would highly suggest that people now just install the beta of 1password 5.1 I've been using it to great success on my end.

1password 5.1 is out of beta and sudolikeaboss works like boss now - without workaround.
BTW, I'm not a big fan of installation instructions as a gif. Going to create a pull request for list-based installation instructions.

I tried first without the workaround and I did have the "Cannot Fill Item in Web Browser" error. Tried the workaround and still the same error. Then I saw that it was not needed anymore since I have 1P 5.1. I ran:
brew uninstall sudolikeaboss-workaround
brew uninstall sudolikeaboss

I restarted
brew install sudolikeaboss

Still got the same issue, any idea what I'm missing ?

Even though the workaround is no longer necessary, you need to still uncheck the "Verify browser code signature" checkbox in 1Password 5.1 settings:

@aspushkinus thanks, I thought the workaround was a way to keep it checked, this paragraph is not very clear in the README, will do a PR.

Works for me without workaround.
$ sudolikeaboss --version
sudolikeaboss version 0.2.0

$ sw_vers -productVersion
10.11.1

1Password 5
Version 5.4.1 (541003)

Awesome! iterm2 plugin.  Thank you !!!


⚠ PrivateHD has degraded performance

In 6781c1d, PrivateHD ($PHD) experienced degraded performance:

HTTP code: 200
Response time: 3186 ms

Resolved: PrivateHD performance has improved in bc3a663.


Update Editor component documentation with blockRenderMap prop

Hi! Travis errors are from flow, and eslint. Do I have to change the base branch where this PR is to be merged?

Hi @fatman- ,
Do you mind rebasing master back to your PR repo ? that should fix flow / linting errors


fix: update versions in the work sum

closing since @sawka is working an another branch with similar changes


[markdown-it-mermaid] Support passing options

Support passing any option, why are they hardcoded ?
ui-mono font display as serif on my Mac.

Now, you can pass options to markdownItMermaid() function(markdown-it-mermaid@^0.3.3).
Try the new version and if it still doesn't work, open a new issue.

@soaple The plugin doesn't seem to work anymore when I update to 0.3.3, reverting to 0.3.2 works.
No error shown on the browser console.
Currently investigating.

I think the refactor to return a method instead of a markdown-it instance doesn't work:
https://github.com/markslides/markslides/blob/894eef30d133aa1ef3c55628580be1747769a167/packages/markdown-it-mermaid/src/index.ts#L28C5-L28C33
If I revert all the code in 3.3.3 except the ...config spread, everything works again.
Also, ui-monospace is only supported in Safari, so the default value should probably be the supported monospace value instead.
https://caniuse.com/?search=ui-monospace

@mrleblanc101 As you mentioned, plugin is changed to function at v0.3.3.
Example code:
import markdownItMermaid from '@markslides/markdown-it-mermaid';

markdownItMermaid({
  fontFamily: 'monospace',
});

Can you show your working code using v0.3.3?
And I will change default font to monospace.
Thank you for sharing this information 😀

This works in 0.3.2, but doesn't in 0.3.3. Doesn't matter if I pass a config or not.
markdownIt({ html: true })
        .use(MarkdownItMermaid)

Did you try like below?
markdownIt({ html: true })
        .use(MarkdownItMermaid())

Oh, I see.
Since it's now a function, I should call it like so:
markdownIt({ html: true })
        .use(MarkdownItMermaid())

But I'm pretty sure this is an error. No other markdown it plugin works like so.

But as I was saying originally. You can revert all change in 0.3.3, and only accept a second config argument to the constructor and spread it like you did. Not sure I understand the why you made those other changes.
import MarkdownIt from 'markdown-it';
import Token from 'markdown-it/lib/token';
import Renderer from 'markdown-it/lib/renderer';
import mermaid from 'mermaid';

const mermaidChart = (code: string) => {
    try {
        mermaid.parse(code, { suppressErrors: true });
        return `<div class="mermaid">${code}</div>`;
    } catch ({ str, hash }: any) {
        return `<pre>${str}</pre>`;
    }
};

// TODO: Inject this value from outside
const isDarkMode = false;

- const markdownItMermaid = (md: MarkdownIt) => {
+ const markdownItMermaid = (md: MarkdownIt, config) => {
    mermaid.initialize({
        theme: isDarkMode ? 'default' : 'dark',
        darkMode: isDarkMode,
        fontFamily: 'ui-monospace',
        altFontFamily: 'monospace',
        startOnLoad: true,
+        ...config
    });

    // @ts-ignore
    md.mermaid = mermaid;

    const original =
        md.renderer.rules.fence ||
        function (tokens, idx, options, env, self) {
            return self.renderToken(tokens, idx, options);
        };

    md.renderer.rules.fence = (
        tokens: Token[],
        idx: number,
        options: MarkdownIt.Options,
        env: any,
        self: Renderer
    ) => {
        const token = tokens[idx];
        const code = token.content.trim();
        if (token.info === 'mermaid') {
            return mermaidChart(code);
        }

        return original(tokens, idx, options, env, self);
    };
};

export default markdownItMermaid;

The config should be a second argument like so:
markdownIt({ html: true })
        .use(MarkdownItMermaid, {
            theme: 'default',
        })

And not a function param

@mrleblanc101 Thank you for your suggestion.
I wasn't familiar with markdown-it plugin, so I implemented it as a function call.
Currently, it was fixed like your suggestion at v0.3.4.
Check it out, and if you still have a problem please let me know😀

Yes 🙌
And with your monospace fix, I might not even need the config param, but it's still great to have it !
I might try other themes to test how they look, couldn't find any picture in the mermaid doc so I have no idea how the 4 other themes look 👀

For your reference 😀
default

neutral

dark

forest

base


Dxvk v1.5 Wine-5.0-rc4 crash with Witcher 3, Battle net

Software information
I build Wine and DXVK from sources. It used to work :)
But with latest wine and dxvk, I got a crash for Witcher 3 and Battle net app.
System information

GPU: GeForce GTX 960
Driver: NVIDIA 440.44
Wine version: wine-5.0-rc4
DXVK version: v1.5 (tag on git)

Do you need toolchain infomations ? I use Docker image to build everything
Apitrace file(s)
No API trace
Log files
No logs
Investigations
I got a crash with Witcher 3 (same with battle net app) :
wine: configuration in L"/mnt/ssd/wine/prefix" has been updated.
info:  Game: witcher3.exe
info:  DXVK: v1.5
info:  Built-in extension providers:
info:    Win32 WSI
info:    OpenVR
warn:  OpenVR: Failed to locate module
info:  Enabled instance extensions:
info:    VK_KHR_get_physical_device_properties2
info:    VK_KHR_surface
info:    VK_KHR_win32_surface
wine: Unhandled page fault on execute access to<PHONE_NUMBER>000000 at address<PHONE_NUMBER>000000 (thread 005c), starting debugger...

After debugging as I can, I found the crash occurs here :
src/dxvk/dxvk_instance.cpp
m_vki = new vk::InstanceFn(true, this->createInstance());

At the end of InstanceLoader() constructor ?!?! My logs where displayed in InstanceLoader() ctr,  but nothing in InstanceFn() ?!
Whatever, I rolled back to v1.4.6 and it's working.
So I test different versions, I found the issue appears here :
07c2de62be51928f87aa0612fbe05f6946991625 : no crash here
dc13f4831829d6b444306dbc38fa892d3f4e7d45 : crash here !

After testing, I notice VK_EXT_full_screen_exclusive is causing the crash. What I expect regarding the strange behavior of IntanceLoader/InstanceFn crash. (class size mismatch ? InstanceLoader::m_instance becomes invalid ?!)
If I disabled VK_EXT_full_screen_exclusive, application starts normaly.
In wine sources, I didn't find bindings for vkGetPhysicalDeviceSurfacePresentModes2EXT ? Is it related ?
vkGetPhysicalDeviceSurfacePresentModes2EXT() is a part of Vulkan 1.1.130 (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkGetPhysicalDeviceSurfacePresentModes2EXT.html)
But in Dxvk's wiki page, NVIDIA driver shall be 430.14 or newer. But drivers 440.44 are shipped with Vulkan 1.1.119 (or I miss something on my setup)
Then I don't know how to fix it, does Dxvk shall check if vkGetPhysicalDeviceSurfacePresentModes2EXT() is available ? Or does Wine shall implement support of this function.
Hope it will help.

VK_EXT_full_screen_exclusive is optional (it's meant for Windows anyway), and DXVK does not call vkGetPhysicalDeviceSurfacePresentModes2EXT if the extension is not supported. Did you change anything?

I don't change anything in the code. I used versions describe in previous post (tag v1.5 and wine 5.0-rc4)
"disabled VK_EXT_full_screen_exclusive" means :
include/vulkan/vulkan_win32.h
// #define VK_EXT_full_screen_exclusive 1

And :
src/vulkan/vulkan_presenter.cpp
    VkResult status;

//     if (m_device.features.fullScreenExclusive) {
//       status = m_vki->vkGetPhysicalDeviceSurfacePresentModes2EXT(
//         m_device.adapter, &surfaceInfo, &numModes, nullptr);
//     } else {
      status = m_vki->vkGetPhysicalDeviceSurfacePresentModesKHR(
        m_device.adapter, m_surface, &numModes, nullptr);
//     }

    if (status != VK_SUCCESS)
      return status;

    modes.resize(numModes);

//     if (m_device.features.fullScreenExclusive) {
//       status = m_vki->vkGetPhysicalDeviceSurfacePresentModes2EXT(
//         m_device.adapter, &surfaceInfo, &numModes, modes.data());
//     } else {
      status = m_vki->vkGetPhysicalDeviceSurfacePresentModesKHR(
        m_device.adapter, m_surface, &numModes, modes.data());
//     }

In that way, it's working. Probably, an issue with detection of vkGetPhysicalDeviceSurfacePresentModes2EXT availability ? (my setup maybe)
I can do the following tests :

test on clean prefix v1.5
test on clean prefix latest head with b376417

Well it sounds more like you're crashing in vkGetInstanceProcAddr already.
Do you have the Windows Vulkan loader installed inside your prefix or something?

I have tested with latest version b376417 (not working)
I have tested same version with a clean prefix, and only override :
"d3d10"="native"
"d3d10_1"="native"
"d3d10core"="native"
"d3d11"="native"
"d3d9"="native"
"dxgi"="native"

And Witcher is starting correctly. Sorry for false positive. I'll try to figure which dll override is causing the mess.

I removed the following DLL override in user.reg and this solve the issue :
msvcp100
msvcp110
msvcp120
msvcp140
msvcp80
msvcr100
msvcr100_clr0400
msvcr110
msvcr120
msvcr140
msvcr80
msvcr90
ucrtbase

Games seems to work perfectly. (Witcher, PoE, SC2, HeartStone ...)
I'm closing the issue.