Ceph hostname change during upgrade

L>M has changed the hostname of our containers, therefore we
need to adapt this everywhere. Ceph was left behind, and this
is fixing the hostnames by shutting down the monitors, removing the mons,
deleting the containers, recreating them, and rejoining the cluster, all
of this in a serial way.
The ceph-mon playbook was adapted to verify the bind mount is there, in
order to avoid data loss.
Signed-off-by: Jean-Philippe Evrard<EMAIL_ADDRESS>Connects rcbops/u-suk-dev#383

:mag_right: Preview

HULK PREVIEW

:mag_right: Preview

Testing this out now, but another thing we'll most likely need to address is the lack of fact caching in rpc-openstack.  When you run ceph-mon.yml with --limit and there are no mon facts in /etc/openstack_ansible/ansible_facts, it fails with:
TASK: [ceph.ceph-common | generate ceph configuration file] *******************
<<IP_ADDRESS>> ESTABLISH CONNECTION FOR USER: root
<<IP_ADDRESS>> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/root/.ansible/cp/ansible-ssh-%h-%p-%r" -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=120 <IP_ADDRESS> /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1474487544.19-24462282248248 && echo $HOME/.ansible/tmp/ansible-tmp-1474487544.19-24462282248248'
fatal: [liberty-aio_ceph_mon_container-f08cd0ce] => One or more undefined variables: 'dict object' has no attribute u'ansible_eth1'

Are there any reasons we cannot simply sync openstack-ansible's fact settings in ansible.cfg with rpc-openstack's?

ofc I will test to verify if my understanding is ok :p

HULK PREVIEW

:mag_right: Preview

This seemed to run most of the time for me. One of my runs failed trying to SSH into a ceph_mon container. That made it kind of a hassle to continue.
On another note, as @mattt416 pointed out, it would be good to cleanup the [mon] configs on the OSD nodes. Those are still referencing the old hostnames.
I'm doing some more testing now to verify the integrity of the ceph cluster(i.e creating cinder volumes).
I'm also trying to get my multinode lab environment back up to test this.

Tested this latest commit on an AIO, the first two times it failed w/ ssh errors, bumped up my VM's CPUs (originally just 1) and then the upgrade took fine.  So, this LGTM but I think there are still some comments above that need addressing.
I'm currently spinning up SYD-SYD2-2 so I can do more extensive testing.  The repo-build is taking an eternity so I'll need to check on it tomorrow.
As @alextricity25 pointed out, we'll still need to re-run ceph-osd.yml.  We'll also need to do a bunch more testing before we can remove the WIP and get this merged.

The OSD bits are not done AT ALL right now.
I don't know how it happened but in all our force push, we introduced a regression, the scp is now done on the physical host, instead of the deploy node. That could be a cause of pain too.
I'll adapt this, and retry a full deploy later. In the meantime, I'll focus on OSDs.

Testing the latest now.

The most recent commit spits back this when running the ceph-osd playbook:
TASK: [ceph.ceph-common | verify only one osd scenario was chosen] ************
failed: [cantu-testup-ceph13_ceph_osd_container-10c5ba92] => {"failed": true}
msg: please select only one osd scenario
failed: [cantu-testup-ceph13_ceph_osd_container-c72cf92f] => {"failed": true}
msg: please select only one osd scenario
failed: [cantu-testup-ceph13_ceph_osd_container-d51b5925] => {"failed": true}
msg: please select only one osd scenario

FATAL: all hosts have already failed -- aborting

Currently investigating...

I've pinned it down to the osd_directory and the raw_multi_journal variables.
In liberty, raw_multi_journal is set to false by default, but after the upgrade the value is set to true in user_rpco_variables_defaults.yml. This is because the value is set to true in the mitaka branch.. However, after the upgrade, osd_directory is also set to true, which causes this conditional to fail.
I'm currently looking for the best way to deal with this is..

HULK PREVIEW

I submitted a fix for what I stated above as a separate commit. Hopefully I did that right. I was told we can squash commits later?

HULK PREVIEW

:eyes: Preview

:mag_right: Preview

Blocked until we change our variables.
Bug explained here: https://github.com/rcbops/rpc-openstack/issues/1436

Ignore this comment.

On my tests, I'm still getting these intermittent SSH connection errors on my ceph_mon containers:
TASK: [ceph.ceph-common | check if nmap is installed] *************************
fatal: [cantu-testup-ceph16_ceph_mon_container-4b4c8470] => SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh

FATAL: all hosts have already failed -- aborting

Is anyone else seeing the same thing?

I added a commit that adds comments to this TASK in test-upgrade.sh. @mattt416, @evrardjp, Could you please review these comments for accuracy?

I've tested the latest commit (I had to run migrate-yaml.py myself, then make sure raw_mutli_journal was False). I was able to run through test-upgrade.sh successfully, and it also looks like ceph is operating as expected with the new host names in place. I've outlined my testing below:

Check ceph is operational before the upgrade

cantu-testup-ceph18_ceph_mon_container-2c4508d1 | success | rc=0 >>
    cluster 0513156b-0b06-48c2-b3f7-aec1ab767ba7
     health HEALTH_OK
     monmap e1: 3 mons at {cantu-testup-ceph18_ceph_mon_container-09826d3c=<IP_ADDRESS>:6789/0,cantu-testup-ceph18_ceph_mon_container-20708421=<IP_ADDRESS>:6789/0,cantu-testup-ceph1
8_ceph_mon_container-2c4508d1=<IP_ADDRESS>:6789/0}
            election epoch 4, quorum 0,1,2 cantu-testup-ceph18_ceph_mon_container-2c4508d1,cantu-testup-ceph18_ceph_mon_container-20708421,cantu-testup-ceph18_ceph_mon_container-09826d
3c
     osdmap e16: 3 osds: 3 up, 3 in
      pgmap v1940: 512 pgs, 4 pools, 0 bytes data, 0 objects
            124 GB used, 127 GB / 265 GB avail
                 512 active+clean

cantu-testup-ceph18_ceph_mon_container-09826d3c | success | rc=0 >>
    cluster 0513156b-0b06-48c2-b3f7-aec1ab767ba7
     health HEALTH_OK
     monmap e1: 3 mons at {cantu-testup-ceph18_ceph_mon_container-09826d3c=<IP_ADDRESS>:6789/0,cantu-testup-ceph18_ceph_mon_container-20708421=<IP_ADDRESS>:6789/0,cantu-testup-ceph18_ceph_mon_container-2c4508d1=<IP_ADDRESS>:6789/0}
            election epoch 4, quorum 0,1,2 cantu-testup-ceph18_ceph_mon_container-2c4508d1,cantu-testup-ceph18_ceph_mon_container-20708421,cantu-testup-ceph18_ceph_mon_container-09826d3c
     osdmap e16: 3 osds: 3 up, 3 in
      pgmap v1940: 512 pgs, 4 pools, 0 bytes data, 0 objects
            124 GB used, 127 GB / 265 GB avail
                 512 active+clean

cantu-testup-ceph18_ceph_mon_container-20708421 | success | rc=0 >>
    cluster 0513156b-0b06-48c2-b3f7-aec1ab767ba7
     health HEALTH_OK
     monmap e1: 3 mons at {cantu-testup-ceph18_ceph_mon_container-09826d3c=<IP_ADDRESS>:6789/0,cantu-testup-ceph18_ceph_mon_container-20708421=<IP_ADDRESS>:6789/0,cantu-testup-ceph18_ceph_mon_container-2c4508d1=<IP_ADDRESS>:6789/0}
            election epoch 4, quorum 0,1,2 cantu-testup-ceph18_ceph_mon_container-2c4508d1,cantu-testup-ceph18_ceph_mon_container-20708421,cantu-testup-ceph18_ceph_mon_container-09826d3c
     osdmap e16: 3 osds: 3 up, 3 in
      pgmap v1940: 512 pgs, 4 pools, 0 bytes data, 0 objects
            124 GB used, 127 GB / 265 GB avail
                 512 active+clean

Run migrate-yaml.py by hand without the --for-testing-take-new-vars-only, then decide on appropriate values.

Run test-upgrade.sh

Verify ceph status once again(notice updated hostnames everywhere):

cantu-testup-ceph18_ceph_mon_container-2c4508d1 | success | rc=0 >>
    cluster 0513156b-0b06-48c2-b3f7-aec1ab767ba7
     health HEALTH_OK
     monmap e7: 3 mons at {cantu-testup-ceph18-ceph-mon-container-09826d3c=<IP_ADDRESS>:6789/0,cantu-testup-ceph18-ceph-mon-container-20708421=<IP_ADDRESS>:6789/0,cantu-testup-ceph18-ceph-mon-container-2c4508d1=<IP_ADDRESS>:6789/0}
            election epoch 26, quorum 0,1,2 cantu-testup-ceph18-ceph-mon-container-2c4508d1,cantu-testup-ceph18-ceph-mon-container-20708421,cantu-testup-ceph18-ceph-mon-container-09826d3c
     osdmap e44: 3 osds: 3 up, 3 in
      pgmap v2281: 512 pgs, 4 pools, 0 bytes data, 0 objects
            141 GB used, 110 GB / 265 GB avail
                 512 active+clean

cantu-testup-ceph18_ceph_mon_container-09826d3c | success | rc=0 >>
    cluster 0513156b-0b06-48c2-b3f7-aec1ab767ba7
     health HEALTH_OK
     monmap e7: 3 mons at {cantu-testup-ceph18-ceph-mon-container-09826d3c=<IP_ADDRESS>:6789/0,cantu-testup-ceph18-ceph-mon-container-20708421=<IP_ADDRESS>:6789/0,cantu-testup-ceph18-ceph-mon-container-2c4508d1=<IP_ADDRESS>:6789/0}
            election epoch 26, quorum 0,1,2 cantu-testup-ceph18-ceph-mon-container-2c4508d1,cantu-testup-ceph18-ceph-mon-container-20708421,cantu-testup-ceph18-ceph-mon-container-09826d3c
     osdmap e44: 3 osds: 3 up, 3 in
      pgmap v2281: 512 pgs, 4 pools, 0 bytes data, 0 objects
            141 GB used, 110 GB / 265 GB avail
                 512 active+clean

cantu-testup-ceph18_ceph_mon_container-20708421 | success | rc=0 >>
    cluster 0513156b-0b06-48c2-b3f7-aec1ab767ba7
     health HEALTH_OK
     monmap e7: 3 mons at {cantu-testup-ceph18-ceph-mon-container-09826d3c=<IP_ADDRESS>:6789/0,cantu-testup-ceph18-ceph-mon-container-20708421=<IP_ADDRESS>:6789/0,cantu-testup-ceph18-ceph-mon-container-2c4508d1=<IP_ADDRESS>:6789/0}
            election epoch 26, quorum 0,1,2 cantu-testup-ceph18-ceph-mon-container-2c4508d1,cantu-testup-ceph18-ceph-mon-container-20708421,cantu-testup-ceph18-ceph-mon-container-09826d3c
     osdmap e44: 3 osds: 3 up, 3 in
      pgmap v2281: 512 pgs, 4 pools, 0 bytes data, 0 objects
            141 GB used, 110 GB / 265 GB avail
                 512 active+clean

Verify functionality of ceph cluster by creating images and volumes (volumes and images populated in the rbd pools)

ansible mons -m shell -a "rbd ls images"
cantu-testup-ceph18_ceph_mon_container-09826d3c | success | rc=0 >>
f3b79dee-665d-4df3-a858-17e31389de7f

cantu-testup-ceph18_ceph_mon_container-2c4508d1 | success | rc=0 >>
f3b79dee-665d-4df3-a858-17e31389de7f

cantu-testup-ceph18_ceph_mon_container-20708421 | success | rc=0 >>
f3b79dee-665d-4df3-a858-17e31389de7f

ansible mons -m shell -a "rbd ls volumes"
cantu-testup-ceph18_ceph_mon_container-20708421 | success | rc=0 >>
volume-4fc08823-8527-4439-88b4-e37f43e1a19d

cantu-testup-ceph18_ceph_mon_container-09826d3c | success | rc=0 >>
volume-4fc08823-8527-4439-88b4-e37f43e1a19d

cantu-testup-ceph18_ceph_mon_container-2c4508d1 | success | rc=0 >>
volume-4fc08823-8527-4439-88b4-e37f43e1a19d

Given the above, you have my +1

Could someone not @alextricity25 and not @mattt416 have a last look?
Thank you.

I'm testing this on a multi node cluster as we speak.  I'll update with my findings in the next couple of hours.  :)

SYD-SYD2-2 has this patch applied, and an upgrade (with FORKS=10) has progressed nicely through the ceph component.  I'm now on the openstack-ansible upgrade and my ceph cluster looks healthy.  As per my inline comment, I do think we ought to ensure the cluster is in a good place before cycling onto the next MON (which could inadvertently tear down the cluster), and with a change of that nature in place I do think this review looks good.  It'd be great to get some additional eyes on it to make sure we're not missing anything obvious.

OK, my upgrade finally bombed out when running setup-maas.yml as part of the RPC upgrade.  It failed trying to provision a ceph.conf onto the hosts that have ceph services running on them:
TASK: [ceph.ceph-common | generate ceph configuration file] *******************
fatal: [730504-infra01] => One or more undefined variables: 'dict object' has no attribute u'ansible_eth1'
fatal: [731201-storage02] => One or more undefined variables: 'dict object' has no attribute u'ansible_eth1'
fatal: [731174-infra03] => One or more undefined variables: 'dict object' has no attribute u'ansible_eth1'
fatal: [731202-storage03] => One or more undefined variables: 'dict object' has no attribute u'ansible_eth1'
fatal: [731200-storage01] => One or more undefined variables: 'dict object' has no attribute u'ansible_eth1'
fatal: [731173-infra02] => One or more undefined variables: 'dict object' has no attribute u'ansible_eth1'

It looks like setup-maas.yml also gathers mons, so we should probably replace that with a call to gen-facts.yml.  In my instance, it looks like no facts were gathered for some reason:
PLAY [Gather mons facts for ceph.conf template] *******************************

PLAY [Install Ceph dependencies] **********************************************

TASK: [ceph.ceph-common | fail on unsupported system] *************************
skipping: [730504-infra01]
skipping: [731202-storage03]
skipping: [731173-infra02]
skipping: [731174-infra03]
skipping: [731201-storage02]
skipping: [731200-storage01]

@mattt416 Could you clarify the failure, please?
It looks like the facts are indeed missing for the ceph.conf task, but every single ceph playbook should have generated the facts.
On which play(book) did this occur?

Included the explicit gathering playbook into the setup-maas.

If you want to double-check your formatting, check the preview.

:eyes: Preview

Tested this again, verify-maas.yml failed (I think there were some failed LB checks before the upgrade started), but otherwise the upgrade ran smoothly end-to-end.  I will create a separate card to revisit seeing if we can put some of this ceph upgrade component into a playbook, and to add some ceph status checking before containers are torn down.  That aside, I'm a 👍 here.

I've reviewed it as well, but didn't test in a lab yet, so while I approve I can't merge it yet.

I'm gonna count major's and my vote as a singe actual vote and merge this.

I'm also deleting the branch

Backport is here: https://github.com/rcbops/rpc-openstack/pull/1463


Find the source from which data/dpeloy/0.3._ are compiled

What are data_0.3._ deployment files?

[ ] check if they have deposit limits?
[ ] add source codes to the Etherscan
[ ] add a document in the repo explaining the different deployment files (maybe that already exists, but see where it is)

0.3._ has deposit limits: https://rinkeby.etherscan.io/address/0xed50a9ad6263f5416de956b27979ee3457557896#code

Perhaps it's better to remove 0.3._.

Commit 89b3625dd702fe5397f21ec458a1b8e5e9e908e0 adds the deployment data in question.  Which source was used for this?

README says something actually.

Source code: https://github.com/raiden-network/raiden-contracts/tree/fc1c79329a165c738fc55c3505cf801cc79872e4/raiden_contracts/contracts

Perhaps it's possible to re-generate the same bytecode from there.

0.3 was removed from the repo.


feat: adding helper to move SteeringVector to a given device or dtype

This PR adds a convenience method .to() on SteeringVector which returns a new steering vec with .to() called on each of its layer activations.
closes #10

LGTM


Update zio to 1.0.13

Updates dev.zio:zio from 1.0.3 to 1.0.13.
GitHub Release Notes - Version Diff
I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.
Configure Scala Steward for your repository with a .scala-steward.conf file.
Have a fantastic day writing Scala!

Ignore future updates
Add this to your .scala-steward.conf file to ignore future updates of this dependency:
updates.ignore = [ { groupId = "dev.zio", artifactId = "zio" } ]

labels: library-update, early-semver-patch, semver-spec-patch, commit-count:1

Superseded by #292.


Snippets: improve breaking into sentences

Github lost the screenshot, so I don't remember what problem it was about. But some improvements were made in this commit: https://github.com/parpalak/rose/commit/9ff10782b44863d2d96679abdc5789e84eceff2a


Issue with changing scale and loading game

Seeing a strange issue when trying to change the scale and reloading a game from the workspace. Looks like ResetGame is calling the current tool (settings) but trying to load the Game directory.

When hitting Crtl + 1 from this screen it says it's reloading the game directory but ends up loading the last tool.

To reproduce, I copied the Music tool over to the Game folder to test out the preloader and then started changing the scale value.

When changing the scale, the tool reloads itself which forces the engine to correct the scaling.


Accordion: use "name" attribute for auto-collapse

Replace data attribute with name attribute and provide JavaScript fallback for non-supporting browsers.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details#name

I'll do this. Already have it nearly done.
We should probably also port this code to a makeup ui component. I'll create a separate issue for that on makeup.

Done.


Original dataset

Hello, could you please tell me from where you got the two datasets? I would like to download the raw data (each reading) instead of an 5 minute average. Thank you in advance!

http://pems.dot.ca.gov/, create an account and go to clearinghouse. Select "Station Raw", and district 4 (which is the Bay area).

Caltrans PeMS provides the original dataset.


tests: Remove slow tests detection

According to @showell:

All the slow decorators can die. That was a failed experiment of mine from 2014 days.  I have meaning to kill them for a couple years now.  I wrote this with the best of intentions, but I believe it's now just cruft.  We never made a "fast" mode, for one. And we kept writing more and more slow tests, haha.

I totally support this change.  Thanks @andersk!

Feel free after resolving the merge conflicts with your other PR I just merged parts of.


Stop using govuk template

While waiting for UKTI specific templates, take the base layout from GOV uk and copy into the project and strip out the bits not wanted.

Will Just do this for Nunjucks and then move onto a base version for Django as this is needed for a project.

Include a static css and js file just to support the layout. Should be able to do a hello world without resorting to sass.


Change default storage layout to column store whenever the schema permits

Change the default layout to column store. This will likely slow down updates but likely speed up analytic queries. How much? Here are some numbers (Release build) on the SSB 10GB benchmark on a single socket with 10 cores.

Query
Before
After

Load the big lineitem table
123.7 seconds
207.6 seconds

Q1
3.0 seconds
0.96 seconds

Need to work on speeding up insertion into (compressed) column stores. A future PR.
PS: The following command was use to start quickstep: ./quickstep_cli_shell -printing_enabled=false -buffer_pool_slots=10240 -parallelize_load -num_workers=10 -worker_affinities="0,4,8,12,16,20,24,28,32,36"

Hi @pateljm This is very impressive!

Thanks @hbdeshmukh for all your help this morning on getting the right parameters. That was crucial in getting these numbers!

@pateljm This is awesome!
One minor grammar issue: capitalize the first letter in all the comments, as we treat them as English sentences.

The code looks good.
There are a few corner cases to consider.

If the user creates a table where the first attribute is an attribute which does not have a standard comparator, then setting the SORT_ID to that attribute will make an invalid description.
Similarly, there are some attribute types which cannot be compressed in the relation, the resulting description will be invalid.

For more information on this, the DescriptionIsValid method of CompressedColumnStore will show you what conditions must be met while creating a block.

Finally, setting the default block to column store removes the ability to ad-hoc add tuples to the store. (What if we could keep a rowstore block around for ad-hoc insertions? Is the this even a useful feature?)

I should add that a quick fix to the invalid description corner case if to create the description. We can then test if it is valid, and if not, use the old method of using a rowstore.

Excellent points @cramja on catching the case when the first attribute does not have a comparator. Let me mull over the other point you make about ad hoc tuples.
On a different note, I'm so glad to see you ramping up so quickly and your attention to detail. Thanks!

Ok - had a nice chat with @cramja and would make sense to not merge this PR even after reworking. Better idea is to wait for the block properties work to be completed, and then build on top of that. Deleting this PR next. Thanks Marc!


doc: west: fix WestCommand self.configuration -> self.config

WestCommand has no .configuration field, it's .config.
In the same (and cursed!) sentence, also fix the broken link to west.command.WestCommand by switching the link target from the unusual py:class:: to the common autoclass:: used by all other classes in the same page. I don't understand why that fixes the hyperlink but it works and it's consistent.

Thanks!


Option to generate unique IDs?

This is a feature request.
There's a plugin for minifying IDs but this is basically useless when inlining SVGs in HTML because it is guaranteed to cause problems (i.e. when inlining at least two SVGs that contain IDs you're guaranteed to have a conflict on ID "a").
It would be very useful if SVGO allowed prefixing IDs with a configurable key. This would allow tooling like react-svg-loader to generate a unique prefix and pass it to SVGO to guarantee the IDs don't break when the SVGs are inlined.
A problem is that the IDs can be referenced with xlink:href attributes and url() values but this is already addressed by the cleanupIDs plugin.

Actually, cleanupIDs has prefix option (works only with minifying).

I, too, need this feature.
the cleanupIDs prefix option is not a solution to this problem.  Consider two svg files both of which have a defined id "id1".  When using the two separate svgs inline, these two ids will conflict, since they exist in the same document.  Using the prefix option only moves this problem from having two conflicting "id1" ids to having two conflicting "prefix_id1" ids.

The prefix should be the name of the file. For example:
IconOfACar.svg -> iconofacar_id1
IconOfABeer.svg -> iconofabeer_id1

Being able to supply the prefix should suffice. Seems more versatile than having SVGO pick one automagically.

I don't think that is versatile for batch processing. I usually process thousands of svg files with a script at every site update, and I surely don't want to manually enter a prefix for each one.

Similar issue?: https://github.com/svg/svgo/issues/673

Is there any movement on this?
As much as it sounds a dick move, I think you need to listen to the general consensus here, this is an issue that many users are having when using inlined SVGs when passed through SVGO - for example we even have this issue using Sketch SVGO Compressor plugin, we end up having 10 SVGs with #a that causes masking issues so have to manually go through the file and change them, which is not feasible for a fully automated system.
As @Emasoft has suggested, I think the only sensible solution would be to slugify the filename and use that as the id prefix, turn this on as a default, which means every user that has an automated workflow or has tools that then use svgo will be unaffected, unless they pass in an extra option to disable it something like --disable-auto-id-prefix
@strarsis this does seem like similar issue yeah, I think the issue as a whole is just around "naming conflicts as the minification process has no concept of other files"

PR: https://github.com/svg/svgo/pull/700

@OwenMelbz you can disable minifying IDs in cleanupIDs with the following config:
plugins:
  - cleanupIDs:
      minify: false

So your files will have unique IDs as long as they had it already.

@GreLI You've completely missed the point - which clearly several other people have agreed there is an issue.
Many automated systems rely on svgo
Many of these systems do not allow the user to modify settings.
e.g Sketch has a official plugin, SVGO Compressor, which uses svgo.
The end user cannot modify the plugin or config.
Thus your reply is void.
Its extremely narrow minded and selfish to disregard an issue simply because you don't want to address it, rather than helping the global community come up with a solution to a community acknowledged issue.
Maybe if we state the problem again you will understand.

SVGO when cleaning up IDs (a feature that is still desired) does not have a concept of "other svgs" - which means if you minified 100 svgs, they would all end up having the id of a which means they're next to useless to be embedded into webpages.
The solution to help developers/designers/content writers/PEOPLE is by using the privileged stance of svgos positioning in the development world to implement a feature that solves this issue for users who are using their system for some reason. And there have been plenty of suggestions on ways to solve this.
Remember when Facebook - a social media platform, decided to use its privileged position to help family members involved in world crises to mark theirselves as safe? Yes its not directly their problem to solve, but they could propose a solution because it was for the benefit of its users.
This is why people come to you guys seeking solutions, because you're in a position to help out. Similarly to the cheesy line from spider-man - with great power comes great responsibility.
Maybe thinking of it in a different non-dismissive Trump-like manor will urge you not to slap a "closed" on a real life issue.

Many of these systems do not allow the user to modify settings.

Unfortunately, nobody here can't fix their obvious flaws. What if different users want totally opposite? Configuration is what makes SVGO flexible. Ask these systems authors to add an option to set a configuration. They get paid for this, unlike me or other OSS maintainers.
The “consensus“ here has been set just in your mind. No statistics or clear numbers has been provided to verify your claims. So please stop your nonsense word pouring. Nobody here has to do something for you.

I have encountered this problem recently. I use react-svg-loader to import svg files directly. the react-svg-loader use svgo to optimize svg files. the problem is Adobe Illustrator will export svg files with same ID, and no matter how SVGO minify the ID there will be collision. I searched for a solution and ended up with this issue.
I think @GreLI 's right about the usage and purpose of SVGO. But asking for a feature like is reasonable. SVGO provides a fairly easy way to manipulate svg code. it just seems very natural to do this kind of stuff with SVGO.
I ended up with writing a node script to process all the svg files using svgo. the tricky part is, every time it process a file, it will use a new SVGO instance and use a config with unique prefix.  something look like this:
  let filePath = path.join(folderPath, file)
  let prefix = generatePrefix(file)
  let svgo = new SVGO({
    plugins: [{cleanupIDs: {
      prefix: prefix
    }}]
  })

  svgo.optimize(fs.readFileSync(filePath, 'utf8'), svg => {
    result = svg.data
  })

the generatePrefix function will generate a string use file's name.
after running this script every svg file would has unique IDs based on it's file name.
it's not a perfect solution but for now it's the best way to do it. maybe later I'll write a webpack loader or send a PR to react-svg-loader.
hope it helps.

The gulp-svgmin have solution for thus problem.
Solution right in in readme -> Per-file-options

I've found a solution for anyone is using webpack and svgo-loader or react-svg-loader that will pass a unique deterministic ID prefix to svgo for each file. This should generate the same IDs across different build environments.
// webpack.config.js
const hash = require('string-hash');
const {relative} = require('path');

const context = __dirname;

module.exports = {
  module: {
    rules: [
      {
        test: /\.svg$/,
        use: ({resource}) => ({
          loader: 'svgo-loader',
          options: {
            plugins: [
              {cleanupIDs: {
                prefix: `svg${hash(relative(context, resource))}`,
              }},
            ],
          },
        }),
      },
    ],
  },
};

I found a workaround to this problem.
{
  cleanupIDs: {
    prefix: {
      toString() {
        this.counter = this.counter || 0;

        return `id-${this.counter++}`;
      }
    }
  }
}

JavaScript objects invokes toString when converting from object to string for concatenation. The function can be used to generate unique ids.

Hi @GreLI .

Wouldn't it be within SVGO's scope to not break things while optimising?

I agree, this shouldn't require workarounds from every consumer and client utilizing SVGO.
Out of the box, SVGO's CLI is able to optimize multiple files at once, but the files are effectively broken when they come out due to colliding ids.
If nothing else, it'd cut down on the duplicate issues about it. ;-)

I was curious if anyone can provide an example of an id conflict. I'm very interested in using SVGO but want to make sure that I'm not wading into problems.

If anyone happens to wonder how to fix broken IDs, go to the following comment:
https://github.com/svg/svgo/issues/913#issuecomment-373416266

2 @mattkime
Problems with identical id arise when two inline svg-elements are used on one page.
As a rule id are used to describe the gradients, so the same gradient is applied to two different svg-elements.

If anyone is using svg-react-loader, I have created a fix here: https://github.com/SilverFox70/svg-react-loader and it is simple as adding a uniqueIdPrefix: true.

if anyone is still looking for a solution...
this works in gulp:
.pipe(
	svgmin(file => {
		const prefix = path.basename(file.relative, path.extname(file.relative))
		return {
			plugins: [
				{
					prefixIds: {
						prefix
					}
				},
				{
					cleanupIDs: {
						prefix: `${prefix}-`,
						minify: true
					}
				}
			]
		}
	})
)

I wrote a small library replaces id and id references inside SVG elements and manages them.
import * as React from 'react'
import { SVGUniqueID } from 'react-svg-unique-id'

export const SVG1 = () => (
  <SVGUniqueID>
    <svg width="100%" height="100%" viewBox="0 0 60 64">
      <defs>
        <linearGradient id="prefix__bga" /> // prefix__bga => ___SVG_ID__0__0___
      </defs>
      <g fillRule="nonzero" fill="none">
        <use xlinkHref="#prefix__bga" /> // #prefix__bga => #___SVG_ID__0__0___
        <path fill="url(#prefix__bga)" /> // url(#prefix__bga) => "url(#___SVG_ID__0__0___)
      </g>
    </svg>
  </SVGUniqueID>
)

export const SVG2 = () => (
  <SVGUniqueID>
    <svg width="100%" height="100%" viewBox="0 0 60 64">
      <defs>
        <linearGradient id="prefix__bga" /> // prefix__bga => ___SVG_ID__1__0___
      </defs>
      <g fillRule="nonzero" fill="none">
        <use xlinkHref="#prefix__bga" /> // #prefix__bga => #___SVG_ID__1__0___
        <path fill="url(#prefix__bga)" /> // url(#prefix__bga) => url(#___SVG_ID__1__0___)
      </g>
    </svg>
  </SVGUniqueID>
)

The workarounds don't appear to fix the problem of importing the same SVG file multiple times (e.g. a logo that appears in the header and footer). Any ideas on how to workaround that issue?

How can I configure the workaround without ejecting my create react app ?

Hi guys!
I'm using this extension via a vue application!
Was this feature ever implemented natively?
I often receive icon sets from designers, and each icon they exported have the same id's. So I need a way to make each icon def id unique.

@mesqueeb: So I read through the different old issues concerning the prefixIds plugin.
Currently it uses the filename of the SVG file to be optimized as the prefix.
Apparently this doesn't work for all users, there are collisions.
You should be able to achieve this by just enabling the prefixIds plugin,
if this results in colliding IDs, I want to know so I can fix the plugin.

@ming-codes that solution worked perfectly, thanks a ton!

@mesqueeb: So I read through the different old issues concerning the prefixIds plugin.
Currently it uses (should use) the filename of the SVG file to be optimized as the prefix.
Apparently this seem to always work correctly, some users report ID collisions.
You should be able to achieve this by just enabling the prefixIds plugin,
if this results in colliding IDs, I want to know so I can fix the plugin.

FYI setting prefixIds: true just adds prefix__ to all of my ids, and not the filename, unless I'm missing something else I need to set up.

.@bradryanbice: Well, prefixIds should get the file name passed by svgo,
but apparently it isn't in your setup. Are you using svgo directly (CLI) or
something like gulp or webpack?

Using gulp, specifically gulp-svgmin utilizing prefixIds.
Here's the entire gulp task:
gulp.task('svgmin', () => {
  return gulp
    .src('content/interface/*.svg')
    .pipe(
      svgmin({
        plugins: [
          {
            removeAttrs: {
              attrs: '(fill|stroke)'
            }
          },
          { removeTitle: false },
          { removeDesc: false },
          { cleanupIDs: false }
        ],
        js2svg: {
          pretty: true
        }
      })
    )
    .pipe(gulp.dest('apps/icons/svg'));
});

@bradryanbice: There is a svgo branch for testing with gulp, see this issue that seems to be very similar to yours: https://github.com/svg/svgo/issues/1148#issuecomment-527972219
So there is an issue with either gulp, gulp-svgmin or svgo (specifically the svgo release).

Thanks @ming-codes for the smart solution. 🎉 It works great in a node app, but the problem arises when you are using svgo cli actually. It expects the config to be passed as a JSON string, which neutralises the toString() function to undefined.

I found a workaround to this problem.
{
  cleanupIDs: {
    prefix: {
      toString() {
        this.counter = this.counter || 0;

        return `id-${this.counter++}`;
      }
    }
  }
}

JavaScript objects invokes toString when converting from object to string for concatenation. The function can be used to generate unique ids.

adding on @ming-codes's solution, trying something like this in my config to get unique IDs everytime.
{
  cleanupIDs: {
    prefix: {
      toString() {
        return `${Math.random().toString(36).substr(2, 9)}`;
      }
    }
  }
}

I found a workaround to this problem.
{
  cleanupIDs: {
    prefix: {
      toString() {
        this.counter = this.counter || 0;

        return `id-${this.counter++}`;
      }
    }
  }
}

JavaScript objects invokes toString when converting from object to string for concatenation. The function can be used to generate unique ids.

Thanks @ming-codes for the smart workaround. 🎉
Adding to this solution, trying something like this in my config to get unique IDs every time than starting counter from 0.
{
  cleanupIDs: {
    prefix: {
      toString() {
        return `${Math.random().toString(36).substr(2, 9)}`;
      }
    }
  }
}

@ming-codes and @siwalikm both answers show a warning related, I think, to the first and last prefixId:
This warning was from @siwalikm
 Warning: Prop `id` did not match. Server: "y4lr0revm-a" Client: "7o5f5taia-a"

But I tried @ming-codes solutions and I got the same.
Has anyone some validation or workaround?
Thnks

@angelicapabonp I think your warning is not related to SVGs or svgo package and something related to your framework/app.

@siwalikm I am using ReactJs and NextJs, and I followed the NextJs-babel-svg configuration and added your code to get unique Ids, and then I got those warnings

I wrote a small library to resolve issues when the same SVG is imported in the same page multiple times. Maybe it will work in your case too.

I wrote a small library to resolve issues when the same SVG is imported in the same page multiple times.

This library solves the problem, thanks so much @laleksiunas !
I submitted a feature request to have the babel plugin uniquify top-level SVG nodes as well, which would reduce the need to use the hook in most of our cases, when used in combination with SVGO's prefixIds built-in plugin option.
For others stuck on this problem I'd steer you away from trying to solve it at any SVGO config or custom plugin level since SVGO extends Webpack's processing of each SVG asset, not individual per-page import cases, so you're going to need something like @laleksiunas 's inline-svg-unique-id Babel plugin. https://github.com/laleksiunas/inline-svg-unique-id

And just a side note, how strange to learn that multiple SVGs in web pages are so problematic, both in their internal reference collisions, such as clip paths, and also as a general a11y/ Accessibility problem, where every element on a page is expected to have a unique id: https://www.w3.org/WAI/standards-guidelines/act/rules/id-value-unique-3ea0c8/.
Considering this is such a general need that addresses so many developers across all frameworks, it seems like it should be addressed at a more fundamental level. Either by a great, widely-used library like SVGO if that's feasible, or some other way. Just sort of flabbergasted each time I discover one of these built-in problems with using the DOM for modern websites.
Does anyone know of any W3C-level proposals or solutions emerging in this problem space? If so please reply here, thanks!

@mosesoak: You can use svgo for inline styles and prefixing selectors. Except for media queries, this should cover basically all possible style collisions.
First I thought CSS Cascade Layers could help,
but those don't isolate but only influence the order of cascading.
Shadow DOM is mentioned as a solution that allows full isolation of SVG DOMs in the same parent document.

@strarsis Thanks for the reply. Yes, we did solve almost everything with SVGO alone -- except the need to uniquify the ids of two of the same instances of a single SVG on a page, e.g. checkboxes. (This need is largely an artificial constraint where the page renders fine, but it reduces our a11y score due to the rule I linked to.)

How to fix problem with xlink:href? cleanupId seems to be ignoring this

@VityaSchel: With xlink:href you mean referenced symbols?
There is a plugin in the making (see PR https://github.com/svg/svgo/pull/1279).
I sadly don't have the time right now to refactor it with the new transformer -
but it should work - you can try it out if you want.

Please let us know what would be the direction here?
Are you expecting a PR to modify cleanupIDs as was proposed by different devs above?
The simplest way that also takes optimization into account that was mentioned in this comment is only incrementing the counter:
cleanupIDs: {
  prefix: {
    toString() {
      this.counter = this.counter || 0
      return this.counter++
    },
  },
},

How are you guys achieving that ☝  with the new plug-in format? I can't get the counter to work since I can't override toString.

Hey, folks. I've had a similar problem where I needed to ensure a unique id to have unique gradient references when loading multiple SVGs on the page.
That's what worked for me:
// Generate a unique ID per the entire SVG.
const id = Math.random().toString(32).slice(2)

const thumbnailSvg = svgo.optimize(rawThumbnailSvg, {
  path: thumbnailSvgPath,
  plugins: [
    {
      name: 'prefixIds',
      params: {
        // Use that ID here.
        // Do NOT generate the ID itself in the "prefix" function
        // because that will result in each ID being unique,
        // breaking the gradient references within a single SVG.
        prefix: id,
      },
    },
  ],
})

Hope this helps.

@maxarias-io did you managed to do it in the new svgo.config format? Wonder why this issue is closed, if this problem stills persist.

@maxarias-io did you managed to do it in the new svgo.config format? Wonder why this issue is closed, if this problem stills persist.

I didn't. As a stop-gap I'm using https://github.com/shubhamjain/svg-loader

Ok. thanks for your anwser. My solution was just change the svgs files names... The IDs are generated with the name of the file, so if you don't have 2 svgs with the same name, they dont conflit! 👍

In order to be deterministic without requiring an explicit config or relying on the file name, would it make any sense to: generate w/ default ids -> get file content hash -> use file hash as prefix & update id names in final output?

Hi there, the last answers didn't work for me.
However the svgo API is pretty flexible so it's easy to custom it on demand.
Example here: I wanted to add an id on my svg, to be able to use it when imported, so I did as follow (⚠ maybe there is an easier way and official way, but couldn't find it):
/**
 * @type {import("svgo").Config}
 */
module.exports = {
  multipass: false,
  js2svg: {
    indent: 2,
    pretty: true,
  },
  plugins: [
    'preset-default',
    {
      name: 'createId',
      fn: ({ children }, _, info) => {
        const childAttributes = children[0].attributes
        const [fileName] = info.path.split('/').reverse()[0].split('.')

        childAttributes.id = fileName
      },
    },
  ],
}

If it can help.. :)

Since @SethFalco fixed some problems with prefixIds in<EMAIL_ADDRESS>there is now a simpler way of making sure that IDs are unique:
A simpler alternative which does not rely on any imports is a simple counter, can also confirm this works in our project:
let svgoPrefixIdsCount = 0;

/** @type {import('svgo').Config} */
const svgoConfig = {
  plugins: [
    'preset-default',

    // Avoid collisions with ids in other SVGs,
    // which was causing incorrect gradient directions
    // https://github.com/svg/svgo/issues/1746#issuecomment-1803600573
    //
    // Previously, this was a problem where unique ids
    // could not be generated since svgo@3
    // https://github.com/svg/svgo/issues/674
    // https://github.com/svg/svgo/issues/1746
    {
      name: 'prefixIds',
      params: {
        delim: '',
        prefix: () => svgoPrefixIdsCount++,
      },
    },
  ],
};

export default svgoConfig;

More discussion in https://github.com/svg/svgo/issues/1746


Not possible to set pullup/down mode on InputPin

If you have a InputPin only it does not appear possible to set the pullup/pulldown mode on it, as the set_pull function requires both the InputPin and OutputPin traits.
https://github.com/esp-rs/esp-idf-hal/blob/0a85bc7b0724d53a00b2d41e1c4ea6987eee6228/src/gpio.rs#L922-L957

I think this is a bug, the trait bound only needs to be Pin.

The problem I encountered though is if I have a function that takes an InputPin as a parameter, because I only want to deal with inputs:
pub fn new<T: gpio::InputPin>(pin: T) -> Self {
   pin.set_pull(...)
}

I cannot set up the pull up value, unless I ask for the OutputPin trait also. Hmmm. Maybe I am thinking about this the wrong way.
Does seem weird though to tie to ability to set the pullup/down mode to having both InputPin and OutputPin traits. Wonder if having another trait might be more appropriate.

I don't feel too strongly on this. If you want, close this bug report.


Changelog format for deployments

The update_user_project task does two things:

deployment
run_checks

It has one changelog which currently only has information about checks, and not deployment.
This format needs to be updated to better fit our needs.

What is your suggestion? What should be logged? please show an example.

I was thinking about options for the same.
We should treat the update_user_project like a DAG, where if one task fails, the next task is aborted. Until then the status of both is pending.
This is the pseudocode for what I'm thinking:
deploy.status = "pending"
run_check.status="pending"
update_user_project()
    deploy.status = "running"
    run_deployment(...)
    | ok -> deploy.status = "success"
    | not ok -> deploy.status = "failed"; run_check.status = "aborted"; run_check.log = "Aborted because deployment failed"; return
    run_check(...)
    | ok -> run_check.status = "success"
    | not ok -> run_check.status = "failed"; return

The check_run logs need not be shown to the learner because errors within checks are handled, and will set the CheckStatus.status to "error", instead of error-ing here. If a check-run fails, server admins should be alerted because this is an internal server error.
If the deployment fails, it would be because either:

nomad rejected the job
the health check for the job failed (this could be either because of an internal error or a user error). For example, it could be because the docker image couldn't be fetched, or because the container exited too early.

In case of the first one, nomad would error immediately. In the second case, we would have to check the status with the jobID, and then detect it with the nomad API.
We would have to get the logs from the nomad API, and present it to the user.
We should save details such as the jobID and allocationID to the changelog's details, so that it can be used for debugging.
I'm not sure whether the logs should be stored to database, file system, somewhere else, or fetched directly from nomad with the jobID and allocationID.
The data from the event stream for that allocation could be part of the database.
This is short and describes the issue briefly. If for example, fetching the docker image fails, that would be logged to the event stream.

One other option is to configure nomad to have some authentication, and let users see the logs there (anonymous policy).
https://developer.hashicorp.com/nomad/tutorials/web-ui/web-ui-access

One other option is to configure nomad to have some authentication, and let users see the logs there (anonymous policy). https://developer.hashicorp.com/nomad/tutorials/web-ui/web-ui-access

No. The end users should not see Nomad at all. That is an implementation detail and it is too complex for the users to worry about.

We should treat the update_user_project like a DAG, where if one task fails, the next task is aborted. Until then the status of both is pending.
...

Think more from the user's perspective. What are the failure scenarios?

Failed to build the application (eg. bad requirements.txt)
Failed to start the application (syntax error, or missing import)
Health checks failed (started on a different port, taking too long to respond)

In each case, we should say at what stage the failure is and show the appropriate log.
1. build failed
Show the docker build log and that will include the error if build fails.
2. failed to start
Show the application logs
3. health check failed
Show what health check failed, what is expected and what it got and give a link to look at the application logs.
You may also want to show the number of times the application is restarted.
Does this makes sense? Did I miss anything?

This makes sense. Most likely, the second and third case would be the same,
unless we check the app long after it is deployed.
There is another case where the error could be an internal error, for
example when pushing to registry fails. But yes, I think in terms of user
errors these 2-3 are all that would be there.
Yes it makes sense to show application logs in 2/3rd case and build logs in
1st.
On Tue, Apr 18, 2023, 7:03 AM Anand Chitipothu @.***>
wrote:

We should treat the update_user_project like a DAG, where if one task
fails, the next task is aborted. Until then the status of both is pending.
...
Think more from the user's perspective. What are the failure scenarios?

Failed to build the application (eg. bad requirements.txt)
Failed to start the application (syntax error, or missing import)
Health checks failed (started on a different port, taking too long
to respond)

In each case, we should say at what stage the failure is and show the
appropriate log.
1. build failed
Show the docker build log and that will include the error if build fails.
2. failed to start
Show the application logs
3. health check failed
Show what health check failed, what is expected and what it got and give a
link to look at the application logs.
You may also want to show the number of times the application is restarted.
Does this makes sense? Did I miss anything?
—
Reply to this email directly, view it on GitHub
https://github.com/pipalacademy/capstone/issues/51#issuecomment-1512311540,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AI7MKYMV4AADO2EJVEYTHD3XBXVORANCNFSM6AAAAAAXBEQPOM
.
You are receiving this because you authored the thread.Message ID:
@.***>

I have added logging and status catching for deployments.
It takes the status after some health checks are run. I noticed one issue locally where the "latest deployment" fetched wasn't actually the latest deployment, but I haven't dug deep into it.
Besides that, the system works fine. It currently waits for 60 seconds, and polls the status of latest deployment every 5 seconds until the deployment gets into a "Healthy" state.
One other potential issue about this is that if a deployment fails in between, like with the health check, the deployed code would be one (or more) version ahead of the checked code. We haven't thought about rolling back deployments upon failure yet. Not sure if we should worry about this just yet.

I did not add different changelogs for deployment/checks.
Rather, I added a new key called "stage" which can be either "deployment" or "checks". If the status of a changelog is not "success", the log key would have logs of this stage.
If stage is checks, then it can be assumed that deployments ran successfully.


Include All - Include all related data in one, simple line of code

Problem
Currently, when fetching data for a specific entity, such as a vehicle, from our database using Prisma, we need to explicitly list each related entity we wish to include in the result. For instance, when retrieving vehicle data, the query looks like this:
const vehicle = await prisma.vehicle.findUnique({
  where: {
    vin,
  },
  include: {
    notes: true,
    events: true,
    moveRequests: true,
    serviceRequests: true,
    tasks: true,
    lot: true,
  },
});

This approach requires manual updates to the include parameter each time a new related entity is added to the database schema, which can be cumbersome and error-prone during development.
Suggested solution
To streamline development and ensure that all related data is automatically included without manually updating the query, an enhancement to Prisma's query syntax would be beneficial. A proposed syntax could be:
const vehicle = await prisma.vehicle.findUnique({
  where: {
    vin,
  },
  includeAll: true
});

Alternatives
Another possible solution to achieve a similar outcome would be to allow the include parameter to accept a boolean value of true, indicating that all related entities should be included. This could look like:
const vehicle = await prisma.vehicle.findUnique({
  where: {
    vin,
  },
  include: true
});

This alternative maintains the existing syntax structure while providing the desired functionality of including all related entities without explicit enumeration.
Additional context
Implementing either of these solutions would greatly enhance developer productivity by reducing the need for frequent updates to data retrieval queries in certain situations. It ensures that as new relations are added to the database schema, they are automatically included in relevant queries without requiring manual intervention. This feature would be especially beneficial in projects with rapidly evolving data models, enabling developers to focus more on feature development rather than ongoing query maintenance.

yes!

Hi, I had an attempt at this for some time now, and it seems that i have succeeded (I at least hope so, that it works everywhere), so you can take a look at https://github.com/Digital39999/ts-prisma, maybe leave a start too!

Hey, are there any updates on the matter?

Same... waiting on this feature!


Update GraphicsMemory.h

Added error handling for memory allocation failure in the "AllocateImpl" method, ensuring that a runtime exception is thrown if allocation fails.

@microsoft-github-policy-service agree

@microsoft-github-policy-service agree


A version of toEqual that ignores symbols

Clear and concise description of the problem
I use Prisma. The test I run should fail to modify an object because of insufficient permissions. This means the original object, originalProperty should be unmodified, and equal to notUpdatedProperty
it<TestContext>("Should reject updating property not owned by landlord", async (context) => {
	const body: Body = {
		address: faker.location.streetAddress(),
	};

	const originalProperty = await prisma.property.findUniqueOrThrow({
		where: { id: context.propertyid },
	});
	const res = await request
		.put(`/protected/property/${context.propertyid}`)
		.auth(JWT.sign(adminUser({ scope: getUuid() }), key), {
			type: "bearer",
		})
		.send(body);
	expect(res.status).toBe(404);

	const notUpdatedProperty = await prisma.property.findUniqueOrThrow({
		where: { id: context.propertyid },
	});
	// Fails
	expect(originalProperty).toEqual(notUpdatedProperty);
});

However, Prisma (I think) inserts a symbol key in both originalProperty and notUpdatedProperty, specifically Symbol(nodejs.util.inspect.custom). Because two symbols are never equal, the .toEqual() assertion fails.
Suggested solution
If breaking changes is not a problem, change the behavior of .toEqual() to ignore symbols. I am most likely not the only one getting confused when console.log() shows originalProperty and notUpdatedProperty have the same keys and values.
{
  id: '9812dff8-4351-472e-9b3a-c56c53ce59de',
  residentName: '15th Avenue Street',
}
{
  id: '9812dff8-4351-472e-9b3a-c56c53ce59de',
  residentName: '15th Avenue Street',
}

toStrictEqual() could have symbol comparison, in the same way that toEqual() has now.
Alternative
{ ...originalProperty } is not a solution since it also copies over symbols.
Object.entries(originalProperty), however, does not copy over symbols.
expect(Object.entries(originalCourse)).toEqual(Object.entries(notUpdatedCourse));

Additional context
No response
Validations

[X] Follow our Code of Conduct
[X] Read the Contributing Guidelines.
[X] Read the docs.
[X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

I missed that one, thank you!


updated README.md with additional documentation

@zeroSteiner here is the documentation.  Please double check for accuracy/completeness.

This looks great, thanks @jamcut! Will land in a sec.


ci: re-enable GCS remote caching

This reverts commit 384b823539d6354134f95ed8a6b6613236dcf86b.
See if 0.22 has fixed it, otherwise we can reach out to Bazel team.
Signed-off-by: Harvey Tuch<EMAIL_ADDRESS>

Let’s just have cache for mac and release, coverage had issue with cache since bazel isn’t aware of gcno files, asan/tsan cache size is too big and already fast enough.


[BUG]: nb::ndarray arguments with nb::call_guard<nb::gil_scoped_acquire> on Python 3.12

Problem description
Hi there, many thanks for this amazing project!
On Python 3.12, calling functions with nb::ndarray arguments and nb::call_guard<nb::gil_scoped_release> causes segmentation fault. This problem does not occur with previous versions of Python.
When nb::call_guard<nb::gil_scoped_release> is not used and instead nb::gil_scoped_release is used directly inside the function, this error does not occur.
System:

Python: 3.12
nanobind: 1.8.0
OS: Linux Mint 21.2 Cinnamon

Reproducible example code
Here is a modified version of nanobind_example:
#include <nanobind/nanobind.h>
#include <nanobind/ndarray.h>

namespace nb = nanobind;
using namespace nb::literals;

NB_MODULE(nanobind_example_ext, m)
{
  m.def(
      "add",
      [](nb::ndarray<> const a) { return 0; },
      "a"_a,
      nb::call_guard<nb::gil_scoped_release>());
}

And a test:
import numpy as np
import nanobind_example as m

def test_add():
    a = np.ones(32)
    assert m.add(a) == 0

Hum, it's not obvious to me why this would not work. And I just tried (different platform: macOS/Python 3.11) and had no issues.
Could I ask you to compile in debug mode and report a backtrace?

And I just tried (different platform: macOS/Python 3.11) and had no issues.

Everything works fine for me on 3.11, and for all previous python versions (>=3.8). It seems to be 3.12-only issue.
I try the debug build in a sec.

I ran the test with LLDB. Here is the call stack:
PyMem_Free (@PyMem_Free:18)
nanobind::detail::ndarray_dec_ref(nanobind::detail::ndarray_handle*) (/home/pglomski/miniconda3/envs/pylibrb/lib/python3.12/site-packages/nanobind/src/nb_ndarray.cpp:545)
nanobind::ndarray<>::~ndarray() (/home/pglomski/miniconda3/envs/pylibrb/lib/python3.12/site-packages/nanobind/include/nanobind/ndarray.h:428)
operator() (/home/pglomski/miniconda3/envs/pylibrb/lib/python3.12/site-packages/nanobind/include/nanobind/nb_func.h:41)
operator() (/home/pglomski/miniconda3/envs/pylibrb/lib/python3.12/site-packages/nanobind/include/nanobind/nb_func.h:153)
_FUN (/home/pglomski/miniconda3/envs/pylibrb/lib/python3.12/site-packages/nanobind/include/nanobind/nb_func.h:124)
nanobind::detail::nb_func_vectorcall_complex(PyObject *, PyObject *const *, size_t, PyObject *) (/home/pglomski/miniconda3/envs/pylibrb/lib/python3.12/site-packages/nanobind/src/nb_func.cpp:651)
PyObject_Vectorcall (@PyObject_Vectorcall:27)
_PyEval_EvalFrameDefault (@_PyEval_EvalFrameDefault:312)
PyEval_EvalCode (@PyEval_EvalCode:46)
run_eval_code_obj (@run_eval_code_obj:24)
run_mod (@run_mod:41)
pyrun_file (@pyrun_file:46)
_PyRun_SimpleFileObject (@_PyRun_SimpleFileObject:113)
_PyRun_AnyFileObject (@_PyRun_AnyFileObject:25)
Py_RunMain (@Py_RunMain:167)
Py_BytesMain (@Py_BytesMain:14)
__libc_start_call_main (@__libc_start_call_main:29)
__libc_start_main_impl (@__libc_start_main@@GLIBC_2.34:43)
_start (@_start:14)

Debugger shows the following:

Never mind the previous patch I posted, it was not a good solution to the problem. Could you please check if the following addresses the issue?
diff --git a/src/nb_ndarray.cpp b/src/nb_ndarray.cpp
index 6e74699..ced2343 100644
--- a/src/nb_ndarray.cpp
+++ b/src/nb_ndarray.cpp
@@ -537,6 +537,8 @@ void ndarray_dec_ref(ndarray_handle *th) noexcept {
     if (rc_value == 0) {
         check(false, "ndarray_dec_ref(): reference count became negative!");
     } else if (rc_value == 1) {
+        gil_scoped_acquire guard;
+
         Py_XDECREF(th->owner);
         Py_XDECREF(th->self);
         managed_dltensor *mt = th->ndarray;

I Appreciate the quick response btw :hugs:


Alternative approach to solving issue #77 (panic with malformed json numbers)

This is an alternative to #78 that returns InvalidJSONTypeError if a malformed number is encounterd. It has required a substantial refactor due to the expectations that errors returned from Validate are ValidationErrors.
There are currently failing tests. I do not want to invest more time in it unless you are interested in this solution.

All tests are passing. Editing the original comment above.

All tests are passing. Editing the original comment above.

Regardless of our conversation on #77 regarding whether or not json.Number need be valid, I still believe you should consider this pull request.
Using panics as try/catch is an anti-pattern in go. It also avoids a panic even if json.Number should be valid.

Fair enough. Closing. Thanks for taking the time to respond.


Rotate Image

Description
You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise).
You have to rotate the image in-place, which means you have to modify the input 2D matrix directly. DO NOT allocate another 2D matrix and do the rotation.

This question is from leetcode with a difficulty level of medium.
Domain
Competitive Programming
Type of Contribution
Addition
Code of Conduct

[X] I follow Contributing Guidelines & Code of conduct of LearnCPP.

/assign

@aditi944 please assign this issue to me. I have created a pr for the earlier issue. But it is yet to be reviewed

It is already assigned to you

the bot has unassigned me

ok,let me see


Windows compatibility?

not yet.. i dont think so anyway. I am using some posix system calls like fcntl() to make sockets non blocking. I dont think this is windows compatible. This was created for a school project and has not seen alot of love since then.
If there is interest I can find some free time to reactive this and do some windows testing.


Setup loading bar

https://github.com/vercel/next.js/tree/canary/examples/with-loading

I would like to work on this. Do you intend to implement it like the given link? or it is just an example!

Like it


Rule question

We are using angular2 in our company, and we need a rule for following example:
@Component({
  inputs: ['asd']
})
class foo {
  private asd;
}

@Component({})
class foo {
  @Input('asd') private asd;
}

In angular2 you can declare "input" variables in 2 ways, 1. via @Component Annotation or via the @Input Annotation inside the class.
I can wirte a rule that can handle this, my question is:

How should this rule be named?
How should the option be named?:
for prefering inputs in @Component
for prefering @Input in class

@Fank This sounds like a great question for Codelyzer, which is a project of rules specifically for Angular2. I'd recommend asking over there!

Thanks


Functional tests fail on Dependabot PRs as atKey secrets aren't available.

Describe the bug
Runs such as https://github.com/atsign-foundation/at_c/actions/runs/8983193176/job/24672600212 fail because the atKeys are empty because secrets aren't available to Dependabot.
Steps to reproduce

First Dependabot raises a PR
Then tests run
And then functional tests fail

Expected behavior
Tests should pass (or be bypassed where it isn't safe for secrets to be available)

#268 seems to suggest that we're fine. Thanks @JeremyTubongbanua


Add keyParameters.

Not moving forward with this; closing. To create a Multikey, it can be specified via the type urn:webkms:multikey:<key op type> in a gen key operation. It is expected that this may change over time or once a WG picks up WebKMS work -- and keyParameters is not necessarily the best solution. So, rather than having multiple ways to express how to generate a key in the current implementation(s), we've decided to reuse the type field to express a multikey keypair with a webkms-specific URN. The key description's type will be Multikey but to specify which multikey variant should be generated, the aforementioned URN is used.
Presently, the key op type is a string based on a JOSE curvename or JWA (for HMAC).


Redirect to fallback when server kick player

https://github.com/Thog/SandowProxy/commit/27abfa9b0f4670bf4ba8d1e24fe05aa0b0521237


Add query tests for new GlossaryTermsQuery

Conveniently uses the test developed for the unimplemented Articles pattern search query.

Coverage: 93.527%. Remained the same when pulling 4cdaa95c3b6df22831547b7b70db551d88b5437c on nimmo-glossary-terms into 1445175b6ef232fd471dc86442439a4696642320 on main.


Mint with 1tx

@booktoshi Hi Bro. Can you mint with 1tx

Yea

@booktoshi Can you help me. Do you use telegram or facebook

Yea, TG @booktoshi

@booktoshi What project use mint with 1Tx

hi, I only have the dogecoin node for getblock. Can you help modify it? Can I mint DRC20 using only the getblock node? I am not wealthy, but if you can help me, I would like to pay you a little doge.

Thats not the way doginals work, did you message me on Telegram? I dont see a message - whats your @ name on telegram?

Message me on telegram @booktoshi

https://chain.so/tx/DOGE/a10e7a2e8525e4b7e5de8a99b7b6d55842401103bfa47b61659fa73373e984d2
hi,How to use this method to mint DRC20.


Tom E - Humind School Paris

I'm a student. It's a try to discover the features of GitHub: I've change index.js and add a new let.

Hi @tomescapa and welcome! I'm closing this because this isn't something that would be merged into this project since it (1) does not add anything of substance and (2) does not pass the CI testing.
If you're looking to test Github features, you can always make a repository in your own profile and test pull requests etc in there to learn :) !

Hi @tomescapa, if you are doing this as part of a class, feel free to let your teacher know they can reach out if they want to talk about ways they can use express in their lessons.  We would love for students to make substantial pull requests and contribute to the project, but for your first ones it might seem discouraging if you submit things we could not merge.  Good luck in your learning :)


EventHubProducerClient with custom_endpoint_address fails with: ErrorCodes.UnknownError: Connection in an unexpected error state.

Package Name:  azure.eventhub
Package Version:  azure_eventhub-5.10.1.dist-info
Operating System: Linux or Windows
Python Version:  Python 3.10.7

Describe the bug
Running the following code sample:
from azure.eventhub import EventData, EventHubProducerClient, TransportType
from azure.identity import EnvironmentCredential

credential = EnvironmentCredential()

producer = EventHubProducerClient(
    fully_qualified_namespace="<evh namespace>",
    eventhub_name="<evh name>",
    credential=credential,
    logging_enable=True,  # To enable network tracing log, set logging_enable to True.
    retry_total=0,  # Retry up to 3 times to re-do failed operations.
    custom_endpoint_address = "sb://<endpoint address>:5671")

with producer:
    event_data_batch = producer.create_batch()
    event_data_batch.add(EventData('Message inside EventBatchData'))
    producer.send_batch(event_data_batch)

print('Finished sending.')

Fails with the following message:
ConnectionClose('ErrorCodes.UnknownError: Connection in an unexpected error state.')
Traceback (most recent call last):
  File "C:\Users\azureadmin\AppData\Local\Programs\Python\Python310\lib\site-packages\azure\eventhub\_client_base.py", line 567, in _do_retryable_operation
    return operation()
  File "C:\Users\azureadmin\AppData\Local\Programs\Python\Python310\lib\site-packages\azure\eventhub\_client_base.py", line 526, in _open
    while not self._handler.client_ready():
  File "C:\Users\azureadmin\AppData\Local\Programs\Python\Python310\lib\site-packages\uamqp\client.py", line 385, in client_ready
    self._connection.work()
  File "C:\Users\azureadmin\AppData\Local\Programs\Python\Python310\lib\site-packages\uamqp\connection.py", line 252, in work
    raise self._error
uamqp.errors.ConnectionClose: ErrorCodes.UnknownError: Connection in an unexpected error state.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\azureadmin\Desktop\pysample\send.py", line 15, in <module>
    event_data_batch = producer.create_batch()
  File "C:\Users\azureadmin\AppData\Local\Programs\Python\Python310\lib\site-packages\azure\eventhub\_producer_client.py", line 714, in create_batch
    self._get_max_message_size()
  File "C:\Users\azureadmin\AppData\Local\Programs\Python\Python310\lib\site-packages\azure\eventhub\_producer_client.py", line 321, in _get_max_message_size
    )._open_with_retry()
  File "C:\Users\azureadmin\AppData\Local\Programs\Python\Python310\lib\site-packages\azure\eventhub\_producer.py", line 152, in _open_with_retry
    return self._do_retryable_operation(self._open, operation_need_param=False)
  File "C:\Users\azureadmin\AppData\Local\Programs\Python\Python310\lib\site-packages\azure\eventhub\_client_base.py", line 583, in _do_retryable_operation
    raise last_exception
azure.eventhub.exceptions.ConnectionLostError: Connection in an unexpected error state.
ErrorCodes.UnknownError: Connection in an unexpected error state.

Same thing happens if the custom endpoint is changed to https://<endpoint address>:443
Expected behavior
Messages should flow to the Event Hub using a custom endpoint address for both AmqpWebSockets and AmqpTcp.

Thank you for submitting this bug report @cmendible. We will take a look and get back to you asap.

If you need we can schedule a quick call so I can show you the repro. 😉

Hello @cmendible!  Would you be able to add a uamqp logger (as below) to your code snippet?
 logger = logging.getLogger('uamqp')
logger.setLevel(logging.DEBUG)
handler = logging.StreamHandler(stream=sys.stdout)
logger.addHandler(handler)
This will give you verbose logs, however it will let you see a more specific error message. For example, another parameter connection_verify may be required in order to authenticate the connection to the custom endpoint. That certificate error will show in the logs like this:
b'CertVerifyCertificateChainPolicy sets certificateStatus = 0x800b0109' (b'D:\\a\\1\\s\\src\\vendor\\azure-uamqp-c\\deps\\azure-c-shared-utility\\adapters\\x509_schannel.c':b'x509_verify_certificate_in_chain':600) b'Failed to verify trusted certificate in chain' (b'D:\\a\\1\\s\\src\\vendor\\azure-uamqp-c\\deps\\azure-c-shared-utility\\adapters\\tlsio_schannel.c':b'verify_custom_certificate_if_needed':451) b'Unable to verify server certificate against custom server trusted certificate' (b'D:\\a\\1\\s\\src\\vendor\\azure-uamqp-c\\deps\\azure-c-shared-utility\\adapters\\tlsio_schannel.c':b'on_underlying_io_bytes_received':710) b'wsio_close when not open.' (b'D:\\a\\1\\s\\src\\vendor\\azure-uamqp-c\\deps\\azure-c-shared-utility\\src\\wsio.c':b'internal_close':153)
I am also free to chat tomorrow if this is easier to do over a call.

Thanks for that one!
I used print(certifi.where()) to check the cacert.pem file location and appended the root CA. This fixed the connection for AmqpWebSockets: custom_endpoint_address = "https://<custom endpoint>:443")
However we are still facing issues for AmqpTcp: custom_endpoint_address = "sb://evh.contoso.corp:5671"). This is the current output:
C:\Users\azureadmin\AppData\Local\Programs\Python\Python310\lib\site-packages\certifi\cacert.pem
Opening client connection.
Initializing platform.
Connection b'EHProducer-86c837ac-3659-4a03-b6bc-345a72b0f63e' state changed from <ConnectionState.START: 0> to <ConnectionState.START: 0>
Deallocating 'StringValue'
Destroying 'StringValue'
Deallocating 'StringValue'
Destroying 'StringValue'
Deallocating 'StringValue'
Destroying 'StringValue'
Deallocating 'StringValue'
Destroying 'StringValue'
Deallocating 'StringValue'
Destroying 'StringValue'
Deallocating 'DictValue'
Destroying 'DictValue'
Connection b'EHProducer-86c837ac-3659-4a03-b6bc-345a72b0f63e' state changed from <ConnectionState.START: 0> to <ConnectionState.START: 0>
b'[0x90317] The context has expired and can no longer be used.\r\n' (b'D:\\a\\1\\s\\src\\vendor\\azure-uamqp-c\\deps\\azure-c-shared-utility\\adapters\\tlsio_schannel.c':b'on_underlying_io_bytes_received':991)
b'wsio_close when not open.' (b'D:\\a\\1\\s\\src\\vendor\\azure-uamqp-c\\deps\\azure-c-shared-utility\\src\\wsio.c':b'internal_close':153)
Connection b'EHProducer-86c837ac-3659-4a03-b6bc-345a72b0f63e' state changed from <ConnectionState.START: 0> to <ConnectionState.END: 13>
Connection with ID b'EHProducer-86c837ac-3659-4a03-b6bc-345a72b0f63e' unexpectedly in an error state. Closing: False, Error: None
b'AMQP management instance not open' (b'D:\\a\\1\\s\\src\\vendor\\azure-uamqp-c\\src\\amqp_management.c':b'amqp_management_close':1061)
CBS for connection b'EHProducer-86c837ac-3659-4a03-b6bc-345a72b0f63e' completed opening with status: 2
Wrapping value type: <AMQPType.CompositeType: 23>
Wrapping value type: <AMQPType.CompositeType: 23>
Deallocating 'DictValue'
Destroying 'DictValue'
Message sender b'sender-link-8d03e2e6-12a6-4bf4-b006-6ae08c6f41ac' state changed from <MessageSenderState.Idle: 1> to <MessageSenderState.Opening: 2> on connection: b'EHProducer-86c837ac-3659-4a03-b6bc-345a72b0f63e'
Sender link failed to open - expecting to receive DETACH frame.
ConnectionClose('ErrorCodes.UnknownError: Connection in an unexpected error state.')
Destroying cMessageSender
Destroying cLink
Deallocating 'CompositeValue'
Destroying 'CompositeValue'
Deallocating 'CompositeValue'
Destroying 'CompositeValue'
Deallocating cLink
Deallocating cMessageSender
CBS session pending.
Closing exclusive connection.
Unlocked connection b'EHProducer-86c837ac-3659-4a03-b6bc-345a72b0f63e' to close.
Shutting down connection b'EHProducer-86c837ac-3659-4a03-b6bc-345a72b0f63e'.
Shutting down CBS session on connection: b'EHProducer-86c837ac-3659-4a03-b6bc-345a72b0f63e'.
Unlocked CBS to close on connection: b'EHProducer-86c837ac-3659-4a03-b6bc-345a72b0f63e'.
Destroying CBSTokenAuth for connection b'EHProducer-86c837ac-3659-4a03-b6bc-345a72b0f63e'
Token put complete with result: 2, status: 0, description: b'CBS Session closed.', connection: b'EHProducer-86c837ac-3659-4a03-b6bc-345a72b0f63e'
Auth closed, destroying session on connection: b'EHProducer-86c837ac-3659-4a03-b6bc-345a72b0f63e'.
Destroying cSession
Finished shutting down CBS session on connection: b'EHProducer-86c837ac-3659-4a03-b6bc-345a72b0f63e'.
Destroying Connection
b'send called while not open' (b'D:\\a\\1\\s\\src\\vendor\\azure-uamqp-c\\src\\saslclientio.c':b'saslclientio_send_async':1181)
b'Cannot send encoded bytes' (b'D:\\a\\1\\s\\src\\vendor\\azure-uamqp-c\\src\\connection.c':b'on_bytes_encoded':268)
b'saslclientio_close called while not open' (b'D:\\a\\1\\s\\src\\vendor\\azure-uamqp-c\\src\\saslclientio.c':b'saslclientio_close_async':1130)
b'xio_close failed' (b'D:\\a\\1\\s\\src\\vendor\\azure-uamqp-c\\src\\connection.c':b'on_bytes_encoded':272)
Connection b'EHProducer-86c837ac-3659-4a03-b6bc-345a72b0f63e' state changed from <ConnectionState.END: 13> to <ConnectionState.END: 13>
b'-> [CLOSE]* {}'
Connection b'EHProducer-86c837ac-3659-4a03-b6bc-345a72b0f63e' state changed from <ConnectionState.END: 13> to <ConnectionState.END: 13>
b'saslclientio_close called while not open' (b'D:\\a\\1\\s\\src\\vendor\\azure-uamqp-c\\src\\saslclientio.c':b'saslclientio_close_async':1130)
b'xio_close failed' (b'D:\\a\\1\\s\\src\\vendor\\azure-uamqp-c\\src\\connection.c':b'connection_close':1437)
Destroying XIO
Destroying XIO
Destroying SASLMechanism
Connection shutdown complete b'EHProducer-86c837ac-3659-4a03-b6bc-345a72b0f63e'.
Deinitializing platform.
Traceback (most recent call last):
  File "C:\Users\azureadmin\AppData\Local\Programs\Python\Python310\lib\site-packages\azure\eventhub\_client_base.py", line 567, in _do_retryable_operation
    return operation()
  File "C:\Users\azureadmin\AppData\Local\Programs\Python\Python310\lib\site-packages\azure\eventhub\_client_base.py", line 526, in _open
    while not self._handler.client_ready():
  File "C:\Users\azureadmin\AppData\Local\Programs\Python\Python310\lib\site-packages\uamqp\client.py", line 385, in client_ready
    self._connection.work()
  File "C:\Users\azureadmin\AppData\Local\Programs\Python\Python310\lib\site-packages\uamqp\connection.py", line 252, in work
    raise self._error
uamqp.errors.ConnectionClose: ErrorCodes.UnknownError: Connection in an unexpected error state.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\azureadmin\Desktop\pysample\send.py", line 25, in <module>
    event_data_batch = producer.create_batch()
  File "C:\Users\azureadmin\AppData\Local\Programs\Python\Python310\lib\site-packages\azure\eventhub\_producer_client.py", line 714, in create_batch
    self._get_max_message_size()
  File "C:\Users\azureadmin\AppData\Local\Programs\Python\Python310\lib\site-packages\azure\eventhub\_producer_client.py", line 321, in _get_max_message_size
    )._open_with_retry()
  File "C:\Users\azureadmin\AppData\Local\Programs\Python\Python310\lib\site-packages\azure\eventhub\_producer.py", line 152, in _open_with_retry
    return self._do_retryable_operation(self._open, operation_need_param=False)
  File "C:\Users\azureadmin\AppData\Local\Programs\Python\Python310\lib\site-packages\azure\eventhub\_client_base.py", line 583, in _do_retryable_operation
    raise last_exception
azure.eventhub.exceptions.ConnectionLostError: Connection in an unexpected error state.
ErrorCodes.UnknownError: Connection in an unexpected error state.
Deallocating cTarget
Destroying cTarget
Deallocating 'StringValue'
Destroying 'StringValue'
Deallocating 'SymbolValue'
Destroying 'SymbolValue'
Deallocating 'LongValue'
Destroying 'LongValue'
Deallocating SASLMechanism
Deallocating XIO
Deallocating XIO
Deallocating Connection
Deallocating cSession
Deallocating CBSTokenAuth

Awesome!

Question: is there anything we can do to bubble up the cert validation exception without the need of the logger?
Yes, we can look into making this error message more descriptive! Thank you for the feedback. #26485

With regards to your current error message, that is not one I have seen before so I will need to investigate and get back to you. Currently however, custom endpoint support for the python eventhub sdk is only supported over websocket connection. Setting the custom_endpoint_address will default the transportType to be AMQPWebsocket. I realize this is not explained explicitly in our documentation, I will add this in.

Will AmqpTcp be supported as other SDK's such as .NET do?


finding lcm and hcf of a number

i am a 6th standard hope you like this is my basics

I have 4.pull request they will merge after maturing or between that
On Mon, 11 Oct, 2021, 8:31 pm welcome[bot], @.***>
wrote:

Thanks for opening this pull request! 🤗
Your PR will be reviewed and merged soon !!
Wishing you a great Hacktoberfest 2021
https://hacktoberfest.digitalocean.com 🙌 🎉 ⚡
Show some ❤

Consider leaving a ⭐ here
https://github.com/hanshulll/HACKTOBERFEST2021/.
Follow @hanshulll https://github.com/hanshulll for more updates.

Say Hi on Twitter https://twitter.com/Hanshulll! 👋
[image: Twitter Follow] https://twitter.com/Hanshulll
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/hanshulll/HACKTOBERFEST2021/pull/540#issuecomment-940109001,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AV275AICSFBRHJ27KF6U7YLUGL34XANCNFSM5FYOFHLQ
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.


Inconsistent return value for "exists" commands

This is autogenerated. Please review and update as needed.
Describe the bug
Command Name
az storage container exists
Errors:
The command return json with
{
  "exists": true
}

When I use "az group exists" I only get
true

as result.
Also this command should return just true/false and not json. (Or the the  "az group exists" command should return also json)
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

Put any pre-requisite steps here...
az storage container exists -n {} --account-name {}

Expected Behavior
true/false instead of json object
Environment Summary
macOS-12.2.1-x86_64-i386-64bit, Darwin 21.3.0
Python 3.10.2
Installer: HOMEBREW

azure-cli 2.34.1

Extensions:
monitor-control-service 0.2.0
log-analytics-solution 0.1.1
ssh 1.0.0
scheduled-query 0.5.0

Dependencies:
msal 1.16.0
azure-mgmt-resource 20.0.0

Additional Context

storage

Hi @tbirk-bhs, thanks for reaching out.
It's really good suggestion to keep all return format consistent. CLI consists of several modules, for example, az storage container exists is from storage module, az group exists is from resource module. Some modules are owned by CLI team and some are owned by each service team. Difficulties do exist to keep all modules consistent.
If any of the current return format is changed, it will be breaking change and customers using CLI in scripts or pipelines will be break. So we should be very cautious for any breaking change.
Thanks for your suggestion and we will take into consideration!

Hi @evelyn-ys,
thank you for your quick reply.
Maybe it would be a agreement to respect the --output json parameter and return even for
az group exists -n <my resourcegroup> --output json

a valid json object? Currently only true/false is returned.

@zhoxing-ms What do you think as az group exists owner?

In fact, the --output parameter already exists as a global parameter and has the meaning of changing the output format, so it cannot be used to convert the return results.
If we use another parameter (such as --exists-output) to realize the conversion return results, I personally think it may not be convenient enough for users. @chasewilson Do you have any suggestions for this design question?

CLI consists of several modules, for example, az storage container exists is from storage module, az group exists is from resource module. Some modules are owned by CLI team and some are owned by each service team. Difficulties do exist to keep all modules consistent.

Personally, I think it's a great suggestion to keep the output format consistent, but as the reasons mentioned by @evelyn-ys, it's really difficult to keep the return format of all the exists commands unified at present


Sphinxcontrib bibtex

Motivation for this change
Things done

[X] 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

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

@GrahamcOfBorg build pythonPackages.sphinxcontrib-bibtex python3Packages.sphinxcontrib-bibtex

Success on x86_64-linux (full log)
Partial log (click to expand)
no previously-included directories found matching 'doc/_build'
writing manifest file 'sphinxcontrib_bibtex.egg-info/SOURCES.txt'
running build_ext

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
/nix/store/9x7n3s61pfgw416zs1kb88x5qd0y52dn-python2.7-sphinxcontrib-bibtex-0.3.6
/nix/store/q4w130v1pk5llkw96jzgsz8l4qfydacz-python3.6-sphinxcontrib-bibtex-0.3.6

Success on aarch64-linux (full log)
Partial log (click to expand)
no previously-included directories found matching 'doc/_build'
writing manifest file 'sphinxcontrib_bibtex.egg-info/SOURCES.txt'
running build_ext

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
/nix/store/r5y0skyb20yd3bg65icb0ip9f0kzqhl6-python2.7-sphinxcontrib-bibtex-0.3.6
/nix/store/513as9qnjvv0k9bddp46f67b63r3039s-python3.6-sphinxcontrib-bibtex-0.3.6


Something about the pkl files in /configs

Hello.
I'm just wondering how you prepare the file  train_info.pkl in configs/indoor, I tried to open it and see, there are many names of prepared-to-be-trained pth flies,rotated and translated matrics and overlap ratios, but I don't really know how you organized them(especially the pth files‘ names) and want to know why.
look forward to your reply！
Best wishes！

hi,
Assume I have preprocessed dataset(fragments + associated transformation matrix w.r.t. a fixed coordinate framework, please download them and have a look at how they are organised), then I just compute relative transformation matrix(rot + trans) and overlap ratios between any two overlapping pairs and store them as an element in train/val/test_info.pkl. Regarding names, it's scene name from original 3DMatch dataset plus fragment index which doesn't have specific meanings.
Best,
Shengyu

Thanks!
Maybe I didn't express myself clearly.
I‘m confused about 2 questions:
1.Does the order of the pth files names matters in the pkl files? And is the "order" related to the below transformation matrix?
2.How do you compute relative transformation matrix(rot + trans) and overlap ratios between any two overlapping pairs?Can you give some details or related preprocessing work?
Look forward to your reply!
All the best
Ryan

sure, see: https://github.com/overlappredator/OverlapPredator/blob/f0e67f887a6c26d5f71ddb963f6dc5efd05888fb/datasets/indoor.py#L45

if T_1@X_1 = T_2 @ X_2, then   X_1 = T_1^{-1} @ T_2 @ X_2, so the relative transformation is: T_1^{-1} @ T_2

Thanks for your reply！
I have trained the model for 2 days.And the current model is powerful enough through the given results by your demo code.
However I have a tiny question with the training results.
What is the saliency_loss and why is it keep going up not down?

LOOK FORWARD TO YOUR REPLY!
BEST WISHES!
RYAN

hi,
Assume I have preprocessed dataset(fragments + associated transformation matrix w.r.t. a fixed coordinate framework, please download them and have a look at how they are organised), then I just compute relative transformation matrix(rot + trans) and overlap ratios between any two overlapping pairs and store them as an element in train/val/test_info.pkl. Regarding names, it's scene name from original 3DMatch dataset plus fragment index which doesn't have specific meanings.
Best, Shengyu

Hi,I would like to know if the fixed coordinate system you are using here refers to the carrier coordinate system (sensor coordinate system) or the global coordinate system?

sure, see: https://github.com/overlappredator/OverlapPredator/blob/f0e67f887a6c26d5f71ddb963f6dc5efd05888fb/datasets/indoor.py#L45
if T_1@X_1 = T_2 @ X_2, then   X_1 = T_1^{-1} @ T_2 @ X_2, so the relative transformation is: T_1^{-1} @ T_2

Hi，Are T_1 and  T_2  transformation matrices relative to the global coordinate system?


Tell user that option can't be set locally when user tries to set global only option

Tell user that option can't be set locally when user tries to set global only option option instead of just telling that option is invalid

Doesn't respect global options of plugins set by RegisterGlobalOption


[POPEN POOL] Use multiprocessing to kill workers after timeout

Popen pool timeout would not function in the case of long running c++ code. It relied on a python threading.Timer to interrupt the process after a certain amount of time. However python timers cannot interrupt c++ code (or any other code besides python). Instead we now use a subprocess (via python's multiprocessing) to kill the worker process after the timeout expires. This works no matter what code is being run.
Note that this means that TimeoutErrors are never reported because we have no way of distinguishing between timeouts and subprocesses dying. I think this is a worthwhile tradeoff because we can run into situations where autotvm takes forever to tune because it is waiting on a really slow to compile program.
@tqchen

Thanks @tkonolige, great catch of the problem(of long running c++ fns). This is indeed something we overlooked. Would be nice to still get the timeout information back.
Let me also spend some time digging to see what can we do here.

Coming back with some diggings.
My initial reaction after seeing the comments was yes it could indeed be the case where python cannot interrupt c++. Because it is indeed true that python signal handler function in c++ won't be caught until getting back to python interpreter.
Here is the fun part, I end up trying to type up a solution via c++ multi-threading, then after writing test cases to confirm the behavior I realized that actually the original implementation might work fine.
Here is why: python's multi-threading is backed by real system threads and they are guarded by GIL. So although one thread enters the FFI as a long running function, another thread(the watcher) can continue to run in python interpreter (as the GIL has been released by the long running function) without a problem, as a result the timeout signal back to the parent process will continue to function, then the parent process signals kill to the popen worker.
The two test cases I created for the alternative solution end up shows the original impl is working as intended.
https://github.com/apache/tvm/compare/main...tqchen:popen2
See the following busy counting function(in C++) as a proxy for long running c++ functions
TVM_REGISTER_GLOBAL("testing.busy_counting").set_body_typed([](double value, int repeat, int number) {
  double sum = 0.0;
  for (int i = 0; i < number; ++i) {
    for (int j = 0; j < repeat; ++j) {
      sum += value;
    }
    LOG(INFO) << "Finished counting for " <<  (i + 1)  << " iter";
  }
});

Running the following debug script yields:
from tvm.contrib.popen_pool import PopenWorker
import tvm.testing._ffi_api

proc = PopenWorker()

proc.send(tvm.testing.busy_counting, [0.1, 1<<25, 10], timeout=100)
proc.recv()

proc.send(tvm.testing.busy_counting, [0.1, 1<<25, 100], timeout=0.2)
proc.recv()

[18:06:34] ffi_testing.cc:180: Finished counting for 1 iter
[18:06:34] ffi_testing.cc:180: Finished counting for 2 iter
[18:06:34] ffi_testing.cc:180: Finished counting for 3 iter
[18:06:34] ffi_testing.cc:180: Finished counting for 4 iter
[18:06:35] ffi_testing.cc:180: Finished counting for 5 iter
[18:06:35] ffi_testing.cc:180: Finished counting for 6 iter
[18:06:35] ffi_testing.cc:180: Finished counting for 7 iter
[18:06:35] ffi_testing.cc:180: Finished counting for 8 iter
[18:06:35] ffi_testing.cc:180: Finished counting for 9 iter
[18:06:35] ffi_testing.cc:180: Finished counting for 10 iter
---------see here is the second iteration where timeout get triggered in c++ run----
[18:06:35] ffi_testing.cc:180: Finished counting for 1 iter
[18:06:35] ffi_testing.cc:180: Finished counting for 2 iter
Traceback (most recent call last):
  File "debug_popen.py", line 12, in <module>
    proc.recv()
  File "/home/tqchen/github/tvm/python/tvm/contrib/popen_pool.py", line 297, in recv
    raise TimeoutError()
TimeoutError

So perhaps there is over-speculation in this case. @tkonolige if you encountered a repro case, it would be good to dig deeper and see if there are other reasons behind.

I think something between our environments is different :). Here is what I get from your script (I modified it a little so it went slower):
[09:23:44] /home/tristan/octoml/tvm/src/support/ffi_testing.cc:184: Finished counting for 1 iter1.1259e+15
[09:23:44] /home/tristan/octoml/tvm/src/support/ffi_testing.cc:184: Finished counting for 2 iter2.2518e+15
[09:23:44] /home/tristan/octoml/tvm/src/support/ffi_testing.cc:184: Finished counting for 3 iter3.3777e+15
[09:23:44] /home/tristan/octoml/tvm/src/support/ffi_testing.cc:184: Finished counting for 4 iter4.5036e+15
[09:23:44] /home/tristan/octoml/tvm/src/support/ffi_testing.cc:184: Finished counting for 5 iter5.6295e+15
[09:23:44] /home/tristan/octoml/tvm/src/support/ffi_testing.cc:184: Finished counting for 6 iter6.7554e+15
[09:23:44] /home/tristan/octoml/tvm/src/support/ffi_testing.cc:184: Finished counting for 7 iter7.8813e+15
[09:23:44] /home/tristan/octoml/tvm/src/support/ffi_testing.cc:184: Finished counting for 8 iter9.0072e+15
[09:23:44] /home/tristan/octoml/tvm/src/support/ffi_testing.cc:184: Finished counting for 9 iter1.01331e+16
[09:23:44] /home/tristan/octoml/tvm/src/support/ffi_testing.cc:184: Finished counting for 10 iter1.1259e+16
[09:23:44] /home/tristan/octoml/tvm/src/support/ffi_testing.cc:184: Finished counting for 1 iter1.1259e+16
[09:23:44] /home/tristan/octoml/tvm/src/support/ffi_testing.cc:184: Finished counting for 2 iter2.2518e+16
[09:23:45] /home/tristan/octoml/tvm/src/support/ffi_testing.cc:184: Finished counting for 3 iter3.3777e+16
[09:23:45] /home/tristan/octoml/tvm/src/support/ffi_testing.cc:184: Finished counting for 4 iter4.5036e+16
[09:23:45] /home/tristan/octoml/tvm/src/support/ffi_testing.cc:184: Finished counting for 5 iter5.6295e+16
[09:23:45] /home/tristan/octoml/tvm/src/support/ffi_testing.cc:184: Finished counting for 6 iter6.7554e+16
[09:23:45] /home/tristan/octoml/tvm/src/support/ffi_testing.cc:184: Finished counting for 7 iter7.8813e+16
-------------------------- snip -----------------------------------
[09:23:47] /home/tristan/octoml/tvm/src/support/ffi_testing.cc:184: Finished counting for 96 iter1.08086e+18
[09:23:47] /home/tristan/octoml/tvm/src/support/ffi_testing.cc:184: Finished counting for 97 iter1.09212e+18
[09:23:47] /home/tristan/octoml/tvm/src/support/ffi_testing.cc:184: Finished counting for 98 iter1.10338e+18
[09:23:47] /home/tristan/octoml/tvm/src/support/ffi_testing.cc:184: Finished counting for 99 iter1.11464e+18
[09:23:47] /home/tristan/octoml/tvm/src/support/ffi_testing.cc:184: Finished counting for 100 iter1.1259e+18
Traceback (most recent call last):
  File "timer-debug.py", line 11, in <module>
    proc.recv()
  File "/home/tristan/octoml/tvm/python/tvm/contrib/popen_pool.py", line 297, in recv
    raise TimeoutError()
TimeoutError

The timeout error only occurs after the c++ function finishes.
This is Python 3.8.12 on Pop!_OS 21.04.

Here is why: python's multi-threading is backed by real system threads and they are guarded by GIL. So although one thread enters the FFI as a long running function, another thread(the watcher) can continue to run in python interpreter (as the GIL has been released by the long running function) without a problem, as a result the timeout signal back to the parent process will continue to function, then the parent process signals kill to the popen worker.

Is this still true in the case where we call python -> c++ -> python -> c++?

Thanks @tkonolige , that is another fun surprise :)
I end up was able to reproduce the problem under cython, and this revealed an issue in the cython FFI implementation(which does not exist in ctypes due to automatic release of all GILs).
https://github.com/apache/tvm/pull/11461 should fix the problem

Closing in favor of #11461


Cores retroarch

Games spectrum,amiga500/1200,neogeo,for launcher please.

Issue can be closed, this relates to RetroFlow, not HexFlow.
RetroFlow issues can be posted here:
https://github.com/jimbob4000/RetroFlow-Launcher/issues


check oob write in discord-public-message.c

FYI, I added an oob write check to this file.  the cl: c6b34ea

Ok, thanks!

Ok, thanks!


Using

I have the following Vue component:
<template>
  <button class="primary">
    Test
  </button>
</template>

<style>
.primary {
  @apply bg-blue-300;
}
</style>

The style is applied and all is good.
But I would like to use <style lang="postcss"> to get syntax highlighting. But when adding lang="postcss" I get the following error:
ERROR in ./src/components/base/QButton.vue?vue&type=style&index=0&lang=postcss& (./node_modules/vue-loader/lib??vue-loader-options!./src/components/base/QButton.vue?vue&type=style&index=0&lang=postcss&) 8:0
Module parse failed: Unexpected token (8:0)
File was processed with these loaders:
 * ./node_modules/vue-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|
|
> .primary {
|   @apply bg-blue-300;
| }

Going by this Twitter post. This should be possible.
Is there any additional setup or configuration required to get syntax highlighting when using the directives in a Vue component?
It is a new project created with vue-cli version 4.2.2.
I added a postcss.config.js in the src folder containing the following:
module.exports = {
  plugins: [require("tailwindcss"), require("autoprefixer")]
};

My tailwind.config.js is empty:
module.exports = {
  theme: {
    extend: {}
  },
  variants: {},
  plugins: []
};

The following packages are installed:
{
  "name": "webclient-service",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "test:unit": "vue-cli-service test:unit",
    "lint": "vue-cli-service lint",
    "storybook": "start-storybook -p 6006",
    "build-storybook": "build-storybook"
  },
  "dependencies": {
    "core-js": "^3.6.4",
    "tailwindcss": "^1.2.0",
    "vue": "^2.6.11",
    "vue-router": "^3.1.5",
    "vuex": "^3.1.2"
  },
  "devDependencies": {
    "@babel/core": "^7.8.4",
    "@storybook/addon-actions": "^5.3.13",
    "@storybook/addon-links": "^5.3.13",
    "@storybook/addon-storysource": "^5.3.13",
    "@storybook/addons": "^5.3.13",
    "@storybook/vue": "^5.3.13",
    "@vue/cli-plugin-babel": "~4.2.0",
    "@vue/cli-plugin-eslint": "~4.2.0",
    "@vue/cli-plugin-router": "~4.2.0",
    "@vue/cli-plugin-unit-jest": "~4.2.0",
    "@vue/cli-plugin-vuex": "~4.2.0",
    "@vue/cli-service": "~4.2.0",
    "@vue/eslint-config-prettier": "^6.0.0",
    "@vue/test-utils": "1.0.0-beta.31",
    "babel-eslint": "^10.0.3",
    "babel-loader": "^8.0.6",
    "babel-preset-vue": "^2.0.2",
    "eslint": "^6.7.2",
    "eslint-plugin-prettier": "^3.1.1",
    "eslint-plugin-vue": "^6.1.2",
    "prettier": "^1.19.1",
    "vue-template-compiler": "^2.6.11"
  }
}

Can you share your webpack config? It sounds like you don't have the postcss loader properly configured.

@thalesagapito it is a new project created with @vue/cli version 4.2.2.
I didn't tinker with any of the default configurations.

Well that's probably what's wrong. According to the Vue CLI docs:

Vue CLI uses PostCSS internally

So since you have used it to create your project it'll work out of the box, and that's why your css by default has postcss processing. But since you're trying to add lang="postcss", your webpack config needs instructions on how to process these lang="postcss" blocks.
What you need to do is update your vue.config.js like this:
module.exports = {
  configureWebpack: {
    module: {
      rules: [
        {
          test: /\.postcss$/,
          use: [ 'style-loader', 'postcss-loader' ]
        }
      ]
    }
  }
}

And add the postcss-loader package to your devDependencies.

Thank you for your help!
I thought that since the Vue CLI docs already use PostCSS I don't have to do any additional setup.


Integrate code artifact with a2d2

Added AWS CodeArtifact configuration in a2d2-settings.xml & pom.xml.
Tested by building a2d2 on local.

This pull request is for testing a code artifact configuration. Once testing is complete, we will finalize the changes and create the pull request.


Multiple Email Support?

Hey quick question regarding the module -- does it handle multiple emails when passed as an list?
ex :
send({
  to: target_emails,
  subject: mailsubject,
  files: [attachment],
  text: body
}, function (err, res) {
  console.log('FAILED TO SEND EMAIL:', err, '; res:', res);
});

where target_emails is a list of emails
target_emails = ['email1,', 'email2'];

yes, this is mentioned in example 1.