adding delete linode test e2e

Description

Adds a test that deletes a linode
And some clean up, reorganize test files
Add testing-library to cypress (to have common way of coding tests across the repo)
Updates tsconfig.json to exclude cypress
Updates ESlint config (remove unused part in packages/manager/package.json add correct one for codacy in .eslintrc.json)
Updates the proxy setting to have API available on localhost:3000/api
Adds also a few tests, using proxying of our API to make it available on localhost enabling extra features (like spying on requests, and stubbing) of cypress.

Function defensiveDo in support/ui/common.js helps handling detached DOM objects due to rerenders, see https://docs.cypress.io/guides/references/error-messages.html#cy-failed-because-the-element-you-are-chaining-off-of-has-become-detached-or-removed-from-the-dom
It has a unit test in integrations/support.spec.js
Type of Change

Non breaking change ('update', 'change')

prerequisite
You need a file ./packages/manager/config/development.json.
See the doc for this file in TESTING.md
You will need an API token, no need to change the rest.
Note, you can use the one from .env if you want
This defines the user running the e2e tests.
{
    "env": {
    "oauthtoken": "xxxxxx YOUR API TOKEN xxx",
    "apiroot": "https://api.linode.com",
    "loginUrl": "https://login.linode.com/login",
    "loginRoot": "https://login.linode.com"
    }
}

test w/ docker

have docker started
run yarn docker:cy

without docker

Because of an update to the proxy setting, you want to restart your localhost:3000 app server (kill and restart yarn up)

TO RUN HEADLESS: once the app is on localhost:3000, run yarn cy:e2e

TO RUN in DEBUG MODE (interactive, browser opened)

testing different browser
Also, tested with chrome electron and Firefox. For Firefox I used brew cask install firefox
To test in cli. 'yarn cy:e2e --headless --browser firefox'
Default 'yarn cy:e2e' uses electron by default.
'yarn cy:debug' for interactive mode you can choose your browser

Codacy reports issues with global 'cy' not being defined. This mostly a non - issue, i ll see if i find a way to declare that with a tsconfig

Bumping the pageLoadTimeout in cypress.json to 15000 gets the delete test passing for me consistently. Otherwise it basically always fails. Cypress doesn't consider the page "loaded" until everything is loaded, and watching Chrome in debug mode, the full page content does take a long time to show up.

So i did a few things:

reduce the dependency of the delete test on reaching the setting tab as this was problematic, and slowing down the test => this should make the test less flaky
increased the timeout => as this is a problem reported by @Jskobos and observed by @patthiel
Added a deleteAllVolumes
reordered the Notification detection for creating a Linode as The toast notification is emitted before the busy state

After changing pageLoadTimeout in cypress.json to 15000, I get 1 failed test in linodes/smoke-delete-linode.spec.js:

1 failing

delete linode deletes test nanode:
CypressError: Timed out retrying: cy.click() failed because this element is detached from the DOM.

Settings
Cypress requires elements be attached in the DOM to interact with them.
The previous command that ran was:

cy.should()

This DOM element likely became detached somewhere between the previous and current command.
Common situations why this happens:

Your JS framework re-rendered asynchronously
Your app code reacted to an event firing and removed the element

You typically need to re-query for the element or add 'guards' which delay Cypress from running new commands.

Pulled your most recent changes and they seem a lot more stable. I haven't had a chance to review the code yet, but i only got one failure over the course of running the whole suit several times.. it could just be related to my horribly slow machine, but 🤷♂
  dashboard
    1) checks load time and number of GET

  0 passing (23s)
  1 failing

  1) dashboard checks load time and number of GET:
     CypressError: Timed out retrying: Expected to find element: '[data-qa-header]', but never found it.
      at cypressErr (http://localhost:3000/__cypress/runner/cypress_runner.js:149934:9)
      at throwErr (http://localhost:3000/__cypress/runner/cypress_runner.js:149867:11)
      at Object.throwErrByPath (http://localhost:3000/__cypress/runner/cypress_runner.js:149915:3)
      at retry (http://localhost:3000/__cypress/runner/cypress_runner.js:144197:19)
      at onFailFn (http://localhost:3000/__cypress/runner/cypress_runner.js:132448:16)
      at tryCatcher (http://localhost:3000/__cypress/runner/cypress_runner.js:167415:23)
      at Promise._settlePromiseFromHandler (http://localhost:3000/__cypress/runner/cypress_runner.js:165351:31)
      at Promise._settlePromise (http://localhost:3000/__cypress/runner/cypress_runner.js:165408:18)
      at Promise._settlePromise0 (http://localhost:3000/__cypress/runner/cypress_runner.js:165453:10)
      at Promise._settlePromises (http://localhost:3000/__cypress/runner/cypress_runner.js:165528:18)
      at Async../node_modules/bluebird/js/release/async.js.Async._drainQueue (http://localhost:3000/__cypress/runner/cypress_runner.js:162140:16)
      at Async../node_modules/bluebird/js/release/async.js.Async._drainQueues (http://localhost:3000/__cypress/runner/cypress_runner.js:162150:10)
      at Async.drainQueues (http://localhost:3000/__cypress/runner/cypress_runner.js:162024:14)

Pulled your most recent changes and they seem a lot more stable. I haven't had a chance to review the code yet, but i only got one failure over the course of running the whole suit several times.. it could just be related to my horribly slow machine, but 🤷♂
  dashboard
    1) checks load time and number of GET

  0 passing (23s)
  1 failing

  1) dashboard checks load time and number of GET:
     CypressError: Timed out retrying: Expected to find element: '[data-qa-header]', but never found it.
      at cypressErr (http://localhost:3000/__cypress/runner/cypress_runner.js:149934:9)
      at throwErr (http://localhost:3000/__cypress/runner/cypress_runner.js:149867:11)
      at Object.throwErrByPath (http://localhost:3000/__cypress/runner/cypress_runner.js:149915:3)
      at retry (http://localhost:3000/__cypress/runner/cypress_runner.js:144197:19)
      at onFailFn (http://localhost:3000/__cypress/runner/cypress_runner.js:132448:16)
      at tryCatcher (http://localhost:3000/__cypress/runner/cypress_runner.js:167415:23)
      at Promise._settlePromiseFromHandler (http://localhost:3000/__cypress/runner/cypress_runner.js:165351:31)
      at Promise._settlePromise (http://localhost:3000/__cypress/runner/cypress_runner.js:165408:18)
      at Promise._settlePromise0 (http://localhost:3000/__cypress/runner/cypress_runner.js:165453:10)
      at Promise._settlePromises (http://localhost:3000/__cypress/runner/cypress_runner.js:165528:18)
      at Async../node_modules/bluebird/js/release/async.js.Async._drainQueue (http://localhost:3000/__cypress/runner/cypress_runner.js:162140:16)
      at Async../node_modules/bluebird/js/release/async.js.Async._drainQueues (http://localhost:3000/__cypress/runner/cypress_runner.js:162150:10)
      at Async.drainQueues (http://localhost:3000/__cypress/runner/cypress_runner.js:162024:14)

This looks like a login error, I will look into why this could happen

After changing pageLoadTimeout in cypress.json to 15000, I get 1 failed test in linodes/smoke-delete-linode.spec.js:
1 failing

  1) delete linode deletes test nanode:
     CypressError: Timed out retrying: cy.click() failed because this element is detached from the DOM.

Settings

Cypress requires elements be attached in the DOM to interact with them.

The previous command that ran was:

  > cy.should()

This DOM element likely became detached somewhere between the previous and current command.

Common situations why this happens:
  - Your JS framework re-rendered asynchronously
  - Your app code reacted to an event firing and removed the element

You typically need to re-query for the element or add 'guards' which delay Cypress from running new commands.

@DevDW Where you running the latest version of the code, because we do not try to find the setting tab to click on it anymore, so this should not happen anymore

It seems like a regression may have occurred related to the login command generating errors since 3/12.
I am investigating if something changed with login.
until then do not merge, although it will also break what is currently in develop
What you may see:

Ran the most recent version twice. When I did it with yarn docker:cy, I got the following failed test:
1 failing

  1) create linode "before each" hook for "creates a nanode":
     CypressError: Timed out after waiting '15000ms' for your remote page to load.

Your page did not fire its 'load' event within '15000ms'.

You can try increasing the 'pageLoadTimeout' value in 'cypress.json' to wait longer.

Browsers will not fire the 'load' event until all stylesheets and scripts are done downloading.

When this 'load' event occurs, Cypress will continue running commands.

Because this error occurred during a 'before each' hook we are skipping the remaining tests in the current suite: 'create linode'
      at cypressErr (http://localhost:3000/__cypress/runner/cypress_runner.js:149934:9)
      at throwErr (http://localhost:3000/__cypress/runner/cypress_runner.js:149867:11)
      at Object.throwErrByPath (http://localhost:3000/__cypress/runner/cypress_runner.js:149915:3)
      at timedOutWaitingForPageLoad (http://localhost:3000/__cypress/runner/cypress_runner.js:138069:20)
      at http://localhost:3000/__cypress/runner/cypress_runner.js:138852:16
      at tryCatcher (http://localhost:3000/__cypress/runner/cypress_runner.js:167415:23)
      at http://localhost:3000/__cypress/runner/cypress_runner.js:162556:41
      at tryCatcher (http://localhost:3000/__cypress/runner/cypress_runner.js:167415:23)
      at Promise._settlePromiseFromHandler (http://localhost:3000/__cypress/runner/cypress_runner.js:165351:31)
      at Promise._settlePromise (http://localhost:3000/__cypress/runner/cypress_runner.js:165408:18)
      at Promise._settlePromise0 (http://localhost:3000/__cypress/runner/cypress_runner.js:165453:10)
      at Promise._settlePromises (http://localhost:3000/__cypress/runner/cypress_runner.js:165528:18)
      at Async../node_modules/bluebird/js/release/async.js.Async._drainQueue (http://localhost:3000/__cypress/runner/cypress_runner.js:162140:16)
      at Async../node_modules/bluebird/js/release/async.js.Async._drainQueues (http://localhost:3000/__cypress/runner/cypress_runner.js:162150:10)
      at Async.drainQueues (http://localhost:3000/__cypress/runner/cypress_runner.js:162024:14)

When I ran it without docker using yarn cy:e2e, all specs passed

I've had a few failures still too, though much rarer now. We could bump the timeout to 20000, since slow tests are better than unpredictable tests, but I don't know enough about good testing practice to know if that's kosher

Considering the 90th percentile time to load the app is about 17 secs, it is probably normal we need to extend the timeout to 20 secs, and i agree with Jared, we d rather want a slow test than a failing test because API is slow.


CI/CD release workflow fails due to dev-preview tags

Describe the bug
The calculate_next_release_version function fails with the message Invalid version: 1.22.0-dev-preview.0 due to the presence of dev-preview tags.
Steps To Reproduce
run the fastlane release lane

Expected behavior
workflow succeeds
Amplify Framework Version
1.21.0
Amplify Categories
Analytics
Dependency manager
Cocoapods
Swift version
n/a
CLI version
n/a
Xcode version
n/a
Relevant log output
Invalid version: 1.22.0-dev-preview.0

Is this a regression?
Yes
Regression additional context
No response
Device
n/a
iOS Version
n/a
Specific to simulators
No response
Additional context
No response

This has been fixed in this commit: https://github.com/aws-amplify/amplify-ci-support/commit/512a6f2f1c92c19f752fb238ad04d077cf3151a5


⚠ Homepage (omg.lol) has degraded performance

In 99d5b9e, Homepage (omg.lol) (https://8bit.lol/) experienced degraded performance:

HTTP code: 0
Response time: 0 ms

Resolved: Homepage (omg.lol) performance has improved in 3fdfb53 after 7 hours, 21 minutes.


Add image generator/saver

I wrote a script that'll generate images (has options num_batches, batch_size, push_to_hub) basically you decide how many images to generate of a certain prompt, and it'll generate ones with completely random seeds, then push them to the Hugging Face Hub. This is nice cuz we can then have an open source gallery of images there.

Closed with #70


ARROW-9850:[Go] Defer should not be used inside a loop

As is described in the second section in https://blog.learngoprogramming.com/gotchas-of-defer-in-go-1-8d070894cb01
defer inside the loop may cause unforeseen problems.

@sbinet do you have time to take look?

@sbinet Hi Sebastien,  I concerned about it. But the loop bodies have some return values(error values), so it's not simple to do like this. So I think it 's not worth to do like that.

well, I'd prefer to keep the robustness coming with defer to release memory no matter what.
but ok.


libprotoc version is not correct in docker build

What type of bug is this?
Other
What subsystems are affected?
Other
What happened?
The README.md file clearly states if I built from source, that protoc version needs greater or equal to 3.15. But in Dockerfile, after docker builds, the version is 3.12.4.
What operating system did you use?
Ubuntu 22.04
Relevant log output and stack trace
# protoc --version
libprotoc 3.12.4

How can we reproduce the bug?
Run docker build

Thanks for your report!
I search into protoc's changelog and find out that

optional support is added in 3.12.0 as an experimental feature, need experimental_allow_proto3_optional flag to enable it
it goes stable in 3.15.0, and doesn't require extra flags since then.

2020-05-12 version 3.12.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)

  Protocol Compiler
  * [experimental] Singular, non-message typed fields in proto3 now support
    presence tracking. This is enabled by adding the "optional" field label and
    passing the --experimental_allow_proto3_optional flag to protoc.
    * For usage info, see docs/field_presence.md.
    * During this experimental phase, code generators s

2021-02-05 version 3.15.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)

  Protocol Compiler
  * Optional fields for proto3 are enabled by default, and no longer require
    the --experimental_allow_proto3_optional flag.

And tonic-build also mentions this:
https://github.com/hyperium/tonic/blob/933f5607350af983e479219a2ef3688484976968/tonic-build/src/prost.rs#L354-L360
But now the codebase doesn't contain optional protocol as we are in progress of refactoring our gRPC protocol. I guess that's why 3.12.4 could compile.


Hachicorp Vault policies

I tested the Github action against HachiCorp Vault policy files, since it detects the formatting errors in the policies, then it failed because doesn't find tf and tfvars.
=> Searching for .tf and .tfvars files
error: unknown option `staged'
Wanted to see if you can include HCL Vault policies  in the action or see if I can omit the step about searching .tf and .tfvars files in order to work with Vault.

@jevalenciap Hello. Can you give an example of a filename you're using as this policy?

@jevalenciap Which version of the action are you using?
git diff --staged was used here in versions prior to v0.3.
Please update it and let me know the result.

Thanks @ChristophShyper for your prompt reponse.
I am using V0.3
- name: Fail on malformatted files
        uses<EMAIL_ADDRESS>        with:
          list: true

It detects formatting issues correcly in the Vault HCL policies but then I got an error.
Adding a screenshot of the error that I am getting:
Not sure if the error is because tf and tfvars files are not found (they oare only applicable for Terraform but not for Vault)

@jevalenciap I found the issue. Due to how GitHub Actions are constructed the version needs to be added be always updated in the manifest file. Which I somehow missed for all this time. As a result even if you had v0.3 in your workflow it still used the image with v0.2.
This line needed to be updated https://github.com/devops-infra/action-format-hcl/pull/70/files#diff-1243c5424efaaa19bd8e813c5e6f6da46316e63761421b3e5f5c8ced9a36e6b6R38
I'll release v0.3.1 now which should work properly.

Thanks @ChristophShyper, I updated the GH action to the version 0.3.1
- name: Fail on malformatted files
        uses<EMAIL_ADDRESS>        with:
          list: true

But now I am getting a cache error once GH action runs.

Looks like git even on Ubuntu acts different than on my host and in some cases (issue with .git) it throws this error.
So from now I'll use find instead of it, while maintaining similar functionality.
This change should do the trick https://github.com/devops-infra/action-format-hcl/pull/71/files#diff-6f9d41d046756f0ddc2fcee0626bdb50100d12b88f293734eff742818e03efa2R58
I'm releasing it with v0.3.2 version.

@ChristophShyper
Great!, I tested it, I am not getting the error anymore.

Thank you so much! I appreciate your diligence and fast response

I'm happy my work is of any help to others 😃


KNOX-2259 KNOX-2260 KNOX-2261 - Fixed Impala/Kudu/HBase UI context path in service metadata

What changes were proposed in this pull request?
Corrected the contexts for Impala/Kudu/HBase UI services and fixed the code which selects the correct service definition when looking for metadata (the version was not considered before).
How was this patch tested?
Tested manually: added a sample descriptor (with IMPALAUI, KUDUUI, HBASEUI services) pointing to a remote cluster (where valid URLs are found). Knox generated the topology properly and the correct URLs are displayed on the Home page.

Looks good.
Suggestion: It might be useful if you update KNOX-2259 with additional fixes done here like for HBase and Metadata code.

Done (HBase and KUDU has its own JIRA; I referenced this PR for them too)


what is the 'stream' struct looks like in rdb file?

I didn't find the stream struct in this wiki, could you add this?

+1


how to hide password when get the model

Issue
How can I hide the password? is there any way to not select the password using typescript-sequelize?
Versions

sequelize: ^6.37.1
sequelize-typescript: 2.1.6
typescript: ^5.1.3

Issue type

[ ] bug report
[ x] feature request

Actual behavior

Expected behavior

Steps to reproduce

Related code

// src/models/user.model.ts

import { Table, Column, Model } from 'sequelize-typescript';
import { Exclude } from 'class-transformer';
import { IsNotEmpty } from 'class-validator';
import { IsEmail } from 'class-validator';

@Table
export class User extends Model {
  @Column
  @IsNotEmpty()
  name: string;

  @Column
  @IsEmail()
  email: string;

  @Column
  @Exclude({ toPlainOnly: true })
  password: string;

  @Column({
    type: 'ENUM',
    values: ['l', 'p'],
  })
  gender: string;
}

I override toJSON
  toJSON() {
    const json = super.toJSON();
    // Make sure that the password is not included in the response
    delete json.password;
    return json;
  }

You can also use scopes for this
@Table
@DefaultScope(() => {
  exclude: ['password']
})
export class User extends Model {...}

And then, for cases where you need it, you can create a different @Scope()
you can find more here https://github.com/sequelize/sequelize-typescript?tab=readme-ov-file#scopes

  @Column({
      get: () => undefined,
  })
  password: string;


Extracting t fragment from Locator

What do you think of providing a method of extracting time(s) from a Locator
There is a private extension on Locator which kind of does this, but looks like it only matches start time (my understanding is that end time can be specified).
https://github.com/readium/swift-toolkit/blob/a62962bbb862a5852ce8f79c5369213f38c79e8e/Sources/Navigator/Audiobook/AudioNavigator.swift#L389-L409
Would you be open to a Locator.time property/function (() -> (Double?, Double?)?). I'd be open to providing a PR for this if you want.

For sure, that would be helpful! Thank you.
This extension should be on Locator.Locations though, you can take inspiration from this HTML extension: https://github.com/readium/swift-toolkit/blob/a62962bbb862a5852ce8f79c5369213f38c79e8e/Sources/Shared/Publication/Extensions/HTML/Locator+HTML.swift
As for the result, I'd prefer a struct or at least tuple with named values.


Clarification: intended behavior of offmol.impropers?

Describe the bug
Not really a bug, possibly naive question about intended behavior in enumerating indices for improper torsions.
I was surprised at the large number of torsions included in offmol.impropers for some molecules (e.g. len(methane.impropers) == 24).
The way offmol.impropers are enumerated appears maximally permissive, in that it doesn't place a constraint on the connectivity or identity of the central atom (except that it must have connectivity of >= 3). I think it's equivalent to returning all chemical environment matches for the SMARTS pattern "[*:1]~[*:2](~[*:3])~[*:4]" ("a central atom and 3 tagged neighbors").
Are there other constraints we wish to impose on the indices returned by offmol.impropers? For example, would it be desirable to impose a constraint that the connectivity of the central atom is exactly 3 ("[*:1]~[X3:2](~[*:3])~[*:4]" )?
To Reproduce
from openforcefield.topology import Molecule

improper_smarts = "[*:1]~[X3:2](~[*:3])~[*:4]"
#permissive_improper_smarts = "[*:1]~[*:2](~[*:3])~[*:4]"

smiles_list = ["C", "N", "CCCCC", 'C'*1000]

def compare_improper_enumeration_schemes(smiles):
    offmol = Molecule.from_smiles(smiles)

    smarts_inds = offmol.chemical_environment_matches(improper_smarts)
    offmol_inds = [tuple([atom.molecule_atom_index for atom in improper]) for improper in offmol.impropers]

    print(f'smiles:\n\t{smiles}')
    print(f'matches for substructure search "{improper_smarts}":\n\t{len(smarts_inds)}')
    print(f'offmol.impropers:\n\t{len(offmol_inds)}')
    print(f'set(smarts_matches) is subset of set(offmol.impropers):\n\t{set(smarts_inds).issubset(offmol_inds)}\n\n')

for smiles in smiles_list:
    compare_improper_enumeration_schemes(smiles)

Output
smiles:
	C
matches for substructure search "[*:1]~[X3:2](~[*:3])~[*:4]":
	0
offmol.impropers:
	24
set(smarts_matches) is subset of set(offmol.impropers):
	True

smiles:
	N
matches for substructure search "[*:1]~[X3:2](~[*:3])~[*:4]":
	6
offmol.impropers:
	6
set(smarts_matches) is subset of set(offmol.impropers):
	True

smiles:
	CCCCC
matches for substructure search "[*:1]~[X3:2](~[*:3])~[*:4]":
	0
offmol.impropers:
	120
set(smarts_matches) is subset of set(offmol.impropers):
	True

smiles:
	CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
matches for substructure search "[*:1]~[X3:2](~[*:3])~[*:4]":
	0
offmol.impropers:
	24000
set(smarts_matches) is subset of set(offmol.impropers):
	True

Computing environment:
openforcefield==0.7.1

The intended behavior here is hard to define. The word impropers will be interpreted differently in SMIRNOFF-land ("give me all the trefoil impropers") versus AMBER-land ("each center has one unique particle tuple which is correct, and that is the only way").
I see where you're going with the *X3:2 pattern, but I don't think it's safe to say that either:

only trivalent atoms can have impropers assigned
all trivalent atoms will have impropers assigned

Impropers are complicated because the only way to know how many of them will be defined is by consulting a ForceField. This means that a Molecule.impropers iterator can not be correct.
Further, during parameterization, the way that we determine the three canonical orderings of a trefoil improper (as opposed to the six possible orderings) is by canonically ordering them according to their Topology particle indices, which may be different from their Molecule particle indices. So, even if we tried to report the trefoil impropers on a molecule, the final parameterized tuples may be different.
I could see two paths forward here:

Leave it as "the maximal number of possible impropers", which is what we have now
Remove it altogether, since it's fairly confusing

I think the issue here is that .impropers returns a huge number of things to sort through, only a small number of which would ever be used by an Amber or SMIRNOFF force field. It seems like there's an easy way to prune down the list of impropers returned to a much smaller list that would still be more than would be assigned, but with a much less crazy overestimate, especially if we split .smirnoff_impropers (central atom is second atom) from .amber_impropers (central atom is first atom).

Ok, that makes sense. Let me take a swing at a spec to add these:

Molecule.smirnoff_impropers

Should return impropers only for trivalent centers
Central atom should be in second position in tuple
Return all orderings of non-central atoms (?)

Molecule.amber_impropers

Same as above, but central atom should be in first position in tuple

Add Topology and TopologyMolecule.smirnoff_impropers and amber_impropers similar to above, but with topology instead of molecule indices.

I'm not sure which way to go on "all orderings of non-central atoms" but it seems better to return all orderings, since it'll be easier for users to prune these down than to permute them up.

Thanks Jeff! That spec makes sense to me.

I'm not sure which way to go on "all orderings of non-central atoms" but it seems better to return all orderings, since it'll be easier for users to prune these down than to permute them up.

I'd also vote for returning all orderings, for the additional reasons that (1) this behavior is simpler to describe and verify than one that tries to canonicalize the ordering or return an arbitrary ordering, (2) this behavior is convenient to implement by chemical_environment_matches.

Leave it as "the maximal number of possible impropers", which is what we have now

Does this spec imply the removal of .impropers in its current state, or leaving it as is (or something in between, like dropping the public .impropers getting and only using ._impropers as something to be fed to .smirnoff_impropers/.amber_impropers)? I'd go for leaving it as is but updating the documentation to make this behavior more explicit (and without this error):
https://github.com/openforcefield/openforcefield/blob/6336eca1240b0f73d4da8010ecc680244b2e6c3a/openforcefield/topology/molecule.py#L3534-L3545

I'd vote for leaving as-is. If we're exposing other methods that provide the needed functionality then there's no pressure for an behavior change/API break. It's a silly method in its current form, but if someone out there is actually using it then there's no need to disrupt them.


token-js: Allow a custom mint address for create-mint

At Aurory we are going to use a custom mint address for our token (generated through the solana grind command), I think this is quite common as other projects (like star atlas etc..) are also using a vanity address.
Currently, it's not possible to directly submit a custom key pair through the cli or the JS mintToken function.
To make it possible:

Add an optional argument to the create-token command, which should be a keypair's path + add a condition here.
Add an optional mintAccountKeypair: Signer to the js function + a condition for the mintAccount

@mvines

it's not possible to directly submit a custom key pair through the cli

The cli supports this actually and it's exactly the code you linked to!

Add an optional argument to the create-token command, which should be a keypair's path + add a condition here.

The optional argument to the create-token command is the custom mint keypair

Do you think it makes sense to add an optional argument to JS createMint function to be able to also use a custom mint address from here?

Yep that seems fine to me!

Might make sense to briefly mention this is being done now in https://github.com/solana-labs/solana-program-library/pull/2539:
https://github.com/solana-labs/solana-program-library/blob/25111c64207c6f684e95990de32c787550f684ba/token/ts/src/actions/createMint.ts#L29-L39

Fixed in #2539

@tevdoradze @joncinque Besides having a cool looking mint address, what's the point of specifying a custom keypair for the mint token? What could you do if you have access to the mint account secret key? Are there any security implications?

@iMrDJAi Your question better belongs on a dedicated support forum like https://solana.stackexchange.com/ -- I (or someone else) would be happy to answer it there!


APIError: Invalid request made, key returns as undefined

The full error is:
APIError: Invalid request made     at C:\Users\kubak\Desktop\breadbot\node_modules\disco-oauth\lib\client.js:106:23     at processTicksAndRejections (node:internal/process/task_queues:93:5) {   statusCode: 400 }
My code:
router.get('/auth', async (req, res) => {
try {
const code = req.query.code;
const key = await authClient.getAccess(code).catch(console.error);
res.cookies.set('key', key);
console.log(key)
  res.send(key)
} catch(e) {
  res.redirect('errors/400')
`}`

});`
The key returns as undefined

Could you share your full code? I suspect it might be due to improper setup since that request is for getting the access token and needs you to have set up your redirect URIs, scopes, client ID and client secret.

Yeah, here its a pastebin link:
https://pastebin.com/xFj3sE08

Ok yeah this is due to improper setup.
On line 7, you set the internal redirect URI to ${config.dashboard.url}/auth which can not be the same as http%3A%2F%2Flocalhost%3A3000%2Fauth which does not contain the /.
Note that even though they are essentially the same, discord needs the two values to be exactly the same, if you set the redirect URI in your dashboard to contain the encoded URI components, make sure all links in the setup also use encoded URI components, any decoded ones will cause errors.

Ok yeah this is due to improper setup.
On line 7, you set the internal redirect URI to ${config.dashboard.url}/auth which can not be the same as http%3A%2F%2Flocalhost%3A3000%2Fauth which does not contain the /.
Note that even though they are essentially the same, discord needs the two values to be exactly the same, if you set the redirect URI in your dashboard to contain the encoded URI components, make sure all links in the setup also use encoded URI components, any decoded ones will cause errors.


Pusher Failed

I used laravel-websockets and pusher to build a real-time auction platform for a small group of farmers. But no matter what I do, the app stops getting new events and "Pusher failed" error is thrown. I tried to increase server size, u limit is 1000. But anytime more than 20 people use the app. Everything goes to hell.
Please help. Is there anything I can do to increase limits and scale other than the ulimit mentioned in the documentation. Does pusher have any limit hardcoded or something?

I am facing the same issue : once I reach +/- 360 simultaneous connections, events are not broadcasted anymore and Laravel starts sending "BroadcastingError / connection to Pusher failed" errors.
The app and sockets server are on 2 different domains/servers and communicate over ssl.
I have tried to follow instructions listed in the Deployment section
and increased the ulimit successfully, but the installation of the 'event' package fails (needs to install php devel, which relies on another dependency etc etc - installation is blocked)

This is unlikely to be a library problem and more likely to be a server configuration problem. I use this library to serve events to players in a browser game, and typically have anywhere from 300-500 players connected simultaneously without dropping events.

Any suggestions on how to configure a VM for this?


Feature: Produce output in inspect findings json format

Scan can produce the result in ShiftLeft inspect json format for inspect users. Following environment variable needs to be set for testing.

SHIFTLEFT_ORG_ID
SHIFTLEFT_ORG_TOKEN
SHIFTLEFT_ACCESS_TOKEN
SHIFTLEFT_APP

PR also includes azure-pipelines config, plus minor tweaks

Sample findings json file

Sample for a go project


fix invalid link

Why are these changes needed?

Fix invalid link
Related issue number

Checks

[ ] I've included any doc changes needed for https://microsoft.github.io/autogen/. See https://microsoft.github.io/autogen/docs/Contribute#documentation to build and test documentation locally.
[ ] I've added tests (if relevant) corresponding to the changes introduced in this PR.
[ ] I've made sure all auto checks have passed.

Codecov Report

Merging #20 (0051570) into main (6f54631) will increase coverage by 0.13%.
Report is 10 commits behind head on main.
The diff coverage is 92.30%.

@@            Coverage Diff             @@
##             main      #20      +/-   ##
==========================================
+ Coverage   34.22%   34.35%   +0.13%
==========================================
  Files          17       17
  Lines        1911     1921      +10
  Branches      416      420       +4
==========================================
+ Hits          654      660       +6
- Misses       1207     1209       +2
- Partials       50       52       +2

Flag
Coverage Δ

unittests
34.35% <92.30%> (+0.18%)
:arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Files
Coverage Δ

autogen/code_utils.py
44.13% <92.30%> (+0.78%)
:arrow_up:


Fix documentation for logger

As mentioned on https://github.com/platformatic/platformatic/issues/305, the current documentation for the logger config is not correct.
From here, we see that is under the server prop, not the core one.
This PR simply updates the documentation 😊

I have read the DCO document and I hereby sign-off my contribution

recheck


Fixes in thirdeye-hadoop for standalone setup

These changes only affect the standalone setup and will not affect the UMP usage of thirdeye-hadoop

LGTM


GAMS compilation errors re: time_relative

Code sample or context
Tried to run a scenario from the CLI, e.g.:
$ message-ix --url="ixmp://local/ENGAGE_SSP2_v4.1.7/EN_NPi2020_1000f" solve --remove-solution

Expected result
Scenario solves.
Problem description
The scenario does not solve. I see:
ixmp.model.base.ModelError: GAMS errored with return code 2:
    There was a compilation error

For details, see the terminal output above, plus:
Listing   : /home/khaeru/vc/iiasa/message-ix/message_ix/model/MESSAGE_run.lst
Input data: /home/khaeru/vc/iiasa/message-ix/message_ix/model/data/MsgData_ENGAGE_SSP2_v4.1.7_EN_NPi2020_1000f.gdx

GAMS listing files are attached (MESSAGE_run.lst.2022-01-27.txt); key lines are:
1793  duration_time_rel(time,time2)$( Not time_relative(time) ) = 1 ;
****                                                  $141
**** LINE    109 INCLUDE     /home/khaeru/vc/iiasa/message-ix/message_ix/model/MESSAGE/data_load.gms
**** LINE     77 INCLUDE     /home/khaeru/vc/iiasa/message-ix/message_ix/model/MESSAGE/model_setup.gms
**** LINE     65 INPUT       /home/khaeru/vc/iiasa/message-ix/message_ix/model/MESSAGE_run.gms

…

141  Symbol declared but no values have been assigned. Check for missing
        data definition, assignment, data loading or implicit assignment
        via a solve statement.
        A wild shot: You may have spurious commas in the explanatory
        text of a declaration. Check symbol reference list.
257  Solve statement not checked because of previous errors
492  Symbol not in GDX

Per the "wild shot" suggestion, I removed the explanatory text from the declaration of time_relative, and this seems to fix the problem:
…
    balance_equality(commodity,level)       mapping of commodities-level where the supply-demand balance must be maintained with equality
* flag for treating unit of ACT in sub-annual time slices relative to parent 'time' (=activating parameter 'duration_time_rel')
    time_relative(time)
;

There is no comma, but perhaps the (=) or other characters are the problem. At first glance, I'm not sure why this doesn't offend GAMS on CI.
Versions
Output of message-ix show-versions

ixmp:        3.3.0
     08533cb (HEAD -> main, tag: v3.4.0rc1, tag: v3.4.0, iiasa/main) Mark v3.4.0 in release notes
message_ix:  3.3.1.dev1+g56611ad.d20210630
     315b4f9 (HEAD -> main, iiasa/main) Address failing "Install from conda-forge" workflow (#541)
message_ix_models: 2021.4.8.dev5+g338d44a
     436332f (HEAD -> main, tag: v2022.1.26rc1, tag: v2022.1.26, origin/main, origin/HEAD) Mark v2022.1.26 in doc/whatsnew
message_data: 2020.6.21.dev872+g6c848d83
     0588751c (HEAD -> transport-2022-W04, iiasa/transport-2022-W04) Remove mypy exclusions for transport modules

click:       8.0.1
dask:        2022.01.0
genno:       installed
     d4f0d4b (HEAD -> main, tag: v1.9.1, origin/main) Update copyright year
graphviz:    0.14.2
jpype:       1.3.0
… JVM path:  /usr/lib/jvm/java-17-openjdk-amd64/lib/server/libjvm.so
openpyxl:    3.0.7
pandas:      1.4.0
pint:        0.18
xarray:      0.20.2
yaml:        5.4.1

iam_units:   installed
     00857b7 (HEAD -> main, tag: v2021.11.12rc1, tag: v2021.11.12, origin/main) Add nightly tests (#33)
jupyter:     1.0.0
matplotlib:  3.3.4
plotnine:    0.8.0
pyam:        0.11.0

GAMS:        24.9.1

python:      3.9.7 (default, Sep 10 2021, 14:59:43)
[GCC 11.2.0]
python-bits: 64
OS:          Linux
OS-release:  5.13.0-23-generic
machine:     x86_64
processor:   x86_64
byteorder:   little
LC_ALL:      None
LANG:        en_CA.UTF-8
LOCALE:      ('en_CA', 'UTF-8')

FYI @behnam-zakeri @LauWien

The problem seems to be with the code added in #509.
I find that the tests added in that PR fail on my system with various errors.
Can you say what version(s) of GAMS you were running locally as you developed this?

version(s) of GAMS

I use GAMS version 35.2.0.

I just ran all tests and for me the tutorials added here ran through, only test_tutorial[R_austria_load_scenario] and test_tutorial[R_austria] don't, but these never do since jupyter_client.kernelspec.NoSuchKernel: No such kernel named IR, which I didn't install yet.

I use GAMS version 35.2.0.

Okay, and CI I believe uses a pretty recent version as well. As you can see, my local install is still on 24.

We don't have a strict/format minimum GAMS version, except I think for MESSAGE-MACRO.
Maybe this is something that has changed between GAMS versions, i.e. the list of acceptable characters in the descriptive text after an item declaration used to exclude ()=, etc., but now allows some of them.
I don't think it's necessary to track down precisely where; rather we can just apply the fix that I found worked for me locally.

recent version

Hm, just out of curiosity, checking here  it says GAMS version 25.1.1 is used or maybe I'm mistaken.

just apply the fix that I found worked for me locally.

Sounds good, happy to implement it.


Grammar fixes for faq.md

Thanks @proudmuslim-dev :)

No problem! I plan on making further PRs for the rest of the site as necessary
Really appreciate the work you guys are doing- can't wait for Haveno to be ready :)

No problem! I plan on making further PRs for the rest of the site as necessary

That would be appreciated. We are about to push more content to the website :)


Named aggs

Adds support for named aggregations as well as fully qualified named aggregations.

Related to #192

looks g2g

@pyromaniac ok now?

Give me some time please, I have to review this

Ok, Let's see how would it go. I'm still not sure that named scopes can't be used instead of it, but I have at least to try to use aggregations at first


Why cannot I call the IPython display method from within an ipyvuetify class ?

context
I want to create more sofisticated widgets flavoured with js behaviour so that you can interact with in many different way. As I want these component to be reusable, I pu lot of efforts to translate them into python class instead of using the template version of ipyvuetify. I've already face this problem multiple times but I think that now I narrowed down the bug and I can show a minimal example.
Let assume you want to create a special component that when click, create an alert and display the v_model value.
The basic component I want to use will be IPython as it allows me to display pure js :
from Ipython import display, HTML

js = <script>alert('turlututu');</script>
display(HTML(js))

It works like a charm.
Now let's add some layers to the component :
from IPython.display import display, HTML

class TestJs():

    def __init__(self, msg):

        self.js = f"<script>alert('{msg}');</script>"

    def display_js(self):

        display(HTML(self.js))

toto = "turlututu"
test = TestJs(toto)
test.display_js()

work like a charm as well, the alert is display on my screen
bug
now I would like to create a special Alert object :
import ipyvuetify as v
from IPython.display import display, HTML

class Alert(v.TextField):

    def __init__(self, **kwargs):

        self.outlined = True
        self.label = "copy to clipboard"
        self.readonly = True
        self.append_icon = "mdi-clipboard-outline"
        self.v_model = "toto_asticot!"

        super().__init__(**kwargs)

        self.on_event('click:append', self._alert)

    def _alert(self, widget, event, data):
        """copy the content of the textfield in the clipboard"""

        js = f "<script>alert('{self.v_model}');</script>"
        print(js)
        display(HTML(js))

        return self

alert = Alert()
alert

Here there is a bug. I can display the textField, I can click on the clipboard btn but no alert is launched. I'm sure that the function is executing itself as the v_model is effectively printed.
strange behaviour
Now, and that may lead to a simple solution, if I run :
alert._alert(None, None, None)

It works ( js alert and  python print)
question
Any idea why when I try to run display function from js event it doesn't work ?

You need to use the output capturing mechanism in ipywidgets:
import ipyvuetify as v
import ipywidgets as w
from IPython.display import Javascript

class Alert(v.TextField):

    output = w.Output()

    def __init__(self, **kwargs):

        self.outlined = True
        self.label = "copy to clipboard"
        self.readonly = True
        self.append_icon = "mdi-clipboard-outline"
        self.v_model = "toto_asticot!"

        super().__init__(**kwargs)

        self.on_event('click:append', self._alert)

    @output.capture()
    def _alert(self, widget, event, data):
        """copy the content of the textfield in the clipboard"""

        js = f"navigator.clipboard.writeText('{self.v_model}');alert('{self.v_model} copied to clipboard.');"
        print(js)
        display(Javascript(js))

        return self

alert = Alert()
display(alert, alert.output)

so in fact any container type is breaking it. Your solution can work in the framework of a simple notebook but here i'm building an extensive dashboard and I cannot afford to set manually the display function on top of everything 😄

It was likely not a good idea to overwrite _ipython_display_(self), as that function seems to be disregarded when the widget is rendered in a container. It is clear with the following example:
class Test(v.Btn):
    def __init__(self, **kwargs):
        super().__init__(children=['Button'])
    out = w.Output()
    with out:
        print("widget's output here")

    def _ipython_display_(self):
        display(self.out)

Then Test() shows "widget's output here", whereas w.HBox([Test()]) shows a button "Button".
The solution is then to subclass a container class (as you do in sepal-ui):
class TextFieldCopy(v.Layout):

    def __init__(self, **kwargs):
        self.tf = v.TextField(append_icon = "mdi-content-copy", **kwargs)
        self.out = w.Output(layout={'display': 'none'})
        super().__init__(children=[self.tf, self.out])
        self.tf.on_event('click:append', self.copyToCB)

    def copyToCB(self, widget, event, data):
        js = f"navigator.clipboard.writeText('{self.tf.v_model}')"
        with self.out:
            display(Javascript(js))

This works in JupyterLab (v3), but not in Voilà, at least on my cloud-based JupyterHub configuration, I get 'JavaScript output is disabled in JupyterLab' (with the display-none layout parameter removed).

something like the opposite of a Vuetify event @event calling a vue_event python function in a VuetifyTemplate

I have just noticed that feature "RPC to frontend" was available (but not documented). With that and the possibility of displaying a Vuetify widget within a VuetifyTemplate widget, you can create a hybrid widget class that keeps the Python interface of the Vuetify widget while having additional callable Javascript methods in the template:
class Alert(v.VuetifyTemplate):

    def __init__(self,
                 outlined=True,
                 label="copy to clipboard",
                 readonly=True,
                 append_icon="mdi-clipboard-outline",
                 **kwargs):
        self.tf = v.TextField(outlined=outlined,
                              label=label,
                              readonly=readonly,
                              append_icon=append_icon,
                              **kwargs)
        self.template = '''<mytf/>
        <script> {methods: {
            jupyter_clipW(_txt) {alert(_txt);}}}
        </script>'''
        self.components={'mytf': self.tf}
        v.VuetifyTemplate.__init__(self)

        def _alert(widget, event, data):
            self.send({"method": "clipW", "args": [self.tf.v_model]})
        self.tf.on_event('click:append', _alert)

alert = Alert(v_model="toto_asticot!")
alert

One drawback is that, after instantiation, the TextField instance is alert.tf instead of alert (one can also derive Alert from v.TextField instead of v.VuetifyTemplate, and redefine the _ipython_display_ or _repr_mimebundle_  method, but this does not work in a container widget, as mentioned above).
I have edited my previous replies to highlight that displaying (=adding) a new Javascript object for each execution of a same Javascript command is less memory efficient and likely slower.
If this RPC to frontend feature was similarly added to VueRenderer.js with the possibility to define a methods attribute with custom Javascript methods (as in VuetifyTemplate), that would be great (to remove the need of creating a VuetifyTemplate).

something like the opposite of a Vuetify event @event calling a vue_event python function in a VuetifyTemplate

I have just noticed that feature "RPC to frontend" was available (but not documented). With that and the possibility of displaying a Vuetify widget within a VuetifyTemplate widget, you can create a hybrid widget class that keeps the Python interface of the Vuetify widget while having additional callable Javascript methods in the template:
class Alert(v.VuetifyTemplate):

    def __init__(self,
                 outlined=True,
                 label="copy to clipboard",
                 readonly=True,
                 append_icon="mdi-clipboard-outline",
                 **kwargs):
        self.tf = v.TextField(outlined=outlined,
                              label=label,
                              readonly=readonly,
                              append_icon=append_icon,
                              **kwargs)
        self.template = '''<mytf/>
        <script> {methods: {
            jupyter_clipW(_txt) {alert(_txt);}}}
        </script>'''
        self.components={'mytf': self.tf}
        v.VuetifyTemplate.__init__(self)

        def _alert(widget, event, data):
            self.send({"method": "clipW", "args": [self.tf.v_model]})
        self.tf.on_event('click:append', _alert)

alert = Alert(v_model="toto_asticot!")
alert

One drawback is that, after instantiation, the TextField instance is alert.tf instead of alert (one can also derive Alert from v.TextField instead of v.VuetifyTemplate, and redefine the _ipython_display_ or _repr_mimebundle_  method, but this does not work in a container widget, as mentioned above).
I have edited my previous replies to highlight that displaying (=adding) a new Javascript object for each execution of a same Javascript command is less memory efficient and likely slower.
If this RPC to frontend feature was similarly added to VueRenderer.js with the possibility to define a methods attribute with custom Javascript methods (as in VuetifyTemplate), that would be great (to remove the need of creating a VuetifyTemplate).
guimillet,

I searched and found this post. This is what I'm looking for.  Do you have an example for icon button?  I would like to run some javascript when user click the Icon button, but my code doesn't work:
Here is my code:
import ipyvuetify as v
class Alert(v.VuetifyTemplate):
def __init__(self,
             outlined=True,
             label="copy to clipboard",
             readonly=True,
             append_icon="mdi-clipboard-outline",
             **kwargs):
    self.tf = v.Icon(class_='mt-2 mb-1 mr-1',color='black', children=['mdi-view-grid-outline'])
    self.template = '''<mytf/>
    <script>
        {methods: {
        jupyter_clipW(_txt) {
            alert(_txt);
            console.log('xx');
            }}}
    </script>'''
    self.components={'mytf': self.tf}
    v.VuetifyTemplate.__init__(self)

    def _alert(widget, event, data):
        self.send({"method": "clipW", "args": [self.tf.v_model]})
    self.tf.on_event('click:append', _alert)

alert = Alert(v_model="toto_asticot!")
alert
Any solution? thanks

For an icon button, you need the Btn widget with icon=True property. The Icon widget is just an icon without event.
Last month, a recommended way for embedding widgets has been documented. Here is an icon button that executes a javascript function, based on that documented manner:
import ipyvuetify as v
import traitlets
import ipywidgets as widgets

class MyBtn(v.VuetifyTemplate):

    text = traitlets.Unicode('text trait').tag(sync=True)

    button = traitlets.Any(
        v.Btn(
            class_='mt-2 mb-1 mr-1',
            icon=True,
            color='black',
            children=[v.Icon(children=['mdi-view-grid-outline'])]
        )
    ).tag(sync=True, **widgets.widget_serialization)

    def on_click(self,widget, event, data):
        self.send({"method": "jsFunc", "args": [self.text]})

    @traitlets.default('template')
    def _template(self):
        return '''
        <template>
            <jupyter-widget :widget="button" />
        </template>
        <script> {methods: {
            jupyter_jsFunc(_txt) {
                alert(_txt);
                console.log('xx');
                }}}
        </script>
        '''

    def __init__(self, **kwargs):
        self.button.__init__(**kwargs)
        self.button.on_event('click', self.on_click)
        super().__init__()

btn = MyBtn()
btn

In that example, the content of the trait text is passed to jsFunc. One can change attributes of the button with for example MyBtn(color='red') upon creating the button, or after creation: btn.button.color = 'red', btn.text = 'new text'.

Thank you. It works!

guimillet,
I tried in my application and it works very well. I noticed that javascript function was called twice. any idea how to prevent the second call in this example?
Thanks.

If the same instance of the button is displayed N times (from two cells) or redisplayed N times (by re-executing the display of the button), then indeed the JavaScript function is called N times. Is it your case? (restart the kernel to check)
I have updated the example code above such that the button is initialised in the __init__ function to make the button an instance attribute. This way, calling MyBtn() again creates a new button. With the example in the current documentation wherein the Slider is a class attribute, a new instance of MyComponent contains the same Slider... I will propose that change to the documentation.

I had forgotten this one, thank you @guimillet, you clearly nailed it. Closing for now.

Thank you @guimillet for the code!! I've been trying many workarounds to generate a function to scroll down and that I could call programmatically.


User defined prior range

The current version estimates the prior range from the posterior samples, however I have found that this can be too narrow for some purposes. It would be useful if the user could pass the prior range to the MAF function if already known, with the default calculation used if these are not passed.

From offline conversations it would be helpful to record where the current defaults a =((n-2)xmin - xmax)/(n-3) and b((n-2)xmax - xmin)/(n-3) come from.
This is a relatively non-trivial piece of analysis, and is a simpler version of the solution to Exercise 22.10 in Mackay open-access pdf)
The problem as stated is that you have n samples, drawn from some uniform distribution with unknown limits (a,b), and you observe that the smallest (largest) sample has value xmin (xmax), what do you know about (a,b)?
The punchline is that instead of b=xmax, a=xmin, which is obviously too tight an estimate (but is the maximum likelihood solution) you should instead use:
b = ((n-2)xmax - xmin)/(n-3) = xmax + (xmax-xmin)/(n-3)
a = ((n-2)xmin - xmax)/(n-3) = xmin - (xmax-xmin)/(n-3)

i.e. you expand each bound by a fraction 1/(n-3) of the range.
Assuming the samples are drawn between some (unknown) limits a and b, then for
one sample:
P(x|a,b) = 1/(b-a)    [if a<x<b, 0 otherwise]
and our likelihood given n samples is:
P(D|a,b) = 1/(b-a)^n    [if all x satisfy a<x<b, 0 otherwise]
Assuming an (improper) uniform prior P(a,b) = const, then
P(a,b|D) = (n-1)(n-2)/(xmax-xmin)^(n-2)/(b-a)^n    [if a<xmin and b>xmax, 0 otherwise]
Marginalising out a, one can find
`P(b|D) = (n-2)/(xmax-xmin)^(n-2)/(b-xmin)^(n-1)``
and b:
P(a|D) = (n-2)/(xmax-xmin)^(n-2)/(xmax-a)^(n-1)
These have a maximum posterior/likelihood at a=xmin and b=xmax, but the more Bayesian
thing to do if you must compress is to choose the posterior mean, which are
the values quoted above. The other (more correct) option is to draw from these distributions whenever you need a value for (a,b).

Hi @DeaglanBartlett, @williamjameshandley,
Thanks for recording the detail on the derived limits here @williamjameshandley. I agree with @DeaglanBartlett  that it would be helpful for the user to be able to pass known prior ranges if they are available. Could you go ahead and make a PR @DeaglanBartlett? This should be a fairly straightforward addition of a kwarg to the classes in margarine.maf and margarine.kde. Eventually I would like the two different density estimator classes to inherit from something more generic so that updates like this only require the editing of one class but that is likely a much more extensive PR.
Sorry for the slow reply! Been a bit busy.


Comparison with graphql_flutter/graphql package

Hello,
I have been worked with both of these gql clients for a while now beside each other. I have some doubts about how this two should be used and for flutter newbies like me i think others could be confused at first as well, There are guides on internet on using both at the same time but it doesn't feels completely natural to me. Most important differences i could see was graphql_flutter supports cache and Artemis does code generation, right?
Are they supposed to be used beside each other? Any best practices or suggestion to use only one maybe?

Did you get along with this article?
<EMAIL_ADDRESS>

To be short - graphql_flutter is a client
Artemis for code generation

Thanks for response, yes i have read that article. The part that made me doubt if these two are meant to be used along each other was when calling a mutation:
Mutation(
    options: MutationOptions(
        document: CreateAddressMutation(
                variables: CreateAddressArguments(
                    title: "",
                    details: "",
                    lat: 10.1,
                    lng: 10.1))
            .document),
    builder: (
      RunMutation runMutation,
      QueryResult? result,
    ) {
      return ElevatedButton(
          onPressed: () {
            if (_formKey.currentState!.validate()) {
              runMutation({
                "title": "T",
                "details": "D",
                "lat": 10.1,
                "lng": 10.1
              });
            }
          },
          child: Text('Save'),
          ));

I couldn't find a way around having to pass the arguments twice maybe i did something wrong here.

@ridyio check this
https://github.com/comigor/artemis/issues/314

@vasilich6107 Thanks a lot, Got it now


Checks that the workflow actually works for #790

Testing this way is a bad idea because the images built with images.yaml will be overwrite the image names built from code on the main branch.


Cannot process downloads - NameError: global name 'PIL' is not defined

Error received is as follows:
Start downloading... Using Referer: https://www.pixiv.net/                                                                  23816 of     23816 Bytes  Completed in 0.002s (11.36 MiB/s)  Image invalid, deleting... Traceback (most recent call last):   File "PixivUtil2.py", line 176, in download_image NameError: global name 'PIL' is not defined Error at download_image(): (<type 'exceptions.NameError'>, NameError("global name 'PIL' is not defined",), <traceback object at 0x04137A80>) at https://i.pximg.net/user-profile/img/2016/09/08/02/29/02/11466629_db44fce4505b7bb5e52ec3cf810ae289_170.jpg (9000)
Error repeats and eventually gives up, attached is generated error page.
Error page for member 3406627.zip

Update: issue does not occur on 20170813-beta1v2

try latest releases

can confirm that seems to have fixed it, cheers.


[Request] Add apiBaseUrl as a parameter in Publish-PerTenantExtensionApps

Hi Freddy,
Could you please consider to add apiBaseUrl as a new parameter in Publish-PerTenantExtensionApps?
The function is reading apiBaseUrl from the settings of the BcContianerHelper. I would like to use this function to make automated releases using the free DevOps Agent (that is stateless).
It's a project using LS Central, so the base url is not the default one but "https://lscentral.api.bc.dynamics.com"
I'm using the script from the workshop.
Thank you

You are using the "old" CI/CD HOL scripts?
The problem is, that apiBaseUrl is used in a lot of functions (and also the baseUrl), meaning that you would have to change scripts in a lot of places.
in AL-Go for GitHub, you can have BcContainerHelper settings in the normal project settings file.
In the old CI/CD HOL - I would add two lines to Install-BcContainerHelper:
$bcContainerHelperConfig.apiBaseUrl = "your api baseurl"
$bcContainerHelperConfig.baseUrl = "your baseurl"
Then all functions will work with this.

The first attempt to add this functionality was to add parameters, but I found that these parameters needed to be transferred to a lot of functions and it all just didn't make sense.
Just add the two lines from my comment before your Publish- command and everything should work.

Unfortunately I've already tried what you suggested but receivign the following error message:
"The property 'apiBaseUrl' cannot be found on this object. Verify that the property exists and can be set."

Try this:

What does your machine say?
Maybe you have an old containerhelper in memory.

Remove-Module BcContainerHelper
UnInstall-Module BcContainerHelper -allversions
should get rid of all old versions

My machine works exactly like yours.
In this specific scenario I'm using the free DevOps Agent (that is stateless), the script is installing the module and then when I try to change the value it fails but I've noted that the variable contains the correct value inside the function for this reason I asked you for a new parameter.
Remove the module I did not test yet but I do not think will fix the issue.

If it is a stateless devops agent, it should work.
You must have a spelling mistake or like - please include script and output including the lines I suggest

I think I know what the problem is.
After Install-Module, use Import-Module BcContainerHelper
Import-Module is implicit when you call the first function of BcContainerHelper and initializes the config variable.
Meaning that you cannot access the variable before importing.
If this is true, then including the output of your script would have shown that the messages displayed by Import-Module didn't get displayed.

This is the script

and this is the failure

Now the test using Import-Module BcContainerHelper after Install-Module

But the result now shows a new error to fix :-(

The issue is that while the url to make the call starts with
https://lscentral.api.bc.dynamics.com/
The scope must be
https://api.businesscentral.dynamics.com/.default
and this is not configurable in the function.
Please can you consider now to add a parameter to pass the scope?

When using clientId and ClientSecret, you need to add -tenantId to Publish-PerTenantExtensionApps or you need to use -bcAuthContext instead of clientId and ClientSecret.

ParameterSet CC includes all three parameters
https://github.com/microsoft/navcontainerhelper/blob/2ea2bc6a59a650d30761fd0bed972a822f01fe43/BcSaaS/Publish-PerTenantExtensionApps.ps1#L53
I will add an error message if neither CC or AC parameter sets are specified fully to explain this.

You only shared part of the script.
The script is trying to create an authcontext with the clientId, clientSecret, tenantId and apibaseUrl using this:
$bcauthContext = New-BcAuthContext `
            -clientID $clientID `
            -clientSecret $clientSecret `
            -tenantID $tenantId `
            -scopes "$($bcContainerHelperConfig.apiBaseUrl.TrimEnd('/'))/.default"

That fails.
It looks like the resource/scopes is wrong.
Not sure what the right value for that would be?
#2060 is about the same topic - I asked the guy what he did in order to get an AuthContext.

Hi Freddy,
Here the full script:
`Write-Host "Installing BcContainerHelper"
Install-Module BcContainerHelper -Force -AllowPrerelease
Import-Module BcContainerHelper
#$bcContainerHelperConfig.apiBaseUrl = "https://lscentral.api.bc.dynamics.com"
#$bcContainerHelperConfig.baseUrl = "https://lscentral.bc.dynamics.com"
Write-Host "Publishing to tenant"
Publish-PerTenantExtensionApps -useNewLine
-ClientID "$(PublisherAppClientID)"
-ClientSecret "$(PublisherAppClientSecret)"
-tenantId "$(TenantId)"
-environment "$(Environment)"
-companyName "$(CompanyName)"
-appFiles @(Get-Item "Artifacts/output/Apps/*.app" | % { $_.FullName })`

Finally a version of the script working for me, I can confirm that the base url is different of the url in the scope.
`Write-Host "Installing BcContainerHelper"
Install-Module BcContainerHelper -Force -AllowPrerelease
Import-Module BcContainerHelper
$bcContainerHelperConfig.apiBaseUrl = "https://lscentral.api.bc.dynamics.com"
$bcauthContext = New-BcAuthContext
-clientID "$(PublisherAppClientID)"
-clientSecret "$(PublisherAppClientSecret)"
-tenantID "$(TenantId)"
-scopes "https://api.businesscentral.dynamics.com/.default"
Write-Host "Publishing to tenant"
Publish-PerTenantExtensionApps -useNewLine
-bcauthContext $bcauthContext
-environment "$(Environment)"
-companyName "$(CompanyName)"
-appFiles @(Get-Item "Artifacts/output/Apps/*.app" | % { $_.FullName })`

Thanks - this means that the scopes which are auto-applied in Publish-PerTenantExtensionApps is wrong.
Will fix that.

Scope is correct for MS environments but it it does not match for other environments.
You can leave everything as is or add the apiBaseUrl and scope as parameters only in Publish-PerTenantExtensionApps to simplify a bit the script for the releases.

Whether I add the parameter or not won't make any difference.
The apiBaseUrl is a setting - and that works fine as you have found out - I am not going to add this parameters to the 10 or so functions that uses the setting and transfer values back and forth - a parameter was tried and found to be a bad implementation.
The code I had in the function used the apiBaseUrl setting as scopes - and in your code that works, you use the BC standard api url as scopes - and the error when running with my code was that the scopes was wrong - so if your code works - scopes needs to be "https://api.businesscentral.dynamics.com/.default" and not "$($bcContainerHelperConfig.apiBaseUrl.TrimEnd('/'))/.default"

Agreed, my suggestion was only because we found a bit tricky that after the installation of the module, it was needed to import the module in order to initialize the variables and be able to change the apiBaseUrl.
The issue I had was only with Publish-PerTenantExtensionApps not with any other functions.


[BUG] Crash on Nixos using home-manager module

Using hyprlock installed directly from the home manager module, it crashes on startup (red screen) with the below error:
[TRACE] [sc] DMABUF format DRI driver not from this Mesa build ('24.0.3' vs '23.3.5')
failed to bind extensions
DRI driver not from this Mesa build ('24.0.3' vs '23.3.5')
failed to bind extensions
DRI driver not from this Mesa build ('24.0.3' vs '23.3.5')
failed to bind extensions
DRI driver not from this Mesa build ('24.0.3' vs '23.3.5')
failed to bind extensions
DRI driver not from this Mesa build ('24.0.3' vs '23.3.5')
failed to bind extensions
DRI driver not from this Mesa build ('24.0.3' vs '23.3.5')
failed to bind extensions

However when overriding the hyprlock package to V0.2.0 in nixpkgs-unstable by setting programs.hyprlock.package = pkgs.hyprlock, there is no crash and hyprlock works normally.
I can't seem to bisect this issue as building from source doesn't seem to work at all for me, even on v0.2.0. Seems unrelated though.
I saw #85 but since I'm on Nixos i'm not sure how this build vs runtime mismatch could happen.
Any ideas?

The mesa in your system's nixpkgs vs the mesa in hyprlock's nixpkgs is different, thus it doesn't work.
I'll update the nixpkgs version in this flake and it should then work again.


Add an implementation of Any. [phab:D85]

Created by zarko at 2015-02-23 19:30:36:
proto3's Any support is incomplete. Here's one
we can use while we wait for it.

schroederc wrote at 2015-02-23 19:32:25:
For what do we need the Any type currently?

schroederc commented inline (context lost during migration) at 2015-02-23 19:33:26:
This should probably go in a separate proto file and imported where necessary.

zarko commented inline (context lost during migration) at 2015-02-23 20:21:42:
Done.

zarko wrote at 2015-02-23 20:21:42:
This is a prerequisite for #271.

zarko wrote at 2015-02-23 20:22:17:

Split out Any.

fromberger commented inline (context lost during migration) at 2015-02-23 23:01:28:
Is the reason we need this that the proto3 support in C++ does not cover this case yet? If so, can you please add a TODO to swap to using the real version when it becomes available? (Maybe also: A task to integrate that change when it becomes available)

fromberger wrote at 2015-02-23 23:01:28:
Just one documentation-related nit, otherwise g2g.


Roll engine 72283b64196c..36b5b1936765 (2 commits)

git@github.com:flutter/engine.git/compare/72283b64196c...36b5b1936765
git log 72283b64196c..36b5b1936765 --no-merges --oneline
2019-08-23<EMAIL_ADDRESS>Roll src/third_party/dart 06d3769ac6..2e4c89aa73 (19 commits)
2019-08-23<EMAIL_ADDRESS>Remove deprecated ThreadTest::GetThreadTaskRunner and use the newer CreateNewThread API. (flutter/engine#11395)
The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
If the roll is causing failures, please contact the current sheriff (liyuqian@google.com), and stop
the roller if necessary.

Auto-roller completed checks. About to merge.


Robot vibrating

Hello,
The simulation worked fine for me, although the robot always gets stuck on a narrow passage during autonomous navigation. However, I am trying to implement this on the real robot but no luck at the moment.
I have an ODrive controller 56v v3.6, Arduino mega and jetson nano but a different wheel (hoverboard 165.1 mm wheel diameter).
When I run the Arduino ROS serial node, the wheel spins but with heavy vibration. I anticipate it could be errors due to the encoder and wheel parameters calculation. Also, the robot moves quite slow in RViz (sometimes unnoticeable) compared to real-time.
I am wondering if you could spare some time to assist me to fix it?.
Thank you for your time and in anticipation of your response

ODrive updated their firmware to use 'turns', which is a motor revolution, instead of encoder counts. So you'll probably need to adjust all the units because they are 8192 times too big now.

@XRobots Thanks for you reply. So in this case,  I have to divide the previous  values by 90 cpr to get it in turns/m, turns/s and rad/s (the values written in red). I am wondering if that is right?

It looks like the right process, but I haven't checked the maths ;-)

Ok, thank you very much for your concern. I would be pleased if you could find out time to go through it. I tested the new values with the robot and it seems to work fine at low speed. However, there are still vibration driving the robot at high speed.


Possibility to send html instead of url?

Hi,
Thanks for the wonderful library and all the effort that you invested. I have a situation where I'd prefer to send raw html to the bot and get back pdf in return, so no urls just html in POST request, is that possible? Thanks.

FYI - did a little digging and found that the underlying library accepts data urls, so if you take your html, base64 encode it and then request pdf-bot with a url of data:text/html;base64,<your encoded html here> it will do what you're looking for...

Hi, I tried to convert local file using file protocol:
$ pdf-bot push 'file://full/path/contract.html'
The job was created with ID 82a0112d-7eaa-474a-8b4c-d13ee6a8ec4a

$ pdf-bot shift:all
Found 1 jobs, divided into 1 chunks
Running chunk 1, 0 chunks left
html-pdf-chrome error: Error: HtmlPdf.create() page navigate failed. (job ID: 82a0112d-7eaa-474a-8b4c-d13ee6a8ec4a. Generation ID: 746d2054-267e-4e85-ab46-19d900b5b20c)

As you see above it generates error.
How you can point local file name for pdf-bot?

I reply for myself - it is possible, but required some quirk in the following line:
https://github.com/esbenp/pdf-bot/blob/a2edd1ea570b840965e980c0900c5aaa27d80148/src/utils.js#L2
Should be:
var isValidUrl = function (url) {
  return url.match(/(((file:\/|[A-Za-z]{3,9}:(?:\/\/)?)(?:[\-;:&=\+\$,\w]+@)?[A-Za-z0-9\.\-]+|(?:www\.|[\-;:&=\+\$,\w]+@)[A-Za-z0-9\.\-]+)((?:\/[\+~%\/\.\w\-_]*)?\??(?:[\-\+=&;%@\.\w_]*)#?(?:[\.\!\/\\\w]*))?)/)
}

because for file protocol root directory for full path should contain single slash character as google-chrome headless seems to have such requirement.


Remove dependency on git

Remove dependency git2, which is only used for one single thing, which can be rewritten by hand, or possibly use an existing crate for same functionality.

Closed by #15


Validation for "create new item"

In my case I want some basic validation before the user can do "create new item".
Use case: The user enters mail-adresses. I don't want to accept foo@example, but I want to accept<EMAIL_ADDRESS>I looked at the source. I guess validation is not possible at the moment.
What do you think?
Here is the relevant code:

    def post(self, request):
        """Create an object given a text after checking permissions."""
        if not self.has_add_permission(request):
            return http.HttpResponseForbidden()

        if not self.create_field:
            raise ImproperlyConfigured()

        text = request.POST.get('text', None)

        if text is None:
            return http.HttpResponseBadRequest()

        result = self.create_object(text)

        return http.HttpResponse(json.dumps({
            'id': result.pk,
            'text': six.text_type(result),
        }))

Your are correct, there is no form nor validation support in the create
option.
For complete validation support, I recommend you try django-addanother. It
uses a popup like django admin to support a form.

I know that django-addanother exists.
In this case I think "Create new" could be extended, since I only supply a simple string. I don't need a form or popup.
Is there a way to stop "Create new" from appearing via a method on the Select2QuerySetView (one if its mixins)?
If this is possible, this could be solved in a very re-usable way: the developer can supply a check_input() method. If it returns True "Create new" appears, if it returns False, it does not appear.

I think I understand now, excellent idea !
Perhaps we should also run this check ?

Maybe has_add_permission() does work. But this name would confuse everyone who has not read this discussion. Since this is not about "permission"
I would suggest a new method: input_can_be_added(self, text)

BTW the string which as entered by the users has several names in the library. Once it is "text" once it is "q". Would be nice to agree on one name :-)

I meant we should check has_add_permission as well as input_can_be_added.
Perhaps can_create_option(text) would be easier to type

... nice, you understand me.
What are we adding here? In the docs I found this:

Creation of new choices in the autocomplete form

So I would suggest to call the method can_create_new_choice.
Although I prefer "valid" or "validation" to be in it.
... it is difficult to name things properly.

Perhaps validate_input() ?

Now we have three names: q, text, input ....
Sorry, I have no matching name. Maybe tomorrow.

If the method that creates the object is create_object(), should it be just can_create_object() ?

I am unsure wether the widget is the right place to handle this.
The widget exists to display data.
Adding might be more a task for form.Field.

The widget here doesn't create any data ! It just provides a way to create it yourself through a POST request, and the object is created by the view, like with add-another ;)
In 3.0, such values were created in form.Field, but Django doesn't support this and that caused numerous bugs: https://github.com/yourlabs/django-autocomplete-light/issues/604

ok, you have more experience in that field as I have. My current solution is to overwrite the whole post() method.
Before a matching method name can be found, I think the fundamental question should be solved:
How to call the string the user send to the widget:

q
text
input
....

Seems like it would be better to choose from one that we already have, I think q makes more sense here because text is pretty generic. Would that work for you ?

I don't like one-character variables. And in django-context there is already Q.
But I think q is the best choice.

I'm going to second the idea that "q" is an unfortunate choice for a variable name.

How to call the string the user send to the widget

Note that on the Select2 side this is usually referred to as the "search term" (both q and term are sent when searching).

term also works for me !

Yes, term sound good.

Agreed ! Hey are you going to europycon ? Perhaps we could have a hangouts session and talk this through ?

@jpic  sorry for the late response. No, I won't go to europycon. I have wife and family, my spare time is limited. I would like to go there :-)

Well it was last month ! Anyway, would you like to have a hangouts session
next month or are you all set ?

@jpic Yes, I  have some time. What are you interested in? You can reach me at<EMAIL_ADDRESS>

Duplicate of https://github.com/yourlabs/django-autocomplete-light/issues/779?


Render_response (rebased onto dev_5_0)

This is the same as gh-1162 but rebased onto dev_5_0.

Replacement for #1161 with fixes ready for m5

--rebased-from #1162


Improve getter for asg::Barrier

See comments at bottom of #71

I might as well add a commit to this PR changing the others as well.

This PR was approved. But the additional changes mentioned in https://github.com/Qiskit/openqasm3_parser/pull/75#pullrequestreview-1836773398 were added in 6920e11


Fix #2830 - subgroups incorrectly shows as commands in help

Fixed regression introduced by the performance work that made the help subsystem confused about commands vs. command groups (we now replace command groups we know won't match the arguments passed in with a dummy command).
Fixes #2830
This checklist is used to make sure that common guidelines for a pull request are followed.
General Guidelines

[n/a] The PR has modified HISTORY.rst with an appropriate description of the change (see Modifying change log).

Command Guidelines

[n/a ] Each command and parameter has a meaningful description.
[n/a] Each new command has a test.

(see Authoring Command Modules)

Codecov Report

Merging #2838 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #2838      +/-   ##
==========================================
+ Coverage   62.88%   62.88%   +<.01%
==========================================
  Files         464      464
  Lines       25901    25901
  Branches     3945     3944       -1
==========================================
+ Hits        16287    16288       +1
  Misses       8594     8594
+ Partials     1020     1019       -1

Impacted Files
Coverage Δ

src/azure-cli-core/azure/cli/core/application.py
89.32% <100%> (+0.48%)
:arrow_up:

src/azure-cli-core/azure/cli/core/parser.py
81.37% <100%> (ø)
:arrow_up:

Continue to review full report at Codecov.

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


Tower agent not fetching correct files via github API

I'm trying to run the following pipeline on Tower:
nextflow run https://github.com/enasequence/covid-sequence-analysis-workflow
		 -name test-V2
		 -with-tower
		 -r v2-api-migration
		 -main-script nanopore/nanopore.nf

But it errors out with the following:
WARN: Cannot read project manifest -- Cause: Remote resource not found: https://api.github.com/repos/enasequence/covid-sequence-analysis-workflow/contents/nextflow.config
Remote resource not found: https://api.github.com/repos/enasequence/covid-sequence-analysis-workflow/contents/main.nf

Ideally as I've specified the Revision number which in my case is the branch name, the Github API URL's should look like:
https://api.github.com/repos/enasequence/covid-sequence-analysis-workflow/contents/nextflow.config?ref=v2-api-migration and
https://api.github.com/repos/enasequence/covid-sequence-analysis-workflow/contents/main.nf?ref=v2-api-migration right?
I'm using Tower agent on LSF.
Nextflow module version: nextflow-21.10.6-gcc-9.3.0-tkuemwd

The problem is that the repository does not have either the nextflow.config or main.nf file in the project root

It does have both on the branch v2-api-migration

Unfortunely it's not enough. There must be at least the nextflow.config file (even empty) in the default branch

Ok thanks 👍 Would have been helpful to document clearly, the need for having a main.nf and a nextflow.config file at the root of the repo.


Remove display none from input element

Since it is hidden, we can't use Tab to select it and choose a file.
If is remains visible, but has style of width: 0, height: 0 - we are able to choose this element.

PR?

@okonet sure, will do today

Possible related to #180
@VladShcherbin what about the PR? Still gonna do it?

@okonet hey, I've tried to do it, but we need to show the active state somehow with css (as you press tab  key and want to see it becomes active).
We can use + selector, but this way we need to make sure input element is placed before the styled element.

I'm open to any solution at this point. I also think that current implementation prevents using Dropzone inside of form element with submit handler, so I'd say, it's worth trying. I like the idea BTW and glad to help.

Naive question:, but can we useopacity: 0 instead of display: none ? That should create an element on the stacking context which should be clickable and tabbable http://stackoverflow.com/a/742324

@arjshiv you can set the opacity, but the item (input element) will produce white space inside the dropbox element (width + height of the element).
But it's not the main problem - you need to show the user that the dropbox element gets focused. To do this - you can add a class when input is focused or use css selector.

Probably an easy solution can be smth like this:
const dropzoneClassName = classNames('dropzone', { focused: this.state.isFocused })

<Dropzone className={dropzoneClassName}>
  <input onFocus={this.handleInputFocus} />
</Dropzone>

And the input element can be set to 0 / 0 (width / height) and 0 opacity.

@VladShcherbin Thanks - that's helpful. I'll try and see if I can take a crack at it later this week if you and @okonet are open to it

@VladShcherbin yeah that's exactly the kind of thing I had in mind

@arjshiv sure, go for it. I tried some time ago, but unfortunately didn't end up with the tests setup.
Would be great if you'll try to solve it ;)

@arjshiv @okonet  here is a simple dropbox component I'm using in my apps and a small demo.
It toggles the focused class and works as described above. Maybe it can help to do similar thing here.

What if we just add tabindex="0" to the outer div, add a listener for onKeyPress and then filter for Space / Enter?

I'd rather skip implementing :focus behavior -- this might end up very messy and on different platforms might then work differently.

It is a pretty important feature for usability, without it keyboard only users won't be able to use it. What part are you thinking could get messy? Seems pretty straight forward to me.

I'm not doubting accessibility is important but implementing these features yourself isn't the best strategy from my experience. So I'm open to a standard-based solution that doesn't involve custom event handling etc.

@josh18 I've edited my initial comment that might lead to the confusion.

@okonet I've used two solutions:

Using input onFocus & onBlur events (when input is focused / blurred, the focused class is toggled)

<Dropzone className={giveMeTheClass}>
  <input onFocus={addFocusedClass} onBlur={removeFocusedClass} />
</Dropzone

Using just css selector (but it needs markup changes)

<Dropzone>
  <input />
  <div className="dropzone-box" />
</Dropzone>

css part
input:focused + .dropzone-box {
  border-color: blue;
}

Both of them worked for me, though I didn't test them on phones, tablets, IE.
Not sure, if there is a better solution or which one is the best. I've seen the first solution (focus trick) in other element libraries.

Personally, I also ended with using the first solution - no need for a dropzone-box element and is easy to implement (just toggle a class with a name from props).

@VladShcherbin I like the first one better since we want to support inline styling not just CSS. Does it work with the hidden <input /> as well? Can you submit a PR with it?

Ah ok I see what you mean. However adding enter / space input seems to be pretty common.
Example 1
Example 2
I'm not such a fan of the adding classes option as the default focus (e.g. glow on Chrome) won't work so I think you would either have to set a focus style or trust that a user is going to set a custom focus style. I guess that's the same if you use the + selector.
Another possible option is to use a <button> instead of a <div> and then just reset all the styles on the button, not sure I would recommend that though.

@okonet I tried to setup on local previously, but failed with the tests setup. The needed steps:

input onHover / onBlur events
dropzone onHover / onBlur props (for custom events)
add a focused state with default false
toggle focused state in input handle events
add dropzone prop for a focused class
add this class to dropzone
add inline styles for focused state
input has to be visible, my css for it is

input {
  display: block;
  width: 0;
  height: 0;
  border: none;
  opacity: 0;
  overflow: hidden;
}

Great! I'll try to find some time to work on this one but I'd appreciate a PR for it as well!

What's the plan on creating focus style for the dropzone div? For example if you add a focus class what style would you use for .dropzone.isFocused? Create a custom style? Or just leave it blank and rely on the user to add a custom style?
IIRC browsers don't necessarily have the same default focus style and Firefox doesn't have any, instead it just uses the default focus style of the OS you are using.

@josh18 you can look at the source code to see, how active, rejected and default styles are handled.
Basically, if you provide you classes or styles- it will you them, if you don't provide anything - will use default ones.

Sorry I probably wasn't very clear with my question, I mean what css properties are you going to use? For example in Chrome the default for :focus is outline: -webkit-focus-ring-color auto 5px;

I'd choose border-color / outline or something, that doesn't need browser prefixes. Actually, since currently there is no such feature, any styling will be good as it can easily be changed later.

Wouldn't you want it to be consistent with the default browser styles though? Otherwise there's a high chance it is going to be different from all the other focus styles on the page.

It depends on the personal taste, I actually never rely on default library styles. The real answer is - the person with the PR will have to decide this for us :)

The more I think about it, the less I like the approach of providing these styles by this library. Following the "React-way" should allow easy composition. Having lot's of such decisions in the library will potentially break some use cases for many people.
Consider the following example: you have a Dropzone around a <textarea>, like GitHub does. I believe it is the <textarea> you want to get be focused when you navigate with the keyboard and not the <input>. Same way, if you want to make the Dropzone look like a normal input, there should be an easy way of passing styles to the input element.
I think, in the end, this should be done in the user-land, i.e. it should be a developer's job to provide accessible content inside the Dropzone. One exception, though, is the ability to style the input should be also provided. I think this is pretty easy and elegant solution that would not break anything.
Thoughts?

Good point, I didn't think about having multiple controls inside (though in your example I think you would want both focusable).
Letting the developer add styles to the file input seems like a good idea to me. If possible maybe you could also let them add attributes so they can add things like onFocus and aria-label?
The only problem with this approach is that I think lots of developers will either forget or ignore the accessibility part. Maybe if these changes go through I can write up some accessible examples to remind them and help them get started? Do you think that would be helpful?

@josh18 I'd be happy to include your accessibility tips. I also think this lib could provide sane defaults out of the box (talking about aria-label for example) + a way to customize it.
I'm still not sure how to tackle such a change. One of the pain points is also integrating this component with forms (redux-form or simple ones) since the implementation detail about the input is hidden. On the other hand, I realize most of the developers appreciate the ease of integration. Does anyone have an idea here?
PS: Should ↑ be a separate discussion?

Sorry I don't quite understand what you are meaning, can you expand on this?

since the implementation detail about the input is hidden

Also I just realised you can already edit the input via inputProps which is really useful, maybe one of the changes we make is split up overridable (style, aria-label) and non-overridable props (ref, onChange, etc).

I think this can be solved with the following steps:

use a root element of type button instead of div
allow tabindex on dropzone props.
add onClick prop on root with a value of this.open.

I have this code:
<form>
  <input />
  <Dropzone ref={"dropzone"}>
      <button type="button" onClick = { (e) => { e.preventDefault(); this.refs.dropzone.open(); } } />
  </Dropzone>
</form>

The problem is when i press enter with input focused, onClick dropzone button is trigered. But if move button out of Dropzone, it isnt happens.
I don know if it is related with this issue. Sorry if not

:tada: This issue has been resolved in version 8.0.0 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


Including set env db.sh

Following the new scheme for configuration files, I included the set_env_db_template.sh in the gammasim-tools repository, updating the documentation.

Codecov Report

Merging #380 (76e9937) into master (97d72b4) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #380   +/-   ##
=======================================
  Coverage   78.51%   78.51%
=======================================
  Files          68       68
  Lines        6687     6687
=======================================
  Hits         5250     5250
  Misses       1437     1437

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

I addressed the comments and now the tests are passing, so I am merging it. If something more is needed please undo it and let me know.


Pinning the llvm repository on 3.8.

cc @ctiller - llvm-toolchain-wily contains clang-format, and not a "stable" clang-format-3.8.

LGTM

I'm still have issues with the patch:
$ ./tools/distrib/clang_format_code.sh
++ dirname ./tools/distrib/clang_format_code.sh
+ cd ./tools/distrib/../..
+ docker build -t grpc_clang_format tools/dockerfile/grpc_clang_format
Sending build context to Docker daemon 6.656 kB
Step 1 : FROM ubuntu:wily
 ---> a45461306653
Step 2 : RUN apt-get update
 ---> Using cache
 ---> fbb5bd70d882
Step 3 : RUN apt-get -y install wget
 ---> Using cache
 ---> 72f5edf90b2c
Step 4 : RUN echo deb http://llvm.org/apt/wily/ llvm-toolchain-wily-3.8 main >> /etc/apt/sources.list
 ---> Running in 2261023f4da1
 ---> 2e53a31ef55d
Removing intermediate container 2261023f4da1
Step 5 : RUN echo deb-src http://llvm.org/apt/wily/ llvm-toolchain-wily-3.8 main >> /etc/apt/sources.list
 ---> Running in 477abf569f63
 ---> f4d09fea5e84
Removing intermediate container 477abf569f63
Step 6 : RUN apt-get update
 ---> Running in 4c79839f6cab
Hit http://archive.ubuntu.com wily InRelease
Get:1 http://archive.ubuntu.com wily-updates InRelease [65.9 kB]
Get:2 http://archive.ubuntu.com wily-security InRelease [65.9 kB]
Get:3 http://llvm.org llvm-toolchain-wily-3.8 InRelease [4220 B]
Ign http://llvm.org llvm-toolchain-wily-3.8 InRelease
Get:4 http://llvm.org llvm-toolchain-wily-3.8/main Sources [1830 B]
Get:5 http://archive.ubuntu.com wily/main Sources [1411 kB]
Get:6 http://llvm.org llvm-toolchain-wily-3.8/main amd64 Packages [6060 B]
Get:7 http://archive.ubuntu.com wily/restricted Sources [7171 B]
Get:8 http://archive.ubuntu.com wily/universe Sources [8976 kB]
Get:9 http://archive.ubuntu.com wily/main amd64 Packages [1833 kB]
Get:10 http://archive.ubuntu.com wily/restricted amd64 Packages [23.1 kB]
Get:11 http://archive.ubuntu.com wily/universe amd64 Packages [8673 kB]
Get:12 http://archive.ubuntu.com wily-updates/main Sources [98.2 kB]
Get:13 http://archive.ubuntu.com wily-updates/restricted Sources [3560 B]
Get:14 http://archive.ubuntu.com wily-updates/universe Sources [26.5 kB]
Get:15 http://archive.ubuntu.com wily-updates/main amd64 Packages [273 kB]
Get:16 http://archive.ubuntu.com wily-updates/restricted amd64 Packages [20.4 kB]
Get:17 http://archive.ubuntu.com wily-updates/universe amd64 Packages [119 kB]
Get:18 http://archive.ubuntu.com wily-security/main Sources [58.0 kB]
Get:19 http://archive.ubuntu.com wily-security/restricted Sources [2681 B]
Get:20 http://archive.ubuntu.com wily-security/universe Sources [12.3 kB]
Get:21 http://archive.ubuntu.com wily-security/main amd64 Packages [192 kB]
Get:22 http://archive.ubuntu.com wily-security/restricted amd64 Packages [17.4 kB]
Get:23 http://archive.ubuntu.com wily-security/universe amd64 Packages [64.2 kB]
Fetched 22.0 MB in 3s (7064 kB/s)
Reading package lists...
W: GPG error: http://llvm.org llvm-toolchain-wily-3.8 InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 15CF4D18AF4F7421
W: Size of file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_wily-updates_main_source_Sources.gz is not what the server reported 98246 98250
W: Size of file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_wily-security_main_source_Sources.gz is not what the server reported 57962 57969
W: Size of file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_wily-security_main_binary-amd64_Packages.gz is not what the server reported<PHONE_NUMBER>96
 ---> 6b32eb30e5e8
Removing intermediate container 4c79839f6cab
Step 7 : RUN apt-get -y install clang-format-3.8
 ---> Running in 634dfa1d8335
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
  file libbsd0 libedit2 libexpat1 libffi6 libllvm3.8 libmagic1
  libpython-stdlib libpython2.7-minimal libpython2.7-stdlib libsqlite3-0
  mime-support python python-minimal python2.7 python2.7-minimal
Suggested packages:
  python-doc python-tk python2.7-doc binutils binfmt-support
The following NEW packages will be installed:
  clang-format-3.8 file libbsd0 libedit2 libexpat1 libffi6 libllvm3.8
  libmagic1 libpython-stdlib libpython2.7-minimal libpython2.7-stdlib
  libsqlite3-0 mime-support python python-minimal python2.7 python2.7-minimal
0 upgraded, 17 newly installed, 0 to remove and 0 not upgraded.
Need to get 15.4 MB of archives.
After this operation, 64.7 MB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  libllvm3.8 clang-format-3.8
E: There are problems and -y was used without --force-yes

The subsequent runs of this command give me a similar package authentication error. Maybe I need to clear my cache somehow...
$ ./tools/distrib/clang_format_code.sh
++ dirname ./tools/distrib/clang_format_code.sh
+ cd ./tools/distrib/../..
+ docker build -t grpc_clang_format tools/dockerfile/grpc_clang_format
Sending build context to Docker daemon 6.656 kB
Step 1 : FROM ubuntu:wily
 ---> a45461306653
Step 2 : RUN apt-get update
 ---> Using cache
 ---> fbb5bd70d882
Step 3 : RUN apt-get -y install wget
 ---> Using cache
 ---> 72f5edf90b2c
Step 4 : RUN echo deb http://llvm.org/apt/wily/ llvm-toolchain-wily-3.8 main >> /etc/apt/sources.list
 ---> Using cache
 ---> 2e53a31ef55d
Step 5 : RUN echo deb-src http://llvm.org/apt/wily/ llvm-toolchain-wily-3.8 main >> /etc/apt/sources.list
 ---> Using cache
 ---> f4d09fea5e84
Step 6 : RUN apt-get update
 ---> Using cache
 ---> 6b32eb30e5e8
Step 7 : RUN apt-get -y install clang-format-3.8
 ---> Running in 195205f77427
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
  file libbsd0 libedit2 libexpat1 libffi6 libllvm3.8 libmagic1
  libpython-stdlib libpython2.7-minimal libpython2.7-stdlib libsqlite3-0
  mime-support python python-minimal python2.7 python2.7-minimal
Suggested packages:
  python-doc python-tk python2.7-doc binutils binfmt-support
The following NEW packages will be installed:
  clang-format-3.8 file libbsd0 libedit2 libexpat1 libffi6 libllvm3.8
  libmagic1 libpython-stdlib libpython2.7-minimal libpython2.7-stdlib
  libsqlite3-0 mime-support python python-minimal python2.7 python2.7-minimal
0 upgraded, 17 newly installed, 0 to remove and 0 not upgraded.
Need to get 15.4 MB of archives.
After this operation, 64.7 MB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  libllvm3.8 clang-format-3.8
E: There are problems and -y was used without --force-yes

@jboeuf   this has broken the sanity test (because the code formatting is incorrect).
https://grpc-testing.appspot.com/job/gRPC_pull_requests/8586/config=opt,language=sanity,platform=linux/testReport/junit/(root)/tests/tools_distrib_clang_format_code_sh/
Btw, we are in managed merge mode, next time please add "ready to merge" label and @nicolasnoble  or me will merge.
Fix is here:
https://github.com/grpc/grpc/pull/6534

Sorry about that. Will keep in mind for next time...
On Wed, May 11, 2016 at 10:26 AM, Jan Tattermusch<EMAIL_ADDRESS>wrote:

@jboeuf https://github.com/jboeuf this has broken the sanity test
(because the code formatting is incorrect).
https://grpc-testing.appspot.com/job/gRPC_pull_requests/8586/config=opt,language=sanity,platform=linux/testReport/junit/(root)/tests/tools_distrib_clang_format_code_sh/
Btw, we are in managed merge mode, next time please add "ready to merge"
label and @nicolasnoble https://github.com/nicolasnoble or me will
merge.
Fix is here:
#6534 https://github.com/grpc/grpc/pull/6534
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/grpc/grpc/pull/6444#issuecomment-218529873


Orphan ClusterRole resource-metrics-server-resources deployed

We have noticed an instance of an orphan resource in one of your Kubernetes configuration files. Deploying Kubernetes resources that are not being actively used or referenced by any other resources in the cluster can lead to orphan resources. These orphan resources consume unnecessary resources and can potentially cause confusion or clutter within the cluster.  Additionally, we provide anecdotal evidence from topolvm-topolvm#484 regarding the orphan resource defect.
What happened?:
ClusterRole resource-metrics-server-resources does not have any cluster role binding.
What did you expect to happen?:
resource-metrics-server-resources role should have a role binding, otherwise it is a orphan resource. Or delete resource-metrics-server-resources to avoid deploy orphan resource.
Anything else we need to know?:
Environment:

prometheus-adapter version:  master branch
prometheus version:
Kubernetes version (use kubectl version):
Cloud provider or hardware configuration:
Other info:

/assign @zyue110026
/triage accepted