How to assign access token to a group or specific permissions?

I've looked through the issues and documentation and a bit confused.
When I created an access token through the rest api in the past, I had to assign it to a group to ensure the permissions were associated with the access token.
Right now, I have created the api token using the documented example:
resource "artifactory_api_key" "ci" {}

However, when trying to assign this token into a group, I'm not clear how to do this from the provider documentation.
When doing via POST request, you can see I had to designate member-of-groups for the access token to be generated.

    $invokeRestMethodSplat = @{
        Method  = 'POST'
        Body    =
        @{
            "username"     = $UserName #this is access token name, anything can be used
            "scope"        = "member-of-groups:$GroupName"
            'Content-Type' = 'application/x-www-form-urlencoded'
            'expires_in'   = 0                                  # Used to set as non-expiring
            'refreshable'  = $true # allow access tokens to be refreshed and leave user the same
        }
        Headers = @{ Authorization = "Basic $encodedCredentials" }
        Uri     = "https://$ACCOUNTNAME.jfrog.io/$ACCOUNTNAME/api/security/token"
    }
    $response = Invoke-RestMethod @invokeRestMethodSplat

What I'd thought I'd see would be something like
resource "artifactory_api_key" "ci" {
      groups = [ resource.group.id ]
}

If you have any examples on how to do this, or an issue I missed that answered this please let me know. I plan on looking at the provider code more, but figured I'd make this visible so if it's an easy fix others might benefit, or if I contribute a PR with something I can link it to this anyway.
Appreciate the great work on this project as it solves a big need in making Jfrog more manageable.

I think I've found the answer. This hasn't been implemented.
I found that the go-artifactory library does support this, but it hasn't been implemented into the provider.
https://github.com/atlassian/go-artifactory/blob/6111b34bd09a5f74a3fb36a2a882687693c984a8/artifactory/v1/security.go#L904-L919
// Creates an access token
// Since: 5.0.0
// Security: Requires a valid user
func (s *SecurityService) CreateToken(ctx context.Context, opts *AccessTokenOptions) (*AccessToken, *http.Response, error) {
	path := "/api/security/token"
	req, err := s.client.NewURLEncodedRequest("POST", path, opts)
	if err != nil {
		return nil, nil, err
	}
	req.Header.Set("Accept", client.MediaTypeJson)

	token := new(AccessToken)
	resp, err := s.client.Do(ctx, req, token)
	return token, resp, err
}

This shows the creation for an access token is there, and it's the exact same api endpoint from my powershell invoke-webrequest.
Looks like this needs to be added to provider for me to leverage.
I'll take a look at what that might entail and if I make some progress I'll post an update.
Haven't done a provider contribution yet so I need to familiarize myself with it.


Update Links

Updated broken links to legacy MSDN sites with correct link to MS Docs pages.  Updated remaining MSDN links where redirection currently works to the correct MS Docs pages.

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

I concur with the suggested changes. Even if the pages are only available in English (en-us) at this time, it is usually a good idea to use language agnostic links, just in case some of them are (or will become) available in other languages (except in the event that any of the links become broken again if the /en-us/ part is removed).

@ItzLevvie Please use the Commit suggestion button for each of your suggestions. I can't merge anything until your suggestions are part of the actual PR. This must be done in the next 30 days or it will become necessary to close this PR.

@mikeamoss : We hope all is well with you and that you may be available for updating this PR of yours.
Otherwise, we will have to close this PR and have someone else open a new PR to get it merged.

@illfated  Closing this item. Please open a new PR so we can go ahead and accept these changes.


Adds JOSS to list of journals

[x] I followed the CONTRIBUTING guidelines.

Below, describe what this Pull Request adds:
I added JOSS (Journal of Open Source Software) to the list of journals where people can publish software.

Thanks @kyleniemeyer !


nixos-rebuild: Treat any build/target host as non-local

Closes #148918.
Motivation for this change
nixos-rebuild should treat any build/target host as an SSH target
Things done

Built on platform(s)

[x] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

[ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
[ ] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[ ] Tested basic functionality of all binary files (usually in ./result/bin/)
22.05 Release Notes (or backporting 21.11 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module
[ ] (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes

[x] Fits CONTRIBUTING.md.

Ping @jonringer

Ping @znewman01 @veprbl, do any of you have the right to merge this?

Ping @znewman01 @veprbl, do any of you have the right to merge this?

This appears to have broken passing -L flag:
$ nixos-rebuild -L --target-host<EMAIL_ADDRESS>--build-host localhost --flake /home/jtojnar/Projects/nixfiles#azazel switch
building the system configuration...
error: unknown flag '-L'
Try 'nix-store --help' for more information.

Or rather, it is no longer possible to keep the buildHost local and different from targetHost since this condition will identify them:
https://github.com/l0b0/nixpkgs/blob/2f74bf9ce86149f3094c86ee93d695864bad1b90/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh#L151-L152

I wonder if it would help to move if [[ -z "$buildHost" ]]; then buildHost="$targetHost" fi to the --target-host|t) case.

That would allow us to pass it --target-host=foo --build-host= to achieve a local build but it would behave inconsistently with --build-host= --target-host=foo.
Maybe we should introduce a separate --local-build flag that would disable the buildHost="$targetHost" step?

@l0b0 Do you have a way to address the regression? If not, let's temporarily revert.

What if we simply remove this block:
https://github.com/NixOS/nixpkgs/blob/fdee2bc6c8bd0ef05c60aa9bf54d978827b12843/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh#L151-L153
All it did before this PR, was to transform --target-host target --build-host "" to --target-host target --build-host target (buildHost was not empty by default, but contained localhost).
This does not seem very useful and is also undocumented.
If the block is removed, an empty buildHost, either by leaving out --build-host or setting it to "", would result in a local build.
In this case, the --target-host documentation should probably be updated to mention the "" case:

If --build-host is not explicitly specified, building will take place locally.

Adding to the confusion, I'd like to report another problem with this commit. Perhaps I'm doing it wrong, in that case please let me know!
Anyway, reverting this specific commit fixes both issues below for me.
I'm using nixos-rebuild switch --target-host <host> --use-remote-sudo --use-substitutes --flake .#<host> to update one of my VMs.
This commit caused the output of sudo hidden. I can get past that by monitoring the process list and typing the password when ps shows that sudo is waiting for it.
But then, after the 2nd sudo prompt (which does get displayed!), I get the following errors, and the remote system fails to switch accordingly:
error: selector 'password' matches no derivations, maybe you meant:
       password-store
bash: line 2: these: command not found
: No such file or directoryfqli5g4y2s6av7v3x3sb91lqs3vxih-nixos-help.drv
: No such file or directory88mxnzbbim23ddm5wb3sx57r8v2a64-nixos-help.drv
: No such file or directoryf03qklngdx9smqnfh3k81r8yrlm62l-builder.pl.drv
: No such file or directory33ifym20yzlgp4p4glgdf1kim3p01q-nixos-enter.drv
: No such file or directorygsaal7n6ij8hf8p6d43b02i3i140fd-nixos-rebuild.drv
<snip a lot of these type of lines>
bash: -c: line 101: syntax error near unexpected token `('
'ash: -c: line 101: `these 138 paths will be fetched (230.42 MiB download, 797.24 MiB unpacked):
Shared connection to xxx.xxx.xxx.xxx closed.
$


Ship upgrade active after mod update

Hi there!
I just updated the mod (to 2.0.6) and in game I realized that the body cam didn´t work any more.
I searched for the issue and after a while I noticed, that in the setting the ship upgrade was suddenly active (only activates the body cam on the monitor if you buy it in the store).
I don´t know if this was on purpose but I wanted to let you know about this.
I am not sure any more if I deactivated it when I first installed the mod and if it´s active by default - but I had it deactivated for sure before the update.

Yeah, that was actually my bad for not initially setting the config option to the intended default of enabled. It was corrected in a config migration step, so now that you're on a version past that point, it should not change again.
Sorry for the inconvenience!


List component

So I renamed ListBox back into ListView.
After merge it I will go to remove BaseComponent and add documentation comments for every single component.

Please run melos format again.

That's it.


FastNoiseLite domain_warp_fractal_type defaults to the wrong value

Godot version
v4.0.alpha8.official [cc3ed63af]
System information
Ubuntu, Nvidia
Issue description
the options for domain_warp_fractal_type are as follows:

DOMAIN_WARP_FRACTAL_NONE = 0
DOMAIN_WARP_FRACTAL_PROGRESSIVE = 1
DOMAIN_WARP_FRACTAL_INDEPENDENT = 2

where the default (according to the inspector) is DOMAIN_WARP_FRACTAL_PROGRESSIVE.
no setting is serialized when saving with DOMAIN_WARP_FRACTAL_PROGRESSIVE.
however when loading the scene, the texture is then generated with DOMAIN_WARP_FRACTAL_NONE.
Steps to reproduce

create a new Node2D scene
add a Sprite2D node, plug in a NoiseTexture and a FastNoiseLite
enable Domain Warp
notice that Fractal Type defaults to Progressive in the inspector. effectively however, None is used. confirm this by switching to None and back to Progressive.
save the scene with Progressive. reopen the scene, notice it's still set to Progressive but None is used.

Minimal reproduction project
No response

cc @Geometror


[P2] Main view. NT add titles for scrollableView and collection.

NT differentiate collection and scrollable view and add titles to them

Removed sections added titles, changed view for general emotions - now they contain icon with text below the icon


Launch.json/tasks.json only work if in first folder in multi-folder workspace

VSCode Version: 1.16.0-insider
OS Version: Windows 10

Steps to Reproduce:

Add a task or launch type.
It adds it only to the first project (folder) even though you might want it in other projects.
Tasks/debug only work when launch.json/tasks.json are in the first folder.

Reproduces without extensions: Yes

To add a launch config to a specific folder use the corresponding "Add Config" menu in the launch config drop down menu:

In addition the launch config drop down menu shows all launch configs from all folders of a multifolder workspace.

Tasks have not been adopted to multi folder so far. This will happen in one of the next milestones.

This got fixed for 1.17.


adding nats cluster

@tomusheq Is this configured with persistence & replication?

Any special requirements when using NATS? Why do we need an ELB here and not for other queues?

To get persistence (at least once delivery) would need to use either NATS Streaming (https://github.com/nats-io/nats-streaming-server) or JetStream (https://github.com/nats-io/jetstream).

@wallyqs Thanks for the pointers! I'm not (yet :) ) that proficient in the nats ecosystem, which one would you recommend to test when looking for a replicated, persistent, with at-least-once delivery message queue?

No problem :) For persistence and replication maybe the HA setup from this example could be an option, though it uses Raft for replication so would not be the best performance: https://docs.nats.io/nats-on-kubernetes/minimal-setup#ha-setup-using-statefulsets There is another deployment type called Fault Tolerance that uses a shared filesystem that could result in better perf in comparison but more involved to deploy.

@wallyqs Thanks again :) We are looking at deployments where the nodes are possibly independent, so we'll go with the raft option

@tomusheq Is this configured with persistence & replication?

Yes I saw that NATS streaming is required, working on it.
Current config is without replication & persistence.

needs a merge/rebase :)

Latest seems to be 0.19.0? See https://github.com/nats-io/nats-streaming-server
Also maybe we could extract the version number to a configuration variable?
@tomusheq

needs a merge/rebase :)

Done.

Latest seems to be 0.19.0? See https://github.com/nats-io/nats-streaming-server
Also maybe we could extract the version number to a configuration variable?

I have added variable nats_version. Currently it is set to newest release available (v0.19.0).


fix-404

in #2374 ：
- ./public/docs/setup/kubernetes/helm-install/index.html
  *  External link https://docs.helm.sh/using_helm/#installing-helm failed: https://docs.helm.sh/using_helm/ exists, but the hash 'installing-helm' does not
- ./public/docs/setup/kubernetes/quick-start-gke-dm/index.html
  *  External link https://cloud.google.com/kubernetes-engine/versioning-and-upgrades#versions_available_for_new_cluster_masters failed: https://cloud.google.com/kubernetes-engine/versioning-and-upgrades exists, but the hash 'versions_available_for_new_cluster_masters' does not

The hash "#installing-helm"  had been removed from "https://docs.helm.sh/using_helm",
and the other one had been updated.

[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by:
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: rcaballeromx
If they are not already assigned, you can assign the PR to them by writing /assign @rcaballeromx in a comment when ready.
The full list of commands accepted by this bot can be found here.
The pull request process is described here

Needs approval from an approver in each of these files:

content/OWNERS

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by:
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approvers: fleeto, frankbu
If they are not already assigned, you can assign the PR to them by writing /assign @fleeto @frankbu in a comment when ready.
The full list of commands accepted by this bot can be found here.
The pull request process is described here

Needs approval from an approver in each of these files:

content/OWNERS
content_zh/OWNERS

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

/lgtm

[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: rootsongjc
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: frankbu
If they are not already assigned, you can assign the PR to them by writing /assign @frankbu in a comment when ready.
The full list of commands accepted by this bot can be found here.
The pull request process is described here

Needs approval from an approver in each of these files:

content/OWNERS
content_zh/OWNERS [rootsongjc]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment


macOS not working without setuptools_rust

🌍 Environment

Your operating system and version: macOS 10.13.4
Your python version: 3.6.5
How did you install python (e.g. apt or pyenv)? Did you use a virtualenv?: venv and sys installation
Your rust version: rustc 1.28.0-nightly

💥 Reproducing
As referenced in this issue I cannot get pyo3 working for the example in the README without resorting to setuptools_rust.
The docs say

For MacOS, "-C link-arg=-undefined -C link-arg=dynamic_lookup" is required to build the library

I could not get this to work and @fafhrd91 hinted that looking at the setuptools_rust output might be useful. Here is the error I get when I try the command I got from setuptools_rust:
cargo rustc --lib --manifest-path Cargo.toml --features pyo3/python3 pyo3/extension-module --release -- --crate-type cdylib -C link-arg=-undefined -C link-arg=dynamic_lookup
   Compiling pyo3 v0.2.5 (file:///Users/alex/learn/rust/pyo3)
   Compiling word-count v0.1.0 (file:///Users/alex/learn/rust/pyo3/examples/word-count)
error: Unrecognized option: 'release'

error: Could not compile `word-count`.

To learn more, run the command again with --verbose.

What is the best way to get this to run on a mac without needing setuptools_rust?

I don't have a mac, so I can't test this myself. There are two things that should work though: One is running cargo rustc --release -- -C link-arg=-undefined -C link-arg=dynamic_lookup, the other is creating a .cargo/config with the links args and then using cargo build --release normally:
[target.macos]
rustflags = [
  "-C", "link-arg=-undefined",
  "-C", "link-arg=dynamic_lookup",
]

@konstin thanks! Just submitted a PR that makes the README more explicit.

Tiny addition for everybody trying to get .cargo/config to work. I had to adjust the target like so:
[target.x86_64-apple-darwin]
rustflags = [
  "-C", "link-arg=-undefined",
  "-C", "link-arg=dynamic_lookup",
]

See also: https://github.com/inferiorhumanorgans/r2-c166/blob/752b61d36acd1ddbbcd0844505f94093773e4cc5/README.md


Participant IDs form create

@AidaasinAyda if this is in review can you please tell me where to find it. Is it in my email?


Issue downloading datasets from Docker

Hi,
Thanks a lot for this tool, it looks amazing. I've noticed an extremely slow history download on my RPI2 so I assumed that it was caused by the limited amount of resources available on the RPI2, so I decided to try it using Docker on my MBP (on a side note, is the history download a lot faster on a faster machine?). I added the config for Gekko-BacktestTool to gekko Dockerfile and it created the image correctly.
However when I run the following command I always get the following error, no matter what exchange or pair I use:
perl backtest.pl -i -p kraken:ETH:ALL -f last -t now
And the error:
Updating Gekko's kraken market data...
Done writing Kraken market data
Import 6 pairs: kraken:ETH:EOS, kraken:ETH:GNO, kraken:ETH:ETC, kraken:ETH:ICN, kraken:ETH:MLN, kraken:ETH:REP.
DBD::SQLite::db prepare failed: no such table: candles_ETH_EOS at backtest.pl line 522.
DBD::SQLite::db prepare failed: no such table: candles_ETH_EOS at backtest.pl line 522.

Any ideas?

I did solve the issue running the following command:
perl backtest.pl -i -p binance:ETH:ALL -f 2017-01-01 -t now
My assumption is that the command I was using was trying to update the table, but the table didn't exist. Specifying a start date achieves what I was trying to do.


fix(exposePartialUpdateObjectNoCreate): Expose the PartialUpdateObjec…

…tNoCreate to the client

Great thanks @robertmogos

Coverage increased (+0.3%) to 78.133% when pulling d32da1d9d77bc4032c3a086120e22b7a92fc2981 on fix/exposePartialUpdateObjectNoCreate into ec0c565d3df3538881a0a32a7f9ed4ca0138c3b0 on master.


Improve GHSA-5xrr-fw23-8wgc

Hi @Shepherd36, could you elaborate on why these changes should be made?


Remove unnecessary imports in cupy._sorting

Rel #3420.
This PR removes unnecessary imports from cupy._sorting submodule.

These must be fixed?
_misc/memory_ranges.py:from cupy._sorting import search
manipulation/basic.py:from cupy._sorting import search

pfnCI, test this please.

Jenkins CI test (for commit 3254e04ccddb52ce0df12a11d24a36737e371d94, target branch master) succeeded!

I suppose we should leave the lines as they are, but you mean?

Ah, ok I misunderstood that from cupy._sorting import search won't work after this fix. Locally confirmed it's still working. LGTM!


nix 2.0: no completion for custom channels

nix build nixpkgs.<TAB> works fine, but if I have a custom channel in my NIX_PATH (e.g., NIX_PATH=mychannel=/path/to/mychannel), nix build mychannel.<TAB> doesn't provide any suggestions.

I'm unable to reproduce this:
> NIX_PATH=foo=/home/hed/nixpkgs/
> nix run foo.<tab>

This gives completion for me (where /home/hed/nixpkgs is a nixpkgs checkout).
You're sure that import /path/to/mychannel evaluates to either a set or an autocallable function?

It works if the custom channel is nixpkgs, but it's not working on my custom channel.  Typing out the full nix build command and running it starts the build successfully though. The top-level is a manually defined set, so I would think that it should be able to auto-complete at least that far.

Ah, right, found the problem. When building the NIX_PATH expressions I've wrongly assumed that they're functions. Hopefully the last code with that faulty assumption.
Thanks :)

Awesome, working now! As always, thanks for your amazing responsiveness :)


[Feature, Request], autocomplete, can't, set, the, Input, props,, maxLength, and, minLength

Existing Component
Yes
Component Name
autocomplete
Description
autocomplete 不能设置maxlength 和minlength。

Any news about this issue?

need it @Leopoldthecoder

Supported in https://github.com/ElemeFE/element/pull/8859


Update to Meshes.jl v0.43

Codecov Report
Attention: Patch coverage is 18.18182% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 79.89%. Comparing base (90efe36) to head (7b4266e).

Files
Patch %
Lines

ext/GeoStatsBaseMakieExt.jl
0.00%
9 Missing :warning:

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #204      +/-   ##
==========================================
- Coverage   80.93%   79.89%   -1.05%
==========================================
  Files          21       21
  Lines         383      388       +5
==========================================
  Hits          310      310
- Misses         73       78       +5

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


Remove X from popups

After alert system went live these appeared in all popups (activities, pois, trails):

Before

Not sure how we were hiding this before. Class is leaflet-popup-close-button

Done on staging: https://github.com/smartchicago/trailsy/commit/9498ccba206df0c4184ed744d5caa31b46f0e6a5

Looks good.

Deployed


fix(slugbuilder): check for the succeded status while waiting for slugbuilder pod

Summary of Changes
Since the only reason we need to check if the pod is started or not is to stream the logs, we can add a check to see pod completed status if the pod run has completed before we started checking.
Issue(s) that this PR Closes
Closes #199
Associated End To End Test PR(s)
Associated Documentation PR(s)
Associated Design Document(s)
Testing Instructions
Please provide a detailed list for how to test the changes in this PR.

Create a Deis Cluster
deploy an app
you should be able to successfully deploy and should not be able to reproduce the scenario mentioned in #298

Pull Request Hygiene TODOs
Please make sure the below checklist is complete.

[x] Your pull request is concise and to the point (make another PR for refactoring nearby code)
[x] Your commits are squashed into logical units of work
[x] Your commits follow the commit style guidelines

@kmala #298 has issues that are directly related, and should be closed if that issue is closed:

#199
#185
#207

Also, would this also solve #57?


Fix nested all-of objects

Status
READY
Description
Fixes #1692
I'm not sure why this extra check was there, it seems like it's legacy and not valid anymore.
Todos

[x] Tests
[ ] Documentation
[ ] Changelog Entry (unreleased)

Seems like tests are failing, looking at it

That's the case test in #1635 that I addressed. It seems to affect other nested polymorphic cases 👀

All these nested polymorhpic cases are coming back 😄 Maybe we should investigate if we need to take out the excavator and rewrite some of this 🫨


0.2.5 h8f162c

Checklist

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

@conda-forge-admin, please rerun bot

Reading the label in case it helps

Ah missed this is a user PR (not a bot PR). Adding bot rerun won't work on user PRs (only bot PRs)

Superseded by #13


ivy-occur equivalent

One of my favorite features of ivy is ivy-occur. The integration with ibuffer for ivy-switch-buffer, with grep-mode for swiper, and with dired for counsel-find-file and similar commands is especially nice. I wouldn't want to try to do file management in a minibuffer with a bunch of keybindings (like helm), but it's nice to be able to populate a dired or grep buffer with results and then do whatever in it.

For the sake of other readers, the requested functionality is to take the candidates from the minibuffer and put them into a real buffer, with a keymap that allows you to select one of them. That seems like a reasonable feature because it will not require any particularly bad contortion of the abstractions. Thanks for making me aware of this feature; I had not seen it before.

+1 for this feature. Very useful for finding all of the faces a package provides.

+1 That would be the big missing piece for me as well. It's the only reason I am still using ivy instead of selectrum.

+1 This is why I still use Ivy. My use case is counsel-rg, where I do a search for a term with ripgrep, turn it into an ivy-occur buffer, and then use wgrep to make it an editable buffer and make changes across files.

@b3n out of curiosity, is rg.el a suitable replacement for counsel-rg + ivy-occur?

@raxod502 I just tried out rg.el and it does indeed meet my needs, thank you for pointing me to it! The only downside is I can't get search results in the minibuffer as I type, but I can live with that.

@raxod502 I don't think rg.el shows results as you type, counsel-rg does. rg is so fast that it is nearly instantaneous. It makes it usable for project navigation for instance.

I looked at this and I do not think it is a good idea to try to implement the whole thing like Ivy does it. That is because it breaks the completing-read abstraction badly. Ivy relies on knowing what action to take with the selected candidate, but Selectrum does not know this because it only implements completing-read.
That said, I'm not opposed to adding something more moderate to Selectrum which will allow commands like ivy-occur for specific use cases to be implemented. Here is what I am thinking. We add a new keyword argument to selectrum-read that allows you to get the list of currently displayed candidates when the user exits the minibuffer (whereas normally the return value is just the selected candidate). Then, to implement a replacement for (as an example) ivy-occur + Ibuffer, you simply make a command that uses selectrum-read to read a buffer, but with the new keyword argument -- and then feed the resulting list to Ibuffer. What do you all think? Would that be workable? I'm open to other ideas.
I think it might be desirable to make this feature controlled by a dynamically bound variable rather than a keyword argument, since that would allow you to use selectrum-read-buffer, selectrum-read-file-name, etc. in these ivy-occur replacements without modification or hacks.
The code is at https://github.com/raxod502/selectrum/pull/56.

The following might be funny given that I also added suggestions a while back to implement features which deter from the default API but I'm no more in favour of adding such features now. This will lead to a state where selectrum more and more can't just be used a a replacement for completing-read, people will implement all kinds of things which use such extra features and all of the sudden you have new selectrum-this, selectrum-that packages. Not that there would be something wrong with that but I would wish we would have more packages which just use the default API and don't require a specific completion framework. For some things which need features not compatible with the default API it might make sense to use such a framework but for those we already have helm or counsel.

I looked at this and I do not think it is a good idea to try to implement the whole thing like Ivy does it. That is because it breaks the completing-read abstraction badly. Ivy relies on knowing what action to take with the selected candidate, but Selectrum does not know this because it only implements completing-read.
That said, I'm not opposed to adding something more moderate to Selectrum which will allow commands like ivy-occur for specific use cases to be implemented. Here is what I am thinking. We add a new keyword argument to selectrum-read that allows you to get the list of currently displayed candidates when the user exits the minibuffer (whereas normally the return value is just the selected candidate). Then, to implement a replacement for (as an example) ivy-occur + Ibuffer, you simply make a command that uses selectrum-read to read a buffer, but with the new keyword argument -- and then feed the resulting list to Ibuffer. What do you all think? Would that be workable? I'm open to other ideas.
I think it might be desirable to make this feature controlled by a dynamically bound variable rather than a keyword argument, since that would allow you to use selectrum-read-buffer, selectrum-read-file-name, etc. in these ivy-occur replacements without modification or hacks.
The code is at #56.

That sounds like a decent solution, I am liking the direction of keeping selectrum lightweight as well and from what I understood a "selectrum-occur" can happen separately with this.

Here's an idea: I think a main advantage of ivy-occur is we can call the command first without thinking, and then choose to select a candidate or call ivy-occur based on the situation. As far as I can tell, #56 doesn't give us the mechanism to do this, so I would say it's not much useful. To me, pop up the Selectrum UI to only get a list of candidates from it seems weird.
If we seriously want a mechanism to implement similar feature, I think a new action must be added. When calling it, the list of candidates is returned like in #56. The command build on top of selectrum-read could do different things based on whether it receives a list or not from selectrum-read. If we do this, we need an argument in selectrum-read to explicitely enable this "occur" action, so it's blocked by default (and in selectrum-completing-read).

@AmaiKinono If, as you suggest, selectrum-read grows an argument to enable the "occur" action, then how is that different from the :return-candidates argument? In either case, the caller must explicitly declare that they want a list rather than just the selected candidate.
I agree that it is nice to be able to start the session first and then later decide whether to use the occur-like feature, but I am not sure it's possible to implement this without violating the design philosophy of completing-read rather badly.

how is that different from the :return-candidates argument? In either case, the caller must explicitly declare that they want a list rather than just the selected candidate.

With the :return-candidates argument, the caller declares it want a list. But with an enable-occur-action argument, the caller declares it can deal with a string (given by the selectrum-select-current-candidate or selectrum-submit-exact-input action), or a list (given by the suggested "occur" action).

With multiple selection (https://github.com/raxod502/selectrum/commit/5f59af278b3b7010c56e222c2196b24b1a56675d), there is a more elegant way: the caller invokes completing-read-multiple, and then we can have a keybinding ("the ivy-occur keybinding") which selects all the candidates before exiting the minibuffer. Then the caller decides what to do based on whether more than one candidate was returned in the list. What do you think of that? The only disadvantage I see is that you can't do an ivy-occur action on only one candidate -- but I have a hard time seeing many use cases for that.

the caller invokes completing-read-multiple, and then we can have a keybinding

I think that sounds great! Instead of a key binding we could also accept "*" as the input for meaning all candidates.

Oh I just noticed I missed the case of returning all matched candidates of current query. No idea how to implement this in a way so it works with regular completing-read-multiple when not using selectrum.

Yeah, I think the thing people are mostly excited about is doing an occur operation on the list of currently matched candidates.

Yep, I missed that. Without such a concept in the default API this seems to be hard to achieve in a compliant way. I still like the idea of a special marker added to the input because that way commands using this feature would at least in theory also work without selectrum-mode.
One way we could achieve that would be by using a wrapper which always rebinds commands in crm-local-completion-map and crm-local-must-match-map before calling completing-read-multiple. This rebound commands could then add all currently matching candidates to the input and submit them. When the commands using completing-read-multiple are written using this wrapper they would also work without selectrum.

Actually why not avoid such an API altogether and just provided selectrum commands like:
(push (cons [remap dired] 'selectrum-dired)
      selectrum-minibuffer-bindings)

(defun selectrum-dired ()
  (interactive)
  (run-at-time
   0 nil
   (lambda ()
     (dired (cons "*selectrum-dired*"
                  (mapcar #'selectrum--get-full selectrum--candidates)))))
  (abort-recursive-edit))

Huh. I guess using an idle timer together with abort-recursive-edit does in fact allow you to implement alternate actions without breaking the completing-read API. Very clever, I had not thought of that.
If it were done this way, I don't think I would mind alternate action support being added to Selectrum, although I think I would prefer to see alternate actions that are global across all commands (and available under special keybindings) rather than ones that are defined by the caller to selectrum-read. That way we don't fall into the trap of needing to write a wrapper for every possible Emacs function that uses completing-read.
The same approach allows not only alternate actions, but also occur-like actions, as you observed. I think this is great!

If it were done this way, I don't think I would mind alternate action support being added to Selectrum, although I think I would prefer to see alternate actions that are global across all commands (and available under special keybindings)

That would be great! Maybe we could use a prefix key which would show a menu for available categories: file-actions, buffer-actions and so on. After selecting one of them with a key another one shows up with the actual actions.

For some candidates like files or buffers we could actually auto detect them

As long as the auto-detection is customizable -- it needs to be clear that such functionality will necessarily make some decisions arbitrarily which may not always be correct, and therefore can be tweaked if needed by the user.

We can also use detect the type of some collections by querying the metadata category. We could store the metadata when the collection gets normalized before it gets passed to selectrum-read.

You can ivy-occur like functionality using embark the corresponding command is called embark-export. In addition to that you get minibuffer actions on candidates (like ivy-actions). See the [wiki](https://github.com/raxod502/selectrum/wiki/Additional-Configuration#minibuffer-actions-with-embark for setup instructions.

Can be closed? Embark is pretty solid now :)

Can be closed? Embark is pretty solid now :)

This thread is being closed automatically by Tidier because it is labeled with "waiting on response" and has not seen any activity for 90 days. But don't worry—if you have any information that might advance the discussion, leave a comment and I will be happy to reopen the thread :)


Broken link in README.md

The link to
https://github.com/pybamm-team/pybamm-supporting-material/blob/master/pybamm.pdf
in the line
"A set of slides giving an overview of PyBaMM can be found here".
of README.md is broken.

Thanks, fixed in #1004


Multiresolution Gatys

For the Gatys method, higher quality results can be attained by following a multiresolution strategy, where a small image is generated, then used as initialization for a higher resolution version. This procedure is repeated several times until a very large image is obtained.
Code: https://gist.github.com/jcjohnson/ca1f29057a187bc7721a3a8c418cc7db
Examples of images where this was used:

https://www.reddit.com/r/deepdream/comments/7a90yk/bioluminescent_mushroom_forest/
https://www.reddit.com/r/deepdream/comments/5mfp0b/elephant_mounted_machine_gun/

This strategy is compatible with the tiling method: each tile would be rendered using multiresolution.

Implemented!


Tag push from another workflow does not trigger release workflow

Thanks for looking into my previous issue 🙏
Now, the issue is that I cannot get my workflow to be triggered.
I am not sure if it's a limitation on Github but my scenario is as follows:

Tag.yml runs a workflow, and pushes a new tag via git tag v${version} && git push --tags
Release.yml has the functionality to pick this up and create a release.

But despite a few tries, the Release workflow never runs 😔
My code is available here.
https://github.com/cloud-on-prem/iam-capable/tree/main/.github/workflows

An event created by the action using the default GITHUB_TOKEN cannot trigger other workflows.
See this for details and workarounds.


Feat/cognitarium instantiate

This PR brings the handling of the cognitarium instantiate message.
It is pretty straightforward, it manage the STORE state containing at this step the store's owner and limits, and will probably be used to store other information related to the store usage.
API Changes
Regarding limits, this PR brings the handling of default values. The Store query response contains now limits without being Option typed.

size-limit report 📦

Path
Size

target/wasm32-unknown-unknown/release/okp4_objectarium.wasm
338.24 KB (0%)

target/wasm32-unknown-unknown/release/okp4_law_stone.wasm
640.91 KB (0%)

0 B (+100% 🔺)

:tada: This PR is included in version 2.0.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


Failure to communicate with the Pos printer used via USB

Failure to communicate with the Pos printer used via USB. May be related to this issue #76 .
I could not communicate with the printer using this method. Printer also tested with another test application. It worked.

// USB, Bluetooth, or Serial
var printer = new SerialPrinter(portName: "COM5", baudRate: 115200);

Hey @ahoirg this library works with USB printers fine, but you must use a virtual COM port emulator since it doesn't speak USB directly.  More info [in the readme](https://github.com/lukevp/ESC-POS-.NET#usb-usage-guide. Which test application did you use?


Dynamic shape error in vmap with jacrev of jacrev

I'd like to compute the following expression in a vectorized way: first take the derivative wrt. to the data, and then take the derivative of this expression wrt. the parameters. I tried implementing it like this
func, params, buffer = make_functional_with_buffers(network)
vmap(jacrev(jacrev(func, 2), 0), (None, None, 0))(params, buffers, data)

but this isn't working since I get this error message:

RuntimeError: vmap: We do not support batching operators that can support dynamic shape. Attempting to batch over indexing with a boolean mask.

I'm a bit surprised since I expected a second application of jacrev shouldn't change how vmap interacts with the function, but I guess that was incorrect.
Edit:
I also tried replacing this expression above using the hessian operation (and just ignoring the small computational overhead of computing the double derivatives I'm not interested in)
vmap(hessian(func, (0, 2)), (None, None, 0))(params, buffers, data)

but that code resulted in the same error.
Can you please point me to information about how to solve this problem?

@zimmerrol thanks for reporting. Can you provide network definition to repro the issue ? Thanks

Sure, the network is a simple MLP with leaky relu activations. Here is a minimal version of its definition:
def leaky_relu(x, negative_slope=0.2, inplace=False):
    if inplace:
        out = x
    else:
        out = x.clone()
    out[out <= 0] = out[out <= 0] * negative_slope
    return out

class MLP(nn.Module):
    def __init__(self, input_dim, output_dim, hidden_dim, n_layers):
        super().__init__()
        self.input_dim = input_dim
        self.output_dim = output_dim
        self.n_layers = n_layers
        self.hidden_dim = [hidden_dim] * (self.n_layers - 1)

        if self.n_layers == 1:
            _fc_list = [nn.Linear(self.input_dim, self.output_dim)]
        else:
            _fc_list = [nn.Linear(self.input_dim, self.hidden_dim[0])]
            for i in range(1, self.n_layers - 1):
                _fc_list.append(nn.Linear(self.hidden_dim[i - 1], self.hidden_dim[i]))
            _fc_list.append(nn.Linear(self.hidden_dim[self.n_layers - 2], self.output_dim))
        self.fc = nn.ModuleList(_fc_list)

    def forward(self, x):
        h = x
        for c in range(self.n_layers):
            if c == self.n_layers - 1:
                h = self.fc[c](h)
            else:
                h = leaky_relu(x(self.fc[c](h)))
        return h

@zimmerrol the error message is related to your leaky_relu implementation. A workaround could be just to use nn.functional.leaky_relu:
- h = leaky_relu(self.fc[c](h))
+ h = nn.functional.leaky_relu(self.fc[c](h))

Ah, interesting, thanks! I switched from nn.function.leaky_relu to my own implementaton since the built-in one doesn't support forward-mode AD, which is required by hessian. How did you find out that this function caused the error?

How did you find out that this function caused the error?

Well, the error message is indicating that:
  File "/tmp/fth/repro_823_vmap_dynamic_shape.py", line 40, in forward
    h = leaky_relu(self.fc[c](h))
  File "/tmp/fth/repro_823_vmap_dynamic_shape.py", line 11, in leaky_relu
    out[out <= 0] = out[out <= 0] * negative_slope
RuntimeError: vmap: We do not support batching operators that can support dynamic shape. Attempting to batch over indexing with a boolean mask.


Discuss parameterized vs. prepared statements

The term "prepared statements" and "parameterized statements"
are treated as synonyms in many APIs. However, that is not
always true - there are APIs where they are different.
In those cases prepared statements generally include
parameterized statement capabilities, but not the other way around.
Switching to this terminology also makes it easier to (briefly)
discuss what to do with stored procedures.
I made a lot of changes in the SQL injection section, including a
number of additions, but SQL injection vulnerabilities are so
important that I think this is worth doing. I tried to give
specifics without being overwhelming. I added a few other
language-specific examples, again because SQL injection is such
a common problem that I want to increase the likelihood of
people seeing how to use them in a language they know.
Signed-off-by: David A. Wheeler<EMAIL_ADDRESS>

That's a good one to raise, in terms of differences between the two terms.
I'd also add that there are some differences between ecosystems and even libraries, with how they implement parameterized statements. For example, the JavaScript library mysql (on npmjs) implements client-side parameterized statements. So doing something like this:
connection.query('SELECT * FROM users WHERE id = ?', [userId], function (error, results, fields) {
  if (error) throw error;
  // ...
});

is actually just syntactic sugar for prepared statements, but it really isn't. Those string replacements are done in the code-level (hence, referenced as "client-side") rather than being sent to the MySQL engine to be properly escaped there.
The mysql2 JavaScript library, does however support and implements the database-level prepared statements and is the safer method of using it.

@lirantal - I intentionally avoided the client-side vs. server-side implementation of parameterized statements. I'm not sure everyone agrees that server-side is necessarily the "proper" way, especially since the client has to do something before the server can know what to process. Can you point me to material that makes a strong case that client-side is the wrong way?

I'll check about an official resource with reasoning statement here but unofficially here, the point of view I have on this is that relying on client-side query parameterization (and by client-side, I mean a library, such as a mysql driver used on the application-level), could potentially suffer from:

logic bugs that would introduce security bugs and incorrect escaping
as is the case with a denylist, if new or different ways of escaping input come about, then said library need to be kept up to date.

The "must be kept up to date" definitely makes sense (though that's generally true).
Even if the server does some kind of escaping, the client will have to do something so that server-side escapes are done correctly.
That said:  I can see that it might be much less prone to defects. I'm definitely willing to entertain this as a change, I can see the argument, I just want to have high confidence that it's correct  :-).

Here's some information I found on client/caller-side vs. server/database-side parameterized statements:

HN discussion on "Finding an Authorization Bypass on my Own Website" https://news.ycombinator.com/item?id=30571990
"Finding an Authorization Bypass on my Own Website" https://maxwelldulin.com/BlogPost?post=9185867776
"Finding an unseen SQL Injection by bypassing escape functions in mysqljs/mysql" https://flattsecurity.medium.com/finding-an-unseen-sql-injection-by-bypassing-escape-functions-in-mysqljs-mysql-90b27f6542b4
mysqljs issue (unresolved): https://github.com/mysqljs/mysql/issues/274
https://stackoverflow.com/questions/15778572/preventing-sql-injection-in-node-js - some people in this discussion seem to consider client-side as "not real parameterized statements" but there's a mish-mash of terminology in that thread, so I don't know that this should be taken as usual.

It looks like part of the challenge is that to support server-side parameterized statements, in many systems you have to use a binary protocol between client and server, but in many cases that's unavailable or avoided for various reasons. It looks like many libraries do this.
Most people say client vs. server, but some databases (esp. sqlite) are implemented as embedded libraries so that terminology isn't quite correct.
I wouldn't go so far as to say that implementing parameterized statements on client/caller side are "wrong", but they have to be done correctly. It looks like the mysqljs/mysql (https://github.com/mysqljs/mysql) escaping works okay for strings (making assumptions about MySQL), but that it doesn't escape non-strings (like objects) correctly. Personally, I think that's a vulnerability in that mysql library's parameterized statement system. If nothing else, we should warn about that for input validation, e.g.:

Parameterized statement implementations may only work correctly for base types like strings and numbers (not structured types such as objects, dictionaries, or arrays). This is know to affect at least Node.js's mysqljs/mysql library. Make sure your input validation verifies the type before allowing the input further, and/or verify that all possible types are handled correctly."

Even if the server does some kind of escaping,

The client-side's database driver uses specific APIs to ensure that query parameterization is performed. Here's an example:
connection.execute("SELECT * FROM USERS WHERE username = ?",[
     req.body.username
    ],function(error, results){});

I can see the argument, I just want to have high confidence that it's correct :-).

Thanks for spending time looking these up. Setting aside "right" and "wrong", it looks like you've found the motivation across these threads on the Internet to realize, even if to an extent, that server-side (database engine, that is) query parameterization is the most secure way of doing it in order to avoid SQL injections. I'd say, while other options might be good enough, we want to explicitly recommend server-side at the database-level rather than anything else. I've been communicating this weekend with folks from the OWASP community to update the SQL Injection prevention cheatsheet to address that knowledge gap which exists there today, and they've agreed.

Server-side at least avoids potential mismatch between the client & server, so on that basis alone it's an advantage.
There is a catch, though: it's clear that many libraries do not provide this. It's not even clear that all database engines provide the tools for doing it. So we can't say "thou shalt", but we can describe it as a recommendation & cite the advantages.
The problem of "parameterized library gets it wrong" is highly related but it seems like it's not quite the same thing. Clearly a server-side (engine-side) system could also do it wrong. So far I only know of one library that gets escaping wrong, mysqljs/mysql, though there certainly could be others. It seems like the warning there is beware of sending complex data via parameterized statements; as some interfaces may get it wrong.
Thanks so much for raising this issue. I look forward to working this out & spreading the news.

@lirantal @david-a-wheeler
I agree that we should recommend server-side parameterization when libraries are available that support it. Before reading this thread, I had assumed that libraries that implemented parameterized statements did it server-side and didn't even realize some libraries did it client-side. Client-side parameterization is just syntactic sugar around escaping, and I think it's inherently less secure than server-side parameterization for the same reason why security fixes that address vulnerabilities at the API server are better made at the API server level rather than merely the API client library level.

Exactly. Thank you for recognizing this and the support in keeping the documentation here up to date :-)

Client-side parameterization is just syntactic sugar around escaping

Let's not undersell client-side parameterized statements. The sugar significantly reuses security risks. The problem with forms like:

"select ... where name = " + sql_escape(dangerous_input)

Is that the default is insecure - that is, developers have to remember to escape the data on every call, and since forgetting to add the call is the default, the default is dangerous.

and I think it's inherently less secure than server-side parameterization

Yes, but it's subtle.
The problem isn't technically because it's server-side (the client is trusted in this case). There's nothing necessarily less secure about doing it on the client, as long as the client and server agree.
The problem is that the client might not have exactly the same interpretation as the server, so putting the interpretation on the server eliminates the risk of a mismatch between the client interpretation & the server interpretation. If the server binary API subtly changed, the same thing could happen, it's just less likely.
There's the additional problem that in practice it appears that some client-side implementations may not escape correctly for some structure/array types. Technically that's orthogonal, since server-side code can make the same mistake. The basic problem is that clients should only only provide data that the parameterized/prepared statement system can handle. I need better information about this case.

Okay, I tried to add more info about application vs. DBMS side parameterization, while keeping it relatively simple AND accurate. That is a hard tightrope to walk. Comments welcome. I intend to merge this soon; we can improve it further, but I want to make sure we have at least this material in the course.

Sure, I'm all up for progress :-)

This pull request has an epic number of modifications, but I think we're done or nearly there.
My thanks to everyone.
I've become convinced that part of the problem with application-side library escaping is that the library doesn't really parse SQL, so it can't know the parameter's expected type. If the library supports complex types like objects, then the "obvious" thing to do is insert the form that makes sense... even if the specific SQL statement doesn't allow for the complex form at that point.
It'd be interesting to see how libraries could prevent this. The "obvious" way would be for libraries to NOT expand complex structures like objects by default, and only expand them if they are specially marked, e.g., allowObject(o) or some such.  I wonder if the library could add parentheses in a way that would prevent the attack, e.g., if an object is expanded to "( field = value ... )", could the attack still work. Also, I have yet to find a way to talk PostgreSQL into allowing the attack; it doesn't like X = Y = Z syntax at all (though I didn't try for long, so that just may be a lack of time & imagination on my part). But that's a different problem.
I intend to let this change "simmer" today & merge it tomorrow (unless there's something serious found).


PerfInfo type definition

Forget to define internal type. =)

I don't know why but merge commits show wrong username for your PRs... using squash commits seems to fix it.


SKIN OR THEME

Is there any vidstack player skin or theme or how could I create one.

Vidstack Player would be awesome if it was as easy to use like Plyr, with it having sensible defaults for plug-and-play use (UI being the most important factor). Currently Vidstack doesn't replace Plyr without spending time on building user interface and other missing or barebone features, which cost man-hours. I still like the idea of Vidstack as it currently is!

It’s mentioned in the docs that it’s on the roadmap. We definitely understand and there’ll be a much easier/quicker setup path in the near future :)

Our UI components now contain a default look out of the box which should speed up development.
Skins are tracked here:

Community Skin Discussion
Community Skin
Plyr Skin


Unsupported type

What did I do:
1. $ npm install -g json-server
2. Prepare a simple json file: {"id": "1", "name": "Ricardo", "lastname": "Gonzales" }
3. $ json-server --watch logincorrect.json

What did I get from CMD:
\{^_^}/ hi!

Loading C:\Users\xxx\Desktop\logincorrect.json
Done
C:\Users\xxx\AppData\Roaming\npm\node_modules\json-server\src\server\router\index.js:70
throw new Error('Unsupported type')
      ^
Error: Unsupported type
at Object.module.exports [as router] (C:\Users\xxx\AppData\Roaming\npm\node_modules\json-server\src\server\router\index.js:70:11)
at createApp (C:\Users\xxx\AppData\Roaming\npm\node_modules\json-server\src\cli\run.js:37:27)

Any help?

It means that you're using an unsupported type in your JSON file.
You need to use either arrays of objects or plain objects. For example, this will work:
{
  "users": [
    {"id": "1", "name": "Ricardo", "lastname": "Gonzales" }
  ],
  "array": [{}, {}, {}]
  "object": {}
}

Thanks for your responding. Now is working! Can I set headers responses like my backend does using this tool?

You're welcome. What kind of headers do you need?

What my backend is return now is a simple json and a token. This token is encripted and its placed on the header response.

Ok I see.
You need to use the project as a module. Actually, JSON Server is built on of Express so you can use any middleware with it.
If you need to access the response before it's sent you can do so this way:
var jsonServer = require('json-server')

// Returns an Express server
var server = jsonServer.create()

// Set default middlewares (logger, static, cors and no-cache)
server.use(jsonServer.defaults)

// Returns an Express router
var router = jsonServer.router('db.json')
server.use(router)

// render is called just before returning the response
// so you can do some customization here
router.render = function (req, res) {
  res.setHeader('X-SOME-HEADER', '...')
  res.jsonp(res.locals.data)
}

server.listen(3000)

You can also add or overwrite routes.

Thank you so much and thanks for your time! I'm very new in node, so I guess I should write that code in a file and run it as a script using node right?

Yes, absolutely.
npm install json-server # install it locally
# create an index.js
nodemon index.js


Update ATS2 version to 0.4.0

Motivation for this change
CHANGELOG: https://github.com/ats-lang/ATS-Postiats-release/blob/v0.4.0/CHANGES-ats2
Things done

[ ] Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
Built on platform(s)

[ ] NixOS
[ ] macOS
[X] other Linux distributions

[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
[X] Tested execution of all binary files (usually in ./result/bin/)
[ ] Determined the impact on package closure size (by running nix path-info -S before and after)
[ ] Ensured that relevant documentation is up to date
[X] Fits CONTRIBUTING.md.

Hi, is there something else I need to add to this PR? =)

superseded by #100196


Remove Workshop/appworkshop_232090.acf upon init

Otherwise workshop downloads may get stuck.

Gotta investigat if this can cause any inconsistencies if some files are already present in the map dirs.


Send open lineage information to DataHub, get HTTP ERROR 404 No endpoint POST

Describe the bug
I send open lineage information to datahub with API (api/v2/lineage),got a error Error 404 No endpoint POST /api/v2/lineage
DataHub version: 0.14.0

This is the correct path:
/openapi/openlineage/api/v1/lineage
Also you can check it on the swagger endpoint ->
/openapi/swagger-ui/index.html?urls.primaryName=OpenLineage

You can also check how to setup with airflow here -> https://datahubproject.io/docs/lineage/openlineage/#how-to-set-up-airflow


Publish version 4.1.8 to CocoaPods

Hi,
I am trying to use the version 4.1.8 but it is not available in CocoaPods, can you please publish it?
-> PromiseKit (4.4.0)
   Promises for Swift & ObjC.
   pod 'PromiseKit', '~> 4.4.0'
   - Homepage: http://promisekit.org
   - Source:   https://github.com/mxcl/PromiseKit.git
   - Versions: 4.4.0, 4.3.2, 4.3.1, 4.2.2, 4.2.0, 4.1.7, 4.1.4, 4.1.3, 4.1.2, 4.1.0, 4.0.5, 4.0.4, 4.0.3, 4.0.1, 4.0.0, 3.5.3, 3.5.2, 3.5.1, 3.5.0, 3.4.4, 3.4.3, 3.4.2, 3.4.1, 3.4.0, 3.3.0, 3.2.1, 3.2.0,
   3.1.1, 3.1.0, 3.0.3, 3.0.2, 3.0.1, 3.0.0, 2.2.1, 2.2.0, 2.1.3, 2.1.2, 2.1.1, 2.1.0, 2.0.6, 2.0.5, 2.0.4, 2.0.3, 2.0.2, 2.0.1, 2.0.0, 1.7.2, 1.7.1, 1.7.0, 1.6.0, 1.5.3, 1.5.2, 1.5.1, 1.5.0, 1.4.3,
   1.4.2, 1.4.1, 1.4.0, 1.3.0, 1.2.5, 1.2.4, 1.2.3, 1.2.2, 1.2, 1.0.3, 1.0.2, 1.0.1, 1.0, 0.9.21, 0.9.19, 0.9.18, <IP_ADDRESS>, 0.9.17, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, 0.9.16,
   <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, 0.9.15, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, 0.9.14, <IP_ADDRESS>, <IP_ADDRESS>, 0.9.13, <IP_ADDRESS>, 0.9.11, 0.9.10, 0.9.9, <IP_ADDRESS>, 0.9.8, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>,
   0.9.7, 0.9.6, 0.9.5, 0.9.4, 0.9.3, 0.9.2, 0.9.1, 0.9.0 [master repo]

4.1.8 had a specific change for Carthage only, so had no reason to be released for CocoaPods. Why do you need it?

Because I have a library that supports Carthage and CocoaPods and uses PromiseKit as dependency and it would be great to have the same dependencies versions.

OK, well it doesn't hurt. But linting takes ~1 hour, so I can only do it last thing as otherwise my computer is out of action, plus I cannot guarantee the linting will work since I am now on Xcode 9 and this requires Xcode 8. In fact I'm pretty sure it will not work. Hmm.

git checkout 4.1.8
pod trunk push PromiseKit.podspec

This should work, right?
Thanks, I will wait 👍

This should work, right?

Like I said, I doubt it will lint unless I install Xcode 8 which I guess I can do, but this will be a lot of time for me to spend, and I don't have much time available currently. Linting takes an hour, it probably will fail for some other revlock issue which will then waste more time.

K, I disabled lint and pushed it.

@mxcl Thanks 👍


DTSPO-2879 removed api module

https://tools.hmcts.net/jira/browse/DTSPO-2879 Removed API module

@timja do we need the policy and plum_product modules removed as well? They have the same references to core-infra-$var.env}

@timja do we need the policy and plum_product modules removed as well? They have the same references to core-infra-$var.env}

yes


Add PKCS#8 writing support

Description
This PR is based on @mvgalen work at https://github.com/ARMmbed/mbedtls/pull/1759. It as support for writing keys in PKCS#8 syntax in either DER or PEM format.
The main implementation was taken from https://github.com/ARMmbed/mbedtls/pull/1759, but this PR also adds some tests and the DER part. In addition, this PR improves the gen_key app so that it is able to write keys in PEM or DER format with PKCS#1 or PKCS#8 syntax.
Status
READY
Requires Backporting
No, this is a new feature
Migrations
NO
Todos

[ ] Tests
[ ] Documentation
[ ] Changelog updated
[ ] Backported

@RonEld: I have reworked the PR according to your comments. A few notes:

I reduced the memory usage a little so that the test data fits but is not too tight. I also moved these buffers to the heap to avoid stack overflow, but is still a lot for an MCU.
What other tests we could add? I tried thinking about this for a bit, but I am not sure what tests are worth adding
I think the test you suggested (Have a pkcs 1 file, parse it, write it to pkcs8, and then compare it with a pkcs8 file, which is the pkcs8 format of the pkcs 1 original file) is a bit redundant because this is testing the PKCS#1 parsing more than anything else as the writing PKCS#8 routines tested would be the same as with the current tests because the writing is done based on the pkey struct...
I am a bit reluctant to add the PKCS#8 writing/reading to key_app_writer because that app does both private and public keys but as far as I am aware of PKCS#8 is only for private keys. So adding PKCS#8 to the app would make it asymmetric and a bit awkward to use.
I will look into adding PKCS#8 encryption support, but this was not part of the contributor's PR.

@andresag01 Thank you for the rework

I reduced the memory usage a little so that the test data fits but is not too tight. I also moved these buffers to the heap to avoid stack overflow, but is still a lot for an MCU.

Correct, thanks. That's enough for now, I guess, but I still think we should have a way of testing on target as well.

I think the test you suggested (Have a pkcs 1 file, parse it, write it to pkcs8, and then compare it with a pkcs8 file, which is the pkcs8 format of the pkcs 1 original file) is a bit redundant because this is testing the PKCS#1 parsing more than anything else as the writing PKCS#8 routines tested would be the same as with the current tests because the writing is done based on the pkey struct...

The intention was to verify the PKCS#8 key we are writing, as as expected. Perhaps: have hard coded input for RSA and EC keys, write them to PKCS #8 key, and compare with an existing key with same values which was written by third party, such as openssl ?

am a bit reluctant to add the PKCS#8 writing/reading to key_app_writer because that app does both private and public keys but as far as I am aware of PKCS#8 is only for private keys. So adding PKCS#8 to the app would make it asymmetric and a bit awkward to use.
AFAIK, PKCS#8 is also for public keys. They start with -----BEGIN PUBLIC KEY----- , and I believe we already support writing them.

I will look into adding PKCS#8 encryption support, but this was not part of the contributor's PR.

You are correct that it's not part of the original PR, but this would have been a comment I would add to the original PR as well. If we are adding a function, I would prefer having it to cover all cases. At least the function signature, return "not supported" for password protected at the time being, and open a ticket for tracking this. Obviously, I prefer it to be supported in this PR, but at least the function signature should have it supported.

Actually, I believe our mbedtls_pk_write_pubkey_pem() API writes public keys in PKCS#8, and we are lacking the functionality to write public keys in PKCS#1 syntax, which is unfortuante, I believe.

I have just looked again at the RFC, and PKCS#8 is for private key alone, to my understanding.
I guess our documentation in https://tls.mbed.org/kb/cryptography/asn1-key-structures-in-der-and-pem should be updated...
Nonetheless, our private \ public key writing functionality is not symmetric, and we should have support for writing the keys we are able to parse,

@RonEld: From your comments, I guess we agree that PKCS#8 is only for private keys. I will look into the encryption bit. With regards to the other points:

Do you still want to modify key_app_writer? I would prefer not to because PKCS#8 does not match very well with the PKCS#1 functionality key_app_writer already offers.
For the tests you said: "The intention was to verify the PKCS#8 key we are writing, is as expected. Perhaps: have hard coded input for RSA and EC keys, write them to PKCS#8 key, and compare with an existing key with same values which was written by third party, such as openssl ?". This what I first tried to do, but the problem is that privateKey and privateKeyAlgorithmIdentifier fields in the PKCS#8 struct have an optional attributes parameter for EC keys. Unfortunately,OpenSSL and MbedTLS generate these optional fields differently and I could not get them to have both the same behaviour without modifying other parts of Mbed TLS. So instead what I did was manually check everything is OK and generate the keys using Mbed TLS itself.

@andresag01

Do you still want to modify key_app_writer?

Since these are only example applications, I won't put my foot down. However, the current implementation of key_app_writer is not symmetrical, and doesn't offer PKCS#1 functionality.
For private keys:
we write keys in PKCS#1 syntax, with -----BEGIN RSA PRIVATE KEY----- and -----BEGIN EC PRIVATE KEY-----, however for public keys, we write in X.509 SubjectPublicKeyInfo, with -----BEGIN PUBLIC KEY-----. So, I don't agree with the claim that "* PKCS#8 does not match very well with the PKCS#1 functionality key_app_writer already offers."
Thank for your explanation on the tests. I still think we are lacking some tests, but I understand the limitations.
As for encryption part, I strongly think we should have in the API a parameter for password. For the time being, we can add the parameter, return a  not supported error(with documentation), and track it in a seperate issue. I don't like that if we don't add the password parameter, we will need to deprecate this function once we decide to add encryption support., if we can avoid deprecation.

@RonEld: I had a closer look at your comments:

You wrote:

the current implementation of key_app_writer is not symmetrical, and doesn't offer PKCS#1 functionality.
For private keys:
we write keys in PKCS#1 syntax, with -----BEGIN RSA PRIVATE KEY----- and -----BEGIN EC PRIVATE KEY-----

When I meant by asymmetric is that I do not think that one would normally use PKCS#8 to encode public keys, only private ones. I suppose that you could encode a public key with PKCS#8 or something like this and then change the PEM header and footer to say PUBLIC instead of PRIVATE. But I am not sure whats the point of this. Also, I think public keys are generally encoded using the X.509 SubjectPublicKeyInfo, so thats expected from key_app_writer. Anyways, I have tried to fit the PKCS#8 into the key_app_writer, so what I ended up doing was adding a new command line option to say whether you want to encode the output private key as pkcs1 or pkcs8. This parameter has no effect when the output requested is a public key.

You mentioned:

As for encryption part, I strongly think we should have in the API a parameter for password.

I think that it would be nice to be able to encrypt PKCS#8 keys. However, I think that this requires more than simply adding a password input parameter for the key file writer function. For example, how would you pick the encryption algorithm? I personally think that this is a further feature altogether and would prefer to leave it for a future PR.
I do not see the need to have to deprecate the current PKCS#8 writer if we were to add an encryption option. If I needed to add that feature, I would just create a wrapper around the unencrypted PKCS#8 writer function. The wrapper would just use the old functionality to write the unencrypted key, then it would encrypt the output and finally it would add the extra ASN.1 structs around it.

@andresag01 THank you for addressing my comments

When I meant by asymmetric is that I do not think that one would normally use PKCS#8 to encode public keys, only private ones.

Yes, PKCS#8 is for private key only. (starts with -----BEGIN PRIVATE KEY-----). The corresponding public key which starts with -----BEGIN PUBLIC KEY----- is the X.509 SubjectPublicKeyInfo, which we support. The problem, in key_app_writer, is that for private keys we wrote in PKCS#1, ( with your change, now also PKCS#8) and for public keys, X.509 SubjectPublicKeyInfo alone (PKCS#1 is not supported there). But this is a different topic.

I do not see the need to have to deprecate the current PKCS#8 writer if we were to add an encryption option. If I needed to add that feature, I would just create a wrapper around the unencrypted PKCS#8 writer function.

Correct, That's another solution. iowever, I think that the more APIs we have, the more it's confusing. If we can save the additional API in advance, why not do it? I see your point on algorithm parameter as well, and not only password. So perhaps we should open this for discussion, on what sould be the proper API?

@RonEld: Thanks for reviewing. In summary, I think that the review comments were address except the one related to writing PKCS#8 encrypted keys. As I stated before, I personally think that it would be ideal to keep this PR relatively small and self contained and leave the encryption for a later stage. In any case, I think Mbed TLS does not currently support writing encrypted keys.
I also understand Ron's point of view that he ideally wants to make sure the API for encrypted and unencrypted keys is consistent from now such that we do not regret choices that we might need to deprecate and leave with for a very long time. However, I think that having a function for encrypted and another for unencrypted keys in the future is also acceptable (we can change the naming of the one being introduced here if it helps).
At this stage, I think that it would be ideal if we ask a gatekeeper. @mpg could you take a look? Also, this might be of interest to @gilles-peskine-arm or @Patater because i think this is part of the crypto component.

On whether to support writing encrypted keys in this PR, I think we shouldn't. This PR adds a meaningful feature and we shouldn't hold it until it adds another feature. So to me, the question is, should the new functions mbedtls_pkcs8_write_key_der and mbedtls_pkcs8_write_key_pem take extra arguments to support encryption, which would currently not be implemented?
On whether to support writing encrypted keys in the new functions, I see good arguments both ways.
On the pro side, this is a useful feature, and it would make the functions more symmetric with mbedtls_pk_parse_key.
On the con side, it would make the API more complicated for users who don't want to encrypt the output.
What exactly would the API look like? How does one specify which encryption algorithm to use, and what parameters does it take (password, salt length, iteration count…)? What successors of RFC 5208 should the API be able to support?
If we don't have a consensus on how the API would look like then we should move on with the current API proposal and do encryption with new functions later.

@andresag01
If the consensus to write encrypted keys is to do it in a different function, then I withdraw my objection.
Please rename the functions to:
mbedtls_pkcs8_write_clear_key_der and mbedtls_pkcs8_write_clear_key_pem to make it clearer:)

@RonEld: I will rename the functions to explicitly say that they write unencrypted keys.

@RonEld: I have renamed the functions to make it clear that they only write unencrypted PKCS#8 private keys.

@andresag01 The changes look good to me, however there is a merge conflict.
Please resolve

@RonEld: I have rebased to fix the merge conflict.

@andresag01 Thanks for resolving the conflicts!
Changes look good, however now CI fails, when MBEDTLS_SSL_KEEP_PEER_CERTIFICATE is undefined

@RonEld: Thanks for pointing out the CI failure. There was a memory leaky test, but that should be fixed now. Waiting for CI results.

@andresag01 CI still fails, now when MBEDTLS_RSA_C is not defined.
I suggest you run all the depends-* and similar  scripts to avoid some issues

@RonEld: Thanks for pointing out the CI failure. There were two problems that only showed up when running the EC tests only.

The macros to define the internal buffers sizes did not have parenthesis and size was not being set to the correct size.
The internal buffer size to hold the PKCS8 key did not account for the EC params.

I added fixes for these two issues in the last commit. Waiting for the CI results...

@andresag01 Thanks for the changes!
The changes look good, however please explain why the EC Params add an additional 9 bytes.
According to RFC5480:
ECParameters ::= CHOICE {
       namedCurve         OBJECT IDENTIFIER
       -- implicitCurve   NULL
       -- specifiedCurve  SpecifiedECDomain
     }

Couldn't the OID be larger than 9 bytes?
In addition, the CI now fails in the tests for crypto submodule, as new API in libmbedcrypto does not exist in the crypto submodule. CC @Patater

@RonEld:

The changes look good, however please explain why the EC Params add an additional 9 bytes.

The code in this PR is based on a community contribution. The original code did not add thee EC parameters when the key to write in PKCS#8 is of that kind. So I added it but forgot to take into account the size of this in the internal buffer.
I do not know what is the maximum size of the OID for the EC params. My approach was simply to work out the maximum length of that data from the possible values in Mbed TLS listed here. I think that should be sufficient for our needs and anyways this is safe because (as the test pointed out) there will be a clear failure.

In addition, the CI now fails in the tests for crypto submodule, as new API in libmbedcrypto does not exist in the crypto submodule.

I will not take action regarding this for the moment. But please let me know if anything needs fixing from my end.

PING.
In my opinion the functionality of writing PKCS#8 keys should be part of a TLS library. However in addition to the feature requests discussed in this PR I would definitely add support for writing encryption of keys when writing then (minimum according to PKCS5, PKCS12 maybe optional for the first version).
Regards
TrinityTonic

Hi, when can we expect this PR to be merged?

@fractalclone Nobody is actively working on this. Given its age, I expect it needs some rework, probably starting with a rebase, then getting it to pass CI, and address all the review comments.


Don't set leader if already set

Don't set leader if already set (presumably in vimrc.local.pre)

Good idea, thanks for the fix.


⚠ Bofrost.lu has degraded performance

In 935926b, Bofrost.lu (https://www.bofrost.lu) experienced degraded performance:

HTTP code: 200
Response time: 2128 ms

Resolved: Bofrost.lu performance has improved in 927b28c after 19 minutes.


README edits for installation issues

Add info on using ANACONDA PROMPT  to avoid errors that arise when DL the tutorials

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

This was rolled into #138, now merged.


highlighting TODO, FIXME etc

Hi!
Thank you for great Sublime extension!
I just wanted to share my way to highlight notes in comments in hope this can be somehow generalised. Idea was taken (actually copy-pasted ;) ) from PythonImproved, which works with Neon Color Scheme
--- .config/sublime-text-2/Packages/C Improved/old C Improved.tmLanguage
+++ .config/sublime-text-2/Packages/C Improved/edited C Improved.tmLanguage
@@ -996,6 +996,29 @@
 		<dict>
 			<key>patterns</key>
 			<array>
+				<!-- start inserting here -->
+				<!-- copy-paste from Python Improved, works with Neon Color Scheme -->
+				<dict>
+					<key>captures</key>
+					<dict>
+						<key>1</key>
+						<dict>
+							<key>name</key>
+							<string>punctuation.definition.comment.python</string>
+						</dict>
+						<key>2</key>
+						<dict>
+							<key>name</key>
+							<string>comment.line.note.notation.python</string>
+						</dict>
+					</dict>
+					<key>match</key>
+					<!-- magic there -->
+					<string>^\s*(//+)\s*(BUG|FIXME|TODO|XXX).*$\n?</string>
+					<key>name</key>
+					<string>comment.line.note.python</string>
+				</dict>
+				<!-- end inserting here -->
 				<dict>
 					<key>captures</key>
 					<dict>

Here is how it looks like

Hi!
Thanks for the suggestion.
I've just been experimenting a bit, and here's what I've achieved so far (using the Monokai Soda color scheme):

Most likely I'll also add a background line highlighting (dark blue on your example screenshot), for schemes that support that. I like the way these lines are rendered on the minimap. :)
However, there's a minor issue with the Neon scheme, namely that it matches a too strict comment.line.note.python scope for task tag lines. I believe there should be something like comment.line.note, which doesn't limit it to the Python syntax. I guess, you could suggest them the obvious fix, if you wish. ;-)
Anyway, I'll let you know once I prepare a PR so that you could test the feature before releasing it.

This looks really nice! I didn't know this is possible on vanilla Sublime color schemes. Looking forward to your update!

Neon-color-scheme has been recently updated, exactly comment.line.note.python -> comment.line.note

Great! Thanks for letting me know.

It's a pleasure =)

Hi @xtotdam,
I ended up with more general solution involving more change than I expected: #28, #29, #30 (you can just check out the latter to try it out).
However, these require more further changes from a color scheme, so I've just proposed MattDMo/Neon-color-scheme#26 addressing my concerns. That PR also has a screenshot attached showing how it would look like after accepting all these changes.

Hi!
I had a very quick look at your latest commits to both CImproved and Neon (am uber-busy right now). Everything works just like it has to. Great work! Thank you
In my opinion colors are chosen just right :)


hasMember doc: add import module effect to example

It was very surprising to me that all imported functions because "members" of the struct according to "hasMember" trait. Let's add that behavior to the documentation.

Removed the trailing whitespace.

Definitely a good idea to document the current behaviour. Thanks!


[5.0] Added hasRegex() to Request

This is just a proposal for something I use a lot.
Example:
http://domain.com/page?utm_source=foo&utm_campaign=bar&utm_name=foo

So I need to check if there is any item that begins with utm_. With this new method:
if(Input::hasRegex('/^utm_/')) {
  // --
}

Rebase of: https://github.com/laravel/framework/pull/7268

That can be useful


Add image that appears in metatags

I added a placeholder image to the /public directory however it doesn't seem be appearing in the social media banner.
Any ideas on best way to hook it up?
Found this site which is a good way to test: https://www.opengraph.xyz/
Apparently the optimal aspect ratio is 1200x630px
Also in case there is a way to cycle through different views of the map here are links to specific cities that give pretty cool views:
Lagos: https://www.millionneighborhoods.africa/#11.63/6.4673/3.3842
Dar es Salaam: https://www.millionneighborhoods.africa/#11.16/-6.8413/39.2718
Kinshasa: https://www.millionneighborhoods.africa/#11.77/-4.3178/15.2685
Nairobi: https://www.millionneighborhoods.africa/#12.33/-1.29349/36.82689
Dakar: https://www.millionneighborhoods.africa/#11.59/14.7386/-17.3777
Freetown: https://www.millionneighborhoods.africa/#11.81/8.43171/-13.23846
Accra: https://www.millionneighborhoods.africa/#11.24/5.57/-0.2304
Luanda: https://www.millionneighborhoods.africa/#11.54/-8.8478/13.2923
Windhoek: https://www.millionneighborhoods.africa/#11.83/-22.55722/17.06952
Cape Town: https://www.millionneighborhoods.africa/#11.1/-33.9857/18.5339
Maputo: https://www.millionneighborhoods.africa/#11/-25.8812/32.5637
Harare: https://www.millionneighborhoods.africa/#11.66/-17.8571/31.0533
Lusaka: https://www.millionneighborhoods.africa/#11.57/-15.4122/28.2952
Blantyre: https://www.millionneighborhoods.africa/#11.73/-15.7973/35.018
Kampala: https://www.millionneighborhoods.africa/#11.12/0.2641/32.5417
Addis Ababa: https://www.millionneighborhoods.africa/#11.81/8.99783/38.76702
Mogadishu: https://www.millionneighborhoods.africa/#13.04/2.0422/45.34075
Abidjan: https://www.millionneighborhoods.africa/#10.86/5.3374/-3.9717
Ouagadougou: https://www.millionneighborhoods.africa/#11.79/12.3592/-1.53824
Antananarivo: https://www.millionneighborhoods.africa/#11.35/-18.9118/47.5239

https://www.millionneighborhoods.africa/card-image.png


Topological sort - bug

It's a nit that won't matter most of the time but the topo sort implementation doesn't work in case you have cycles in the graph.
i.e. there is a hard assumption you're operating over a DAG.

Why can't this function simply be implemented as follows?
  def backward(self, is_first=True):
    if (is_first == True):
      self.grad = 1.0

    self._backward()

    for c in self._prev:
      c.backward(False)

Do you mean when there are two or more current children nodes are connected and you want to conceder one of them as a parent node to the other children ones?
If that right you can just do the following:
def backward(self):
    # topological order all of the children in the graph
    topo = []
    visited = dict()
    def build_topo(v):
        if v not in visited.keys():
            visited[v] = v._prev
            for child in visited[v]:
                build_topo(child)
            topo.append(v)
    build_topo(self)

NOTE: I did not test it yet, but I think using dictionary instead of "set" to define the children of each node separately should be fine!

 A vertex v of a directed graph is said to be reachable from another vertex u when there exists a path that starts at u and ends at v. As a special case, every vertex is considered to be reachable from itself (by a path with zero edges).

It's a nit that won't matter most of the time but the topo sort implementation doesn't work in case you have cycles in the graph.
i.e. there is a hard assumption you're operating over a DAG.

It's correct. On the other hand, if it is a Dag, can we simply write the backward function as
def backward(self):
    self._backward()
    for child in self._prev:
      child.backward()

It's a nit that won't matter most of the time but the topo sort implementation doesn't work in case you have cycles in the graph.
i.e. there is a hard assumption you're operating over a DAG.

It's correct. On the other hand, if it is a Dag, can we simply write the backward function as
def backward(self):
    self._backward()
    for child in self._prev:
      child.backward()

No. Your implementation is essentially a DFS, while topological sort requires a BFS. For this simple DAG your code could be wrong:
b = 2*a
c = a + b

with topological sort, it's guaranteed that the back propagation goes in the order of c -> b -> a. With your code, the order could be c -> a -> b, which is wrong.

@gordicaleksa
Could you please provide an example when the computational graph is not a DAG?


DIRECTORY ASCII CHAR WARNING

I using Arduino ide 1.0.5r2, when open the RFID-Cloner.ino File, IDE say: must ASCII ONLY...

Could u change the file name?

IDE 1.0 is not supported. Try latest version (>=1.6).

Fine, I already download new version IDE, it work.
Thanks you.


need remove session in case of LIBSPDM_STATUS_SEQUENCE_NUMBER_OVERFLOW

Currently, there is code to detect session overflow.
In libspdm_decode_secured_message, it sets last error.
    if (sequence_number == (uint64_t)-1) {
        libspdm_secured_message_set_last_spdm_error_struct(
            spdm_secured_message_context, &spdm_error);
        return LIBSPDM_STATUS_SEQUENCE_NUMBER_OVERFLOW;
    }

In libspdm_encode_secured_message, it does not.
    if (sequence_number == (uint64_t)-1) {
        return LIBSPDM_STATUS_SEQUENCE_NUMBER_OVERFLOW;
    }

I think the behavior should be consistent.
In requester - libspdm_receive_data, it will end session.
    if (spdm_response->header.request_response_code == SPDM_ERROR) {
        if ((spdm_response->header.param1 == SPDM_ERROR_CODE_DECRYPT_ERROR) &&
            (session_id != NULL)) {
            libspdm_free_session_id(context, *session_id);
            libspdm_release_receiver_buffer (context);
            return LIBSPDM_STATUS_SESSION_MSG_ERROR;
        }
    }

In responder - libspdm_build_response, it does not.
        switch (context->last_spdm_error.error_code) {
        case SPDM_ERROR_CODE_DECRYPT_ERROR:
            /* session ID is valid. Use it to encrypt the error message.*/
            if((context->handle_error_return_policy &
                LIBSPDM_DATA_HANDLE_ERROR_RETURN_POLICY_DROP_ON_DECRYPT_ERROR) == 0) {
                status = libspdm_generate_error_response(
                    context, SPDM_ERROR_CODE_DECRYPT_ERROR, 0,
                    &my_response_size, my_response);

I think the behavior should be consistent.

Since the counter is 64 bits this will never actually happen.

if we add such check, that means we assume it might happen. As such we need do the clean up.


Pass priority and TTL to transport

This appears to be working okay with WxQ/new-qmedia, but the TTL will need some adjusting in conf server/manifest. Right now the TTL is set to 50ms, which should be fine, but apparently it's not fine.  It needs to be more like 100ms. The problem appears to be with picoquic taking too long a times that exceeds 50ms.  That's a bit crazy, so we need to dig into that. Regardless, that's unrelated to the pq/time-queue changes here.

. Right now the TTL is set to 50ms, which should be fine, but apparently it's not fine. It needs to be more like 100ms.

both seems to be really small TTL values. I would think it should be 500ms or more .. may be 1 sec


Issue with Dynamic value in "Set Version" task (Visual Studio Online)

I am trying to use the update version task but I getting the following error:

2017-05-03T20:14:53.9206240Z ==============================================================================
2017-05-03T20:14:53.9206240Z Task         : MSCRM Set Version
2017-05-03T20:14:53.9206240Z Description  : Updates the version of a CRM Solution
2017-05-03T20:14:53.9206240Z Version      : 8.2.0
2017-05-03T20:14:53.9206240Z Author       : Michaël Hompus
2017-05-03T20:14:53.9206240Z Help         :
2017-05-03T20:14:53.9206240Z ==============================================================================
2017-05-03T20:14:55.8074152Z Updating Solution Version to 1.0.1$(Rev:.r)
2017-05-03T20:15:10.1937098Z ##[error]The version is in an invalid format. Version: 1.0.1$(Rev:.r)
2017-05-03T20:15:10.2269142Z ##[section]Finishing: MSCRM Set Version: XXXXXXXXXXXXXXXXXXXX

Any ideas?

Are you running the task from build or release?

Build, I use the exact same value for the build number within VSTS.

Ah, I messed up the documentation there. It seems you can't use $(rev) outside the build number format.
Because I always have another input for my version numbering so I didn't get caught by this.
For now, the quickest ways to get this working is

Use another variable with a version number (without revision);
Change the build number format to 1.0.1$(Rev:.r), and set the version number in the task to $(Build.BuildNumber);

If you don't want the build number to only contain the version number we need some powershell magic.

Add a powershell script task with the following code befor the SetVersion task

$newVersion = [version]($env:BUILD_BUILDNUMBER -replace ".*?(\d+)[._](\d+)[._](\d+)[._](\d+)", "`$1.`$2.`$3.`$4")
Write-Host "##vso[task.setvariable variable=GeneratedVersion;]$newVersion"

All tasks after this block will have access to the new variable $(GeneratedVersion).

This is a bit cumbersome. The task needs to be improved to handle this by default.

Thanks, I think $(Build.BuildNumber); will do the trick for me.
It would be really good to see some articles  on putting everything together.
Starting from structuring projects in VS to build and release.
I have solutions unpacking and checking into source control but can't help feeling I am missing a trick.
Just an idea, thanks for the pointer.

Thanks, I think $(Build.BuildNumber); will do the trick for me.
It would be really good to see some articles  on putting everything together.
Starting from structuring projects in VS to build and release.
I have solutions unpacking and checking into source control but can't help feeling I am missing a trick.
Just an idea, thanks for the pointer.

Glad you got it working and thanks for your feedback. Yes more articles is certainly one of the things I intend to do.

Hi All,
I see that this problem is still present in VSTS extension. Do you have a plan to fix it out ?
Thanks!

@IvanKirianov What is the issue you are facing? are you not able to use the suggestion by @eNeRGy164

Hi @eNeRGy164! I am running into the same issue above and neither the solution via $(Build.BuildNumber) nor the PS script helps. I can continue troubleshooting it myself but do you mind shedding some light on why the dynamic Build Number poses such challenge for the Set Version task?
For static definition, it works just fine:
Build Number: <IP_ADDRESS>
Set Version (v12): $(Build.BuildNumber)

But when I change it to:
Build Number: 1.0.0$(Rev:.r)
Set Version (v12): $(Build.BuildNumber)

It fails:
Updating solution version to <IP_ADDRESS>
##[error]The version is in an invalid format. Version: <IP_ADDRESS>

Even when I use your PS script, it fails because it cannot parse the version despite your attempt to reassemble it digit by digit:
Cannot convert value "<IP_ADDRESS>" to type "System.Version".
Error: "Input string was not in a correct format."
At D:\a\_temp\848efa4b-7f4e-4df0-a419-a4e61ba8264c.ps1:5 char:1
+ $newVersion = [version]($env:BUILD_BUILDNUMBER -replace ".*?(\d+)[._] ...

In all instances the Build Number is in the correct format, it is interpreted as a string, but it can never be parsed. What am I missing? This used to work for me just fine.
Thanks a lot!

Found the problem:
For some reason, $(Build.BuildNumber) variable contains several non-printable characters at the end which are not visible in the console:
<IP_ADDRESS>â€‹
I am not sure why @eNeRGy164's regex did not work for me but this did the trick:
## Remove all non-printable characters
$cleanVersion = [version]($env:BUILD_BUILDNUMBER -replace "[^ -~]")

##Save
Write-Host "##vso[task.setvariable variable=cleanVersion;]$cleanVersion"

However, this means that the PowerShell task seems mandatory if you want to use $(Build.BuildNumber) as the solution version in SetVersion for now.

@bluonic $(Build.BuildNumber) should work in the task. In fact I have used in the getting started video: https://youtu.be/rl62P68UxE4

I used the task previously and it just worked. No idea why it doesn't work in that one DevOps environment. Hopefully nobody will have to use the trick above. Nice video!


Lacking Webpack integration

The package cannot be imported in a Webpack setup: import moment from 'moment-holiday yields Error: Cannot find module ".". A require calls does not succeed either. Could you add support for Webpack?
P.S. Originally discovered in the context of create-react-app.

Got it. Just do import 'moment-holiday'

Plus one for this. I'm trying to use this with react, won't work, getting lots of web pack related errors.

Seeing this as well...

Hey, this seems to be a huge problem for us using react can you please show us how to fix this. Thanks

Running into this too. Great library, but can't use it due to incompatibility with Webpack.

Also ran into this trying to use in React App.
Is there a workaround?

Cant import

Workaround is to go to node-modules and replace:
“undefined”==typeof require||nul===require||require.amd?this.moment:require(“moment”) with:
require("moment")

@anetk we don't really want to modify node_modules as most of the time we delete this before we commit the project

@kgrosvenor Fork the .min file to your project then, so you can fix the requires there.

I have created a fork that is usable via webpack: https://github.com/joeldenning/moment-holiday.
Installation:
npm install --save https://github.com/joeldenning/moment-holiday\#1.5.2-webpack.0

@joeldenning thanks for fork! Also you may want to update your documentation to:
yarn add joeldenning/moment-holiday\#1.5.2-webpack.0
per https://github.com/yarnpkg/yarn/issues/2083#issuecomment-525335592
Cheers!


Regression in 1.16.22: @EqualsAndHashCode includes transient fields by default

With this code:
@EqualsAndHashCode
public class BugExample {

    int a;
    transient int b;

    public BugExample(int a, int b) {
        this.a = a;
        this.b = b;
    }

}

the field b in fact does make a difference for .equals. The regression was introduced in version 1.16.22; 1.16.20 works as documented.
Minimal example with tests exposing the issue: https://github.com/emlun/lombok-1.16.22-regression
Probably related to #1772.

I'd bet this has been fixed in 1.18, just can't see it in the changelog.

Sorry, yep, it's fixed in f241ef8c309b90faacabe66431b9deaebfd7087a on master. Also duplicate of #1724.

I mean it's not fixed in the 1.18.0 release, but I guess the fix will be included in the next release.


Handle multiple link elements with rel=icon

Extracted from #75
It is very possible—even recommended—that there are multiple icons and if we're going to check that they actually exist, we should fallback to the other images listed.
e.g.:
<link rel="icon" type="image/png" href="https://cdn.yourwebsite.com/favicon-16x16.png" sizes="16x16">
<link rel="icon" type="image/png" href="https://cdn.yourwebsite.com/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.yourwebsite.com/favicon-96x96.png" sizes="96x96">

There is a subtle functionality change here in that the element matching head > link[rel="shortcut icon"] will no longer be checked first, but that isn't important, nor should it be. That said, not checking for rel="shortcut icon" first could also be an improvement since its usage isn't quite correct or modern:[1]

For historical reasons, the HTML specification now allows the use of shortcut as a link relation if it’s immediately followed by a single U+0020 space character and the icon keyword.

Fixed up the JSDoc

Fixed up the JSDoc, again 😅