Use caddy file-server --browse for backend-mode=web

Hi team,
Just a thought! I was playing with --backend-mode=web, and was wondering if there'd be any interest in using that as kind of a wrapper for caddy file-server --browse which has a nicely-formatted file browser (with image previews in grid mode). You can see screenshots of the file browser here:
https://github.com/caddyserver/caddy/pull/5427
The file browser appears whenever there isn't an index.html file. Basically it's a production-ready file server but with a really nice file listing when an index is missing.

Absolutely. That seems like pretty low-hanging fruit!
I may end up with a few questions about the best way to "pre-configure" an embedded Caddy when we use it for things like --backend-mode web. I believe the right approach might be to generate a JSON configuration structure and pass it to caddy.Run?
But if theres' a better way that I should be thinking about this, let me know!

Yep, that's the basic idea. Here's how we do it for the caddy file-server command: https://github.com/caddyserver/caddy/blob/master/modules/caddyhttp/fileserver/command.go
You'll notice we skip the JSON part and go directly to building the struct.

Makes perfect sense! I had assumed there would be a way to go directly to structs skipping the JSON, but I hadn't dug enough for a good example yet... so that's very helpful.
I'll probably work on getting this slotted into the next zrok release also. Like I said, seems like pretty low-hanging fruit.
One of the remaining issues for a TUI-based Caddy integration is still capturing the logging from Caddy. We're using logrus for all of our logging, and I just basically change the destination of the logrus output so that I can capture it and display it in the TUI. I haven't looked deeply into Caddy's logging yet... is there a way I could capture Caddy's logging output to handle it differently in the TUI?

Yeah; we use zap -- and we expose a way to change the output of our logs in Caddy config. You will want to set a writer for the log called default: https://caddyserver.com/docs/json/logging/logs/writer/

Perfect! I think that's all the silly questions I have for the moment! You just saved me a bunch of time at least knowing that the things I'm trying to do are possible and linking me to an example. Thank you!
👍
p.s. It's on my roadmap to look at other logging frameworks... but I built a custom appender for logrus that captures the function name from the runtime (not super fast, I know... but we try to avoid logging in performance-critical sections). Having the function name in the logging output in a nice way makes log comprehension a lot easier. I just need to take a look at some of the newer frameworks and see if there's a reasonable way to approximate the same thing.

Sounds good!
I don't think there's necessarily anything wrong with logrus :man_shrugging: We use zap for its zero-allocation benefits, so we can still log in hot paths. There's probably a way to do what you're asking (Go has functions for getting the calling function name you could add to the log yourself, even.)
Quick off-topic question while we're here, if that's OK... the [blog post] has these diagrams in it:

I understand a central server is needed to establish trust between the two nodes so they can start communicating; does the second diagram imply that the data has to flow through that central node as well, or is it true P2P? (If it has to flow through the central node, how do you manage all that bandwidth of many users?)
Question 2: If I want to run my own OpenZiti network, would that be this command here?

I'd bet there's a way to capture the logging stacks in newer, potentially more efficient logging frameworks like zap. I'm just due for a survey of the logging landscape at some point. logrus has been pretty good to us, though.
Yes, OpenZiti exists as a mesh network. The OpenZiti SDK clients make an "edge connection" to a router on that mesh, then the mesh is responsible for using its own routing methods to determine the best path across the mesh (using various smart routing options and self-healing options) to another SDK client. So your connection does traverse networks and compute resources that make up the deployment. We're not doing STUN/TURN style rendezvous, and then allowing traffic to transit outside of OpenZiti.
In reality it's not all that different than horizontally scaling anything else... You can configure and design traffic paths that work whatever way makes sense, and then add resources where they're necessary. The big, fast links still go across the big fast parts of the internet, so it's not actually that much additional overhead in practice. We think of the internet and LAN segments and such as "underlay" and the OpenZiti mesh and clients as the "overlay". OpenZiti supports massive amounts of mesh network infrastructure.
Future changes to OpenZiti will see things like multi-tenancy, so that multiple control planes can share a single mesh... allowing for economies of scale. Really big deployments with lots of compute and bandwtdth can be shared be a lot of network control planes.
The bulk of OpenZiti ships as a single executable. Our "router", "controller", "tunnelers", and a lot of administration tooling are all bound into a big cobra CLI namespace. That's just the root of that cobra structure. If you download a copy of the OpenZiti binary you can take a look at the whole CLI tree. There's also a hand OpenZiti quickstart that you can use to explore the underlying OpenZiti network:
https://openziti.io/docs/learn/quickstarts/
The OpenZiti quickstart is used by the zrok self-hosting guide to provide an OpenZiti network for a local zrok deployment:
https://docs.zrok.io/docs/guides/self-hosting/self_hosting_guide/
Glad you got something working! Assuming you're talking about the zrok SDK examples?
Anything I can help with or answer, don't hesitate to ask!

Some early progress on embedded Caddy for --backend-mode web:

@mholt What's the best way for me to update the template used to render these pages so that I can also include a zrok logo? Was thinking about something along the lines of "Powered by zrok Served with Caddy`...

Also have the TUI integration working:

That's looking good! :100:

So your connection does traverse networks and compute resources that make up the deployment.

Gotcha, I think -- so if I wanted to have kind of a self-hosted, independent network of connected clients, I would host a router and then all the traffic would flow through that router?

Thanks! It'll definitely be going out in the next zrok release that includes the Caddy integration. I think it's a really nice improvement in the --backend-mode web functionality.

Gotcha, I think -- so if I wanted to have kind of a self-hosted, independent network of connected clients, I would host a router and then all the traffic would flow through that router?

Yes... you could host a single router along with a single controller. And those would likely only consume very minimal resources. We have lots of people who run that kind of configuration on things like Rasberry Pis.

You can use a custom browse template by specifying template_file: https://caddyserver.com/docs/modules/http.handlers.file_server#browse/template_file
I'd recommend just getting the source code from ours: https://github.com/caddyserver/caddy/blob/master/modules/caddyhttp/fileserver/browse.html -- and then modify it to your liking. (Of course, we do update ours occasionally. So you might want to merge in patches here and there.)

Got it! I'll knock that out next. Then I just need to capture the logging and it's basically done.

Thanks! It'll definitely be going out in the next zrok release that includes the Caddy integration. I think it's a really nice improvement in the --backend-mode web functionality.

Hurray! I think so too :sweat_smile:

Yes... you could host a single router along with a single controller. And those would likely only consume very minimal resources. We have lots of people who run that kind of configuration on things like Rasberry Pis.
Cool, alright. I'm not too worried about hardware resources so much as paying for excess data transfer through a web hosting provider. DigitalOcean has hard caps on bandwidth (before a pricey 1 cent per GB), but I think services like Scaleway limit speed instead of size. Ramnode also hard-caps bandwidth but has a more affordable .4 cents per GB after that. Anyway, just brainstorming. Thanks!

I'm not sure that there's going to be a way for us to use our own embedded browse.html:
	if fsrv.Browse.TemplateFile != "" {
		tpl = tplCtx.NewTemplate(path.Base(fsrv.Browse.TemplateFile))
		tpl, err = tpl.ParseFiles(fsrv.Browse.TemplateFile)
		if err != nil {
			return nil, fmt.Errorf("parsing browse template file: %v", err)
		}

By default Caddy is bootstrapping a //go:embed-ed tempalte using tpl.Parse:
		tpl = tplCtx.NewTemplate("default_listing")
		tpl, err = tpl.Parse(defaultBrowseTemplate)
		if err != nil {
			return nil, fmt.Errorf("parsing default browse template: %v", err)
		}

If we were referencing an external file, the TemplateFile config would work, but I don't think there's a way to provide a string path to the go runtime that will reference an embedded file.

Oh, are you trying to embed a custom template into the binary? Hmm :thinking: I'm not sure we've had that request before.

Exactly. We only ship the single binary to end users.

Ah... well, for now my suggestion would be to change the browse.html file and compile caddy with that.
I wonder if we made it possible to set the template as a struct field directly -- like as a string, that could probably work?
Still, huge yikes for such a big string in your JSON (you won't see the JSON, but other users will be able to do this, which :man_facepalming: is not the most elegant IMO).
I will think on this but if you have any other ideas, let me know!

Or what if there was just a string you could set in the JSON/config that simply added a line to the footer next to "Served with Caddy" -- I've seen a couple people change the whole template to do just this, actually. Maybe that's all we need?

I wonder if we made it possible to set the template as a struct field directly -- like as a string, that could probably work?

That would honestly be the best possible option. We can just //go:embed our own template and then pass it to Caddy. It would really only be useful to people who want to compile their own Caddy builds and override the default template, but that would for sure work for us.

@michaelquigley How would you feel about my follow-up suggestion:

what if there was just a string you could set in the JSON/config that simply added a line to the footer next to "Served with Caddy"

So you could do, maybe this in your config:
"footer": "Powered by zrok"

and it would appear next to "Served with Caddy"
Would that work?
Embedding the whole thing as a string is a little unwieldy for the reasons I mentioned, so it's not my top priority right now, but if you still want to do that and do it sooner rather than later, let's get NetFoundry set up on a Business sponsorship and I will be able to tackle it right away :+1:

@michaelquigley How would you feel about my follow-up suggestion:
Would that work?

No, not really. I suspect that we're probably also going to want to potentially end up making changes to that template for other (functionality-related) reasons as we move forward. And we're also going to want to put our SVG graphic in there, also.
Being able to //go:embed our own template is the solution that makes the most sense.

Embedding the whole thing as a string is a little unwieldy for the reasons I mentioned, so it's not my top priority right now, but if you still want to do that and do it sooner rather than later, let's get NetFoundry set up on a Business sponsorship and I will be able to tackle it right away 👍

I don't really want to expose this as a JSON configuration setting... that doesn't seem like the right approach. I just want to change the default embedded template in the binary.
Business sponsorhips are something we can look into in the medium-term, but it's not likely to happen in the short term. We're just barely establishing a foothold for Caddy in zrok at this point.
We may just have to maintain a private fork of Caddy in the short term to make the changes we need. That's not ideal and I would prefer not to do that... but all we need to do is provide a function in the fileserver package, like this:
//go:embed browse.html
var defaultBrowseTemplate string

func SetDefaultBrowseTemplate(template string) {
   defaultBrowseTemplate = template
}

And we should be good to go. That would allow us to call fileserver.SetDefaultBrowseTemplate before instantiating the fileserver components, and we're off to the races.

Even simpler would be to change:
var defaultBrowseTemplate strng

To:
var DefaultBrowseTemplate string

Ah ok. I can probably do that. Let me look into that tomorrow 👍

Awesome! Thank you so much!
Hoping to get v0.4.6 out early next week with the Caddy integration. Working on a demonstration video this week.


Build provider code for openSUSE zypper?

On openSUSE Leap 42.1, which uses rpm based Zypper package manager, Julia requests "using PyPlot" result in a curious but harmless bug which forces the Yast window to pop up requesting root access. Denial at this window allows the process to continue and PyPlot appears to work ok.
It is hard to find out where this call is coming from. In an effort to straighten things out some provider code for Zypper has been added to BinDeps (https://github.com/JuliaLang/BinDeps.jl/issues/188).
Since Cairo in the deps code has some provision for providers, now that BinDeps allows calls to zypper, is the Cairo community willing to entertain changes to the build dependencies which may use this provider rather than force a build from source?

Makes sense to me. This package is sort of community-maintained at the moment.
Would have to tag a version of BinDeps that includes Cairo support first, then change the BinDeps version requirement in REQUIRE accordingly. For now you can try local testing with Pkg.checkout("BinDeps") to see if you can get the right deps/build.jl setup.

@tkelman You mean "a version of BinDeps that includes zypper support", right?

Yes, thank you.

Well, I guess my proposed changes in #129 were not welcomed by the Travis tester. I will look at the output, but feedback would be nice :)

Fixed in #129.


arrow-cpp: 2.0.0 -> 3.0.0

Motivation for this change
https://arrow.apache.org/release/3.0.0.html
Things done

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

[x] NixOS
[ ] macOS
[ ] other Linux distributions

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

Output of nixpkgs-review:
2 packages failed to build:
python37Packages.intake python38Packages.intake

12 packages built:
arrow-cpp python37Packages.datasets python37Packages.google-cloud-bigquery \
python37Packages.ibis-framework python37Packages.pyarrow python37Packages.tokenizers \
python37Packages.transformers python38Packages.datasets python38Packages.google-cloud-bigquery \
python38Packages.pyarrow python38Packages.tokenizers python38Packages.transformers

Output of nixpkgs-review:
2 packages failed to build:
python37Packages.intake python38Packages.intake

12 packages built:
arrow-cpp python37Packages.datasets python37Packages.google-cloud-bigquery \
python37Packages.ibis-framework python37Packages.pyarrow python37Packages.tokenizers \
python37Packages.transformers python38Packages.datasets python38Packages.google-cloud-bigquery \
python38Packages.pyarrow python38Packages.tokenizers python38Packages.transformers

python3Packages.intake fails to build on the parent commit as well.

python3Packages.intake fails to build on the parent commit as well.

checking on aarch64 error though

checking on aarch64 error though

This is a semi-automatic executed nixpkgs-review which is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.
Result of nixpkgs-review pr 110895 run on x86_64-darwin 1

4 packages failed to build and are new build failures:

python37Packages.intake: log https://termbin.com/fdmm
python38Packages.intake: log https://termbin.com/brhv
python38Packages.tokenizers: log https://termbin.com/z16t
python38Packages.transformers: log was empty

10 packages built:

arrow-cpp
python37Packages.datasets
python37Packages.google-cloud-bigquery
python37Packages.ibis-framework
python37Packages.pyarrow
python37Packages.tokenizers
python37Packages.transformers
python38Packages.datasets
python38Packages.google-cloud-bigquery
python38Packages.pyarrow

This is a semi-automatic executed nixpkgs-review which is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.
Result of nixpkgs-review pr 110895 run on x86_64-darwin 1

4 packages failed to build and are new build failures:

python37Packages.intake: log https://termbin.com/fdmm
python38Packages.intake: log https://termbin.com/brhv
python38Packages.tokenizers: log https://termbin.com/z16t
python38Packages.transformers: log was empty

10 packages built:

arrow-cpp
python37Packages.datasets
python37Packages.google-cloud-bigquery
python37Packages.ibis-framework
python37Packages.pyarrow
python37Packages.tokenizers
python37Packages.transformers
python38Packages.datasets
python38Packages.google-cloud-bigquery
python38Packages.pyarrow

This is a semi-automatic executed nixpkgs-review which is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.
Result of nixpkgs-review pr 110895 run on x86_64-linux 1

2 packages failed to build and are new build failures:

python37Packages.intake: log https://termbin.com/fnu1
python38Packages.intake: log https://termbin.com/bxt3

12 packages built:

arrow-cpp
python37Packages.datasets
python37Packages.google-cloud-bigquery
python37Packages.ibis-framework
python37Packages.pyarrow
python37Packages.tokenizers
python37Packages.transformers
python38Packages.datasets
python38Packages.google-cloud-bigquery
python38Packages.pyarrow
python38Packages.tokenizers
python38Packages.transformers

This is a semi-automatic executed nixpkgs-review which is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.
Result of nixpkgs-review pr 110895 run on x86_64-linux 1

2 packages failed to build and are new build failures:

python37Packages.intake: log https://termbin.com/fnu1
python38Packages.intake: log https://termbin.com/bxt3

12 packages built:

arrow-cpp
python37Packages.datasets
python37Packages.google-cloud-bigquery
python37Packages.ibis-framework
python37Packages.pyarrow
python37Packages.tokenizers
python37Packages.transformers
python38Packages.datasets
python38Packages.google-cloud-bigquery
python38Packages.pyarrow
python38Packages.tokenizers
python38Packages.transformers

it does seem to be a regression on aarch64

it does seem to be a regression on aarch64

@GrahamcOfBorg build pkgsi686Linux.arrow-cpp

@GrahamcOfBorg build pkgsi686Linux.arrow-cpp

Disabled the specific tests for now.
Reported the aarch64 test failures upstream: https://issues.apache.org/jira/browse/ARROW-11398

Disabled the specific tests for now.
Reported the aarch64 test failures upstream: https://issues.apache.org/jira/browse/ARROW-11398

This is a semi-automatic executed nixpkgs-review which is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.
Result of nixpkgs-review pr 110895 run on x86_64-darwin 1

4 packages failed to build and are new build failures:

python37Packages.intake: log https://termbin.com/yy2zp
python38Packages.intake: log https://termbin.com/4cjy
python38Packages.tokenizers: log https://termbin.com/pxel
python38Packages.transformers: log was empty

10 packages built:

arrow-cpp (parquet-cpp)
python37Packages.datasets
python37Packages.google-cloud-bigquery
python37Packages.ibis-framework
python37Packages.pyarrow
python37Packages.tokenizers
python37Packages.transformers
python38Packages.datasets
python38Packages.google-cloud-bigquery
python38Packages.pyarrow

This is a semi-automatic executed nixpkgs-review which is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.
Result of nixpkgs-review pr 110895 run on x86_64-darwin 1

4 packages failed to build and are new build failures:

python37Packages.intake: log https://termbin.com/yy2zp
python38Packages.intake: log https://termbin.com/4cjy
python38Packages.tokenizers: log https://termbin.com/pxel
python38Packages.transformers: log was empty

10 packages built:

arrow-cpp (parquet-cpp)
python37Packages.datasets
python37Packages.google-cloud-bigquery
python37Packages.ibis-framework
python37Packages.pyarrow
python37Packages.tokenizers
python37Packages.transformers
python38Packages.datasets
python38Packages.google-cloud-bigquery
python38Packages.pyarrow

This is a semi-automatic executed nixpkgs-review which is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.
Result of nixpkgs-review pr 110895 run on x86_64-linux 1

2 packages failed to build and are new build failures:

python37Packages.intake: log https://termbin.com/5haf
python38Packages.intake: log https://termbin.com/h3xa

12 packages built:

arrow-cpp (parquet-cpp)
python37Packages.datasets
python37Packages.google-cloud-bigquery
python37Packages.ibis-framework
python37Packages.pyarrow
python37Packages.tokenizers
python37Packages.transformers
python38Packages.datasets
python38Packages.google-cloud-bigquery
python38Packages.pyarrow
python38Packages.tokenizers
python38Packages.transformers

This is a semi-automatic executed nixpkgs-review which is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.
Result of nixpkgs-review pr 110895 run on x86_64-linux 1

2 packages failed to build and are new build failures:

python37Packages.intake: log https://termbin.com/5haf
python38Packages.intake: log https://termbin.com/h3xa

12 packages built:

arrow-cpp (parquet-cpp)
python37Packages.datasets
python37Packages.google-cloud-bigquery
python37Packages.ibis-framework
python37Packages.pyarrow
python37Packages.tokenizers
python37Packages.transformers
python38Packages.datasets
python38Packages.google-cloud-bigquery
python38Packages.pyarrow
python38Packages.tokenizers
python38Packages.transformers


AD-HOC feat (Configuration): Support expressing an OSQuery secret

When registering OSQuery with a central server the server requires
either a shared secret to be expressed, or mutual TLS authentication.
This commit implements one such mechanism for managing this identity
verification.
== Design Notes ==
=== File over Environment ===
It's possible to express the secret both as an environment variable,
and as a file. The most common mechanisms for supplying environment
variables the author has used are:

/etc/environment
systemd extension

However, neither suits in this case. The playbook will be run against
non-systemd hosts, and /etc/environment is inherited by all processes.
Accordingly, a file seemed the best mechanism to express the secret in a
compatible way. Additionally, it appears to be used in the kolide
tests against OSQuery anyway.

LGTM. Thanks @andrewhowdencom !
My only concern is at this point, it's more reflecting documentation options. There are no unit/functional tests for fleet manager options. might add them here or in kolide/zentral role in the future.

Thanks!!
On Sat., 7 Apr. 2018, 1:51 pm Julien<EMAIL_ADDRESS>wrote:

Merged #5 https://github.com/juju4/ansible-osquery/pull/5.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/juju4/ansible-osquery/pull/5#event-1562162463, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AGaMI-yC76X92v7vM-XB-MitTZ7xw6kyks5tmKhSgaJpZM4TGhG2
.

--
Andrew Howden
Careful, well crafted web development.
W: https://andrewhowden.com/
PGP: https://pgp.andrewhowden.com (79BAC08A6ED1FF1EABE350A7587D3B3A961D2D2D)


Why do default https URLs returned from STAC not work?

I noticed that in the "Use GeoPandas to view footprints" section of this notebook the alternate S3 URLs are used instead of the default. When using the default URLs to load assets into Xarray DataArrays, and subsequently trying to access the values of the actual Numpy array, I receive a RasterIO error claiming that the URL is "not a supported file format". The URL the traceback gives is pre-pended with a "/vsis-3/" folder that isn't part of the original default URL (something I suspect that GDAL is doing in the background??).
Can someone please help me understand why the default URLs returned from STAC don't work like the S3 URLs, and what is going on with the "/vsis-3/" directory that's magically pre-pended to the default URL when calling the Numpy array loaded from the STAC?

@amsnyder  - No, even if I open up an AWS session, it won't open the url.

Can you send me an example of the s3 url that is not opening? I just tried the first one in the table from the gist you linked and it opened for me - but maybe I am not grabbing the correct url


RE8 Shadow Of Rose

The game crashes in VR mode, at the starting sequences, and other than that, it also forces 3rd mode on the sequence, even tho i turned it off.

Not crashing for me, but unplayable due to forced third person cam.

Also... from the wiki:
If you are crashing, or are having a technical problem then upload these files from your game folder:
re2_framework_log.txt - The WHOLE LOG, not snippets of it.
reframework_crash.dmp if you are crashing

Created my own issue before I saw this. Do you guys know if shadow of rose will be supported?

@praydog news?

@praydog any comments on this please? Thanks

Not working on it at the moment.

Not working on it at the moment.

Would be so awesome of you if you could take a look. Probably quite a few of us that would love to revisit RE8 in VR :)

News about this? other than the universal ue4ss?

It's fine in 3rd person with a gamepad, but is there any way to use headset-based aiming with it?


Specify uniqueItems for settings

https://code.visualstudio.com/updates/v1_39#_validation-for-uniqueitems-in-the-settings-editor

Not sure if we have any settings that would use this, though.


ktor 2.0

Hello, now Space SDK does not support ktor 2.0, an example exception is:
java.lang.NoClassDefFoundError: io/ktor/client/features/HttpClientFeature

Do you have plans to migrate in the nearest future? Thanks.

Hi! Not in the nearest future, but soon after Ktor 2.0 is out of EAP.


plot(x)

I forget if we decided to ignore this or what. Anyway, in base R:
plot(1:10)

Whereas:
gs <- gsplot() %>%
     points(1:10)
gs

Warning message:
In is.na(data.var) : is.na() applied to non-(list or vector) of type 'NULL'

another tricky one. points (and plot) call xy.coords internally, which turns x=5:7 and y=NULL into x=1:3 and y=5:7. We would need to have that happen, then grab the coords for our limit calculations. I think we should do that (or something simpler if possible), but I looked into it briefly and didn't see a very clean way to do it.


Detect unsafe fn main() { ... }

Currently the playground doesn't detect this main function:
unsafe fn main() {}

Never mind, this doesn't actually compile.

Since the playground is relatively dumb (using regex), you can trick it by adding a newline
unsafe
fn main() {}

You can also force it to run when it's misdetected:


how to reset/refresh the modal

how to reset/refresh the modal before/after closing the modal??

@Prasadu112 do you need to 'restore' the content?  if so, then, show us how it is your modal .

Dear @Prasadu112,
Since this is a usage related questions, I suggest you ask it in our Gitter channel or Discord Server.
Also, kindly fork this jsFiddle to present your test-case.


Add junit properties to display parameterized test names

In many parameterized tests, the display name is broken. Example - testMetadataFetch appears as [1] true, [2] false link
This is because the constant in @ParameterizedTest
String DEFAULT_DISPLAY_NAME = "[{index}] {argumentsWithNames}";

This PR adds a new junit-platform.properties which overrides to add a {displayName} which shows the the display name of the method
For existing tests which override the name, should work as is. The precedence rules are explained

name attribute in @ParameterizedTest, if present
value of the junit.jupiter.params.displayname.default configuration parameter, if present
DEFAULT_DISPLAY_NAME constant defined in @ParameterizedTest

Source: https://junit.org/junit5/docs/current/user-guide/#writing-tests-parameterized-tests-display-names
Sample test run output
Before: [1] true link
After: testMetadataExpiry(boolean).false link
Committer Checklist (excluded from commit message)

[ ] Verify design and implementation
[ ] Verify test coverage and CI build status
[ ] Verify documentation (including upgrade notes)

This is a great change but note that we don't use JUnit5 for all tests. Hence we need to ensure that this change doesn't impact Junit4 tests. Ref:
https://github.com/apache/kafka/blob/9911fab1a1a95b7783c21fef75f043ea42fea790/build.gradle#L470
Also, can we do it for all tests in Kafka instead of just for the clients module?

@divijvaidya added in modules, where ParameterizedTest is currently used as part of https://github.com/apache/kafka/pull/14687/commits/777d14d3aba7c59070916497388d82adeb19405a. We could also just do it in all modules as well, let me know if that's useful

Thanks for the context on JUnit4, once the build completes. Looks like streams/connect today use this, example ConsistencyVectorIntegrationTest.
I'll check the CI output if we see any discrepancies before/after

@alok123t Let me know when this is ready for review. And yes, let's just add this proactively to all modules OR, is it possible to put it at one place and apply for all modules (in build.gradle you will notice things such as rat are configured once and get applied for all modules)? Perhaps something worth considering.

@divijvaidya looks like we only need add the junit file in root modules like server-common and clients and other should be able to import

@divijvaidya looks like we only need add the junit file in root modules like server-common and clients and other should be able to import

Sweet! Please verify after the CI is complete that we don't have regression with tests which use Junit 4 and then we should be ready to merge.

@divijvaidya I think it looks reasonable JUnit 4 test - ConsistencyVectorIntegrationTest running on CI

I triggered a re-build of the CI since JDK11+Scala 2.13 was failing

We have an unusually large number of failures. @alok123t can you please check the failures to see if they might be related to this change?

@divijvaidya looks unrelated. Most failed tests are related to RestoreIntegrationTest - likely some regression when I merged in latest changes from trunk to trigger a new build

Hey @alok123t. Thanks for working on this. In the last build, I just noticed that parameterized still are still reported as:
Build / JDK 21 and Scala 2.13 / [5] Type=ZK, MetadataVersion=3.7-IV1, Security=PLAINTEXT – kafka.zk.ZkMigrationIntegrationTest

Shouldn't your patch fix those as well?

@alok123t Any progress on this one? I actually need it to continue my experiment to improve our CI.

Hey @alok123t. Thanks for working on this. In the last build, I just noticed that parameterized still are still reported as:
Build / JDK 21 and Scala 2.13 / [5] Type=ZK, MetadataVersion=3.7-IV1, Security=PLAINTEXT – kafka.zk.ZkMigrationIntegrationTest

Shouldn't your patch fix those as well?

@dajac Looks like these tests are based on the @ClusterTest annotation which internally overrides the name() https://github.com/apache/kafka/blob/af747fbfed7e81617c3b3ad0e4dc8c857aa9502b/core/src/test/java/kafka/test/annotation/ClusterTest.java#L41 and has it own custom implementation of overriding the name https://github.com/apache/kafka/blob/9b468fb278701be836a2641650356907bf84860a/core/src/test/java/kafka/test/junit/ClusterTestExtensions.java#L187
In case there are no other outstanding comments, shall we go ahead and merge this PR and we can fix the naming for the ones which use annotations in a subsequent PR

Thanks for the explanation, @alok123t! I think that we could fix those separately, if we want to. @divijvaidya Do you want to do a final review?


Deployment commit for prod-stable

Merged main branch to prod-stable.
Use latest commit to update namespace ref in app-interface repo. Don't use merge commit, SHAs must be unique when images are created for each branch.

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

Project coverage is 76.96%. Comparing base (b1af6dc) to head (e12dfa6).

Additional details and impacted files
@@             Coverage Diff              @@
##           prod-stable    #1234   +/-   ##
============================================
  Coverage        76.96%   76.96%
============================================
  Files               68       68
  Lines              673      673
  Branches           119      119
============================================
  Hits               518      518
  Misses             139      139
  Partials            16       16

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


OperationalError (Exception error)

Greetings Team!
My environment:

Linux Parrot OS version 5.0
Code Name: Bullseye
Debian based

Currently I'm trying to follow the steps to be able to run the una-hora by following the 2nd steps (localized use), but I got stuck on the following step:

Migración y data inicial

$ pipenv run python manage.py migrate
Once this step starts, it triggers an OperationalError at the end (attached the traceback):
django.db.utils.OperationalError: could not translate host name "database" to address: Name or service not known
OperationalError.log
I've managed to edit the .env variables and used:
DATABASE_HOST=localhost instead of DATABASE_HOST=database
And now I get the following:
FATAL:  password authentication failed for user "postgres"
Now, to get passed that authentication failure, I was able to change the default postgres password (Linux Parrot OS Debian):
sudo -u postgres psql

\password
Input Password: password
Input again: password
quit

After that, everything runs smoothly, except that it doesn't load the .css files:

WARNING 2021-12-16 00:10:24,248 log<PHONE_NUMBER>82161573632 Not Found: /static/css/dist/styles.css
[16/Dec/2021 00:10:24] "GET /static/css/dist/styles.css HTTP/1.1" 404 13027

It seems like you are running the project locally instead of using Docker (instructions for using Docker here: https://github.com/Code4PuertoRico/una-hora/blob/main/docs/en/README-devs.md#option-1-docker)
In that case, you'll need to run these two commands so that the frontend dependencies:
$ pipenv run python manage.py tailwind build
$ pipenv run python manage.py collectstatic --no-input

I updated the READMEs to include these two commands: https://github.com/Code4PuertoRico/una-hora/blob/main/docs/en/README-devs.md#option-2-local
Let me know if it works 👍🏻

Thank you @rnegron  😄 💯  this worked perfectly, even on Windows 10. In the case of Windows 10 I did some changes to make it work:
I currently have NodeJs 17+ and whenever I ran this step:
pipenv run python manage.py tailwind install
This message appeared:

It looks like node.js and/or npm is not installed or cannot be found.
Visit https://nodejs.org to download and install node.js for your system.
If you have npm installed and still getting this error message, set NPM_BIN_PATH variable in settings.py to match path of NPM executable in your system.
Example:
NPM_BIN_PATH = "/usr/local/bin/npm"

I was able to mitigate this by adding the NPM_BIN_PATH = r"C:\Program Files\nodejs\npm.cmd" to the settings.py file, in this case:
File: local.py
Location:  (DRIVE) --> \config\settings\local.py
Source: Installation Django Tailwinds issues
I had issues trying out the Docker container using Docker Desktop (Win10) but I'll double-check I'm doing everything right, if not, I'll hit you up in an issue request.
This issue is now solved


pyglet.image.load_animation() fails when decoder is specified

Symptom:
If I load an animation image by using a custom decoder I get NotImplementedError.
e.g.
import io
from pyglet.image import *
from pyglet.image.codecs import *

class MyFileDecoder(ImageDecoder):
    def __init__(self, width, height, palette):
        pass
    def decode_animation(self, file, filename):
        return Animation([ImageData(0, 0, 'RGBA', [], 0)])

palette = []
myFileData = io.BytesIO(bytes([1, 2]))

myFileAnimation = pyglet.image.load_animation('myFile',
    file=myFileData, decoder=MyFileDecoder(640, 480, palette))

Expected Result:
The animation should be loaded correctly without throwing any errors.
Workaround:
In the case when a decoder is specified to load_animation(), a call to decoder.decode() is made, however it should be decoder.decode_animation().
See... https://github.com/adamlwgriffiths/Pyglet/blob/7ced33347a70bbaa02bab7ad28ad3c976bd9b216/pyglet/image/init.py#L2496
In the snippet, when a decoder isn't specified it goes through registered decoders looking for one that handles the file type. Once one is found decoder.decode_animation() is called.
By changing line 2496 above as follows, the code works as expected.
        return decoder.decode_animation(file, filename)

Not sure why you're putting this here. This is a 7 year old fork of pyglet.

Ah, sorry. Google searched, and yours is the root of 8 other forks. Assumed it was the master. Probably should have read the docs.


Expose information about linear trees in JSON format

Refer to https://github.com/microsoft/LightGBM/pull/3299#issuecomment-821049739 for the initial discussion.
Here is the code how linear trees are dumped into txt format
https://github.com/microsoft/LightGBM/blob/fba18e488ccd82b25c4e0788b2fec1f75bcde46a/src/io/tree.cpp#L378-L405
The same information should be dumped in NodeToJSON function
https://github.com/microsoft/LightGBM/blob/fba18e488ccd82b25c4e0788b2fec1f75bcde46a/src/io/tree.cpp#L428
Special attention should be paid to the case of uno-leaf tree:
https://github.com/microsoft/LightGBM/blob/fba18e488ccd82b25c4e0788b2fec1f75bcde46a/src/io/tree.cpp#L419-L423

This is a sub-issue of #2604.

@btrotta Could help with this please?


Datasets Unknown Keyword Argument Error - task_templates

Describe the bug
Issue
from datasets import load_dataset
examples = load_dataset('facebook/winoground', use_auth_token=<YOUR USER ACCESS TOKEN>)

Gives error
TypeError: DatasetInfo.__init__() got an unexpected keyword argument 'task_templates'

A simple downgrade to lower datasets v 2.21.0 solves it.
Steps to reproduce the bug

pip install datsets

from datasets import load_dataset
examples = load_dataset('facebook/winoground', use_auth_token=<YOUR USER ACCESS TOKEN>)

Expected behavior
Should load the dataset correctly.
Environment info

Datasets version  3.0.0
transformers version: 4.45.0.dev0
Platform: Linux-6.8.0-40-generic-x86_64-with-glibc2.35
Python version: 3.12.4
Huggingface_hub version: 0.24.6
Safetensors version: 0.4.5
Accelerate version: 0.35.0.dev0
Accelerate config:    not found
PyTorch version (GPU?): 2.4.1+cu121 (True)
Tensorflow version (GPU?): not installed (NA)
Flax version (CPU?/GPU?/TPU?): not installed (NA)
Jax version: not installed
JaxLib version: not installed
Using GPU in script?: Yes

Thanks, for reporting.
We have been fixing most Hub datasets to remove the deprecated (and now non-supported) task templates, but we missed the "facebook/winoground".
It is fixed now: https://huggingface.co/datasets/facebook/winoground/discussions/8

Hello @albertvillanova
I got the same error while loading this dataset: https://huggingface.co/datasets/alaleye/aloresb...
How can I fix it ?
Thanks


Fix IBM Power HMC vendor type

Use "IBM Power HMC" consistently as the vendor. "IBM PowerVM" isn't
wrong, but ManageIQ uses vendor to display the Provider type (and
icon) so consistency is preferred.
Required for: https://github.com/ManageIQ/manageiq-providers-ibm_power_hmc/pull/38

Skipping backport to najdorf, because it is already in the branch.


Exclude tracefs by default from disk checks

Attempting to include tracefs volumes causes a spammy WARN-level log message by default.
What does this PR do?
Adds tracefs to the default file_system_exclude
Motivation
This causes a spammy log message every time disk checks run
Additional Notes
Issues where this was reported:
https://github.com/DataDog/integrations-core/issues/5675
https://github.com/DataDog/dd-agent/issues/3875
Review checklist (to be filled by reviewers)

[ ] Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
[ ] PR title must be written as a CHANGELOG entry (see why)
[ ] Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
[ ] PR must have changelog/ and integration/ labels attached
[ ] If the PR doesn't need to be tested during QA, please add a qa/skip-qa label.

Hi Datadog Review folks,
I think this is good to go, but I don't understand based on the linked instructions what exactly I am supposed to do (if anything) to add a changelog/ label, as it seems I do not have permissions


Port https://github.com/Xilinx/mlir-aie/pull/1587

https://github.com/Xilinx/mlir-aie/pull/1587

@jtuyls lemme know if you still want this for in-tree.


Refactored triggers api

Pull Request Test Coverage Report for Build 283

471 of 490 (96.12%)  changed or added relevant lines in 22 files are covered.
9 unchanged lines in 3 files lost coverage.
Overall coverage increased (+0.7%) to 96.918%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

source/Cosmos-API-Triggers-Tests/TriggersAPITest.class.st
282
286
98.6%

source/Cosmos-Actions-API-Core/ActionsAPIInstaller.class.st
0
4
0.0%

source/Cosmos/CosmosInstaller.class.st
0
5
0.0%

source/Cosmos-API-Triggers/TriggersAPIContext.class.st
11
17
64.71%

Files with Coverage Reduction
New Missed Lines
%

source/Cosmos-Actions-API-Core/ActionsAPIInstaller.class.st
1
0.0%

source/Cosmos-PeriodicalScheduler-Tests/PeriodicalSchedulerTest.class.st
4
80.95%

source/Cosmos-PeriodicalScheduler-Tests/ScheduledTaskTest.class.st
4
86.21%

Totals

Change from base Build 277:
0.7%

Covered Lines:
3837

Relevant Lines:
3959

💛  - Coveralls


docs: Bump stable cask OS versions

[x] Have you followed the guidelines in our Contributing document?
[x] Have you checked to ensure there aren't other open Pull Requests for the same change?
[ ] Have you added an explanation of what your changes do and why you'd like us to include them?
[ ] Have you written new tests for your changes? Here's an example.
[ ] Have you successfully run brew style with your changes locally?
[ ] Have you successfully run brew typecheck with your changes locally?
[ ] Have you successfully run brew tests with your changes locally?

Review period will end on 2022-11-07 at 22:00:45 UTC.

Review period skipped due to critical label.

Thanks!


Configuration bug

Describe the bug
The configuration only runs after I reload (F5) the page.
To Reproduce
Steps to reproduce the behavior:

Go to '[https://www.urbtix.hk/payment-information/]'
The configuration does not run, but shows "Done" at the extension tool bar
Reload (F5) the page
The configuration works

Expected behavior
The configuration shall work after the page was first loaded.
Desktop

OS: Windows 11
Browser: chrome
Version: 118.0.5993.118

I won't be able to insert different text values in the same place one by one, even through Google sheets?
The problem is that the input field is always the same... but the text that will be entered must be different each time! Is this possible or are you thinking of adding such a feature in the future?
Or maybe you are thinking about connecting artificial intelligence in the future so that it enters random text into a field? And did your extension simply automate the send action?


Using DAL 'add another' functionality for a

I've got a form for Document where the end user should pick a category from a list (). The items in that list are coming from a different model ´DocumentCategory`.
There will be only a few categories, but I'd like to have the possibility to add a category through the "+" button, after which the newly entered category would be selected in the .
I had a look at http://django-autocomplete-light.readthedocs.org/en/latest/addanother.html which tells more about this, but seems focused on autocomplete as well.
What would be the easiest way and DRY to achieve the above? Since I'm using django-autocomplete-light in other forms, I'd prefer not to copy/paste and hack around.

Could you reproduce your question in stackoverflow and link it here if necessary ?
Thanks !
And Welcome to AUTHORS BTW B)


⚠ Bofrost.de has degraded performance

In 85c654e, Bofrost.de (https://www.bofrost.de) experienced degraded performance:

HTTP code: 200
Response time: 877 ms

Resolved: Bofrost.de performance has improved in 7be5e21.


Search for keybinding by hotkey in keybindings ui

Would be nice to have the ability to search for keybindings by hotkey so you don't have to search manually.

Search by command name would be useful, too.

@comex You can just start typing in the keybindings UI to filter by command name. It works just like other listings (the strings view, symbols, etc).

Also, you can use the command-palette (CMD-p) to search for the action name and it shows the keybindings from there as well.

I don't know that we're going to implement the search by keybinding feature so I'm going to close this one out for now. We might reconsider in the future, I just don't know if the extra feature of having to have a special. I did just enable the search box by default in the keybinding view (builds >= 2945) so that's no longer undiscoverable and you can sort by keybinding which makes finding a particular keybind pretty quickly. If anyone feels strongly that this isn't usable enough feel free to re-open.


string-encryption bugs

string-encryption cant encryption some large methods, and some local variable not encryption

Pushed a fix for the exception (fix will be in the next release). And for local variables not being encrypted this shouldn't happen, if you can post a screenshot of where this happens in your jar in a decompiler I can look into fixing it.


Proper adding of 'directory/'

test for adding single level directory with forward slash in the end
normalizing the path that is passed to the add method

When executing 'dvc add directory/' (the slash in the end is the problem), dvc was adding the directory to the data repo but the dvc file that it was creating was named '.dvc' instead of 'directory.dvc'.

Hi @egotsev !
Thank you for the fix! Merged.


Evaluate guacamole HTML for VNC access

Description
Replace current VNC Sunstone integration
Use case
Provide better end user experience
Interface Changes
Change Sunstone VNC console
Additional Context
https://guacamole.apache.org/

Progress Status

[ ] Branch created
[ ] Code committed to development branch
[ ] Testing - QA
[ ] Documentation
[ ] Release notes - resolved issues, compatibility, known issues
[ ] Code committed to upstream release/hotfix branches
[ ] Documentation committed to upstream release/hotfix branches

Worth looking into: https://github.com/BarrieAlmond/GuacNebula

Just deployed this (https://github.com/BarrieAlmond/GuacNebula) very cool solution in my lab.
The VNC, and especially the RDP connection profile is exactly what many of my customers are querying for. +1 on this!

Thanks for the feedback! we'll give it priority

Moving to backlog, guacamole agent may be too heavy on the hypervisors. Maybe we are missing something, but in our tests it pulls a tomcat?

Yes, it requires a java application server like Tomcat or Jetty.

Thanks for the confirmation.
Seems like an overkill for a light VNC feature. We'll evaluate its optional inclusion.
Meanwhile, we keep on the lookout.

That’s true. I’m running it inside Docker Containers in my environments. But it’s not that “lightweight” as NoVNC ;-)
Perhaps as (well documented) Add-On / Extension with integration via Marketplace?
Best
Sebastian

Am 18.06.2019 um 13:31 schrieb Tino Vázquez<EMAIL_ADDRESS>Thanks for the confirmation.
Seems like an overkill for a light VNC feature. We'll evaluate its optional inclusion.
Meanwhile, we keep on the lookout.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

You're right that as a VNC client it isn't exactly lightweight. I think the biggest benefit of Guacamole comes from using it for in-browser RDP connections to provide functions not available with NoVNC. Using RDP it can adjust the remote resolution to match the browser's display area, provide a form of clipboard redirection (text only, from pasting in to the ctrl-alt-shift menu), bi-directional audio redirection, print redirection, and file transfers from dragging on to the browser and downloading from a virtual drive via the ctrl-alt-shift menu.
It of course needs RDP to be enabled on the VM - easy enough with Windows, and can work with xrdp on Linux. It also needs the VM to be on an IP range contactable by the Guacamole server (could possibly be circumvented on KVM with VM port forwarding similar to what is mentioned here.
All I can say is it worked a treat for the virtual lab that I put together, running it inside Docker containers. Whether this is of any benefit to a particular environment depends on their requirements. Unfortunately I've now moved on from that project so can't contribute any more.

Wow @BarrieAlmond , it looks so cool!
It would be nice to containerize it and provide with Kube-OpenNebula as ready VDI solution!

Using RDP it can adjust the remote resolution to match the browser's display area, provide a form of clipboard redirection (text only, from pasting in to the ctrl-alt-shift menu), bi-directional audio redirection, print redirection, and file transfers from dragging on to the browser and downloading from a virtual drive via the ctrl-alt-shift menu.

Nevertheless, native spice-client support can provide all of this with less changes, see https://github.com/OpenNebula/one/issues/1262

closing in favor of the spice approach

reopening and putting this on the backlog as an alternative to noVNC

"A deployment scenario could be: one guacamole server on the frontend and guacd proxies on each hypervisor. The guacamole server can reach each guacd proxy and each guacd proxy can reach any VM on its own hypervisor. When creating a connection, some parameter needs to be set in order to use a particular guacd proxy" by @km4cus

PRs to merge:

one: OpenNebula/one-ee/pull/92
docs: OpenNebula/docs/pull/1243
dev: OpenNebula/development/pull/1137

superb job Sergio!


Optionalize chttp2

CC @makdharma

I was waiting for travis to give results, when merge started being an issue.

Alright, I'm not going to wait on travis any further... They were successful in the previous installations of the PR anyway.


PHPLIB-724 : Korean translated versionof READEME , CONTRIBUTING

Upload README-KO.md and CONTRIBUTING-KO.md file,
which are Korean translated.

Hello, I'm an undergraduate student in South Korea, Jian Han.
I was interested in MongoDB, while I was learning Database subject at school, and I wanted to participate in open source
contribution.
I found that there wasn't Korean translated version of README file and CONTRIBUTING file.
I thought  more people can contribute together if there is a translated version.
I hope  my commit can be checked and examined please.
Thank you.
@jmikola

Thanks for the contribution. I understand this would make the project more accessible to our Korean users, but I'm afraid we don't have the resources to maintain translations directly within the repository. I'd worry that these files would soon become out-of-date and having inaccurate information could be worse than having none at all (or  having users run the English documents through a translation tool).
That said, PHP.net actually has a system in place to support translations. There is presently no Korean translation, but that is something you can propose on the mailing list. About the Manual: Translations has more information for doing so.
The PHP.net manual also has a much larger audience than our GitHub repositories, so going that route would likely have a bigger impact for Korean users. If you wanted to focus on MongoDB specifically, the MongoDB Driver section of the manual has pages on installing the driver and using this library, which could certainly be translated. Although contributing to the core PHP language docs would also be a noble cause with greater reach.

Thank you for your kind review. I understood what you meant. Thank you for your advice.
I might find some other way to contribute to open source. :) Thank you again!
It was a good experience.


304 error

these directions lead to a 304 error that I am unable to solve
[Enter feedback here]

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

ID: 5689b389-ead5-825d-dde1-9a290bc0819f
Version Independent ID: 52a526a2-477a-dda4-02b4-eac1440811ed
Content: Add an API to Azure Static Web Apps with Azure Functions
Content Source: articles/static-web-apps/add-api.md
Service: static-web-apps
GitHub Login: @craigshoemaker
Microsoft Alias: cshoe

@dbehmoaras
Thanks for your feedback! We will investigate and update as appropriate.

@dbehmoaras Thanks for your feedback! We will investigate and update as appropriate.

It's possible that I'm missing a step, but I am unable to discern what that is. In the meantime, I was able to find a workaround where I enable CORS (just for the specific client-side URL I'm testing) and using the whole URL (eg. some-app.azurewebsites.net/api/endpoint) instead of just the api path (eg. 'api/endpoint') but it's not explicitly stated in the manual so I'm not sure if this is the correct approach in terms of security.
I am concerned about enabling CORS in production - I could protect the API with authentication / authorization but I just want to make sure I didn't miss anything.
Thanks!

Apologies for the delay. Thanks for the follow-up and update.
I understand you had trouble with the directions provided in the doc for adding an API to your Azure Static Web App. A 304 error typically means that the resource has not been modified since the last time it was requested, so it's possible that the issue is related to caching.
You may want to consider using authentication and authorization to protect your API. Azure Static Web Apps supports several authentication providers, including Azure Active Directory and GitHub, which can be used to secure your API endpoints.
Checkout these doc for more info on how to set up authentication and authorization in the Azure Static Web Apps documentation:
Authenticate and authorize Static Web Apps
Custom authentication in Azure Static Web Apps.
I was able to follow and test deploy fine as outlined in the doc, as a side note, this channel is reserved for ‘Azure docs’ feedback- for sharing doc feedback and suggesting content improvements.
Thanks again for your feedback!

@AjayKumar-MSFT thank you for your reply. I have tried to investigate the 304 issue related to caching but I was unable to determine a root cause (it's a very simple api call with a small JSON response in the body as a payload).
If other devs are encountering a 304 is it possible that this may be a gotcha within the steps that would benefit documentation ? Since I followed the docs step-by-step, I was wondering if something may have been missed.
I will definitely take your advice on authentication & authorization.
In any case, I thank you for your prompt reply and look forward to continuing to interact your team as I continue to work within the Azure ecosystem.


Text paging cutting markdown tags

Hello,
I have a specific use case where I will send text reports as messages over telegram and would contain several markdown tags. However, there are cases where text paging cuts in between these tags, causing telegram to error with Can't find end of the entity starting at byte offset xxxx.
Any advice?

The library currently paginates the first 4088 characters if the entire text > 4096 characters. The main issue is that if the markdown  closing tag ends up somewhere > 4096'th character, it will definitely break the markdown with or without the library. The only solution seems to allow users to pass in their own reserve space value. A higher reserve space value means a lower probability of the markdown breaking, however it still does not guarantee there will be no breakage since its entirely dependent on the position of the tags. So its all about where the tag will fall.

Do you think it is possible to parse the response after text paging for any broken markdown if parsed by Telegram and to 'append/prepend' the necessary tags to both pages so that the message gets through instead of being rejected by the server?
An alternative would be to push the last markdown tagged text to from the first message to the second message so that it doesn't get 'cut'.
Both way seems pretty complicated to implement though, not very sure.


In React Table v7 Sandbox infinite scroll is not working with server side example.

We are still working on this part of the sandbox. Thanks!


Android doc is missing "new ReactNativeOneSignalPackage()"

The android doc is missing the MainApplication.java inserts

I'm having the same issue 3.0.3 one Signal

this is done when you execute react-native link react-native-onesignal

@fermuch got the answer here... no need to include it in the docs since it's being done automatically during linking.

@avishayil I came across a problem this morning and realized the link function didn't do it job to add ReactNativeOneSignalPackage(). Shouldn't it be added to the docs just in case people missed it?

I had this same issue with OneSignal being undefined; the link function didn't update my MainApplication.java and I had to do it manually by following the example app config.
I will note that when I first ran the link function, it failed to work because react-native link thought that my Java files were in an intermediate folder, e.g. "could not find /android/app/src/main/java/com/MY_APP_NAME/ALPHA/MainApplication.java", but /ALPHA was a folder that wasn't actually in my file structure. My package was recently renamed to .com.MY_APP_NAME.alpha, in AndroidManifest.xml. I'm thinking perhaps react-native link looks at the package name to try to determine where your Java files are.
I agree that since this has happened to several people it would be helpful to add to the docs for troubleshooting.

Seems like react-native link react-native-onesignal does not update MainApplication.java in all cases, it didn't for me too. I suggest reopening this issue until the docs show how to link this library manually.


Ability to create batches based on a first and last match predicate

Hello,
To begin with MoreLINQ is an awesome idea and is really helpful! Regarding this pull request, I had to create a method that would batch a list of items based on a "first" match and "last" match, where other items in between does not satisfy either of the matches. After I wrote this method, I thought it would be a good addition to the MoreLINQ repository!
Here is an example of how this could be put in to use:
public class Activity
{
    public int Id { get; set; }
    public string Name { get; set; }
    public bool IsEnabled { get; set; }
}

public class BatchTester
{
    public static void Main(string[] args)
    {
        // Generate 9 entries w/ Name Activity 1, Activity 2, Activity 3,... and so on
        var activities = Enumerable.Range(0, 9)
                                   .Select(
                                        i => new Activity
                                              {
                                                  Id = i,
                                                  Name = "Activity " + ((i%3) + 1),
                                                  IsEnabled = true
                                              });
        Func<Activity, bool> firstMatch = activity => activity.Name.EndsWith("1");
        Func<Activity, bool> lastMatch = activity => activity.Name.EndsWith("3");
        var batches = activities.Batch(firstMatch, lastMatch);
        foreach (var batch in batches)
        {
            var combined = string.Join(", ", batch.Select(b => b.Name));
            // This would print Activtiy 1, Activity 2, Activity 3
            Console.WriteLine(combined);
        }
     }
}

Do check this out (test & implementation) and let me know your thoughts! Thanks for the opportunity!!

This seems to have weird semantics when the firstMatcher matches twice before the lastMatcher matches: Change firstMatch to activity.Id < 3 , and the result becomes:

Activity 3, Activity 1, Activity 2, Activity 3
Activity 1, Activity 2, Activity 3

Hello!
The intention of this extension method is to be used on a collection in which there is going to be a definite pattern, like in the example I used - every group would have 3 activities happening, say every day. May be adding a date field in the sample Activity class would help to implicitly convey the use case? Once it is used for something like the "id" which is almost always going to be unique, I guess the purpose is kind of lost! Correct me if I am wrong!!
I am trying to think of a use case for "id" fields, which would be valid, but I cannot think of any right now...

@karthik25 If that is the use case, what is the purpose of the lastMatch parameter? One could define a single parameter that defines batch boundaries (ie, it would return the previous batch and start a new one).

@fsateler  Yes, we can kind of achieve the same with just one predicate. But that would give me a lot of false positives. For example consider the following sequence:
Activity 1, Activity 1, Activity 1, Activity 2, Activity 1, Activity 2, Activity 3
I will get the following batches with this (the first 3 does not represent a pattern).
Activity 1
Activity 1
Activity 1, Activity 2
Activity 1, Activity 2, Activity 3

With a last match too, I would only get
Activity 1, Activity 2, Activity 3
Which is a valid pattern.
In short, without the last match predicate I will be getting batches which does not follow a pattern completely!

Thinking more about it, I could make the last match optional and start yielding batches even if it doesn't fit a pattern!

@karthik25 This is why it is important to understand the inuition behind each method, so that one can infer reasonable results.
BTW, MoreLinq already has a method that splits on a single match function.
BTW2, I find interesting the ability to select patterns, but I'm unsure if a pattern based on start/end is generic enough.

@fsateler Fair enough, I felt like it will be a great value add for MoreLINQ! With respect to making it more clear, like what this method does, can you pls. provide some suggestions?
Thanks!

@karthik25 I'm still a bit confused about what it is meant to do, that is why I ask all these questions! For example, with the following sequence:

Activity 1, Activity 1, Activity 1, Activity 2, Activity 1, Activity 2, Activity 3

Why does it make sense that the result be:

Activity 1, Activity 2, Activity 3

Instead of the entire sequence? In other words, why was the start point succesively moved each time "Activity 1" appeared? And I mean why in an intuitive sense: why would a naive user expect such a result?

@fsateler :)
This method is only concerned about "patterns" - that's why only Activity 1, Activity 2, Activity 3 makes sense. Without a start and end I cannot think of a way to identify patterns.
For example, the following qualify as patterns. Line 2 is missing one of the activities but still follows a "pattern".
Activity 1, Activity 2, Activity 3
Activity 1, Activity 3

So, in a large set of activities, using this method we will be able find all the groups that did or did not follow a pattern and do further analysis to see what was missed quite often.

@karthik25 So without looking at the implementation, I'm trying to understand your idea about capturing patterns as batches. So you are proposing that we have predicates to identify the start and end of a pattern within a sequence. What do you expect to happen to things falling in-between those patterns? Should they simply be dropped?

@atifaziz Yes. That's the intention. Elements after first match and before last match are added as is. Anything else is dropped.
For example in,
`Activity 1, Activity 1, Activity 1, Activity 2, Activity 3, Activity 1, Activity 3``
First 2 elements are dropped and only 2 batches are yielded Activity 1, Activity 2, Activity 3 and Activity 1, Activity 3.
Based on the discussion we have had so far, I am more and more convinced that this is pretty specialized and does not seem generic and so probably does not belong here! I leave it to you!!
Thanks for the opportunity, learned quite a few new stuff looking at various methods here! Hopefully my next contribution is straight forward!!

@karthik25 It seems like the concept of what you are proposing is misleading when articulated as batches belonging to a pattern. Perhaps it's also the vocabulary so based on what you've explained so far, I would say that what you're after is identifying adjacent sequences that are bracketed and non-bracketed. I say bracketed because your so-called pattern is defined by the first and last element. I wouldn't care about dropping the rest to keep the idea simple and general. If someone wants to drop the non-bracketed sequences, they could do that via a downstream Where. So given the following sequence of characters:
abcdef[ghijk]lmnop[qrstuv]wx[y]z

and bracketing defined by predicates ch == '[' for first and ch == ']' for last, the output would be sequences of character sequences grouped as follows:
abcdef, [ghijk], lmnop, [qrstuv], wx, [y], z

If someone were to put a gun to my head and ask me to cook up a name for this in under 10 seconds, it would be dull suggestions like SegmentByBracketing or GroupAdjacentByBracketing. 😛
The point is that it's not plain and simple batching and your proposal as it stands now would overload the concept and lead to confusion. I don't know if what I've presented captures the abstract operation more precisely, but if it does, I would try and model it that way and see how it goes. If you find then it has wide and general application, you're welcome to return to discuss further and submit another PR.


[RFC] Cache API rework

This is the outcome of the discussion in #50747 and #50136.
The cache API is now composed by:

cache_{data,instr}_enable()
cache_{data,instr}_disable()
cache_{data,instr}_line_size_get()
cache_{data,instr}_flush_all()
cache_{data,instr}_flush_range(addr, size)
cache_{data,instr}_invd_all()
cache_{data,instr}_invd_range(addr, size)
cache_{data,instr}_flush_and_invd_all(addr, size)
cache_{data,instr}_cache_data_flush_and_invd_range(addr, size)

And functions can now be inlined (see ARM64 implementation).
This is still an RFC.

The log for the first commit should mention why these changes are made.

Missed this when it came by before, but this looks perfect to me.  The global en/disable calls are going to be platform dependent I'm sure, and will have to be documented as potential noops.  But this has exactly the properties I wanted from the xtensa work.

That's a lot of new functions. I see some 'ENOTSUP' implementations for ARC whereas the hardware actually supports the features, but that's something we can add.
I'm not sure how users are supposed to use the different functions, as there is some overlap and depending on the platform not all are supported in hardware. Should use code first call 'range' and if that doesn't work then call 'all'? Should 'all' be emulated with 'range' if 'all' is not supported?
I think some extra guidance on mandatory vs optional or so would be good. And maybe a way to query (compile time) what is supported?

That's a lot of new functions. I see some 'ENOTSUP' implementations for ARC whereas the hardware actually supports the features, but that's something we can add.

I tried to port the existing features so if that is not currently present in the tree, it is not present in the new API.

I'm not sure how users are supposed to use the different functions, as there is some overlap and depending on the platform not all are supported in hardware.

That's why you have -ENOTSUP.

Should use code first call 'range' and if that doesn't work then call 'all'? Should 'all' be emulated with 'range' if 'all' is not supported?

It depends on the architecture. range is for when you want to operate an a given range, all is supposedly acting on the whole cache. Some architectures have different instructions for the two, some others can make all falling back on range.

I think some extra guidance on mandatory vs optional or so would be good.

Nothing is mandatory. If the operation is not supported at run-time, the API simply returns -ENOTSUP.

And maybe a way to query (compile time) what is supported?

Why? What's the use case here to query at compile time?

Why? What's the use case here to query at compile time?

I had portability in mind, writing code that works on multiple platforms. If these functions are kernel/platform only, the user normally knows what's available and what not. But if these are going to be userspace and generic application APIs, I would prefer to not have to rely on runtime trial and error to see what is supported.

if these are going to be userspace and generic application APIs, I would prefer to not have to rely on runtime trial and error to see what is supported.

But isn't this currently the case for all the Zephyr user exposed APIs? Some functions can not be populated by the driver and they usually returns some kind of error at run-time, see for example: https://github.com/zephyrproject-rtos/zephyr/blob/cfcf63018481a62fb413859555fb2e8e14d536c7/include/zephyr/drivers/uart.h#L515-L525
We are returning -ENOTSUP instead of -ENOSYS but the idea is the same I think.

Good example, the uart. There is some minimal expected functionality (poll_out doesnt have the ENOSYS), and there are CONFIGS indicating what is supported/used, see UART documentation:
Most importantly, the Kconfig options define whether the polling API (default), the interrupt-driven API or the asynchronous API can be used. Only enable the features you need in order to minimize memory footprint.

Good example, the uart. There is some minimal expected functionality (poll_out doesnt have the ENOSYS), and there are CONFIGS indicating what is supported/used

Well, in this case you still have CONFIG_ICACHE and CONFIG_DCACHE that indicates whether i-cache, d-cache or both are supported. Do you need more granularity than that? Because adding one CONFIG_ for each function to indicate whether that is supported or not looks to me an overkill and something unseen TBH.
I also fail to see the gain in having something:
#if defined(CONFIG_DATA_FLUSH_ALL_IS_SUPPORTED)
sys_cache_data_flush_all();
#endif

vs
if (sys_cache_data_flush_all() != -ENOTSUP) {
}

but probably you have a different use case in mind.

Is the cache_{data,instr}_cache_data_flush_and_invd_range(addr, size) a typo in the PR description? Should it be cache_{data,instr}_flush_and_invd_range  according to your code?

I might have another question, do we really need thoese xxxx_all() API? Most of the time we only use the _range() right? What's more, the _all() API can be fulfilled by the _range() like giving size with a -1 or a macro indicating _all().  This can also reduce the numbers of the cache API.

I might have another question, do we really need thoese xxxx_all()
API? Most of the time we only use the _range() right? What's more, the
_all() API can be fulfilled by the _range() like giving size with
a -1 or a macro indicating _all().  This can also reduce the numbers
of the cache API.

Two reasons I can think of:

Most cache implementations provide separate instructions for
"range" and for "all". Being able to use the appropriate method depending
on the context is important.

If you distinguish between "range" and "all" with a special range
argument to mean "all" then you'll need code to inspect the range at
run time and conditionally select the right instruction to use. With
separate functions there is no need for runtime conditionals, and if the
"all" variants are not used then the linker will drop them from the final
build.

Two reasons I can think of:

Most cache implementations provide separate instructions for
"range" and for "all". Being able to use the appropriate method depending
on the context is important.
If you distinguish between "range" and "all" with a special range
argument to mean "all" then you'll need code to inspect the range at
run time and conditionally select the right instruction to use. With
separate functions there is no need for runtime conditionals, and if the
"all" variants are not used then the linker will drop them from the final
build.

Clear, and very reasonable to me :)

@evgeniy-paltsev can you take another look?

Why DNM?

Why DNM?

At least https://github.com/zephyrproject-rtos/libmetal/pull/17 needs to go in first.

Just curious: Why was the openamp version updated as part of this PR (from 1258d35)?

It was requested by the OpenAMP maintainer. See https://github.com/zephyrproject-rtos/zephyr/pull/50988#pullrequestreview-1188175641


Shouldn't<EMAIL_ADDRESS>fail ?

Hey, I am using email_validator in my application and according to the documentation , '#' isn't allowed in strict mode. Somehow though<EMAIL_ADDRESS>passes the validation.

In my setup<EMAIL_ADDRESS>don't pass using strict_mode: true.

Thanks. The validation is intentionally loose. See #49 and the new README.