Removing desktops

Just discovered this shell, and have been experimenting with it.  In doing so, I have created some desktops that I would like to clear, delete, disable or whatever term to eliminate them is proper.  Short of reconfiguring the installation is there a way to accomplish this?
While I recognize this is a pre-release edition, I hope someone will kindly assist me.  I have been rather impressed so far.  Using under Win 10 without replacing file explorer.
Thank you.

Are you referencing the virtual desktop system built in the windows 10?
Sent from my iPhone
On Jun 15, 2018, at 9:06 PM, GR8smoky <notifications<EMAIL_ADDRESS>wrote:
Just discovered this shell, and have been experimenting with it. In doing so, I have created some desktops that I would like to clear, delete, disable or whatever term to eliminate them is proper. Short of reconfiguring the installation is there a way to accomplish this?
While I recognize this is a pre-release edition, I hope someone will kindly assist me. I have been rather impressed so far. Using under Win 10 without replacing file explorer.
Thank you.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcairoshell%2Fcairoshell%2Fissues%2F159&data=02|01||9ec7d343939c4709223108d5d32564a2|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636647079902304690&sdata=fqAXoA8U5yvQp%2Ba8i7g7Af%2Fxn2WF739yswsbf4aNnk8%3D&reserved=0, or mute the threadhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAGxXAZcpfaMoYU2FDMIxmn4NDRAJkKQjks5t9FoVgaJpZM4UqTIk&data=02|01||9ec7d343939c4709223108d5d32564a2|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636647079902304690&sdata=4QJ6saCUy6j7WOkPv0uO4IzekojVXbLN%2FPO%2B27UepXA%3D&reserved=0.

No.  I am referring to what I believe are called Dynamic Desktops.
In an attempt to explain clearly, in Cairo go to and click on Places on top menu bar, then select Downloads; this will load all folders from that directory on to your screen that can now be scrolled through with the dynamic navigation toolbar.  Can that individual screen/desktop be later cleared or removed from showing in Cairo without deleting the directory from the HD/file explorer/system?
Hope this clears up my question.
Thanks for responding.

I believe this is accomplished by clicking the home button on the dynamic desktop navigation
Sent from my iPhone
On Jun 16, 2018, at 11:30 AM, GR8smoky <notifications<EMAIL_ADDRESS>wrote:
No. I am referring to what I believe are called Dynamic Desktops.
In an attempt to explain clearly, in Cairo go to and click on Places on top menu bar, then select Downloads; this will load all folders from that directory on to your screen that can now be scrolled through with the dynamic navigation toolbar. Can that individual screen/desktop be later cleared or removed from showing in Cairo without deleting the directory from the HD/file explorer/system?
Hope this clears up my question.
Thanks for responding.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcairoshell%2Fcairoshell%2Fissues%2F159%23issuecomment-397819810&data=02|01||c45a31e083cb48bed18a08d5d39e25db|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636647598552220022&sdata=sYWwoiB%2F0Yz9wv79k87%2BvhPIzqS7qPhJqGWeAojmgnc%3D&reserved=0, or mute the threadhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAGxXASK1VNepK17KiyuO_8VP-sl4ytOrks5t9SSrgaJpZM4UqTIk&data=02|01||c45a31e083cb48bed18a08d5d39e25db|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636647598552220022&sdata=OquDGdjEoChtivdQNR61dleyc0bwl%2BfOkgx9smWh7QM%3D&reserved=0.

No, that does not accomplish my goal, it just rotates the undesired "desktop" or screen out of view.
What I want to accomplish is to remove/delete the screen from Cairo's rotation scheme.  What has occurred is that in experimenting I did some things I would like to undo, and keep some other things (like the taskbar configuration), so as to not start from scratch again. Plus I know I will make errors and want to make changes again in the future.
I have played with options, key combos, and context screens to no avail so far.  Now wondering if there is a profile or configuration file that could be modified.
If any ideas or suggestions, I'd appreciate them.  Thanks for your help so far. Kind of late here so will not work on anything until tomorrow.

The only desktop that Cairo saves is the default one set in Cairo Settings. Are you talking about the back/forward buttons? The back button traverses up the directory structure, while the forward button traverses desktop history. However, this is not persisted across restarts of Cairo.

I think this is a misunderstanding of the functionality. The feature is the directory that the desktop polls to show the desktop icons can be changed. You are not creating multiple desktops, you are just changing where the desktop’s icons come from. Think of it like an explorer window.
Sent from my iPhone
On Jun 16, 2018, at 11:02 PM, GR8smoky <notifications<EMAIL_ADDRESS>wrote:
No, that does not accomplish my goal, it just rotates the undesired "desktop" or screen out of view.
What I want to accomplish is to remove/delete the screen from Cairo's rotation scheme. What has occurred is that in experimenting I did some things I would like to undo, and keep some other things (like the taskbar configuration), so as to not start from scratch again. Plus I know I will make errors and want to make changes again in the future.
I have played with options, key combos, and context screens to no avail so far. Now wondering if there is a profile or configuration file that could be modified.
If any ideas or suggestions, I'd appreciate them. Thanks for your help so far. Kind of late here so will not work on anything until tomorrow.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcairoshell%2Fcairoshell%2Fissues%2F159%23issuecomment-397851310&data=02|01||cc8c977d92054899b7c108d5d3fec98a|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636648013615277304&sdata=eQJuN36rBxpZxml6GZk%2BXqj2RB%2FA8mdvA5USJzbaJak%3D&reserved=0, or mute the threadhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAGxXAXGbavJNGUskrsndgAsxzMNkCZQaks5t9cbOgaJpZM4UqTIk&data=02|01||cc8c977d92054899b7c108d5d3fec98a|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636648013615277304&sdata=cnqLOOVqAB8dw1bgju9TrMC2utSrrFlpanfNAVAYIsA%3D&reserved=0.

I think this is a feature request to be able to view and remove undesired Dynamic Desktop history. My recommendation for such a feature would be to either click and hold OR right click the Dynamic Desktop navigation to show a history menu. This menu would allow direct navigation to that entry on click and also have an [x] button to the right for removal. Since the Dynamic Desktop navigation can be moved around the  history menu would have to be location aware so that it’s not display off screen. On other request that comes to mind while discussing this is to have a configurable limit to the length of history that is stored  from one to ∞ ( or some other reasonable limit, I don’t have the source open and I don’t remember what I originally coded it as )
Sent from my iPhone
On Jun 17, 2018, at 1:13 AM, Sam Johnson <notifications<EMAIL_ADDRESS>wrote:
The only desktop that Cairo saves is the default one set in Cairo Settings. Are you talking about the back/forward buttons? The back button traverses up the directory structure, while the forward button traverses desktop history. However, this is not persisted across restarts of Cairo.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcairoshell%2Fcairoshell%2Fissues%2F159%23issuecomment-397855324&data=02|01||34db6ae5cbd74d0b73ba08d5d4111cd2|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636648092310582777&sdata=ZXiOWWT5G4L1fzOvDl1e%2FiNaaX4j0MIRxy439XZneuo%3D&reserved=0, or mute the threadhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAGxXAVUslNeEOr0ruYZFDk0q3K-23I07ks5t9eWNgaJpZM4UqTIk&data=02|01||34db6ae5cbd74d0b73ba08d5d4111cd2|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636648092310582777&sdata=JitnRcYom%2BycGaFMoCvdPWffrGArSGWEVxiYgKBxtXo%3D&reserved=0.

I added a proof of concept to my fork
https://github.com/josuave/cairoshell
Sent from my iPhone
On Jun 17, 2018, at 1:13 AM, Sam Johnson <notifications<EMAIL_ADDRESS>wrote:
The only desktop that Cairo saves is the default one set in Cairo Settings. Are you talking about the back/forward buttons? The back button traverses up the directory structure, while the forward button traverses desktop history. However, this is not persisted across restarts of Cairo.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcairoshell%2Fcairoshell%2Fissues%2F159%23issuecomment-397855324&data=02|01||34db6ae5cbd74d0b73ba08d5d4111cd2|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636648092310582777&sdata=ZXiOWWT5G4L1fzOvDl1e%2FiNaaX4j0MIRxy439XZneuo%3D&reserved=0, or mute the threadhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAGxXAVUslNeEOr0ruYZFDk0q3K-23I07ks5t9eWNgaJpZM4UqTIk&data=02|01||34db6ae5cbd74d0b73ba08d5d4111cd2|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636648092310582777&sdata=JitnRcYom%2BycGaFMoCvdPWffrGArSGWEVxiYgKBxtXo%3D&reserved=0.

I think I am beginning to get things clearer.
Per Dremin commit, it is the back button screens I'd like to erase -- just the screens not actually the directories or files themselves. Those back button screens do persist from close to restart (at least using windows as file manager).
Per josuave commit, if I follow correctly, I believe that addresses what I seek.  Have not been able to look at proof of concept, yet.
I do realize profile in user account does not have any bearing.
Thank you both.

Just a final comment here.
Thanks for all your help. Looked at proof of concept, but way above my pay grade.
Sorry I can not be of more help in arriving at a solution.

That’s OK, I did notice a small bug in the WPF implementation of the Browse button’s context menu. In some cases I need to double right click to get the context menu opening function to react appropriately.
Sent from my iPhone
Jun 17, 2018, at 8:32 PM, GR8smoky <notifications<EMAIL_ADDRESS>wrote:
Just a final comment here.
Thanks for all your help. Looked at proof of concept, but way above my pay grade.
Sorry I can not be of more help in arriving at a solution.
—
On
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcairoshell%2Fcairoshell%2Fissues%2F159%23issuecomment-397917177&data=02|01||23fb42e6b0f44733e3dc08d5d4b2ffc9|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636648787607083672&sdata=1ZQE9yZ8Ve3w0hSOICsFLvIMdjdTPE6JnlQi120ybYo%3D&reserved=0, or mute the threadhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAGxXAUQITOElQLy7x8S3e03WwcdkgQTAks5t9vUngaJpZM4UqTIk&data=02|01||23fb42e6b0f44733e3dc08d5d4b2ffc9|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636648787607083672&sdata=pqL8XxRaFk6LhZzHkda3C%2FhB%2FSgEfyAAiyIf%2FhGESMQ%3D&reserved=0.

@josuave - were you planning on finishing this in your fork?

I haven’t had much time lately to look at this. I’ll try to pull it back up this weekend and review. I need to add a remove button [x] to each menu item and I’m also not sure where the right click bug is coming from yet.
Sent from my iPhone
On Jun 27, 2018, at 10:38 PM, Sam Johnson <notifications<EMAIL_ADDRESS>wrote:
@josuavehttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjosuave&data=02|01||7f74c5ef6a4c493cd64b08d5dca02d92|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636657502865190827&sdata=qNwdl%2F2ebhm5wr3qgB9EbjXbDyIpaO2jDqIc07hHLeg%3D&reserved=0 - were you planning on finishing this in your fork?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcairoshell%2Fcairoshell%2Fissues%2F159%23issuecomment-400892405&data=02|01||7f74c5ef6a4c493cd64b08d5dca02d92|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636657502865190827&sdata=6b71CX5ovnAySmJgv3nqGwrYYQww4Fr8kZr%2B4GcxuhE%3D&reserved=0, or mute the threadhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAGxXAYTwFjUkjO01BRc4FKjDg-DRuLNKks5uBEGNgaJpZM4UqTIk&data=02|01||7f74c5ef6a4c493cd64b08d5dca02d92|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636657502865190827&sdata=nT6MNBvsWADO3Cz%2BNBRUQYGRoouayI2O%2Bs94MoLttQk%3D&reserved=0.

Just for clarification: The bug is actually with the built-in contextmenu opening event.
Sent from my iPhone
On Jun 27, 2018, at 10:38 PM, Sam Johnson <notifications<EMAIL_ADDRESS>wrote:
@josuavehttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjosuave&data=02|01||7f74c5ef6a4c493cd64b08d5dca02d92|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636657502865190827&sdata=qNwdl%2F2ebhm5wr3qgB9EbjXbDyIpaO2jDqIc07hHLeg%3D&reserved=0 - were you planning on finishing this in your fork?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcairoshell%2Fcairoshell%2Fissues%2F159%23issuecomment-400892405&data=02|01||7f74c5ef6a4c493cd64b08d5dca02d92|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636657502865190827&sdata=6b71CX5ovnAySmJgv3nqGwrYYQww4Fr8kZr%2B4GcxuhE%3D&reserved=0, or mute the threadhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAGxXAYTwFjUkjO01BRc4FKjDg-DRuLNKks5uBEGNgaJpZM4UqTIk&data=02|01||7f74c5ef6a4c493cd64b08d5dca02d92|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636657502865190827&sdata=nT6MNBvsWADO3Cz%2BNBRUQYGRoouayI2O%2Bs94MoLttQk%3D&reserved=0.

@josuave is it possibly due to the toolbar not having focus on first right-click?

This is odd. It seems to be something. I’m thinking of removing the contextmenu on the button itself and on right click of the button show an standalone contextmenu that is not bound to any control. I left my dev laptop back home so I won’t be able to look again until this weekend.
Sent from my iPhone
On Jul 3, 2018, at 7:44 PM, Sam Johnson <notifications<EMAIL_ADDRESS>wrote:
@josuavehttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjosuave&data=02|01||0293b2c430684c01599608d5e13edd11|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636662582463674442&sdata=B71pCmPCbh8Dd0uYjMrtIIOdtP%2BfogUEv0%2FoCSMJA8c%3D&reserved=0 is it possibly due to the toolbar not having focus on first right-click?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcairoshell%2Fcairoshell%2Fissues%2F159%23issuecomment-402322084&data=02|01||0293b2c430684c01599608d5e13edd11|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636662582463674442&sdata=3F7d3bVwct%2BDrH9T%2FhbfWMzHQAkqJkad1k3%2Bx6%2BXmA0%3D&reserved=0, or mute the threadhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAGxXAQk82VlFlTHltSIkh1hbPZ2KJezhks5uDAHFgaJpZM4UqTIk&data=02|01||0293b2c430684c01599608d5e13edd11|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636662582463674442&sdata=mu%2F4Mh2y6ScODVUE9K%2BfJOz2VNNQYVb%2B4l73rEZMoAI%3D&reserved=0.

The work done for this by @josuave will be available the next release.

Thanks for head's up and all the work done on this issue


ScrollGridFlow does not work with children that have an infinite width.

Describe the bug
If all children of a ScrollGridFlow have infinite width, the rendering results in NaN position.
Expected behavior
I would expect that the horizontal layout respects the InfiniteWidth of the children.
In particular, with MaxCrossAxisCount = 1, the ScrollGridFlow should behave like a virtualized ScrollList.
Desktop: Windows 10
Unity version: 2021.
UniMob version: 2.3.0
UniMob.UI version:  0.5.2
Other plugins installed: None (as in it is reproducible with no plugins)

I will add that I think the issue is due to the code located at https://github.com/codewriter-packages/UniMob.UI/blob/4f3db6ff9514adef904187a6d2dde96fab70b5e0/Runtime/Widgets/ScrollGridFlow.cs#L52-L55
that result in a InnerSize of 0 if all children have infinite width.


az cloud set -n AzureCloud" is fails intermittently.

This is autogenerated. Please review and update as needed.
Describe the bug
az cloud set -n AzureCloud" is failing intermittently.
Command Name
az cloud set -n AzureCloud" is failing intermittently.
Errors:

                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/argparse.py", line 1185, in add_parser
    raise ArgumentError(self, _('conflicting subparser: %s') % name)
argparse.ArgumentError: argument _subcommand: conflicting subparser: set
To open an issue, please run: 'az feedback'
##[error]Script failed with error: ERROR: The command failed with an unexpected error. Here is the traceback:
ERROR: argument _subcommand: conflicting subparser: set
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 560, in execute
    self.parser.load_command_table(self.commands_loader)
  File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/site-packages/azure/cli/core/parser.py", line 100, in load_command_table
    command_parser = subparser.add_parser(command_verb,
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/argparse.py", line 1185, in add_parser
    raise ArgumentError(self, _('conflicting subparser: %s') % name)
argparse.ArgumentError: argument _subcommand: conflicting subparser: set
To open an issue, please run: 'az feedback'

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...
``

Expected Behavior
Environment Summary
Linux-<IP_ADDRESS>-microsoft-standard-WSL2-x86_64-with-glibc2.29, Ubuntu 20.04.4 LTS
Python 3.8.13
Installer: DEB

azure-cli 2.36.0 *

Extensions:
ml 2.1.2

Dependencies:
msal 1.17.0
azure-mgmt-resource 20.0.0

Additional Context

az cloud set

I don't why it happens but you're using python 3.11 to executed command.
3.11 is not supported yet. See https://github.com/Azure/azure-cli/issues/24494
You need to check your cli installation.


pipenv install failure doesn't exit with failure code

Currently if pipenv fails to install (in my case due to hashes not matching the lock file, possibly also for other reasons), the error message is pushed off the screen by normal Collecting ... messages and the exit code is 0, despite the fact nothing has been installed at all.
It should return an error code and finish with a big red error message
To reproduce: Remove the virtualenv, change one of the hashes in Pipfile.lock and run pipenv install

Thanks for this @frankh, this is now resolved in 85d2b2e.


Make a new release of Frog

Hi! First of all, thank you to all contributors that developed Frog! It's the best OCR tool I've ever used, by far 🐸❤
Looking at the issue tracker, there a lot of duplicates (#207, #124, #98, #71, #192) of an issue that has already been solved by 96396a60c428dfc2763b372ec461ced131aa4dcd. The issue I'm talking about breaks the screenshot feature, which is a major convenience in using Frog.
That being said, would it be possible to make a new release of the project? I know this is mostly a maintainer's job, but I make myself available for testing and whatever else I can help with.

I know this is mostly a maintainer's job, but I make myself available for testing and whatever else I can help with.

I would be happy to help co-maintain this app and the Flathub package to take care of releases and fixing bugs since I have already been helping out! :slightly_smiling_face:

Hi! First of all, thank you for using this app :) Second, I need to explain myself a little. It just so happens that reality does not allow me to live in peace and I found myself in a difficult state and simply do not find the strength to engage in the project as often as it requires. I try to support it with updates at least once every six months, but recently this has been difficult for me.
@DaPigGuy thanks for your help, I'll think about your suggestion soon!

@amka There's no need to explain yourself at all! The effort you've poured into your contributions to Frog have already saved countless minutes of my time, so I'll always be grateful no matter the direction the project ends up going :)

Been using Frog ocr from two years, I really love this App, is there any temporary fix until a newer release is deployed.

Bumping here, any movement on this? This tool works amazing for files but would love to be able to screenshot directly. Or maybe a method via the CLI to pipe a screenshot directly from hyprshot or similar tool?


Does not work on Ubuntu

This release does not work on Ubuntu as is stated. I don't use Wayland. See previous issues that are closed for reproduction of error.

It works for me in Ubuntu! Please stop opening non-descriptive issues. I don’t want to hear about your hatred of clipboards @DavidLarsson. Go make something you like.


#007 Add documentation to this project

[x] Install mkdocs
[x] Configuration mkdocs in the current project
[x] Add Get started
[x] API reference

DOne


reportMissingImports warning

Environment data

Language Server version: Pylance
OS and version: Windows 10
Python version (& distribution if applicable, e.g. Anaconda): Anaconda, Python 3.8.3

Code Snippet / Additional information

# No warning
from apiclient import discovery
discovery.build

# reportMissingImports warning
from apiclient.discovery import build

What is the name and version of the library that provides the import apiclient?

What is the name and version of the library that provides the import apiclient?

apiclient.__version__ is NOT available.
import apiclient
apiclient.__version__

Here is the apiclient/__init__.py in site-packges.
"""Retain apiclient as an alias for googleapiclient."""

import googleapiclient

from googleapiclient import channel
from googleapiclient import discovery
from googleapiclient import errors
from googleapiclient import http
from googleapiclient import mimeparse
from googleapiclient import model

try:
    from googleapiclient import sample_tools
except ImportError:
    # Silently ignore, because the vast majority of consumers won't use it and
    # it has deep dependence on oauth2client, an optional dependency.
    sample_tools = None
from googleapiclient import schema

_SUBMODULES = {
    "channel": channel,
    "discovery": discovery,
    "errors": errors,
    "http": http,
    "mimeparse": mimeparse,
    "model": model,
    "sample_tools": sample_tools,
    "schema": schema,
}

import sys

for module_name, module in _SUBMODULES.items():
    sys.modules["apiclient.%s" % module_name] = module

I understand that apiclient is the name of the import module, but what is the name of the library? In other words, what is the command you used to install this library? Is it pip install apiclient? Or pip install googleapiclient? Or something else?

I understand that apiclient is the name of the import module, but what is the name of the library? In other words, what is the command you used to install this library? Is it pip install apiclient? Or pip install googleapiclient? Or something else?

Was following instruction from https://developers.google.com/analytics/devguides/reporting/core/v4/quickstart/service-py
pip install --upgrade google-api-python-client
pip install --upgrade oauth2client

The package name is google-api-python-client

google-api-core                    2.7.1
google-api-python-client           2.42.0
googleapis-common-protos           1.56.0

This library is doing something that I've never seen before — and didn't realize was even supported by Python. I'm not sure if it is officially supported or just happens to work as a side effect of the complex import mechanism in the Python runtime.
The module apiclient/__init__.py is importing another module using the statement from googleapiclient import discovery, and you're trying to import symbols from the discovery.py module using the statement from apiclient.discovery import XXX. The discovery.py module doesn't exist in the file system under the apiclient directory; that relationship exists only in memory once the from googleapiclient import discovery statement is executed at runtime.
I think we can handle this case statically, but I'll need to think more about how much complexity this would add to pyright / pylance. As I said, this is the first time I've ever seen this situation, so it's far from the norm.
In the meantime, you can use the following variants if you want to avoid the reportMissingImports warning.
from apiclient import discovery
discovery.build

or
from googleapiclient.discovery import build

Environment data

Language Server version: Pylance
IDE Visual Studio Code version: 1.66.1
OS and version: Windows 11
Python 3.10.4

I used to install this library "pip install python-decouple"
# reportMissingImports warning
from decouple import config

I had a similar problem, finally, I uninstalled and reinstalled Pylance Extension and it resolved.

Environment data

Language Server version: Pylance
IDE Visual Studio Code version: 1.66.1
OS and version: Windows 11
Python 3.10.4

I used to install this library "pip install python-decouple"
# reportMissingImports warning
from decouple import config

done everything suggested by chatgpt, reinstalled pylance still issue not solved

@abdudds, my guess is that decouple is not installed in your environment, or the environment that you have selected in VS Code is not the environment that you planned to use. See https://code.visualstudio.com/docs/python/environments#_working-with-python-interpreters.
If this doesn't help, please open a new issue.


Gradients of non-scalars (higher rank Jacobians)

Currently if you call gradients(ys, xs), it will return the sum of dy/dx over all ys for each x in xs. I believe this doesn't accord with an a priori mathematical notion of the derivative of a vector. I'd like the way to take the derivative of ys wrt xs where both are vectors and have a Jacobian matrix returned. By extension, I'd like to take the derivative of a vector wrt a matrix and get back a 3-tensor. There doesn't seem to be a convenient tensorflow function to compute the Jacobian or higher order derivatives. Am I missing something or is this functionality that we could add?

zackchase@, you are right about the current gradients function. Currently, you can compute the Jacobian of, say, a vector, by calling gradients multiple times, one for every scalar component (obtained by slicing) of the original vector, and reassembling the results. Contributions are welcome to make this nicer and efficient.

It'd be pretty hard to support gradients of non-scalars with our current setup, since it would require every gradient function to handle extra rank input.  The one possibility I could see would be if we add some sort of map facility to register how to add extra ranks to ops, then compute gradients with respect to extra rank by computing lower rank and calling the registered map transformations.
Someone asked for map a while back, so if anyone wanted to tackle this task that might be the way to go.  Handling it at the gradient function level is probably bad, since it would add required complexity to an existing feature.  Warning: This is a pretty large change, so a good deal of discussion would be in order before starting.

Hi Geoffrey, thanks for taking an interest in this issue. I was initially confused by the use of "rank" to describe the number of dimensions of the array. Should we avoid this name in the thread title and documentation to preempt confusion via overloading the linear algebra notion of rank?

Tensor rank is very standard terminology: http://mathworld.wolfram.com/TensorRank.html

Cool. The terminology gets funny when we talk about rank-R decompositions of tensors, meaning the tensor can be represented as a sum of R outer products of rank-1 tensors, but probably not a problem for us to solve here.
One thing I thought of is that I would like to compute the frobenius norm of the Jacobian of the log probabilities for use as a smoothness penalty as in a contractive autoencoder. In this case, as we only seek a scalar at the end, is there a more efficient method than separately calculating the derivative of each output with respect to the inputs?

  In that case, you should differentiate with respect to that single scalar.

Not exactly. I'm saying if one wants to penalize the norm of the Jacobian of the mapping function.
So optimization objective would be (pseudocode):
cost(y,yhat, X) = loss(y,yhat) + norm(Jacobian(log(yhat), X))

Ah, sorry for not reading carefully.  You're correct that (as far as I know) there's no easy way to do that in tensorflow.  According to someone more knowledgeable than I, people generally do such contractive autoencoders by writing out the first derivative manually.  Also, they generally restrict to single layer at a time networks for speed issues, since doing the full Jacobian for a multilayer network is quite expensive.

Regardless, it would be good to have a way to call derivatives of vectors and receive gradients of the expected shape.

Differentiating with respect to one variable is similar to how it works in Theano. I agree it may be confusing when TensorFlow automatically turns many variables into one by taking the sum. An alternative would be to fail if there's more than 1 output variable specified, and require the user to specify sum explicitly.
The reason for "one output variable at a time" in TensorFlow (and Theano) is because we do reverse mode AD by default. In reverse AD you have a single target scalar quantity and you propagate sensitivities with respect to that quantity. In contrast, if you we did forward AD instead, we would naturally support multiple output variables, but only compute derivative with respect to one scalar variable at a time. Supporting mixed mode propagation to cover "multiple inputs/multiple outputs" case could be a lot of extra plumbing.
If you have a small number of output variables, standard thing to do is to apply reverse AD with respect to each variable in a loop. This is what Theano recommends to do for compute Hessian for instance: http://deeplearning.net/software/theano/tutorial/gradients.html#computing-the-hessian.

I was hoping to implement higher order derivatives using the map function but am getting an error message I can't quite get my head around. My implementation is (in pseudo code)
params = tf.Variable("some initial value")
loss = some_function(params)
grads = tf.gradients(loss, params)[0]
hess = tf.map_fn(lambda grad: tf.gradients(grad, X)[0], grads)

When I fetch the hessian, I get the error message
InvalidArgumentError: All inputs to node map/while/gradients/map/TensorArrayUnpack_grad/TensorArrayGrad/TensorArrayGrad must be from the same frame.

I assumed that tensorflow has an issue because it doesn't know about params in the loop (cf. non_sequences in theano scan), and extended map_fn to pass extra arguments to the loop. Unfortunately, the extra arguments get wrapped in an identity transformation and tf.gradients(params, tf.identity(params)) gives [None], which seems a bit unintuitive.
Looping in python is of course fine but I'd like to avoid introducing an extra node to the graph for every parameter. Any suggestions?

@yuanbyu: Do you understand this issue with tf.map_fn?

Note for anyone who comes across this thread: tf.map_fn is an unrelated thing involving control flow, not something related to mapping over extra rank tensors.

We don't support higher-order gradients for while_loop/map_fn/scan/fold. You should see an informative error message if you try to do that.

@vladfi1 I'm no longer at Brain, so I wouldn't know. I would say it is unlikely to ever be part of core TensorFlow. There are >450 ops in TF, so Brain team would have to implement forward AD grad method for all of 450 ops and maintain them forever, or alternatively have to explain why someone's favorite op doesn't have AD support.  It seems more realistic that someone would create a separately maintained library that does forward-AD, and utilizes TensorFlow as backend. Kind of like autograd but using TensorFlow instead of numpy as the backend.

Is tf.test.compute_gradient is some kind of funtion that we can get the jacobian matrix (not as a tensor but as a numpy.ndarray) of a vector tensor y w.r.t. a vector tensor x?

There are no built-in jacobians in TensorFlow, instead anything called
'grad' or 'gradient' computes Jacobian-vector product (also called LOp in
theano), see
https://en.wikipedia.org/wiki/Automatic_differentiation#Reverse_accumulation
On Mon, Feb 20, 2017 at 4:04 AM, MYaooo<EMAIL_ADDRESS>wrote:

Is tf.test.compute_gradient is some kind of funtion that we can get the
jacobian matrix (not as a tensor but as a numpy.ndarray) of a vector tensor
y w.r.t. a vector tensor x?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/tensorflow/tensorflow/issues/675#issuecomment-281062188,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABaHO7dLBLvhJH5KoSiV8WcySnfR5cnks5reYFMgaJpZM4G9_8_
.

@yaroslavvb Thanks for your reply. I see why it's expensive to do that.

Hessians are supported but yes, they are expensive to compute.

@myaooo currently tf.gradients gives gradient of function which outputs a scalar. You could call it multiple times for each output. IE, [tf.gradients(component, var) for component in vector].
There's a trick for computing hessians more efficiently described in https://github.com/tensorflow/tensorflow/issues/4897#issuecomment-253056458

Adding a comment that this was also a bit of a gotcha for me, and simultaenously adding a vote to consider a change to the api. Calling tf.gradients(matrix, vector, aggregation_method=None) I would have expected it to return an tensor of the same shape as matrix, but it returns sum(M) along an axis.

It's a little less surprising when you know that there's no efficient algorithm to compute Jacobian, therefore all neural net frameworks use reverse mode AD which requires target to be a scalar

@el3ment I consider this a bug.  Unfortunately, I've looked into fixing it, and there's a surprising number of tests within TensorFlow that depend on it.  I didn't get past said piles of tests to see whether there's interesting downstream code in Google that uses it.

@el3ment @girving
I found this confusion as well.
x = tf.constant([3], dtype=tf.float32) y = tf.constant([9,8,7,6,5], dtype=tf.float32) z = x_mean * y sess.run(tf.gradients(z, x_mean))
and I got array([35.])

Just trying to understand something. I was trying to make a hack of tf.gradient that would give, for a y of rank (M,N) and an x of rank (Q,P) a gradient tensor of rank (M,N,Q,P) as one would naturally expect. However, as mentioned already here, what one gets is a rank (Q,P) which is the grad of the sum of the elements of y.  Now what I can't figure out, looking into the tensorflow code is where is that sum over elements of y  made? Is it as the beginning or at the end? Could someone help me pinpoint the lines of code where that is done?

Note that "summing ys together" is sort of buried deep in backprop. Note that TensorFlow uses Reverse Mode AD in order to compute gradients, and reverse mode AD only supports a scalar output function. If you have non-scalar output, we don't have any algorithm much better than calling reverse mode AD on each of the components of the output separate.
(there's a trick mentioned by ian here which is a bit better on Python overhead compared to calling gradients many times)
That said, the place where summation of ys happens is in line 479-481 in gradients_impl.py
First note that grad_ys are set to the same value in this line
grad_ys = _DefaultGradYs(grad_ys, ys, colocate_gradients_with_ops)
Later there's this block

 # Add the initial gradients for the ys.
    for y, grad_y in zip(ys, grad_ys):
      _SetGrad(grads, y, grad_y)

Note that if you had a single y*=y1+y2+y3+..., then the gradients would propagate in the same way -- the same backprop value from y would be copied over to nodes y1,y2,y3, so this block implicitly treats ys as being added up into the final sum

Thanks for your response!
But there are two things which confuse me from your answer:
(1)

we don't have any algorithm much better than calling reverse mode AD on each of the components of the output separate.

I'm pretty sure that that cannot be the case. If you think of a deep network outputting a vector y, then the gradient of y[0] is basically the same as that from y[1], they only defer by the last weight matrix elements. i.e. y[0] = W(0,j) V(j, ...)  while y[1] = W(1,j) V(j,...).
(2)     You say the summation happens at line 479-481 of gradients_impl.py
But just above those lines, there is the following comment in the code:
grads: op => list of gradients received on each output endpoint of the
# op.  The gradients for each endpoint are initially collected as a list.
# When it is time to call the op's gradient function, for each endpoint we
# aggregate the list of received gradients into a Add() Operation if there

is more than one.
And indeed when one looks into the function _SetGrad there is no addition, only appending to a list, and all the y 's, if I understand correctly, are still kept separate by being different keys to the dictionary grads.
So I am utterly confused by this.
Also thank you very much for Ian's trick, but I don't really understand what he means.

@isabeaups the two gradients can differ significantly when there are non-linear operators, as is the case for neural networks.
As a toy example, suppose there's some operation that when f(x)=1, and you compute gradient, one of the backprop operators overflows and causes NaN, which is a valid float32 value. If you want to backprop from vector [1,2], you are going to have to do full backprop from 1, and from 2. There's no shortcut that'll let you keep same size intermediate matrices and be able to backprop from both values in parallel

I'm reopening this issue since I think it's still a valid feature request -- @yuanbyu comment https://github.com/tensorflow/tensorflow/issues/675#issuecomment-241961454 from last year closing it doesn't make sense to me.
One simple way to implement this in TensorFlow -- though possibly not the most efficient -- is with tf.reshape, tf.map_fn and tf.gradients:
def jacobian(y, x):
  def fn(y_i):
    (result,) = tf.gradients(y_i, x)
    return result
  y_flat = tf.reshape(y, (-1,))
  jacobian_flat = tf.map_fn(fn, y_flat)
  return tf.reshape(jacobian_flat, y.shape.concatenate(x.shape))

Example usage:
>>> x = tf.ones((3,))
>>> y = x ** 2
>>> jacobian(y, x)
<tf.Tensor 'Reshape_6:0' shape=(3, 3) dtype=float32>

Could simply add tf.jacobian to the TensorFlow API and keep tf.gradients unchanged?

@shoyer I can't get your jacobian to work (seems like a similar issue to here). Here's a minimal example:
tf.reset_default_graph()

x = tf.placeholder(tf.float32, shape=[3])
y = x ** 2 / 2

jac = jacobian(y, x)

sess = tf.Session()

x_val = np.random.randn(3).astype(np.float32)

jac_val = sess.run(jac, feed_dict={x: x_val})

I get
InvalidArgumentError: TensorArray map/TensorArray_16@map/while/gradients: Could not write to TensorArray index 1 because it has already been read.

Just a FYI for anyone who happens to stumble here looking for a tf.jacobian: this seems to work (props to @yaroslavvb):
N = 3

tf.reset_default_graph()

x = tf.placeholder(tf.float32, shape=[N])
y = x ** 2 / 2

y_list = tf.unstack(y)
jacobian_list = [tf.gradients(y_, x)[0] for y_ in y_list]  # list [grad(y0, x), grad(y1, x), ...]
jacobian = tf.stack(jacobian_list)

sess = tf.Session()

x_val = np.random.randn(N)
jacobian_val = sess.run(jacobian, feed_dict={x:x_val})

print(x_val)
print(jacobian_val)

Indeed seems pretty slow for bigger values of N... would be nice to get the map_fn method to work (if it's going to be faster).

@harpone oops -- good catch! Apologies for posting untested code :). (The version that I actually got working on Friday used a static loop, but then I mistakenly assumed tf.map_fn would simplify it.)

@shoyer @harpone here's mine -- works for high-dimensional Jacobians (numerator and denominator have >1 dimension), undefined batch sizes, and tensors that are not statically known.
Remember to use an interactive session, otherwise tf.get_default_session() will not be able to find the session.
def tf_jacobian(tensor2, tensor1, feed_dict, sess = tf.get_default_session()):
    """
    Computes the tensor d(tensor2)/d(tensor1) recursively.
    :param tensor2: numerator of Jacobian
    :param tensor1: denominator of Jacobian
    :param feed_dict: input data (need this if tensors are not statically known)
    :return: a tensor of dimension (dim_tensor2 x dim_tensor1)
    """
    # can't do tensor.get_shape() because it doesn't work for undefined batch size
    shape = list(sess.run(tf.shape(tensor2), feed_dict))
    if shape:
        # split tensor2 along first dimension and recur
        # int trick from https://github.com/tensorflow/tensorflow/issues/7754
        tensor2_split = tf.split(axis = 0, num_or_size_splits = int(shape[0]), value = tensor2)
        grad_split = [tf_jacobian(tf.squeeze(M, squeeze_dims = 0), tensor1, feed_dict) for M in tensor2_split]
        return tf.stack(grad_split)
    else:
        # calculate gradient of scalar
        grad = tf.gradients(tensor2, tensor1)
        if grad[0] != None:
            return tf.squeeze(grad, squeeze_dims = [0])
        else:
            # replace any undefined gradients with zeros
            return tf.zeros_like(tensor1)

And here's one for batched tensors:
def batch_tf_jacobian(tensor2, tensor1, feed_dict, sess = tf.get_default_session()):
    """
    Computes the matrix d(tensor2)/d(tensor1) recursively.
    Tensorflow doesn't really have its own Jacobian operator
    (tf.gradients sums over all dims of tensor2).

    :param tensor2: numerator of Jacobian, first dimension is batch
    :param tensor1: denominator of Jacobian, first dimension is batch
    :param feed_dict: input data (need this if tensors are not statically known)
    :return: batch Jacobian tensor
    """
    shape2 = list(sess.run(tf.shape(tensor2), feed_dict))
    shape1 = list(sess.run(tf.shape(tensor1), feed_dict))

    jacobian = tf_jacobian(tensor2, tensor1, feed_dict)
    batch_size = shape2[0]

    batch_jacobian = [tf.slice(jacobian, [i] + [0]*(len(shape2)-1) + [i] + [0]*(len(shape1)-1),  [1] + [-1]*(len(shape2)-1) + [1] + [-1]*(len(shape1)-1)) for i in range(batch_size)]
    batch_jacobian = [tf.squeeze(tensor, squeeze_dims = (0, len(shape2))) for tensor in batch_jacobian]
    batch_jacobian = tf.stack(batch_jacobian)
    return batch_jacobian

@shoyer Hi. Thanks for your example to compute jocabian. Computing jocabian by gradients in an for iteration is quite slow. Is there a way to use map_fn method to accelerate computing?

There is no current plan to accelerate computing jacobians. Even if while loops were fixed to be differentiable you wouldn't get a substantial speedup after graph building time, I think.

Ok, thanks.
On 8 Jun 2017 3:38 p.m., "Alexandre Passos"<EMAIL_ADDRESS>wrote:

There is no current plan to accelerate computing jacobians. Even if while
loops were fixed to be differentiable you wouldn't get a substantial
speedup after graph building time, I think.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/tensorflow/tensorflow/issues/675#issuecomment-307205652,
or mute the thread
https://github.com/notifications/unsubscribe-auth/APzAbWh0cMyai7RLWReKXpekZOYhL9iAks5sCE3SgaJpZM4G9_8_
.

I've played a bit with using while_loop to build Hessians. The graph build time is significantly reduced (about an order of magnitude). Unfortunately, the evaluation time seems to be worse (about a factor of three worse). Full details here: https://gist.github.com/tillahoffmann/003f3bcb9639a18253ec7854abcbea01 Would be nice if we could get the best of both worlds.

Hey there! I have been going through some of the solutions to compute J, however, all of them seem to be non feasible in a case where the dim of x is large. Even in the small mnist case with only 20 hidden units and a batch size of 32 it is infeasible to compute j(h, x).

@liber145 I have to compute semi-large Jacobians and am also having performance issues using a for loop.
After looking at the code by @tillahoffmann I came up with the following function, which gives a decent speedup for larger N:
def jacobian(y_flat, x):
    n = y_flat.shape[0]

    loop_vars = [
        tf.constant(0, tf.int32),
        tf.TensorArray(tf.float32, size=n),
    ]

    _, jacobian = tf.while_loop(
        lambda j, _: j < n,
        lambda j, result: (j+1, result.write(j, tf.gradients(y_flat[j], x))),
        loop_vars)

    return jacobian.stack()

In my case speed is similar to Theano's jacobian function

@jeisses, the implementation of hessians on the master branch looks very similar to the one you suggested (see here).

@tillahoffmann, yes, I did derive the function directly from that code :smile:.
But I'm looking for just a Jacobian matrix, doesn't the hessians function contain second order derivates, and still use aggregated gradients? Or could I use the hessians function for this?
Thanks

@jeisses, of course, my bad. In fact, it would be great if we could integrate your proposed Jacobian implementation and simply implement the hessian as hessian(y, x) = jacobian(gradient(f, x), x).

@shoyer  I used your version to compute the value of Jacobian passing y=model.total_loss and x=weights. The value of jacobian for different weights is exactly same as the value of gradients. Why is to so

@shaifugpt take a look to your output function,  the functions here work for a y = [y0, y1, ...], your output is surely [[y0,y1, ...]] so you can try :
def jacobian(y, x):
    y_list = tf.unstack(y[0])
    jacobian_list = [tf.gradients(y_, x)[0] for y_ in y_list]  # list [grad(y0, x), grad(y1, x), ...]
    return tf.stack(jacobian_list)

or
def jacobian(y, x, size_y):
    n = size_y
    loop_vars = [
        tf.constant(0, tf.int32),
        tf.TensorArray(tf.float32, size=n),
    ]
    _, jacobian = tf.while_loop(
        lambda j, _: j < n,
        lambda j, result: (j+1, result.write(j, tf.gradients(y[0][j], x))),
        loop_vars)
    return jacobian.stack()

where size_y is the size of the output of your model.

Hi,
I tried the suggestions. But these are errors I get.
In the first one, y_list = tf.unstack(y[0]) gives error. I am computing the
jacobian of model.total_loss wrt model.trainable_weights. So it gives
error: Index out of range using input dim 0; input has only 0 dims for
'strided_slice_4' (op: 'StridedSlice') with input shapes: [], [1], [1], [1]
and with computed input tensors: input[3] = <1>.
In the second one, model.out.shape is (40,10) where 40 is batch size and 10
is dimension. It gives error in syntax: def jacobian(y,
x,(model.output.shape):
On Tue, Sep 26, 2017 at 7:33 PM, candidj0<EMAIL_ADDRESS>wrote:

@shaifugpt https://github.com/shaifugpt take a look to your output
function, the functions here work for a y = [y0, y1, ...], your output is
surely [[y0,y1, ...]] so you can try :
def jacobian(y, x):
y_list = tf.unstack(y[0])
jacobian_list = [tf.gradients(y_, x)[0] for y_ in y_list]  # list [grad(y0, x), grad(y1, x), ...]
return tf.stack(jacobian_list)
or
def jacobian(y, x, size_y):
n = size_y
loop_vars = [
tf.constant(0, tf.int32),
tf.TensorArray(tf.float32, size=n),
]
_, jacobian = tf.while_loop(
lambda j, _: j < n,
lambda j, result: (j+1, result.write(j, tf.gradients(y[0][j], x))),
loop_vars)
return jacobian.stack()
where size_y is the size of the output of your model.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/tensorflow/tensorflow/issues/675#issuecomment-332206689,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AbjabSMFJuQqMcQ3G4sNP1hWB6ljYr34ks5smQRPgaJpZM4G9_8_
.

Sorry @shaifugpt, try this one :
def jacobian(y, x, n):
    y_list = tf.unstack(y, num = n)
    jacobian_list = [[tf.gradients(y_, x)[0][i] for y_ in tf.unstack(y_list[i])] for i in range(n)] # list [grad(y0, x), grad(y1, x), ...]
    return y_list, tf.stack(jacobian_list)

n is the batch size.

Hi
I tried your code. But I could not understand why did you unstack y i.e
model.total_loss in my case. Your code is giving error: ValueError: Invalid
axis: 0; must be in [0,0) for 'unstack_25' (op: 'Unpack') with input
shapes: []. This is because model.total_loss has shape: <tf.Tensor
'mul_1:0' shape=() dtype=float32>
On Wed, Sep 27, 2017 at 10:31 PM, candidj0<EMAIL_ADDRESS>wrote:

Sorry @shaifugpt https://github.com/shaifugpt, try this one :
def jacobian(y, x, n):
y_list = tf.unstack(y, num = n)
jacobian_list = [[tf.gradients(y_, x)[0][i] for y_ in tf.unstack(y_list[i])] for i in range(n)] # list [grad(y0, x), grad(y1, x), ...]
return y_list, tf.stack(jacobian_list)
n is the batch size.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/tensorflow/tensorflow/issues/675#issuecomment-332586492,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AbjabSyDIDMa_6sSXTL-RCxZiB5unfn-ks5smn91gaJpZM4G9_8_
.

@jeisses I am somewhat confused by the implementation because of the resulting shape of J.
According to https://en.wikipedia.org/wiki/Jacobian_matrix_and_determinant
Let f: R^n -> R^m , then the J(f) is a m * n matrix. Given, that the input has a size s, J should be a s * m * n matrix, which the implementation of @candidj0 gives us. (However, it is slow due to the for loop.)
Both solutions require the input size to be determined, i.e. [None, n] doesn't work
Setting s = 1, version one gives (1, 1, 1, 500)  and version two gives (1, 10, 500), whereas an s=20 is outputting (20, 1, 20, 500) and (20, 10, 500).
Have I missed a point somewhere in the implementation (because I really like to get that speedup)?
import tensorflow as tf
import numpy as np

def jacobian_1(y_flat, x):
    n = y_flat.shape[0]

    loop_vars = [
        tf.constant(0, tf.int32),
        tf.TensorArray(tf.float32, size=n),
    ]
    _, jacobian = tf.while_loop(
        lambda j, _: j < n,
        lambda j, result: (j+1, result.write(j, tf.gradients(y_flat[j], x))),
        loop_vars)
    return jacobian.stack()

def jacobian_2(y, x, n):
    y_list = tf.unstack(y, num = n)
    jacobian_list = [[tf.gradients(y_, x)[0][i] for y_ in tf.unstack(y_list[i])] for i in range(n)] # list [grad(y0, x), grad(y1, x), ...]
    return tf.stack(jacobian_list)

s = 1
n = 500
m = 10

x = tf.placeholder(tf.float32, [s, n])
w = tf.Variable(tf.truncated_normal([n, m], stddev=0.1))
b = tf.Variable(tf.constant(0.1, shape=[m]))
y = tf.matmul(x, w) + b

init = tf.global_variables_initializer()
sess = tf.Session()
sess.run(init)

j = jacobian_1(y, x)
j_out = sess.run(j, feed_dict={x:np.random.rand(s,n)})
print(j_out.shape)

j_2 = jacobian_2(y,x, s)
j_out = sess.run(j_2, feed_dict={x:np.random.rand(s,n)})
print(j_out.shape)

For me, I prefer computing the Jacobian matrix outside the graph using very lightweight operations.
I compute the Jacobian for each point in batches then I stack them at the end
Here is a running example based on @oborchers example:
import time
import numpy as np
import tensorflow as tf

def jacobian(session, y, x, p, batch_size):
    """The Jacobian matrix of `y` w.r.t. `x` at `p`

    Let f(x) be some function that has a Jacobian A at p
    then, f(p) = y = Ap+b
    where A of shape mxn, p of shape nx1 and b of shape mx1

    Args:
        model: A Classifier that has a graph open session
        y: The output tensor
        x: The input tensor
        p: The points of linearization
        batch_size: How many rows of the Jacobian to compute at once

    Returns:
        The Jacobian matrices for the given points
    """
    # add gradient layer to model graph only if it was not added before
    name = y.op.name.replace("/", "_")
    if not hasattr(session, name):
        g = {}
        with session.graph.as_default():
            g["mask"] = tf.placeholder(y.dtype, name="mask_" + name)
            g["grad"] = tf.gradients(g["mask"] * y, x, name="grad_" + name)[0]
            setattr(session, name, g)
    else:
        g = getattr(session, name)

    jacobian_list = []
    for i in range(p.shape[0]):
        # extract the Jacobian matrix for a single point
        batches_list = []
        point = p[i:i + 1, :]
        shape = y.shape.as_list()[1:]
        for mask in masks_batches(shape, batch_size):
            batch_size = mask.shape[0]
            feed = {g["mask"]: mask, x: np.vstack([point] * batch_size)}
            batches_list.append(session.run(g["grad"], feed_dict=feed))
        jac = np.vstack(batches_list)

        # reshape it as a matrix (not necessary but sometimes desirable)
        # you can uncomment the following line if a 2D matrix is required
        # jac = jac.reshape(jac.shape[0], -1)

        jacobian_list.append(jac)

    return np.stack(jacobian_list)

def masks_batches(shape, batch_size):
    """Batches iterator over all possible masks of the given shape

    A mask is a numpy.ndarray of shape `shape` of all zeros except
    for a single position it is one. It is useful to get those masks
    in batches instead of getting them one by one.

    Args:
        shape: The shape of each mask
        batch_size: How many masks to return in each iteration

    Returns:
        A batch of masks of shape [batch_size, *shape]
    """
    num_rows = np.prod(shape)
    if num_rows < batch_size:
        batch_size = num_rows

    _mask = np.zeros((batch_size, *shape))
    mask = _mask.reshape(batch_size, -1)

    num_batches = -(-num_rows // batch_size)
    for i in range(num_batches):
        start = i * batch_size
        end = min(start + batch_size, num_rows)

        # check if last batch is smaller than batch size
        if end - start < batch_size:
            batch_size = end - start
            _mask = np.zeros((batch_size, *shape))
            mask = _mask.reshape(batch_size, -1)

        mask[:, start:end] = np.eye(batch_size)
        yield _mask
        mask[:, start:end] = 0

if __name__ == '__main__':
    n = 500
    m = 10
    s = 20

    x = tf.placeholder(tf.float32)
    w = tf.Variable(tf.truncated_normal([n, m], stddev=0.1))
    b = tf.Variable(tf.constant(0.1, shape=[m]))
    y = tf.matmul(x, w) + b

    init = tf.global_variables_initializer()
    sess = tf.Session()
    sess.run(init)

    start = time.time()
    j_out = jacobian(sess, y, x, np.random.rand(s, n), m)
    w_out = sess.run(w)
    # they should be equal and output ~< 1e-6 (single precision)
    print(np.linalg.norm(w_out.T - np.mean(j_out, axis=0)))
    print(str(int(time.time() - start)) + " Seconds: " + str(j_out.shape))

@oborchers i don't check the time but maybe you can try :
def body(y, x, i):
    n = tf.shape(y)[0]
    loop_vars = [
        tf.constant(0, tf.int32),
        tf.TensorArray(tf.float32, size=n),
    ]
    _, jacobian = tf.while_loop(
        lambda j, _: j < n,
        lambda j, result: (j+1, result.write(j, tf.gradients(y[j], x)[0][i])),
        loop_vars)
    return jacobian.stack()

def tf_jacobian(y, x, n):
    loop_vars = [
        tf.constant(0, tf.int32),
        tf.TensorArray(tf.float32, size=n),
    ]
    _, jacobian = tf.while_loop(
        lambda i, _: i < n,
        lambda i, result: (i+1, result.write(i, body(y[i], x, i))),
        loop_vars)
    return jacobian.stack()

jacobians =  tf_jacobian(y, x, n) where n is the batch size.

@ModarTensai this is great! Thank you.
It produces an error for me, though, when m=1. I'd like to use this to produce per-example gradients of a single-valued output, so my application will have m=1 as well. Is there an easy fix you know of, before I dig in?

@aribenjamin If m = 1, w is a vector not a matrix but I fixed and updated the code
all what have been changed is line 53 from
repeated_point = np.zeros(1)

to
repeated_point = point

Thanks for noticing the bug!

@ModarTensai and @candidj0 : Awesome guys! You rock, thank you! I'll test them over the weekend and see how they work on a toy dataset.

There are no built-in jacobians in TensorFlow, instead anything called
'grad' or 'gradient' computes Jacobian-vector product (also called LOp in
theano),

Sanity checking, but LOp is vector-Jacobian product, not Jacobian-vector product, correct?

Nobody seems to have posted any followup, but the codes proposed by @candidj0 and @jeisses do not work when nested (testing in tensorflow 1.5.0). So computing the hessian by nesting will not work (@tillahoffmann). Let me make this a bit more concrete. I am using the jacobian
def map(f, x, dtype=None, parallel_iterations=10):
    '''
    Apply f to each of the elements in x using the specified number of parallel iterations.

    Important points:
    1. By "elements in x", we mean that we will be applying f to x[0],...x[tf.shape(x)[0]-1].
    2. The output size of f(x[i]) can be arbitrary. However, if the dtype of that output
       is different than the dtype of x, then you need to specify that as an additional argument.
    '''
    if dtype is None:
        dtype = x.dtype

    n = tf.shape(x)[0]
    loop_vars = [
        tf.constant(0, n.dtype),
        tf.TensorArray(dtype, size=n),
    ]
    name = str(random.randint(1,<PHONE_NUMBER>))
    _, fx = tf.while_loop(
        lambda j, _: j < n,
        lambda j, result: (j + 1, result.write(j, f(x[j]))),
        loop_vars,
        parallel_iterations=parallel_iterations,
        name=name
    )
    return fx.stack()

def jacobian(fx, x, parallel_iterations=10):
    '''
    Given a tensor fx, which is a function of x, vectorize fx (via tf.reshape(fx, [-1])),
    and then compute the jacobian of each entry of fx with respect to x.
    Specifically, if x has shape (m,n,...,p), and fx has L entries (tf.size(fx)=L), then
    the output will be (L,m,n,...,p), where output[i] will be (m,n,...,p), with each entry denoting the
    gradient of output[i] wrt the corresponding element of x.
    '''
    fx_vec = tf.reshape(fx, [-1])
    return map(lambda fxi: tf.gradients(fxi, x, name=name)[0],
               fx_vec,
               dtype=x.dtype,
               parallel_iterations=parallel_iterations)

I am using this because it supports dynamic sizes, that is, one of the dimensions can be None.
However, this simple test
    import numpy
    from numpy.random import randn

    numpy.random.seed(0)

    x = randn(3, 3)
    A = randn(2, 3)
    xtf = tf.constant(x, tf.float64)
    Atf = tf.constant(A, tf.float64)
    y = tf.matmul(tf.matmul(Atf, xtf), xtf)
    with tf.Session() as sess:
        # print(sess.run(Ax))
        dydx = jacobian(y, xtf)
        print(sess.run(dydx))
        d2ydx2 = tf.squeeze(jacobian(dydx, xtf))
        print(sess.run(d2ydx2))

throws the error
ValueError: Cannot use 'while_1/while/gradients/f_count_1' as input to 'while_1/while/gradients/f_count' because they are in different while loops. See info log for more details.
Does anybody know the issue here?
The first jacobian is correct. The second one (essentially the hessian) does not.

I just tested the previous code on the nightly Docker build, and the error remains.

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

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

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

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

@mholzel I wanted to thank you for that jacobian implementation, seems to work perfectly for a problem I am working on. In my opinion, this capability should be pushed to the main TensorFlow branch, as it is useful in many problems.

@mholzel Have you found how to nest while loop to make it work?

No. It seems like a really subtle bug in either the gradient or while loop implementation. That requires somebody with a lot more knowledge than me about what is going on there

damn, thanks anyway... Is there anyone that can help? maybe we can bother @ovrebdo?

@marcociccone in TF 1.4 seems to be working fine, if this is an alternative for you.

This is indeed a bug in TF. It's caused by taking the gradient(y, x) inside a while loop wrt such that the computation of y from x goes through a different while loop, something like:
x = ...
y = while_loop(..., [x])
z = while_loop(..., tf.gradients(y, x), [y])

So in @mholzel's script, it's from passing the outcome of one jacobian call to the other jacobian call. (BTW, thanks very much for the easy repro.)
Unfortunately this is quite tricky to fix. I'll try to take another look at it tomorrow and see if I can come up with something.

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

@mholzel for the double jacobian, suppose you just map to tf.hessian instead of tf.gradient. Doesn't solve to arbitrary order but it does get the hessian of a tensor wrt variables.

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

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

There is now an experimental new approach to doing Jacobians here:
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/parallel_for/gradients.py#L28

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

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

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

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

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

There is now an experimental new approach to doing Jacobians here:
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/parallel_for/gradients.py#L28

Did anyone compare the performance of the new functionality and the previous solution posted by @mholzel here? I am finding the new jacobian included in gradients.py way slower than @mholzel solution...

There is now an experimental new approach to doing Jacobians here:
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/parallel_for/gradients.py#L28

Did anyone compare the performance of the new functionality and the previous solution posted by @mholzel here? I am finding the new jacobian included in gradients.py way slower than @mholzel solution...

gradients_test.py in the same file has some benchmarks that show that pfor based jacobian generally works much faster than a while loop based one. Can you share your benchmark ?

I threw together this function, it uses tf.map_fn and assumes a batch style input, but at least it works for batches. It's pretty high level but seems to adress some of the ideas if the conversation above:
def Jacobian(X, y):
    J = tf.map_fn(lambda m: tf.gradients(y[:,:,m:m+1], X)[0], tf.range(tf.shape(y)[-1]), tf.float32)
    J = tf.transpose(tf.squeeze(J), perm = [1,0,2])
    return J
```

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

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

@zackchase Is this resolved? Please close If it was resolved already. Thanks!

tf.GradientTape.jacobian and tf.GradientTape.batch_jacobian APIs have been added for computing Jacobians. These are based on experimental pfor logic which can also be disabled to fallback to loop based implementation.


add optional expiration date to cleezy

Synchronized time formatting to '%Y-%m-%dT%H:%M:%S.
Added expiration date column to db table (OPTIONAL PARAMETER, SHOULD WORK EITHER WAY)
Auto delete on next URL request if expiration date is invalid
Some inconsistencies with timestamp formatting when I tested with Postman but I didn't know how to fix, small detail to clean up

done


Euphoria classes are not working in v1.0.2802

Euphoria classes aren't working at all (just do some relax ragdoll) because R* changed how to get event indices in v1.0.2802 (no longer call the virtual function at the vtable of CEvent + 0x18 at least). Need to figure out how they get event indices now.
https://github.com/crosire/scripthookvdotnet/blob/3fe2bd4f021735affeb2992464aa1c29aba988bb/source/core/NativeMemory.cs#L4138

I figure out new offset is at CEvent + 0x48. I'm struggling how to find the offset in case they add or remove virtual functions again, though.

Closing as 59afba0 fixes this issue.


replace main() with run()

https://github.com/kurtosis-tech/kurtosis/issues/425

depends on https://github.com/kurtosis-tech/kurtosis/pull/475


Fix etcd as a backend store support

See commit messages for more info.

LGTM when CI happy

LGTM.
Thanks @abronan @mrjana !!!!


Wrong Link

On the section:
Use Azure Arc-enabled servers
This method supports managing the installation, management, and removal of VM extensions from the Azure portal, using PowerShell, the Azure CLI, or with an Azure Resource Manager (ARM) template.
All of these links refer to the Log Analytics agent rather than AMA.

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

ID: bfea7a35-9f9f-95f1-851a-41be94dcc9a4
Version Independent ID: a8309211-0ba7-70a8-2e85-07379fb12c09
Content: Deploy Azure Monitor agent on Arc-enabled servers - Azure Arc
Content Source: articles/azure-arc/servers/concept-log-analytics-extension-deployment.md
Service: azure-arc
Sub-service: azure-arc-servers
GitHub Login: @johnmarco
Microsoft Alias: johnmarc

@lanicolas Thanks for your comment! We will review and provide an update as appropriate.

Hello @lanicolas . Regarding this issue, the links aren't actually wrong; they simply point to docs that say how to manage extensions on Arc-enabled machines, including the AMA. I'm making a slight addition to the text that might help clarify that point. I will now close this issue.

#please-close


Add support for next_day function

As per the Presto docs, the next_day functionality is presently not supported in presto which is supported in other engines like postgres and hive where it gives the next date for a particular day of the week as shown below:
postgres=> select next_day(timestamp'1991-02-04 00:00:00.000', 'SUNDAY');
      next_day
---------------------
 1991-02-10 00:00:00
(1 row)

I would like to work on this

@electrum can you comment on the proposed syntax?

The Oracle syntax seems fine. The day should be matched case insensitive. The returned date is the next day after the provided date or timestamp (important when the date is already that day of the week).
One thought is that the day argument will usually be static, so we could have fixed variants like next_sunday. These would be faster (at least until we support specialization based on constant arguments) and more convenient for users.

@fornaix you can submit the PR if you are done working on this issue.

@electrum so you mean we can have have 7 variants of the the function next_day with just one parameter instead of having same function with 2 parameters in the form of date and day of the week.

We can start with the next_day function, but consider later adding the 7 variants for fixed data.

The Oracle syntax seems fine. The day should be matched case insensitive. The returned date is the next day after the provided date or timestamp (important when the date is already that day of the week).

@electrum are we done with syntax-needs-review?


PyAudio==0.2.14 is not getting installed

PyAudio==0.2.14 is not getting installed from Cloud9 EC2 instance and throwing errors continuously .
Error Code -       error: command '/usr/bin/gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for PyAudio
Failed to build PyAudio
ERROR: Could not build wheels for PyAudio, which is required to install pyproject.toml-based projects

Same here not able to install it .Any options to fix it.

On Linux, try to install
sudo apt-get install libasound-dev portaudio19-dev libportaudio2 libportaudiocpp0

On Mac, try to install
brew install portaudio


Syncing message when app is coming from backgroud

keeping it open for master merge.

[ ] on List View
[ ] on Chat View
[ ] on 3rd Party View


ObjectDisposedException when getting the Uri of an encrypted video

This code will throw an ObjectDisposedException in libvideo 1.3.0:
string uri = "https://www.youtube.com/watch?v=NUsoVlDFqZg";
var video = YouTube.Default.GetVideo(uri);
string result = video.Uri; // right here

Why? The gist of it is: when we run GetVideo, we create a new HttpClient to visit YouTube. After getting the source code of the page, we dispose the HttpClient so we don't leak resources.
Next, when we try getting the Uri, we have to visit another webpage if the video is encrypted. To avoid wasting resources, we try to reuse the HttpClient we just used to go to YouTube. Except we just disposed it.
Now once we try to use the HttpClient again, it realizes it's disposed and throws an ObjectDisposedException.
Oops.

Potential fixes:

Use VideoClient to visit the new webpage. While this would be neater and less code, it may not be a good solution because VideoClient is mainly intended for downloading the video binaries. The HTTP configurations (see bottom) you may want to make for a VideoClient may not apply for text-based files.

Create a new HttpClient each time a URL is decrypted. While is one of the simpler solutions, this may not be such a good idea. Consider the following code:

var videos = YouTube.Default.GetAllVideos("...");
var uris = videos.Select(v => v.Uri);

Seems innocuous, right? Well, pretend the video is encrypted. If we chose this option, and the video had, say 7 URLs to decrypt, then 7 new HttpClients would be created. This is definitely not good for performance.

Eagerly decrypt the URLs. Also a simple solution, but with big reprecussions. If we did this and the video is encrypted, then a simple line like YouTube.Default.GetVideos("...") will automatically decrypt all of the URLs. Basically, 7 HTTP requests. Even if we only needed 1, and didn't care about the other 6.

Alright, so those are the options I've come up with so far. At this moment I think 1) seems to be the best choice, it might not be so bad to share some HTTP configurations in VideoClient. If anyone else managed to understand that, feel free to suggest any alternatives/give your opinion. I'll be fixing this issue by tomorrow evening.

@jamesqo Wonderful!

Fixed! 0246ce6. Try downloading v1.3.1.

Hey just updated, it's working awsome thanks :+1:

@narqs Awesome, great to know! Contact me if you have any more issues :wink:


numpy import error On Ubuntu Linux version 24.04

File "/usr/lib/python3/dist-packages/matplotlib/transforms.py", line 49, in
from matplotlib._path import (
ImportError: numpy.core.multiarray failed to import
Error: importing radae_txe

Please run the script again carefully following every step of the instructions.
Several Ubuntu-24.04 installs have been done recently without issue.
If there is still a problem run the script again with:
$ freedv-rade-build/freedv-rade-build | tee freedv-rade-build.log
Attach the freed-rade-build.log here. Thanks.


Monthly payment worksheet: link fixes

Change links to the worksheet so they go to the new page instead of the pdf
Changes

change MPW links (on owning-a-home, owning-a-home, and owning-a-home/process/sources) to go to the worksheet page instead of pdf
fix typo on MPW

Review

@cfarm or @amymok

Screenshots
Typo:

Fixed:

Checklist

[ ] Changes are limited to a single goal (no scope creep)
[ ] Code can be automatically merged (no conflicts)
[ ] Code follows the standards laid out in the front end playbook
[ ] Passes all existing automated tests
[ ] New functions include new tests
[ ] New functions are documented (with a description, list of inputs, and expected output)
[ ] Placeholder code is flagged
[ ] Visually tested in supported browsers and devices
[ ] Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)

Looks good to me!

Thanks, @amymok!


[Question]: What is the recommended approach for using Lambda?

Type: Question
I don't see a spring-cloud-aws-starter-lambda project, and am wondering, what is the recommended way to integrate Lambda that is compatible with Spring Cloud AWS 3.x?

Which integration specifically do you have in mind? Have you had a look at https://github.com/spring-cloud/spring-cloud-function?
Let me convert this issue to discussion


Added    CONTRIBUTING.MD  &  CODE_OF_CONDUCT.MD    files to the repository

Hey @codingkatty , as per our discussion in issue #86 , I have added both Contributing.md and Code_of_Conduct.md files in the repository with short, precise and user friendly description.
I hope it gets merged,
Best Wishes.

@codingkatty Done !


RouteExists thrown when registering a directory and a missing file to the same route.

https://github.com/sanic-org/sanic/issues/2132

Not related to routing.


Error DOMException in v1.0.6

Hi,
I currently have an issue with version 1.0.6.
The module worked in version 1.0.4 but after update, I have the following error:
Blocked a frame with origin "http://url" from accessing a cross-origin frame

I went back to version 1.0.4 for now.
Does anybody have a similar issue ?
Sincerely

Hey, are you using rawgit for the plugin? That's the only reason I can think about right now.

Hi, no i use npm and the default vue-cli webpack templates to build my project

can you give a minimal reproduction example?

Did you resolve it / make any progress on this?

Closing as cannot reproduce.


handling floats for tolerance

This line seems to be a mistranslation of the JavaScript version:
$sqTolerance = (int)$tolerance == $tolerance ? $tolerance*$tolerance : 1;

If a float is passed for $tolerance, then it will be ignored and the default value of 1 will be used instead. Shouldn't it just be this?
$sqTolerance = $tolerance * $tolerance;

The test in the JavaScript original is just to handle the default value, but PHP handles that automatically.

+1

Valid point, fixed that in last commit


feat: add #[pyo3(from_item_all)] for FromPyObject

This PR addresses #3112 by implementing #[pyo3(item_all)] #[pyo3(from_item_all)].

I think UI tests exercising the error paths would be good to have here.

I've noticed that, and I'll figure out how to fix the tests and improve coverage today (that's why I marked this as a draft) (^^)

It looks like you may have run the UI tests with nightly Rust? Quite a few spans have changed. Suggest rebuilding with stable.
Overall I'm happy for this functionality although I'm unsure about the name item_all. I understand why you chose it though it's not immediately intuitive to me as a reader what it means.
I wonder if something like all_from_items or from_item_all are any clearer? I don't love those either so happy for further suggestions!

I personally perfer from_item_all, since that's similar to get_all and set_all which we already have.
I'll update the PR again once I can continue to work on it.

It seemed that I forgot some paths in the UI tests. I'll address them soon.
I'm uncertain about the name too. from_items or something like that seems okay to me.
I'm thinking about the divergence in behavior from get_all and set_all, which don't allow specifying the name with get, name = ..., so that seems inconsistent. However, I think allowing specifying args passed to get_item is still useful. Maybe I could separate that to an extra proposal along with changes to get_all and set_all?

I'm thinking about the divergence in behavior from get_all and set_all, which don't allow specifying the name with get, name = ..., so that seems inconsistent.

This is a good point and something we overlooked when originally implementing get_all and set_all, it would be nice to allow them to accept #[pyo3(name = ...)] on individual fields.

Ugh. I didn't manage to make coverage rate pass codecov's check. Are declarative macro invocations blocking llvm-cov to pick them up?


Feature suggestion

1、Dragging moves the player without holding middle mouse.
2、Hide to the edge of the screen and automatically show when the mouse is moved over it.
3、Automatically display a larger image when the mouse is over an album image, just like Deskband Controls (a foobar component).
4、Add button to close foobar

I think middle mouse to move was used to avoid accidental movement, there may have been a technical reason too but I can't remember. I agree it's not a user friendly choice, I'll investigate this point.
On point two and three, I'm very hesitant to add these features. The app is designed to be simple and unobtrusive, I don't want it jumping around every time I move the mouse near it.
If we want a close button, I think the anticipated behaviour would be closing the miniplayer and leaving foobar open. You can click the album artwork to focus foobar and close it normally, I find this to be a satisfactory method.

On point two, I think having the opacity reduced until mouse over might be an idea

I think middle mouse to move was used to avoid accidental movement, there may have been a technical reason too but I can't remember. I agree it's not a user friendly choice, I'll investigate this point.
On point two and three, I'm very hesitant to add these features. The app is designed to be simple and unobtrusive, I don't want it jumping around every time I move the mouse near it.
If we want a close button, I think the anticipated behaviour would be closing the miniplayer and leaving foobar open. You can click the album artwork to focus foobar and close it normally, I find this to be a satisfactory method.

Thanks for your reply, maybe I didn't make it clear, what I meant was to use the left mouse button instead of the middle mouse button. Points 2 and 3 are no problem, because other players are like this, adding the close button is mainly for convenience, otherwise when you exit the player, you need to close it twice.

5、Need more detailed color settings, because when I try to change the background color, it doesn't work at all, I need to change the black part to blue and the text part to black.

Yeah, I understand the request. I made this choice a long time ago and I'm pretty sure that was the behaviour I originally wanted but there was some good reason that I didn't use left mouse.
I'll investigate and get back to you with either the change or detail exactly why it's like that.
For point five, please send a screenshot with settings fg_col=#000000, alpha=1.0 and bg_col=#0000ff.

Yeah, I understand the request. I made this choice a long time ago and I'm pretty sure that was the behaviour I originally wanted but there was some good reason that I didn't use left mouse.
I'll investigate and get back to you with either the change or detail exactly why it's like that.
For point five, please send a screenshot with settings fg_col=#000000, alpha=1.0 and bg_col=#0000ff.
Well, too few settings options.

I'd like to stick to only foreground and background colour for the sake of simplicity but I can certainly make the button background colours adjust to the bg_colsetting if they aren't doing that already.


Uncaught Error: Missing required parameters: sitekey

I get this error when I refresh my page which has Reaptcha component. Here is my code snippet. I confirmed that sitekey is being passed correctly to the component when I refresh the page.
                <Reaptcha style={{ margin: "20px" }}
                    ref={e => this.recaptchaInstance = e}
                    sitekey={process.env.REACT_APP_CAPTCHA_SITEKEY}
                    onLoad={() => { }}
                    onVerify={this.captchaCallback}
                    onExpire={this.captchaExpiredCallback}
                />

@sachinsawant71 What happens when you pass sitekey explicitly? (not via process.env.REACT_APP_CAPTCHA_SITEKEY})

I tried it too. I hardcoded the site key into the component property but I am still getting same error.

@sachinsawant71 Do you have a <script /> with Google reCAPTCHA in your site? If yes, delete it. Reaptcha injects the Google script by itself.

Thanks a lot. I had script for Google reCAPTCHA in the index.html. I removed it and it started working after "Refresh" too.

Awesome! :)

Confirmed. I had same issue after struggling to get recaptcha to work on my own, but finally  switching to use Reaptcha.  Thanks to google for redirecting me to this issue and for the quick resolution :).


Update configuring-additional-lsa-protection.md

adding clarifying statement:
It is not sufficient for the module to be signed by a private certification authority. It needs to be signed by Microsoft via the above partner program.

#assign: @robinharwood, @Xelu86
@robinharwood @Xelu86
Can you review the proposed changes?
#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team


Menu for copy code to clipboard.

I had a old prettivy code that placed above the code a menu bar so you could
copy the code to the clipboard , is that gone?

See attachment.

Original issue reported on code.google.com by<EMAIL_ADDRESS>on 10 Nov 2013 at 8:34
Attachments:

bar.png

I don't think this was ever in google-code-prettify, you must have been using another library.
Of course you can always do this yourself with a bit of Javascript to add such a menu to every pre/code blocks.


Added a new route to DELETE an existing user

This PR includes the following additions and improvements for both the Community and Enterprise Edition's Admin Dashboard page:

[x] Added a new route to the table for deleting an existing user.
[x] Rectified the description for "Deleting pending invites" and changed "self-hosted instance" to "instance."
[x] Added an info card below the User Management APIs table.
[x] Fixed a minor character issue in the InfraTokens section.

HSB-478


Update concepts/storage/volumes.md

Resolves #27234

Direct link to the preview: https://deploy-preview-27235--kubernetes-io-master-staging.netlify.app/docs/concepts/storage/volumes/#background

Kubernetes supports many types of volumes. A Pod can use any number of volume types simultaneously. Ephemeral volume types have a lifetime of a pod, but persistent volumes exist beyond the lifetime of a pod. When a pod ceases to exist, Kubernetes destroys ephemeral volumes; however, Kubernetes does not destroy persistent volumes.

/sig storage

@sftim I reflected your suggestion, squashing 2 commits into one. :)

/lgtm

/approve


JSON type

Search Terms

JSON

Suggestion
Type annotation for JSON in a string.
Use Cases
Let's say you have a string which contains valid JSON object, like so:
const json = '{"hello": "world"}';

How can you type annotate the json variable? Currently, you can mark it as a string:
const json: string = '{"hello": "world"}';

Instead there could be some TypeScript language feature that helps with typing JSON in a string more precisely, for example:
const json: JSON {hello: string} = '{"hello": "world"}';

Examples
Specify that string contains valid JSON.
let json: JSON any;
let json: JSON; // shorthand

Add typings to an HTTP response body.
let responseBody: JSON {ping: 'pong'} = '{"ping": "pong"}';

Add type safety to JSON.parse() method.
let responseBody: JSON {ping: 'pong'} = '{"ping": "pong"}';
let {ping} = JSON.parse(responseBody);
typeof ping // 'pong'

JSON cannot contain complex types.
type Stats = JSON {mtime: Date}; // Error: Date is not a valid JSON type.

Doubly serialized JSON.
let response: JSON {body: string} = '{"body": "{\"userId\": 123}"}';
let fetchUserResponse: JSON {body: JSON {userId: number}} = response;

Get type of serialized JSON string using jsontype keyword.
type Response = JSON {body: string, headers: object};
type ResponseJson = jsontype Response; // {body: string, headers: object}
type ResponseBody = ResponseJson['body']; // string
type ResponseBody = (jsontype Response)['body']; // string

Specify that variable is JSON-serializable.
let serializable: jsontype JSON = {hello: 'world'};
JSON.serialize(serializable); // OK

let nonserializable: object = {hello: 'world'};
JSON.serialize(nonserializable); // Error: 'nonserializable' might not be serializable.

Checklist
My suggestion meets these guidelines:

[x] This wouldn't be a breaking change in existing TypeScript / JavaScript code
[x] This wouldn't change the runtime behavior of existing JavaScript code
[x] This could be implemented without emitting different JS based on the types of the expressions
[x] This isn't a runtime feature (e.g. new expression-level syntax)

Syntax Alternatives
type ResponseRaw = JSON {ping: 'pong'};
type ResponseRaw = json {ping: 'pong'};
type ResponseRaw = string {ping: 'pong'};
type ResponseRaw = json_string {ping: 'pong'};
type ResponseRaw = JSON<{ping: 'pong'}>;
type ResponseRaw = JSON({ping: 'pong'});

type Response = jsontype Response; // {ping: 'pong'}
type Response = typeof Response; // {ping: 'pong'}
type Response = parsed(Response); // {ping: 'pong'}

It seems like you want, generally, refinements on string types. In the vein of #6579 (for specifically regex refinements) or #4895 (for arbitrary nominal refinements).

@weswigham refinements on string type, yes, but this proposal deals specifically with JSON.

What are the use cases for writing JSON strings in code instead of writing them as parsed literals?

@RyanCavanaugh I have plenty of mock data for tests as JSON in strings, when you receive response from and API it could be JSON in a string, when you read from a file it could be .json. I'm sure there a re plenty more examples.

What I mean is, if you're writing the code, why are you writing them in the error-prone "{ 'x': 'y'}" form instead of the easier { x: 'y' } form? I

@RyanCavanaugh I am not, but sometimes you receive your data in that form and you have to deal with it. For example, here is a typical AWS SQS message example:
{
  "Messages": [
    {
      "Body": "{\n  \"Message\" : \"{\\\"assetId\\\":14,\\\"status\\\":\\\"Uploading\\\",\\\"updatedAt\\\":\\\"2018-10-16T08:47:43.538Z\\\"}\",\n }"
    }
  ]
}

(I have removed some fields for brevity. Also, I hope all the escapings are correct. :) )
The above is basically dobly-serialized JSON in Messages[0].Body field. I have no control of this format, but I would like to type annotate it somehow. For example it could be done like so:
interface Response {
  Messages: ({
    Body: JSON {
      Message: JSON {
        assetId: number;
        status: string;
        updatedAt: string;
      }
    }
  })[];
}

sometimes you receive your data in that form

Makes sense - but in that case, we can't really do any valuable typechecking of that JSON at compile-time. Or are you saying you're copying the JSON responses into your test files? Just trying to understand

... we can't really do any valuable typechecking of that JSON at compile-time.

Sure, but code can be annotated at dev time so developer can get all the code completion and error messages that are obvious from static code analysis. For example:
JSON.parse(JSON.parse(JSON.parse(message).Body).Message).assetId; // OK
JSON.parse(JSON.parse(JSON.parse(message).Body).Message).oops; // Error: ...

Or are you saying you're copying the JSON responses into your test files?

Yes.

SO you're saying it's be useful coupled with a JSON.parse overload along the lines of
declare function parse<T>(string: JSON T): T;

@weswigham exactly!

Along the lines of what people have said in #4895, you can get pretty close with branded strings today:
type JSONString<T> = string & { " __JSONBrand": T };
function parse<T>(str: JSONString<T>): T { return JSON.parse(str as string) as any; };
let responseBody = '{"ping": "pong"}' as JSONString<{ping: 'pong'}>;
parse(responseBody).ping; // OK

there's no automatic creation of them and no automatic validation that your string actually meets the constraint you want the type to imply, but you can flow the type around, at least.

declare function serialize<T>(obj: jsontype T): T;

@weswigham How would you annotate JSON.stringify method using branded strings?

OK, if anyone is interested, here is what I did:
type JSON<T> = string & {__JSON__: T};
type JSONParse = <T>(str: JSON<T>) => T;
type JSONStringify = <T>(obj: T) => JSON<T>;

const JSONSTR: {
  parse: JSONParse;
  stringify: JSONStringify;
} = {
  parse: (...args) => JSON.parse(...args),
  stringify: (...args) => JSON.stringify(...args) as any,
};

Autocompletion works:

Autocompletion for above mentioned example works:

BTW, create this tiny NPM package if anyone needs branded JSON strings:
https://github.com/streamich/ts-brand-json

It is faster to use JSON.parse of a string literal than to use a JSON object literal:
https://v8.dev/blog/cost-of-javascript-2019#json
So this feature is now a bit more useful (although it is better if the compiler will generate the JSON.parse itself when it sees a JSON literal)


Release v0.0.8

What this PR does / why we need it
Which issue(s) this PR fixes

Fixes #
Special notes for your reviewer
Does this PR introduce a user-facing change?

None

/lgtm
/approve
/kind documentation


docker Jira Endless Loop: StoryDataClientImpl

Before I added the JIRA_PAGE_SIZE=10, I was gettting a socket timeout error. However, when I added this environment variable, it goes in an endless loop through pages 10 by 10 and the data is still not populated in the dashboard.
hygieia-jira     | 2017-12-08 16:11:00,012 INFO  c.c.d.collector.CollectorTask - ------------------------------- ----
hygieia-jira     | 2017-12-08 16:11:00,013 INFO  c.c.d.collector.CollectorTask - https://{mycompany}/jira
hygieia-jira      | 2017-12-08 16:11:00,013 INFO  c.c.d.collector.CollectorTask - ------------------------------- ----
hygieia-jira      | 2017-12-08 16:11:00,027 INFO  c.c.d.collector.CollectorTask - Team Data               0         0s
hygieia-jira      | 2017-12-08 16:11:01,739 INFO  c.c.d.collector.CollectorTask - Project Data           62         1s
hygieia-jira      | 2017-12-08 16:11:06,617 INFO  c.c.d.c.story.StoryDataClientImpl - Loop i 0 pageSize 10
hygieia-jira      | 2017-12-08 16:11:10,339 INFO  c.c.d.c.story.StoryDataClientImpl - Loop i 10 pageSize 10

My docker-compose:
hygieia-jira-feature-collector:
  image: hygieia-jira-feature-collector:latest
  container_name: hygieia-jira
  links:
  - mongodb
  - hygieia-api
  environment:
  - JIRA_BASE_URL=https://{mycompany}.com/jira
  - JIRA_CREDENTIALS={base64Credentials}
  - JIRA_ISSUE_TYPE_NAMES=Story
  - MONGO_PORT=tcp://mongodb:27017
  - JIRA_PAGE_SIZE=10

Hi @DimsumPanda,
Could you please try again with all these properties below and let us know if it works for you? Thanks !
PageSize - Expand contract this value depending on Jira implementation's
default server timeout setting (You will likely receive a SocketTimeoutException)
pageSize=100
queryFolder=jiraapi-queries
storyQuery=story
epicQuery=epic
Add these if you are using a proxy
jiraProxyUrl=
jiraProxyPort=
jiraBaseUrl=
jiraQueryEndpoint=rest/api/2/
For basic authentication, requires username:password as string in base64
This command will make this for you:  echo -n username:password | base64
jiraCredentials=
jiraIssueTypeNames=Story
#############################################################################
In Jira, your instance will have its own custom field created for 'sprint' or 'timebox' details,
which includes a list of information.  This field allows you to specify that data field for your
instance of Jira. Note: You can retrieve your instance's sprint data field name
via the following URI, and look for a package name com.atlassian.greenhopper.service.sprint.Sprint;
your custom field name describes the values in this field:
https://[your-jira-domain-name]/rest/api/2/issue/[some-issue-name]
#############################################################################
jiraSprintDataFieldName=customfield_10007
#############################################################################
In Jira, your instance will have its own custom field created for 'super story' or 'epic' back-end ID,
which includes a list of information.  This field allows you to specify that data field for your instance
of Jira.  Note:  You can retrieve your instance's epic ID field name via the following URI where your
queried user story issue has a super issue (for example, epic) tied to it; your custom field name describes the
epic value you expect to see, and is the only field that does this for a given issue:
https://[your-jira-domain-name]/rest/api/2/issue/[some-issue-name]
#############################################################################
jiraEpicIdFieldName=customfield_10003
#############################################################################
In Jira, your instance will have its own custom field created for 'story points'
This field allows you to specify that data field for your instance
of Jira.  Note:  You can retrieve your instance's storypoints ID field name via the following URI where your
queried user story issue has story points set on it; your custom field name describes the
story points value you expect to see:
https://[your-jira-domain-name]/rest/api/2/issue/[some-issue-name]
#############################################################################
jiraStoryPointsFieldName=customfield_10004
#############################################################################
In Jira, your instance will have its own custom field created for 'team'
This field allows you to specify that data field for your instance
of Jira.  Note:  You can retrieve your instance's team ID field name via the following URI where your
queried user story issue has team set on it; your custom field name describes the
team value you expect to see:
https://[your-jira-domain-name]/rest/api/2/issue/[some-issue-name]
#############################################################################
jiraTeamFieldName=customfield_11248
Set this to true if you use boards as team
jiraBoardAsTeam=true
Thanks !


losing selection when page change

Hello,
I am using smart table to fetch data from the server.
<ng2-smart-table [settings]="settings" [source]="source" (userRowSelect)="changeSelection($event)"></ng2-smart-table>
changeSelection(event){
 event.selected.forEach(element => {
      this.selectedRows.push(element.code);
});
}

when I click to a new page the event parameter is empty and when I go back to the initial page I found that the rows are not selected anymore.
Please I need your help.

As per angular docs, when the component loads the constructor and then
onInit function runs. It seems that your data is loaded on or after these
function and hence when you traverse back the event data is empty. You will
have to use some service to perform the operation if you wish to conserve
the data
On Sep 8, 2017 18:19, "FARHANE"<EMAIL_ADDRESS>wrote:
Hello,
I am using smart table to fetch data from the server.
<ng2-smart-table [settings]="settings" [source]="source" (userRowSelect)="
changeSelection($event)">
changeSelection(event){
event.selected.forEach(element => {
this.selectedRows.push(element.code);
});
}
when I click to a new page the event parameter is empty and when I go back
to the initial page I found that the rows are not selected anymore.
Please I need your help.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/akveo/ng2-smart-table/issues/525, or mute the thread
https://github.com/notifications/unsubscribe-auth/AWRxgKgzBONZaxhk4dE3ejxg1Lem05cnks5sgTfsgaJpZM4PRIuV
.

@ronit123321 Could you go into a little more detail? Saying "Use a Service!" isn't very helpful...

It's not a good idea to call canstructor each time you click on a page number.

It's not a good idea to call canstructor each time you click on a page number.

Hi @FARHANE  Did you find any solution to this problem? thanks!

Hi @FARHANE
Is it possible to call click event onchange of each page in angular smart table?

Hi @FARHANE
Is there any way to add events dynamically for angular smart table for pagination?


Extend OpenAPI docs for bus API

Routes added:

[x] /contract
[x] /hosts
[x] /host
[x] /metric
[x] /multipart
[x] /objects
[x] /object
[x] /params
[x] /slabbuffers
[x] /sectors
[x] /settings
[x] /slabs
[x] /state
[x] /stats
[x] /system
[x] /upload
[x] /webhooks

@ChrisSchinnerl now has all routes, would like to F/U with a PR where I go over all routes in an editor and see what's missing


Update list onchain balance response to return both total and spendable

currently it shows 0 sats if we are waiting for an onchain confirmation of the balance, which is a poor UX

oops, duplicate of https://github.com/getAlby/nostr-wallet-connect-next/issues/110