Lookup abbreviations using the keyboard

Background
From the main canvas, provide a way for the user to quickly lookup abbreviations (templates, functional groups, etc.) via typing their names.
Solution
When a user is in the main editor view and starts typing the name of the abbreviation on the keyboard - a context window should appear containing current user input and a list of matching abbreviations in a form of a drop-down list that can be navigated via the keyboard.
When a user presses the "Enter" key - the context window closes and the selected abbreviation is set as the current template that the user can place on the canvas.
There may be collisions of abbreviation names and current Ketcher keyboard shortcuts, so the context menu should only appear if more than one letter was typed within a certain time limit (e.g. appear if the user typed the second letter within 1000 ms)

The suggestions list should contain abbreviations with names - DCM (dichloromethane)
If an abbreviation is empty or the same as the name only the name should be displayed - CO2Me
The list of abbreviations should contain all Elements from the Periodic Table. Labels should be in the form Element (Name), F.e. Br (Bromine).
If there're no search results for entered string, then display a dropdown with the text No matching results.
If a user removes all entered text, then display a dropdown with the text Start typing atom or template structure name without any options.
Only one highlighted substring should be displayed for the option label. Priority order should be followed:

there's no abbreviation, highlight substring in a name
the lookup string is located at the beginning of an abbreviation, highlight the substring in an abbreviation
the lookup string is located at the beginning of a name, highlight the substring in a name
if the lookup string is located at the beginning of an abbreviation and a name at the same time or not located at the beginning of both of them, check the similarity for an abbreviation and name
similarity for an abbreviation is greater or equal to the similarity of a name, highlight the substring in an abbreviation
otherwise, highlight the substring in a name

The suggestions list should be sorted according to these criteria:

Matched substring is at the beginning of the name or abbreviation. F.e. "Hg (Mercury)". If 2 items are equal by this criteria, then check criteria 2
Highest similarity of lookup value with name or abbreviation. Where similarity is the result of the division of the length of the matched string by the length of the name or abbreviation. F.e. for the lookup value mer and option Hg (Mercury) similarity will be 3/7 by matching with the element name. For the lookup value hg and option Hg (Mercury) will be 1 by matching the element abbreviation. If the lookup value is found in the name and the abbreviation, then the highest value of similarity should be taken for this option. If 2 items are equal by this criteria, then check criteria 3
Lexicographical comparison in case point 1 and 2 give the same result. The whole option label should be used for lexicographical comparison - Hg (Mercury)

#184100484

Found duplicated abbreviations (numbers are count of instances):

Indole - 2
alpha-D-Allopyranose - 2
alpha-D-Altropyranose - 2
alpha-D-Galactopyranose - 2
alpha-D-Glucopyranose - 2
alpha-D-Gulopyranose - 2
alpha-D-Idopyranose - 2
alpha-D-Mannopyranose - 2
alpha-D-Talopyranose - 2
Bicyclo[4-1-1]octane - 2
Bicyclo[4-2-1]nonane - 3
Bicyclo[4-2-2]decane - 3
Bicyclo[4-3-1]decane - 4
Bicyclo[4-3-2]undecane - 4
Bicyclo[4-4-1]undecane - 3
Bicyclo[4-4-2]dodecane - 3
GLY-Glycine - 2
Cyclopentadiene - 2
Ring5 - 2

https://github.com/epam/ketcher/assets/81073/b44214be-43d9-48bd-8a9c-6d684c07fd5e


Question: Keybinding to open lspsaga peek definition not working

Bug description
I have the following setup for lsp saga:
{
	"nvimdev/lspsaga.nvim",
	config = function()
		require("lspsaga").setup({})
		local opts = { noremap = true, silent = true }
		vim.keymap.set("n", "<leader>rn", ":Lspsaga rename<CR>")
		vim.keymap.set("n", "<leader>K", ":Lspsaga hover_doc<CR>")
		vim.keymap.set("n", "<leader>ca", ":Lspsaga code_action<CR>")
		vim.keymap.set("n", "<leader>gr", ":Lspsaga finder tyd+ref+imp+def<CR>")
		vim.keymap.set("n", "<leader>gd", ":Lspsaga peek_definition<CR>", opts)
		vim.keymap.set("n", "<leader>D", ":Lspsaga show_line_diagnostics<CR>")
		vim.keymap.set("n", "<leader>d", ":Lspsaga show_cursor_diagnostics<CR>")
	end,
	dependencies = {
		"nvim-treesitter/nvim-treesitter",
		"nvim-tree/nvim-web-devicons",
	},
}

I can effectively open a popup that shows a definition using gd, but when I want to maximize that popup in the current pane using the 'o' key, it automatically jumps to a new line under my cursor in insert mode. I've also tried oand many other alternatives.
Is there any way to set the behavior of the 'o' key only for that popup?
Steps to reproduce

run Lspsaga peek_definition
hit letter o or O, trying to open up the pop up and have it completely maximized in your current pane. There you will see that the only thing that will happen would be that your cursor will create a new line up/down your current line

Expected behavior
Have peek definition pop up completely maximized in your current pane
Neovim version (nvim -v)
0.9.5
lspsaga commit
2198c07124bef27ef81335be511c8abfd75db933
Terminal name/version
warp

Did you try this? This overrides default behavior of having to use <C-c>o to edit inside of the float. For me, using this override means o takes me to definition.

Yes, however idk why when I press <C-c>  I get that line erased before even being able to press o

Adding the following statement solved the problem for me:
      require("lspsaga").setup({
        definition = {
          keys = {
            edit = 'o'
          }
        }
      })

I had an issue with the configuration of my keyboard though, that's why this answer wasn't working.
Many thanks @winter-again !


Sets default background/foreground colors

If the foregroundColor and/or backgroundColor do not exist in the config then hyper-statusline defaults to black for both.
Tested this in Node:
> require('color')(undefined).string()
'rgb(0, 0, 0)'

This commit also removes some redundant default resolvers. Since .string() from color returns a filled string the default option is no longer needed.

Sorry for massive delay ✌


Return error window output to default font size.

Fixes #134
Back to a default font size. Looks like this with that lovely native-ui:

:heart_eyes: :+1: :+1: :+1:


Project doesn't open both in VS12 and VS13

Project is not supported as Visual says.

Can't reproduce. Also opens in VS2015.


Can't fetch anymore collections (Opensea cloudflare update)

Hey everybody,
I noticed that opensea increased the number of times it checked my browser when opening it.
I then noticed that the script can't fetch anymore collections.
✅ === OpenseaScraper.rankings() ===
=== OpenseaScraper.rankings() ===
...fetching 1 pages (= top 100 collections)
...opening url: https://opensea.io/rankings?sortBy=one_day_volume
...🚧 waiting for cloudflare to resolve
...exposing helper functions through script tag
...scrolling to bottom and fetching collections.
...🥳 DONE. Total Collections fetched: 0
scraped 0 collections:
Is this the same for you guys? Does anyone have an idea on how to fix this?
Thanks

Same here.. try looking for solutions

I can confirm the issue. Cloudflare is taking a very long time to resolve. I tested and could observe the following behavior:

it eventually resolves, but it can take up to multiple minutes.
the cloudflare page reloads multiple times. Increasing the overall timeout for all methods works, but not sure how usefull the scraping is when it takes ~2 mins to resolve.

Deploying a quickfix soon that works with extended execution time of up to 2 mins (not optimal though). If anyone has ideas how to resolve cloudflare please share.
I found this repo, will test and report soon:
https://github.com/JimmyLaurent/cloudflare-scraper

ok cloudflare-scraper repo I tested does not work, it broke since cloudflare started to reload the page (which we also experience):
https://github.com/JimmyLaurent/cloudflare-scraper/issues/39#issuecomment-908615480
Unfortunately the waiting for 2 mins somehow also does not work consistently. Cant figure out why for now. Not sure what else to do.
I have to say sometimes cloudflare is getting more rigid and its a temporary thing, so chances are opensea experiences a ton of traffic and thats why cloudflare is more rigid, but we'll have to see if this issue persist long term.
Sorry theres no fix for now :( if anyone has ideas please share!

would disabling timeout on waitForSelector work?
the error im getting is
waiting for selector .cf-browser-verification to be hidden failed: timeout 30000ms exceeded - guess they extended at a variable time..
also perhaps should wait for #__next tag to show?

waitForSelector has a default timeout for 30000ms (30 secs). I tried extending to 2 mins but for me it still did not work. I also wanted to wait for the opensea page to appear, but with no luck. You can try around yourself:
// REPLACE
await page.waitForSelector('.cf-browser-verification', {hidden: true});
// WITH
await page.waitForSelector('#__next', {timeout: 120000});

hidden: true means puppeteer will wait for the selector to disappear. This was the logic before: wait until cloudflare class disappears, but we could also just wait for the opensea selector to appear. But as said above, for me it did not work consistently.

ok cloudflare-scraper repo I tested does not work, it broke since cloudflare started to reload the page (which we also experience): JimmyLaurent/cloudflare-scraper#39 (comment)
Unfortunately the waiting for 2 mins somehow also does not work consistently. Cant figure out why for now. Not sure what else to do.
I have to say sometimes cloudflare is getting more rigid and its a temporary thing, so chances are opensea experiences a ton of traffic and thats why cloudflare is more rigid, but we'll have to see if this issue persist long term.
Sorry theres no fix for now :( if anyone has ideas please share!

Thank you for your quick responses. It seems that it works again without changing anything. I think you were right with the assumption that cloudflare changed something because opensea had a lot of traffic. I'll keep this issue open a few more days and I'll report to you if something changed again

Ah great, thanks for the report, its good to know that this issue happens. I know there is a solution to bypass cloudflare but its not that simple to do. They also change stuff a lot so its always a cat and mouse game to keep up with the changes.
Its good that it works again and please do report after you test over the next few days!

the problem is still there when i am using cloud service to run the puppeteer.

Did you try using a proxy? If you ran this on a cloud service it's probably just blacklisted by opensea.
I didnt run into anymore problems on Mac. If I try to run the script on Linux it stops right here
✅ === OpenseaScraper.rankings() ===
=== OpenseaScraper.rankings() ===
...fetching 1 pages (= top 100 collections)
...opening url: https://opensea.io/rankings?sortBy=one_day_volume
...🚧 waiting for cloudflare to resolve
...exposing helper functions through script tag
...scrolling to bottom and fetching collections.
I use the same code 1:1 on mac and It worked on Linux a week ago. I'm clueless

Which cloud service did you use? I am useing firebase functions (which basically is google cloud) and it works for me. If you want I can share my setup.

@SKreutz can you open another issue for the linux bug?

@khalilsiu
Which cloud service did you use? I am useing firebase functions (which basically is google cloud) and it works for me. If you want I can share my setup.

I'm using compute engine for that, perhaps i should try with firebase in that case
I havent tried using a proxy yet..
It would be great if you can share your setup with me @dcts

Did you try using a proxy? If you ran this on a cloud service it's probably just blacklisted by opensea.
I didnt run into anymore problems on Mac. If I try to run the script on Linux (computer in the same network) it stops right here without any errors like it's frozen.
✅ === OpenseaScraper.rankings() === === OpenseaScraper.rankings() === ...fetching 1 pages (= top 100 collections) ...opening url: https://opensea.io/rankings?sortBy=one_day_volume ...🚧 waiting for cloudflare to resolve ...exposing helper functions through script tag ...scrolling to bottom and fetching collections.
I use the same code 1:1 on mac and It worked on Linux a week ago. I'm clueless

Exactly, I took screenshots during the froze and it happens that the waiting page is being redirected to every time, so it is stuck within that waiting room forever.

I'm closing since issue since the cloudflare problem is solved and opening a new one


libmodbus init closes #283

Thanks for the PR!
I hardcoded the config results on windows for robustness and performance (check_xyz is very slow on windows). I also moved the include files up to the root, since that's how the library appears to document use (#include <modbus.h>). I know that for cmake users, you had added that as an include path, however we do intend to be used by more than cmake so this seems like an acceptable change :)


"Viezuri" is listed in the drop-down menu

Description:
"Viezuri" is listed in the drop-down menu alongside its corresponding county and commune, according to the law
Precondition:
The website is up an running.

Step 1
Type "Viezuri" in the search bar.

Expected results
The location is listed in the drop-down menu as "Viezuri, Alba (Ceru-Băcăinți)".


Adjusting font size and label size

I can't figure out how to change the size of the fonts and label in a plot.
How is this possible?

You should be able to do:
%opts Layout [fig_inches=(10,8) fig_rcparams={'axes.labelsize':20,'axes.titlesize':20}]

However the magic parser seems to complain if the rcparams dict contains more than on entry. I'd therefore recommend either setting the rcparams directly via matplotlib or using the hv.Store object (which holds all the options) directly like this:
hv.Store.options.Layout = hv.Options('plot', fig_rcparams={'axes.labelsize':20,'axes.titlesize':20})

Maybe we should provide a slightly better interface to these options. I could imagine having title_kwargs, label_kwargs and tick_kwargs plot options allowing you to directly override the font options for each. Can anyone suggest any better names for these plot options?

For me, the most obvious would be:
%%opts Image [title_size=10 label_size=8]

or setting both the same
%%opts Image [font_size=10]

Seems reasonable, the kwargs thing would have let you set the font weight (i.e. bold, italic etc.) too but I think I think I agree with you, size is a far more common option and we want the name for that option to be clear. Should be fairly straightforward to implement these, will see maybe I'll add them today.

Having an easy way to control font sizes makes sense to me but I would like to avoid the proliferation of size parameters. How about:
%%opts Image [font_sizes={'title':10, 'xlabel':20, 'ylabel':25, 'ticks':7}]

What I prefer about this suggestions is that:

One parameter for all the fontsizes instead of many.
Actually shorter if you want to specify multiple font sizes at once.

If we declared font_sizes as a param.Parameter (less type checking unfortunately), you could even set all the font sizes at once by supplying a simple integer instead of a dictionary. This would be a fairly intuitive and simple default behaviour that could then easily be overridden using the more specific dictionary specification.
Thoughts?

Sounds like an intuitive solution. Will autocomplete work with it though?
Also an easy way to turn of the ticks in the axes would be nice.

The key font_sizes will still auto-complete but the possible dictionary keys (i.e 'title', 'xlabel', 'ylabel', 'ticks') won't autocomplete unless someone does a lot of work on the completer.
At least the easy case (i.e a single integer) is trivial but for finer control, users may have to  consult the documentation to see what options are possible. That said, I still think this is probably the cleanest solution!

A font related issue, not all fontsizes of a HoloMap change:
hv.Store.options.Layout = hv.Options('plot', fig_rcparams={'axes.labelsize':40,
                                                           'axes.titlesize':40})
a = lambda: hv.Image(np.random.randn(10,10), bounds=(0, 0, 10, 10)).relabel('test1')
hv.HoloMap({1: a(), 2: a()})

That example is due to a non-applying options definition. A single HoloMap is not a Layout, you'd have to set the figure_rcparams on the Image for it to apply:
hv.Store.options.Image = hv.Options('plot', fig_rcparams={'axes.labelsize':40, 'axes.titlesize':40})

This is kind a counter-intuitive but expected behavior of the options system. If you want to set some options globally you could set them on the plotting baseclass, where they are first introduced, e.g. in this case you:
from holoviews.plotting import Plot
Plot.fig_rcparams={'axes.labelsize':40, 'axes.titlesize':40}

We could consider providing a few branches to the Options tree are globally applied, e.g. Store.options.Global could apply to all plots and support all plot options that implemented on Plot, Store.options.Element could apply to all ElementPlots and support all of its plot options.

We could consider providing a few branches to the Options tree that are globally applied, e.g. Store.options.Global could apply to all plots and support all plot options that are implemented on Plot, Store.options.Element could apply to all ElementPlots and support all of its plot options.

Although I agree with the idea of such shortcuts, doing it this way would result in 'Element' and 'Global' appearing in the opts magic completions.
While this does make does sense it may also complicate the magic further and confuse new users - I would favour only setting opts on concrete classes that can be used directly.

I would call Global "Plot" if that's the class it applies to (can't seem to find it easily in the source code), but it does seem useful to have them available.  I'm not sure why you argue that having them in the opts magic completions would be confusing -- seems like that's exactly where you want to have them, so that people realize that they can set things overall this way.

I think for this problem, Philipp's suggestion of setting the defaults on Plot is the cleanest and safest approach which already works fine.

I have implemented the fontsize parameter in the block of commits from 0f54bea to b598acc.
You can now use something simple like this:
%opts Image [font_size=15]

or  something more involved like this:
%opts Image [font_size={'title':10, 'xlabel':20, 'ylabel':25, 'ticks':7}]

The default of fontsize=None lets matplotlib decide via the rcparams. Note that in Layouts you can set the title size but the other options will be ignored (they need to be set at the appropriate level).
I think I can close this issue now. The only other suggestion was about setting parameters globally but I would say this is solved very nicely by Philipp's suggestion of setting fig_rcparams on Plot (or alternatively change the rcParams in default.mplstyle.)

I'm a bit lost maybe, I'm trying to set the global fontsize and I don't want to do the following:
%%opts Image [fontsize=13] Contours  [fontsize=13] Scatter [fontsize=13] Layout [fontsize=13]

for obvious reasons.
Then I tried Phillips
hv.Store.options.Image = hv.Options('plot',  fig_rcparams={'axes.labelsize':40,
                                                           'axes.titlesize':40})

and
from holoviews.plotting import Plot
Plot.fig_rcparams={'axes.labelsize':40, 'axes.titlesize':40}

and both give me:

EDIT!
I tried it again, but now it did change the labels for no apparent reason.
from holoviews.plotting import Plot
Plot.fig_rcparams={'axes.labelsize':40, 'axes.titlesize':40}

Although this doesn't change the label fontsize of the HoloMap.

The above doesn't work anymore, should change it into:
from holoviews.plotting import MPLPlot
MPLPlot.fig_rcparams={'axes.labelsize':14, 'axes.titlesize':14}

How can I set these style options now? I'm already trying this for 20min, quite frustrating.

What's exactly is the issue? This works for me:
%%opts Image [fontsize={'title':20, 'xlabel':20, 'ylabel':25, 'ticks':7}]
hv.Image(np.random.rand(10,10), group='A')

and so does this:
%%opts Image [fontsize=10]
hv.Image(np.random.rand(10,10), group='A')


status_emoji: Remove extra space with Handlebars whitespace control

Discussion.

@amanagr can you review and test this change?

LGTM. We removed the icon before the user name so that CSS is not required.

Merged, thanks @andersk! And yeah, handlebars whitespace control is madness in this case.


better example for log alert with database included

@AbbyMSFT

Can you review this PR?
IMPORTANT: When this content is ready to merge, you must add #sign-off in a comment or the approval may get overlooked.

#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team

#reassign: @nolavime

Hi @nolavime,
Can you please review this suggested change? If it makes sense, please approve and sign off.
Thanks,
Abby

#sign-off

@AbbyMSFT

Merging per https://github.com/MicrosoftDocs/azure-docs/pull/113343#issuecomment-1685296568


react and react-dom mismatch after upgrading to v1.0.0 (React 17)

https://github.com/backstage/backstage/pull/9037
https://github.com/backstage/backstage/issues/6910
We have upgraded our code base to v1.0.0 and following is the react version under packages/app/package.json
"react": "^17.0.2",
"react-dom": "^17.0.2",
We have extended some of the backstages' plugin such as api-docs/ catalog / tech-radar to give custom features for our project and following is what we have in the package.json there
"peerDependencies": {
"@types/react": "^16.13.1 || ^17.0.0",
"react": "^16.13.1 || ^17.0.0",
"react-dom": "^16.13.1 || ^17.0.0"
},
All our other internal plugins in the project have the same react and react-dom versions as above
Our root package.json has the following
"resolutions": {
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
Now we are seeing below error
ERROR 501: Lazy loaded chunk failed to load, try to reload the page: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons: 1. You might have mismatching versions of React and the renderer (such as React DOM) 2. You might be breaking the Rules of Hooks 3. You might have more than one copy of React in the same app See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.

What does yarn why react and yarn why react-dom say? They should both just list a single version. It's possible to get a duplicate install with those version ranges since ^17.0.0 isn't exactly the same as ^17.0.2, and ofc v16 satisfies the full range as well. Double check the react and react-dom entries in yarn.lock, most likely you should actually just be able to just remove them from yarn.lock and run yarn install to solve the issue.

yarn why react
[4/4] Calculating file sizes...
=> Found<EMAIL_ADDRESS>yarn why react-dom
[4/4] Calculating file sizes...
=> Found<EMAIL_ADDRESS>There appears to be only one version of both react and react-dom.
Clearing the yarn.lock did yarn install
Using the below versions everywhere in the project
"@types/react": "^17.0.2"
"react": "^17.0.2",
"react-dom": "^17.0.2",
Contents of yarn.lock
<EMAIL_ADDRESS>version "17.0.2"
<EMAIL_ADDRESS>version "17.0.2"
Still the same issue.

Hmm, looks alright. You could double-check @hot-loader/react too, that there's only one of each of the specific 16 and 17 installed via ©backstage/cli.
I think it's time to move on to investigating point 2, is it possible that you have an invalid hook call somewhere? what does the stack trace look like?

"@hot-loader/react-dom-v16@npm<EMAIL_ADDRESS>version "16.14.0"
"@hot-loader/react-dom-v17@npm<EMAIL_ADDRESS>version "17.0.2"
The internal plugin, where we see that error hasn't changed anything. All we are doing at the moment is to upgrade to v1.0.0.
And surprisingly, there is not console stack trace !!!

And now when I perform the following.
// Add this in node_modules/react-dom/index.js
window.React1 = require('react');
// Add this in your component file
require('react-dom');
window.React2 = require('react');
console.log(window.React1 === window.React2);
it prints false

and also we get the following warning while performing yarn install
warning "workspace-aggregator-2de7c4d2-d288-4b92-8bae-15d51521a951 > app > @backstage/cli ><EMAIL_ADDRESS>has incorrect peer dependency<EMAIL_ADDRESS>warning "workspace-aggregator-2de7c4d2-d288-4b92-8bae-15d51521a951 > @backstage-extended/plugin-catalog > react-helmet ><EMAIL_ADDRESS>has incorrect peer dependency<EMAIL_ADDRESS>warning "workspace-aggregator-2de7c4d2-d288-4b92-8bae-15d51521a951 > app > @backstage/core-components > @material-table/core ><EMAIL_ADDRESS>has incorrect peer dependency<EMAIL_ADDRESS>warning "workspace-aggregator-2de7c4d2-d288-4b92-8bae-15d51521a951 > app > @backstage/core-components > @material-table/core ><EMAIL_ADDRESS>has incorrect peer dependency<EMAIL_ADDRESS>warning "workspace-aggregator-2de7c4d2-d288-4b92-8bae-15d51521a951 > app > @backstage/core-components > @material-table/core > react-beautiful-dnd ><EMAIL_ADDRESS>has incorrect peer dependency<EMAIL_ADDRESS>

We have the same issue, everything is same with @shanthisagar-dhanya-kumar-db and also we have the error at Catalog, TechDocs and Scaffolder pages

Finally, it appears that we had the scenario 2 which is hooks inside the function which we detected and finally resolved it.
@Rugvip : Thanks for helping to understand the other views.


Adds .well-known URI for password change

Checklist
🚨 Please review the guidelines for contributing to this repository. 🚨

[x] Make sure you are making a pull request against our main branch (left side)
[x] Check that that your branch is up to date with our main.
[x] Make sure you are requesting to pull a topic/feature/bugfix branch (right side). Don't request your main!
[x] Check that the tests and code linter both pass.
[ ] If you're a new contributor, please sign our contributor license agreement.

Warnings

[ ] This PR will change existing database contents.
[ ] This PR introduces a breaking change to existing installations.

Summary
This adds the Well-known URI for a password reset.
Linked issues

Description of changes
This change adds a Well-known URI for a password reset and a simple spec. One drawback is that this would let a user go to their password reset in single-user mode -- not ideal but possible. It also allows password managers to quickly access the link in multi-user mode which is ideal.
I wrote the spec in the context of "when signed out" but it also works if the user is signed in. I'm not certain the best way to describe the context, so I left it as is.

Very nice, I didn't know this was a thing!
For .well-known when it gets more complex, I was intending to follow the pattern that Mastodon did here of having controllers in a subdirectory and module: https://github.com/mastodon/mastodon/tree/main/app/controllers/well_known


Deployment

Deployment
As a boot camp student,
I want the prework notes to be structured on a webpage,
So that I can easily find and read the information
GIVEN a Prework Study Guide website,
WHEN I visit the website using the URL,
THEN I can access my website from any browser

Criteria for the Deployment issue have been completed.


fix(plugins): use character class for path separators

path.sep is not a valid regex when on win32 (single "\")
resolves #55

:tada: This PR is included in version 7.0.3 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


Fixing arguments order when getting value from AST

Hello,
Given the following InputObjectType :
new InputObjectType([
    'name'   => 'order',
    'fields' => [
        'foo'  => ['type' => Type::string()],
        'bar'  => ['type' => Type::string()]
    ],
]);

and something like order: {bar: "ASC", foo: "ASC"} as value, the return of GraphQL\Utils\AST::valueFromAST will be ['foo' => 'ASC', 'bar' = 'ASC'].
However when the order of arguments has importance, like constructing an ORDER SQL clause, this can pose a problem and the return should be ['bar' => 'ASC', 'foo' = 'ASC'].
The aim of this PR is to fix this by using the order given by the user instead of the order defining during the field configuration.
I used directly assertSame() in the test case instead of the helper method runTestCaseWithVars because this method use assertEquals and this doesn't test the order of the keys.
Tell me if I should replace assertEquals by assertSame in the helper method, I was not sure about that.
fix : https://github.com/api-platform/core/issues/2808

This is not a bug. The specification clearly states this:

Arguments are unordered
Arguments may be provided in any syntactic order and maintain identical semantic meaning.
These two queries are semantically identical:
Example № 12
{
  picture(width: 200, height: 100)
}

Example № 13
{
  picture(height: 100, width: 200)
}

While I understand what you are trying to achieve, relying on arguments order is not spec-compliant. If we merge this it will make client apps fragile because they will rely on the implementation-specific feature.
See also recent discussion about this topic exactly in the graphql-spec repo.
So for your use-case of order clause the correct model would be a single argument of List type. Lists do preserve ordering of elements.


remove pessimizing moves on return

remove several statements containing "return std::move(x)" which,
according to the c++ standard 12.8/31 is pessimizing, because
these objects are eligible for the NRVO. This issues a warning
in gcc 9 otherwise.

seems to be not working with the older compilers

I'm getting this problem to. May it be fixed by a macro?
#ifdef __GNUC__
	#if __GNUC__ >= 9
		#define MOVE(X) X
	#else
		#define MOVE(X) std::move(X)
	#endif
#else
	#define MOVE(X) std::move(X)
#end


Change module name from mock_mpi to mockmpi

It seems to be discouraged to use underscores in pip package names.  So I used MockMPI for the package name.  But to avoid confusion, I think it would be simpler to also use mockmpi (without underscore) as the python module name.
Any objections?

No strong opinions, so yep, sure!


[GCD/Gui only] When searching pressing enter on results brings comic id 1

Prior to recent alphas when pulling up a search in the GUI of the the GCD database, if the correct series comes up without further selection it would grab the issue details that matched the issue number (so Age of the Wolf from rebellion would bring up no other options in the search result for example)  and populate the form with those details. Now it grabs the details but of  the comic with issue id #1. See attached screens at imgur for example.
Screens

This does only happen in GUI with GCD talker all others appear unaffected.

Some parentheses were forgotten https://github.com/comictagger/gcd_talker/blob/45c83f3cda056781578cc6e656685ac57ce166ad/gcd_talker/gcd.py#L837

Fixed with https://github.com/comictagger/gcd_talker/pull/24
I need to make a couple of other changes and then I'll do a new release in the next few days.

https://github.com/comictagger/gcd_talker/releases/tag/0.1.2 but the pre-compiled alpha CT won't have it until the next alpha release.

This should be included in https://github.com/comictagger/comictagger/releases/tag/1.6.0-alpha.22


Wolcen: Lords of Mayhem - Character head is surrounded by big blob

Software information
in Wolcen: Lords of Mayhem, when launching the game (and while playing) there is a big blob around the character head. (sometimes it blinks away, but its just there -_-)
Example Picture:

I'll Try to run the game on windows later this week to provide API Trace + "how it should be".
but i belive i am not the only one it bothers, so if someone else can feel this info by then, it will be great! \o/
System information

GPU: GTX 1050
Driver: 440.59.0
Vulkan: 1.1.119
Wine version: Proton 5.0-2
DXVK version: v1.5.4-3-gfbca62df8

Apitrace file(s)

Will provide later (from windows PC), if someone can help with that meanwhile it will be great

Log files

d3d11.log:
Wolcen_d3d11.log

I'm aware, but I'll need an apitrace to debug the problem.

Wow, since you responded so fast i'll try to catch up with IRL friend of mine who can help me get those from his windows machine.. stay tuned :P

Windows + dx11 (native) = NO BIG BALL HEAD
Windows + dxvk = NO BIG BALL HEAD
WIne + dxvk = BIG BALL HEAD
Wine + wined3d = BIG BALL HEAD

Where did you place the .dll to make it work? (Like load dxvk wolcen on windows)
i am trying to do it with my firend with no success, (not in bin, not in win_x64,not in Wolcen itslef) :\

Yes, I put dlls in win_x64 folder, and it just works. p.s. I tested on win 8.1 (lol)
Just retested right now and no visual gliches so far. So it's not dxvk but wine issue.

well thats the first directory i tried, and with set DXVK_HUD=1 in console, then launch Wolcen.exe, i dont see any indication wolcen is indeed ran by DXVK.. :
how did you verify you get DXVK backend and not native dx11?

First the d3d11.log and dxgi.log were properly filled. Then MSI Afterburner overlay show VULKAN. And the performance different between dx11 and dxvk is noticeable.

Sigh...
@doitsujin
Here you are:
https://my.pcloud.com/publink/show?code=XZO2sskZx6M8Su7Qauua2YCYTCixryyjkkpy

Thanks, will take a look later.
One thing you could try is setting dxvk.enableOpenVR = False in dxvk.conf (also set DXVK_CONFIG_FILE=/path/to/dxvk.conf). vrclient is currently causing all sorts of issues unfortunately.

And the performance difference between dx11 and dxvk is noticeable.

Got any numbers? CryEngine is known not to run very well on DXVK, but if you're on somewhat recent hardware (AMD Polaris / Nvidia Pascal or newer) then it shouldn't be more than a 20% hit.
Unless of course there's some jankiness going on where the game magically runs much better when it thinks it's on an Nvidia card (cough Crysis 3).

I didn't do a benchmark, but I was just running around in the beginning area and watched fps for a bit. On my old  GTX 960 (1080p + medium quality settings):
win + dx11 = 50-53 fps
win + dxvk = 34-39 fps
wine + dxvk = 33-35 fps (probably lower because kwin compositor is on)

Meh, that's pretty low. Might be due to 2GB VRAM though.

Setting dxvk.enableOpenVR = False doesn't help with the "afro" problem. It continue to show some VR unable to find strings.
Reporting Nvidia card doesn't help with performance. It's ~50 on Linux with DXVK and ~150 on Windows.
Intel 9900K, NVIDIA 1080 Ti here.

Do you need some Wine logs?

Has anyone tried protontricks [appid] d3dcompiler d3dcompiler_43 d3dcompiler_47? If that fixes it then it's d3dcompiler related.

yes, didn't help

Well, i am not sure how other people tested it but on -another- windows 10, ive tried throwing d3d11 dll in all directories there more or less, (yes including win_x64 where it makes most sense)
Then using sysinternals process explorer ive seen that indeed system32 one is loaded and not local one.. (but funny thing that i do see most of the loaded dlls are from win_x64 system)
Ive left windows systems more then a decade ago but i have to say this really doesnt act as expected and i would really like to see on my own how it works on windows with dxvk.. :/
Any idea if i can do something similar to linux LD_PRELOAD and force it to use my dll? (As trying to replace system32 one ends up with some guard system ?!?! :/)
(p.s, i did try gw2 with dxvk on that system and it works perfectly as expected and reacts to dxvk_hud/log)

As long as dxvks dlls (dxgi.dll, d3d11.dll, ...) are in directory of the exe, windows should prefer them over the system32 ones.

Yeah thats what i know from win 7 and below which i knew great.
But now on windows 10 it doesnt seem to be the case anymore..
And i am launching from cmd so i control the cwd..
Dlls from release x64 directory ( in wolcen/win_x64)

As long as the dxvk dlls (dxgi.dll, d3d11.dll, ...) are in directory of the exe, windows should prefer them over the system32 ones.

Actually not. Some applications prefer to use system ones using LoadLibraryEx with LOAD_LIBRARY_SEARCH_SYSTEM32 flag.

Yeah well looks like i will have to belive in others when they say they got dxvk to load on windows for this game.. i couldnt, so i cant verify if thats indeed dxvk issue or not..
Do you want to close this issue based on @dlshinobi analysis?

Sigh..., ok there is the MSI Afterburner Overlay in Wolcen:

But still I wonder what the actually problem is in wine to cause this issue. And not only that, but also there is a bug with clothes (especially with female ones).

But still I wonder what the actually problem is in wine to cause this issue. And not only that, but also there is a bug with clothes (especially with female ones).

That's exactly what I noticed as well. It is, however, not the clothes itself, but rather the character model. If you put a helmet on that hide the hair, you also hide the "afro". So the afro is related to the hair.. very likely at least. You can also see that by changing hair color.
The whole model looks untextured, with the exception of the armor of course.

Sigh..., ok there is the MSI Afterburner Overlay in Wolcen:

By the way, DXVK HUD works for me in Wolcen.

Nvidia 440
GTX 2070
DXVK 1.5.4
Me too :

Ok nice. Thanks for helping me out :)
So @doitsujin i assume we should close ticket here..
Any idea where i should open this ticket? Wine bug tracker?

Either Wine bug tracker or existing Proton GitHub issue for Wolcen. Wine bug tracker may get attention of Wine devs, or at least it's possible.


Ruby 3.4.1

This updates ruby from 3.3.6 to 3.4.1.

Closing in favor of https://github.com/bullet-train-co/bullet_train/pull/1847


Undefined behaviour on 32-bit due to m_file_size declared as std::size_t

The switch to BZ2_bzWriteClose64 in https://github.com/osmcode/libosmium/commit/54894fdbb2d70e11a5e22cf0298bc12cdec95e59 seems to cause undefined behaviour on 32-bit architectures or any where std::size_t is defined as 32-bit type, that is due to left-shift by 32 bits in
https://github.com/osmcode/libosmium/blob/54894fdbb2d70e11a5e22cf0298bc12cdec95e59/include/osmium/io/bzip2_compression.hpp#L233
It seems the switch to BZ2_bzWriteClose64 should be completed with re-declaring m_file_size as std::uint64_t instead of std::size_t.

Applies to current v2.16.0 and current master.

By the way, that undefined behaviour may lead to seemingly correct result or shift by 32-bits is the same as a shift by 0-bits but it should not be relied on.

Good catch! We have to remove the UB of course. I don't want to switch to unit64_t though, because that would mean there would be lots of changes needed elsewhere, including in client code. Reading large files on 32 bit systems will probably not work anyway.

Fixed in 1705adb8afb46baa8216fe55312b2ede2931b2e4.

The fix is not perfect, because it will not report the correct result on 32bit systems, but I can live with that.

I considered similar patch too, but I was not sure if you will accept it :-) thus I suggested the type change. I can live with the fix too. Thanks!


Use a macro to declare required functions

This seemed an interesting exercise in metaprogramming.
I wanted a list of which things would error if i didn't define them.
Vs which ones had defaults defined.
ergo this PR.

julia> xx = AbstractFBCModels.required_functions()
[1] reactions(a::AbstractFBCModels.AbstractFBCModel) @ AbstractFBCModels none:0
[2] n_reactions(a::AbstractFBCModels.AbstractFBCModel) @ AbstractFBCModels none:0
[3] metabolites(a::AbstractFBCModels.AbstractFBCModel) @ AbstractFBCModels none:0
[4] n_metabolites(a::AbstractFBCModels.AbstractFBCModel) @ AbstractFBCModels none:0
[5] genes(a::AbstractFBCModels.AbstractFBCModel) @ AbstractFBCModels none:0
[6] n_genes(a::AbstractFBCModels.AbstractFBCModel) @ AbstractFBCModels none:0
[7] stoichiometry(a::AbstractFBCModels.AbstractFBCModel) @ AbstractFBCModels none:0
[8] bounds(a::AbstractFBCModels.AbstractFBCModel) @ AbstractFBCModels none:0
[9] objective(a::AbstractFBCModels.AbstractFBCModel) @ AbstractFBCModels none:0
[10] reaction_stoichiometry(a::AbstractFBCModels.AbstractFBCModel, reaction_id::String) @ AbstractFBCModels none:0
[11] save(a::AbstractFBCModels.AbstractFBCModel, path::String) @ AbstractFBCModels none:0

:warning: Please install the  to ensure uploads and comments are reliably processed by Codecov.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (d0022b0) to head (f516db2).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #26   +/-   ##
=========================================
  Coverage   100.00%   100.00%
=========================================
  Files            6         5    -1
  Lines          277       267   -10
=========================================
- Hits           277       267   -10

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

I went back and forth on the name several times while writing this.
Since it does also include save which isn't really an accessor.

/format


refine String#capitalize

Use String#capitalize method as refinement
Unisender::Client class in a separate flie

Please correct tests.

Good job, thank you


iterator should support random access for sort interface?

iterator contains an index and a value, which provide only a Partial Order which is insufficient for sort operations


Add type checking before sending objects to server

Within Client if the user attempts to access multiple metrics with get_multiple_metrics but provides a string instead of a list of strings for runs this returns an Error 500 from the server. This should be prevented before data is sent to the server.

Closed by additional of pydantic.validate to class methods.


Bind Mouse To Window/Monitor

Description of the new feature / enhancement
Some games, such as Paradox's Stellaris, do not properly bind the mouse cursor to the game window. On systems with 2+ monitors this means that the mouse cursor will move out of the game window and onto another display based on configuration. PowerToys Mouse Utilities could add a configurable hotkey to bind the mouse cursor either to a specific window and/or monitor to help work around these issues.
Scenario when this would be used?
Playing games where the developer does not properly bind the mouse cursor, but could also be useful in cases where a second (or third) monitor is used purely for displaying status updates and the user does not want the mouse cursor to leave the primary monitor where all interactions will take place.
Supporting information
No response

Maybe for inspiration, check this feature from Synergy here.

I can say another situations this can be useful: If you are using an image editor that has a full screen function (such as Photoshop), it would be useful to be able to lock the cursor inside the window.
Additionally, it would be useful if there were a toggle, as well as a key that can be held to temporarily allow the user to move the cursor outside the window.

This feature would be great for using drawing apps on a 2-in-1 or tablet so you can keep your pen/stylus in the drawing window if you want to split the screen for multi-tasking.


M part of XYZM coordinates is being ignored?

Hi,
I'm manually constructing linestrings with XYZM coordinates (Z= always 0 for now). When I inspect the coordinates individually, the values for M are correct, but when exporting the feature to WKT or WKB, the M part seems to be omitted for some reason. Considering WKT and WKB support XYZM, this doesn't make much sense to me. Is there a way to make the eport functions include the M part?

@josbol what version of DotSpatial do you use?

I'm using 1.9.0

I just had a look at the code. 1.9 only creates XY WKTs.
2.0 is able to create XYZ WKTs but still doesn't create XYZM WKTs. As we're using the original NTS source code in 2.0 I've created issue an issue there to find out why the M support doesn't seem to work as expected.
So we'll have to wait for an answer before we can determine how we'll support XYZM WKTs in 2.0.

Thanks!

should work based on the linked NTS issue


Update/Remove issue templates

Control objective
A clear and concise description of what the control objective is and why it's important.
Remediation
The remediation action(s) to satisfy the control objective.
Categories
Proposed primary category and categories from the available list of categories.
Additional context
Add any other context about the problem here.

Already completed


Remove unsafe from new on RND

Unsafe is not required here given that all futures are required to live longer than their global peripheral instances. There are other occurrences of unsafe being used on new that should be removed. I started to do that but then went down a bit of a rabbit hole. Therefore, just confining this PR to what I'm currently exposed to.

bors r+

bors r+


SysExMessage::Buffer requires Default, limiting buffer size to 32 bytes

Hi there!
Thank you so much for all the hard work that's gone into NIH-plug and its ecosystem.
I'm just wondering about the Default requirement on the SysExMessage::Buffer type, effectively limiting the size to 32 bytes because of delightful Rust array shenanigans. I removed this bound locally: everything compiles and all of the tests still pass.
This Default doesn't seem necessary here, since the buffer is custom-created via calls to to_buffer. The code internals clearly don't rely on this bound and making the type more permissive should be strictly non-breaking. For instance, you could still call Buffer::default() on smaller buffers as before (if you're not doing something more direct like [a, b, c, d, ..]), whereas [0; N]` or similar would make larger arrays doable.
As for the motivation: for my plugin work, I need comparatively huge SysEx buffers (typically 1kB+) to collect incoming notation/articulation/arbitrary text information from the DAW, update this data and add/modify MIDI events in various ways based on the data contained therein. For debug builds I use a human-readable format but switch to a more compact binary representation for release. It's all working phenomenally well so far, especially with VST3, and I would really like to use the official repo instead of my patched version.
If there are no objections, I'd be happy to submit a pull request for this one-liner.
Thanks again,
Iain

The Default constraint is indeed no longer necessary, good catch. It was part of an older design where the equivalent of SysExMessage::to_buffer() would fill in existing slice which meant that the caller had to construct that slice first. Fixed in 727b15aa9304918f0098d6be6ac406ea444737d5. Do keep in mind that if you need to accept 1 KiB SysEx events your plugin's memory consumption will grow by a couple megabytes to be able to handle events that large.


Set es_conn_timeout in rule conf

The rule configuration currently does not inherit the base config's setting for es_conn_timeout so the Elasticsearch instance created in each run_rule call via new_elasticsearch doesn't use the timeout specified in the config.
This was causing an issue where I had set es_conn_timeout in config.yaml, used that config using the --config flag but ended up with a 10 second timeout.

Thanks. Eventually I need to but a better mechanism for getting defaults from config.yaml instead of cherry picking each individual one.


undefined method `red' when deploying

Checklist

[x] Upgrade Jets: Are you using the latest version of Jets? This allows Jets to fix issues fast. There's a jets upgrade command that makes this a simple task. There's also an Upgrading Guide: http://rubyonjets.com/docs/upgrading/
[x] Reproducibility: Are you reporting a bug others will be able to reproduce and not asking a question. If you're unsure or want to ask a question, do so on https://community.rubyonjets.com
[x] Code sample: Have you put together a code sample to reproduce the issue and make it available?  Code samples help speed up fixes dramatically. If it's an easily reproducible issue, then code samples are not needed. If you're unsure, please include a code sample.

My Environment

Software
Version

Operating System
MacOS Mojave 10.14.4

Jets
1.8.9

Ruby
2.5.3

Expected Behaviour
When running jets deploy it should properly deploy my app and give me some helpful output.
I believe it actually worked the first time I ran it on this system but all subsequent times have had the same issues. Even when generating new apps from scratch.
Current Behavior
When running jets deploy after receiving the Deploying CloudFormation stack with jets app! output I get the following stack trace:
Traceback (most recent call last):
	16: from /Users/davidbackeus/.rbenv/versions/2.5.3/bin/jets:23:in `<main>'
	15: from /Users/davidbackeus/.rbenv/versions/2.5.3/bin/jets:23:in `load'
	14: from /Users/davidbackeus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.9/exe/jets:14:in `<top (required)>'
	13: from /Users/davidbackeus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.9/lib/jets/cli.rb:5:in `start'
	12: from /Users/davidbackeus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.9/lib/jets/cli.rb:21:in `start'
	11: from /Users/davidbackeus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.9/lib/jets/commands/base.rb:27:in `perform'
	10: from /Users/davidbackeus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.9/lib/jets/commands/base.rb:38:in `dispatch'
	 9: from /Users/davidbackeus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
	 8: from /Users/davidbackeus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
	 7: from /Users/davidbackeus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
	 6: from /Users/davidbackeus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.9/lib/jets/commands/main.rb:21:in `deploy'
	 5: from /Users/davidbackeus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.9/lib/jets/commands/deploy.rb:34:in `run'
	 4: from /Users/davidbackeus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.9/lib/jets/commands/deploy.rb:81:in `ship'
	 3: from /Users/davidbackeus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.9/lib/jets/cfn/ship.rb:20:in `run'
	 2: from /Users/davidbackeus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.9/lib/jets/cfn/ship.rb:54:in `save_stack'
	 1: from /Users/davidbackeus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.9/lib/jets/cfn/ship.rb:65:in `update_stack'
/Users/davidbackeus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.9/lib/jets/cfn/ship.rb:69:in `rescue in update_stack': undefined method `red' for #<String:0x00000001130eed18> (NoMethodError)

Looking at the stack on Cloudfront it has only created the S3 bucket on the Cloudformation stack. No gateway API or lambda functions etc.
Step-by-step reproduction instructions
jets new <app-name> --database=postgresql
cd <app-name>
echo "2.5.3" > .ruby-version
jets deploy

Solution Suggestion
This should be changed to .color(:red): https://github.com/tongueroo/jets/blob/master/lib/jets/cfn/ship.rb#L69

Fixed the error in PR #230. After running jets deploy using my fixed branch I can verify that the actual deploy error reported by AWS was:
ERROR: Template format error: Unrecognized resource types: [AWS::Lambda::LayerVersion]

Possibly LayerVersion isn't supported in the eu-north-1 region. Haven't found any official documentation on the topic but there is a forum post echoing the same issue: https://forums.aws.amazon.com/thread.jspa?messageID=892152

RE: undefined method .red

Thanks for the fix!

RE: Possibly LayerVersion isn't supported in the eu-north-1 region.

Yup, some regions don't fully support Lambda yet. Another user also ran into this on the community forums: Unrecognized resource types: [AWS::Lambda::LayerVersion]
This AWS Region Table Matrix helps.

RE: It would be nice if jets would validate that the current region is supported and fail early with a nice error message instead of ending up with a half broken deploy and a cryptic error.

Think so too. Though hesitant to add a check and then when AWS adds support to a region, we'll have to maintain that table. Thinking docs would be a better approach.  Point the user to the docs as a helpful tip.  Will take PRs for this.
Anyway, thanks for the fix!

Had a look at the matrix. Not sure what to look for to determine LayerVersion support though? According to the matrix "Lambda" is supported in all regions. We're having a lab week at my company and I might be spending the whole week labbing with Jets so I might get time to improve your docs if I know what to look for :)


Apply flake8

@tsudmi , letting you know just in case that external contributors cannot merge approved pull requests by themselves:

You can merge the changes by yourself then.

@tsudmi , letting you know just in case that external contributors cannot merge approved pull requests by themselves:

You can merge the changes by yourself then.


Anthropic Vertex Support

Description
Support for Claude 3 model access via the GCP Vertex service. Similar implementation to the AnthropicBedrock provider.

I will look into adding this!

Testing out this implementation
def vertex_client_wrapper(
    project_id: Optional[str] = None,
    region: Optional[str] = None,
) -> Callable[
    [Union[Anthropic, AsyncAnthropic]], Union[AnthropicVertex, AsyncAnthropicVertex]
]:
    """Returns a client wrapper for using Anthropic models on GCP Vertex."""

    def inner_wrapper(client: Union[Anthropic, AsyncAnthropic]):
        """Returns matching `AnthropicVertex` or `AsyncAnthropicVertex` client."""
        kwargs = {"project_id": project_id, "region": region}
        if isinstance(client, Anthropic):
            client = AnthropicVertex(**kwargs)  # type: ignore
        elif isinstance(client, AsyncAnthropic):
            client = AsyncAnthropicVertex(**kwargs)  # type: ignore
        return client

    return inner_wrapper

I've confirmed the above code works w/ model claude-3-haiku@20240307.
For reference the code I used to test this was
Call
class BookRecommender(AnthropicCall):
    prompt_template = "Please recommend a fantasy book."

    call_params = AnthropicCallParams(model="claude-3-haiku@20240307")
    configuration = BaseConfig(
        client_wrappers=[
            vertex_client_wrapper(
                project_id="MY_PROJECT_ID",
                region="us-central1",
            )
        ]
    )

I also tested using AnthropicExtractor as well.
Would you like to submit the PR instead? @VVoruganti

I've confirmed the above code works w/ model claude-3-haiku@20240307.
For reference the code I used to test this was
Call
class BookRecommender(AnthropicCall):
    prompt_template = "Please recommend a fantasy book."

    call_params = AnthropicCallParams(model="claude-3-haiku@20240307")
    configuration = BaseConfig(
        client_wrappers=[
            vertex_client_wrapper(
                project_id="MY_PROJECT_ID",
                region="us-central1",
            )
        ]
    )
recommender = BookRecommender()
response = recommender.call()
print(response.content)
# > Here are a few recommendations for fantasy books:

# 1. "The Name of the Wind" by Patrick Rothfuss - This is the first book in the Kingkiller Chronicle series, which is a critically acclaimed and immersive fantasy story about a legendary wizard-like figure telling the story of his life.
...

I also tested using AnthropicExtractor as well.
Would you like to submit the PR instead? @VVoruganti

Yes! I can submit a PR with a test in the next few hours


Nvss 579 cli features

Summary

Added features:
Fake record
Json2xml
checkXml
checkJson
Xml2json
Xml2xml
Json2json
Roundtrip-ije
Roundtrip-all
Ije
Ijebuilder
Compare
Extract

Added singleordefault() to suffix to avoid error in getter

Added todo's to address issues/STU updates

Remaining Issues

Race and ethnicity getter returns empty codeabledict when nothing is present, which causes json2json and xml2xml to generate a bunch of empty race/ethnicity entries that should be “no” or not present at all
Roundtrip-ije  which includes whitespace on occasion and flips Y’s to N’s in some cases

check out roundtrip ije, there were fields that were flipping and whitespace was getting added.


As a sys-admin I want to run fixable soft_validations and fixes nomenclature in a project  [was "and user"]

The soft_validation should run in 3 steps:
1: all taxon_names
2. all taxon_name_relationships
3. all taxon_names

This should be done periodically. And every time before CoLDB export.

Isolating this to a back-ground rake task so that we can close it independently. See https://github.com/SpeciesFileGroup/taxonworks/issues/2546 for the UI.
Belongs in /lib/tasks/maintenance/soft_validation.rake
See https://github.com/SpeciesFileGroup/legumes/blob/main/tasks/legumes.rake#L400


[Misc] add option to get_distributed_init_method with "env://"

This option makes it easier to configure multi-node setup on a cluster with slurm. The following script works on my two nodes slurm system.
#!/bin/sh

HOST_NAME=$(hostname)

export MASTER_ADDR=$(scontrol show hostnames "$SLURM_JOB_NODELIST" | tail -n 1)

echo "Working on ${HOST_NAME}"

start_port=$(echo $SLURM_STEP_RESV_PORTS | sed 's/-/ /g' | awk {'print $1'})

end_port=$(echo $SLURM_STEP_RESV_PORTS | sed 's/-/ /g' | awk {'print $2'})

all_ports=$(seq $start_port $end_port)

ports_array=($all_ports)

server_port=${ports_array[0]}

torch_port=${ports_array[1]}

# Ray slurm examples https://docs.ray.io/en/latest/cluster/vms/user-guides/community/slurm.html

ray_port=6379

echo "all ports used "$server_port,$ray_port,$torch_port

if [ -z "$GPU_PER_NODE" ]

then

    GPU_PER_NODE=1

fi

if [ -z "$N_NODES" ]

then

    N_NODES=2

fi

WORLDSIZE=$(expr $GPU_PER_NODE "*" $N_NODES)

# set env variable for torch distributed

export MASTER_PORT=$torch_port

export WORLD_SIZE=$WORLDSIZE

export RANK=$SLURM_PROCID

echo "TORCH env "$MASTER_ADDR,$MASTER_PORT,$WORLD_SIZE,$RANK

# set env variable for Ray

export master_ip=$(host $MASTER_ADDR | awk '{print $4}')

echo "World size is "$WORLDSIZE

echo "slurm id ${SLURM_PROCID}"

if [[ "$MASTER_ADDR" == "$HOST_NAME" ]]

then

    HOST_IP=$HOST_NAME

    echo "Setting HOST_IP on ${HOST_NAME}"

    hostip=$(hostname -I | cut -f1 -d' ')

    echo "Serving LLM at the following address"

    echo $hostip:$server_port

    echo "Starting a Ray instance .."

    ray start --head --node-ip-address=$master_ip \

    --port=$ray_port --dashboard-host <IP_ADDRESS> --dashboard-port 8266 \

    --num-cpus $SLURM_CPUS_PER_TASK --num-gpus $GPU_PER_NODE --block &

    sleep 40

    python -m vllm.entrypoints.openai.api_server --model MODEL_PATH  --tensor-parallel-size $WORLDSIZE --dtype float16 --port $server_port

else

    sleep 10

    ray start --address "${master_ip}:${ray_port}" \

        --num-cpus $SLURM_CPUS_PER_TASK --num-gpus $GPU_PER_NODE --block &

    sleep 1d # hold the resource on worker node for ray, exiting the current flow will release the resource

fi

@HoustonJ2013 in your case, you only launch python in one node, and inside the script, it will use ray to launch tasks in the rest nodes. How does slurm come into play here?

please see https://github.com/vllm-project/vllm/pull/4014 , you should be able to use env:// now.


stan-math tests break with Intel MKL

The test mdivide_left_grad_vv and mdivide_left_grad_vd do fail for small deviations from the expected precision (1.5e-12 > 1.0e-12) when I run the Stan-Math tests with -DEIGEN_USE_MKL_ALL (which is equal to EIGEN_USE_BLAS, EIGEN_USE_LAPACKE, and EIGEN_USE_MKL_VML). If possible, can the thresholds be relaxed to 1.0E-10 (given that this very high precision is not needed)?
For more information on Eigen+MKL, see
http://beamteam.usask.ca/mark/acquaman/dd/d88/_topic_using_intel_m_k_l.html
Even using the more "strict" EIGEN_USE_BLAS, EIGEN_USE_LAPACKE_STRICT and EIGEN_USE_MKL_VML triggers this test to fail. I can only get successfull Stan-Math tests iff I use
EIGEN_USE_BLAS and EIGEN_USE_MKL_VML
which is not optimal I guess, as the LAPACK routines from MKL would not be used.  This stuff may be included in the cmdstan documentation on MKL for other users.
Best,
Sebastian
[ RUN      ] AgradRevMatrix.mdivide_left_grad_vv
test/unit/math/rev/mat/fun/mdivide_left_test.cpp:86: Failure
The difference between Cd(i,j) and g[k] is 1.5916157281026244e-12, which exceeds 1.0E-12, where
Cd(i,j) evaluates to -273.0000000000008,
g[k] evaluates to -273.00000000000239, and
1.0E-12 evaluates to 9.9999999999999998e-13.
test/unit/math/rev/mat/fun/mdivide_left_test.cpp:86: Failure
The difference between Cd(i,j) and g[k] is 1.3073986337985843e-12, which exceeds 1.0E-12, where
Cd(i,j) evaluates to<PHONE_NUMBER>0000054,
g[k] evaluates to<PHONE_NUMBER>0000185, and
1.0E-12 evaluates to 9.9999999999999998e-13.
test/unit/math/rev/mat/fun/mdivide_left_test.cpp:86: Failure
The difference between Cd(i,j) and g[k] is 1.3073986337985843e-12, which exceeds 1.0E-12, where
Cd(i,j) evaluates to -280.0000000000008,
g[k] evaluates to -280.0000000000021, and
1.0E-12 evaluates to 9.9999999999999998e-13.
test/unit/math/rev/mat/fun/mdivide_left_test.cpp:86: Failure
The difference between Cd(i,j) and g[k] is 1.1084466677857563e-12, which exceeds 1.0E-12, where
Cd(i,j) evaluates to<PHONE_NUMBER>0000054,
g[k] evaluates to<PHONE_NUMBER>0000165, and
1.0E-12 evaluates to 9.9999999999999998e-13.
test/unit/math/rev/mat/fun/mdivide_left_test.cpp:86: Failure
The difference between Cd(i,j) and g[k] is 1.0516032489249483e-12, which exceeds 1.0E-12, where
Cd(i,j) evaluates to<PHONE_NUMBER>0000054,
g[k] evaluates to<PHONE_NUMBER>0000159, and
1.0E-12 evaluates to 9.9999999999999998e-13.
[ RUN      ] AgradRevMatrix.mdivide_left_grad_vd
test/unit/math/rev/mat/fun/mdivide_left_test.cpp:178: Failure
The difference between Cd(i,j) and g[k] is 1.5916157281026244e-12, which exceeds 1.0E-12, where
Cd(i,j) evaluates to -273.0000000000008,
g[k] evaluates to -273.00000000000239, and
1.0E-12 evaluates to 9.9999999999999998e-13.
test/unit/math/rev/mat/fun/mdivide_left_test.cpp:178: Failure
The difference between Cd(i,j) and g[k] is 1.3073986337985843e-12, which exceeds 1.0E-12, where
Cd(i,j) evaluates to<PHONE_NUMBER>0000054,
g[k] evaluates to<PHONE_NUMBER>0000185, and
1.0E-12 evaluates to 9.9999999999999998e-13.
test/unit/math/rev/mat/fun/mdivide_left_test.cpp:178: Failure
The difference between Cd(i,j) and g[k] is 1.3073986337985843e-12, which exceeds 1.0E-12, where
Cd(i,j) evaluates to -280.0000000000008,
g[k] evaluates to -280.0000000000021, and
1.0E-12 evaluates to 9.9999999999999998e-13.
test/unit/math/rev/mat/fun/mdivide_left_test.cpp:178: Failure
The difference between Cd(i,j) and g[k] is 1.1084466677857563e-12, which exceeds 1.0E-12, where
Cd(i,j) evaluates to<PHONE_NUMBER>0000054,
g[k] evaluates to<PHONE_NUMBER>0000165, and
1.0E-12 evaluates to 9.9999999999999998e-13.
test/unit/math/rev/mat/fun/mdivide_left_test.cpp:178: Failure
The difference between Cd(i,j) and g[k] is 1.0800249583553523e-12, which exceeds 1.0E-12, where
Cd(i,j) evaluates to<PHONE_NUMBER>0000054,
g[k] evaluates to<PHONE_NUMBER>0000162, and
1.0E-12 evaluates to 9.9999999999999998e-13.
[  FAILED  ] AgradRevMatrix.mdivide_left_grad_vd (1 ms)

Hi!
I just decreased the precision from 1e-12 to 1e-10 (file test/unit/math/rev/mat/fun/mdivide_left_test.cpp) and now all tests in
test/unit/math/rev/mat/fun/
do pass. I will run tests on full stan-math unit tests with MKL, let's see...

... all tests with Intel 14+MKL pass in stan math once the precision in test/unit/math/rev/mat/fun/mdivide_left_test.cpp has been lowered to 1e-10.

I don't see any problem with lowering precision in the tests for Intel compatibility.   We can let Intel users make their own decision to sacrifice a couple decimal places of accuracy for speed.


not working

I am trying to scrap a site which is blocked by my isp.
my code
from proxy_requests import ProxyRequests
r = ProxyRequests(url)
r.get()

output
Unable to make proxied request... Please check the validity of https://httpbin.org/ip

Is that the actual URL that you are using?
Seems to work fine for me. It should for you too...
>>> from proxy_requests import ProxyRequests
>>> url = 'https://httpbin.org/ip'
>>> r = ProxyRequests(url)
>>> r.get()
>>> r.get_status_code()
200
>>> r.get_proxy_used()
'<IP_ADDRESS>:35609'
>>> print(r)
{
  "origin": "<IP_ADDRESS>, <IP_ADDRESS>"
}

I typically will only see that error that you have shown if the URL is not valid, or if I am not connected to the internet.

Sorry my actual URL is 'https://yify.It'


Improve UX of CLI: the commands are too long

consider near-cli:
near-cli contract call-function as-transaction [CONTRACT_ACCOUNT_ID] [FUNCTION_NAME] [FUNCTION_ARGS_TYPE] [FUNCTION_ARGS] [COMMAND]

versus
near call <contractName> <methodName> [args]

The former is utterly long.

@robert-zaremba Thanks for opening this conversation! I believe it is a feature, not a bug. The latter is utterly ambiguous and misleading and not reproducible.

Is it going to call a contract on testnet or mainnet?

Answer: it depends on the env variables

Is it going to be a "view-function" call or a "change-function" call?

Answer: it is a transaction "change-function" call. Follow-up question: guess how the non-transaction / "read-only" / "view-function" call command is named and how to even discover it

How much Gas is attached?

Answer: there is some default that is only reasonable for simple contract calls

Who is going to be the sender of this call?

Answer: there should be --masterAccount arg specified, and if you add it, the command is not slim anymore

This CLI has interactive mode and I don't expect users to type out all the commands by memory, instead, I envision them to be guided by the interactive prompts and receive a final command at the end if they want to replay the same command or tweak the command the next time. There was a similar discussion before: https://github.com/near/near-cli-rs/pull/75#discussion_r875039241

power users won't use interactive mode

I think that this works well if it's all prompts from the start, but I agree most CLI users would prefer to write out the command.
@robert-zaremba You can also create a plugin for the cli, like cargo, e.g. near-cli-your-plugin which would cover your use case. Would just need to alias near-cli to near-cli your-plugin.

I think a potential resolution for this is to have shell completions, so double-tab and you can see possible options for the next entry in the command line.

power users won't use interactive mode

The power users I know enjoy the fact that the very first time they use the CLI they were walked through the process and at the end they have a copy-pastable command that they just use via scripts or replay/edit it and they re-use later from the shell history without thinking which env variables they have set in the current session.


Viewer

is there any way of just viewing a model?
i.e. a react component that loads a model file and renders it? no editing needed

Hello @rob-at-airwalk
Sorry to have not responded earlier, I have not been keeping a close enough eye on Mike's repo
Threat Dragon has been migrated to a new github area in the OWASP github organisation:
https://github.com/OWASP/threat-dragon
In that repo there are some FAQs that may help. Can you have a look and see if any help with your issue?
If not then raise an issue (probably a feature request).


In order to compile Java 9+ source, please set compileSdkVersion to 30 or above

While compileSdkVersion is 33 and i tried all options available but still i am facing this issue.
In order to compile Java 9+ source, please set compileSdkVersion to 30 or above

Im on it. new version will be released soon

I solved this issue by making these changes in node_modules/react-native-streetview/build.gradle
minSdkVersion safeExtGet('minSdkVersion', 21)
targetSdkVersion safeExtGet('targetSdkVersion', 33)

@ShaziaNasim606 you may use v0.2.2 released today


Fix lint errors in commands.go file

File: commands.go
Line 27: warning: comment on exported type NodeDiskManagerOptions should be of the form "NodeDiskManagerOptions ..." (with optional leading article) (golint)
Line 71: warning: comment on exported function RunNodeDiskManager should be of the form "RunNodeDiskManager ..." (golint)

claimed

@nathan78906 Thanks for the PR


Integration Test - Release - 2022/01/25 03:24:17

Auto create for integration test. IssueCommandFlow

#pri1

Just type '#pri3'

#pri2

#pri3

#assign PRMergerTest1

#assign NonAllowedUser

The following users don't have valid GitHub IDs, or are not collaborators on this repo: nonalloweduser

#reassign PRMergerTest2

#reassign NonAllowedUser

The following users don't have valid GitHub IDs, or are not collaborators on this repo: nonalloweduser

#please-close

#unassign PRMergerTest1

GitHub user PRMergerTest2 has been removed from the MicrosoftDocs organization, so they were automatically removed as an assignee.

#unassign NonAllowedUser


[bug] I can't get the name of file recognized by ast-grep cli

Please read the FAQ for the bug you encountered.

[X] I have read the existing FAQ

⏯ Playground Link
N/A
💻 Code
# anything; ast-grep just doesn't look!
pkgname=ffmpeg

🙁 Actual behavior
Say I want to use ast-grep to update my PKGBUILDs (bash scripts used to create Arch Linux packages), so I run:
ast-grep run -p 'pkgname=$A' -r 'pkgname=$A-lily' -l bash PKGBUILD

ast-grep does nothing to the file.
Changing the filename to something.sh or using stdin works, but the former is tedious and the latter doesn't work with multiple files / --interactive.
🙂 Expected behavior
ast-grep examines my provided filenames and does its work.
Additional information about the issue
ast-grep 0.32.2.
I also tried various --no-ignore and --globs options. They didn't help.

Hi, thanks for using ast-grep.
ast-grep recognizes files by their extensions and determines the file type based on the extension. So PKGBUILD will not be processed as bash.
Arguably, -l bash can help the CLI to determine the language, but the argument PKGBUILD can also be a directory, where it is not clear if ast-grep should pick up other files as bash.
As a workaround, you can use a global level sgconfig.yml and languageGlobs, say, you can put it in ~/sgconfig.yml.
ruleDirs: []

languageGlobs:
  bash:
    - "PKGBUILD"

If the project does not have a ast-grep config yet. Alternatively, put languageGlobs in the sgconfig.yml local to the project.

Hi，兄贵， In the CI environment, we may not have permission to modify the contents of the home directory. Can we specify it in the command line?

Thanks for the quick response. The sgconfig.yml setting works, but why isn't it ~/.sgconfig.yml like other config files there?

-l bash arguably can help the CLI to determine the language, but the argument PKGBUILD can also be a directory, where it is not clear if ast-grep should pick up other files as bash.

ast-grep could check if it's a file or a directory. Alternatively, a flag could be added to tell ast-grep to search / edit all files given on the command line without any globbing logic?

ast-grep could check if it's a file or a directory. Alternatively, a flag could be added to tell ast-grep to search / edit all files given on the command line without any globbing logic?

The design option here is exponentially complex. Consider how complex ast-grep will be handling file reading/writing.

check -l bash
check file/directory of the argument
check lang globs
check if --all files
note scan does not have -l option
we can introduce scan's -l option but it is different from sg run's -l

If I were a user, I don't want to learn these options.

If I were a user, I don't want to learn these options.

Uhhh, me too. So I didn't think ast-grep did its own globbing at first sight. It has so many options, but misses the simplest use case...
BTW, I noticed that it has a short name sg, but it collides with the traditional linux command sg.

it collides with the traditional linux command sg.

@lilydjwg you can file a case in the pinned issue https://github.com/ast-grep/ast-grep/issues/56#issuecomment-2540495469


Issue with value 0 in $in operator

I have sample code over here on which I am trying "$in" operator to search value 0, but not getting expected result.
data = [{"a":{"b":[{"status":0}]}},{"a":{"b":[{"status":2}]}}]
Query :
objects = sift({"a.b.status":{"$in": [0, 2]}}, data);
//result = 1, expected result = 2
objects = sift({"a.b.status":{"$in": [0]}}, data);
//result = 0, expected result = 1
objects = sift({"a.b.status":{"$in": [2]}}, data);
//result = 1, expected result = 1
Could you please help?

Should be fixed with 2.x.


How to load lora weights using StableVideoDiffusionPipeline？

How to load lora weights using StableVideoDiffusionPipeline？    I using    lora_pipeline = StableVideoDiffusionPipeline.from_pretrained(
"/home/data/MODEL/stable-diffusion/stable-video-diffusion-img2vid-xt-1-1",
torch_dtype=torch.float16,
) lora_pipeline.load_lora_weights("/home/code/Motion-LoRA/LoRA_forward_onepoint/pytorch_lora_weights.safetensors"), and it turns out "AttributeError: 'StableVideoDiffusionPipeline' object has no attribute 'load_lora_weights'"?
Could you tell me how to solve it?

hmm not sure if loading as adapter is supported or not in this codebase. I haven't investigated, but off top of my head what you could do is probably merge the weights and load from that.


Some stale bot

Actual Situation
Copier is growing. Luckily not so often, some people come, open a PR, and abandon it. However, sometimes it does happen.
A big amount of open issues and PRs limits the quality of support that we can give to active and important ones.
Desired Situation
A nice bot could mark as stale and, later, close issues and PRs before they rot.
Proposed solution
Use https://github.com/marketplace/actions/close-stale-issues which is just a CI that runs every week and passes a 🧹 across the repos.

Might make sense for PRs, but I'm not a fan of bot staling valid issues.


support both CHAP methods

According to #11, not all authorization servers have upgraded to the new CHAP method.
This commit lets you choose between old and new methods. See README.md.

@zonyitoo Please check the new commit. Thanks.


PR 1 for issue #425

Show searches as inline buttons for testers additionally to show the searches as before

I cancel this PR, will do another


Added Mesh and Grid graph generator

#150 Adds both directed and undirected versions of Mesh and Grid graph generators.
This PR doesn't add test cases for Grid generator as it is unclear how the weights will be passed for the grid. As a multidimensional array or a flattened array?
@mtreinish Please let me know how to proceed with that

Pull Request Test Coverage Report for Build 352349521

52 of 125 (41.6%)  changed or added relevant lines in 1 file are covered.
No unchanged relevant lines lost coverage.
Overall coverage decreased (-2.4%) to 91.594%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

src/generators.rs
52
125
41.6%

Totals

Change from base Build 350177310:
-2.4%

Covered Lines:
2528

Relevant Lines:
2760

💛  - Coveralls

@darknight009 thanks for pushing this. Hmm, I hadn't thought about that, but I'd probably just go with a flattened array. It's consistent with the other generator methods and easier to deal with. We just need to make sure it's documented the order it's used, row major or column major.

@darknight009 just an fyi thanks to your work on this PR we were able to speed up qiskit-terra's coupling map construction in: https://github.com/Qiskit/qiskit-terra/pull/5469


Initial update for the latest version of the module

Added Known limitation section
Started updating first set of chapters (up to chapter 3.2.2.)

Hi Jasper @jaspervanderhoek ,
The changes look great and add a lot of depth and background which was missing. Thanks.
Let me know when it is ready to be reviewed properly.
I notice that there has been an accidental :s/us/UA/g - if you still have it open in an editor perhaps that would be the easiest place to undo it with a ^z rather than reverting the whole commit or reversing it by hand?
I look forward to hearing from you when this is ready to review, and let me know if there is anything I can help you with.
Mark

I notice that there has been an accidental :%s/us/UA/g - if you still have it open in an editor perhaps that would be the easiest place to undo it with a ^z rather than reverting the whole commit or reversing it by hand?

Unfortunately I made that change a while ago (I had some typos where I typed OPC US instead of UA) apparently I forgot to check the case sensitive option with the find/replace.
I think I fixed all mistakes though.

Thanks for resolving so quickly! Looks fine now.

Hi Jasper, @jaspervanderhoek
Is this ready to be reviewed and merged, or is there more work you need to do on it?

Hi @MarkvanMents , yes it's ready to be merged. There are just 2 todo's left in the document, we need a new screenshot of the module in the project explorer. And I added a todo to do an in-page link to another chapter, I don't know how you write those links for our doc pages.

@jaspervanderhoek Jasper, I still can't merge this as you still have it in draft.
Do you have a release date for this module planned, or do I need to talk to Jos/Erno?
Thanks
Mark


Button login doesn't show on firefox

Hello,
yesterday I have installed the example of Satellizer.
I use the node version for back-end.
In mozilla firefox I don't show these buttons login: facebook, google +, Instagram, linkedin, twitter.
I show correctly other buttons.
If I try to remove, for example, class btn-facebook from login html page, the button is visible (it is gray color).
What is the problem?
Best regards.

Sorry,
I have one problem on my Firefox that I solved.


Short solution needed: "Change error log format" (nginx)

Please help us write most modern and shortest code solution for this issue:
Change error log format (technology: nginx)
Fast way
Just write the code solution in the comments.
Prefered way

Create pull request with a new code file inside inbox folder.
Don't forget to use comments to make solution explained.
Link to this issue in comments of pull request.

Change access log format


Error: The current working directory doesn't exist, cannot proceed. After each machine shutdown/startup.

Environment
Windows build number: Microsoft Windows [Version 10.0.19041.329]
Your Distribution version: Ubuntu Release: 18.04
Whether the issue is on WSL 2 and/or WSL 1: WSL 2

Steps to reproduce

Shutdown Windows (Fast boot enabled)
Start Windows
Open Visual Studio Code, get an error: /mnt/c/Users/xxx/.vscode/extensions/ms-vscode-remote.remote-wsl-0.44.3/scripts/wslServer.sh: Input/output error
Open console using for example Windows Terminal, see an error: Error: The current working directory doesn't exist, cannot proceed.

Expected behavior
All should start normally, restart shouldn't be necessary.
Actual behavior

In the console I get an error:
Error: The current working directory doesn't exist, cannot proceed.
in VS Code, I get an error:
/mnt/c/Users/xxx/.vscode/extensions/ms-vscode-remote.remote-wsl-0.44.3/scripts/wslServer.sh: Input/output error

To workaround, I have to open PowerShell and do:
wsl --shutdown
wsl

Please have a look.

I have the same issue. I'm running the Debian flavor of WSL, and with the recently released Windows update 2004, I have converted it to a WSL2 instance. My hardware is based on an AMD Ryzen CPU. Everytime after I have shutdown my computer, start it up again, and open Windows Terminal to start the Debian WSL2 environment, I cannot access the /mnt/c/ and /mnt/d/ mount. This issue occurs independent of the software used: trying 'ls' in bash on these mounts is also producing Input/Output errors. wsl --shutdown in a CMD/Powershell window fixes this issue.
My bet is the mounts do not get properly remounted after a warm reboot (e.g. fastboot), or that the Debian WSL2 environment does not get the proper signals to remount these volumes. The mounts do still exist, they're just not readable/writeable.

I think this is similar to my issue :(

I experienced a similar issue today w/Ubuntu WSL2. WSL shutdown / restart has resolved the issue. I'll try to capture more debug info next time I see it.


Refactor MetaDataService.getCredential(httpClient: self.httpClient)

Once the AsyncHTTPClient has landed in master, I would really like to refactor the MetaDataService in so far that it doesn't use static methods (that involve some kind of decision making) anymore. static func getCredential(httpClient: self.httpClient) I'm looking at you.
This idea was originally proposed in #160 but left to not make the already huge changes even larger.
import Foundation
import NIO
import NIOConcurrencyHelpers
import AWSSigner

public struct ExpiringCredential: Credential {

    public let accessKeyId: String
    public let secretAccessKey: String
    public let sessionToken: String?
    public let expiration: Date?

    public init(accessKeyId: String, secretAccessKey: String, sessionToken: String? = nil, expiration: Date? = nil) {
        self.accessKeyId = accessKeyId
        self.secretAccessKey = secretAccessKey
        self.sessionToken = sessionToken ?? ProcessInfo.processInfo.environment["AWS_SESSION_TOKEN"]
        self.expiration = expiration
    }

    func nearExpiration() -> Bool {
        guard let expiration = self.expiration else {
            return false
        }

        // are we within 5 minutes of expiration?
        return Date().addingTimeInterval(5.0 * 60.0) > expiration
    }
}

/// protocol for decodable objects containing credential information
public protocol CredentialContainer: Decodable {
    var credential: ExpiringCredential { get }
}

public protocol MetaDataClient {
    associatedtype MetaData: CredentialContainer & Decodable

    func getMetaData() -> EventLoopFuture<MetaData>
}

enum MetaDataClientError: Error {
    case failedToDecode
    case couldNotGetInstanceRoleName
}

extension MetaDataClient {

    /// decode response return by metadata service
    func decodeResponse(_ bytes: ByteBuffer) throws -> MetaData {
        let decoder = JSONDecoder()
        // set JSON decoding strategy for dates
        let dateFormatter = DateFormatter()
        dateFormatter.locale = Locale(identifier: "en_US_POSIX")
        dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss'Z'"
        dateFormatter.timeZone = TimeZone(secondsFromGMT: 0)
        decoder.dateDecodingStrategy = .formatted(dateFormatter)
        // decode to associated type
        let metaData = try decoder.decode(MetaData.self, from: bytes)
        return metaData
    }
}

class MetaDataCredentialProvider<Client: MetaDataClient> {
    typealias MetaData  = Client.MetaData

    let eventLoopGroup  : EventLoopGroup
    let metaDataClient  : Client

    let lock            = NIOConcurrencyHelpers.Lock()
    var credential      : ExpiringCredential? = nil
    var credentialFuture: EventLoopFuture<Credential>? = nil

    init(eventLoopGroup: EventLoopGroup, client: Client) {
        self.eventLoopGroup = eventLoopGroup
        self.metaDataClient = client

        _ = self.refreshCredentials()
    }

    func getCredential() -> EventLoopFuture<Credential> {
        self.lock.lock()
        let cred = credential
        self.lock.unlock()

        if let cred = cred, cred.nearExpiration() == false {
            // we have credentials and those are still valid

            if self.eventLoopGroup is MultiThreadedEventLoopGroup {
              // if we are in a MultiThreadedEventLoopGroup we try to minimize hops.
              return MultiThreadedEventLoopGroup.currentEventLoop!.makeSucceededFuture(cred)
            }
            return self.eventLoopGroup.next().makeSucceededFuture(cred)
        }

        // we need to refresh the credentials
        return self.refreshCredentials()
    }

    private func refreshCredentials() -> EventLoopFuture<Credential> {
        self.lock.lock()
        defer { self.lock.unlock() }

        if let future = credentialFuture {
            // a refresh is already running
            return future
        }

        credentialFuture = self.metaDataClient.getMetaData()
            .map { (metadata) -> (Credential) in
                let credential = metadata.credential

                self.lock.lock()
                defer { self.lock.unlock() }

                self.credentialFuture = nil
                self.credential = credential

                return credential
            }

        return credentialFuture!
    }

}

struct ECSMetaDataClient: MetaDataClient {
    public typealias MetaData = ECSMetaData

    struct ECSMetaData: CredentialContainer {
        let accessKeyId: String
        let secretAccessKey: String
        let token: String
        let expiration: Date
        let roleArn: String

        public var credential: ExpiringCredential {
            return ExpiringCredential(
                accessKeyId: accessKeyId,
                secretAccessKey: secretAccessKey,
                sessionToken: token,
                expiration: expiration
            )
        }

        enum CodingKeys: String, CodingKey {
            case accessKeyId = "AccessKeyId"
            case secretAccessKey = "SecretAccessKey"
            case token = "Token"
            case expiration = "Expiration"
            case roleArn = "RoleArn"
        }
    }

    static let Host = "<IP_ADDRESS>"

    let httpClient    : AWSHTTPClient
    let endpointURL   : String

    init?(httpClient: AWSHTTPClient, host: String = ECSMetaDataClient.Host) {
        guard let relativeURL  = ProcessInfo.processInfo.environment["AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"] else {
            return nil
        }

        self.httpClient     = httpClient
        self.endpointURL    = "http://\(host)\(relativeURL)"
    }

    func getMetaData() -> EventLoopFuture<ECSMetaData> {
        return request(url: endpointURL, timeout: 2)
            .flatMapThrowing { response in
                if let body = response.body {
                    return try self.decodeResponse(body)
                }
                throw MetaDataClientError.failedToDecode
            }
    }

    private func request(url: String, timeout: TimeInterval) -> Future<AWSHTTPResponse> {
        let request = AWSHTTPRequest(url: URL(string: url)!, method: .GET, headers: [:], body: nil)
        return httpClient.execute(request: request, timeout: TimeAmount.seconds(2))
    }

}

//MARK: InstanceMetaDataServiceProvider
/// Provide AWS credentials for instances
struct InstanceMetaDataClient: MetaDataClient {
    typealias MetaData = InstanceMetaData

    struct InstanceMetaData: CredentialContainer {
        let accessKeyId: String
        let secretAccessKey: String
        let token: String
        let expiration: Date
        let code: String
        let lastUpdated: Date
        let type: String

        var credential: ExpiringCredential {
            return ExpiringCredential(
                accessKeyId: accessKeyId,
                secretAccessKey: secretAccessKey,
                sessionToken: token,
                expiration: expiration
            )
        }

        enum CodingKeys: String, CodingKey {
            case accessKeyId = "AccessKeyId"
            case secretAccessKey = "SecretAccessKey"
            case token = "Token"
            case expiration = "Expiration"
            case code = "Code"
            case lastUpdated = "LastUpdated"
            case type = "Type"
        }
    }

    static let Host = "<IP_ADDRESS>"
    static let MetadataUri = "/latest/meta-data/iam/security-credentials/"

    let httpClient    : AWSHTTPClient
    let endpointURL   : String

    init(httpClient: AWSHTTPClient, host: String = InstanceMetaDataClient.Host, uri: String = InstanceMetaDataClient.MetadataUri) {
        self.httpClient = httpClient
        self.endpointURL = "http://\(host)\(uri)"
    }

    func getMetaData() -> EventLoopFuture<InstanceMetaData> {
        return getUri()
            .flatMap { url in
                return self.request(url: url, timeout: 2)
            }
            .flatMapThrowing { response in
                if let body = response.body {
                    return try self.decodeResponse(body)
                }
                throw MetaDataClientError.failedToDecode
            }
    }

    func getUri() -> EventLoopFuture<String> {
        return request(url: self.endpointURL, timeout: 2)
            .flatMapThrowing{ response in
                switch response.status {
                case .ok:
                    if let body = response.body, let roleName = body.getString(at: body.readerIndex, length: body.readableBytes, encoding: .utf8) {
                        return "\(self.endpointURL)/\(roleName)"
                    }
                    return self.endpointURL
                default:
                    throw MetaDataClientError.couldNotGetInstanceRoleName
                }
        }
    }

    private func request(url: String, timeout: TimeInterval) -> Future<AWSHTTPResponse> {
        let request = AWSHTTPRequest(url: URL(string: url)!, method: .GET, headers: [:], body: nil)
        return httpClient.execute(request: request, timeout: TimeAmount.seconds(2))
    }
}

@fabianfett I was thinking it would be nice to have custom credential provider classes. Do you think this will be possible once you have finished this work. I would like to add a credential provider class that gets the credentials from Cognito Identity.

@adam-fowler yes for sure!


build: make the muslc library statically linked

Description
Made the muslc library statically linked so that the build performed with the command make build-alpine can be executed also on environment that don't have the muslc lib.

Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...

[ ] included the correct type prefix in the PR title
[ ] added ! to the type prefix if API or client breaking change
[ ] targeted the correct branch (see PR Targeting)
[ ] provided a link to the relevant issue or specification
[ ] followed the guidelines for building modules
[ ] included the necessary unit and integration tests
[ ] added a changelog entry to CHANGELOG.md
[ ] included comments for documenting Go code
[ ] updated the relevant documentation or specification
[ ] reviewed "Files changed" and left comments if necessary
[ ] confirmed all CI checks have passed

Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...

[x] confirmed the correct type prefix in the PR title
[ ] confirmed ! in the type prefix if API or client breaking change
[ ] confirmed all author checklist items have been addressed
[ ] reviewed state machine logic
[ ] reviewed API design and naming
[ ] reviewed documentation is accurate
[ ] reviewed tests and test coverage
[x] manually tested (if applicable)

@RiccardoM @manu0466
build/desmos: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=ac58f8a7220ebd70d44f11788290819bdd5ef5f3, for GNU/Linux 3.2.0, stripped

It does not work on my instance, it shows dynamically linked after running make build. My environment is WSL ubuntu.
BTW, make build-alpine with docker is failed on my instance, the error log is:
Step 8/15 : RUN LEDGER_ENABLED=false BUILD_TAGS=muslc GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true LINK_STATICALLY=true make build
 ---> Running in 3619d11db887
make: git: Operation not permitted
make: /bin/sh: Operation not permitted
make: /bin/sh: Operation not permitted
make: git: Operation not permitted
make: which: Operation not permitted
make: uname: Operation not permitted
make: /bin/sh: Operation not permitted
Makefile:39: *** gcc not installed for ledger support, please install or set LEDGER_ENABLED=false.  Stop.

It seems wrong on the command of  RUN LEDGER_ENABLED=false BUILD_TAGS=muslc GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true since it has two LEDGER_ENABLED args, one is false and the other one is false.

@manu0466 Could you please answer @dadamu doubts about the double LEDGER_ENABLED flag and whether it makes sense on statically linking things also when running make build?


include builds for linux 4.18 and 4.19

It's me again, trying to keep travis up to date

So, finally its there :)
evdi repository has been updated with quite some number of changes.
We are shifting towards 'atomic modeset', which means we are dropping
support for kernels older than 4.2.
With this change we did bump-up the evdi/libevdi versions, so for compatibility
please install new DisplayLinkManager, which can be downloaded from here:
https://www.displaylink.com/downloads/ubuntu
Hope you will like it ;)
(I will just copy&paste this message to wherever it fits ;p)
Will close the PR. Thanks!


Application crash - closes automatically when the appropriate steps are taken

Steps to reproduce:

Go to Select Field
Select any value from the list
Tap the back arrow in the upper left corner or the Android navigation back button
The application closes itself.
I expect to go back to the previous activity (main application activity) as in other cases.

Android 11, Xiaomi Mi 9, version of application 0.24.0

Thx. Reproduced. I'll take a look.

It was "just" a catalog issue. Fixed :)

That's great! :)


Implement InternalInvokeFunction

Codecov Report

Merging #120 (987bf0c) into main (0873847) will decrease coverage by 2.90%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main     #120      +/-   ##
==========================================
- Coverage   68.53%   65.64%   -2.90%
==========================================
  Files          32       35       +3
  Lines        1815     1895      +80
==========================================
  Hits         1244     1244
- Misses        571      651      +80

Impacted Files
Coverage Δ

src/business_logic/execution/objects.rs
63.87% <0.00%> (-1.27%)
:arrow_down:

...ic/transaction/objects/internal_invoke_function.rs
0.00% <0.00%> (ø)

src/definitions/constants.rs
0.00% <0.00%> (ø)

src/definitions/general_config.rs
90.90% <ø> (ø)

src/public/abi.rs
0.00% <0.00%> (ø)

src/utils.rs
46.51% <0.00%> (-0.55%)
:arrow_down:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more


spaces in file path corrupt location

i uploaded the following file from my windows file system:
/a/src/web/viewer/git/workflow-curl-view.and.data.api/ $ ./viewerAPI upload "/v/C/Program Files/Autodesk/Revit 2016/Samples/rst_advanced_sample_project.rvt"
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
100 11.2M  100   499  100 11.2M      3  82150  0:02:46  0:02:23  0:00:23 21352
{
"bucket-key": "comphound-bucket",
"objects": [
{
"content-type": "application/octet-stream",
"id": "urn:adsk.objects:os.object:comphound-bucket/Program+Revit+rst_advanced_sample_project.rvt",
"key": "Program+Revit+rst_advanced_sample_project.rvt",
"location": "https://developer.api.autodesk.com/oss/v1/buckets/comphound-bucket/objects/Program+Revit+rst_advanced_sample_project.rvt",
"sha-1": "8b7e00fbed8f80467b6a54b37f7fdcace2044236",
"size": 11792384
}
]
}
ID: urn:adsk.objects:os.object:comphound-bucket/Program+Revit+rst_advanced_sample_project.rvt
Location: https://developer.api.autodesk.com/oss/v1/buckets/comphound-bucket/objects/Program+Revit+rst_advanced_sample_project.rvt
look at the resulting location: it includes the first word of some intermediate folder names!
when i try to register, it is not obviously found:
/a/src/web/viewer/git/workflow-curl-view.and.data.api/ $ ./viewerAPI register rst_advanced_sample_project.rvt
cat: /Users/jta/a/src/web/viewer/git/workflow-curl-view.and.data.api/data/comphound-bucket.rst_advanced_sample_project.rvt.json: No such file or directory
Traceback (most recent call last):
File "", line 1, in
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/init.py", line 290, in load
**kw)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/init.py", line 338, in loads
return _default_decoder.decode(s)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
100    53  100    43  100    10     45     10  0:00:01 --:--:--  0:00:01   102
Registration submission failed!
HTTP/1.1 400 Bad Request Access-Control-Allow-Credentials: true Access-Control-Allow-Origin: * Content-Type: application/json; charset=utf-8 Date: Thu, 01 Oct 2015 15:19:56 GMT Server: Apigee Router x-ads-app-identifier: platform-viewing-2<IP_ADDRESS>3.c60682a-production x-ads-duration: 0 ms x-ads-error-id:  x-ads-exception-id: 19fed11e-50dd-454d-a1f9-309e62e700e4 x-ads-startup-time: Thu Oct 01 03:07:15 UTC 2015 x-ads-troubleshooting: The request is invalid. Content-Length: 43 Connection: keep-alive  {"diagnostic":"'urn' parameter is invalid"}

Hi Jeremy,
I tried with  ./viewerAPI upload "/c/temp/AREA   Autodesk University_files/Au Test.obj" with no problem, let me know when you can share your screen to debug together

hi cyrille, may the problem be caused by the fact that the folder containing the sample is on the virtual Windows C: drive generated by parallels?

Hi Jeremy,
I doubt, the code simply reads the bytes to upload, and the file seems to have uploaded properly. And the path given which cause the problem, is a string you entered manually, with forward slash. So everything looks ok, but it is not :( I tried here and it is working. If it happens again, let me know and will debug together - there should be a good reason, but I am clueless for now :S