handling closed connections in ws_handler

I recently noticed that if a connection closes abnormally (and additionally is one that websockets is aware of), then ws_handler on the server side just continues running normally. This can create a problem by leaving protocol objects on the server-side running for longer than they need to be.
I sort of expected in this case that the server would send CancelledError in to ws_handler to notify the handler that there is no longer a connection to be handled.
I'm wondering then if it would make sense for websockets to send CancelledError in this case. If not, what is the right way for a ws_handler to "subscribe" to or be notified of the connection closing? It would be much better for ws_handler e.g. to be able to register a callback on a future rather than having to, say, check that protocol.open is true at regular intervals.
Here is example code to illustrate the issue:
def log(msg):
    print(f'****: {msg}')

async def fail_connection(protocol):
    await asyncio.sleep(5)
    log('failing connection')
    await protocol.fail_connection()

async def handle_connection(protocol, path):
    asyncio.ensure_future(fail_connection(protocol))
    try:
        while True:
            await asyncio.sleep(1)
            log('still handling connection')
    finally:
        log('exiting handle_connection()')

async def run_client():
    async with websockets.connect('ws://localhost:8765'):
        print('client connected')
        await asyncio.sleep(10)

    print('client exiting')

async def run():
    async with websockets.serve(handle_connection, 'localhost', 8765):
        await run_client()

And here are the logs:
client connected
INFO:asyncio:poll 998.616 ms took 1003.063 ms: timeout
****: still handling connection
INFO:asyncio:poll 999.874 ms took 1004.412 ms: timeout
****: still handling connection
INFO:asyncio:poll 999.875 ms took 1003.993 ms: timeout
****: still handling connection
INFO:asyncio:poll 999.880 ms took 1004.832 ms: timeout
****: still handling connection
****: failing connection
DEBUG:websockets.protocol:server ! failing WebSocket connection: 1011
DEBUG:websockets.protocol:server > Frame(fin=True, opcode=8, data=b'\x03\xf3', rsv1=False, rsv2=False, rsv3=False)
DEBUG:asyncio:poll 15.719 ms took 0.015 ms: 1 events
DEBUG:websockets.protocol:client < Frame(fin=True, opcode=8, data=b'\x03\xf3', rsv1=False, rsv2=False, rsv3=False)
DEBUG:websockets.protocol:client > Frame(fin=True, opcode=8, data=b'\x03\xf3', rsv1=False, rsv2=False, rsv3=False)
DEBUG:websockets.protocol:server < Frame(fin=True, opcode=8, data=b'\x03\xf3', rsv1=False, rsv2=False, rsv3=False)
DEBUG:websockets.protocol:server x half-closing TCP connection
DEBUG:asyncio:poll 14.151 ms took 0.010 ms: 1 events
DEBUG:asyncio:<_SelectorSocketTransport fd=12 read=polling write=<idle, bufsize=0>> received EOF
DEBUG:websockets.protocol:client - eof_received()
DEBUG:websockets.protocol:client - connection_lost(None)
DEBUG:asyncio:<_SelectorSocketTransport fd=13 read=polling write=<idle, bufsize=0>> received EOF
DEBUG:websockets.protocol:server - eof_received()
DEBUG:websockets.protocol:client x closing TCP connection
DEBUG:websockets.protocol:server - connection_lost(None)
DEBUG:websockets.protocol:server x closing TCP connection
****: still handling connection
INFO:asyncio:poll 999.879 ms took 1002.503 ms: timeout
****: still handling connection
INFO:asyncio:poll 999.879 ms took 1004.720 ms: timeout
****: still handling connection
INFO:asyncio:poll 999.879 ms took 1000.126 ms: timeout
****: still handling connection
INFO:asyncio:poll 999.880 ms took 1003.233 ms: timeout
****: still handling connection
client exiting
****: exiting handle_connection()
DEBUG:websockets.protocol:server ! failing WebSocket connection: 1001

You are correct. The current design assumes that ws_handler will notice that the connection is closed next time it attempts to interact with the connection with recv, send, ping or pong.
Cancelling the ws_handler when the connection terminates makes sense.
I'd do that in WebSocketServerProtocol.handler by changing:
yield from self.ws_handler(self, path)

Could you somehow phase in the friendlier behavior, e.g. making it opt-in
initially and deprecating the old behavior in a major release?
On Tue, May 1, 2018 at 12:39 PM Aymeric Augustin<EMAIL_ADDRESS>wrote:

You are correct. The current design assumes that ws_handler will notice
that the connection is closed next time it attempts to interact with the
connection with recv, send, ping or pong.
Cancelling the ws_handler when the connection terminates makes sense.
I'd do that in WebSocketServerProtocol.handler by changing:
yield from self.ws_handler(self, path)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/aaugustin/websockets/issues/338#issuecomment-385767552,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAVt7v-vXA4TM6qhxqKnqbpoLhYPT7EKks5tuLndgaJpZM4RvmoZ
.

shield starts by wrapping its argument in ensure_future.
After yield from asyncio.shield(finalize(...)), finalize(...) lives it its own task. If that yield from in cancelled, the link is broken and there's no way to wait for finalize()to complete.

what is the right way for a ws_handler to "subscribe" to or be notified of the connection closing?

I added WebSocketCommonProtocol.wait_closed for this purpose today.

With how websockets is currently written, it looks like protocol.connection_lost_waiter could be used for this. However, the ergonomics of this isn't so great, and it's not clear if connection_lost_waiter is part of the public API.

wait_closed is the public API you were missing. Indeed it's built on top of connection_lost_waiter.
So plan B is implemented.

Going back to plan A.
@lgrahl and I had a discussion on a similar topic in #464.
Eventually we decided to remove cancellation to make sure end users consistently see ConnectionClosed exceptions. If we added cancellation in the situation described here, users could randomly see ConnectionClosed or CancelledError depending on which one wins the race. That would be inconsistent with the choice made in #464.
We also reached the conclusion that cancellation was appropriate when something no longer cares about the result of a process it started. One could argue that we're in this situation: the server /almost/ no longer cares about the result of ws_handler.
The fine print in /almost/ is that ws_handler is user-provided code. This is an inversion of control scenario. We don't know if there's anything worth executing left in ws_handler.
My arguments around finalization code above show that in some cases, there's something worth executing and that throwing CancelledError will just make things more complicated.

I'm bothered by the inconsistency at this point: we're cancelling ws_handler when the server shuts down but not when the connection drops. I'm not finding a valid reason why websockets should handle these two situations differently. It's an accidental result of implementing them separately.
When the server shuts down, we want to terminate connections with 1001 Going Away. To achieve this, we need cancel ws_handler, detect that the server is shutting down (cf. _is_server_shutting_down) and decide that a 1001 is appropriate.
Closing the connection with 1001 and letting ws_handler terminate would be more consistent. If we change what we documented in #392, it will be a backwards-incompatible change (but an acceptable one).

This is an interesting one. I never encountered it since my implementation closes all connections and waits for all handlers to return before it shuts down the server. This allows me to control the close code for each connection individually and clean up any remaining resources.
Because of that, I would be fine if the server cancels remaining handlers implicitly by letting them know that the connection is gone as proposed in https://github.com/aaugustin/websockets/issues/338#issuecomment-423834444. The only thing that could happen is that the handler waits for something completely different... which I don't think is important since the application already made an intent to shut down the server. If it wants to shut down cleanly, it needs to signal that intent to its own handlers.

If I make this change, then there are only two situations where websockets cancels tasks:

Tasks created with asyncio.ensure_future, passed to asyncio.wait, and returned as still pending (4 instances);
Internal tasks running ping_keepalive and transfer_data that must terminate when the connection shuts down.

None of these tasks run user code, only framework code, so the "inversion of control" argument doesn't apply to them.

In hindsight, it would have perhaps made sense to use an asyncio.Queue to hand out (connection, path) tuples and let the application queue its own task.

Also known as "letting the user deal with the problem" ;-)
Jokes aside, websockets aims at being very simple to get started with. It shouldn't require too much assembly to be usable. Of course that make it less flexible; it's a tradeoff.

While working on this, I dug myself into this beautiful rabbit hole: https://bugs.python.org/issue34852

I have a WIP PR for this in #483. I still need to:

[ ] Figure out what happens to connections where the opening handshake hasn't completed yet when the server shuts down and try to return a HTTP 503 if possible
[ ] Review tests -- currently everything passes and there's 100% coverage but I'm not sure everything makes sense
[ ] Document the ws.wait_closed().add_done_callback(asyncio.current_task().cancel) trick

Interestingly, this PR also seems to provide a reasonable solution to #394.

Server and client examples for testing server shutdown (trigger it with Ctrl-C) during the handshake or the data exchange phase.
Server
#!/usr/bin/env python

import asyncio
import logging
import signal
import websockets

logging.basicConfig(level=logging.DEBUG)

class ServerProtocol(websockets.WebSocketServerProtocol):
    async def process_request(self, path, request_headers):
        # Wait to make it easier to interrupt the handshake
        for counter in range(10, 0, -1):
            print(counter)
            await asyncio.sleep(1)

async def echo(websocket, path):
    async for message in websocket:
        await websocket.send(message)

async def echo_server(stop):
    async with websockets.serve(
        echo, "localhost", 8765, create_protocol=ServerProtocol
    ):
        await stop

loop = asyncio.get_event_loop()

stop = asyncio.Future()
loop.add_signal_handler(signal.SIGINT, stop.set_result, None)
loop.add_signal_handler(signal.SIGTERM, stop.set_result, None)

loop.run_until_complete(echo_server(stop))

Client
#!/usr/bin/env python

import asyncio
import logging
import websockets

logging.basicConfig(level=logging.DEBUG)

async def echo():
    async with websockets.connect("ws://localhost:8765") as websocket:
        for letter in "abcdefghij":
            await websocket.send(letter)
            await websocket.recv()
            await asyncio.sleep(1)

loop = asyncio.get_event_loop()

loop.run_until_complete(echo())


Add settings config site and release template tags

Thought it useful to keep the javascript client and the python client using the same tags (release tag is especially useful since it's automatic).

I don't like this PR as much as the more flexible one I just sent: PR #756


ValueError: all the input arrays must have same number of dimensions, but the array at index 0 has 1 dimension(s) and the array at index 1 has 2 dimension(s)

I'm trying to use DeepExplainer with my deep model, which has multiple inputs (17). I have successfully instantiated it like this (pay no attention to the fact that background samples are not randomly selected):
background = [input_mode[:100] for input_mode in network_inputs_validation]
e = shap.DeepExplainer(model, background)

However, when I try to get the Shapley Values for a particular sample, I get this error:
test_input = [input_mode[101] for input_mode in network_inputs_validation]
shap_values = e.shap_values(test_input)

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-42-783b0780b4c5> in <module>()
      1 test_input = [input_mode[101] for input_mode in network_inputs_validation]
----> 2 shap_values = e.shap_values(test_input)

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/shap/explainers/deep/__init__.py in shap_values(self, X, ranked_outputs, output_rank_order)
    117         were chosen as "top".
    118         """
--> 119         return self.explainer.shap_values(X, ranked_outputs, output_rank_order)

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/shap/explainers/deep/deep_tf.py in shap_values(self, X, ranked_outputs, output_rank_order)
    262                 tiled_X = [np.tile(X[l][j:j+1], (bg_data[l].shape[0],) + tuple([1 for k in range(len(X[l].shape)-1)])) for l in range(len(X))]
    263                 # we use the first sample for the current sample and the rest for the references
--> 264                 joint_input = [np.concatenate([tiled_X[l], bg_data[l]], 0) for l in range(len(X))]
    265                 # run attribution computation graph
    266                 feature_ind = model_output_ranks[j,i]

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/shap/explainers/deep/deep_tf.py in <listcomp>(.0)
    262                 tiled_X = [np.tile(X[l][j:j+1], (bg_data[l].shape[0],) + tuple([1 for k in range(len(X[l].shape)-1)])) for l in range(len(X))]
    263                 # we use the first sample for the current sample and the rest for the references
--> 264                 joint_input = [np.concatenate([tiled_X[l], bg_data[l]], 0) for l in range(len(X))]
    265                 # run attribution computation graph
    266                 feature_ind = model_output_ranks[j,i]

<__array_function__ internals> in concatenate(*args, **kwargs)

ValueError: all the input arrays must have same number of dimensions, but the array at index 0 has 1 dimension(s) and the array at index 1 has 2 dimension(s)

Any ideas? BTW I'm using TF 2.0 in non-eager mode and the model was created using tf.keras.
Thanks.

Just in case it's useful for someone: This seems related to not using Numpy slices. if you pass a single example as input to shap.DeepExplainer.shap_values it fails like this. Be sure to pass a Numpy array slice, even if you are interested in the Shapley Values for a single instance.

@williamcaicedo how did you solve this? i am having trouble with the same error for shap.deep explainer

I did pass it as a Numpy slice, but it still doesn't work


Remove space from start and end of path.

fixes: https://github.com/firebase/extensions/issues/1055

Thanks @ankit-programmer.
We could potentially use some test cases adding to ensure this works as expected. Happy to support on this as it could require updates from the new emulator.

Due to risks and a potential richer params update in the future mentioned here.
We will close this PR for now, but may be used for future reference.


Explore making Settings Manager inherit from BaseSettings

🚀 Feature
From #2759, @tlambert03 asked:

tangential question: I assume there's a good reason, but I can't remember... can SettingsManager itself not be a BaseSettings with the sub-settings as fields?

Making an issue to explore this.
Motivation

Pitch

Alternatives

Additional context

@tlambert03 we can close this right?


adding discord and twitter links on homepage footer.

At present, there are no handles to discord/twitter on footer.

@nevo-david  can I start working on this ?

Sure! Thank you!


Fix compatibility issues with python 3.10 and django 4.0

This MR intends to fix multiple compatibility issues.

The first one is the use of collections.Mapping which has been deprecated since python 3.3, instead of collections.abc.Mapping. In Python 3.10, this won't work anymore.

$ python
Python 3.9.1 (default, Jan 20 2021, 00:00:00)
[GCC 10.2.1 20201125 (Red Hat 10.2.1-9)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from collections import Mapping
<stdin>:1: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working

The second one is a compatibility issue with the upcoming Django 4.0 version. The use of the providing_args parameter for django's Signal object has always been purely documentational, and is planned to be completely removed in Django 4.0.

$ python -W all
Python 3.9.1 (default, Jan 20 2021, 00:00:00)
[GCC 10.2.1 20201125 (Red Hat 10.2.1-9)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from django.dispatch import Signal
>>> Signal(providing_args=["foo"])
<stdin>:1: RemovedInDjango40Warning: The providing_args argument is deprecated. As it is purely documentational, it has no replacement. If you rely on this argument as documentation, you can move the text to a code comment or docstring.

The third one is another compatibility issue with Django 4.0. The use of django.conf.urls is deprecated since django 2.0. Also, django.urls.url will be removed from Django 4.0. django.urls.re_path can be used instead, as it was an alias for the same function since django 2.0.

The last one is another compatibility issue with Django 4.0, but I didn't find any documentation on it. It's due to this commit that modifies the internal attribute name of the FieldFile class.

For each of these issues, I tried to keep full retro-compatibility with the previous version.

Looks good, thank you!


NEXT-9519 - Account order history: product images missing

Description:
The product images for the order items are missing on the account order history page.
Steps to reproduce:
Create a product with an image
Order it
Go to the order history page (/account/order)
View the items of the last placed order
Expected result:
The product image will be displayed
Actual result:
No product image will be displayed

Had a look at this issue, seems to be already resolved:

@shopwareBoostDay/shopware-qa feel free to close this one.

already fixed


A11y_AzureToolsStorageExplorer_Disk_DiskInfoTable_ScreenReader:Voiceover reads the table column header twice.

“Check out Accessibility Insights! Identify accessibility bugs before check-in and make bug fixing faster and easier.”
GitHubTags: #A11y_AzureToolsStorageExplorer; #A11yMAS; #A11YTCS; #DesktopApp; #WCAG1.3.1; #VoiceOver; #Mac;
Environment Details:
Application Name: Azure Tools Storage Explorer
Application Version: 1.10.0
MAC Version 10.14.6 Beta(18G29g)
Repro Steps:

Launch Storage Explorer
Navigate to "Open Connect dialog" pane and Sign in to Azure.
Go to "Manage Accounts" pane and Select the subscriptions you will use. Once selected, click on "Apply" button.
Navigate to "Disks" of the selected subscription.
Navigate to "A11ytest" and  click on it.
Navigate to Table under the tool bar.
Start VoiceOver and navigate using Tab key and check whether the Voiceover reads the table column header twice.
Actual:
Voiceover reads the table column header twice.
Expected:
VoiceOver should read the table column header once.
UserImpact:
Screen reader users will get confuse if Voiceover reads twice for the column header.

Attachment for Reference:
1982_A11y_AzureToolsStorageExplorer_Disk_DiskInfoTable_ScreenReader.pptx

@MRayermannMSFT Verified the issue on version 1.12.0 and MAC 10.15.3.The issue is no longer reproduced.Hence close this bug.

GithubTags:#Closed;

GitHubTags:#BM-TCS-StorageExplorer-Mac-Sep2019;


Update webpack to be a peerDependency in 'custom-functions-metadata-plugin'?

Expected behavior
When developing an Excel add-in, one should be able to use both 'react' and 'custom functions'.
Current behavior
Current dependency configuration in the 'custom-functions-metadata-plugin' makes the combined project crash, because of a bug with multiple webpack versions. Updating webpack from being a dependency to a peerDependency in the 'custom-functions-metadata-plugin' might solve the issue.
I've been trying to merge two of the default yeoman templates, React and CustomFunctions. After copying the necessary packages, and updating the manifest and the webpack configuration, npm start crashes with the following error:
The 'compilation' argument must be an instance of Compilation
I've been able to find other issues where this is discussed (such as here), and it seems to be an issue with having two versions of webpack running at the same time. This made me realize that the 'custom-functions-metadata-plugin' was listing webpack as a dependency as opposed to a peer dependency, therefore installing a second version of webpack in my project.
Manually removing the webpack dependency from the package-lock.json solved the issue for me, but thought it would be good to raise the issue!
Steps to Reproduce
Please provide detailed steps for reproducing the issue.

Create a React project via Yeoman
Create a Custom Functions project via Yeoman
Manually update package.json, manifest and webpack config in 1. to include relevant sections from 2.
Start the dev server

If it is simply a problem with the different versions of webpack then the custom functions project wouldn't work by itself because it's using the same version as the react project.  Seem like there is something in the merge you are doing.  You might try starting the the Custom Functions project and add the necessary react components (the reverse of what you are describing here).

Running into the same error when trying to run 'npm build' trying to merge an Excel React add-in with Custom Functions.
Would be nice if there was an example official repo with both React and Custom Functions together as there seems to be others trying to do the same thing and merge the templates.

I was running into this same problem. I solved it by adding a postinstall script to the package.json, which removes webpack from custom-functions-metadata-plugin's node_modules. It is ugly but it works 😅
"postinstall": "rm -rf ./node_modules/custom-functions-metadata-plugin/node_modules/webpack"

I had the same problem.  Everything is okay until I run  npm update .  Webpack was upgraded from version 4 to version 5. custom-functions-metadata-plugin was upgraded from 1.0.40 to 1.0.54,  The error happened.

I was running into this same problem. I solved it by adding a postinstall script to the package.json, which removes webpack from custom-functions-metadata-plugin's node_modules. It is ugly but it works 😅
"postinstall": "rm -rf ./node_modules/custom-functions-metadata-plugin/node_modules/webpack"

Thank you so much @OttoLaitinen . As your advice, I fixed this issue.
In my case, everything was okay until I ran  npm update .  The error happened and:

webpack was upgraded from version 4 to version 5.
But webpack-cli and webpack-dev-server were not changed.

custom-functions-metadata-plugin was upgraded from 1.0.40 to 1.0.54,

In the folder node_modules, there are 2 folder custom-functions-metadata and custom-functions-metadata-plugin

I was running into this same problem. I solved it by adding a postinstall script to the package.json, which removes webpack from custom-functions-metadata-plugin's node_modules. It is ugly but it works 😅
"postinstall": "rm -rf ./node_modules/custom-functions-metadata-plugin/node_modules/webpack"

Thank you so much, @OttoLaitinen. As your advice, I fixed this problem.
In my case, everything was okay until I ran  npm update .  The error happened and:

webpack was upgraded from version 4 to version 5.
But webpack-cli and webpack-dev-server were not changed.

custom-functions-metadata-plugin was upgraded from 1.0.40 to 1.0.54,

In the folder node_modules, there are 2 folder custom-functions-metadata and custom-functions-metadata-plugin

I wonder that if the version of webpack, webpack-cli could be the cause of is bug.

Looking at Excel-Custom-Functions in isolation what's currently in the repo works.  However it has vulnerabilities listed and while most of those can be corrected just fine, there are three updates that cause problems when updated: copy-webpack-plugin, webpack, and custom-functions-metadata-plugin.  Of those custom-functions-metadata-plugin was only listed as a minor version update which means it gets updated more easily and is the trigger of the indicated error.  It probably should have had a major version update when the webpack dependency shifted major versions (instead of version to 1.0.44).  If you leave custom-functions-metadata-plugin at the lower version and update webpack and copy-webpack-plugin in excel-custom-functions project instead you will get other error requiring webpack configuration updates.
In thinking about the plugin itself . . . I'd have to consider moving webpack from a dependency to a peerdependency more closely.

"postinstall": "rm -rf ./node_modules/custom-functions-metadata-plugin/node_modules/webpack"

I was hitting the same error so I tried using the above but I get this error
/node_modules/custom-functions-metadata-plugin/lib/customfunctionsplugin.js:39
                compilation.assets[this.options.output] = new webpack_1.sources.RawSource(generateResult.metadataJson);
                                                                                ^
TypeError: Cannot read property 'RawSource' of undefined
    at /node_modules/custom-functions-metadata-plugin/lib/customfunctionsplugin.js:39:81

which looks like a failure at require webpack
what is the best way to get around this issue or is there a fix for the main issue?

I am also hitting the same issue as @pk8189.


Add Ballerina Expression Syntax doc

Purpose

Describe the problems, issues, or needs driving this feature/fix and include links to related issues in the following format: Resolves issue1, issue2, etc.

Created new PR to syn the branch


Fix paths of mina-sshd-api-plugin modules

Description
Fixes paths of plugins provided by https://github.com/jenkinsci/mina-sshd-api-plugin. Issue https://github.com/jenkins-infra/repository-permissions-updater/issues/2592.
Submitter checklist for adding or changing permissions
Always

[ ] Add link to plugin/component Git repository in description above

For a newly hosted plugin only

[ ] Add link to resolved HOSTING issue in description above

For a new permissions file only

[ ] Make sure the file is created in permissions/ directory
[ ] artifactId (pom.xml) is used for name (permissions YAML file).
[ ] groupId / artifactId (pom.xml) are correctly represented in path (permissions YAML file)
[ ] Check that the file is named plugin-${artifactId}.yml for plugins

When adding new uploaders (this includes newly created permissions files)

[ ] Make sure to @mention an existing maintainer to confirm the permissions request, if applicable
[ ] Use the Jenkins community (LDAP) account name in the YAML file, not the GitHub account name
[ ] Make sure to @mention the users being added so their GitHub account names are known if they require GitHub merge access (see below).
[ ] All newly added users have logged in to Artifactory at least once

Reviewer checklist (not for requesters!)

[ ] Check this if newly added person also needs to be given merge permission to the GitHub repo (please @ the people/person with their GitHub username in this issue as well). If needed, it can be done using an IRC Bot command
[ ] Check that the $pluginId Developers team has Admin permissions while granting the access.
[ ] In the case of plugin adoption, ensure that the Jenkins Jira default assignee is either removed or changed to the new maintainer.
[ ] If security contacts are changed (this includes add/remove), ping the security officer (currently @Wadeck) in this pull request. If an email contact is changed, wait for approval from the security officer.

There are IRC Bot commands for it

I read through the repo and I think you are right. The name is used as prefix as per https://github.com/jenkins-infra/repository-permissions-updater/blob/1b552df59049d381c3350db9e305fc96f0ac0afd/src/main/groovy/io/jenkins/infra/repository_permissions_updater/ArtifactoryPermissionsUpdater.groovy#L221.
For consistency, I think it is best that we rename the modules with the pattern mina-sshd-api-* rather than mina-sshd-*-api in the plugin repo.
We currently have for the following (groupId:artifactId):
io.jenkins.plugins.mina-sshd-api:mina-sshd-api-parent
io.jenkins.plugins.mina-sshd-api:mina-sshd-common-api
io.jenkins.plugins.mina-sshd-api:mina-sshd-core-api
io.jenkins.plugins.mina-sshd-api:mina-sshd-scp-api
io.jenkins.plugins.mina-sshd-api:mina-sshd-sftp-api

We should probably have:
io.jenkins.plugins.mina-sshd-api:mina-sshd-api-parent
io.jenkins.plugins.mina-sshd-api:mina-sshd-api-common
io.jenkins.plugins.mina-sshd-api:mina-sshd-api-core
io.jenkins.plugins.mina-sshd-api:mina-sshd-api-scp
io.jenkins.plugins.mina-sshd-api:mina-sshd-api-sftp

So the path io/jenkins/plugins/mina-sshd-api/ should actually be enough alone and with the name mina-sshd-api` it would result in the following includes that I think should work:
io/jenkins/plugins/mina-sshd-api/*/mina-sshd-api-*
io/jenkins/plugins/mina-sshd-api/*/maven-metadata.xml
io/jenkins/plugins/mina-sshd-api/*/maven-metadata.xml.*
io/jenkins/plugins/mina-sshd-api/maven-metadata.xml
io/jenkins/plugins/mina-sshd-api/maven-metadata.xml.*

But I think this is the "hack" that @daniel-beck was referring to ? So is it actually recommended to have a distinct permissions/plugin-mina-sshd-api-*.yml file per module + 1 for the parent ?

I think so, pretty annoying when adding new people though but if it uses CD it’s not so bad

BTW we use the wildcard for the BOM https://github.com/jenkins-infra/repository-permissions-updater/blob/8f5d9fe63f48a35280f435e727039f27cde70554/permissions/pom-bom.yml#L7 to avoid an extra step when adding an LTS line (#1938).


Add environment.yml and install.R to simplify installation

Ready to go. I took out the full list of R dependencies since I think it was already out of date. We'll have to keep on top of updating install.R as we add new ones.

That prefix shouldn't be in the environment.yml file, I took it out. Will
figure out why that commit isn't being reflected here.
On Thu., Mar. 24, 2022, 4:43 p.m. Matthew Meier, @.***>
wrote:

@.**** approved this pull request.
Looks great - I commented where I saw one typo
Will test this out as soon as I can!
In environment.yml
https://github.com/R-ODAF/R-ODAF_Health_Canada/pull/64#discussion_r833731341
:

@@ -0,0 +1,13 @@
+name: rnaseq
+channels:

conda-forge

bioconda

defaults
+dependencies:

anaconda-clean

rsem

fastp

star

multiqc
+prefix: /home/kcook/.conda/envs/rnaseq

This is cool. For this line though is it possible to have an environment
variable that substitutes the Linux user name? Just wondering if that would
work without any extra trouble. Or $HOME?
In README.md
https://github.com/R-ODAF/R-ODAF_Health_Canada/pull/64#discussion_r834710928
:

-## "Installing" the pipeline
+There are also numerous dependencies in R (a full list would take up a lot of space and would likely be incmoplete). Run install.R within R or using Rscript to install them.
Typo in "incomplete"
—
Reply to this email directly, view it on GitHub
https://github.com/R-ODAF/R-ODAF_Health_Canada/pull/64#pullrequestreview-919468033,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ACPMUO3KTS2LJL3T3CNMX3LVBTHYZANCNFSM5RPCSBGQ
.
You are receiving this because you authored the thread.Message ID:
@.***>

No it actually isn't there anymore. I guess it only posted when I finished the review... I was attempting to comment that yesterday from mobile, but maybe it didn't actually post because I had accidentally started a review. I can see that it is red now and replaced.


limits or something else?

i use v 1.0.7
All association use custom batch.
Also i have a big struct like
posts(first: 10) {
  user {
    id
  }
  comments(first: 10) {
    user {
      id
    }
    replies {
      user {
        id
      }
      uploads: {
        user {
          id
        }
      }
    }
  }
}

But looks like when i try load many dataloader batches i got error
"Unable to find item [\"a83e3944-1b45-4f70-b400-0f119d989fb0\"] in batch
when i remove 1 field with dataloader from query all is ok but after back it query again failed.
Any things?
one example
def dataloader_one(source, queryable, type, map_fn \\ & &1) do
   fn parent, _args, %{context: %{loader: loader}} = _resolution ->
     parent_id = Map.get(parent, :id) || Map.get(parent, :__parent_id)

     loader
     |> Dataloader.load(source, {:one, queryable}, [{type, parent_id}])
     |> on_load(fn loader ->
       loader
       |> Dataloader.get(source, {:one, queryable}, [{type, parent_id}])
       |> map_fn.()
       |> wrap_with_ok
     end)
   end
 end

def run_batch(_, query, :quests_count, user_ids, repo_opts, %{current_user: current_user} = params) do
       User.quests_count(current_user.id, user_ids, true)
       |> run_batch_wrapper(params[:repo], user_ids, repo_opts, 0)
     end

def run_batch_wrapper(query, repo, entities_ids, repo_opts, default_value \\ nil, map_fn \\ &(&1)) do
   repo = repo || Repo
   results =
     query
     |> repo.all(repo_opts)
     |> Map.new

   for id <- entities_ids, do: map_fn.(Map.get(results, id, default_value))
 end

I have exactly the same problem, but not directly the same. I have this helper:
    dataloader(
      loader,
      fn object, _args, %{context: %{current_user: user}} ->
        {key, %{user: user, parent: object}}
      end,
      opts
    )

and in some queries it will fail with the same error as you, but when I remove parent: object from the args everything works fine. I spent around 3 days debugging the problem and still could not understand how all this dataloading works from start to end.

Closing as a lot has changed, please reopen with a test case if this is still an issue.


Regarding PRs

So, whenever you are going to accept contributions, I guess, you need people to branch out the name of the course they are interested to write about. The branch name should ideally be /name1-name2-.., for e.g. /theory-of-computation .
Any ideas/suggestions about the format of the text? So that I can incorporate the template in contributing.md ?

For the topic you wish to contribute, simply name it as topic-name-like-this. Example: operating-systems. Apart from that, if you wish to contribute to an existing topic or branch, simply open an issue referencing it.

For an entire topic, I have made a sample template.
## Topic Heading Here

### Standard Textbooks

1. **Book1** - Author1 [1]
2. **Book2** - Author2 [2]

### Alternative/Supplementary

1. **Book1** - Author1
2. **Book2** - Author2 [3]

### Notes

[1] - Used as reference for

- [CSxxx at UXX](course-hyperlink)
- [CSxxx at UXX](course-hyperlink)

[2] - Used as reference for

- [CSxxx at UXX](course-hyperlink)
- [CSxxx at UXX](course-hyperlink)

[3] - Used as reference for [CSyyy at UXYZ](course-hyperlink) where some famous instructor teaches.

### References

- NITR Curricula (because that's what I'm basing this off of)
- [XYZ Curricula at XYZ University](hyperlink-to-curricula-if-available)
- Websites

'''[some-wikipedia-page](with-wikipedia-link-here)''
'''[some-other-page](with-link-here)''

- Courses

'''[CSXXX - Full-univ-name-here](hyperlink-to-course)''
'''[CSXXX - Full-univ-name-here](hyperlink-to-course)''
'''[CSXXX - Full-univ-name-here](hyperlink-to-course)''

- Uncategorized reference
- Uncategorized reference

' indicates a space. Three leading spaces and two trailing spaces allow you to have paragraphs without line breaks as in Courses under References.
Found a great link? Keep it in miscellaneous for now.
It comes out looking like
Topic Heading Here
Standard Textbooks

Book1 - Author1 [1]
Book2 - Author2 [2]

Alternative/Supplementary

Book1 - Author1
Book2 - Author2 [3]

Notes
[1] - Used as reference for

CSxxx at UXX
CSxxx at UXX

[2] - Used as reference for

CSxxx at UXX
CSxxx at UXX

[3] - Used as reference for CSyyy at UXYZ where some famous instructor teaches.
References

NITR Curricula (because that's what I'm basing this off of)

XYZ Curricula at XYZ University

Websites
some-wikipedia-page
some-other-page

Courses
CSXXX - Full-univ-name-here
CSXXX - Full-univ-name-here
CSXXX - Full-univ-name-here

Uncategorized reference

Uncategorized reference

Improvements to the template above are very welcome as changes further down the line will be more time intensive than now. Once a satisfactory template has been achieved, there will be no further template changes until a v1 of the curriculum books is complete and ready for use.

I like the template, but don't you think the course names, in the references feel a bit repetitive? Since we are already using them above. I am pretty sure there must be a better way to go about it.
One way to go about it, would be to have a universal set only of these courses. That way, multiple subjects ca reference back to them, still avoid redundancy.
Case in point: For someone who wants to learn Compiler Design, he still has to get through Theory of Computation and Automata Theory. So under the  used as a reference for section, we can write the name of TOC course, and link it to a universal list of courses. Which will be the same link given to someone who searches in the TOC curriculum section. Suggestions?

The idea is one I have previously thought of, but not seriously. The concept seems much better, so I'll make modifications to the template.

One way to go about it is to categorize the courses by University. That way, all links (with their relevant descriptions) will be categorised.

Also, would like to point out that though your idea of prerequisites is absolutely necessary, it's not one that furthers our progress towards a list of books. The idea will definitely be kept in mind for future implementation.

Relevant changes have been made starting from the MP & MC branch, and is now reflected in dev branch after merging. Updates to the template will be made soon.

@AB1908 , I think the work is coming on nicely now. Should I commit the contributing.md PR template to the dev branch? Or should we wait for some time?

Create a pull request and I'll review ASAP!

PR #12 addresses this issue for now. Closed until further notice.

A contributing.md file has been created, and PR Template has moved to it's own file as per community guidlines.


Replace contents of README.md with a link to kubeflow.org

We should direct users to the official documentation and remove
the documentation in the README.md

kubeflow/website#107 will update the website to include all information
currently in the README as well as other information

README.md is outdated; e.g. it is still referring to v1alpha1

Fix #760

This change is

/assign @gaocegege
/assign @kunmingg

Coverage increased (+0.07%) to 56.773% when pulling 325b157b22c2558ef31b6d469143e20082cbddec on jlewi:fix_readme into 0e6dd17d1dff3e9a30024ae8aeaad151800c53e2 on kubeflow:master.

/retest
/lgtm
/approve


Added pipeline to filter for single nitrogen-nitrogen bonds

Description
Added an example pipeline that filters for single nitrogen-nitrogen bonds
Todos
Notable points that this PR has either accomplished or will accomplish.

[ ] create more unique fingerprints
[ ] create more unique relevance functions

Questions

[ ]

Status

[ ] Ready to go

-What is the selection process in your example (the properties your selecting with, and the frequency)?
-What is your starting # of molecules?
-What is the final # of molecules?
@danieljcabrera

The selection process of my example revolves around looking at the neighboring atoms of single nitrogen-nitrogen bonds and the Wiberg Bond Order of these nitrogen-nitrogen bonds. These values were then returned as a list in a fingerprint with all of the atomic numbers of the neighboring atoms being at the beginning of the list and every list ending with the Wiberg Bond Orders of single nitrogen-nitrogen bonds. Additionally, my selection frequency in the config of my pipeline is 3.
My starting number of molecules was 1000.
My final number of molecules is 26.
@jmaat @btjanaka

Please let me know if there are any other questions you guys have or suggestions for edits, fixes, etc. :)

This pull request introduces 1 alert when merging 8bb58f5 into fd195e7 - view on LGTM.com
new alerts:

1 for Unused local variable

@danieljcabrera Please take a look.

@danieljcabrera Have you used YAPF to format these files? See https://github.com/btjanaka/dance/blob/master/.github/CONTRIBUTING.md#auto-formatting for more info.

I believe I made all the changes you suggested Bryon, please let me know if there was anything I did incorrectly or any other changes to still be made. Also, I only started the README for surrounding_nitrogen_bonds, I will be finishing it asap I had a very busy week, sorry! 😅Thank you for the link to the example though!
@btjanaka

Starting 1000 molecules > filtered based on N-N bonds, what's the number of molecules that results here? > then what is the selection process when you select at a frequency of 3? @danieljcabrera

Yes, Jessica and I both discussed and agreed about this as well. Currently my thoughts are to make use of a max length for the entire fingerprint so it will be standardized for comparison, using 0 or -1 to fill in values when necessary like you suggested. However, I have a couple questions about what a max length could mean and how I should go about resolving these issues:

In determining a max length, how should I be taking into account molecules that could potentially have more than one single nitrogen-nitrogen bond?
ex:
mol with 2 single nitrogen-nitrogen bonds- [bond1neighbor, bond1neighbor, bond2neighbor, bond2neighbor, bond2neighbor]
mol with 1 single nitrogen-nitrogen bond- [bond1neighbor, bond1neighbor]
As my code stands I believe the find_neighboring_atoms() and wiberg_bond_order() functions would continue to add neighbors or WBOs to their lists as they goes through every match of a single nitrogen-nitrogen bond for each individual molecule as show above. (Could I also have a SMILES string with multiple single nitrogen-nitrogen bonds to test this with to make sure this is what's happening? I'm not too sure how to write my own or where I could go to look for one 😅)

I also had the thought that I could only use 1 WBO value if I only returned the average WBO for all the single nitrogen-nitrogen bonds of a molecule. Do you think this would be more or less efficient than creating a max length list of WBO values for every molecule. This only made sense to me with WBO values and not neighbors because I'm not sure if an average of atomic number values would be as useful.
@btjanaka @jmaat

@jmaat After testing I can confirm that the number of molecules I start with is 1000. After filtering based on N-N bonds this is then dwindled down to 26 molecules. Then based on what I understand from the dance documentation the selection frequency sets a portion of the possible molecules that will be taken from the original file. Since the selection frequency is at 3 this would mean a possible of 333 molecules that would be taken, which is not reached by the 26. Is my understanding of this correct @btjanaka?

Question 1:

Separating the atoms around different bonds is tough. Perhaps you could create a block of 10 (or another size) for each bond and populate each block with the atomic numbers around a bond? Then you could have a maximum number of blocks / N-N bonds possible in a molecule.
Perhaps we need to come up with more structured ways to represent fingerprints in DANCE than a single vector of floats? This is a huge discussion in itself.

Question 2:

It is certainly more space efficient to just use 1 average WBO, but you lose a ton of info (namely, the individual WBO values). At any rate, it seems like you're dealing with a pretty small dataset, so you may not even see the difference.
I guess you could do average atomic number, but then you would only be able to say "hey, this molecule here tends to have atoms with higher atomic number (AKA heavier atoms) around the N-N bonds compared to that molecule"

Your other question:

Actually I think it is 334 because it selects 0, 3, 6, ..., 999

Thank you for the help Bryon! As of now, I changed the fingerprint function for neighboring atoms so that it will return a max length 10 list of atomic numbers that are neighbors to any N-N bond in a molecule. I also did the same with the Wiberg bond order function by returning a list of max length 5 for all the potential WBO values of N-N bonds in a molecule. Any spots in the lists that aren't taken up are 0's. Then the fingerprint combines the 2 lists and returns the result so that every fingerprint will be a list of 15 values.

I think it looks good; is there anything you wanted me to check for? Basically, if it works, and you're getting the results you expect, I think it should be okay.

Nothing in particular, I think because I had never officially marked off the changes you suggested from a while ago it had taken you off as a reviewer so I wanted to make sure I added you again. I have a few more edits to make along with the changes you just suggested so I'll be uploading another version this week, thank you for all the help! :)

@jmaat @btjanaka just updated the experiment with my latest results!

@btjanaka thank you for all the feedback! I just updated everything and resolved the conversation for all the fixes I made, the only two remaining are ones I will be looking into further. Thank you again :)

@btjanaka @jmaat here is the updated heat map script I used to generate the results I just posted on slack!


Please evaluate OmegaConf and Hydra

Hi, interesting project!
I am the author of  OmegaConf and of Hydra.
Take a look at OmegaConf has some powerful features that can help your project:

Config composition
Interpolations
Optional strong runtime type safety (via dataclasses).
And more.

Hydra could also be of interest, although some of it's default behaviors may be inappropriate for your proejct.

Thanks @omry. Especially the dot-list functionality is very interesting!

The dotlist is one of the earlier features in OmegaConf :).
You have another task for schema validation which I think can be addressed easily using Structured Configs.
I am also sure interpolation can help you reduce config duplication (and can also allow transparent access to environment variables):
user: ${env:USER}

that really is very cool! amazing work, thanks for sharing!

Glad you like it.
I strongly recommend that you look at Hydra as well, it's significantly more advanced but also more opinionated - and some of the opinions may be somewhat incompatible with your goals.
Let me know what you think.


[hf inference] ASR remote inference model parser impl

[hf inference] ASR remote inference model parser impl
Implementation of the HuggingFaceAutomaticSpeechRecognition Model parser using the inference endpoint to run inference. Python API takes in bytes as well as path, skip binary for now.
Very similar to #1018
Testplan

Temporarily add model parser to Gradio Cookbook model parser registry.

    asr = HuggingFaceAutomaticSpeechRecognitionRemoteInference()
    AIConfigRuntime.register_model_parser(
        asr, asr.id()
    )

run AIConfig Edit on Gradio example

python3 -m 'aiconfig.scripts.aiconfig_cli' edit --aiconfig-path=cookbooks/Gradio/huggingface.aiconfig.json --parsers-module-path=cookbooks/Gradio/hf_model_parsers.py --server-mode=debug_servers

Stack created with Sapling. Best reviewed with ReviewStack.

#1021
-> #1020

Fixed a couple of nits on comments
Renamed any references of image to audio
Refactored validate_and_retrieve_audio_from_attachments to also validate only one audio attachment

Testplan,
Same as in original pr description, output had the same output so omitting the screenshot

update the mimetype validation to check audio, not audio/


Add Navbar test and minor updates to ImportModal, Export, and Navbar

Wanted to start with some tests of the existing Navbar stuff first... will push search changes next.
Please see unit test results:

Hmm, seeming to have some auth issues, so @R-Sandor please test this before merging to main ... it's late and I'm running out of gas so can pick it back up tmrw


same tool must not be map to two different machines at the same time

when
i map a part and tool for a machine
then
the same  tool can not  be used by a different machine
actual
same tool can b mapped to different machines

Actually, this is not a wrong thing in our requirement. Because if we fix the constraints for tool changeover, one tool in one machine we get difficulties with tool change.  Now this will rectified by toolchangeover only


Update urls for owner-transferred repos: ScientificTypes, MLJScientificTypes

cc @DilumAluthge

@DilumAluthge I wonder if we should revert these changes in light of the fact that we also want to change the names of the repos; see https://github.com/JuliaAI/ScientificTypes.jl/issues/125#issue-909967441 .
Now that I see how name ambiguities are resolved with ownership sub-directories, we should do the name changes,
ScientificTypes -> ScientificTypesBase
MLJScientificTypes -> ScientificTypes
at the same time as updating the urls?
What is your suggestion?
cc @juliohm

Hmmm. In the General registry, renaming doesn't really work like that. We never actually remove a package name from the registry.
Here is what you would want to do:

Create a new package and call it ScientificTypesBase.
Copy all of the content of ScientificTypes into ScientificTypesBase. Now register ScientificTypesBase as a new package.
Now, delete all contents of the ScientificTypes package and replace them with the contents of the MLJScientificTypes package. Then make a new breaking release of ScientificTypes.
Now you can deprecate the MLJScientificTypes package.

Does that make sense?

Yes. That makes sense and sounds like the safest.


Seeking some clarification on your article

Hi Clare, sorry that I've raised this as an issue in an unrelated repo, but i didn't know how to contact you otherwise..   And thanks for your sessions at Reinvent ( the stay at home version ).. Helpful stuff! and quite timely.
I'm actively using cdk-pipelines which is still in experimental.. One of the topics that is being discussed is if a pipeline should only have a single source.    As coded right now, it only as one,  and i've found that to be quite restrictive.
Your article ( https://aws.amazon.com/builders-library/automating-safe-hands-off-deployments/ ) is being used as a reference, to model it from ( see  https://github.com/aws/aws-cdk/issues/10872 )..
I've re-read your article several times, and i cant' find anything to suggest that a pipeline can only have one source. The only suggestion in your article is that 'Source' has been shown as a single box in some of the diagrams.
I have a use case where i don't' have much choice but to have multiple sources, because the ownership/business models precludes it all from being in a single source.     My IaC repo is in one place,  and the repos for a number of containers are owned by others in other places.      However, a commit in either place, needs to trigger some changes.     I'd love to have everything in one place, but it just wont' happen.
I've hacked a solution together to get around it, by having my code build post stage kick of the cdk pipelines, after its finished building an image and placing it in ECR.
  post_build:
    commands: |
      echo Build completed on $(date)
      echo Pushing the Docker image...
      docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$IMAGE_TAG
      aws ssm put-parameter --name "/$INFRA_PIPELINE/$IMAGE_NAME/CurrentTag" --type "String" --value "$IMAGE_TAG" --overwrite
      aws codepipeline start-pipeline-execution --name $INFRA_PIPELINE

This feels like a 'hacky' hack.
Is their any chance you could clarify if you article really meant that there should only be one source?

Commented on the CDK issue

Commented on the CDK issue


Feature/issue80

We currently have two main macros in our git distribution: novis.mac and vis.mac. When a new feature gets added that has a macro option, we need to update both these macros to reflect the new available option. This pull request consolidates novis.mac and vis.mac into a single file called WCSim.mac (this solves #80 and is the first step to fixing issue #81).
Changes in the Pull Request

The visualizer options that were in vis.mac have been moved to a file called  visOGLSX.mac.
The pre-existing visRayTracer.mac has been modified to just contain the RayTracer options rather than act as a stand-alone macro.
novis.mac has been renamed WCSim.mac and lines to turn on the visualizer have been added. In order to turn on the visualizer,  /control/execute visOGLSX.mac or /control/execute visRayTracer.mac can be uncommented in the WCSim.mac file.

I just did a quick round of verification runs. Running WCSim.mac gives the same output as novis.mac. If I turn on the OGLSX options the visualization looks the same as running with vis.mac in the old code. Running with the RayTracer options outputs the same figures as visRayTracer.mac did before.


BROOKLYN—349: fix DSL resolution in location

There are two parts to fixing this:

Fix for NPE in JcloudsLocation.getComputeService: we are more careful when copying the ResolvingConfigBag, so we don't resolve all the values too early when copying it from one ResolvingConfigBag to another.

Fix for creation of DSL tasks (e.g. in DslComponent.newTask()) so that we pass through the current task's context entity when we create the DSL task.

For (2), it's not clear to me if that is the right fix. The alternative would be to ensure that it is the entity's ExecutionContext that is used to execute the created task (which would thus automatically set the entity-context as a tag on the task). Presumably we are currently sometimes using the vanilla management context's ExecutionContext instead.

See #279 for an alternative fix (though no test - we could copy the test from here into that PR).
We'll only want one of this PR or #279 to be merged, I think. @grkvlt @ahgittin @neykov I'm keen to hear your thoughts on it.

Can we merge #340 and then look at this?  It gives clearer methods for dealing with semantics of copying resolved / unresolved semantics, and it moves Location's config to be treated like others.  Many of your changes here can still work but some may need changing to fit with how it works.
In particular note that with #340 the ConfigBag exposed by AbstractLocation is an RO view.  (Not sure if that matters.)

@ahgittin I've rebased this against master (now that #340 is merged), and confirmed JcloudsRebindStubTest still passes.
Can you review please?

The changes make sense. I think they will work even if the DSL is set on the location object, nothing specific to provisioning.properties here. Worth a test case to confirm?
The result still depends on the context where evaluation happens, not where it's set. Or may be not, not sure how #340 interacts with this and locations specifically.
Good to merge.

@neykov can you review these additional commits please? Do you agree that we should merge this, and not @grkvlt 's #279?
When refactoring the tests to remove duplication, I realised that if one uses:
provisioning.properties:
  password: $brooklyn:config("password")

And then subsequently calls jcloudsSshMachineLocation.getHostname() outside of the context of an entity, then it fails to resolve (because it doesn't know which entity to look at the config on).
I discussed the short term fix with @neykov, and applied it here: it avoids propagating the exception if the credentials can't be obtained, and it only look up the credentials if we really need them (e.g. for hostname on AWS, where we ask the VM for it).

I also discussed the longer term solution with @neykov. Conclusion is that it's hard. And that we should resolve the DSL config's context at the time the entity is being instantiated (e.g. storing it as a field on the DslConfigSupplier or whatever). This would mean we'd always use the entity on which the config was declared, rather than relying on who is looking it up. However, there is (probably?!) an exception to that rule: if you declare config with an @brooklyn:entitySpec, such as for a memberSpec, then you probably want it to refer to the context of the entity to be created rather than the entity where you are declaring the entitySpec (and therefore if setting the entity context on the DSL object, you'd need to ensure it is a different DSL object instance for each member instantiated using the entitySpec!).
That deserves its own thread on dev@brooklyn.

Tested by @duncangrant (for his use-case with kubernetes in clocker, which also motivated his https://github.com/apache/brooklyn-server/pull/361). Merging now.

+1 for  merging.


New package: MetaAnalysis v0.1.0

Registering package: MetaAnalysis
Repository: https://github.com/arinbasu/MetaAnalysis.jl
Created by: @arinbasu
Version: v0.1.0
Commit: 074b703163dbcbff33a5604c9c0628e1b4bf93aa
Git reference: main
Description: This repository is a Julia Meta analysis package

I hope you can turn the README into something more substantiv


added heading, subtitle, icon_badge

added heading, subtitle and icon_badge. I had to remove return statement.

Thank you very much for your effort but the initial body restrictions will be removed in next release so there is no need for adding extra parameters.


Function keys are not translated

Steps to Reproduce

Execute flutter run on the code sample: https://dartpad.dev/?id=e9b2984ed54c2d092a3f3fc91dc2dd60
Click on file
Saw the wrong unicode character

Expected results:
Maybe the text "F11"?
Actual results:
Weird unicode character

Code sample

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

void main() => runApp(const MenuAcceleratorApp());

class MyMenuBar extends StatelessWidget {
  const MyMenuBar({super.key});

  @override
  Widget build(BuildContext context) {
    return Column(
      children: <Widget>[
        Row(
          mainAxisSize: MainAxisSize.min,
          children: <Widget>[
            Expanded(
              child: MenuBar(
                children: <Widget>[
                  SubmenuButton(menuChildren: <Widget>[
                    MenuItemButton(
                      onPressed: () {
                        showAboutDialog(
                          context: context,
                          applicationName: 'MenuBar Sample',
                          applicationVersion: '1.0.0',
                        );
                      },
                      shortcut: const SingleActivator(LogicalKeyboardKey.f11),
                      child: const MenuAcceleratorLabel('&About'),
                    ),
                  ], child: const Text("File")),
                ],
              ),
            ),
          ],
        ),
        Expanded(
          child: FlutterLogo(
            size: MediaQuery.of(context).size.shortestSide * 0.5,
          ),
        ),
      ],
    );
  }
}

class MenuAcceleratorApp extends StatelessWidget {
  const MenuAcceleratorApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Shortcuts(
        shortcuts: <ShortcutActivator, Intent>{
          const SingleActivator(LogicalKeyboardKey.keyT, control: true):
              VoidCallbackIntent(() {
            debugDumpApp();
          }),
        },
        child: const Scaffold(body: MyMenuBar()),
      ),
    );
  }
}

Logs
"zh_Hant": 11 untranslated message(s).
To see a detailed report, use the untranslated-messages-file
option in the l10n.yaml file:
untranslated-messages-file: desiredFileName.txt
<other option>: <other selection>
This will generate a JSON format file containing all messages that
need to be translated.
This app is linked to the debug service: ws://<IP_ADDRESS>:55714/JQrtxdEhHLo=/ws
Debug service listening on ws://<IP_ADDRESS>:55714/JQrtxdEhHLo=/ws
 Running with sound null safety
Connecting to VM Service at ws://<IP_ADDRESS>:55714/JQrtxdEhHLo=/ws

Analyzing app...
No issues found! (ran in 5.4s)

[√] Flutter (Channel stable, 3.7.8, on Microsoft Windows [Version 10.0.19045.2788], locale de-DE)
    • Flutter version 3.7.8 on channel stable at C:\src\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 90c64ed42b (4 days ago), 2023-03-21 11:27:08 -0500
    • Engine revision 9aa7816315
    • Dart version 2.19.5
    • DevTools version 2.20.1

[X] Windows Version (Unable to confirm if installed Windows version is 10 or greater)

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at C:\Users\wusel\AppData\Local\Android\sdk
    X cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[√] Visual Studio - develop for Windows (Visual Studio Build Tools 2022 17.5.3)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools
    • Visual Studio Build Tools 2022 version 17.5.33516.290
    • Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2022.3)
    • Android Studio at C:\Users\wusel\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\223.8836.35.2231.9762515
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9746777)

[√] IntelliJ IDEA Ultimate Edition (version 2022.3)
    • IntelliJ at C:\Users\wusel\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\223.8836.41
    • Flutter plugin version 72.1.4
    • Dart plugin version 223.8888

[√] IntelliJ IDEA Ultimate Edition (version 2023.1)
    • IntelliJ at C:\Users\wusel\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-1\231.8109.90
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart

[√] VS Code (version 1.76.2)
    • VS Code at C:\Users\wusel\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.60.0

[√] Connected device (2 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19045.2788]
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 111.0.1661.54

[√] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 3 categories.

I think the issue is inside this method:
_LocalizedShortcutLabeler.instance.getShortcutLabel(
                shortcut!,
                MaterialLocalizations.of(context),
              ),

It would be cool if this method is public that I can translate these shortcut outside of the MenuItemButton.

Thanks for the report, @CodeDoctorDE
It seems this issue only happens on Web (As I can see it displays correctly on Android with F11).

Demo Android

And I also see there is this log from the output console:
Could not find a set of Noto fonts to display all missing characters. Please add a font asset for the missing characters. See: https://flutter.dev/docs/cookbook/design/fonts

On Web, it looks like going wrong on both renders HTML and Canvaskit:

Web (canvaskit)
Web (HTML)

Please retry and confirm this. If you also have the same above results, you might take a look at https://github.com/flutter/flutter/issues/79172 (which has similar behaviors and log). And please follow up on it for further updates.

Oh, I can confirm it. Sorry, I didn't find this issue before creating this one. This error will be displayed when opening the menu.
On windows it also works fine

Thanks for your confirmation. Closing this issue in favor of https://github.com/flutter/flutter/issues/79172.


website: Unclear content on "mbed TLS Core Features" page

Description

Type: Website Issue
Priority: Minor

Website Issue
At https://tls.mbed.org/core-features, under "Ensuring code quality", below reassuring notice "You want to use high-quality code that is bug-free. So do we!", there's a sentence like:

Because most of the world uses OpenSSL as a basis, we think it's no more that logical to ensure compatibility.

I'm not sure I can understand the 2nd part of the sentence. I'm not a native English speaker, so there's always a chance of me missing something, but the phrase doesn't look like written in literature English to me. Perhaps, the 2nd part should read as "... we think it's more than logical to ensure compatibility." That still not a stellar phrase stylistically, but at least grammar makes sense.
One of the next sentences is:

In addition we test against GnuTLS and we test SSL options, resumptions and extensions for correctness.

This one, it's not very clear what "resumptions" are meant there. No, a TLS expert could understand that sentence, likely "SSL session resumptions" were meant there. But a more layman reader might be perplexed - while "SSL options" and "SSL extensions" are describe in this document previously, word "resumption" doesn't appear anywhere else. A suggestion would be to rewrite the sentence as e.g.:
"In addition we test against GnuTLS, and we test SSL options, session resumption operations, and extensions for correctness."
As the initial quote from this doc ("You want to use high-quality code that is bug-free. So do we!") says, it's important to have the high-quality code. But not less it's important to have high-quality documentation. Confusing documentation for security code correlates with incorrect usage of it, which undermines its security properties.
Thanks.
(To clarify, this is submitted as part of Linaro engineer's work on (further) integration of mbedTLS into Zephyr RTOS, specifically, assessing how easy it is to perform correct mbedTLS configuration based on the available documentation.)

Thanks for the feedback! We'll look into it.

On https://tls.mbed.org/kb/development/thread-safety-and-multi-threading , there's an occurrence of "MBEDTS_THREADING_PTHREAD" (missing "L" in "MBEDTS").

Hi @pfalcon Thank you for informing us on the typo! I have fixed the typo in the article.
Thanks again!

@RonEld : Thanks! Closing then.

@pfalcon I fixed the typo in the article you mentioned in your second comment. I didn't fix the site page where the original issue was raised on. If you think that it still needs attention, please reopen

Well, if you guys think that such reports are useful, sure. (Myself, I think that mbedTLS is important piece of the modern IoT infrastructure, and it's worth polishing it from different sides.) Reopening, thanks.

ARM Internal Ref: IOTSSL-2531


Call setRegistrationProperties endpoint for registrations instead of using Firebase directly

Description
We need to add the country code to the registration node in firebase, to enable region based invite rewards. To decrease our reliance on firebase, we have a new setRegistrationProperties endpoint created that we should call instead.
This PR:

adds country to the firebase rtdb schema
replaces the direct calls to Firebase with setRegistrationProperties endpoint for updating registration details
adds redux variable for signed message, which is used for authentication for the setRegistrationProperties endpoint. this is a redux variable so that it can be persisted and accessed without further authentication (compared to keychain item, where the pincode or biometrics is needed)

Note that no changes were made to the RTDB for now, the only extra authentication is on the setRegistrationProperties endpoint.
Also note that because the private key is used to generated the signed message, and we call the registration node early in the user journey, existing users will see the pincode screen the first time they upgrade their app. New users/users restoring their account will already have their password cached and will not be affected.
Other changes
N/A
Tested
Unit tests and manually
How others should test
General regression - as noted above, the app should continue to work with the exception of existing users who update to this app version. Existing users will be greeted with the pincode screen on first app start only, in order to generate their signed message.
Related issues

Relates to https://github.com/valora-inc/invite-rewards/issues/40

Backwards compatibility
Yes

Also, we're updating the registration node this way, but I think we also need to update the mapping in the users node in this way 😅

hey @gnardini @jeanregisser this is ready for another pass. a lot of stuff has been updated since your reviews, thanks for all the feedback!

the signed message is now stored on the keychain instead of in redux
there are 2 places where we generate the signed message - when an account is created/imported (for new users), and when the account is unlocked (for existing users)
the registration endpoint is called when a new signed message is generated
i'm using signPersonalMessage instead of signTypedMessage for now, since this is the way the registration endpoint is expecting the message. i've sent a message to Victor to ask about the security implications of the 2 functions, i'm happy to update this later if we decide to

Update: Victor recommended to use signTypedMessage, for a more structured signing interface but also to address the main security concern is “domain collisions” where a message signed for one purpose/context overlaps with a message signed for a different purpose/context - i'm convinced, but this will also need a change from the registrations api code that verifies the auth.
i'll make a change there and submit a separate PR to avoid blocking this functionality


Universal listings: allow to adapt active filters

Is your proposal related to a problem?
Currently, the code that builds the active filters is quite limited to a supported set of filter classes (django-filter):
https://github.com/wagtail/wagtail/blob/c11db31a787ab68df79bb051838dc51633a8b2ee/wagtail/admin/views/generic/base.py#L251-L321
Since the new filter handling (with those nice filter-pills) is applied to all generic listings (so for all ModelViewSet-subclasses), I think we should provide a way, to extend the above handling. Its very easy to add new filters, which aren't handled by the code ;) The code above will never be able to handle all filter setups.
For example, we also use  BooleanFilter, TypedChoiceFilter and MultipleChoiceFilter, which aren't handled by Wagtail, therefore displayed wrong, but also quite custom filter fields, which can only be handled by the custom code.
Describe the solution you'd like
As a first step we could extract the type-checking block (code) into a separate method, which gets all the available data (field_name, filter_def, bound_field, value) and returns an ActiveFilter or None (if this filter actually isn't active).
TBD: I'm not sure, if this is the best solution, or if we should actually extract the full code of the loop-body (code) into the new method, and just pass the field_name, which then returns an optional ActiveFilter. This way, it allows even more customization (e.g. handle/skip some fields based on other factors).
Additional context
https://github.com/wagtail/wagtail/pull/11467#discussion_r1456322763
Working on this

Anyone can contribute to this. View our contributing guidelines, add a comment to the issue once you’re ready to start.

Fyi: Our implementation for BooleanFilter and MultipleChoiceFilter is quite generic, so those may be added to the core's implementation too (probably separate issue/PR):

elif isinstance(filter_def, django_filters.MultipleChoiceFilter):
    choices = {str(id): label for id, label in filter_def.field.choices}
    for item in value:
        filters.append(
            ActiveFilter(
                bound_field.auto_id,
                filter_def.label,
                choices.get(str(item), str(item)),
                self.get_url_without_filter_param_value(field_name, str(item)),
            )
        )
elif isinstance(filter_def, django_filters.BooleanFilter):
    if value:
        filters.append(
            ActiveFilter(
                bound_field.auto_id,
                filter_def.label,
                _("Yes"),
                self.get_url_without_filter_param(field_name),
            )
        )
    # else: the checkbox is unchecked (default), therefore not active

The handling of BooleanFilter differs a bit from the proposed https://github.com/wagtail/wagtail/pull/11467#discussion_r1456322763, but actually only the true-ish value is relevant for the active filters (at least in the cases I had so far).

Thanks for the suggestion! I agree that there should be a way for custom filters to define how the "active filter" pill should be displayed. I was thinking of adding this but we were short on time and wasn't sure if this namedtuple is indeed something we want to expose to developers.
I think the way to go would be to use a registry, similar to how we define such overridable parts in the admin, e.g. custom field widgets, or more recently to define how fields are rendered in the inspect view.

Hello Sir @laymonage  i want to work on this issue, can you assign me please

Thanks for your interest @ProgrammingPirates! We do not assign issues outside of the core team - anyone is free to work on any issue.
We recommend thoroughly reading https://docs.wagtail.org/en/latest/contributing/first_contribution_guide.html before making your first contribution. You may also wish to join our #new-contributors channel on Slack.


Add license field in package.json

From npm documentation:

You should specify a license for your package so that people know how they are permitted to use it, and any restrictions you're placing on it.

+1

:+1:

Hi
I'm merging this but I recommend not using nomnomnomnom


Kernel boot logo

Steps to reproduce issue
Connect to the HDMI connected to a monitor
Boot the device
Expected result
The tux (linux) logos should not be visible on the screen
Actual result
HDMI doesnt work on Artik10, this is a known issue
Other information
Reported by: Shaun Mulligan
Test configuration: Artik 10
Test case number: TC08
Test run: https://resinio.testlodge.com/projects/16238/runs/212560?tab=2&run_section_id=210869&executed_case_id=10046693#executed_case_10046693

No further development is planned for this board.


Carousel swipe support

Is your feature request related to a problem? Please describe.
I would like to use the carousel component in mobile app where swipe support would greatly improve the UX.
Describe the solution you'd like
Support swiping left and right the cycle through the items.
Describe alternatives you've considered
None.
Additional context

Hey @tdashworth,
This is a reasonable request - I'll add it to the v2.0 roadmap.

Please fix this asap.

This seems to work already (at least using react) and therefore closing.

What is the status of this functionality? In the HTML it does not work yet or in the documentation, it shows how to activate the feature

I would recommend re-opening this. Swiping is definitely not working outside of React.

Just use embla-carousel


Autocomplete: Passing and retrieving other values

Hello, sorry if I bring this here but I didn't found answer anywhere (here, stackoverflow, the gitter chat, nothing...).
The problem is simple, when I write App, I find "Apple" result and click it, I would like to take a custom parameter that is not the text.
If someone know a solution or a workaround please answer here... I'm going crazy over this. Thank you.
Materialize version: 1.0.0-rc.2

I have same problem with you..

@newmoon gave me the solution on gitter. It's a momentary workaround but it works like a charm (I didn't thought that solution!)
Here you go:
https://codepen.io/anon/pen/YOraMM?editors=0010

@newmoon gave me the solution on gitter. It's a momentary workaround but it works like a charm (I didn't thought that solution!)
Here you go:
https://codepen.io/anon/pen/YOraMM?editors=0010

Thankyou.. for now i can used thats solution..

:+1:


Terminal tabs are not restored in another window after closing it and opening again

Does this issue occur when all extensions are disabled?: Yes

VS Code Version: 1.89.1
OS Version: Ubuntu 22.04.4

Steps to Reproduce:

Open two or more VSCode windows with different projects
Open multiple tabs in terminal in one of those projects, and run some commands in those tabs
Close that project window with close window command or choosing menu - file - close window or the given shortcut
Reopen the closed project, choosing menu - file - open recent
Observe that only the one initial terminal tab is open, the rest of terminal tabs have gone

This issue is present only when one of the multiple VSCode project windows is closed with close window option.
When e.g. the whole VSCode app is exited (all opened windows are closed at once) by choosing menu - file - exit (or the given shortcut), then after reopening the VSCode, all project windows are restored properly with all terminal tabs.

I cannot reproduce - what do you have for the value of terminal.integrated.persistentSessionReviveProcess


rio.Popup Anchors Incorrectly on Auto-Reconnect

Describe the bug
When loading a page with a rio.Popup, the popup sometimes anchors to the top-left corner of the screen instead of the intended location. This behavior only occurs when the browser auto-reconnects to the page (e.g., after a brief network disconnect), and does not happen when navigating to the page manually.

Is there an easy way to reproduce this? I suspect that the impending changes to how popups are displayed will fix this, but I don't know how to test it


Azure setup

A small set of changes that

Renumbers the notebooks (again)
Adds environment.txt and requirements.txt files with our respective conda and pip dependencies
Adds a small "Installation and setup" section to the index notebook that creates our env

Note, this currently does not include dask or yask dependencies or setup, but that can be added easily.

Great, yes, feel free to merge

Cool, merging.


Verify parsers don't mistake trailing whitespace for date/time separator

Since my parser combinator library is LL(1) by default, it thought the space between 27 and # was the date / time separator.
foo = 1979-05-27 # Comment

See https://github.com/ordian/toml_edit/issues/269
I'm assuming others might run into this and it'd be good to upstream the test case.

There's actually already a test for this: https://github.com/BurntSushi/toml-test/blob/master/tests/valid/comment/everywhere.toml#L27
That has two spaces though, not one, maybe that's why it didn't fail?
Actually not sure if no space (e.g. d = 1979-05-27T07:32:12-07:00# c) is allowed too; I'd have to check.

But in general: if you have a bug like this that isn't caught by the existing tests then a test should be added.


[RFC] Apply our brand colors on source{d} dashboards

supersedes #241 (This PR is the second stage, as defined by https://github.com/src-d/sourced-ui/pull/241#issuecomment-519432613)
depends on #258, which depend on #257

DISCLAIMER: This PR introduces visual changes (in charts color scheme) that should be validated or modified by @src-d/product.

This PR ads two new palettes for categorical schemes and two new ones for sequential schemes. This commits also applies source{d} brand over srcdSix and srcdDuo palettes.
This commit also stablish srcdMain and lime_white_royal as the defaults palettes when using SUPERSET_DEFAULT in categorical and sequential schemes.
List of changes (only this last commit is new):

21e90b8 Add the new theme with source{d} theme

You can find below screenshots showing how this proposal looks like compared with our current color schemes.
overview dashboard

collaboration dashboard
note: Pull Requests Workflow chart could not be customized because its underlying type (Event Flow) does not allow to change its visual properties.

@dpordomingo Already started building a rationale on the branding design doc "Charts Colour Scheme".

@src-d/applications
My last commit e65a75f improves the Charts Colour scheme. This is the result of a collaboration with Anita Lillie from Superset's design community, and the full rationale can be seen on the source{d}-branded Superset UI Design Doc on the Charts Colours Section.
Needless to say that @dpordomingo did all the hard work, and improving it couldn't have been more streamlined by him 🙏
When this is merged, we close source{d}-branded superset UI from 2019-R7-CE.

@carlosms Thanks for the review, all changes were addressed on my last commit 0a27441.

LGTM @ricardobaeta
How should we proceed to merge & release?

@dpordomingo The plan was established by @src-d/product for the 2019-R7-CE. We addressed the changes and fully documented our decisions on the  source{d} Branding Design Doc.
I would say we can go for the merge and release.

I rebased and performing the sanity check, I realized that the colors are not ordered as in the design doc, and also that sky color is not in that document, so I pushed some commits to implement the palette defined in the docs.
@ricardobaeta should I merge with my proposal? or is the color gradient (on the palettes you pushed) different than the one in the design document on purpose?
Before my commits:
It was pushed this palette, which has a different color gradient compared with the design doc.

It would create this color distribution, for example:

With my commits:
The palette I just pushed implements the gradient as in the design doc, and removes the sky color because it does not exist in that docs:

it would produce this other distribution, imho more balanced.

click to see the code used to draw the palettes above
const PR_palette = {
    royal: '#7015a8',
    royalMiddle: '#8719cb',
    royalDeep: '#591085',
    royalLight: '#a438e7',
    royalLightDeep: '#bc6ded',

    lime: '#008168',
    limeMiddle: '#009b7c',
    blueDeep: '#006853',
    limeLight: '#00b491',
    blueLightDeep: '#00c8a1',

    coral: '#e5770a',
    coralMiddle: '#f68b0c',
    coralDeep: '#d66600',
    coralLight: '#f89c30',
    coralLightDeep: '#f9ae56',

    vanila: '#d024c6',
    vanilaLight: '#e981e3',

    navy: '#195dca',
    navyLight: '#8fb5f1',

    sky: '#29bff2',
    skyLight: '#c9effc',

    gray: '#6d6e71',
    grayLight: '#c6c7c8',
};

const PR_scheme = palette => [
    {
        id: 'srcdMain',
        label: 'source{d} main colors',
        colors: [
            palette.royal,
            palette.royalDeep,
            palette.royalLight,
            palette.royalLightDeep,
            palette.lime,
            palette.blueDeep,
            palette.limeLight,
            palette.blueLightDeep,
            palette.coral,
            palette.coralDeep,
            palette.coralLight,
            palette.coralLightDeep,
        ],
    },
    {
        id: 'srcdAll',
        label: 'source{d} all colors + middle gradient',
        colors: [
            palette.royal,
            palette.royalMiddle,
            palette.royalDeep,
            palette.royalLight,
            palette.royalLightDeep,
            palette.lime,
            palette.limeMiddle,
            palette.blueDeep,
            palette.limeLight,
            palette.blueLightDeep,
            palette.coral,
            palette.coralMiddle,
            palette.coralDeep,
            palette.coralLight,
            palette.coralLightDeep,
            palette.vanila,
            palette.vanilaLight,
            palette.navy,
            palette.navyLight,
            palette.sky,
            palette.skyLight,
            palette.gray,
            palette.grayLight,
        ],
    },
    {
        id: 'srcdSix',
        label: 'source{d} six colors',
        colors: [
            palette.royal,
            palette.lime,
            palette.coral,
            palette.vanila,
            palette.navy,
            palette.sky,
        ],
    },
    {
        id: 'srcdDuo',
        label: 'source{d} two colors',
        colors: [
            palette.royal,
            palette.royalDeep,
        ],
    },
];

const ALT_palette = {
    royalDeep: '#591085',
    royalMiddle: '#7015a8',
    royal: '#8719cb',
    royalLightDeep: '#a438e7',
    royalLight: '#bc6ded',

    coralDeep: '#d66600',
    coralMiddle: '#e5770a',
    coral: '#f68b0c',
    coralLightDeep: '#f89c30',
    coralLight: '#f9ae56',

    limeDeep: '#006853',
    limeMiddle: '#008168',
    lime: '#009b7c',
    limeLightDeep: '#00b491',
    limeLight: '#00c8a1',

    vanila: '#d024c6',
    vanilaLight: '#e981e3',

    navy: '#195dca',
    navyLight: '#8fb5f1',

    gray: '#6d6e71',
    grayLight: '#c6c7c8',
}

const ALT_scheme = palette => [
    {
        id: 'srcdMain',
        label: 'source{d} main colors',
        colors: [
            palette.royalDeep,
            palette.royal,
            palette.royalLightDeep,
            palette.royalLight,
            palette.coralDeep,
            palette.coral,
            palette.coralLightDeep,
            palette.coralLight,
            palette.limeDeep,
            palette.lime,
            palette.limeLightDeep,
            palette.limeLight,
        ],
    },
    {
        id: 'srcdAll',
        label: 'source{d} all colors + middle gradient',
        colors: [
            palette.royalDeep,
            palette.royalMiddle,
            palette.royal,
            palette.royalLightDeep,
            palette.royalLight,
            palette.coralDeep,
            palette.coralMiddle,
            palette.coral,
            palette.coralLightDeep,
            palette.coralLight,
            palette.limeDeep,
            palette.limeMiddle,
            palette.lime,
            palette.limeLightDeep,
            palette.limeLight,
            palette.vanila,
            palette.vanilaLight,
            palette.navy,
            palette.navyLight,
            palette.gray,
            palette.grayLight,
        ],
    },
    {
        id: 'srcdSix',
        label: 'source{d} six colors',
        colors: [
            palette.royalDeep,
            palette.coralMiddle,
            palette.lime,
            palette.vanila,
            palette.navy,
            palette.gray,
        ],
    },
    {
        id: 'srcdDuo',
        label: 'source{d} two colors',
        colors: [
            palette.royalMiddle,
            palette.royalLight,
        ],
    },
];

const prepare = () => {
    style = document.createElement('style');
    style.innerHTML = `
        body {
            margin: 20px;
        }
        h1 {
            margin-top: 20px;
        }
        .label,
        .color {
            display: inline-block;
            margin: 2px 1px;
            padding: 20px 6px;
        }
        .label {
            width: 75px;
            text-align: right;
            color: #666;
        }
        .color {
            font-family: courier;
            color: #fff;
            font-size: 11px;
            margin-left: 0px;
        }`;
    document.body.innerHTML = '';
    document.body.appendChild(style);
}

const print = scheme => scheme.forEach(p => {
    const palette = document.createElement('div');
    const label = document.createElement('span');
    label.className = 'label';
    label.innerHTML = p.id;
    palette.appendChild(label);
    p.colors.forEach(c => {
        const color = document.createElement('span');
        color.className = 'color';
        color.style.background = c;
        color.innerHTML = c;
        palette.appendChild(color);
    });
    document.body.appendChild(palette);
});

const header = text => {
    const title = document.createElement('h1')
    title.innerHTML = text;
    document.body.appendChild(title);
};

prepare();
header('PR palette')
print(PR_scheme(PR_palette));
header('alternative palette')
print(ALT_scheme(ALT_palette));


Extract function breaks code with switch statement

function foo() {
	let x = 10;
	switch (x) {
		case 1:
			break;
	}
}

select break;
extract
you get

function foo() {
	let x = 10;
	switch (x) {
		case 1:
            newFunction();
	}
}
function newFunction() {
    break;
}

I'm guessing the bug is that we allow the extraction.  It doesn't appear to work with break in a loop.

It looks like the loop case only works by accident - we check if the parent of the statement is a loop and it's not - it's a block.  As far as I can tell, there's no code for handling unlabeled break and continue statements with targets outside the extracted range.


ionic geo location is not working in android mobile

I get location in my mobile ( yuforia 5010A ) but When I install app in my friend mobile then its not working.
i didn't understand why its not working in other mobile.
below is my code .
this.loact.request(this.loact.REQUEST_PRIORITY_HIGH_ACCURACY).then(() =>{
         this.geolocation.getCurrentPosition(enableOption).then((position) => {
           this.geoCuntory(position);
            }).catch((error) => {
              alert(error);
             });

      }, (error)=>{
         alert(error);
        }

Please help me out to get solution

Hello! Thank you for opening an issue with us!
The Ionic Framework issues list is designated for the reporting of bugs with the Ionic Framework or for requesting new features. As this seems to be either a support question or a potential issue with a specific Cordova plugin, I am going to close this issue.
I urge that you ask this question on our forum or on our slack channel.
If the issue is with the plugin itself, please enter an issue in the plugin's repo.
Thanks for using Ionic!

Thank You sir for reply me .
On Wed, Oct 11, 2017 at 4:01 PM, Ken Sodemann<EMAIL_ADDRESS>wrote:

Hello! Thank you for opening an issue with us!
The Ionic Framework issues list is designated for the reporting of bugs
with the Ionic Framework or for requesting new features. As this seems to
be either a support question or a potential issue with a specific Cordova
plugin, I am going to close this issue.
I urge that you ask this question on our forum
https://forum.ionicframework.com or on our slack channel
https://ionicworldwide.herokuapp.com/.
If the issue is with the plugin itself, please enter an issue in the
plugin's repo.
Thanks for using Ionic!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/ionic-team/ionic/issues/13111#issuecomment-335767227,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AUQU6x7OxEx8bPA_C8HuWs3zcyNO-WVMks5srJkDgaJpZM4P1L0d
.


Dataset organization issues

When trying to run the prepare_inception.py script, I am getting the following error:
OSError: ./semanticGAN_code/CelebAMask-HQ/CelebA-HQ-img/unlabel_data/unlabel_list.txt not found.
It seems like the unlabel_data directory does not exist within the CelebA Mask dataset. How can I find the missing file and organize the directory?

hi @Sinjini15 , prepare_inception.py is trying to calculate FID stats on real images and store it locally. You can generate the list of image in unlabel_list.txt or modify data loader on how to load the images.


Limit number of districts touched by each vehicle in VRP

Need help:
I have to solve a simple VRP on a city with multiple districts and I want to limit the maximum number of ditricts touched by each vehicle/route.
Orders=[(x1,y1),(x2,y1),(x3,y3)...(xN,yN)] # each order is identified by its coordinates
Districts=[1,2,3] # only 3 districts for simplicity
Order_district=[2,3,2,...1] # orders belong to one of three districts
My first thought was to add a penalty for each "touched district", but it's hard for me to define a correct Disjunction.
Another option would be to define a dimension based on the length of the Set of touched districts (ie the number of distinct district the route touches), but again how to define such a Dimension?
Then I realized that it must be a hard constraint and tried with the following:
`
traversed_zones=[]
for v in all_vehicles:
traversed_zones.append([[]]*len(all_zones))

for p in all_points:

	z=zones[p]

	traversed_zones[v][z].append(model.VehicleVar(manager.NodeToIndex(p))==v) #True if the vehicle v serves the point p

# sum 1 for all zones with at least one point served by the vehicle v

solver.AddConstraint( solver.Sum(1 for z in traversed_zones[v] if solver.Sum(z)>0) < 3)

`
but running it I get no solution.
I tried a lot of variation of this approach but with no success
Any help or usefull example of using such a derived constraint?
Thank you all!

There was already a discussion on this subject.
I have no good answers.
You could imagine a distance matrix that is mostly 0, except on arcs
crossing districts.
Then setting a maximum on the associated dimension is a proxy for this.
Especially if the limite is strong.
limit of 0 + 0 distance from depot to any district -> forces you to stay in
1 district
limit of 1 -> you can cross 1, but you cannot come back to your first
district visited
limit of 2 -> one back and forth between 2 districts, or 3 districts
visited.
I have no better ideas that fit nicely in the framework.
If the problem is small (less than 30-40 visits), we can try to solve it
with the CP-SAT solver. But it will be slower than the routing library.
Laurent Perron | Operations Research |<EMAIL_ADDRESS>| (33) 1 42 68 53
00
Le lun. 3 juin 2019 à 11:51, madolmo<EMAIL_ADDRESS>a écrit :

Need help:
I have to solve a simple VRP on a city with multiple districts and I want
to limit the maximum number of ditricts touched by each vehicle/route.
Orders=[(x1,y1),(x2,y1),(x3,y3)...(xN,yN)] # each order is identified by
its coordinates
Districts=[1,2,3] # only 3 districts for simplicity
Order_district=[2,3,2,...1] # orders belong to one of three districts
My first thought was to add a penalty for each "touched district", but
it's hard for me to define a correct Disjunction.
Another option would be to define a dimension based on the length of the
Set of touched districts (ie the number of distinct district the route
touches), but again how to define such a Dimension?
Then I realized that it must be a hard constraint and tried with the
following:
`
traversed_zones=[]
for v in all_vehicles:
traversed_zones.append([[]]*len(all_zones))
for p in all_points:
z=zones[p]
traversed_zones[v][z].append(model.VehicleVar(manager.NodeToIndex(p))==v) #True if the vehicle v serves the point p
sum 1 for all zones with at least one point served by the vehicle v
solver.AddConstraint( solver.Sum(1 for z in traversed_zones[v] if solver.Sum(z)>0) < 3)
`
but running it I get no solution.
I tried a lot of variation of this approach but with no success
Any help or usefull example of using such a derived constraint?
Thank you all!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/google/or-tools/issues/1320?email_source=notifications&email_token=ACUPL3LZ7ER3OHH7SPTDBGDPYTSQ7A5CNFSM4HSGMR22YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GXHVULA,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACUPL3JFSIAOAD6GAYC4E6TPYTSQ7ANCNFSM4HSGMR2Q
.

Thank you for your immediate reply :)
I got it to work in the way you suggest adding a dimension that cumuls the district crossed between first and last service point (the depot's district doesn't matter), but it's slightly different, in this way the vehicles can't do more crossing between the same 2 zones and this could lead to a bad optimization in strange cases when the service points are located along the borders.
I really would like to use the constraint the way I designed it or at least understand why it doesn't work! :)

Maybe it's worth mentioning that my sample problem does have solutions with all vehicles touching less then 3 districts

I think I did a little step forward, now I can see the constraint I would expect but it's still not working.
`    traversed_zones=[]
limit=3
for v in all_vehicles:
    traversed_zones.append([[]]*len(all_zones))
    for p in all_points:
        z=zones[p]
        traversed_zones[v][z].append((model.VehicleVar(p)==model.VehicleVar(model.Start(v))))

    #sum(max([True if this vehicle serves a point in this zone])) -> counts the served zones
    constraint=(solver.Sum(solver.Max(z) for z in traversed_zones[v])<=limit )

    print(constraint.DebugString())

    solver.AddConstraint(constraint)`

When I run it this is the output:
(BooleanSum([, , , ])(0..4) <= 3)
Which is exactly what I want, but no solutions!
If I run it with a limit of 4 (the total number of zones in this sample) the output changes in:
TrueConstraint()
(And I think this was another confirm that I'm writing the correct constraint because (0..4)<=4 and the solver semplifies it!)
and in this case I get the solution with 2 to 3 zones touched by each vehicle!
I'm going crazy!

I found my error.

I'm reporting it here just in case anyone was interested in (one) correct solution of the problem:
        traversed_zones={}
        for v in all_vehicles:
            traversed_zones[v]={}
            for p in all_points:
                if p>=data['cluster_depots']: # depot's zone doesn't matter
                    z=data['cluster_zones'][p]
                    zone_list=traversed_zones[v].get(z,None)
                    if zone_list==None:
                        zone_list=[]
                        traversed_zones[v][z]=zone_list
                    # vehicle(p)==v -> v serves p in zone z
                    zone_list.append(model.VehicleVar(manager.NodeToIndex(p))==v)

            #sum(max([True for p in points of zone z if vehicle v serves p])) -> counts the served zones
            constraint=(solver.Sum(solver.Max(z) for z in traversed_zones[v].values())<=conf['zones_limit'])
            solver.AddConstraint(constraint)`


Testdata

This is the set of commits that I was talking about that I can't name.
I feel the choice is between av.testdata and av.exampledata as I don't want to have "sample" in the name so it has zero chance of being confused.
This will be used in the tests (as it already is), and in the examples in the docs (there is one example of it being used in this PR).

Is this still current?