Notification enabled before connection

Describe the bug
Bond peripheral device to Moto G5 (Android 8.1.0). Reboot device which will reconnect.
On the log I observe that before connection callback is received I get callback about notification being enabled.
CCC changes are notified from channel ops callback called from bt_l2cap_connected. This last function is called from bt_conn_set_state on BT_CONN_CONNECTED state. Now note that notify_connected is called from the same place but after bt_l2cap_connected. This explains why information about callback is sent to application after information about notification being enabled.
To Reproduce
Described above.
Impact
Application does not know which connection ccc change relates to as there is no conn argument in the callback.
Screenshots or console output
[00009340] <inf> ble_adv: Advertising started
[00065351] <err> bt_hci_core: PDUNAJ enh_conn_complete 839
[00065355] <err> bt_hci_core: PDUNAJ enh_conn_complete 958 conn=0x20002554
[00065356] <err> bt_gatt: PDUNAJ bt_gatt_connected 2429 conn 0x20002554
[00065357] <err> bt_gatt: PDUNAJ connected_cb 1078
[00065357] <err> bt_gatt: PDUNAJ gatt_ccc_changed 644
[00065357] <err> ble_gatt_hids: PDUNAJ hids_input_report_ccc_changed 440
[00065358] <err> hids: PDUNAJ mouse_notif_handler 135
[00065358] <err> hids: PDUNAJ notif_handler 125
[00065358] <err> hids: PDUNAJ broadcast_subscription_change 72 conn=0x00000000
[00065359] <inf> hids: Notifications enabled
[00065359] <err> bt_gatt: PDUNAJ connected_cb 1078
[00065359] <err> bt_gatt: PDUNAJ gatt_ccc_changed 644
[00065360] <err> ble_gatt_hids: PDUNAJ hids_boot_mouse_inp_rep_ccc_changed 494
[00065360] <err> hids: PDUNAJ boot_mouse_notif_handler 142
[00065360] <err> hids: PDUNAJ notif_handler 125
[00065361] <err> bt_conn: PDUNAJ notify_connected 136 conn=0x20002554 cb=0x00003f01
[00065363] <inf> ble_state: Connected to 80:58:f8:56:19:ce (public)
[00065364] <inf> ble_state: Set security level
[00065368] <inf> event_manager: e: hid_report_subscription_event MOUSE report notification enabled by 0x00000000
[00065370] <inf> event_manager: e: ble_peer_event id=0x20002554 CONNECTED

Environment (please complete the following information):
ncs zephyr 236ec2d2553536835c76dff84adcb188309eaf90
zephyr dee63e20
Additional context
I this it worked in the past... although I see no changes related to this done recently. Maybe something else changed or this was overlooked...

@Vudentz any thoughts on this one?

The L2CAP needs to be initialized properly in order to start receiving request on the channels, so changing the order is not really an option, besides the use of BT_GATT_CCC is recommended only when the user don't need to descriminate the connections thus why the callback don't have a connection parameter since the application shall be passing NULL to bt_gatt_notify/bt_gatt_indicate and the stack will properly propagate the notifications for the connected peers which had it enabled.
We could perhaps add the connection which first change the consolidated setting but the application won't see other connections which just happen to have the same configuration, it is just the first connection to enable and the last to disable that triggers the callback just to inform when the application shall be notifying/indicating or not.
A second option is to delay the enabling the changed callback, though with that applications won't be able to react to new connections as quickly as they used to be.

I tried solving this issue and came up with the following change:
https://github.com/kapi-no/zephyr/commit/9cd0c9e0b722f84654a6118637fcd46e6c57c37c
Basically, it synchronizes connected callbacks with bt_gatt_connected function, which triggers CCC changed callbacks. @Vudentz, is it acceptable for you or do you see any side effects with this approach (apart from the mentioned delay)?

@kapi-no That pehaps is not too bad, I though bt_gatt_connected was doing some context initialization but that is done in bt_att_connected so all it is pushing back is CCC logic which perhaps is ok. We could perhaps add some code to initialize the CCC if the application start submitting GATT procedures, though perhaps that is no necessary since those procedures are most likely GATT client since notification/indiction are controlled via CCC.
That said Id like to understand why does the application needs to know who is connected on the CCC callback, perhaps that is something we didn't envision when creating that API, or it is the same situation of mesh control points which do need to know the connections in order to react properly.

@Vudentz , one example can a HID device that is simultaneously connected to several hosts (all of which enabled notifications) and allows user to select to which host HID reports will go to.
In short application must know which host enabled notifications (i.e. which hosts are ready to received data) and must be able to target a specific host on it's level (i.e. we cannot assume that stack will select a correct host for us).

Well, the proposed change only fixes the order of callbacks received by the application: the connected callback should precede ccc_changed callback. I opened a PR for it, where we can discuss further details:
https://github.com/zephyrproject-rtos/zephyr/pull/13473
As you also noticed, we would like to modify ccc_changed API to include connection object as an additional callback parameter. The reason for it is to better target notification's recipients (GATT clients). We would like to be able to choose a specific conn target and send the notification only to this single target even though other connected GATT clients may have notifications enabled. (In this case, we can't pass NULL to bt_gatt_notify and let the stack propagate notifications.) To be able to do that, it's necessary to keep track of connected peers that have notifications enabled for the given CCC.

@kapi-no , the issue is only for the order but all-in-all this two things are connected.

Well even if we introduce a conn to the CCC callback you had still do the mapping with the actual connection which are enabled to receive notifications.

@Vudentz , one example can a HID device that is simultaneously connected to several hosts (all of which enabled notifications) and allows user to select to which host HID reports will go to.

I supose this means the device would not even be connected, or there is a reason to connect if you won't send any data to them? Or there is some other limitation we are not aware of? Perhaps not supporting directed advertisements?

Hi @Vudentz , example can be a seamless transition between hosts. You start connection to host 2 while maintaining connection to host 1. You switch data flow to host 2 only after it is connected and ready to receive data. I know some companies may want to have this model.

@Vudentz, @kapi-no, just to clarify - at the moment we don't need to identify the conn from notification as we use only one. It may be that we won't need it for some time but it can come as a request at some point.
But we still need to have correct sequence connect->notify.

Hi @Vudentz , example can be a seamless transition between hosts. You start connection to host 2 while maintaining connection to host 1. You switch data flow to host 2 only after it is connected and ready to receive data. I know some companies may want to have this model.

Right, here are some options that I can think of:

Add an API to disable the subscription at server side which would then be checked by bt_gatt_notify/bt_gatt_indicate before they are sent out. One can already do something like this by changing the value on bt_gatt_ccc_cfg which actually comes from the application.

Add a callback bt_gatt_notify/bt_gatt_indicate which is called to authorize the notification sending.

Both 1 and 2 avoid having to have the application managing connections directly, but option 2 may break the API of bt_gatt_notify since there is no struct to append new fields like in bt_gatt_indicate.

We need to reopen this one as we see problem with it.
@kapi-no when gatt is notified about connection error is not checked. It can happen that connection failed and in this case notification will still be sent. We observe that when direct advertised connection fails.


Broken support for Unity

After the new Update, trying to open scripts from Unity threw some errors because of the wrong path. I solved it by entering the full path to the folder where @code is installed.

@allencage I don't know what paths you are referring to, but make sure to read at least this section: https://code.visualstudio.com/Updates#_debugging
So try to fix the paths by prepending a ${workspaceRoot}


Update GRPC version

What is the goal of this PR?
Update GRPC version

Please do not use content of this PR, the GRPC in dependencies has been downgraded. If we upgrade again, we need to make the change first in dependencies again.


[bug]: Table not rendering

What version of strapi-design-system are you using?
npm: 8.19
nodejs: 18
strapi - design-system: 1.6.5
browser: Chrome
What's Wrong?
after updating to the latest strapi and design-system version my table breaks, ima rendering year view calendar, i just copied following code and replace with strapi table components, everything was working in before last update
https://github.com/BelkaLab/react-yearly-calendar

To Reproduce
build a table
Expected Behaviour
render a table

Im saying that table components { Table, Thead, Tbody, Tr, Th } are not working for a table that I'm using in strapi backend.
I used code from react-yearly-calendar and replace native { table, thead, tbody, tr, th } with strapi-design-system components { Table, Thead, Tbody, Tr, Th } and everything was working till the last update, and now I get an error like in first post.
for now, i replaced strapi-design-system  components { Table, Thead, Tbody, Tr, Th } back to native { table, thead, tbody, tr, th } and it's working again, so it seems there is some problem with strapi-design-system

for now, i replaced strapi-design-system components { Table, Thead, Tbody, Tr, Th } back to native { table, thead, tbody, tr, th } and it's working again, so it seems there is some problem with strapi-design-system components { Table, Thead, Tbody, Tr, Th }

Right I see, this hasn't broken any of the tables we use in the CMS, so i'd need to you to supply a reproduction of your issue please, here's a sandbox template to get you started – https://codesandbox.io/s/focused-gates-0bgt3l?file=/src/App.js

for now, i replaced strapi-design-system components { Table, Thead, Tbody, Tr, Th } back to native { table, thead, tbody, tr, th } and it's working again, so it seems there is some problem with strapi-design-system components { Table, Thead, Tbody, Tr, Th }

Right I see, this hasn't broken any of the tables we use in the CMS, so i'd need to you to supply a reproduction of your issue please, here's a sandbox template to get you started – https://codesandbox.io/s/focused-gates-0bgt3l?file=/src/App.js

I copied code here:
https://codesandbox.io/s/tender-roman-z1chip

Ah i see what's happening. We clone the children and pass them props (to give them their row number and column number) but you're not passing these props down, so for example:
const Calendar = () => {
	return (

					<Day />
					<DayWithProps />

	)
}

// This will fail
const Day = () => {
	return
}

// This will work
const DayWithProps = props => {
	return
}

This doesn't just go for Td iirc it applies to most of the component at the moment – Tr / Th

@joshuaellis ok, what should I do? or does DS need to change something?

you should pass all your props like I showed you in the example, otherwise your component is not accessible because no cell knows where they are etc. so anything that renders those components listed above should spread the rest of props that way it'll include the parent's passed props fixing the issue you're having.


Tensorflow build on Bazel takes longer than 24Hrs

Hello Guys, I got a question.. I want to get Tensorflow on my Rasberypi 3b+ and found here the Tutorial to build Tensorflow on Bazel.. After several attempts i got it.. to the point wherenitiate TensorFlow  the build with: bazel build -c opt --copt="-mfpu=neon-vfpv4" --copt="-ftree-vectorize" --copt="-fomit-frame-pointer" --local_resources 1024,1.0,1.0 --verbose_failures tensorflow/tools/pip_package:build_pip_package

now it stuck since 20 Hours maybe here ..
it is normal? or im just should still waiting

its not really stuck the seconds they go up

its not really stuck the seconds they go up

My assumption is you don't have enough memory to run the build. Do "htop" and see if you have enough memory/free threads to run the build.

Nagging Assignee @cy89: It has been 17 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

Nagging Assignee @cy89: It has been 32 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

Nagging Assignee @cy89: It has been 47 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

So guys, sorry for the late response... but i killed the project. Its not working.. finally i found a soloution which is called tensorflow for poets. It works quite well but not fast enough. Its done with native pip. Now i just use the rasberry pi as a "connector" and my tf runs on a vm server. Its  fast and stable and i can train my own models. I get a connection with a rest api (flask) and can send some picture to it from a smartwatch or a mobilephone, notebook and so on. But thanks for help guys. The rasberry pi is not really good for it I think because the perfomance is really really bad.. maybe i am done somthing wrong but now it work with my solution :P

@alex2425 that makes sense. Raspberry Pis aren't known for their processing power. I'll close; reopen if you'd like to revive.


xautolock: implement basic test to confirm functionality

Motivation for this change
Things done

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

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

[x] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
[x] Tested execution of all binary files (usually in ./result/bin/)
[x] Fits CONTRIBUTING.md.

/cc @grahamc

@GrahamcOfBorg test xautolock

No attempt on aarch64-linux
The following builds were skipped because they don't evaluate on aarch64-linux: tests.xautolock
No log is available.

No attempt on x86_64-linux
The following builds were skipped because they don't evaluate on x86_64-linux: tests.xautolock
No log is available.

ok, I'm confused. Did I screw something up or does this seem to be a bug of the bot?

@grahamc  Have we used ofborg for any tests since evaluation checks have landed?

I don't think so... seems like a bug. Looking.

Nope, the problem is with the test:
$ HOME=/homeless-shelter NIX_PATH=nixpkgs=$(pwd) nix-instantiate ./nixos/release.nix -A tests.xautolock --option restrict-eval true --option build-timeout 1800 --arg supportedSystems '["x86_64-linux"]'
error: anonymous function at /home/grahamc/projects/nixpkgs/nixos/tests/xautolock.nix:1:25 called with unexpected argument 'system', at /home/grahamc/projects/nixpkgs/nixos/tests/make-test.nix:5:41

After:
diff --git a/nixos/tests/xautolock.nix b/nixos/tests/xautolock.nix
index 38ba668e00e..ee46d9e05b0 100644
--- a/nixos/tests/xautolock.nix
+++ b/nixos/tests/xautolock.nix
@@ -1,4 +1,4 @@
-import ./make-test.nix ({ pkgs, lib }:
+import ./make-test.nix ({ pkgs, lib, ... }:

 with lib;

it works:
[nix-shell:~/projects/nixpkgs]$ HOME=/homeless-shelter NIX_PATH=nixpkgs=$(pwd) nix-instantiate ./nixos/release.nix -A tests.xautolock --option restrict-eval true --option build-timeout 1800 --arg supportedSystems '["x86_64-linux"]'
warning: you did not specify '--add-root'; the result might be removed by the garbage collector
/nix/store/qp2j5p486avf4m55d1mdgpbx8nv7l0gm-vm-test-run-xautolock.drv

TODO: Publish the logs from a failed evaluation  :D

ahh thx, sorry for this (tested it with nix-build ./nixos/tests/xautolock.nix and it successfully built)

@GrahamcOfBorg test xautolock

No attempt on x86_64-linux
The following builds were skipped because they don't evaluate on x86_64-linux: tests.xautolock
No log is available.

:|

@GrahamcOfBorg test xautolock
once more for old times' sake.

No attempt on x86_64-linux
The following builds were skipped because they don't evaluate on x86_64-linux: tests.xautolock
No log is available.

just to confirm, the command you used worked perfectly fine for me:
→ HOME=/homeless-shelter NIX_PATH=nixpkgs=$(pwd) nix-instantiate ./nixos/release.nix -A tests.xautolock --option restrict-eval true --option build-timeout 1800 --arg supportedSystems '["x86_64-linux"]'
warning: you did not specify '--add-root'; the result might be removed by the garbage collector
/nix/store/vdgqdgb3m4c7gqgls38nn3d9ki4ldnr3-vm-test-run-xautolock.drv

I unfortunately lack some inside knowledge of our testing bot, but please let me know if there's anything I can do to resolve this issue.

OK I've identified the problem:
[root@builder-0-gustav:/var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/builder-0-gustav.ewr1.nix.ci]# HOME=/homeless-shelter NIX_PATH=nixpkgs=$(pwd) nix-instantiate ./nixos/release.nix -A tests.xautolock --option restrict-eval true --option build-timeout 1800 --arg supportedSystems '["x86_64-linux"]'
error: assertion failed at /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/builder-0-gustav.ewr1.nix.ci/pkgs/build-support/closure-info.nix:11:1
(use ‘--show-trace’ to show detailed location information)

In other words, I forgot to use Nix 2 on these boxes. Please hold.

FWIW here is the ongoing log for aarch64: https://logs.nix.ci/?attempt_id=e0e77309-9366-42f0-a004-5a07868fccea&key=nixos%2Fnixpkgs.36706

continues to do the same thing over and over again, expecting different results
@GrahamcOfBorg test xautolock

Failure on aarch64-linux (full log)
Attempted: tests.xautolock
Partial log (click to expand)
machine: running command: journalctl -b SYSLOG_IDENTIFIER=systemd | grep 'session opened'
machine: exit status 1
error: action timed out after -1 seconds at /nix/store/vhy2am16zcdlav555dbdf7rjdb8786l9-nixos-test-driver/lib/perl5/site_perl/Machine.pm line 227, <__ANONIO__> line 901.
action timed out after -1 seconds at /nix/store/vhy2am16zcdlav555dbdf7rjdb8786l9-nixos-test-driver/lib/perl5/site_perl/Machine.pm line 227, <__ANONIO__> line 901.
cleaning up
killing machine (pid 627)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
builder for '/nix/store/nq5j4442mkly47dycy4rnqhfc5cd8jpa-vm-test-run-xautolock.drv' failed with exit code 255
error: build of '/nix/store/nq5j4442mkly47dycy4rnqhfc5cd8jpa-vm-test-run-xautolock.drv' failed

Changed the nix package in a new place ...
@GrahamcOfBorg test xautolock

Mar 13 20:26:49 builder-0-gustav.ewr1.nix.ci ofborg-builder-start[22293]: Can build: tests.xautolock, Cannot build:

Progress!

https://logs.nix.ci/?attempt_id=90025520-3cd0-466b-9140-550fa2401162&key=nixos%2Fnixpkgs.36706

Success on x86_64-linux (full log)
Attempted: tests.xautolock
Partial log (click to expand)
machine: exit status 1
syncing
machine: running command: sync
machine: exit status 0
test script finished in 143.96s
cleaning up
killing machine (pid 593)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
/nix/store/h5liybcy7r2ra38dy6f8clcc40xzda4i-vm-test-run-xautolock

Success on x86_64-linux (full log)
Attempted: tests.xautolock
Partial log (click to expand)
machine: exit status 1
syncing
machine: running command: sync
machine: exit status 0
test script finished in 143.10s
cleaning up
killing machine (pid 593)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
/nix/store/8adqvwp3m5vlxj5va78g2rgdsw814isp-vm-test-run-xautolock

Failure on aarch64-linux (full log)
Attempted: tests.xautolock
Partial log (click to expand)
machine: running command: journalctl -b SYSLOG_IDENTIFIER=systemd | grep 'session opened'
machine: exit status 1
error: action timed out after -1 seconds at /nix/store/vhy2am16zcdlav555dbdf7rjdb8786l9-nixos-test-driver/lib/perl5/site_perl/Machine.pm line 227, <__ANONIO__> line 901.
action timed out after -1 seconds at /nix/store/vhy2am16zcdlav555dbdf7rjdb8786l9-nixos-test-driver/lib/perl5/site_perl/Machine.pm line 227, <__ANONIO__> line 901.
cleaning up
killing machine (pid 627)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
builder for '/nix/store/738paar0hwyyyk9rh8hi2y894f4vwj4n-vm-test-run-xautolock.drv' failed with exit code 255
error: build of '/nix/store/738paar0hwyyyk9rh8hi2y894f4vwj4n-vm-test-run-xautolock.drv' failed

Success on x86_64-linux (full log)
Attempted: tests.xautolock
Partial log (click to expand)
machine: exit status 1
syncing
machine: running command: sync
machine: exit status 0
test script finished in 143.18s
cleaning up
killing machine (pid 593)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
/nix/store/c1fn6p23i7p4h4wa5i42l1yz10gnwrc2-vm-test-run-xautolock

Success on x86_64-linux (full log)
Attempted: tests.xautolock
Partial log (click to expand)
machine: exit status 1
syncing
machine: running command: sync
machine: exit status 0
test script finished in 142.89s
cleaning up
killing machine (pid 593)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
/nix/store/jdpcb4rlh8lhlif2rp250y53nw0ns9j4-vm-test-run-xautolock

well, as it breaks at journalctl -b SYSLOG_IDENTIFIER=systemd | grep 'session opened' it's likely that the actual issue on aarch64 is related to $machine->waitForX;.
And thanks a lot for your support <3

Success on x86_64-linux (full log)
Attempted: tests.xautolock
Partial log (click to expand)
machine: exit status 1
syncing
machine: running command: sync
machine: exit status 0
test script finished in 143.44s
cleaning up
killing machine (pid 593)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
/nix/store/i1f4vwbda6yyh3s15zf0lkqp90n1gaql-vm-test-run-xautolock

Failure on aarch64-linux (full log)
Attempted: tests.xautolock
Partial log (click to expand)
machine: running command: journalctl -b SYSLOG_IDENTIFIER=systemd | grep 'session opened'
machine: exit status 1
error: action timed out after -1 seconds at /nix/store/vhy2am16zcdlav555dbdf7rjdb8786l9-nixos-test-driver/lib/perl5/site_perl/Machine.pm line 227, <__ANONIO__> line 901.
action timed out after -1 seconds at /nix/store/vhy2am16zcdlav555dbdf7rjdb8786l9-nixos-test-driver/lib/perl5/site_perl/Machine.pm line 227, <__ANONIO__> line 901.
cleaning up
killing machine (pid 627)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
builder for '/nix/store/s45hy9v5q2f49ylhxysiqj4vsnkpjcdl-vm-test-run-xautolock.drv' failed with exit code 255
error: build of '/nix/store/s45hy9v5q2f49ylhxysiqj4vsnkpjcdl-vm-test-run-xautolock.drv' failed

Indeed:
machine# [   18.543456] display-manager[642]: (WW) Falling back to old probe method for modesetting
machine# [   18.550807] display-manager[642]: (EE) open /dev/dri/card0: No such file or directory
machine# [   18.558055] display-manager[642]: (EE) No devices detected.
machine# [   18.563576] display-manager[642]: (EE)
machine# [   18.567755] display-manager[642]: Fatal server error:
machine# [   18.572923] display-manager[642]: (EE) no screens found(EE)
machine# [   18.578363] display-manager[642]: (EE)
machine# [   18.582023] display-manager[642]: Please consult the The X.Org Foundation support
machine# [   18.587597] display-manager[642]:    at http://wiki.x.org
machine# [   18.591699] display-manager[642]:  for help.
machine# [   18.595072] display-manager[642]: (EE) Please also check the log file at "/dev/null" for additional information.
machine# [   18.602529] display-manager[642]: (EE)
machine# [   18.605539] display-manager[642]: (EE) Server terminated with error (1). Closing log file.
machine# [   18.966152] display-manager[642]: Giving up.
machine# [   18.971057] display-manager[642]: slim: unable to connect to X server

Failure on aarch64-linux (full log)
Attempted: tests.xautolock
Partial log (click to expand)
machine: running command: journalctl -b SYSLOG_IDENTIFIER=systemd | grep 'session opened'
machine: exit status 1
error: action timed out after -1 seconds at /nix/store/vhy2am16zcdlav555dbdf7rjdb8786l9-nixos-test-driver/lib/perl5/site_perl/Machine.pm line 227, <__ANONIO__> line 901.
action timed out after -1 seconds at /nix/store/vhy2am16zcdlav555dbdf7rjdb8786l9-nixos-test-driver/lib/perl5/site_perl/Machine.pm line 227, <__ANONIO__> line 901.
cleaning up
killing machine (pid 627)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
builder for '/nix/store/ggz1x8m35clpzws32lvj4xs308fcr786-vm-test-run-xautolock.drv' failed with exit code 255
error: build of '/nix/store/ggz1x8m35clpzws32lvj4xs308fcr786-vm-test-run-xautolock.drv' failed

Failure on aarch64-linux (full log)
Attempted: tests.xautolock
Partial log (click to expand)
machine: running command: journalctl -b SYSLOG_IDENTIFIER=systemd | grep 'session opened'
machine: exit status 1
error: action timed out after -1 seconds at /nix/store/vhy2am16zcdlav555dbdf7rjdb8786l9-nixos-test-driver/lib/perl5/site_perl/Machine.pm line 227, <__ANONIO__> line 901.
action timed out after -1 seconds at /nix/store/vhy2am16zcdlav555dbdf7rjdb8786l9-nixos-test-driver/lib/perl5/site_perl/Machine.pm line 227, <__ANONIO__> line 901.
cleaning up
killing machine (pid 627)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
builder for '/nix/store/abx9c39hlxik2gqsa8ixidcbb0alazfq-vm-test-run-xautolock.drv' failed with exit code 255
error: build of '/nix/store/abx9c39hlxik2gqsa8ixidcbb0alazfq-vm-test-run-xautolock.drv' failed

Failure on aarch64-linux (full log)
Attempted: tests.xautolock
Partial log (click to expand)
machine: running command: journalctl -b SYSLOG_IDENTIFIER=systemd | grep 'session opened'
machine: exit status 1
error: action timed out after -1 seconds at /nix/store/vhy2am16zcdlav555dbdf7rjdb8786l9-nixos-test-driver/lib/perl5/site_perl/Machine.pm line 227, <__ANONIO__> line 901.
action timed out after -1 seconds at /nix/store/vhy2am16zcdlav555dbdf7rjdb8786l9-nixos-test-driver/lib/perl5/site_perl/Machine.pm line 227, <__ANONIO__> line 901.
cleaning up
killing machine (pid 627)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
builder for '/nix/store/7ixxr3m23nj66b3vz4kridk7kvdcvvk4-vm-test-run-xautolock.drv' failed with exit code 255
error: build of '/nix/store/7ixxr3m23nj66b3vz4kridk7kvdcvvk4-vm-test-run-xautolock.drv' failed

Failure on aarch64-linux (full log)
Attempted: tests.xautolock
Partial log (click to expand)
machine: running command: journalctl -b SYSLOG_IDENTIFIER=systemd | grep 'session opened'
machine: exit status 1
error: action timed out after -1 seconds at /nix/store/vhy2am16zcdlav555dbdf7rjdb8786l9-nixos-test-driver/lib/perl5/site_perl/Machine.pm line 227, <__ANONIO__> line 901.
action timed out after -1 seconds at /nix/store/vhy2am16zcdlav555dbdf7rjdb8786l9-nixos-test-driver/lib/perl5/site_perl/Machine.pm line 227, <__ANONIO__> line 901.
cleaning up
killing machine (pid 627)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
builder for '/nix/store/pxnzgkkii7f4r77xiivscr0hklpvhl4h-vm-test-run-xautolock.drv' failed with exit code 255
error: build of '/nix/store/pxnzgkkii7f4r77xiivscr0hklpvhl4h-vm-test-run-xautolock.drv' failed

I think deleting my comments asking for the bot to run triggered the bot :')

Failure on aarch64-linux (full log)
Attempted: tests.xautolock
Partial log (click to expand)
machine: running command: journalctl -b SYSLOG_IDENTIFIER=systemd | grep 'session opened'
machine: exit status 1
error: action timed out after -1 seconds at /nix/store/vhy2am16zcdlav555dbdf7rjdb8786l9-nixos-test-driver/lib/perl5/site_perl/Machine.pm line 227, <__ANONIO__> line 901.
action timed out after -1 seconds at /nix/store/vhy2am16zcdlav555dbdf7rjdb8786l9-nixos-test-driver/lib/perl5/site_perl/Machine.pm line 227, <__ANONIO__> line 901.
cleaning up
killing machine (pid 627)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
builder for '/nix/store/p2djh1xks7wdx306i2pay48k0w3r5m06-vm-test-run-xautolock.drv' failed with exit code 255
error: build of '/nix/store/p2djh1xks7wdx306i2pay48k0w3r5m06-vm-test-run-xautolock.drv' failed

thx! and thanks again for your help :)


Added a stream based way to load credentials

I built it for my own purpose (I save the json in my embedded resources).
Could be useful for other people aswell.

@janniksam Thanks for your Pull Request! I will see what's the best way to integrate it. 😎

It's my first pull request, so please have mercy with me :)

No worries! Good work. 😎

I just thought yesterday: There are probably a million more ways to read the Settings. And this "FileBased..." is too long for a human brain to remember. 😅 I would have to Google for an example each time I  use the library. An extension method doesn't fit. Maybe something like a SettingsUtils class with the static methods for reading from File or Stream.

@janniksam What do you think would be the most intuitive way? Good API Design is hard. 🤔

Unfortunately I am not that good at designing, I always have a bad feeling when it comes to that topic.
But let me try:
Just like you said, SettingsUtils sounds fine too me. But I don't like "Utils". "Utils" is like "Manager". It sounds like a class that tends to do alot of things instead of having one single purpose. In my opinion It breaks the principle "seperation of concerns". Maybe "Creator" would fit in this case.
One thing I saw in your code is, that your class is namemd FileBased.... and the method inside is called ReadFromFile or something like this. It's a personal preference, but I don't like that, I think it is redundant.
So, what you should do (imho):

Create a SettingsCreator class.
Create methods called:
---> CreateFromFile
---> CreateFromStream
---> CreateFromJson (accepting the json string

And last but not least,- I think it's self explanatory:

Do not delete your FileBased.... for the next few releases. It would break existing apps consuming your code. Instead mark it as "Obsolete("Use SettingsCreator") or similar.

Sorry I didn't mean to write that much. ;)

Thanks for your opinion! It's too late to remove the class anyway. 🤣 Deprecating it is a good idea for a soft upgrade path. Yes I didn't like this design, either... but then it was commited and too late. 😳 Creator sounds good, I will add this and deprecate the other method.


Specific implemenation for Seq prependAll : should reuse Seq.prepend

Simple for loop prepending each element will be more performant than the current implementation.

Better to make plusAll efficient and have prependAll retain ordering of the supplied colleciton.

Closing - address in a future release under #1057


[role=""] items not being styled for desktop...

Things that are targeted using roles (e.g. [role="banner"]) are not being rendered in IE. My issue started here https://github.com/keithclark/selectivizr/issues/23
[link removed]
The above page is only loading roles for the mobile first (style.css) stylesheet. Anything that starts with header[role="banner"], for example, is keeping it's basic style, e.g. it is not rendering role based styles from 768.css and upward on a desktop with IE
Many thanks,
Glen.

Could you please provide a minimal test case using http://jsfiddle.net/ or similar? Thank you!

I have never used JSFiddle, so hope I have done things correctly here: http://jsfiddle.net/GgrnB/      or full result here http://jsfiddle.net/GgrnB/embedded/result/
This will, hopefully, show what I mean.
I do use selectivizr also, for css selectors in IE. But my basic problem is anything defined in css as a [role=""] is not being rendered in ie7.

I ran into the same issue over the weekend and commented on it with selectivizr. Here's the gist of that:
Check out this demo on IE7: http://alexlande.com/respond-test/.
The first div, styled by [role="main"] doesn't change colors. It works fine on IE8 and even IE6, strangely enough.
Working on my personal site over the weekend, I ended up dropping respond.js for the time being and directing the large screen styles to IE the way that Andy Clarke is doing on his redesign. I imagine that if he had kept using respond he would have run into the same problem.

I've investigated this. The problem is IE7 is not honouring new style rules if they contain attribute selectors and it's not limited to [role].
More info: https://github.com/keithclark/selectivizr/issues/23#issuecomment-3006109

Okay, in testing this just now, it appears that a fix I'm about to apply for another issue (issue #83) fixes this one too! The trick to preserving selectors in IE after injecting them into the DOM appears to be that the styles need to be inserted into the style element after it's appended to the DOM.
@keithclark - do you find similar?
https://github.com/keithclark/selectivizr/issues/23#issuecomment-3006109


possible bug with blade component with variable named 'data'

Laravel Version: 8.6.9
PHP Version: 7.4.26
Database Driver & Version: Database not involved in bug

Description:
The bug happens when you have a blade template file that calls a component with two variables and one of the variables is named '$data'.
In this situation laravel throws an error that $data is undefined but if you change de name of the variable to something else the code runs fine.
Steps To Reproduce:
1 - Create a invokable controller with his corresponding web route.
2 - Create a blade template and a component.
3 - From the controller return a view which is the blade template calling the component. And pass some data.
4 - Implement the component blade template and class.
5 - Run the app and if one variable passed from the blade template to the component is called '$data' laravel complains that $data is undefined, if you change the name to something else the app works fine.
I have made a repository reproducing the error: https://github.com/rogermedico/component-with-data-field
I know it's not a framework breaking bug but I have spent some time to identify what was happening and if I can help someone to avoid that time it will be good.

$data is reserved: https://laravel.com/docs/8.x/blade#reserved-keywords


Restarting a debug preLaunchTask alerts that it terminated with exit code undefined

While verifying https://github.com/microsoft/vscode/issues/84794
Restarting a debug preLaunchTask alerts that it terminated with exit code undefined

Maybe in this scenario the debug session should automatically be cancelled?

Why do you think @connor4312 @weinand this case should be handled differently?
Do you restart the task while debug has not yet started? If yes I think it is a legitimate question to ask the user if he still wants to debug.
@alexr00 in case we decide to treat this scenario differently how can I know if a task terminated due to user initiation or not?

Problem 1: I think the message "prelaunchTask 'xxx' terminated with exit code undefined" is bad in general (independent from the "restart" context).
Even if a user understands the Unix concept "exit code", it does not make sense to talk about "exit code undefined" because "undefined" is not a part of the Unix concept but is an implementation detail (or better: a bug) of VS Code. A user cannot fix his prelaunchTask to stop returning "undefined".
So we need to fix the error message by something like this: "execution of prelaunchTask 'xxx' failed". With this we would not bother the user with unnecessary implementation or Unix details.
Problem 2: should we really show this alert in this "Restart" context or should we silently cancel or continue the Restart?
Assume that a given prelaunchTask works perfectly fine but when being cancelled (e.g. as part of the Restart) fails. Showing always the alert in this case would result in a bad user experience.
From this perspective I think it would make sense to ignore a failing prelaunchTask if it was cancelled as part of a Restart. The subsequent prelaunchTask will succeed (because it is not cancelled) and the debug session will start without problems.

@isidorn the exitCode of the ITaskSummary from running the task will be undefined if the task is canceled by the user.

For problem 1 I have pushed a fix.
@alexr00 thanks, I can use that
@weinand please note that @connor4312 is restarting a task, not a debug session. Restarting a debug session produces no dialog message, it just works

How do I "restart a debug preLaunchTask"?

F1 > tasks: rerun running task

But this will only result in an Alert with an "Debug Anyway" button if the original task was a prelaunch task, correct?
If yes, it still makes sense to ignore an error (exitCode of the ITaskSummary from running the task will be undefined if the task is canceled by the user).

Correct, that is how I understood this issue. @connor4312 can correct me if I am wrong.

So bottom line: don't annoy the user with an "task fail" alert if the task fails because she has cancelled (or restarted) the task.

Exactly.


Add Differentiable requirements to pattern substitutions / pattern generic signature

when calculating constrained function type. Also, add requirements for differentiable results as well.
Fixes #65487

I do not have good testcase besides the way described in https://github.com/apple/swift/issues/65487
However, the issue is very sound and will be easily reproduces when / if we will start supporting differentiation of coroutines (coroutines use pattern substitutions instead of directly substituting into component types).
I checked that Differentiable requirement is added properly to corresponding generic types (it turned out that the current code missed result types, so I added it as well while there).

Tagging @BradLarson

@swift-ci please test

So, for the function type mentioned in #65487 we're now generating:
(sil_function_type type=@callee_guaranteed @substituted <τ_0_0, τ_0_1 where τ_0_0 : Differentiable, τ_0_1 : Differentiable> (@inout Generic<τ_0_0>, @in_guaranteed τ_0_1) -> () for <T, T>
  (input=bound_generic_struct_type decl=null.(file).Generic@/Users/asl/Projects/swift-project/swift/test/AutoDiff/SILOptimizer/semantic_member_accessors_sil.swift:21:8
    (generic_type_param_type depth=0 index=0))
  (input=generic_type_param_type depth=0 index=1)
  (substitution_map generic_signature=<τ_0_0, τ_0_1 where τ_0_0 : Differentiable, τ_0_1 : Differentiable>
    (substitution τ_0_0 -> T)
    (substitution τ_0_1 -> T)
    (conformance type=τ_0_0
      (abstract_conformance protocol=Differentiable))
    (conformance type=τ_0_1
      (abstract_conformance protocol=Differentiable)))
  (substitution_map generic_signature=<nullptr>))

Note that w/o adding handling of result types only one requirement (for τ_0_0) was added.

I have a reproducer which may break this issue (this was compiled with the 09-24a toolchain):
import _Differentiation; public struct D<T>: Differentiable {}
extension D {@differentiable(reverse, wrt: self) mutating func m(r: @differentiable(reverse) (T?) -> T?) {}}

Error message without stack trace:
Invalid type parameter in getReducedType()
Original type: Optional<τ_0_0.TangentVector>
Simplified term: τ_0_0.[Differentiable:TangentVector]
Longest valid prefix: τ_0_0
Prefix type: τ_0_0

Requirement machine for <τ_0_0, τ_0_1>
Rewrite system: {
}
}
Property map: {
}
Conformance paths: {
}

If it turns out to not be related, I can open a separate issue.

Thanks @fibrechannelscsi! It's indeed the reproducer for the issue here. I added the testcase to the PR

@swift-ci please test


Provide guidance on http://localhost:9867 instead of a 404

In a thread on Slack, a new community user reported having installed/started Brim on Linux, saw a process listening on localhost:9867, and therefore tried to connect to http://localhost:9867 from a browser on the assumption that Brim was accessed this way rather than through the Electron-based client. Here's what such a user sees today:

With remote/standalone zqd likely to become a more common config in the days ahead, the exposure for this kind of confusion seems likely to increase. Therefore it would seem a good idea to respond in this situation with more helpful guidance. Perhaps something like the following (including the hyperlinks):

A zqd daemon is listening on this host/port.
If you're a Brim user, connect to this host/port from the Brim application in the graphical desktop interface in your operating system (not a web browser).
If your goal is to perform command line operations against this zqd, use the zapi client

Verified in zqd commit 85f3a81. Now when a zqd listen is running locally and I access http://localhost:9867/ in my browser, I see:

I've confirmed that all the links are going to the expected places.
Thanks @mattnibs!


PE-663: Spanish translations

Notes

app_en.arb and app_en_US.arb have the same content
app_es.arb and app_es_ES.arb have the same content

We need to handle button sizes on the move file/folder modal:

NEXT and BACK buttons from onboarding flow are in english:

I agree to ArDrive terms and service from new user login form is in english:

I agree to ArDrive terms and service from new user login form is in english:

Also, This field is required from same screenshot


The stardog server was working fine for us previously, suddenly it's went down

We are using stardog application- URL through virtual service deployment in our project, it was working properly but suddenly went down in all environments.

@sahoorajashree it sounds like you are looking for Stardog support? This is an issue tracker for some open source software related to our product, not our product support forum. Our docs have more information on how to get in touch to report a problem.


Implement Reverse Jordan-Wigner Transformation

What is the expected behavior?
While Jordan-Wigner transformation is implemented in the mappers framework (JordanWignerMapper), the reverse transformation is missing.
Inspiration can be drawn from https://github.com/quantumlib/OpenFermion/blob/master/src/openfermion/transforms/opconversions/reverse_jordan_wigner.py
PS: If maintainers agree with this issue, it will be solved by collaboration among Quantum Hackathon Korea participants.

Thank you for creating the issue! We are mentors of this event -  https://github.com/qiskit-community/quantum-hackathon-korea-21  and while handling the questions, we found there is no reverse Jordan Wigner function in Qiskit.

Do you have a use-case/example of situations where this reverse transformation would be useful for a particular algorithm or problem being solved?

it can be used for making anti-symmetric groups. also https://github.com/quantumlib/OpenFermion-FQE/blob/e4261fb7de19ae64a2a608e7c136503088976ca9/src/fqe/openfermion_utils.py this doc shows another use-case of this function in the open fermion side. In this time we've received a question because they want to reverse encode the computed qubit state into a fermionic state.

@GyeonghumKim implemented mapper
[https://github.com/molar-volume/qiskit-nature/blob/reverse_jw/qiskit_nature/mappers/second_quantization/reverse_jordan_wigner_mapper.py]
(https://github.com/molar-volume/qiskit-nature/blob/reverse_jw/qiskit_nature/mappers/second_quantization/reverse_jordan_wigner_mapper.py)
and test file
https://github.com/molar-volume/qiskit-nature/blob/reverse_jw/test/mappers/second_quantization/test_reverse_jordan_wigner_mapper.py
We would improve these codes and consider making relevant examples.

#702 shows that we are in the process of migrating the FermionicOp into a new location.
As shown in #701 this will also relocate the mappers into a new location (namely qiskit_nature.second_quantization.operators.fermionic.mappers).
Maybe you can use this opportunity in a few weeks to open a PR which adds this reverse mapping? If you're still interested, I would suggest that you subscribe to #703 and once that is resolved, you add this mapper of yours to the aforementioned location. What do you think?

#702 shows that we are in the process of migrating the FermionicOp into a new location. As shown in #701 this will also relocate the mappers into a new location (namely qiskit_nature.second_quantization.operators.fermionic.mappers).
Maybe you can use this opportunity in a few weeks to open a PR which adds this reverse mapping? If you're still interested, I would suggest that you subscribe to #703 and once that is resolved, you add this mapper of yours to the aforementioned location. What do you think?

Hi @mrossinek  why not! thank you so much! we will follow #703 and add our mapper!

Hi @0sophy1! It has been a while and Qiskit Nature just underwent yet another large refactoring (hopefully the last one as big as this for a long time).
Are you still interested in adding the reverse Jordan-Wigner mapping to Qiskit Nature?
I see that the implementation was basically already done (@BStar14). Instead of the version you proposed there I would suggest to add the reverse map to the existing JordanWignerMapper (because the QubitMapper class dictates a SparseLabelOp -> PauliSumOp direction which your mapper would not match). But that is a design detail which should be easy to figure out :+1:

Hey, I will likely need this feature in the near-ish future.
Would you guys mind if I tried adding it to the JordanWignerMappermyself?

Was this implementation working previously? @BStar14 @GyeonghumKim @0sophy1
I was going through it and updating it to work with the recent updates. Mostly this means using PauliSparseOp and converting the result from dense labels to sparse labels so it's compatible with the new FermionicOp
It seems to map all the Pauli strings with Z correctly but it's missing terms on the way back. Only things I did were what I described above.
Here's a test script, there are some print statements commented for debugging:
from itertools import product
import math

import numpy as np

from qiskit.quantum_info.operators import Pauli
from qiskit.quantum_info import SparsePauliOp

from qiskit_nature.second_q.mappers.fermionic_mapper import FermionicMapper
from qiskit_nature.second_q.operators import FermionicOp

from collections import defaultdict

def transform_dict_keys(data):
    label_transformation = {
        "I": "",
        "N": "+_{} -_{}",
        "E": "-_{} +_{}",
        "+": "+_{}",
        "-": "-_{}",
    }

    new_data = {}
    for key, value in data.items():
        new_key_parts = []
        for i, char in enumerate(key):
            if char in label_transformation:
                # Apply transformation if the character is in the mapping
                transformed = label_transformation[char].format(i, i)
                if transformed:
                    new_key_parts.append(transformed)
        new_key = ' '.join(new_key_parts)  # Join the parts with spaces
        new_data[new_key] = value

    return new_data

def reverse_map(second_q_op: SparsePauliOp) -> FermionicOp:
        """Maps a class:`OperatorBase` to a `FermionicOp`.

        Args:
            second_q_op: the :class:`OperatorBase` to be mapped.

        Returns:
            The `FermionicOp` corresponding to the Hamiltonian in the Fermionic space.
        """

        num_qubits = second_q_op.num_qubits # get number of qubits from input second quantized operator
        fermionic_op = None
        for term in second_q_op:
            transform_list : List[Tuple(str, float)] = []  # list of tuple(pauli, coeff)
            coef_term = term.coeffs[0]  # Assuming coeffs is a list with a single element
            target_pauli_op = term.paulis[0]
            #print(target_pauli_op)

            for i in range(num_qubits):
                one_pauli = target_pauli_op[num_qubits - 1 - i]
                pauli_char=one_pauli.to_label()
                if pauli_char == 'Z': # dealing Pauli Z op
                    transform_list.append((('I',1),('N', -2))) # Zj -> I - 2*Nj => [('I', 1), ('N', -2)]
                elif pauli_char == 'X': # dealing Pauli X op
                    transform_list.append((("+", 1), ('-', 1))) # Xj -> aj_dag + aj => [('+', 1), ('-', 1)]
                    target_pauli_op &= Pauli("I" * (i+1) + "Z" * (num_qubits - i - 1)) # apply Z(j-1)Z(j-2) ... Z(0)
                elif one_pauli.to_label() == 'Y': # dealing Pauli Y op
                    transform_list.append((('+', -1j), ('-', 1j))) # Yj -> i(aj - aj_dag) => [('+', -1j), ('-', 1j)]
                    target_pauli_op &= Pauli("I" * (i+1) + "Z" * (num_qubits - i - 1)) # apply Z(j-1)Z(j-2) ... Z(0)
                else:
                    # dealing Pauli I op
                    transform_list.append((('I', 0.5), ('I', 0.5))) # Ij -> Ij => [('I', 0.5), ('I', 0.5)]; split I into 0.5I + 0.5I for code consistency

            # dealing the phase
            if target_pauli_op.phase == 1:
                coef_term *= -1j
            elif target_pauli_op.phase == 2:
                coef_term *= -1
            elif target_pauli_op.phase == 3:
                coef_term *= 1j

            #print(transform_list)
            pauli_coefs = []
            pauli_strings = []
            # create fermionic operator for a term based on transform_list
            for idxes in product(*[[0, 1]]*num_qubits):
                pauli_coefs.append(math.prod([t[i][1] for t, i in zip(transform_list, idxes)]))
                pauli_strings.append("".join([t[i][0] for t, i in zip(transform_list, idxes)])[::-1])
            ferm_op=list(zip(pauli_strings, pauli_coefs))

            ferm_dict = defaultdict(float)

            # Iterate over each tuple in the list
            for key, value in ferm_op:
                # Sum the float values for tuples with the same string
                ferm_dict[key] += value

            ferm_dict_sparse=transform_dict_keys(ferm_dict)

            #print(ferm_dict)
            #print(ferm_dict_sparse)
            #print(coef_term)

            if not fermionic_op:
                fermionic_op = coef_term * FermionicOp(ferm_dict_sparse,num_spin_orbitals=num_qubits).simplify()
            else:
                fermionic_op += coef_term * FermionicOp(ferm_dict_sparse,num_spin_orbitals=num_qubits).simplify()

        return fermionic_op.simplify()

from qiskit_nature.units import DistanceUnit
from qiskit_nature.second_q.drivers import PySCFDriver

driver = PySCFDriver(
    atom="H 0 0 0; H 0 0 0.735",
    basis="sto3g",
    charge=0,
    spin=0,
    unit=DistanceUnit.ANGSTROM,
)

from IPython.display import display

problem = driver.run()

hamiltonian = problem.hamiltonian
second_q_op = hamiltonian.second_q_op()

mapper=JordanWignerMapper()
qubit_op=mapper.map(second_q_op)

reverse_op=reverse_map(qubit_op)

display("Fermioinic OP:")
display(print(second_q_op))
display("Qubit_OP:")
display(print(qubit_op))
display("Reversed_OP:")
display(print(reverse_op))

And the output:
'Fermioinic OP:'

Fermionic Operator
number spin orbitals=4, number terms=36
  0.3378550774017583 * ( +_0 +_0 -_0 -_0 )
+ 0.3322908651276482 * ( +_0 +_1 -_1 -_0 )
+ 0.3378550774017583 * ( +_0 +_2 -_2 -_0 )
+ 0.3322908651276482 * ( +_0 +_3 -_3 -_0 )
+ 0.09046559989211572 * ( +_0 +_0 -_1 -_1 )
+ 0.09046559989211572 * ( +_0 +_1 -_0 -_1 )
+ 0.09046559989211572 * ( +_0 +_2 -_3 -_1 )
+ 0.09046559989211572 * ( +_0 +_3 -_2 -_1 )
+ 0.09046559989211572 * ( +_1 +_0 -_1 -_0 )
+ 0.09046559989211572 * ( +_1 +_1 -_0 -_0 )
+ 0.09046559989211572 * ( +_1 +_2 -_3 -_0 )
+ 0.09046559989211572 * ( +_1 +_3 -_2 -_0 )
+ 0.3322908651276482 * ( +_1 +_0 -_0 -_1 )
+ 0.34928686136600906 * ( +_1 +_1 -_1 -_1 )
+ 0.3322908651276482 * ( +_1 +_2 -_2 -_1 )
+ 0.34928686136600906 * ( +_1 +_3 -_3 -_1 )
+ 0.3378550774017583 * ( +_2 +_0 -_0 -_2 )
+ 0.3322908651276482 * ( +_2 +_1 -_1 -_2 )
+ 0.3378550774017583 * ( +_2 +_2 -_2 -_2 )
+ 0.3322908651276482 * ( +_2 +_3 -_3 -_2 )
+ 0.09046559989211572 * ( +_2 +_0 -_1 -_3 )
+ 0.09046559989211572 * ( +_2 +_1 -_0 -_3 )
+ 0.09046559989211572 * ( +_2 +_2 -_3 -_3 )
+ 0.09046559989211572 * ( +_2 +_3 -_2 -_3 )
+ 0.09046559989211572 * ( +_3 +_0 -_1 -_2 )
+ 0.09046559989211572 * ( +_3 +_1 -_0 -_2 )
+ 0.09046559989211572 * ( +_3 +_2 -_3 -_2 )
+ 0.09046559989211572 * ( +_3 +_3 -_2 -_2 )
+ 0.3322908651276482 * ( +_3 +_0 -_0 -_3 )
+ 0.34928686136600906 * ( +_3 +_1 -_1 -_3 )
+ 0.3322908651276482 * ( +_3 +_2 -_2 -_3 )
+ 0.34928686136600906 * ( +_3 +_3 -_3 -_3 )
+ -1.25633907300325 * ( +_0 -_0 )
+ -0.47189600728114184 * ( +_1 -_1 )
+ -1.25633907300325 * ( +_2 -_2 )
+ -0.47189600728114184 * ( +_3 -_3 )

None

'Qubit_OP:'

SparsePauliOp(['IIII', 'IIIZ', 'IIZI', 'IIZZ', 'IZII', 'IZIZ', 'ZIII', 'ZIIZ', 'YYYY', 'XXYY', 'YYXX', 'XXXX', 'IZZI', 'ZIZI', 'ZZII'],
              coeffs=[-0.81054798+0.j,  0.17218393+0.j, -0.22575349+0.j,  0.12091263+0.j,
  0.17218393+0.j,  0.16892754+0.j, -0.22575349+0.j,  0.16614543+0.j,
  0.0452328 +0.j,  0.0452328 +0.j,  0.0452328 +0.j,  0.0452328 +0.j,
  0.16614543+0.j,  0.17464343+0.j,  0.12091263+0.j])

None

'Reversed_OP:'

Fermionic Operator
number spin orbitals=4, number terms=14
  (-1.25633907300325+0j) * ( +_0 -_0 )
+ (-0.4718960072811419+0j) * ( +_1 -_1 )
+ (0.483650530471065+0j) * ( +_0 -_0 +_1 -_1 )
+ (-1.2563390730032502+0j) * ( +_2 -_2 )
+ (0.6757101548035166+0j) * ( +_0 -_0 +_2 -_2 )
+ (-0.4718960072811419+0j) * ( +_3 -_3 )
+ (0.6645817302552964+0j) * ( +_0 -_0 +_3 -_3 )
+ (0.18093119978423144+0j) * ( -_0 +_1 -_2 +_3 )
+ (-0.18093119978423144+0j) * ( +_0 -_1 -_2 +_3 )
+ (0.18093119978423144+0j) * ( +_0 -_1 +_2 -_3 )
+ (-0.18093119978423144+0j) * ( -_0 +_1 +_2 -_3 )
+ (0.6645817302552964+0j) * ( +_1 -_1 +_2 -_2 )'Fermioinic OP:'

Fermionic Operator
number spin orbitals=4, number terms=28
  (0.3322908651276482+0j) * ( +_0 +_1 -_1 -_0 )
+ (0.3378550774017583+0j) * ( +_0 +_2 -_2 -_0 )
+ (0.3322908651276482+0j) * ( +_0 +_3 -_3 -_0 )
+ (0.09046559989211572+0j) * ( +_0 +_1 -_0 -_1 )
+ (0.09046559989211572+0j) * ( +_0 +_2 -_3 -_1 )
+ (0.09046559989211572+0j) * ( +_0 +_3 -_2 -_1 )
+ (0.09046559989211572+0j) * ( +_1 +_0 -_1 -_0 )
+ (0.09046559989211572+0j) * ( +_1 +_2 -_3 -_0 )
+ (0.09046559989211572+0j) * ( +_1 +_3 -_2 -_0 )
+ (0.3322908651276482+0j) * ( +_1 +_0 -_0 -_1 )
+ (0.3322908651276482+0j) * ( +_1 +_2 -_2 -_1 )
+ (0.34928686136600906+0j) * ( +_1 +_3 -_3 -_1 )
+ (0.3378550774017583+0j) * ( +_2 +_0 -_0 -_2 )
+ (0.3322908651276482+0j) * ( +_2 +_1 -_1 -_2 )
+ (0.3322908651276482+0j) * ( +_2 +_3 -_3 -_2 )
+ (0.09046559989211572+0j) * ( +_2 +_0 -_1 -_3 )
+ (0.09046559989211572+0j) * ( +_2 +_1 -_0 -_3 )
+ (0.09046559989211572+0j) * ( +_2 +_3 -_2 -_3 )
+ (0.09046559989211572+0j) * ( +_3 +_0 -_1 -_2 )
+ (0.09046559989211572+0j) * ( +_3 +_1 -_0 -_2 )
+ (0.09046559989211572+0j) * ( +_3 +_2 -_3 -_2 )
+ (0.3322908651276482+0j) * ( +_3 +_0 -_0 -_3 )
+ (0.34928686136600906+0j) * ( +_3 +_1 -_1 -_3 )
+ (0.3322908651276482+0j) * ( +_3 +_2 -_2 -_3 )
+ (-1.25633907300325+0j) * ( +_0 -_0 )
+ (-0.47189600728114184+0j) * ( +_1 -_1 )
+ (-1.25633907300325+0j) * ( +_2 -_2 )
+ (-0.47189600728114184+0j) * ( +_3 -_3 )

None

'Qubit_OP:'

SparsePauliOp(['IIII', 'IIIZ', 'IIZI', 'IIZZ', 'IZII', 'IZIZ', 'ZIII', 'ZIIZ', 'YYYY', 'XXYY', 'YYXX', 'XXXX', 'IZZI', 'ZIZI', 'ZZII'],
              coeffs=[-0.81054798+0.j,  0.17218393+0.j, -0.22575349+0.j,  0.12091263+0.j,
  0.17218393+0.j,  0.16892754+0.j, -0.22575349+0.j,  0.16614543+0.j,
  0.0452328 +0.j,  0.0452328 +0.j,  0.0452328 +0.j,  0.0452328 +0.j,
  0.16614543+0.j,  0.17464343+0.j,  0.12091263+0.j])

None

'Reversed_OP:'

Fermionic Operator
number spin orbitals=4, number terms=14
  (-1.25633907300325+0j) * ( +_0 -_0 )
+ (-0.4718960072811419+0j) * ( +_1 -_1 )
+ (0.483650530471065+0j) * ( +_0 -_0 +_1 -_1 )
+ (-1.2563390730032502+0j) * ( +_2 -_2 )
+ (0.6757101548035166+0j) * ( +_0 -_0 +_2 -_2 )
+ (-0.4718960072811419+0j) * ( +_3 -_3 )
+ (0.6645817302552964+0j) * ( +_0 -_0 +_3 -_3 )
+ (0.18093119978423144+0j) * ( -_0 +_1 -_2 +_3 )
+ (-0.18093119978423144+0j) * ( +_0 -_1 -_2 +_3 )
+ (0.18093119978423144+0j) * ( +_0 -_1 +_2 -_3 )
+ (-0.18093119978423144+0j) * ( -_0 +_1 +_2 -_3 )
+ (0.6645817302552964+0j) * ( +_1 -_1 +_2 -_2 )
+ (0.6985737227320181+0j) * ( +_1 -_1 +_3 -_3 )
+ (0.483650530471065+0j) * ( +_2 -_2 +_3 -_3 )

None

(0.6985737227320181+0j) * ( +_1 -_1 +_3 -_3 )
(0.483650530471065+0j) * ( +_2 -_2 +_3 -_3 )

None

@MarcoBarroca, this issue was suspended because we couldn't find its usecase. I would be grateful if you could share your idea. It is also fine to update the code on your own. Maybe @GyeonghunKim can provide more help for it.

I've modified the implementation to use the FermionicOp arithmetic instead of doing so only at the end. Seems simpler this way and I've recovered the same results from the original implementation. Still looks like it's missing something for Operators X and Y as the reverse still isn't the same as the original.
from itertools import product
import math

import numpy as np

from qiskit.quantum_info.operators import Pauli
from qiskit.quantum_info import SparsePauliOp

from qiskit_nature.second_q.mappers import JordanWignerMapper
from qiskit_nature.second_q.operators import FermionicOp

def invert_pauli_terms(sparse_pauli_op: SparsePauliOp) -> SparsePauliOp:
    """Inverts the order of Pauli operators in each term of a SparsePauliOp."""
    inverted_labels = [label[::-1] for label in sparse_pauli_op.paulis.to_labels()]
    # Create a new SparsePauliOp with the inverted labels but same coefficients
    inverted_sparse_pauli_op = SparsePauliOp(inverted_labels, sparse_pauli_op.coeffs)
    return inverted_sparse_pauli_op

def reverse_map(qubit_op: SparsePauliOp) -> FermionicOp:
        """Maps a class:`OperatorBase` to a `FermionicOp`.

        Args:
            second_q_op: the :class:`OperatorBase` to be mapped.

        Returns:
            The `FermionicOp` corresponding to the Hamiltonian in the Fermionic space.
        """

        num_qubits = qubit_op.num_qubits # get number of qubits from input second quantized operator
        qubit_op=invert_pauli_terms(qubit_op)
        total_fermionic_op = FermionicOp.zero()
        for term in qubit_op:
            coef_term = term.coeffs[0]  # Assuming coeffs is a list with a single element
            target_pauli_op = term.paulis[0]
            #print(target_pauli_op)
            #print(coef_term)
            ferm_term_ops=[]
            z_count=0
            for i in range(num_qubits):
                transform_dict={}
                parity_dict={}
                one_pauli = target_pauli_op[num_qubits - 1 - i]
                pauli_char=one_pauli.to_label()
                #print(pauli_char)
                if pauli_char == 'Z': # dealing Pauli Z op
                    transform_dict[f'']=1
                    transform_dict[f'+_{i} -_{i}']=-2
                    ferm_op_pauli=FermionicOp(transform_dict)
                elif pauli_char == 'X': # dealing Pauli X op
                    transform_dict[f'+_{i}']=1
                    transform_dict[f'-_{i}']=1
                    ferm_op_pauli=FermionicOp(transform_dict)
                    target_pauli_op &= Pauli("I" * (i+1) + "Z" * (num_qubits - i - 1)) # apply Z(j-1)Z(j-2) ... Z(0)
                elif one_pauli.to_label() == 'Y': # dealing Pauli Y op
                    phase_factor = (-1j) ** z_count
                    transform_dict[f'+_{i}']=1j
                    transform_dict[f'-_{i}']=-1j
                    ferm_op_pauli=FermionicOp(transform_dict)
                    target_pauli_op &= Pauli("I" * (i+1) + "Z" * (num_qubits - i - 1)) # apply Z(j-1)Z(j-2) ... Z(0)
                else:
                    ferm_op_pauli=FermionicOp.one()
                ferm_term_ops.append(ferm_op_pauli)
                #print(ferm_term_ops)

            term_fermionic_op = FermionicOp.one()
            for op in ferm_term_ops:
                term_fermionic_op = term_fermionic_op @ op
            #print(term_fermionic_op)

            #print(target_pauli_op)

            # dealing the phase
            if target_pauli_op.phase == 1:
                coef_term *= -1j
            elif target_pauli_op.phase == 2:
                coef_term *= -1
            elif target_pauli_op.phase == 3:
                coef_term *= 1j

            total_fermionic_op += coef_term * term_fermionic_op

            #print(coef_term * term_fermionic_op)
            #print(total_fermionic_op)

        return total_fermionic_op.simplify()

from qiskit_nature.units import DistanceUnit
from qiskit_nature.second_q.drivers import PySCFDriver

driver = PySCFDriver(
    atom="H 0 0 0; H 0 0 0.735",
    basis="sto3g",
    charge=0,
    spin=0,
    unit=DistanceUnit.ANGSTROM,
)

from IPython.display import display

problem = driver.run()

hamiltonian = problem.hamiltonian
second_q_op = hamiltonian.second_q_op()

mapper=JordanWignerMapper()
qubit_op=mapper.map(second_q_op)

reverse_op=reverse_map(qubit_op)

display("Fermioinic OP:")
display(print(second_q_op.simplify().simplify()))
display("Qubit_OP:")
display(print(qubit_op))
display("Reversed_OP:")
display(print(reverse_op))

Output:
'Fermioinic OP:'

Fermionic Operator
number spin orbitals=4, number terms=28
  (0.3322908651276482+0j) * ( +_0 +_1 -_1 -_0 )
+ (0.3378550774017583+0j) * ( +_0 +_2 -_2 -_0 )
+ (0.3322908651276482+0j) * ( +_0 +_3 -_3 -_0 )
+ (0.09046559989211572+0j) * ( +_0 +_1 -_0 -_1 )
+ (0.09046559989211572+0j) * ( +_0 +_2 -_3 -_1 )
+ (0.09046559989211572+0j) * ( +_0 +_3 -_2 -_1 )
+ (0.09046559989211572+0j) * ( +_1 +_0 -_1 -_0 )
+ (0.09046559989211572+0j) * ( +_1 +_2 -_3 -_0 )
+ (0.09046559989211572+0j) * ( +_1 +_3 -_2 -_0 )
+ (0.3322908651276482+0j) * ( +_1 +_0 -_0 -_1 )
+ (0.3322908651276482+0j) * ( +_1 +_2 -_2 -_1 )
+ (0.34928686136600906+0j) * ( +_1 +_3 -_3 -_1 )
+ (0.3378550774017583+0j) * ( +_2 +_0 -_0 -_2 )
+ (0.3322908651276482+0j) * ( +_2 +_1 -_1 -_2 )
+ (0.3322908651276482+0j) * ( +_2 +_3 -_3 -_2 )
+ (0.09046559989211572+0j) * ( +_2 +_0 -_1 -_3 )
+ (0.09046559989211572+0j) * ( +_2 +_1 -_0 -_3 )
+ (0.09046559989211572+0j) * ( +_2 +_3 -_2 -_3 )
+ (0.09046559989211572+0j) * ( +_3 +_0 -_1 -_2 )
+ (0.09046559989211572+0j) * ( +_3 +_1 -_0 -_2 )
+ (0.09046559989211572+0j) * ( +_3 +_2 -_3 -_2 )
+ (0.3322908651276482+0j) * ( +_3 +_0 -_0 -_3 )
+ (0.34928686136600906+0j) * ( +_3 +_1 -_1 -_3 )
+ (0.3322908651276482+0j) * ( +_3 +_2 -_2 -_3 )
+ (-1.25633907300325+0j) * ( +_0 -_0 )
+ (-0.47189600728114184+0j) * ( +_1 -_1 )
+ (-1.25633907300325+0j) * ( +_2 -_2 )
+ (-0.47189600728114184+0j) * ( +_3 -_3 )

None

'Qubit_OP:'

SparsePauliOp(['IIII', 'IIIZ', 'IIZI', 'IIZZ', 'IZII', 'IZIZ', 'ZIII', 'ZIIZ', 'YYYY', 'XXYY', 'YYXX', 'XXXX', 'IZZI', 'ZIZI', 'ZZII'],
              coeffs=[-0.81054798+0.j,  0.17218393+0.j, -0.22575349+0.j,  0.12091263+0.j,
  0.17218393+0.j,  0.16892754+0.j, -0.22575349+0.j,  0.16614543+0.j,
  0.0452328 +0.j,  0.0452328 +0.j,  0.0452328 +0.j,  0.0452328 +0.j,
  0.16614543+0.j,  0.17464343+0.j,  0.12091263+0.j])

None

'Reversed_OP:'

Fermionic Operator
number spin orbitals=4, number terms=14
  (-1.25633907300325+0j) * ( +_0 -_0 )
+ (-0.4718960072811419+0j) * ( +_1 -_1 )
+ (0.483650530471065+0j) * ( +_0 -_0 +_1 -_1 )
+ (-1.2563390730032502+0j) * ( +_2 -_2 )
+ (0.6757101548035166+0j) * ( +_0 -_0 +_2 -_2 )
+ (-0.4718960072811419+0j) * ( +_3 -_3 )
+ (0.6645817302552964+0j) * ( +_0 -_0 +_3 -_3 )
+ (0.18093119978423144+0j) * ( -_0 +_1 -_2 +_3 )
+ (-0.18093119978423144+0j) * ( -_0 +_1 +_2 -_3 )
+ (0.18093119978423144+0j) * ( +_0 -_1 +_2 -_3 )
+ (-0.18093119978423144+0j) * ( +_0 -_1 -_2 +_3 )
+ (0.6645817302552964+0j) * ( +_1 -_1 +_2 -_2 )
+ (0.6985737227320181+0j) * ( +_1 -_1 +_3 -_3 )
+ (0.483650530471065+0j) * ( +_2 -_2 +_3 -_3 )

None

Found the issue! Both implementations work fine! Just do a print(second_q_op.normal_order()-reverse_op.normal_order()) and you'll see they match up to e-17!
Fermionic Operator
number spin orbitals=4, number terms=14
  0j * ( +_0 +_1 -_0 -_1 )
+ 0j * ( +_0 +_2 -_0 -_2 )
+ 0j * ( +_0 +_3 -_0 -_3 )
+ 0j * ( +_0 +_2 -_1 -_3 )
+ 0j * ( +_0 +_3 -_1 -_2 )
+ 0j * ( +_1 +_2 -_0 -_3 )
+ 0j * ( +_1 +_3 -_0 -_2 )
+ 0j * ( +_1 +_2 -_1 -_2 )
+ 0j * ( +_1 +_3 -_1 -_3 )
+ 0j * ( +_2 +_3 -_2 -_3 )
+ 0j * ( +_0 -_0 )
+ (5.551115123125783e-17+0j) * ( +_1 -_1 )
+ (2.220446049250313e-16+0j) * ( +_2 -_2 )
+ (5.551115123125783e-17+0j) * ( +_3 -_3 )

second_q_op.normal_order().equiv(reverse_op.normal_order()) also returns True.
I'll work to make a reverse_map() method in the JordanWignerMapper() that implements this and submit a PR. I'll probably use the second implementation I posted just because it seems easier to read. I'll try to include a unit test as well in the test_jordan_wigner_mapper.

Done!
I think reverse JordanWigner will be enough for what I’m working on but I wonder if there shouldn’t be a ReverseQubitMapper() ou FermionicMapper() class in the future to handle reverse transformations for all mappers.
One other question. Why doesn’t FermionicOp.equiv() put all the operators in .normal_mode() before checking equivalence? I took a while to figure out I had recovered the same operator already.


fix function parameters call from str to int

Issue #, if available:
The function expect 2 int, or the first parameter is a str, which makes the pipeline to break
Description of changes:
updated the first parameter from str to an int
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@helkhalfi thank you for the contribution! Can you squash your commits to be one single commit?

@PatrickXYS We can squash merge on our side. It's fine. Thanks for the contribution


Workspace.eachEditor is deprecated.

Use Workspace::observeTextEditors instead
Workspace.eachEditor (/opt/atom/resources/app/src/workspace.js:942:7)
new ClangFormat (/home/peer/.atom/packages/clang-format/lib/clang-format.coffee:7:19)

fixed by 0812fe6a87034a162c763608cd24b33523e8f7cc


Add my blog into showcase

The URL of my blog is: http://biercoff.com/

Available in 2.5.0.

Thanks :)


Confusing information

Why does this document describe how to install and configure the Application Catalog when in the previous section we're told how to remove it because it has been deprecated?

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

ID: 7b63a5c3-b4c4-d60b-fac9-f625edb74022
Version Independent ID: ca712b3a-aa29-9ef2-dbf0-d0a8589245d1
Content: Plan for application management - Configuration Manager
Content Source: sccm/apps/plan-design/plan-for-and-configure-application-management.md
Product: configuration-manager
Technology: configmgr-app
GitHub Login: @aczechowski
Microsoft Alias: aaroncz

Purely for customers that might still be on an earlier but still supported version of ConfigMgr: https://docs.microsoft.com/sccm/core/servers/manage/updates#supported-versions


feat:SpannerDate struct

Prototype PR to discuss implementation of SpannerDate. Closes #5839
This is very much a WIP and created in lieu of design document for better understanding and discussion.

I'll take a look on Monday

I'll take a look on Monday

Likewise - or possibly this afternoon (UK time).

Btw, I haven't reviewed the tests at all yet. Plenty to talk about before we get there :)

Closing for #8367


Firestore Write Trigger Freezes

I am currently testing the 2nd gen on-write Firestore cloud triggers. For some reason, the trigger freezes and stops executing after a few hours from deployment.
It appears that updating a Firestore document is causing the trigger to freeze.

Environment details

OS type and version: MacOS Sonoma 14.3.
Python version: 3.12.2
pip version: 24.0
google-cloud-firestore version: 2.15.0

Steps to reproduce
Note that this bug is difficult to reproduce and would require some repetition to occur.

Deploy the test_document_write HTTP request function and test_on_document_write on-write Firestore trigger.
Run the test_document_write function.

This will create a test Firestore collection and will create or update 10 fixed Firestore documents that will trigger the test_on_document_write cloud trigger.

Observe that the test_on_document_write will make the changes in the updated Firestore docs.
Wait a couple of hours.
Re-run the test_document_write function.
Observe that the Firestore docs will not update due to the function freezing (as shown in the image above). If it did, repeat step 4.

Code example
test_document_write HTTP Request Function

This function creates 10 documents in the test collection, and increments their field a value.

from app.https.common.http_responses import success_response
from firebase_admin import firestore
from firebase_functions import https_fn, options
from google.cloud.firestore import Client, Increment

@https_fn.on_request(cors=options.CorsOptions(cors_methods=['post']))
def test_document_write(request: https_fn.Request) -> https_fn.Response:
    firestore_client: Client = firestore.client()

    batch = firestore_client.batch()

    for i in range(0, 10):
        batch.set(
            firestore_client.document(f'test/doc_{i}'),
            {'a': Increment(1)},
            merge=True,
        )

    batch.commit()

    return success_response()

test_on_document_write on-write Firestore trigger

This trigger ensures that field b always matches the value of field a.

from firebase_functions import logger
from firebase_functions.firestore_fn import (Change, DocumentSnapshot, Event,
                                             on_document_written)

@on_document_written(document='test/{id}')
def test_on_document_write(event: Event[Change[DocumentSnapshot]]):

    after = event.data.after

    if not after:
        return

    after_data = event.data.after.to_dict()
    a = after_data.get('a', 0)
    b = after_data.get('b', 0)

    if a != b:
        updated_data = {'a': a, 'b': a}

        logger.info(
            'Updating document: {}, Old data:{}, New data: {}'.format(
                event.document,
                after_data,
                updated_data,
            ),
        )

        # Occasionally, it appears that the code is freezing here, preventing the final logs from being printed
        after.reference.update(updated_data)

        logger.info(
            'Document updated: {}, Old data:{}, New data: {}'.format(
                event.document,
                after_data,
                updated_data,
            ),
        )

Stack trace
Here's the logs extracted from the GCP Logs Explorer.
downloaded-logs-20240228-171306.json

Update: This is also occurring on Firebase Storage triggers.

I've also encountered the very same issue on a @https_fn.on_request functions:

I have not found a "smoking gun" yet or a test scenario that easily reproduces the issue. I can say though that I was able to reduce the occurrence of deadlock in my own functions by reducing calls that GET the document that is the subject of the trigger. For example, rather than passing the document by path and calling:
path = event.document
...many layers of code...
doc = db.document(path).get()

...I am using event.data.to_dict() (or event.data.after.to_dict()) and passing that data through the stack instead. Am continuing to try to reproduce using test cases that attempt to re-read the document from within the trigger.


stdenv baseHash

Motivation for this change
It provides a better implementation to stripHash which leaks into the global namespace. Initiated by the discussion at https://github.com/NixOS/nixpkgs/pull/16398
Things done

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

[ ] NixOS
[ ] OS X
[ ] Linux

[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
[ ] Tested execution of all binary files (usually in ./result/bin/)
[ ] Fits CONTRIBUTING.md.

This function is a misnomer. baseHash implies it returns the hash, but it rather returns the name.
The equivalent Nix C++ function is called storePathToName BTW.

Fair enough, I just picker an alternative name to avoid breaking back-compat. Do you have any shorted name in mind by any chance ? stripHash is pretty much perfect in terms of shortness and meaning.
If not I'll use storePathToName


Refresh token not blacklisted on logout

#27
Attempt to blacklist refresh token if no JWT_AUTH_COOKIE is found and using SimpleJWT Blacklist
Status returned may be questionable in my try/except, but they make sense to me. I'm not sure how the cookies work, so I didn't test that. If there is a better way to implement this (should it be blacklisted even if using cookies?), please let me know!

I'm not sure how to run unit tests, so I can't add any at the moment.

Added unit tests. Please let me know if you think anything should behave differently!

I'll remove and add how to test in the Readme then since it took me too
long to figure out how.
On Fri, Apr 3, 2020, 9:48 PM Michael<EMAIL_ADDRESS>wrote:

@iMerica requested changes on this pull request.
In Makefile
https://github.com/jazzband/dj-rest-auth/pull/28#discussion_r402687431:

@@ -0,0 +1,2 @@
+test:

This project doesn't use make. We can leave this file out.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/jazzband/dj-rest-auth/pull/28#pullrequestreview-386883232,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AG3DIIM3LNQOU5EW4GNMOGDRK2GXXANCNFSM4LZVTWLA
.

What happens if a user is using Simple JWT, but they don't want to black list? I don't see where you account for this in the current implementation.
After all, the blacklist feature of Simple JWT appears to be completely optional.

If they aren't using cookies or blacklist, isn't logout meaningless? I'd
rather get back that it's not enabled like in the try except.
On Thu, Apr 9, 2020, 7:52 PM Michael<EMAIL_ADDRESS>wrote:

@iMerica requested changes on this pull request.
What happens if a user is using Simple JWT, but they don't want to black
list? I don't see where you account for this in the current implementation.
After all, the blacklist feature of Simple JWT appears to be completely
optional.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/jazzband/dj-rest-auth/pull/28#pullrequestreview-391199988,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AG3DIIOSZW32GHJEIRXKG5DRLZNVDANCNFSM4LZVTWLA
.

Some people handle this by deleting the token from the client (e.g localStorage or native iOS/Android APIs for storage).

Not enabling an optional feature of Simple JWT does not seem exceptional to me

I'm fine changing it to a check if it is installed, but I'd still like it to return a message letting you know it does nothing on the server side.

👍

Updated based on comments.

LGTM 👍


Adds telemetry

This adds telemetry capture to Hamilton.
After this change, by default, when using Hamilton, it will collect anonymous usage data to help us improve Hamilton and know where to apply development efforts.
We capture two events: one when a driver object is instantiated, and one when the execute() call on the driver completes.
No user data or potentially sensitive information is or ever will be collected. The captured data is limited to:

Operating System and Python version

A persistent UUID to indentify the session, stored in ~/.hamilton.conf.

Error stack trace limited to Hamilton code, if one occurs.

Information on what features you're using from Hamilton: decorators, adapters, result builders.

How Hamilton is being used: number of final nodes in DAG, number of modules, size of objects passed to execute().

If you do not wish to participate, one can opt-out with one of the following methods:

Set it to false programmatically in your code before creating a Hamilton driver:from hamilton import telemetry
telemetry.disable_telemetry()

Set the key telemetry_enabled to false in ~/.hamilton.conf under the DEFAULT section:[DEFAULT]
telemetry_enabled = True

Set HAMILTON_TELEMETRY_ENABLED=false as an environment variable. Either setting it for your shell session:export HAMILTON_TELEMETRY_ENABLED=false

or passing it as part of the run command:HAMILTON_TELEMETRY_ENABLED=false python NAME_OF_MY_DRIVER.py

Changes

adds telemetry.py
adds code to driver.Driver to capture telemetry
the code should be wrapped in enough try excepts that it should not impact running operations
adds code to function_modifiers base.
adds tests [TODO]

How I tested this
Tested this locally.
Notes
Checklist

[ ] PR has an informative and human-readable title (this will be pulled into the release notes)
[ ] Changes are limited to a single goal (no scope creep)
[ ] Code passed the pre-commit check & code is left cleaner/nicer than when first encountered.
[ ] Any change in functionality is tested
[ ] New functions are documented (with a description, list of inputs, and expected output)
[ ] Placeholder code is flagged / future TODOs are captured in comments
[ ] Project documentation has been updated if adding/changing functionality.

Quick review notes:

[ ] check for module to not capture custom decorators
[ ] wire up posthog (create account on free tier)
[ ] write code to sanitize error trace to only capture hamilton related code
[ ] write unit tests
[ ] integration tests

I'm wondering if you wouldn't also want to generate a unique ID for each execution to tie start and end events together. It would probably simplify data analysis, but also help to find started but unfinished runs.

I'm wondering if you wouldn't also want to generate a unique ID for each execution to tie start and end events together. It would probably simplify data analysis, but also help to find started but unfinished runs.

Good idea! Can add it.

@elshize would you mind taking this branch for a spin?
pip install git+ssh://git@github.com/stitchfix/hamilton.git@add_telemetry

@skrawcz I updated Hamilton version in my projet and ran my pipeline, worked fine, and got these messages:
DEBUG:root:Succeed in sending telemetry consisting of [b'{"api_key": "phc_mZg8bkn3yvMxqvZKRlMlxjekFU5DFDdcdAsijJ2EH5e", "event": "os_hamilton_run_start", "properties": {"os_type": "posix", "os_version": "Linux-6.0.12-200.fc36.x86_64-x86_64-with-glibc2.35", "python_version": "3.9.11/CPython", "distinct_id": "cda55e8f-785c-4948-86ec-8b3ad3630d64", "hamilton_version:": [1, 11, 1], "telemetry_version": "0.0.1", "number_of_nodes": 21, "number_of_modules": 1, "number_of_config_items": 5, "decorators_used": {"extract_columns": 2}, "graph_adapter_used": "hamilton.base.SimplePythonDataFrameGraphAdapter", "result_builder_used": "custom_builder", "driver_run_id": "965d5d90-9e37-421c-b670-297abe1beddc", "error": null}}'].
DEBUG:root:Succeed in sending telemetry consisting of [b'{"api_key": "phc_mZg8bkn3yvMxqvZKRlMlxjekFU5DFDdcdAsijJ2EH5e", "event": "os_hamilton_run_end", "properties": {"os_type": "posix", "os_version": "Linux-6.0.12-200.fc36.x86_64-x86_64-with-glibc2.35", "python_version": "3.9.11/CPython", "distinct_id": "cda55e8f-785c-4948-86ec-8b3ad3630d64", "hamilton_version:": [1, 11, 1], "telemetry_version": "0.0.1", "is_success": true, "runtime_seconds": 0.3053734302520752, "number_of_outputs": 9, "number_of_overrides": 0, "number_of_inputs": 0, "driver_run_id": "965d5d90-9e37-421c-b670-297abe1beddc", "error": null}}'].


color information in the descriptor

Currently, only the coord info are used for training to generate the descriptor, did you also try to include the color information, i think  it should be helpful in some difficult case also

We did not as our purpose was to investigate how far we could go by just using geometry. Color can indeed improve things. I would recommend to use a robust color space rather than plain RGB, such as sRGB or HSV/Lab.


Need a way to manually include deps when using import() expression

Do you want to request a feature or report a bug?
I am not sure if I have overlooked something, but to me it seems this is a missing feature I'd like being added.

What is the current behavior?
What I want to do is using a dynamic import using an expression, like this:
const module = await import(modulePath);

So I cannot use a string template here.
What is the expected behavior?
But what I do know is every possible value for the modulePath variable - but as it seems, there is no way to tell webpack: "hey, please include those additional modules as (dynamic) dependencies, those are the paths". I think such an option would be quite helpful! With my old, AMD based workflow, I could just include those dynamically loaded modules in the r.js optimizer setup and then just require them in the final build, no matter if they are in the same or a separate bundle.
So in addition it would be nice if those modules can be included in the main bundle, or doing a code split like you normally would do with dynamic imports.
If this is a feature request, what is motivation or use case for changing the behavior?
It would be quite helpful in this scenario when I could tell webpack exactly what modules it can expect when using an expression with dynamic import, without needing to rely on webpack parsing a template string, and therefore potentially including way more files than actually needed (and thereby slowing the build process as well). As it seems there is no way doing that currently?

So yeah, after much fiddling there seems to be a light at the end of the tunnel. Still, this is not a 100% solution and it is surely not for the faint of heart, as it is quite ugly and fragile. And I still wish there was a more easy and elegant way to handle dynamic import()s with expressions, not static strings:
Here is what I have done so far:
1) manual parsing of my routes config
My router uses a config file looking like this:
import StaticClass from "/src/app/StaticClass.js";

export default {
    StaticClass: {
        match: /^\//,
        module: StaticClass
    },
    DynClass: {
        match: /^\//,
        module: "/src/app/DynClass.js"
    }
};

So as you can see the export is an object, with keys acting as the route id, and an object that contains the matches (regex based) and the module which should be executed by the router if the route matches. I can feed my router with both a Constructor function (or an object) for modules which are available immediatly (i.e. contained in the main chunk) or if the module value is a string, this means that the router has to load this module dynamically by using the path specified in the string.
So as I know what modules could be potentially loaded (but not if and when) I can now parse this file within my build process and transform the route config to something webpack can understand:
const path = require("path");
const fs = require("fs");

let routesSource = fs.readFileSync(path.resolve(__dirname, "app/routes.js"), "utf8");

routesSource = routesSource.substr(routesSource.indexOf("export default"));
routesSource = routesSource.replace(/module:\s*((?!".*").)*$/gm, "module: undefined,");
routesSource = routesSource.replace(/\r?\n|\r/g, "").replace("export default", "var routes = ");

eval(routesSource);

let dummySource = Object.entries(routes).reduce((acc, [routeName, routeConfig]) => {

    if (typeof routeConfig.module === "string") {
        return acc + `import(/* webpackChunkName: "${routeName}" */"${routeConfig.module}");`;
    }

    return acc;

}, "") + "export default ''";

(Yeah I know this is quite ugly and also a bit brittle so this surely could be done better)
Essentially I create a new, virtual module where every route entry which demands a dynamic import is translated, so:
DynClass: {
    match: /^\//,
    module: "/src/app/DynClass.js"
}

becomes:
import(/* webpackChunkName: "DynClass" */"/src/app/DynClass.js");

So the route id simply becomes the name of the chunk!
2) including the virtual module in the build
For this I use the virtual-module-webpack-plugin:
plugins: [
    new VirtualModulePlugin({
        moduleName: "./app/dummy.js",
        contents: dummySource
    })
],

Where dummySource is just a string containing the sourcecode of my virtual module I just have generated. Now, this module is pulled in and the "virtual imports" can be processed by webpack. But wait, I still need to import the dummy module, but I do not have any in my development mode (where I use everything natively, so no loaders).
So in my main code I do the following:
let isDev = false;
/** @remove */
isDev = true;
/** @endremove */

if (isDev) { import('./app/dummy.js'); }

Where "dummy.js" is just an empty stub module while I am in development mode. The parts between that special comments are removed while building (using the webpack-loader-clean-pragma loader), so while webpack "sees" the import for dummy.js, this code will not be executed in the build itself since then isDev evaluates to false. And since we already defined a virtual module with the same path, the virtual module is included while building just like I want, and of course all dependencies are resolved as well.
3) Handling the actual loading
For development, this is quite easy (remember I do not use any bundler or loaders here):
import routes from './app/routes.js';

Object.entries(routes).forEach(async ([routeId, route]) => {
    if (typeof route.module === "function") {
        new route.module;
    } else {
        const result = await import(route.module);
        new result.default;
    }
});

(Note that this is not the actual router code, just enough to help me with my PoC)
Well, but for the build I need something else, so I added some code specific to the build environment:
/** @remove */
const result = await import(route.module);
new result.default;
/** @endremove */

if (!isDev) {
    if (typeof route.module === "string") { await __webpack_require__.e(routeId); }
    const result = __webpack_require__(route.module.replace("/src", "."));
    new result.default;
}

Now, the loading code for the dev environment is just stripped out, and there is another loading code that uses webpack internally. I also check if the module value is a function or string, and if it is the latter I invoke the internal require.ensure function to load the correct chunk: await __webpack_require__.e(routeId);. Remember that I named my chunks when generating the virtual module? Now thats why I still can find them now!
4) more needs to be done
Another thing I encountered is when several dynamically loaded modules have the same dependencies, webpack tries to generate more chunks with names like module1~module2.bundle.js, breaking my build. To counter this, I needed to make sure that all those shared modules go into a specific named bundle I called "shared":
optimization: {
    splitChunks: {
        chunks: "all",
        name: "shared"
    }
}

And when in production mode, I simply load this chunk manually before any dynamic modules depending on it are requested:
if (!isDev) {
    await __webpack_require__.e("shared");
}

Again, this code only runs in production mode!
Finally, I have to prevent webpack renaming my modules (and chunks) to something like "1", "2" etc, but rather keep the names I just have defined:
optimization: {
    namedChunks: true,
    namedModules: true
}

Se yeah, there you have it! As I said this wasn't pretty but seems to work, at least with my simplified test setup. I really hope there aren't any blockers ahead of me when I do all the rest (like ESLint, SCSS etc)!


Hello, your theme is great.

Hello, your theme is great. However, it would be even better if it could support the theme switcher plugin. When I use the Lightpad theme, the theme switch button doesn't work properly. Could you look into what might be causing this issue?
https://github.com/madodig/trilium-widget-theme-switch

Hello, your theme is great. However, it would be even better if it could support the theme switcher plugin. When I use the Lightpad theme, the theme switch button doesn't work properly. Could you look into what might be causing this issue?
https://github.com/madodig/trilium-widget-theme-switch

Comment out lines 122-125 of Lightpad, but this may have other effects
/* Fix for flickering tooltips as tooltips steal pointer events if overlapped with tooltip-triggering element. */
.tooltip {
    pointer-events: none;
}

/* Fix for flickering tooltips as tooltips steal pointer events if overlapped with tooltip-triggering element. */
.tooltip {
    /*pointer-events: none;*/
}


fix(wordlist): renormalized trickest wordlist

This is the last time the trickest wordlist will have to be renormalized manually. All future renormaliations will be done automatically by the 'remote-wordlists-updater.yml' github action. See #1017

Thanks for handling @ItsIgnacioPortal

Closing this PR, as this issue is currently being discussed in https://github.com/ItsIgnacioPortal/SecLists-Express/issues/16


Can't add a new (my own) font in the script - PLZ IF SOMEONE KNOWS, IT'S URGENTLY FOR ME, Ty

Hi all and @ankush-me ,
can someone help me, I don't understand how to add my own font into script? I found in code fontlist.txt text source - a file that is used as text source. So there I put my .ttf fonts that I downloaded from here: https://www.1001fonts.com/text-fonts.html?page=1&fbclid=IwAR395plHPNmZemLoKmvpedbqRv0z8pUVU66np7LLWzia14GrAKWcZB1H5o4 and then terminal shows me and error :
'Fabiolo' is the name of font

When I use the upper one (fontlist1.txt - mine) there shows an error.
When I use the bottom one (fontlist.txt - originally from SynthText script) that works fine everytime.

Here you can see how I add paths and names into fontlist1.txt
I also add the font names like 'Fabiolo', 'Halida Sans', ... into Font Manager but still nothing, shows the same errors.

You need to give the full (relative) path to the font file (.ttf) as you have also shown in the last screenshot --- but the paths are not given in the second screenshot. Also you probably need to use the same filename (fontlist.txt and not fontlist1.txt) unless you have made the corresponding change in the code.

Yes, in the second screenshot I didn't put .ttf fonts into folders, they were out (in the same folder where are fontlist.txt) like halida-sans.normal.ttf in 2nd screenshot, but then I try to put them in folders like you did, that you can see in the 3rd screenshot and also don't work.
In code I made a change from fontlist.txt to fontlist1.txt, just load other .txt file.

This last error is different. For adding new fonts you need to update the font model as well. Check here, and use this script.

Also I don't think you need to install these fonts -- but can try.

The Failed to load font: unknown file format error seems to be originating in Pygame's freestyle font engine. I do not have any good pointers on how to resolve that unfortunately.


CI containers' valgrind is no longer running

This week, something changed and valgrind is failing to start up:
https://github.com/sparklemotion/nokogiri/actions/runs/5331574365
This issue is a placeholder for investigating and fixing it.

OK, pretty sure this is because the base image (ruby:3.2) switched from bullseye to bookworm last week.
https://github.com/docker-library/ruby/commit/ed1be47a38a7a24a0aa03c450549afcb592f02a8
See https://github.com/sparklemotion/nokogiri/pull/2721 for a prior example of running into DWARF5 data that requires valgrind 3.20 or later. The ruby:3.2 bookworm image has valgrind 3.19.


Wrong time

Must be 11:54 UTC+3

Time is correct.
It's just in UTC timezone.

I`m not familiar with time zone concept. I live in Ukraine and its wrong time for me.


M09-Lab 16 - Monitoring Application Performance: Lacks appsettings to deploy correctly

Contact Details
No response
What happened?
Exercise : 1
Task: 2
Step: 10 - 12
Description of issue: the Azure App Service deploy step requires configuration to deploy correctly
Repro steps:
Current deployment, without the correct App Settings will result in a 500 error
Step 12 should look like
    - task: AzureRmWebAppDeployment@4
      inputs:
        ConnectionType: 'AzureRM'
        azureSubscription: 'MTTManaged'
        appType: 'webApp'
        WebAppName: 'az400eshoponweb177112039'
        packageForLinux: '$(Build.ArtifactStagingDirectory)/**/Web.zip'
        AppSettings: '-UseOnlyInMemoryDatabase true -ASPNETCORE_ENVIRONMENT Development'

Lab
Other
Relevant screenshots
paste here 😉
Do you want to help us? 👏

[ ] Create a Pull Request by following this project's Contribution Guide

Fixed by #559.


Update DG with design details - Austin

Each member should describe the implementation of at least one enhancement he/she has added (or planning to add).
Expected length: 1+ page per person
The description can contain things such as,

How the feature is implemented (or is going to be implemented).
Why it is implemented that way.
Alternatives considered.

Will write for help and confirmation/clear command


Use crosshairs to switch between views

User story
Nils:

We should discuss how users could use the cross hair to switch from one view to another.
Example: hovering over a cell in the t-SNE  window give me a location in the spatial view, but unless I am already zoomed into the corresponding location, I usually can't make out where exactly that cell is and what it looks like.
I have some ideas for that, e.g. we could show a "detail" view inside the views.
But most importantly we should understand how relevant that is for our target audience.

Preferred solution
Not sure

Eventually there will some kind of global configuration: not a priority for now.

This is somewhat related to navigation across different spaces, see also notes in #189.


Implement modal for purchasing managers

created modal, still need to implement onClick for the Hire buttons, and backend api to decrease coins & change managerOwned = true.


chore: fix trivy workflow by using mcr image

What type of PR is this?
/kind cleanup

What this PR does / why we need it:
Fix trivy workflow failure due to ghcr throttling.
2024-10-28T23:06:23Z	ERROR	[vulndb] Failed to download artifact	repo="ghcr.io/aquasecurity/trivy-db:2" err="OCI repository error: 1 error occurred:\n\t* GET https://ghcr.io/v2/aquasecurity/trivy-db/manifests/2: TOOMANYREQUESTS: retry-after: 849.127µs, allowed: 44000/minute\n\n"
2024-10-28T23:06:23Z	FATAL	Fatal error	init error: DB error: failed to download vulnerability DB: OCI artifact error: failed to download vulnerability DB: failed to download artifact from any source

Which issue(s) this PR fixes:

Fixes #
Special notes for your reviewer

coverage: 80.775%. remained the same
when pulling 6ec020c22123ca7d1b99c26f18009be4f6daf5f2 on jwtty/fix-trivy
into<PHONE_NUMBER>5f4c441ff144b74d9bf4dacc56675b on main.


Make Remote Timer Job Work OnPrem

Q
A

Bug fix?
yes

New feature?
no

New sample?
no

Related issues?
fixes #X, partially #Y, mentioned in #Z

What's in this Pull Request?
The fix adjusts code for Remote Timer Jobs. Using AppOnlyContext in the Remote Timer Job framework OnPrem resulted in the 400 Bad Request Error:
The remote server returned an error: (400) Bad Request. - {"error":"invalid_request","error_description":"AADSTS90002:
No service namespace named '95650b5e-bcbc-4ddc-8170-b31e1f4b4f05' was found in the data store.
Trace ID: c3484490-566a-4892-998d-2819d393d4ab
Correlation ID: 84948f76-8c0f-4bc9-824b-7b6b54d03582\r\n

The reason it fails is the call to accounts.windows.net which (AFAIK) should not be done for S2S:

So using Kirk Evans Blog Post we changed OfficeDevPnP.Core.AuthenticationManager.GetAppOnlyAuthenticatedContext from this
EnsureToken(siteUrl, realm, appId, appSecret, acsHostUrl, globalEndPointPrefix);
ClientContext clientContext = Utilities.TokenHelper.GetClientContextWithAccessToken(siteUrl, appOnlyAccessToken);
return clientContext;

to this where a simpler solution is used for OnPremises environment:
#if ONPREMISES
 //As in Kirk Evans blog the app only context is created this way for S2S
 //https://blogs.msdn.microsoft.com/kaevans/2013/02/23/sharepoint-2013-app-only-policy-made-easy/
appOnlyAccessToken = TokenHelper.GetS2SAccessTokenWithWindowsIdentity(new Uri(siteUrl), null);
#else
EnsureToken(siteUrl, realm, appId, appSecret, acsHostUrl, globalEndPointPrefix);
#endif
ClientContext clientContext = Utilities.TokenHelper.GetClientContextWithAccessToken(siteUrl, appOnlyAccessToken);
return clientContext;

There has been another PR for enabling S2S scenarios for Remote Timer Jobs: PR 86 by @suhasrs. I hadn't seen it before submitting my PR. With all respect for the Low Trust recommendation, it would be great if PnP would address S2S scenarios, too. In our case (and many others' case) we still use S2S and we want to use and contribute to PnP and be able to get updates and improvements through the public Nuget repository. This little fix would allow standardized Remote Timer Jobs both for Hight Trust and Low Trust scenarios. ping @VesaJuvonen

Hi Anatoly,
We'll look into this PR, but given the holidays it most likely will not be processed before the next master merge. We're currently not supporting high trust models for on-premises...isn't using low trust (the same model as used for SharePoint Online) not an option for you?

Hi Anatoly, thanks for your PR...the PnP team has been discussing this and we've decided that we're not going to merge this PR since we're nowhere specifically supporting the high trust model. The main reason for now doing high trust is to keep the PnP code base compatible for both cloud as on-premises since they both support the low trust model. We do know that in certain cases low trust is not sufficient for on-premises, but that's not a scenario that we're actively supporting with PnP.