CameraServer class

This project is pretty much done at least for use on OSX and iOS and in it being used by both ARKit #24227 and ARCore #26221 implementations. Camera support on Android is thus working within ARCore.
In theory CameraFeed objects can be subclassed in GDNative so we can create GDNative based camera implementations.
There is a test project here that works on OSX and iOS:
https://github.com/BastiaanOlij/godot3_test_projects/tree/master/TestCameraServer
This sample project includes an example YCbCr -> RGB conversion shader.
There is one outstanding issue with the GLES2 renderer and that is that GLES2 doesn't support 2 channel textures required for the CbCr texture.
Seeing the difficulties I've had on Windows this platform is an excellent candidate for a GDNative implementation.
Someone else will have to do a linux implementation in due course.

X11 and Windows seem unhappy: https://travis-ci.org/godotengine/godot/jobs/268574379
You'll also have to rebase as I tweaked scene/register_scene_types.cpp a bit during a cleanup.

I’ll be implementing supporting the camera on windows soon but someone will
need to help me on android an x11:)
On Sun, 27 Aug 2017 at 2:44 am, Rémi Verschelde<EMAIL_ADDRESS>wrote:

X11 and Windows seem unhappy:
https://travis-ci.org/godotengine/godot/jobs/268574379
You'll also have to rebase as I tweaked scene/register_scene_types.cpp a
bit during a cleanup.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/godotengine/godot/pull/10643#issuecomment-325145530,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AB2vabFGugyYXe8qDQBzQ-nIVsiF1BS8ks5scEuHgaJpZM4PDTGS
.

--
Kindest regards,
Bastiaan Olij
https://www.facebook.com/bastiaan.olij
https://www.youtube.com/channel/UCrbLJYzJjDf2p-vJC011lYw
https://github.com/BastiaanOlij

Oops, I was including visual_server.cpp instead of visual_server.h, auch...
Working on Windows implementation atm, once I'm back on Mac I'll fix that clang issue.

Ok the current checking is probably completely broken. I'm about to check this out on Mac, check all the blind changes I've done and rebase it to the latest master (might not get around to committing this till tomorrow).
I've been trying to get the windows version to work which has been a frustrating exercise in futility. Its not helped that my expertise on some of the approaches Microsoft seems to love (like COM ugh) is lacking.
Just for people to understand. Webcam support on windows started life as Video For Windows, which is fully deprecated, dead and buried.
They replaced it with DirectShow (part of DirectX) which is still around but key parts have been deprecated in Windows 7 and removed from Windows 10. While I'm 80% through getting this to work, the last 20% requires adding your own direct show filters written as a com DLL, not really suitable.
The current hot to trot solution is called Media Foundation, which I've found completely baffling, I don't even know where to begin.
Anyway, if someone with far more experience then me wants to have a look at it, please do. I'm going to put the finishing touches on this for Mac as I really want to get back into ARKit for which I originally wrote this.
Owh lastly, there is a nice project called libuvc which is cross platform and which we may want to use. I had issues with it not wanting to compile on Windows but with a bit of effort its possible to work around that. This library offers direct access to cameras over USB which would actually serve us well.

Alright, the Mac OS X build is a working again. As mentioned before this should also work for iOS. The only thing I need to add here is discovering when new cameras are plugged in.
For all the other platforms at the very least we need to instantiate the CameraServer base class so Godot can interact with it and find out there are no cameras available. This also opens up the door to adding camera streams through GDNative.
As suggested before, libuvc may be a good open source project to evaluate to add camera support on Linux and possibly windows.
The next step for myself is adding logic to the renderer to use the camera as a background option in viewports and then I'll finish off the iOS support.

Ok, this is really starting to get somewhere.
@reduz you might want to check my changes and see if I've done this in a way you agree with, I think it's pretty much in the same line with how the other background modes work. You can now select "camera feed" as the background mode in your environment settings and it will cause the nominated feed to render as the background. You do need to turn the camera on, i've not made that automatic. See the example project mentioned in the opening post which I've updated.
There are a couple of improvements that still need to be made:

Flipping the camera image either on the X or Y axis should be made optional
We should probably add some code to maintain aspect ratio of the camera image, right now it stretches
I'd really like to change the code so it doesn't do the in memory copy of the camera images @reduz is this possible using the texture objects? If not possibly I should remove the support for making the textures available and just create my own GL texture objects in the camera server?
We probably should add two sets of textures, one set currently used by the rendered, and one being updated by the camera. When the camera has updated the textures we flip a setting and discard any camera frames until the renderer pics them up.  Right now it looks like there is a of locking going on as the renderer and camera are fighting over the textures.

And obviously someone will need to do Windows, Linux and Android implementations. I'll start working on iOS tomorrow and update my ARKit PR to feed ARKits camera images into this.

Almost forget, one more todo, I need to react on someone plugging in/removing a webcam. Shouldn't be to hard to add but still :)

The commit I just added sees a bit of refactoring in how the feeds are exposed to Godot and now completely implements adding/removing cameras on OSX so you can plug in a webcam, get a signal its available, enable the webcam, and things are nicely handled when you unplug it again.
I have also updated my sample application to show this in action:)

I've just added the support to iOS, still need to debug this as it recognised the cameras but gave white output. This may have been a problem with the project files because trying out the material demo works fine.
I have also added the base camera server to all the other platforms. This means that the camera server is available but just doesn't have any cameras, prevents projects from crashing when they try to access the camera server :)

Ok, one more commit for today. The iOS version of this is breathing life.
The problem on iOS is that the iPhone has high speed cameras for its slow motion feature. Basically Godot just stalled as it was getting frames faster then it could process.
This made me implement the double textures solution I wanted to do anyway. So while we're updating our camera texture the renderer uses the previous frame. After we finish updating our current camera frame but before the renderer requests using those, we'll discard camera frames. Right now we do this by ignoring them, I have to investigate whether they can be throttled somehow.
This has put the final nail in the coffin of our texture resources. Texture resources request the RID of the texture only when set assuming its contents changes, not the RID itself. I'll probably be removing that part of the solution unless someone has a smart suggestion here:)
Anyway, there is one more issue on iOS and that is that the colours are all wrong, it looks like the camera images colours are inverted. I have to research that some more.
To be continued....

I did a few more tweaks and cleanups, still no further in knowing what is going wrong on iOS. On OSX the camera shows correctly, when using ARKit to handle the camera everything works fine, but getting data from the camera directly on iOS it looks like the color balance is all off:

No idea what I'm forgetting or doing incorrectly.
Note that I've found this sample project from Apple really handy:
https://developer.apple.com/library/content/samplecode/GLCameraRipple/Listings/GLCameraRipple_RippleViewController_m.html
Maybe someone can see what I'm overlooking :)

After talking to @reduz yesterday, made a few optimisations by removing unnecessary allocations and reusing buffers.
One thing I'll be looking into is using yuv2rgb to do the conversion from YUV to RGB in the camera server itself so the texture uploaded is an RGBA texture. The current approach is slightly faster having the GPU do this conversion and loading slightly less data but conversion to RGB offers more flexibility.

Only a small fix, I had renamed the properties at some point to properly group them but that broke the code that hides properties when not needed.
So now the camera feed id, and h/v flip properties are only shown if you've selected camera feed as the background mode

Another rebase, new physics server had caused a bunch of merge conflicts. Need to check if I didn't mess anything up..

Just rebased

And rebased again, will soon be adding gdnative support to this

Rewrote a whole bunch of things to turn CameraFeed into a subclass of a reference, might even turn it into a resource at some point. This way it should in theory be possible to implement one as a GDNative module.
It's probably broken at the moment on iOS and OSX because I have not yet had time to test the changes.

Ok, fixed the compile issues on OSX and iPhone, only tested on OSX. Hopefully also fixed the clang-format issues.
Did have a weird crash on OSX from time to time but I think that is unrelated to this project, needs more testing.
Need to see if I can now create a camera feed on windows using gdnative.

I'm wondering if any further work can be done on this project, I want to dedicate 3 months on this for GSoC. So in what direction should I go?

@sikub, it would be awesome if someone could look into adding android support for sure :)

I've rebased this PR but haven't tested it yet. I don't see any reason why what worked before wouldn't work now but it is just a first step on reviving this PR.
I'm going to try and do some testing over the weekend and get ARKit up to speed.

Just tested this on an old mac, seems to work but I get intermittent crashes that I can't figure out yet and it stops rendering text correctly, looks like the shader is left in an incorrect state.. not sure why

I've simplified some of the camera code removing the texture chain code. I'll be working on code for Android next in preparation for using this for ARCore.
ARCore combines the YCrCb images into a single texture which is interesting as the Y component usually is at a higher resolution. I might need to see about doing the same for iOS.
With ARCore the texture is also loaded externally with a special texture type which I'll need to add in.
Finally I'm having trouble with GLES2 not supporting 2 channel textures which throws a monkey wrench into the CrCb texture. Still working on that.

One other thing, I've been asked a few times to make the camera image available through a texture object so you can use it in shaders instead of just on the background. What is holding me back here is that you need a custom shader to show YCbCr colour space textures. Is that an acceptable limitation to force onto people?

I've changed the code around so that the YCbCr shader is now embedded into the copy shader, it has become a conditional.
Also I've added the ability to switch between having a texture where the YCbCr is combined in a single texture (Android seems to work like this, may need more changes) and where we have a separate Y and CbCr texture.
Lastly I've added a method that allows the feed implementation to allocate a texture instead of supplying an IMG, again we'll be needing this for the Android implementation as Android will upload the camera data straight into an OpenGL texture id.
I still need to make changes to the GLES2 renderer.
Now that I've removed the double buffering (overkill i think) I'm contemplating making the camera textures accessible as texture in Godot. This will mean that I will also need to add the YCbCr -> RGB conversion logic into the SpatialMaterial logic. Feedback would be welcomed.

Redid the shader changes on GLES2 now as well, my only remaining problem is that GLES2 does not support RG textures so that is a problem on Mac OS X and iOS. Will need to investigate that further possibly adding some form of conversion step.

Rebased this and a few minor changes. Need to find some time to redo the camera detection

Forgot my MacBook dongle so haven't tested my last changes on iOS but they all work on OSX.
I added a CameraTexture to give access to the camera textures.
Fixed a crash error on OSX when deactivating a camera.
Changed the discovery method on iOS since the current version was marked as deprecated (interestingly enough, not deprecated for OSX). This is the only one that needs testing.

There are a couple style issues it seems: https://travis-ci.org/godotengine/godot/jobs/536694827
Could you also amend the commit log to be a bit more descriptive on what this class does? It would be nice to have some offline documentation in the git log about the motivation for adding this class and how to use it. If anything were to happen to GitHub, the git log would be our only documentation on why things have been added to the codebase.

Ah! that was that issue for which you updated to a newer version of clang-format. I'll rebase it and fix it up.
I did document the classes but I'll write abit more in the commit log aswell :)

Thanks a lot for your work on this feature! It took a while to merge but I'm pretty sure it's very ripe :)

Hello everyone, I'm issuing some problems trying to acquire USB camera input. My setup is Linux Mint 19 with Godot 3.2
CameraServer.feeds()
returns an empty array, despite the camera is properly connected and working in guvcview. Do you have any suggestion?

Hey @jumpy88 would you mind creating a separate issue in the issue tracker for your problem?
But even if you do I'm not sure if the CameraServer is implemented for OS other than OSX and iOS. There is a dummy for each platform but that's it. There are other guys having the same problem like you have on other platforms.
You could also create an issue in the godot proposals repository. But in the meantime this really should be documented in the CameraServer docs.

By the way @BastiaanOlij: Is the CameraServer Class usable in HTML5 builds?

@pwab thank you for your reply. Let's see if my question has a quick answer, otherwise I'll create a new issue. Thank you also for the reference to Godot Q&A (I'll make you know if does it help). I searched here on github and this is the only issue I found about CameraServer.

@pwab No, the server is just the framework ontop of which camera implementations can be build. It works for OSX and iOS and it is used for ARCore on Android but nothing else. Hopefully people with a need for access to cameras on other platforms will step up and add implementations for them.

@BastiaanOlij hello and sorry for my misunderstanding: I saw this was merged and I thought all problems were also for the others platforms (I didn't read the entire story because of its length). What do you mean with "it is used for ARCore on Android"? Could CameraServer be used in Android to read data from a camera or not?
I can do a try to extend it to other platforms, but I need some hints about the code structure. Could you suggest me where should I start from (which files and which classes should I study)? Is there an "interface" to implement to make it properly work with the existing code?

@jumpy88 The ARCore functionality in Android has all the logic implemented for reading the camera as it needs that data to do all the tracking and for AR applications to display the camera feed in the background. That hasn't been merged and is waiting a bigger refactoring after some other structural changes are merged into master.
Seeing the camera server is implemented for iOS and OSX that is a good place to start. I really should find a good place to document the structure as that is indeed lacking.
In essence the camera server is a central hub where you can register the cameras that are available in the system by instantiating (subclasses of) CameraFeed objects.
When the user activates a camera the related CameraFeed instance is responsible for interacting with the camera and obtaining images which it then loads into a texture object.
Other parts of the system can grab that texture object in order to do something with those frames.

@BastiaanOlij so, what should I do is to implement CameraLinux extending CameraServer and CameraFeedLinux extending CameraFeed by following the structure I see in godot/modules/camera/camera_win.cpp (or camera_osx.mm but I'm not familiar with .mm files). Is it right?

.mm files are just .cpp files but that have access to obj-c++ syntax.
I would look at camera_osx.mm and use that as a base. I never got things to work on Windows, Windows is weird.

Ok, so the syntax I don't understand should be from obj-c++ (thank you for sharing knowledge).

Windows is weird

I think it's the best sentence I've ever seen about Windows XD.
Ok, I've a lot to study about Godot module, how to extend it, how to contribute and does libuvc works (just to track, this could be useful to read data frame by frame from a usb camera). I'll make you know if I get something working.

Thanks Bastiaan for the clarification. I opened an issue in the docs-tracker to get this documented somehow.

Windows is weird.

I totally agree. For months I tried to implement webcam access inside a C#/WPF project (keep in mind: both MS technology). Then I got to the point that not even one library is supported anymore. The best I could do was to use Computer Vision packages like AForge (latest commit 2017) or OpenCV to get a simple texture out of a webcam stream. And I also failed there.
I now believe the camera app from the MS store uses some kind of magic. 😅

@jumpy88 It just uses normal C++ syntax. It uses .mm files just so you can access some of the obj-C APIs seeing iOS using obj-C. But you can still look at it for structure.
I think I played around with libuvc but couldn't get it to work on Windows.
@pwab it's daft, I went through so many rabbit holes, from video for windows that has been totally removed, to their media classes from which camera support was removed, to their new stuff that doesn't seem to work.
Anyway we really shouldn't be having this conversation in a dead PR, not sure what a better place would be. It would be great to have others involved and do some of the other platforms as I'm knee deep into VR stuff atm.

i have a 3.2 fork with a working webcam implementation for linux using v4l2, kinda hacked together using various sources (and based on the osx implementation), but working. if someone is interested in stabilizing it, i'd love to see this functionality in godot

@pwab did you look into the artoolkit5 or artoolkitx sources? afaik cam works there in windows
https://github.com/artoolkitx/artoolkitx

@BastiaanOlij have a working webcam implementation based on microsoft's media foundation API - #44498

@BastiaanOlij I've two proofs of concept showing how cameras can be acceded in Linux. The first one is based on OpenCV and the second one on UVC.
https://github.com/jumpy88/godot_ocv-camera-reader
https://github.com/jumpy88/godot_uvc-camera-reader
I'm also planning to do the same with v4l2.
Before to start deeping into Godot source code I'm posting this here to discuss which would be the best solution to be included in Godot. I think v4l2 would be the best one not requiring to link against external libraries, but let me know your opinion.

Before to start deeping into Godot source code I'm posting this here to discuss which would be the best solution to be included in Godot. I think v4l2 would be the best one not requiring to link against external libraries, but let me know your opinion.

Indeed, I think using v4l2 would be the way to go here. OpenCV is a huge dependency, so we'd rather not add it to core.

Yeah, I know OpenCV is too large, I hoped UVC was small enough (because I had some already working code based on it). Let's see if tomorrow Santa Claus will bring us a Godot + v4l2 sample.

Sorry for the delay. Santa Claus had some problems to travel due to covid restrictions. Anyway, here we are:
https://github.com/jumpy88/godot_v4l2-camera-reader

Hello everyone, I'm trying to get the same result of the previously linked repositories on Android. My experiments are based on https://github.com/komakai/UVCCamera/tree/komakai-fixes. I can build and run UVCCamera samples but can't figure out how to use its libraries (.so files you can find in libuvccamera/src/main/libs after building it) directly in C++ (without using provided Java wrappers). I think the problem is I've to use the modified libuvc functions taking int fd additional parameter but I've no idea how to get it. I've created a dedicated repository but at the moment it fails setting up the camera
https://github.com/jumpy88/godot_uvc-camera-reader_android
Any help to reverse engineer UVCCamera (provided with almost no documentation) would be very appreciated. Thank you in advance to everyone contributing to this effort.

Hello everyone, I'm trying to get the same result of the previously linked repositories on Android. My experiments are based on https://github.com/komakai/UVCCamera/tree/komakai-fixes. I can build and run UVCCamera samples but can't figure out how to use its libraries (.so files you can find in libuvccamera/src/main/libs after building it) directly in C++ (without using provided Java wrappers). I think the problem is I've to use the modified libuvc functions taking int fd additional parameter but I've no idea how to get it. I've created a dedicated repository but at the moment it fails setting up the camera
https://github.com/jumpy88/godot_uvc-camera-reader_android
Any help to reverse engineer UVCCamera (provided with almost no documentation) would be very appreciated. Thank you in advance to everyone contributing to this effort.

Sorry for the delay. Santa Claus had some problems to travel due to covid restrictions. Anyway, here we are:
https://github.com/jumpy88/godot_v4l2-camera-reader

I see there is some interest in V4L2 proof of concept so I'm starting studying camera_win.cpp by @choonway to integrate my sample code in a camera_linux.cpp. I'm not sure to understand the logic of CameraServer and CameraFeed: will my code run on a different thread and should write the new frame to a buffer when it is available (as in a producer/consumer pattern) or should it ask the device for the new frame and return it when asked by something else?

Sorry for the delay. Santa Claus had some problems to travel due to covid restrictions. Anyway, here we are:
https://github.com/jumpy88/godot_v4l2-camera-reader

I see there is some interest in V4L2 proof of concept so I'm starting studying camera_win.cpp by @choonway to integrate my sample code in a camera_linux.cpp. I'm not sure to understand the logic of CameraServer and CameraFeed: will my code run on a different thread and should write the new frame to a buffer when it is available (as in a producer/consumer pattern) or should it ask the device for the new frame and return it when asked by something else?

Update:
my proof of concept
https://github.com/jumpy88/godot_ocv-camera-reader
thanks to @komakai work (see https://github.com/komakai/opencv/commit/2e2df44eac79acb5bb124356d5e274e235b87641 commit) now also support built-in android cameras (it doesn't work with external USB cameras).

I do not know much about Windows development, but maybe the implementation from OpenCV could be helpful for using the MediaFoundation Framework.
https://github.com/opencv/opencv/blob/master/modules/videoio/src/cap_msmf.cpp
And I was wondering, if we use V4L2 for Linux does that mean that the godot itself must be distributed under the GPL as V4L2 is GPL? Or can it be some kind of plugin... but if used in a game or tool it becomes GPL too?

I'm not expert about licences, but I think you can call a function from a GPL library in your code with a different licence, otherwise no software but GPL could be executed in a Linux environment.

You can't, as you have to link to the library to be able to call functions from it: https://www.gnu.org/licenses/gpl-faq.html#GPLStaticVsDynamic

I just made PR #49763 which is a feature complete Windows implementation including:

Hot-plugging support
YUV->RGB via the CameraFeed shaders (easily decodes 4K input)
Compiles via MinGW

I understand people were already working on this, but I needed a working solution ASAP. I've recently been contracted to build a Windows multimedia app that requires camera input and I figured that while I'm dealing with the MediaFoundation API anyway I may as well build it into Godot which is very well suited to my project.
Any feedback on the implementation would be appreciated.

i have a 3.2 fork with a working webcam implementation for linux using v4l2, kinda hacked together using various sources (and based on the osx implementation), but working. if someone is interested in stabilizing it, i'd love to see this functionality in godot

@subjectdenied Do you have this fork public somewhere? I checked your repos and didn't see it.

@georgewsinger Did you see https://github.com/godotengine/godot/pull/47967 ?

Hello. What about FFMPEG?. It support's Linux, Mac and Windows. It's license LGPL.


Build error in Macbook (tensorflow lite)

OS Platform and Distribution Macbook
TensorFlow installed from (source or binary): github latest bf282dece59bdf88f7a58bcf1064723cb3eea51e
TensorFlow version:trunk
Bazel version (if compiling from source):  1.0.0-homebrew
GCC/Compiler version (if compiling from source): Apple clang version 11.0.0 (clang-1<IP_ADDRESS>)

Run ./tensorflow/lite/tools/make/build_lib.sh or ./tensorflow/lite/tools/make/build_ios_universal_lib.sh
Same build problem:
g++ -O3 -DNDEBUG -fPIC  --std=c++11 -I. -I/Users/kmok/workspaces/tensorflow/tensorflow/lite/tools/make/../../../../../ -I/Users/kmok/workspaces/tensorflow/tensorflow/lite/tools/make/../../../../../../ -I/Users/kmok/workspaces/tensorflow/tensorflow/lite/tools/make/downloads/ -I/Users/kmok/workspaces/tensorflow/tensorflow/lite/tools/make/downloads/eigen -I/Users/kmok/workspaces/tensorflow/tensorflow/lite/tools/make/downloads/absl -I/Users/kmok/workspaces/tensorflow/tensorflow/lite/tools/make/downloads/gemmlowp -I/Users/kmok/workspaces/tensorflow/tensorflow/lite/tools/make/downloads/neon_2_sse -I/Users/kmok/workspaces/tensorflow/tensorflow/lite/tools/make/downloads/farmhash/src -I/Users/kmok/workspaces/tensorflow/tensorflow/lite/tools/make/downloads/flatbuffers/include -I -I/usr/local/include -c tensorflow/lite/experimental/ruy/block_map.cc -o /Users/kmok/workspaces/tensorflow/tensorflow/lite/tools/make/gen/osx_x86_64/obj/tensorflow/lite/experimental/ruy/block_map.o
In file included from tensorflow/lite/core/api/op_resolver.cc:16:
In file included from ./tensorflow/lite/core/api/op_resolver.h:20:
./tensorflow/lite/schema/schema_generated.h:2660:8: error: ISO C++ forbids forward references to 'enum' types
In file included from tensorflow/lite/core/api/flatbuffer_conversions.cc:  enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
16:
^In file included from
./tensorflow/lite/core/api/flatbuffer_conversions.h:24:
In file included from ./tensorflow/lite/core/api/op_resolver.h:20:
./tensorflow/lite/schema/schema_generated.h:2660:8: error: ISO C++ forbids forward references to 'enum' types
./tensorflow/lite/schema/schema_generated.h:2660:32: error: field has incomplete type 'enum FlatBuffersVTableOffset'
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
^
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {

I have the same question at 'flatbuffer' and 'enum'. Please make sure that U use the latest FLATTERBUFFER so that flatbuffers/flatbuffers.h has type 'FlatBuffersVTableOffset'. I solve the problem with it. U can try it. Good Luck.

It had nothing   related to flatbuffer from the log , also the flatbuffer is downloaded by download_dependencies.sh, not  using system one.


Gradle: Upgrade Jackson to version 2.10.0

See https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.10.
Signed-off-by: Sebastian Schuberth<EMAIL_ADDRESS>

Just fyi: the XML issue with deserializing multiple tags with same Name seems to be gone. You ran Ingo it AS well Iirc.

Just fyi: the XML issue with deserializing multiple tags with same Name seems to be gone.

Interesting, how do you know? I didn't find any related changelog entry.

Interesting, how do you know? I didn't find any related changelog entry.

I had implemented something based on 2.10.0 PR3 right the day before which worked, so I assumed it is fixed. I don't know in which release it was addressed though.


add linkedin and email social handles

Small change to add linkedin and email social handles

Thanks for the add!

Thanks for the add!


Extended class does not satisfy requirement when defining default data without explicit type

TypeScript Version:  3.5.3
Code
class Route {
  method: 'get' | 'post';
}

class MyRoute extends Route {
  method = 'get' // error?
  // method: 'get' = 'get' // compiles fine
}

Expected behavior:
Should compile fine by inheriting same type from base abstract class
Actual behavior:
Getting error:

TS2416: Property 'method' in type 'MyRoute' is not assignable to the same property in base type 'Route'.
Type 'string' is not assignable to type '"get" | "post"'.

Playground Link: http://www.typescriptlang.org/play/#code/IYIwzgLgTsDGEAJYBthjAgSgewK4QFMEBvAWACgEFRIZ4EBbAiAC2wBMAuBAcgHNmPBAB9eAB2yQeAbgoBfChRRoMAWQCeOfEQIAPQgDt2GLYRIUqTVh279BCALy8BEHvKA

Duplicate of https://github.com/microsoft/TypeScript/issues/32355


Convert '==' to 'Equals' and reverse

Test case: ?
Category: Refactoring
Severity: Hidden
Diagnostic ID: ?

Is someone working on this at the moment ?

@Kavignon No. But it is not Ready yet. We need a test case, and a diagnostic id.

@Kavignon Feel free to suggest one. @ElemarJR You might want to add it too?

I'm not quite sure about this, but I think that it's better to compare string with the == operator than the Equals method. Please tell me if I'm wrong about this
That could be one of the test cases.
@giggio

@Kavignon @ElemarJR I added the test cases. @Kavignon If you want to work on it let us know.
This is a refactoring, the user might want to change one way or the other.

@giggio where are the test cases ?
So, if I can it right, I'll have to produce the following
Category: Refactoring
Severity: Hidden
Diagnostic ID: CC0085 (converting == to Equals)
Diagnostic ID: CC0086 (converting Equals to ==)
I'll have to see in the library how refactoring is done. I'm used to analyzing but I've no prior experience with refactoring so this will be a nice experience.
I'll make a pull request when I'm done !
I don't seem to be able to assign this issue to myself

How can I assign this to myself?
Can someone assign it to me ?

@Kavignon I will put working in this issue.

@Kavignon We cannot assign the issue to you, github only allows us to assign issues to project maintainers (which are part of a team).
Do not create a Roslyn refactoring. We are not able to deploy refactorings with Nuget, so we are not using them. You need to create an analyzer which creates a Hidden diagnostic, this is how we are working refactorings in CC.
If you have any questions let us know.

I am so sorry. I have been really busy in the past weeks. I'm back on track now and it should not take long before I start making pull requests !

Nice! :)

@Kavignon How is this coming?


include null values in output if allownull is true

Been using this library quite a lot, thanks!
This PR aims to make the output of null values more consistent with the input data. Namely if the input has a value set to null then the output value should remain as null if allownull is set to true.
Previously it would strip out the key/value completely if the value was null, even if allownull was set to true.
Apologies for the whitespace strip - my editor loves doing that.

seems to be a test failure.

thanks for the catch, if we can get tests to pass i'll take a closer look and help land this

tests do pass when run on master. thanks!


questions about the weight maxtrix Wij between ui and vj

Firstly.thanks for your answer on zhihu as well as the implementation on github, it helps me a lot understanding the original paper.
I would like to share my doubt about the very lines just below the figure 2 of the original paper which says "each capsule in the [6,6] grid is sharing their weights with each other".which by my understanding ,means  capsule outputs(vector ui) among a [6,6] grid shares the same Wij.thus,just 32 W should be updated using adam.but in  your implementation ,I can't find any codes to handle the weights sharing mechanism.
Besides,I think the shape of Wij should be [16,8] as the ui is [1,8] or [8,1] vector and obviously conflicts with the Eq 2  .although it looks like a  problem without any importance,I pick it out so that i would be righted if i am wrong with understanding this paper and your implementation.

@jianyin2016 I had the same doubt, and this statement(below) in the paper is kind of increasing the simplicity, but also hindering the proper understanding of what exactly is a capsule unit:
Wij is a weight matrix between each u_i, where i  belongs to (1, 32x6x6) in PrimaryCapsules
and v_j, where j belongs to (1, 10).
It would be great if someone could explain this part in the context of a capsule layer and capsule units.

@rrqq
hello,man.
I studied a couple of implementations these days and I found what I previously think is wrong.
Actually,I tend to believe the ”sharing weights“ mentioned above means each capsule in the [6,6] share a same set of filters to get the [1,8] vector，generally speaking，it is a common sense in DL what sharing weight means  and it make sense.
This issue should be closed as thought I have doubts in all the implementations released because they seem to be not very sure of their implementations themselves.


un-successful request with status code: 400

Community Note

Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version
❯ terraform -v
Terraform v1.2.1

Affected Resource(s)

tf plan on config containing data sources returns 400
tf plan on config non containing data sources is successful
tf apply on config non containing data sources returns 400

Terraform Configuration Files

# provider
terraform {
  required_providers {
    zia = {
      source  = "zscaler/zia"
      version = "2.3.1"
    }
}
provider "zia" {
# credentials set via environment variables
}

data "zia_group_management" "browser_isolation_exemptions" {
  name = "terraform_spike_url_group"
}

Actual Behavior
❯ terraform plan
data.zia_group_management.browser_isolation_exemptions: Reading...
╷
│ Error: un-successful request with status code: 400
│
│   with data.zia_group_management.browser_isolation_exemptions,
│   on url_filtering_rules.tf line 20, in data "zia_group_management" "browser_isolation_exemptions":
│   20: data "zia_group_management" "browser_isolation_exemptions" {
│

Steps to Reproduce
terraform plan

Note
The credentials work with Postman so I don't think it is a credentials issue and also the error code is 400 not 403.

Hi @louiskim-levu-phx

Make sure the username has administrator access in the ZIA portal
Make sure the credentials are in between single quotes such as:

export<EMAIL_ADDRESS>export ZIA_PASSWORD='12345'
export ZIA_API_KEY='12345'
export ZIA_CLOUD='zscalertwo' (Or whatever cloud you're provisioning)
Thanks

It is working now, I wrongly copied the password from postman :)


Collection columns should not be restricted by '=' relation

cql"SELECT id, tags FROM test.post_details where tags = $tags;"

Currently compiles, but failing at execution, showing:

"Collection column 'tags' (set) cannot be restricted by a '=' relation"

This error should be shown at compile time instead

https://github.com/tabdulradi/troy/pull/42


Use build output as Lambda function

This may be an edge case specific to us, but Apex is something we're considering over a tool we've built internally for many of the same purposes accomplished here.
We've preferred to organize our code (primarily JS) with deeper hierarchies than a simple index.js file. Something like:
src
├── index.js
├── lib
│   ├── addMeta.js
│   ├── buildFlow.js
│   ├── helpers.js
│   ├── loadEnv.js
│   ├── mailer
│   │   ├── addTemplate.js
│   │   ├── mailerFlow.js
│   │   ├── updateUrlValue.js
│   │   └── validateInput.js
│   ├── removeMeta.js
│   ├── shouldProcess.js
│   └── sns
│       ├── classify.js
│       ├── unwrapEvent.js
└── package.json

We typically prefer to keep one function to a file and use import/require to build out the dependency trees. With that said, the build/clean step much harder with Apex when using for things like building larger function structures when combined with, say, transpiling ES6 -> ES5 or Coffee -> JS. It'd be useful to be able to specify a "package from this directory on build" flag, that way we can simply do:
{
  "artifacts": "dest",
  "hooks": {
    "build": "babel --out-dir ./dest ./src",
    "clean": "rm ./dest"
  }
}

Where "artifacts" is the directory to be packaged into the .zip archive for upload. Does this seem too edge case for what the goals of Apex are?

Willing to put down code to help with this feature if it seems like a reasonable feature request. I just wanted to ensure this is a valid use case for Apex

Hmm yea I think this makes sense for most cases, basically the inverse of .apexignore. For Go you could just specify the "main" output or main + assets if you have anything that wasn't inlined. I guess the use-case here is slightly different since it's a target directory but maybe we could change the default Go stuff to produce ./build/main and rm -fr build. I'm :+1:, we just need to figure out what this looks like.
Part of me does like that you know what's in the dir is available to you in Lambda. I guess even in the node/transpiling case you don't actually "see" the build output, even if it's spewed all over that directory, it's removed on "clean" anyway. So in that case you could just babel --out-dir . src.
Or if that's too nasty you could babel --out-dir ./build ./src with:
{
  "handler": "build/index.handle"
}

I haven't tried handler with a dir in the name but I'm assuming it works. At least that wouldn't require any Apex changes, plus if we support babel out of the box (I'd like to) the user doesn't have to get all confused by these settings.

The problem I've had with doing a babel --out-dir . src is when you have to deal with prod vs. dev dependencies (i.e. babel-cli vs. just the runtime). It's hard to separate dependencies getting mixed up in something like a node_modules dir without a separate "clean deps for deploy" step. If you build in two separate dirs (or copy to a new dir, then build it locally in that dir) it keeps the source better isolated from the artifacts.
The approach we've taken thus far has been to still to give the user control over the build step (similar to your hooks), but to assume all build commands would be run against (or from within) the build dir.
I think you're correct in saying the build hook will work with dirs in Apex as-is. The only change that would be needed I think is the "package this dir" rather than a single file. I'll test the idea of building to the CWD and using .apexignore and report back.

Sounds good! So far I'm seeing tradeoffs either way, the downside of the current way is having to .apexignore the input source, and the downside of a build dir is you'd have to move put your non-source assets in there. I can't think of a clear winner ATM.

Could this achieved simply by allow you to (optionally) specify a .zip file to apex deploy [functionname] that way, when you wanted to, you could take responsibility for creating that artefact.
So something like this might work:-
apex build myfunc > tmp-build.zip
apex deploy myfunc --zip tmp-build.zip
rm tmp-build.zip

[apex deploy would still read all the config options, etc from the normal place (instead of from within the zip).]
Just an idea…

Specifying the directory is pretty much the same as specifying the zip, just one less step for the user to worry about

@tj Good point.
@plukevdh One way to fix the devDeps problem is by having two package.json files.  One in the root of the project (devDeps only) and one in each Lambda function (deps only) and running npm install twice.
E.g. https://github.com/Financial-Times/next-url-management-api/pull/42/files
Alternatively I wrote this script that will extract the dependencies from a node_modules folder (skipping, without deleting, the devDependencies).  I've been meaning to extract that into a reusable module on its own for a while…

Tough call. Assuming that "handler": "build/index.handle" works fine I'm not sure about changing anything ATM. Users (using build hook) can copy whatever files they want to build directory and then use them as they would be in . inside Lambda function.
Apex is great because it's simple ("we will zip all files in functions dir. use .apexignore to exclude some of them.")

Yea I like that it's simple there too, just need something reasonable to recommend to people or some out of the box solution for interpreted languages.

Having the default be build/index.jsis super reasonable, though I think, since you can configure the handler function in the Lambda SDK, it's worth making that an option somewhere down the road as well. Probably via the function.json file. But thats something we can worry about outside of this issue. I think as soon as you assume for development, all resources are local within a src dir and all resource for deployment are also local in a build dir, then you're really just needing to worry about your CWD given what type of operation you're performing (transpiling, local runtime, dependency management, etc). IMO,  Once you separate "built and deployable" resources from "dev-time" resources, the operations performed between those two get a lot cleaner and more isolated.

Yeah distinct build dirs is nice in that sense, for Go it's pretty much irrelevant unless you don't want to inline some data, then the CWD does matter.
I'm going to move this to v0.7.0 so we have a bit more time to hash out the details, definitely need to think about it more and see if we can come up with a solution that is simple for all cases.

Using webpack or browserify as shown in ./_examples fixes this issue.


⚠ Bofrost.nl has degraded performance

In 6c0c613, Bofrost.nl (https://www.bofrost.nl) experienced degraded performance:

HTTP code: 200
Response time: 2925 ms

Resolved: Bofrost.nl performance has improved in 2a4b933 after 306 days, 6 hours, 24 minutes.


Fix: cairo_native swaps the high and low fields of U256 compared to Cairo's u256

Fixes #715
I introduced this when i added the corelib tests, instead of changing the field order of the u256, instead i swapped the tests and starknet syscall impl, but that was wrong, now its fixed
Checklist

[ ] Linked to Github Issue
[ ] Unit tests added
[ ] Integration tests added.
[ ] This change requires new documentation.

[ ] Documentation has been added/updated.

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

Project coverage is 91.68%. Comparing base (905d695) to head (e098487).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #720   +/-   ##
=======================================
  Coverage   91.68%   91.68%
=======================================
  Files         118      118
  Lines       32644    32644
=======================================
  Hits        29931    29931
  Misses       2713     2713

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


Update actions to remove warnings in GitHub Actions

Description
There were several actions used in GitHub Actions still relying on Node.JS 12 which resulted in warnings being generated at workflow runtime.
With this PR, the following actions were updated:

actions/setup-go@v2 -> actions/setup-go@v3
actions/checkout@v2 -> actions/checkout@v3
codecov/codecov-action@v1 -> codecov/codecov-action@v3
<EMAIL_ADDRESS>-><EMAIL_ADDRESS><EMAIL_ADDRESS>-><EMAIL_ADDRESS>
Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: #1202
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list:

[x] Code compiles correctly
[ ] Created/updated tests
[ ] Extended the documentation

The helm/kind-action action is already available in version 1.5.0. However, I was afraid of updating that many versions at once 🙂

Please do feel free to update it in a follow up PR if possible.
Thanks again for all the contributions !!


AD domain controller not initialized for single-word domains.

If the AD domain is a single word, e.g. demo, the deployment would apparently succeed, but the AD domain controller would fail to initialize properly. As a result, machines are unable to join the domain. The error does not percolate up to the Terraform process. It would be very helpful if it did somehow to stop the deployment. Upstream client tools and users should perform validation and make sure that the domain complies with the AD policies for being at least two tokens separated by dots, e.g. studio.demo However, it should fail if any errors occur during configuration of AD controller. See GoogleCloudPlatform/solutions-cloud-orchestrate#2 for reference.

Will consider using this feature to valiate input: https://www.terraform.io/docs/configuration/variables.html#custom-validation-rules

regex has been introduced to make sure domain is not a single word. Closing as fixed.


Two cmd windows

Great program
I'm trying to incorporate it into my script
to make sure that I am running my program as an administrator
if I start the program it will print You must run this as admin
and then run pyuac.runAsAdmin()
My question is, I now have two cmd windows open
how can I tell it to close the first cmd window
and keep the second cmd window open
so I can run my script
"""
def main():
time.sleep(6)
print("Do stuff here that requires being run as an admin.")
The window will disappear as soon as the program exits!
input("Press enter to close the window. >")
if name == "main":
# ---- is user in admin ----
if not pyuac.isUserAdmin():
print('You must run this as admin')
print("Re-launching as admin!")
time.sleep(4)
# ---- runs admin privileges ----
pyuac.runAsAdmin()
else:
print('You have admin privileges')
# main()  # Already an admin here.
"""

As far as I know there's no real way to do that, at least with the standard python.exe on Windows, which is a console application.  If you have a Windows file association for .py files to python.exe and double click a Python file from explorer, it will spawn a console window. If you then use PyUAC from that program to elevate, it will spawn another window for the admin portion. What you might be able to do is edit the properties of the file (through Windows Explorer) and set it to run as admin from there so it runs as admin from the beginning.
There does exist pythonw.exe which does not spawn a console, and also does not make sys.stdin and sys.stdout available. If the Python program you want to run as admin is a fully GUI program (e.g. using Tkinter or some other GUI library), you might be able to use pythonw.exe instead. However if your program is a console app and uses print() or input() or similar, that won't work.

Thank you very much for responding to my post
I just recently got it to work
I found this online
"""
import admin
if not admin.isUserAdmin():
admin.runAsAdmin()
"""
I modified it by replacing
admin with your pyuac
and it did exactly
what I wanted it to do
the first window comes up saying
you must run this as admin
then it reloads and the uas comes up
if you select a yes
the first cmd window will close
in the second one will pop up saying
you know have admin privileges
It still has a little bit of a bug in it
which I haven't figured out yet
but here's the code encased someone else has the same problem
"""
def user_admin():
try:
if not pyuac.isUserAdmin():
print('\n\t''You must Run as admin')
print('\t''Re-launching as admin!')
time.sleep(4)
pyuac.runAsAdmin()
os.system('cls')
print('\n\t''You now have admin privileges')
input('\t''Press enter to close the window.')
except Exception as e:
print("Unexpected error:", e)
user_admin()
"""
The problem I'm now having is
if you run the script as admin
the above script will terminate
instead of running as admin
other than that it works perfectly


Network pauses

Hello,
First I love that there is 3 button deploy option like this amazing to test if container has a must.
However I am experiencing some network issues... I launched WordPress official container and after working fine for a couple of minutes it no longer connects then after a few minutes it starts working again.
I tested it with other networked instances, to confirm that that was not a problem with the container.
I also assumed it may have been load issue but it is happing today again.
Is this some kind of anti abuse mechanism, so that people have stable predictable connation ? Or maybe there is some network issue I am confused.

Is this some kind of anti abuse mechanism, so that people have stable predictable connation ? Or maybe there is some network issue I am confused.

we have some things for this. Can you please share the exact test that you're running?
Is there a way I can consistently repro this?

#there is no connection to server. Reconncting...
After deleting the instances and closing the session, page is not responding, still session is running.
Im getting this response when I refresh the labs.play-with-docker.com page -   "there is no connection to server. Reconncting...". I dont understand how to deal with this. Will this resolve or close the session by itself when it got to connect with server or its going to incure any charges while I had deleted my instances and closed the session within 2 hours after starting the session as its terminal was not responding properly after 1 and half after only.


retry the mysql-apt-config download and use ssl

mysql-apt-config download from dev.mysql.com fails very often with connection reset by peer. So this patch just retries for 5 times in the hope it works once in a while

This PR is a : Improvement
Link to the related issue if relevant

[ ] Documentation is written
[ ] parameters.yml.dist is updated
[ ] playbook.yml.dist is updated
[x] Changelog was updated

Seems to be an issue with Virtualbox 5.1.8 and 5.0.28...
Closing it for now


Plugin prints empty lines

When using console: true, empty lines are printed on the console when no errors were found:
[13:53:35] Starting 'styles:lint'...
[13:53:36]

[13:53:36] Finished 'styles:lint' after 795 ms

That's my config:
{
	syntax: 'scss',
	reporters: [
		{
			formatter: 'string',
			console: true
		}
	]
}

Not sure if it's a bug or I didn't configure it correctly but the current behavior is weird.

Thanks for reporting this. Will be fixed soon.

This issue has been fixed and released in 2.0.2, so I'm closing it. Feel free to reopen if necessary.


Improve readme

Improve readme as disccussed.

https://github.com/ADS-Testing/SAMOTA/commit/4555df6041902335e85c82741aeaf2948d738e14


chore: use basilisk pallets

Use pallets from Basilisk as they are developed there and to avoid duplication.
Note: versions of the pallets are pinned to rev from feat/asset-registry branch to include newly refactored asset-registry.

@lumir-mrkva I'd just leave it. It is just more hassle to implement the upgrade migration.  It is possible to do it manually via update call.

This is obsolete.
There is a new repo for all crates and pallets which are or will be used by Basilisk and HydraDX.
And this kind of refactor will be done as pallets and features are introduce to HydraDX parachain.


Added error handling if resumption token is not a valid base64 string

When sending an invalid resumption token (not a valid base64 encoded String) the library throws an unhandled exception (IllegalArgumentException).
This change handles this exception and throws a BadResumptionTokenException and thus produces a valid OAI PMH response.

Yes, apparently so. I opened an issue about this:

#273

Any updates on this? Is there a different way I can contribute to avoid this error?

@bumann-sbb no, you're doing everything right. We've just been busy! 😅 Thanks for your patience!

5.2.2 has been released, should be available soon from Central.


384 Track Hibernate ORM 5.5 (master)

Use matrix to compact the existing workflows
Track latest ORM 5.5
Enable JBoss snapshots repository only when required

Merged https://github.com/hibernate/hibernate-reactive/pull/393


MTA-STS Incident Timeline and Post-Incident Review Prep

Definition of Done

[ ] Create a timeline for the incident for a Post Incident Review
[x] Schedule a Post Implementation Review

https://docs.google.com/document/d/16p-1TJ76VRmMfdLoHxi-aBr-EOXoQF3CzqlUOWb4nQw/edit?usp=sharing

Ready for review on Tuesday


Need support for workload using K8 Job

Our pks tile's implementation has a K8 Job artifact.  Kibosh does not handle it properly.  As a result, the "create-service" status is stuck at "create in progress".  In K8 control plan, it shows my K8 Job completed as below:
pod/kibosh-2e96205e-12a9-4c51-8069-fe0d9ff94a57-dse-init-hz457   0/1       Completed   0          19h
I would suggest to inspect the kibosh code to see if the condition statement to verify readiness of a pod for a K8 job is correctly defined.  The code should verify if (READY == 1/1 & STATUS == Running) or (STATUS == Completed) for a Pod to determine create-service's status as "create succeeded".

Issues: 1) should be checking for "Succeeded" rather than "Completed" jobs, 2) Jobs may run for awhile and need to be certain we don't call the deployment succeeded even if the job pod is "Running"


Distance senslr ll40ls will never be executed without running IMU driver

Describe the bug
Intentionally, we have tested following case.

Do not execute any IMU driver app (e.g., mpu9250 or so).
Execute "ll40ls" as the only sensor app. ( nsh> ll40ls start )
ll40ls will never be executed.

To Reproduce
As above.
Expected behavior
Clearly, ll40ls should work.

Hi @hyonlim , a couple of suggestions to help initially.

Ensure that your SENS_EN_LL40LS parameter is set appropriately, (and if not, set/save the value and reboot your autopilot):

This could be related to issue #12278.  I am doing some work refactoring this driver to try to fix this issue, but my progress has been slowed by other priorities recently.  I'll keep up on this issue and work with you to resolve it.

I believe this was resolved by increasing the maximum number of tasks.


messaging and database ins same sketch

hi,
if i build a sketch  of messaging, it works fine
if i buidl a sketch of databse (get data); il works fine
if i merge the two sketch get data doesn't work
please help
Thanks
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include "password.h"
#include <FirebaseClient.h>
void authHandlerBDD();
void authHandlerMess();
void timeStatusCB(uint32_t &ts);
void printResult(AsyncResult &aResult);
void printError(int code, const String &msg);
DefaultNetwork network; // initilize with boolean parameter to enable/disable network reconnection
// ServiceAuth is required for Cloud Messaging.
ServiceAuth sa_auth(timeStatusCB, FIREBASE_CLIENT_EMAIL, FIREBASE_PROJECT_ID, PRIVATE_KEY, 3000 /* expire period in seconds (<= 3600) */);
UserAuth user_auth(API_KEY, USER_EMAIL, USER_PASSWORD);
FirebaseApp appMess, appBDD;
#include <WiFiClientSecure.h>
WiFiClientSecure ssl_client;
using AsyncClient = AsyncClientClass;
AsyncClient aClient1(ssl_client, getNetwork(network)),aClient2(ssl_client, getNetwork(network));
Messaging messaging;
RealtimeDatabase Database;
AsyncResult aResult_no_callback_Mess,aResult_no_callback_BDD ;
bool taskCompleted = false;
void setup()
{
Serial.begin(115200);
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
Serial.print("Connecting to Wi-Fi");
unsigned long ms = millis();
while (WiFi.status() != WL_CONNECTED)
{
    Serial.print(".");
    delay(300);
}
Serial.println();
Serial.print("Connected with IP: ");
Serial.println(WiFi.localIP());
Serial.println();

Firebase.printf("Firebase Client v%s\n", FIREBASE_CLIENT_VERSION);
Serial.println("Initializing appMess..");
ssl_client.setInsecure();
ssl_client.setBufferSizes(4096, 1024);
initializeApp(aClient1, appMess, getAuth(sa_auth), aResult_no_callback_Mess);
initializeApp(aClient2, appBDD, getAuth(user_auth), aResult_no_callback_BDD);
authHandlerMess();
authHandlerBDD();
appMess.getApp<Messaging>(messaging);
appBDD.getApp<RealtimeDatabase>(Database);
Database.url(DATABASE_URL);

}
void loop()
{
authHandlerMess();
authHandlerBDD();
appMess.loop();
appBDD.loop();
messaging.loop();
Database.loop();
if (appMess.ready() && !taskCompleted)
{
    taskCompleted = true;
    Serial.println("Sending message...");
    Messages::Message msg;
    msg.topic("sgdm_piscinea");
    Messages::Notification notification;
    notification.body("Notification body").title("Notification title");
    object_t data, obj1, obj2, obj3, obj4;
    JsonWriter writer;

    writer.create(obj1, "name", string_t("wrench"));
    writer.create(obj2, "mass", string_t("1.3kg"));
    writer.create(obj3, "count", string_t("3"));
    writer.join(data, 3 /* no. of object_t (s) to join */, obj1, obj2, obj3);

    // object_t data2("{\"name\":\"wrench\",\"mass\":\"1.3kg\",\"count\":\"3\"}");
    msg.data(data);
    Messages::AndroidConfig androidConfig;
    androidConfig.priority(Messages::AndroidMessagePriority::_HIGH);
    Messages::AndroidNotification androidNotification;
    androidNotification.notification_priority(Messages::NotificationPriority::PRIORITY_HIGH);
    androidConfig.notification(androidNotification);
    msg.android(androidConfig);
    String payload = messaging.send(aClient1, Messages::Parent(FIREBASE_PROJECT_ID), msg);

    if (aClient1.lastError().code() == 0)
        Serial.println(payload);
    else
        printError(aClient1.lastError().code(), aClient1.lastError().message());
}
getData2();
delay(1000);

}
void authHandlerMess()
{
// Blocking authentication handler with timeout
unsigned long ms = millis();
while (appMess.isInitialized() && !appMess.ready() && millis() - ms < 120 * 1000)
{
// This JWT token process required for ServiceAuth and CustomAuth authentications
JWT.loop(appMess.getAuth());
printResult(aResult_no_callback_Mess);
}
}
void authHandlerBDD()
{
// Blocking authentication handler with timeout
unsigned long ms = millis();
while (appBDD.isInitialized() && !appBDD.ready() && millis() - ms < 120 * 1000)
{
// This JWT token process required for ServiceAuth and CustomAuth authentications
JWT.loop(appBDD.getAuth());
printResult(aResult_no_callback_BDD);
}
}
void timeStatusCB(uint32_t &ts)
{
#if defined(ESP8266) || defined(ESP32) || defined(CORE_ARDUINO_PICO)
if (time(nullptr) < FIREBASE_DEFAULT_TS)
{
    configTime(3 * 3600, 0, "pool.ntp.org");
    while (time(nullptr) < FIREBASE_DEFAULT_TS)
    {
        delay(100);
    }
}
ts = time(nullptr);

#elif __has_include(<WiFiNINA.h>) || __has_include(<WiFi101.h>)
ts = WiFi.getTime();
#endif
}
void printResult(AsyncResult &aResult)
{
if (aResult.isEvent())
{
Firebase.printf("Event task: %s, msg: %s, code: %d\n", aResult.uid().c_str(), aResult.appEvent().message().c_str(), aResult.appEvent().code());
}
if (aResult.isDebug())
{
    Firebase.printf("Debug task: %s, msg: %s\n", aResult.uid().c_str(), aResult.debug().c_str());
}

if (aResult.isError())
{
    Firebase.printf("Error task: %s, msg: %s, code: %d\n", aResult.uid().c_str(), aResult.error().message().c_str(), aResult.error().code());
}

}
void printError(int code, const String &msg)
{
Firebase.printf("Error, msg: %s, code: %d\n", msg.c_str(), code);
}
void getData2()
{
Serial.println("Synchronous Get2... ");
Database.get(aClient2, "/test/int", aResult_no_callback_BDD);
delay(500);
}
void getData()
{
Serial.println("Synchronous Get... ");
Serial.print("Get int... ");
int v1 = Database.get(aClient2, "/test/int");
if (aClient2.lastError().code() == 0)
Serial.println(v1);
else
printError(aClient2.lastError().code(), aClient2.lastError().message());
}

You have to read the library documentation thoroughly to understand the library concept and usage.

You must remove all delay functions from your code because this is async client library.
Read the documentation is a must.

You can use only one FirebaseApp and ServiceAuth for both Messaging and Realtime Database to reduce the code complexity.
The FirebaseApp is the authentication task handler which can be used globally for all Firebase services apps if those apps support the authentication that provide by FirebaseApp.

Only NTP configTime waiting delay can be used. Other delays in your code must be removed.

You can use only one FirebaseApp and ServiceAuth for both Messaging and Realtime Database to reduce the code complexity.
The FirebaseApp is the authentication task handler which can be used globally for all Firebase services apps if those apps support the authentication that provides by FirebaseApp.

Hi. Could you please give an example? As I understand, ServiceAuth and UserAuth have different arguments.

@OleksandrGora
Before asking, you have to understand the concept of authentication/authorization in this library.
https://github.com/mobizt/FirebaseClient?tab=readme-ov-file#app-initialization
There are two required steps of initialization and applying.
STEP 1
The FirebaseApp class object is the auth task handler that you should initialize it based on your authentication type before use with initializeApp.
https://github.com/mobizt/FirebaseClient/blob/5eafe565f8405dae99e13f13202d1434975bbd4a/examples/App/AppInitialization/Async/Callback/UserAuth/UserAuth.ino#L124
https://github.com/mobizt/FirebaseClient/blob/5eafe565f8405dae99e13f13202d1434975bbd4a/examples/App/AppInitialization/Async/Callback/ServiceAuth/ServiceAuth.ino#L124
STEP 2
After initialization, the FirebaseApp class object will be ready to use by applying it to your Firebase services class using FirebaseApp::getApp<AppType>(...).

For Realtime Database

https://github.com/mobizt/FirebaseClient/blob/5eafe565f8405dae99e13f13202d1434975bbd4a/examples/RealtimeDatabase/Async/Callback/Set/Set.ino#L104-L106

For Firestore Database

https://github.com/mobizt/FirebaseClient/blob/5eafe565f8405dae99e13f13202d1434975bbd4a/examples/FirestoreDatabase/Databases/Async/Callback/Create/Create.ino#L114-L116
https://github.com/mobizt/FirebaseClient/blob/5eafe565f8405dae99e13f13202d1434975bbd4a/examples/FirestoreDatabase/Documents/Async/Callback/CreateDocument/CreateDocument.ino#L117-L119
https://github.com/mobizt/FirebaseClient/blob/5eafe565f8405dae99e13f13202d1434975bbd4a/examples/FirestoreDatabase/CollectionGroups/Indexes/Async/Callback/Create/Create.ino#L113-L115

For Messaging

https://github.com/mobizt/FirebaseClient/blob/5eafe565f8405dae99e13f13202d1434975bbd4a/examples/Messaging/Async/Callback/Send/Send.ino#L110-L112

For Firebase Storage

https://github.com/mobizt/FirebaseClient/blob/5eafe565f8405dae99e13f13202d1434975bbd4a/examples/Storage/Async/Callback/Download/Download.ino#L139-L141

For Google Cloud Storage

https://github.com/mobizt/FirebaseClient/blob/5eafe565f8405dae99e13f13202d1434975bbd4a/examples/CloudStorage/Async/Callback/Download/Download.ino#L148-L150

For Cloud Functions

https://github.com/mobizt/FirebaseClient/blob/5eafe565f8405dae99e13f13202d1434975bbd4a/examples/CloudFunctions/Async/Callback/Call/Call.ino#L118-L120

@mobizt, thank you for prompt response.
But from your response I see different authentication methods for different apps.
I implemented both RTDB and Messaging apps in my project, but separately for RTDB and Messaging. Everything works well, but I can not enlarge functionality, because of memory lack.
I am hobbyist, I may not notice some features in docs or examples and can not deal with your links.
For me it is not clear how I can use ServiceAuth for RTDB app.
If you have time to describe deeper, please help. If not - I will keep the program as it is.
Anyway, the library is excellent. I managed to connect mobile app with my hardware device and can keep using it as it is.


RequiredWith not working as expected

✏ Describe the bug
I think there is a bad behaviour with RequiredWith attribute.
↪ To Reproduce¨

it('cannot validate MyData', function () {
    class MyData extends Data
    {
        public function __construct(
            public string $name,
            #[Unique(User::class, 'email')]
            public string $email,
            #[RequiredWith('street')]
            public string|Optional $city,
            #[RequiredWith('city')]
            public string|Optional $street
        ) {
        }
    }

    // Validation exception is not thrown (off course it is but for documentation purposes it is not)
    dd(MyData::validateAndCreate([
           'name' => 'Ruben',
           'email' =><EMAIL_ADDRESS>           'street' => 'MyStreet'
     ]));
});

✅ Expected behavior
I think there should be validate error like: "The city field is required when street is present.", but the request is accepted. The "rules" function with "required_with" works as expected.
    public static function rules(): array
    {
        return [
            'email' => ...,
            'city' => ['required_with:street'],
            'street' => ['required_with:city'],
        ];
    }

🖥 Versions
Laravel: 11
Laravel Data: 4.6.0
PHP: 8.3.6

I think it's same as https://github.com/spatie/laravel-data/issues/844

@scippio i feel the combination of the sometimes (in this case Optional) and required_with rules creates a conflict.

Yes.

@scippio What I meant to say is your data class validation doesn't work because of the Optional type for both properties which translates to "sometimes". notice how the rules method work.

So it's a laravel-data bug? Because Laravel works as expected.

This appears to also be an issue with nullable properties

Duplicate indeed, fixed in next release!


Stream deduplication

A common requirement is to deduplicate a stream based on some field, potentially also using a time window to define uniqueness. For example, users may only want unique values of x once every n seconds. Currently there isn't a great way to do this, but I think that we should support it.
I imagine this working with some kind of transform that acts as a uniquness filter. This would also require stronger CQ execution order semantics, so probably depends on #1721.

We can get away without execution order semantics if the uniqified stream is a derived stream and people read only from the derived stream. Similar to our JSON unpacking example.


Need some help moving from ko-contrib-router to knockout-contrib-router 2

Hi Casey,
We’ve recently started migrating from ko-component-router to knockout-contrib-router and there are some things we noticed and wanted to know if they are bugs or behavior misunderstandings from our side.
I’ve created a codesandbox project where every single issue reported below can be reproduced. Here’s the demo link: https://p938k153rj.codesandbox.io/user
You can check the code at https://codesandbox.io/s/p938k153rj
Difficulties with the Path Binding
From the second router level below, we are no longer able to use the path bind ./, to access child routes, we must add the hardcoded path instead, or work around it using the canonicalPath.
This is indicated in the green/red text: https://p938k153rj.codesandbox.io/user/new/details
The path binding seems to work well for the first level, but not for the second and below.

Children component re-renders when clicking on href for the same route
From the second router level below, when we hit the same navigation item it re-renders the child component. This doesn’t happen at the top level.
In order to test this, click on the ‘Users’ link multiple times. You will notice that the first level “rendered at X ms message” is always the same. This is the expected behavior for me: clicking on the same link doesn’t trigger a re-rendering. It also works fine for the second level ‘New’ and ‘Edit’ navigation items.
But if you click on the ‘Details’ or ‘Contact’ the child component gets re-rendered, every time you click them.
Here is a sample video of this behavior: https://www.screencast.com/t/xmgbuWLKWav
Also, I’ve noticed that the first time I click on the ‘Users’ link the browser navigates to ‘/user’. The second time I click on it, the browser navigates to ‘/user/’.
Let me just say thank you for the router. The newer version is way better and a lot cleaner.

Hey, thanks so much for the detailed report and test cases, really really going to be helpful. I think this is just the repro case I needed for an issue reported by someone else for the path binding.
I'll hopefully be able to dig into this tomorrow or Friday. I suspect that some of the changes I've been experimenting with locally may have the latent effect of resolving the path binding issue.

I'm glad this helps. Thanks for the quick answer.

Hey,
I've updated to rc.2 from my previous demo and tested the changes done in this last versions.
The problem with the 'Difficulties with the Path Binding' appears to be solved.
The only problem, from this issue, that isn't solved yet is 'Children component re-renders when clicking on href for the same route'.
I've also tested the /*option to add active-path class for any of the child routes opened and it works just as expected, it's nice to have this.
You can check the updated demo here: https://codesandbox.io/s/j25n5n44qy


Values set per cmd line get lost after disconnect power.

I watched this here since some versions.  i set the values via cmd connected via the screen cmd. pushed return. Set all values as ever, send X to leave this.
Connected again  and still see all settings as left.  Then power of the pi.
Next day powered it on and i wounder why it is not transmitting. Checked again per screen cmd and see only the default values.
My only way is to modifiy the source code in read_NVM and set fixed settings into the values.  This works as new default.
Any ideas? is this only my problem?  Used original raspi pico, no clones.
So the precomiled bins are not usefull for me.
73 Wolfgang

I have not heard of anyone else experiencing this yet.
My only idea so far is to mention that (as long as you connect quickly enough) it will do a hexdump to the terminal of the NVRAM when it boots.   So configure the settings via command line, and press to X to reboot. Re-connect the serial terminal quickly and screenshot the dump. Repeat that after a power cycle and see if the raw dump looks any different. It will be interesting to see if if maybe it is reading all zeroes, or garbled data,

Ok, i will aquire this infomation and be back with this.
EngineerGuy314 @.***> schrieb am Mo., 22. Juli 2024,
05:14:

I have not heard of anyone else experiencing this yet.
My only idea so far is to mention that (as long as you connect quickly
enough) it will do a hexdump to the terminal of the NVRAM when it boots. So
configure the settings via command line, and press to X to reboot.
Re-connect the serial terminal quickly and screenshot the dump. Repeat that
after a power cycle and see if the raw dump looks any different. It will be
interesting to see if if maybe it is reading all zeroes, or garbled data,
—
Reply to this email directly, view it on GitHub
https://github.com/EngineerGuy314/pico-WSPRer/issues/28#issuecomment-2241961991,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABKZWUENSGXNXHFEBYMVEEDZNR2KZAVCNFSM6AAAAABLA5OF5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBRHE3DCOJZGE
.
You are receiving this because you authored the thread.Message ID:
@.***>

I just realized that I have experienced this 2 or 3 times. (they were on custom PCB boards, and I had already snapped off the USB connector, so I had just assumed something else had gone wrong, and tossed them aside).
I will start digging into this. I am open to ideas.

I've been doing some testing, and it seems on very rare occasion, for reasons i cannot understand,  it will read shifted or corrupted data from the NVRAM (the data in the NVRAM itself isn't corrupted though). By design, as soon as the NVRAM is read, it runs the same feasibility-checking it does whenever you enter values from the user setup menu, and replaces any bad data with defaults, which obviously will ruin the flight. I need it to work that way so that when you first load the program into a new pico, it won't try to run the program with crazy data.
But I think the best way to fix this is that on power-up, it checks for good data. If it finds any bad data, instead of replacing it with defaults, it just pauses 10 seconds, then reboots. After reboot it will probably read the values correctly.
The 10 second delay is needed in case you are running the program on a brand new pico, the 10 seconds will give you a chance to enter the user-setup menu.
I suppose there is still a small chance that it reads corrupted data that is bad but still passes the feasibility check. In that case, at worst, the tracker will only be out of commission until the following dawn, when it will presumably read the data correctly.

That sound as a very good soloution. If implemented i will check it here.
Unfortunelly my test object just started yesterday. Have to solder a new
one first. 🙃
EngineerGuy314 @.***> schrieb am Di., 6. Aug. 2024,
05:15:

I've been doing some testing, and it seems on very rare occasion, for
reasons i cannot understand, it will read shifted or corrupted data from
the NVRAM (the data in the NVRAM itself isn't corrupted though). By design,
as soon as the NVRAM is read, it runs the same feasibility-checking it does
whenever you enter values from the user setup menu, and replaces any bad
data with defaults, which obviously will ruin the flight. I need it to work
that way so that when you first load the program into a new pico, it won't
try to run the program with crazy data.
But I think the best way to fix this is that on power-up, it checks for
good data. If it finds any bad data, instead of replacing it with defaults,
it just pauses 10 seconds, then reboots. After reboot it will probably read
the values correctly.
The 10 second delay is needed in case you are running the program on a
brand new pico, the 10 seconds will give you a chance to enter the
user-setup menu.
I suppose there is still a small chance that it reads corrupted data that
is bad but still passes the feasibility check. In that case, at worst, the
tracker will only be out of commission until the following dawn, when it
will presumably read the data correctly.
—
Reply to this email directly, view it on GitHub
https://github.com/EngineerGuy314/pico-WSPRer/issues/28#issuecomment-2270303339,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABKZWUDBEKLUVA3TP75FSRTZQA5WVAVCNFSM6AAAAABLA5OF5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZQGMYDGMZTHE
.
You are receiving this because you authored the thread.Message ID:
@.***>


Fullstack Capstone Project Kanban Board

Hello there this is our team Kanban boards 🔢

Our Team Has Four Members Which are Listed Below:
@mahammad-mostafa
@ITurres
@78fatemanazari
@demesameneshoa

Project URL for the back-end Kanban board https://github.com/users/mahammad-mostafa/projects/4
Project URL for the front-end Kanban board https://github.com/users/ITurres/projects/6/views/1
Back-end Kanban Board Screenshot:

Front-end Kanban Board Screenshot:

Hi,
Good job so far!
There are some issues that you still need to work on to go to the next project but you are almost there!

Required Changes ♻
According to the project requirements:

However:
1- You've created 1 extra Kanban board for a total of 2.
2- One of the boards has names for the columns "Important notes, backlog, in progress, In review".
3- Not all cards are tasks.
4- Not all cards have been assigned to someone.
5- I cannot check if the tasks pointings are equal (nobody should have more than 5 points than any member) because of item 4.
Therefore:

[ ] There should be only one Kanban board with all the tasks, even if the project spans 2 apps.
[ ] Ensure your board contains 4 columns named: "Todo, In progress, In review, Done".
[ ] Please, kindly don't include any cards that are not tasks (like meet the team, etc).
[ ] There shouldn't exist any card that hasn't been assigned to a person (or group of persons).
[ ] Please make sure that after the above is done, nobody in the team has 5 more points than any other member.

note and tip:  While it is very commendable to do opinionated work and of course there are several ways to do this task, in a job environment we are required to do what is required.  Chances are, on your brand new job, the same will apply to you.  👍
Cheers and Happy coding!👏👏👏

As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.


Update dev commands in documentation

Both README.md and CONTRIBUTING.md have incomplete documentation on how to spin up the dev environment for Alva.
CONTRIBUTING.md

Refers to an npm start script which does not exist.
Recommends using npm over yarn while I believe the opposite is now true.

README.md

Specifies a yarn lerna run watch command which does not work

From what I understand, the proper commands to spin up the dev environment are as follows (in separate terminals):

yarn webpack -w
yarn tsc -b -w
yarn alva

I don't mind creating a PR for these! Not sure if there are other places that may need to be updated?

Hey @zacktayl,
you're totally right, we should update it. I just created a PR for that (#753) – do you think it's understandable now?
Cheers,
Tilman

Looks great, @tilmx!


GET  api/v1/sellers/minsk

GET  api/v1/sellers/city - can be another city
creation of the necessary methods for the work of the point creation or adjustment of the endpoint And if it is not there, work here and there from request to response
acceptance criterion: request is accepted returns responses from the database sent to the front as Jason

https://docs.google.com/presentation/d/15vLIo346QQzIRfms5LKZ_lVYRW6e4JFl-Wuhn1jlRgE/edit#slide=id.g10736dc497d_0_0


Opinions on linter and formatter

So we started that discussion a bit on the discord sometime ago but did not come to any conclusion, but we should really agree on a linter options and auto-formatters for everyone to follow or force on commits with github actions.
I like black to auto-format and flake8 for linting. It helps to catch a lot of issues early.
black can be a bit harsh at first as it's really all or nothing but that's the point in python: there should only be one correct way to do things.

I'm personally ok with using both, the only thing that would be nice is if the line limit can be extended to 120 characthers

We can sent the max-line-length in black and flake8 to 119 which is the recommended length in Django and the default size of Github's own editor.

See #24


Add a setting to toggle notifications

Notifications are already toggleable in the settings for each specific case (Like notice board change notifications or the static schedule one).
What exactly do you mean?


roleAssignments returns HTTP Error 400. The request is badly formed.

Bug Report

github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/authorization/armauthorization/v2
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/authorization/armauthorization/v2 v2.1.1
-go version go1.20.4 darwin/arm64

What happened?
When calling the List for the new API with the same filters as specified in the documentation:

GET https://management.usgovcloudapi.net/subscriptions/{sub_id}/providers/Microsoft.Authorization/roleAssignments
--------------------------------------------------------------------------------
RESPONSE 400: 400 Bad Request
ERROR CODE UNAVAILABLE
--------------------------------------------------------------------------------
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\"http://www.w3.org/TR/html4/strict.dtd\">\r\n<TITLE>Bad Request</TITLE>\r\n<META HTTP-EQUIV=\"Content-Type\" Content=\"text/html; charset=us-ascii\">\r\n
Bad Request
\r\n

HTTP Error 400. The request is badly formed.
\r\n\r\n
--------------------------------------------------------------------------------

What did you expect or want to happen?
Should return the Roles Assignments for the principalId in the filter.
How can we reproduce it?

opts := azcore.ClientOptions{}
if o.IsAzureGovCloud {
	opts.Cloud = azcloud.AzureGovernment
}

armOpts := arm.ClientOptions{
	ClientOptions: opts,
}
rsClient, err := armauthorization.NewRoleAssignmentsClient(creds.SubscriptionID, creds, &armOpts)
if err != nil {
	return nil, fmt.Errorf("initializing new role assignments client: %w", err)
}
var res []armauthorization.RoleAssignment
f := fmt.Sprintf("principalId eq '%v'", principalID)
pager := rsClient.NewListForSubscriptionPager(
       &armauthorization.RoleAssignmentsClientListForSubscriptionOptions {
		Filter:   &f,
		TenantID: nil,
	})
for pager.More() {
	nextResult, err := pager.NextPage(ctx)
	if err != nil {
		return nil, err
	}
	for _, ra := range nextResult.Value {
		res = append(res, *ra)
	}
}

Thanks this is helpful.
Per the OpenAPI definition, the RoleAssignmentFilterParameter isn't supposed to be URL-encoded.  However, if I fix up the SDK code to encode the filter parameter then it works as expected.

@jhendrixMSFT any ETA on this, or do you have a hack we can apply?

@jhendrixMSFT we have another issue, the NewListForResourcePager it doesn't work in some cases.
--------------------------------------------------------------------------------
RESPONSE 400: 400 Bad Request
ERROR CODE UNAVAILABLE
--------------------------------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd"> <TITLE>Bad Request</TITLE> <META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii">
Bad Request

HTTP Error 400. The request is badly formed.

--------------------------------------------------------------------------------

I think this should get you unblocked.
f := url.QueryEscape(fmt.Sprintf("principalId eq '%v'", principalID))

@jhendrixMSFT any news on this? The solution you suggested doesn't work, if you do like that the call will work, but the filter won't be applied correctly, the response will contain records that are not from the principal. The code snippet you provided replaces white spaces by +, the correct comparing with the REST call I gave as example should be UTF-8 encoded %20.
We worked around from our side using rest calls, but quite unfortunate having such version of the sdk going to release like this.
Is this code all generated from OpenApi spec or can I submit a PR to fix this package?

Ian into this today and I found a solution. I'm not sure if the core issue is related to the REST endpoint, the Go SDK, or that everything is working fine and it's just a lack of documentation right now. The official documentation lacks an example that uses a principalId filter, so there's no way to tell what syntax to use. See details below.
Not working reproduction
My code was:
func main() {
	subscriptionID := "<subscription-id>"
	principalID := "<principal-id>"

	cred, _ := azidentity.NewDefaultAzureCredential(nil)
	clientFactory, _ := armauthorization.NewClientFactory(subscriptionID, cred, nil)
	client := clientFactory.NewRoleAssignmentsClient()

	filter := fmt.Sprintf("principalId eq %s", principalID)
	opts := &armauthorization.RoleAssignmentsClientListForSubscriptionOptions{
		Filter: &filter,
	}
	pager := client.NewListForSubscriptionPager(opts)

	var roleAssignments []*armauthorization.RoleAssignment
	for pager.More() {
		nextResult, err := pager.NextPage(context.TODO())
	...
}

And this resulted in an error being returned from pager.NextPage with a 400 status code and an "UnsupportedQuery" error code.
Solution
When trying different workarounds, including the ones suggested here, I found that these two techniques made it work:

URL-encode the filter string with url.QueryEscape, and surround the principal ID value with '.
URL-encode the filter string manually by replacing spaces in the fmt.Sprintf argument with the substring %%20 (to escape the %), and surround the principal ID value with '.

So, I think the missing piece here was to surround the principal ID with the single quotes.
This code ended up working for me:
func main() {
	subscriptionID := "<subscription-id>"
	principalID := "<principal-id>"

	cred, _ := azidentity.NewDefaultAzureCredential(nil)
	clientFactory, _ := armauthorization.NewClientFactory(subscriptionID, cred, nil)
	client := clientFactory.NewRoleAssignmentsClient()

	filter := url.QueryEscape(fmt.Sprintf("principalId eq '%s'", principalID))
	opts := &armauthorization.RoleAssignmentsClientListForSubscriptionOptions{
		Filter: &filter,
	}
	pager := client.NewListForSubscriptionPager(opts)

	var roleAssignments []*armauthorization.RoleAssignment
	for pager.More() {
		nextResult, err := pager.NextPage(context.TODO())
	...
}

(I preferred using url.QueryEscape over manually using %%20)
https://github.com/Azure/azure-sdk-for-go/issues/20847#issuecomment-1568017764 mentioned that their query wasn't working correctly because even though the request was successful, it returned more role assignments than it should have, thus not filtering at all. In my code that worked, my filter did restrict the role assignments correctly. It did not return more than it should have.

Thanks for sharing your solution, this is helpful. I've seen other examples (can't find it right now) where the filtered expression is enclosed in single quotes, so I suspect that this is the expected format.
@sandeep-sen do you know who we can follow up with on the service team about the expected format? In addition, the docs should be updated with an example.

Good timing. I was just filling out a documentation feedback form. I decided to just send them here for full context now that it's been acknowledged.

Adding a note here that this issue does not affect the deny assignments equivalent. Therefore, if you try to use the same string (where you manually escape characters) for Filter, it will return a 400. As of right now, you must not escape the string in order to get deny assignments and you must escape the string in order to get role assignments.


Release 0.5.0

Pull Request Test Coverage Report for Build 795

122 of 315 (38.73%)  changed or added relevant lines in 25 files are covered.
8 unchanged lines in 7 files lost coverage.
Overall coverage decreased (-1.5%) to 55.218%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

connectors/gridgo-keyvalue-common/src/main/java/io/gridgo/connector/keyvalue/KeyValueConstants.java
0
1
0.0%

connectors/gridgo-netty4/src/main/java/io/gridgo/socket/netty4/raw/codec/BelementDecoder.java
2
3
66.67%

connectors/gridgo-redis/src/main/java/io/gridgo/redis/command/string/RedisBitopHandler.java
0
1
0.0%

connectors/gridgo-netty4/src/main/java/io/gridgo/socket/netty4/raw/codec/BelementEncoder.java
4
6
66.67%

core/src/main/java/io/gridgo/connector/support/FormattedMarshallable.java
0
2
0.0%

connectors/gridgo-jetty-http/src/main/java/io/gridgo/connector/jetty/parser/DefaultHttpRequestParser.java
12
16
75.0%

connectors/gridgo-netty4/src/main/java/io/gridgo/socket/netty4/ws/Netty4WebsocketClient.java
3
7
42.86%

connectors/gridgo-netty4/src/main/java/io/gridgo/socket/netty4/ws/Netty4WebsocketServer.java
3
7
42.86%

connectors/gridgo-vertx-http/src/main/java/io/gridgo/connector/vertx/VertxHttpConsumer.java
12
20
60.0%

connectors/gridgo-rocksdb/src/main/java/io/gridgo/connector/rocksdb/RocksDBProducer.java
4
13
30.77%

Files with Coverage Reduction
New Missed Lines
%

connectors/gridgo-http-jdk/src/main/java/io/gridgo/connector/httpjdk/HttpJdkProducer.java
1
58.02%

connectors/gridgo-jetty-http/src/main/java/io/gridgo/connector/jetty/impl/AbstractJettyConsumer.java
1
72.22%

connectors/gridgo-vertx-http/src/main/java/io/gridgo/connector/vertx/VertxHttpConsumer.java
1
78.84%

connectors/gridgo-jetty-http/src/main/java/io/gridgo/connector/jetty/impl/AbstractJettyResponder.java
1
65.4%

connectors/gridgo-rocksdb/src/main/java/io/gridgo/connector/rocksdb/RocksDBConstants.java
1
0.0%

connectors/gridgo-netty4/src/main/java/io/gridgo/socket/netty4/ws/Netty4WebsocketUtils.java
1
27.42%

connectors/gridgo-redis/src/main/java/io/gridgo/redis/command/sortedset/RedisZrevRangeByLexHandler.java
2
0.0%

Totals

Change from base Build 704:
-1.5%

Covered Lines:
3513

Relevant Lines:
6362

💛  - Coveralls


feat: allow validating multiple definitions at once in the cli

Fixes #137 and #136
@davidjb this PR make it possible to validate multiple definitions at once and now support yaml. Would you mind having a look and let me know if it fixes your issues?
You can give it a try by checking out this branch, running npm install and running with npx ts-node
For instance:
npx ts-node ./bin/asl-validator.ts --json-path src/__tests__/definitions/valid-cfn-definition-substitutions.json --json-path src/__tests__/definitions/valid-catch-failure.json --yaml-definition "{}"

Which validates 2 json paths and 1 yaml definition, should output:
✓ State machine definition "src/__tests__/definitions/valid-cfn-definition-substitutions.json" is valid
✓ State machine definition "src/__tests__/definitions/valid-catch-failure.json" is valid
✕ State machine definition "YAML definition #1" is invalid:
 SCHEMA_VALIDATION_FAILED:  is invalid. must have required property 'StartAt'

Just confirming this also fixes some issues I was having with multiple files.  I can now add asl-validator to my pipeline!
Thank you!

@ChristopheBougere Thanks a lot for implementing this. Unfortunately needing to re-specify the type of the input/file between each filename means that globbing isn't feasible, e.g.
asl-validator --yaml-path statemachine/*.asl.yml

which gets expanded out to passing file names as later arguments:
asl-validator --yaml-path statemachine/one.asl.yml statemachine/two.asl.yml statemachine/three.asl.yml ...

This sort of varargs pattern is how both the shell globbing and pre-commit hooks framework works.
In other words, a user can check multiple files but still needs to explicitly name each file and its respective type one after the other as the path arguments differ. On this, needing to specify the type of the input (e.g. --yaml-path, --json-path) means it isn't feasible to generically call the validator, such as:
asl-validator --path *
asl-validator --path statemachine/*
asl-validator --path statemachine/*.{yaml,yml,json}

because you need to tell the validator the type ahead of time. This is less of an issue as you could invoke the validator once for JSON and once for YAML if a variable number of paths were able to be supported.

@davidjb I agree with your suggestion.  Here is a work around in bash:
ASL=$(ls *yml | awk '{a = a "--yaml-path="$1" "} END {print "asl-validator "a}')
${ASL}

Thanks for the feedback @davidjb
Does @jftuga work around solves your issue?

@ChristopheBougere No, not really - I appreciate the workaround but wouldn't say it solves the issue. A workaround like that isn't easily typed and would need a conditional to handle JSON/YAML differently given the requirement to tell the linter the type via an argument. All that could perhaps be aliased in your shell, but then a call to the validator depends on a subshell, piping and an awk program - and becomes brittle if/when asl-validator changes.
Typically, linters will default to taking a list of files/directories to lint as varargs (e.g. JavaScript's eslint or Python's Black)and processes the files and/or directories' contents recursively, with the linter figuring out the specifics internally.


nested components render

Expected behavior and actual behavior.
renderfunction of nested components are triggered, even though they got the same properties
renderfunction should only be triggered, when actually there are new objects
since mutation of objects is not allowed, a flat comparison is enough for equality-checking at the reconciler
Steps to reproduce the problem.
no change of props will trigger renderfunction
Specifications like the version of the project or browser version

fixed in #56


console command not working for removing the frontend cache

whenever you fire the console command ./yii cache/flush cacheFrontend then it's removing the console cache not frontend cache.
it's should be working for specific component name but it's give the below prompt but not working.
The following cache components will be flushed  cache  Flush above cache components? (yes|no) [no]:yes The following cache components were processed: 	* cache (yii\caching\FileCache)

Q
A

Yii version
2.0.9

PHP version
5.6

Operating system
Ubuntu 15.10

@samdark any suggestion from your end, because i think it's not any permission issue for removing the cache using console as per requested environment.
i have change the component name but still it's give the same prompt message.

https://github.com/yiisoft/yii2/blob/master/framework/console/controllers/CacheController.php#L35


Calculated filenames are not found.

At the moment I'm using in my project the file-existence-action to check if some files are available.
I download some files.
I'm assuming that the file 93.pdf is there
but, as I want to have the complete test dynamical, I read the number from a file...

bash-linux:
    runs-on: ubuntu-latest
    steps:
      - uses<EMAIL_ADDRESS>      - uses: pCYSl5EDgo/cat@master
        id: read_recent
        with:
          path: issues.txt
          trim: true
      - run: echo $TEXT
        env:
          TEXT: ${{ steps.read_recent.outputs.text }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      - uses<EMAIL_ADDRESS>      - name: Download Issues with start and end limit
        id: normalIssuesWithRange
        run: bash ./linux_mac/magpi-issue-downloader.sh -f $((${{steps.read_recent.outputs.text}}-6)) -l $((${{steps.read_recent.outputs.text}}-5))
.
.
.
     - name: "Check file existence Linux"
        id: check_files
        uses: andstor/file-existence-action@v1
        with:
          files: "issues/MagPi$((${{steps.read_recent.outputs.text}}-5)).pdf"
          allow_failure: false
      - name: lslah
        run: ls -lah  issues
      - name: File exists
        if: steps.check_files.outputs.files_exists == 'false'
        run: exit 1

The download itself works, as I can see in the lslah
The problem is, that the file existence check is looking for:
These files doesn't exist: issues/MagPi$((98-5)).pdf
see here
I guess it has something todo with this fs.access problem @elizabrock was also writing!
as @elizabrock wrote: it "checks for the literal existence of the string that is passed in."
Is there any way to solve this by calculate it in the action?

Hi 👋
What you are trying to do here is to run evaluate an arithmetic expression in bash. This action currently takes a string input. I do not think (at least for now) that we should eval the strings as bash "commands". Allowing globs you would greatly simplify the file-name matching by matching the file names with a pattern, but that's a whole other story.
Instead, I suggest you add an additional step for calculating the required string input for the action (for example with bash). Then you set the result as an output, see outputs for composite run steps actions , and use this output variable in the file-existence-action files: "issues/MagPi${{steps.calculated_recent_read.outputs.text}}.pdf".
We could of course add a flag for "evaluating" the input string, but then I would need some more arguments for why such a feature is necessary.

I did it now with extra separated calculated variables. and that works!
I close this issue for now, thank you


Unable to send test notifications if using default Notification URL

Describe the bug
When using a system default notification URL (telegram for example), the text box on the individual monitor remains empty. When you try to send a test notification, this causing an error message "Notification URL list is empty, cannot send test." It should instead pick up the system default and send the test through that URL.
Version
v0.45.17 on docker compose
To Reproduce
Steps to reproduce the behavior:

Set up a system default notification URL
Create a new monitor for any website
Inside the monitor notification settings, click use system defaults
Add content to the notification (can be anything)
Send test notification
See error

Share URL:
Not sure how useful this will be since this setup requires system default notifications to be set up
(https://changedetection.io/share/l16w6dnJ-oka)
Expected behavior
It should pick up the system default notification URL and send the notification through that.
Desktop (please complete the following information):

OS: macOs
Browser safari
Version 17.0 (196<IP_ADDRESS>.1)

this was fixed in 0.45.18 :)

Thanks for response, I updated to v0.45.18 but im still receiving the same error.
Note: I don't have this monitor in a tag group, just system defaults


fix: fix API Binary Media Types update issue

Codecov Report

Merging #954 into develop will increase coverage by 0.02%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           develop    #954      +/-   ##
==========================================
+ Coverage    94.78%   94.8%   +0.02%
==========================================
  Files           69      69
  Lines         3067    3079      +12
  Branches       578     580       +2
==========================================
+ Hits          2907    2919      +12
  Misses          84      84
  Partials        76      76

Impacted Files
Coverage Δ

samtranslator/model/api/api_generator.py
94.93% <100%> (+0.19%)
:arrow_up:

samtranslator/swagger/swagger.py
97.76% <100%> (+0.03%)
:arrow_up:

Continue to review full report at Codecov.

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