asyncData is missing the query object on nuxt generate

Version
v2.8.1
Reproduction link
https://vue-asyncdata-demo-hnxvktmgni.now.sh/
Steps to reproduce
This is the source for the demo.
When the project is generated into a static build using NODE_ENV=production npx nuxt generate, the query object is missing from the asyncData method.
In the example provided, it expects to capture ?value=123 and put the 123 in the input element. This works during development but not once it's build to a static site.
Working demo here: https://vue-asyncdata-demo-hnxvktmgni.now.sh/dist/?value=123
The object is entirely missing from the context argument.
What is expected ?
To have query injected as per development process.
What is actually happening?
Missing query from context.

This bug report is available on Nuxt community (#c9365)

Does this happen just on initial page load or also with in-page navigation?

Initial page load.
Unsure of in-page nav - I didn't have a use case for that (and hadn't tested)

Does the asyncData method run at all on initial page load in your case? Dont think its supposed too as on hydration of a generated page it retrieves the data from the window.__NUXT context.
In other words, if your generated page is supposed to work with query parameters these parameters should either also be used when generating those pages or you should implement some sort of hydrate mechanism in eg the beforeMount or mounted hook.

Hi there. Have to dig this one out.
Just realized I also have no query within asyncData on initial load of a generated page.
asyncData() is executed (I assigned some random values to a reactive variable, which I then show in the client later on, so I know it runs).
I also tried to assign the { query } param to a reactive property and what I get is an empty object.
I need this to render some different content when calling the app with a preview iframe form Craft CMS. I know I had access to those once, but I must have changed something, that I don't have access anymore and I cant find out, what it is...

I think when using nuxt generate I don't have any server-side calls anymore. is that correct? (static mode). So asyncData is actually not executed on initial load, because there is no server. But why do I see those random values I assigned?
this is because asyncData is called during nuxt generate! So in my case asyncData is actually NOT called!
Would that make sense?

When using nuxt generate, Nuxt will pre-render each route without any query parameters (since it becomes a static html file), so asyncData is called with query = {}.
Also, when the route is pre-rendered, asyncData won't be called on client-side on hydration and use window.__NUXT__.data value.
If you want to change the behaviour if a query is present, you need to handle it on client-side (using beforeMount or mounted hook).
Example:
export default {
  asyncData ({ query } = {}) {
    return { value: query.value };
  },
  beforeMount() {
    // for hydration
    if (this.value !== this.$route.query.value) {
      this.value = this.$route.query.value
    }
  }
}


Various sync fixes

Coverage increased (+1.1%) to 59.255% when pulling 1994fad067c83e4a639408494368a7adaecfc2ea on edaniels:fixes into 94ea1fe1c98aa05be2eb662595aea7b4c8d177cb on mongodb:master.


linting broken on Typescript tests and definitions

glamorous version: 3.22.1

What you did:
Opened the typescript tests and definitions
What happened:
The linting fails, looks like a bunch of the rules it fails on have been in `tslint-microsoft-contrib
` for a while so linting may not have been working correctly.
Suggested solution:
We update the tslint config to match the eslint ones, also potentially add prettier to the typescript files as well.
Reported code inconsistency:
https://github.com/paypal/glamorous/pull/230#discussion_r129123782
https://github.com/paypal/glamorous/pull/230#discussion_r129125294

Is this still an issue @luke-john?

Ill take a try here if you need help still?

Hey sorry I'd missed the comments on this issue.
Yes this is still an issue that would be great to solve, should be non breaking and can land as a chore.
@oalbacha would you still be able to give this a go?

Sure thing. Let me give it a go.
On Tue, Jul 25, 2017 at 5:32 AM Luke John<EMAIL_ADDRESS>wrote:

Hey sorry I'd missed the comments on this issue.
Yes this is still an issue that would be great to solve, should be non
breaking and can land as a chore.
@oalbacha https://github.com/oalbacha would you still be able to give
this a go?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/paypal/glamorous/issues/172#issuecomment-317602203,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AQN7BUs4nAWYPPqDoxksUF73HYiobhOEks5sRUWigaJpZM4N2sJJ
.

--
Regards,
Omar

Thank you very much.
We've just landed a fairly significant overhaul of the typings on the next branch. So it would be great if you could work off that branch.

Ok great. I will do that.
But can you please help me start? I have forked and cloned the repo. How do I choose to work off the next branch?

First you'll want to make sure your fork is up to date with glamorous
Github have a great article about this at https://help.github.com/articles/syncing-a-fork/.
Once you've synced your fork you'll want to checkout the next branch git checkout next
From there you'll likely want to work on an additional topic branch git checkout -b fix/update-tslint.
Cheers.

When running npm start validate I got some errors:

Could you copy all the output when you run npm start test?

><EMAIL_ADDRESS>start /Users/omaralbacha/Desktop/glamorous
> nps "test"

nps is executing `test` : node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=test jest --coverage
 PASS  src/__tests__/with-theme.js
 PASS  src/__tests__/theme-provider.js (5.898s)
 FAIL  src/__tests__/index.js (7.033s)
  ● can use pre-built glamorous components with css attributes

    - Snapshot
    + Received

    - .css-1t62idy,
    - [data-css-1t62idy] {
    -   -webkit-flex-direction: column;
    -   -ms-flex-direction: column;
    + .css-i91yt1,
    + [data-css-i91yt1] {
    +   flex-direction: column;
    +   href: /is-forwarded;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
    -   display: -webkit-box;
    -   display: -moz-box;
    -   display: -ms-flexbox;
    -   display: -webkit-flex;
    -   display: flex;
    -   flex-direction: column;
    +   -webkit-flex-direction: column;
      }

      <a
    -   class="css-1t62idy is added to classes"
    -   href="/is-forwarded"
    +   class="css-i91yt1 is added to classes"
    +   display="flex"
        id="is-forwarded"
      />

      at Object.<anonymous> (src/__tests__/index.js:36:3)
      at Promise.resolve.then.el (node_modules/p-map/index.js:42:16)
      at process._tickCallback (internal/process/next_tick.js:109:7)

  ● can use pre-built glamorous components with css prop

    - Snapshot
    + Received

    - .css-1d3tm0b,
    - [data-css-1d3tm0b] {
    -   -webkit-flex-direction: column;
    -   -ms-flex-direction: column;
    + .css-1olgftu,
    + [data-css-1olgftu] {
    +   flex-direction: column;
    +   href: /is-forwarded;
    +   background: blue;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
    -   display: -webkit-box;
    -   display: -moz-box;
    -   display: -ms-flexbox;
    -   display: -webkit-flex;
    -   display: flex;
    -   flex-direction: column;
    -   background: blue;
    +   -webkit-flex-direction: column;
      }

      <a
    -   class="css-1d3tm0b is added to classes"
    -   href="/is-forwarded"
    +   class="css-1olgftu is added to classes"
    +   display="flex"
        id="is-forwarded"
      />

      at Object.<anonymous> (src/__tests__/index.js:54:3)
      at Promise.resolve.then.el (node_modules/p-map/index.js:42:16)
      at process._tickCallback (internal/process/next_tick.js:109:7)

 PASS  src/__tests__/create-glamorous.with-component.js
 PASS  src/__tests__/tiny.js
 FAIL  src/__tests__/should-forward-property.js
  ● should forward a random react-supported html attribute

    expect(received).toBeTruthy()

    Expected value to be truthy, instead received
      false

      at Object.<anonymous> (src/__tests__/should-forward-property.js:22:76)
      at Promise.resolve.then.el (node_modules/p-map/index.js:42:16)
      at process._tickCallback (internal/process/next_tick.js:109:7)

Snapshot Summary
 › 2 snapshot tests failed in 1 test suite. Inspect your code changes or run with `npm start -- -u` to update them.

Test Suites: 2 failed, 4 passed, 6 total
Tests:       3 failed, 54 passed, 57 total
Snapshots:   2 failed, 37 passed, 39 total
Time:        11.893s, estimated 36s
Ran all test suites.
----------------------------|----------|----------|----------|----------|----------------|
File                        |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
----------------------------|----------|----------|----------|----------|----------------|
All files                   |      100 |      100 |      100 |      100 |                |
 constants.js               |      100 |      100 |      100 |      100 |                |
 create-glamorous.js        |      100 |      100 |      100 |      100 |                |
 dom-elements.js            |      100 |      100 |      100 |      100 |                |
 get-glamor-classname.js    |      100 |      100 |      100 |      100 |                |
 index.js                   |      100 |      100 |      100 |      100 |                |
 react-compat.js            |      100 |      100 |      100 |      100 |                |
 react-props.js             |      100 |      100 |      100 |      100 |                |
 should-forward-property.js |      100 |      100 |      100 |      100 |                |
 split-props.js             |      100 |      100 |      100 |      100 |                |
 theme-provider.js          |      100 |      100 |      100 |      100 |                |
 tiny.js                    |      100 |      100 |      100 |      100 |                |
 with-theme.js              |      100 |      100 |      100 |      100 |                |
----------------------------|----------|----------|----------|----------|----------------|
The script called "test" which runs "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=test jest --coverage" failed with exit code 1 https://github.com/kentcdodds/nps/blob/v5.6.0/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code

npm ERR! Darwin 16.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" "test"
npm ERR! node v6.11.1
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR<EMAIL_ADDRESS>start: `nps "test"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the<EMAIL_ADDRESS>start script 'nps "test"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the glamorous package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     nps "test"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs glamorous
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls glamorous
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/omaralbacha/Desktop/glamorous/npm-debug.log

Looks like your dependencies are out of date. Try deleting your node_modules and reinstalling them.

Ok so I uninstalled node_modules then ran npm install, npm start validate & npm start test
Here is the output:
~/D/glamorous (master|✔) $ npm uninstall node_modules                                                                                08:36:10
npm WARN<EMAIL_ADDRESS>requires a peer of eslint@>3 but none was installed.
~/D/glamorous (master|✔) $ npm install                                                                                08:36:35
npm WARN<EMAIL_ADDRESS>requires a peer of eslint@>3 but none was installed.
~/D/glamorous (master|✔) $ npm start validate                                                                                08:37:23

><EMAIL_ADDRESS>start /Users/omaralbacha/Desktop/glamorous
> nps "validate"

nps is executing `validate` : node node_modules/concurrently/src/main.js --kill-others-on-fail --prefix-colors "bgBlue.bold,bgMagenta.bold,bgGreen.bold" --prefix "[{name}]" --names "lint,build.andTest,test" 'nps lint' 'nps build.andTest' 'nps test'
[build.andTest] nps is executing `build.andTest` : nps build && nps test.build && nps test.size
[lint] nps is executing `lint` : eslint .
[test] nps is executing `test` : node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=test jest --coverage
[build.andTest] nps is executing `build` : node node_modules/rimraf/bin.js dist && node node_modules/concurrently/src/main.js --kill-others-on-fail --prefix-colors "bgBlue.bold,bgMagenta.bold,bgGreen.bold,bgBlack.bold,bgCyan.bold,bgRed.bold,bgWhite.bold,bgYellow.bold" --prefix "[{name}]" --names "build.es,build.cjs,build.umd.main,build.umd.min,build.es.tiny,build.cjs.tiny,build.umd.main.tiny,build.umd.min.tiny" 'nps build.es' 'nps build.cjs' 'nps build.umd.main' 'nps build.umd.min' 'nps build.es.tiny' 'nps build.cjs.tiny' 'nps build.umd.main.tiny' 'nps build.umd.min.tiny'
[build.andTest] [build.es] nps is executing `build.es` : rollup --config --environment FORMAT:es && node other/concat-exports.js
[build.andTest] [build.umd.main] nps is executing `build.umd.main` : rollup --config --sourcemap --environment FORMAT:umd
[build.andTest] [build.es.tiny] nps is executing `build.es.tiny` : rollup --config --environment FORMAT:es,TINY
[build.andTest] [build.umd.main.tiny] nps is executing `build.umd.main.tiny` : rollup --config --sourcemap --environment FORMAT:umd,TINY
[build.andTest] [build.umd.min] nps is executing `build.umd.min` : rollup --config --sourcemap --environment MINIFY,FORMAT:umd
[build.andTest] [build.umd.min.tiny] nps is executing `build.umd.min.tiny` : rollup --config --sourcemap --environment MINIFY,FORMAT:umd,TINY
[build.andTest] [build.cjs] nps is executing `build.cjs` : rollup --config --environment FORMAT:cjs
[build.andTest] [build.cjs.tiny] nps is executing `build.cjs.tiny` : rollup --config --environment FORMAT:cjs,TINY
[build.andTest] [build.es.tiny] nps build.es.tiny exited with code 0
[build.andTest] [build.cjs.tiny] nps build.cjs.tiny exited with code 0
[test]  PASS  src/__tests__/should-forward-property.js (14.98s)
[build.andTest] [build.umd.main.tiny] nps build.umd.main.tiny exited with code 0
[test]  FAIL  src/__tests__/index.js (18.577s)
[test]   ● can use pre-built glamorous components with css attributes
[test]
[test]     - Snapshot
[test]     + Received
[test]
[test]     - .css-1t62idy,
[test]     - [data-css-1t62idy] {
[test]     -   -webkit-flex-direction: column;
[test]     -   -ms-flex-direction: column;
[test]     + .css-i91yt1,
[test]     + [data-css-i91yt1] {
[test]     +   flex-direction: column;
[test]     +   href: /is-forwarded;
[test]         -webkit-box-orient: vertical;
[test]         -webkit-box-direction: normal;
[test]     -   display: -webkit-box;
[test]     -   display: -moz-box;
[test]     -   display: -ms-flexbox;
[test]     -   display: -webkit-flex;
[test]     -   display: flex;
[test]     -   flex-direction: column;
[test]     +   -webkit-flex-direction: column;
[test]       }
[test]
[test]       <a
[test]     -   class="css-1t62idy is added to classes"
[test]     -   href="/is-forwarded"
[test]     +   class="css-i91yt1 is added to classes"
[test]     +   display="flex"
[test]         id="is-forwarded"
[test]       />
[test]
[test]       at Object.<anonymous> (src/__tests__/index.js:36:3)
[test]       at Promise.resolve.then.el (node_modules/p-map/index.js:42:16)
[test]       at process._tickCallback (internal/process/next_tick.js:109:7)
[test]
[test]   ● can use pre-built glamorous components with css prop
[test]
[test]     - Snapshot
[test]     + Received
[test]
[test]     - .css-1d3tm0b,
[test]     - [data-css-1d3tm0b] {
[test]     -   -webkit-flex-direction: column;
[test]     -   -ms-flex-direction: column;
[test]     + .css-1olgftu,
[test]     + [data-css-1olgftu] {
[test]     +   flex-direction: column;
[test]     +   href: /is-forwarded;
[test]     +   background: blue;
[test]         -webkit-box-orient: vertical;
[test]         -webkit-box-direction: normal;
[test]     -   display: -webkit-box;
[test]     -   display: -moz-box;
[test]     -   display: -ms-flexbox;
[test]     -   display: -webkit-flex;
[test]     -   display: flex;
[test]     -   flex-direction: column;
[test]     -   background: blue;
[test]     +   -webkit-flex-direction: column;
[test]       }
[test]
[test]       <a
[test]     -   class="css-1d3tm0b is added to classes"
[test]     -   href="/is-forwarded"
[test]     +   class="css-1olgftu is added to classes"
[test]     +   display="flex"
[test]         id="is-forwarded"
[test]       />
[test]
[test]       at Object.<anonymous> (src/__tests__/index.js:54:3)
[test]       at Promise.resolve.then.el (node_modules/p-map/index.js:42:16)
[test]       at process._tickCallback (internal/process/next_tick.js:109:7)
[test]
[build.andTest] [build.es] nps build.es exited with code 0
[build.andTest] [build.cjs] nps build.cjs exited with code 0
[test]  PASS  src/__tests__/theme-provider.js (18.731s)
[build.andTest] [build.umd.min.tiny] nps build.umd.min.tiny exited with code 0
[build.andTest] [build.umd.main] nps build.umd.main exited with code 0
[test]  PASS  src/__tests__/with-theme.js
[test]  PASS  src/__tests__/create-glamorous.with-component.js
[lint] nps lint exited with code 0
[test]  PASS  src/__tests__/tiny.js
[test]
[test] Snapshot Summary
[test]  › 2 snapshot tests failed in 1 test suite. Inspect your code changes or run with `npm start -- -u` to update them.
[test]
[test] Test Suites: 1 failed, 5 passed, 6 total
[test] Tests:       2 failed, 55 passed, 57 total
[test] Snapshots:   2 failed, 37 passed, 39 total
[test] Time:        36.91s
[test] Ran all test suites.
[test] ----------------------------|----------|----------|----------|----------|----------------|
[test] File                        |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
[test] ----------------------------|----------|----------|----------|----------|----------------|
[test] All files                   |      100 |      100 |      100 |      100 |                |
[test]  constants.js               |      100 |      100 |      100 |      100 |                |
[test]  create-glamorous.js        |      100 |      100 |      100 |      100 |                |
[test]  dom-elements.js            |      100 |      100 |      100 |      100 |                |
[test]  get-glamor-classname.js    |      100 |      100 |      100 |      100 |                |
[test]  index.js                   |      100 |      100 |      100 |      100 |                |
[test]  react-compat.js            |      100 |      100 |      100 |      100 |                |
[test]  react-props.js             |      100 |      100 |      100 |      100 |                |
[test]  should-forward-property.js |      100 |      100 |      100 |      100 |                |
[test]  split-props.js             |      100 |      100 |      100 |      100 |                |
[test]  theme-provider.js          |      100 |      100 |      100 |      100 |                |
[test]  tiny.js                    |      100 |      100 |      100 |      100 |                |
[test]  with-theme.js              |      100 |      100 |      100 |      100 |                |
[test] ----------------------------|----------|----------|----------|----------|----------------|
[test] The script called "test" which runs "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=test jest --coverage" failed with exit code 1 https://github.com/kentcdodds/nps/blob/v5.6.0/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
[test] nps test exited with code 1
--> Sending SIGTERM to other processes..
[build.andTest] [build.umd.min] nps build.umd.min exited with code 0
[build.andTest] nps build.andTest exited with code null
The script called "validate" which runs "node node_modules/concurrently/src/main.js --kill-others-on-fail --prefix-colors "bgBlue.bold,bgMagenta.bold,bgGreen.bold" --prefix "[{name}]" --names "lint,build.andTest,test" 'nps lint' 'nps build.andTest' 'nps test'" failed with exit code 1 https://github.com/kentcdodds/nps/blob/v5.6.0/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code

npm ERR! Darwin 16.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" "validate"
npm ERR! node v6.11.1
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR<EMAIL_ADDRESS>start: `nps "validate"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the<EMAIL_ADDRESS>start script 'nps "validate"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the glamorous package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     nps "validate"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs glamorous
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls glamorous
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/omaralbacha/Desktop/glamorous/npm-debug.log
~/D/glamorous (master|✔) $ npm start test                                                                                -1- 08:38:16

><EMAIL_ADDRESS>start /Users/omaralbacha/Desktop/glamorous
> nps "test"

nps is executing `test` : node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=test jest --coverage
 PASS  src/__tests__/should-forward-property.js
 PASS  src/__tests__/theme-provider.js
 PASS  src/__tests__/with-theme.js
 FAIL  src/__tests__/index.js (5.003s)
  ● can use pre-built glamorous components with css attributes

    - Snapshot
    + Received

    - .css-1t62idy,
    - [data-css-1t62idy] {
    -   -webkit-flex-direction: column;
    -   -ms-flex-direction: column;
    + .css-i91yt1,
    + [data-css-i91yt1] {
    +   flex-direction: column;
    +   href: /is-forwarded;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
    -   display: -webkit-box;
    -   display: -moz-box;
    -   display: -ms-flexbox;
    -   display: -webkit-flex;
    -   display: flex;
    -   flex-direction: column;
    +   -webkit-flex-direction: column;
      }

      <a
    -   class="css-1t62idy is added to classes"
    -   href="/is-forwarded"
    +   class="css-i91yt1 is added to classes"
    +   display="flex"
        id="is-forwarded"
      />

      at Object.<anonymous> (src/__tests__/index.js:36:3)
      at Promise.resolve.then.el (node_modules/p-map/index.js:42:16)
      at process._tickCallback (internal/process/next_tick.js:109:7)

  ● can use pre-built glamorous components with css prop

    - Snapshot
    + Received

    - .css-1d3tm0b,
    - [data-css-1d3tm0b] {
    -   -webkit-flex-direction: column;
    -   -ms-flex-direction: column;
    + .css-1olgftu,
    + [data-css-1olgftu] {
    +   flex-direction: column;
    +   href: /is-forwarded;
    +   background: blue;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
    -   display: -webkit-box;
    -   display: -moz-box;
    -   display: -ms-flexbox;
    -   display: -webkit-flex;
    -   display: flex;
    -   flex-direction: column;
    -   background: blue;
    +   -webkit-flex-direction: column;
      }

      <a
    -   class="css-1d3tm0b is added to classes"
    -   href="/is-forwarded"
    +   class="css-1olgftu is added to classes"
    +   display="flex"
        id="is-forwarded"
      />

      at Object.<anonymous> (src/__tests__/index.js:54:3)
      at Promise.resolve.then.el (node_modules/p-map/index.js:42:16)
      at process._tickCallback (internal/process/next_tick.js:109:7)

 PASS  src/__tests__/create-glamorous.with-component.js
 PASS  src/__tests__/tiny.js

Snapshot Summary
 › 2 snapshot tests failed in 1 test suite. Inspect your code changes or run with `npm start -- -u` to update them.

Test Suites: 1 failed, 5 passed, 6 total
Tests:       2 failed, 55 passed, 57 total
Snapshots:   2 failed, 37 passed, 39 total
Time:        10.246s, estimated 21s
Ran all test suites.
----------------------------|----------|----------|----------|----------|----------------|
File                        |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
----------------------------|----------|----------|----------|----------|----------------|
All files                   |      100 |      100 |      100 |      100 |                |
 constants.js               |      100 |      100 |      100 |      100 |                |
 create-glamorous.js        |      100 |      100 |      100 |      100 |                |
 dom-elements.js            |      100 |      100 |      100 |      100 |                |
 get-glamor-classname.js    |      100 |      100 |      100 |      100 |                |
 index.js                   |      100 |      100 |      100 |      100 |                |
 react-compat.js            |      100 |      100 |      100 |      100 |                |
 react-props.js             |      100 |      100 |      100 |      100 |                |
 should-forward-property.js |      100 |      100 |      100 |      100 |                |
 split-props.js             |      100 |      100 |      100 |      100 |                |
 theme-provider.js          |      100 |      100 |      100 |      100 |                |
 tiny.js                    |      100 |      100 |      100 |      100 |                |
 with-theme.js              |      100 |      100 |      100 |      100 |                |
----------------------------|----------|----------|----------|----------|----------------|
The script called "test" which runs "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=test jest --coverage" failed with exit code 1 https://github.com/kentcdodds/nps/blob/v5.6.0/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code

npm ERR! Darwin 16.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" "test"
npm ERR! node v6.11.1
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR<EMAIL_ADDRESS>start: `nps "test"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the<EMAIL_ADDRESS>start script 'nps "test"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the glamorous package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     nps "test"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs glamorous
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls glamorous
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/omaralbacha/Desktop/glamorous/npm-debug.log

Hmmm... I'm pretty sure that you're not based on the next branch. Make sure that your fork is updated. You might consider setting up your git repo like this. Then make sure to update both your master branch and your next branch (make sure you're pulling those from this "upstream" repository https://github.com/paypal/glamorous.git). Then make a branch based on the next branch, reinstall dependencies, and try running npm start validate.

Can you hangout really quickly? I have sent you a hangout invite

Appreciate of you can jump in on a hangout quickly to show you what I have done and how to proceed. Thanks,

I'm sorry, I have a very busy week :-/

This project is now in an unmaintained status. Please see the README for more information.


[DOCKER] Determine the https port for redirect ...

Fix the HTTPS connection issue, as shown by the warning,
backend       | warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3]
backend       |       Failed to determine the https port for redirect.

Thans!

Done. :heart:


Jesse: Watch Smart[\W_]+Vision[\W_]+(?:Clinic|Hospital)

Jesse requests the watch of the watch_keyword Smart[\W_]*+Vision[\W_]*+(?:Clinic|Hospital). See the MS search here and the Stack Exchange search in text, in URLs, and in code.

Smart[\W_]*+Vision[\W_]*+(?:Clinic|Hospital) has been seen in 1 true positive, 0 false positives, and 0 NAAs.

Approved by Spevacus in Charcoal HQ


Performance compared to PyTables

I recently found both zarr and PyTables (finally, a stable replacement to using CSVs...) and was wondering if I'm doing something wrong in my choice of chunk shapes here. My data is roughly a 100000 x 20000 int64 array, fairly compressible, and I need to access it from multiple processes (I'm using PyTorch, which spawns multiple workers). I only really need to access a full row at a time, so I've been setting the chunk size to None on the second dimension.
However, my reads seem to be about 30x slower in zarr than in PyTables, despite using the same compressor/filter (blosc-blosclz). I can't quite reproduce this magnitude of difference using synthetic data, but the example below zarr is about 8x slower than PyTables.
Am I doing something wrong, or is this expected?
import os
import sys

import numcodecs
from numcodecs import Blosc
import numpy as np
import tables
import zarr

def access(z, n=100000):
    i = np.random.randint(0, 100000)
    return z.data[i]

def access_tables(t, n=100000):
    i = np.random.randint(0, 100000)
    return t.root.data[i]

def create_zarr(path, n=100000, shape=(0, 20000), chunks=(100, None)):
    if os.path.exists(path):
        return zarr.open(path)
    else:
        z = zarr.open(path, 'w')
    compressor = Blosc(cname='blosclz', clevel=7)
    arr = z.create('data', shape=shape, compressor=compressor, chunks=chunks)
    for _ in range(n):
        arr.append(np.random.randint(0, 10, (1, shape[1])))
    return z

def create_table(path, n=100000, shape=(0, 20000)):
    if os.path.exists(path):
        return tables.open_file(path)
    else:
        t = tables.open_file(path, 'w')
    filter = tables.Filters(7, 'blosc')
    a = tables.Float64Atom()
    arr = t.create_earray(
        t.root, 'data', a, shape, expectedrows=n, filters=filter,
    )
    for _ in range(n):
        arr.append(np.random.randint(0, 10, (1, shape[1])))
    return t

path = 'bench.{}'
z = create_zarr(path.format('zarr'))
t = create_table(path.format('h5'))

print('zarr info:')
print(z.data.info)
print('tables info:')
print(t.root.data)
print(t.root.data.filters)

print('zarr timings:')
%timeit access(z)
print('tables timings:')
%timeit access_tables(t)

print(f'zarr: {zarr.version.version}')
print(f'numcodecs: {numcodecs.version.version}')
print(f'tables: {tables.__version__}')
print(f'python: {sys.version_info}')
print(f'platform: {sys.platform}')

Output:
zarr info:
Name               : /data
Type               : zarr.core.Array
Data type          : float64
Shape              : (100000, 20000)
Chunk shape        : (100, 20000)
Order              : C
Read-only          : False
Compressor         : Blosc(cname='blosclz', clevel=7, shuffle=SHUFFLE,
                   : blocksize=0)
Store type         : zarr.storage.DirectoryStore
No. bytes          :<PHONE_NUMBER>0 (14.9G)
No. bytes stored   :<PHONE_NUMBER> (2.1G)
Storage ratio      : 7.2
Chunks initialized : 1000/1000

tables info:
/data (EArray(100000, 20000), shuffle, blosc(7)) ''
Filters(complevel=7, complib='blosc', shuffle=True, bitshuffle=False, fletcher32=False, least_significant_digit=None)
zarr timings:
4.11 ms ± 343 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
tables timings:
560 µs ± 36.8 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
zarr: 2.2.0
numcodecs: 0.5.5
tables: 3.4.4
python: sys.version_info(major=3, minor=6, micro=6, releaselevel='final', serial=0)
platform: linux

zarr/numcodecs/tables installed using conda.

Hi @sd2k, I think it's probably because of the different sizes of the chunks along the first dimension.
You did not specify the chunk length in pytables, which means it will guess a value based on the expectedlen. In this case it will guess 7 for the chunk length:
In [1]: import tables

In [2]: t = tables.open_file('test.h5', mode='w')

In [3]: a = tables.Float64Atom()

In [5]: arr = t.create_earray(
   ...:     t.root, 'data', a, shape=(0, 20000), expectedrows=100000,
   ...: )

In [7]: arr
Out[7]:
/data (EArray(0, 20000)) ''
  atom := Float64Atom(shape=(), dflt=0.0)
  maindim := 0
  flavor := 'numpy'
  byteorder := 'little'
  chunkshape := (6, 20000)

If you create the zarr array with chunks=(6, None) you should get comparable performance.

Btw this is a use case where having a cache for decompressed chunks should accelerate further, xref #278, PR in progress https://github.com/zarr-developers/zarr/pull/306. Would allow more coarse-grained chunking without comprising ability to access one row at a time.

Cool, no worries. FWIW if you are reading 1 row at a time then chunks=(1, None) will be fastest. If you can adapt your logic to read one chunk at a time into memory, then iterate over rows within chunks, then you obviously would have flexibility to have larger chunks, and larger chunks usually give (much) better read speed and compression ratio. Once #306 is in that would be handled transparently for you, but it's not there yet.

Ace, thanks for the recommendation. I've settled for something low like 4 to strike a bit of a balance and it's looking good!
And thanks for writing zarr :)


Tesseract 4 cannot use anything other than --oem 0

Platform is Debian Jessie - Tesseract 4.00 Git Version.
Platform: Linux localhost 4.4.27-x86_64-jb1 #4 SMP Tue Jun 6 14:41:09 CEST 2017 x86_64 GNU/Linux
Tesseract crashes with "Illegal Instruction" when using anything other than --oem 0
Tesseract Open Source OCR Engine v4.00.00alpha with Leptonica
Detected 35 diacritics
Illegal instruction

Tesseract -v reports
tesseract 4.00.00alpha
 leptonica-1.74.4
  libjpeg 6b (libjpeg-turbo 1.3.1) : libpng 1.2.50 : libtiff 4.0.3 : zlib 1.2.8 : libopenjp2 2.1.0

 Found AVX
 Found SSE

I can scan with --oem 0 though.

what is the version of your traineddata files? Download latest version from the tessdata repo.

Ok, so now I reinstalled tesseract just to make sure I did everything right.
Tessdata files like 'eng.traineddata' have now been downloaded directly from the repo into  /usr/local/share/tessdata
Current content:
configs  deu.traineddata  eng.traineddata  pdf.ttf  tessconfigs
Now Tesseract starts but tells me that it can't load any language. Which is quite odd.
tesseract --tessdata-dir /usr/local/share/tessdata/tessdata -l eng  test.jpg out
results in:
Error opening data file /usr/local/share/tessdata/eng.traineddata
Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory.
Failed loading language 'eng'
Tesseract couldn't load any languages!
Could not initialize tesseract.

tesseract -l eng  test.jpg out
results in:
Error opening data file /usr/local/share/eng.traineddata
and
tesseract --tessdata-dir /usr/local/share/tessdata -l eng  test.jpg out
also results in:
Error opening data file /usr/local/share/eng.traineddata
And whatever I set the TESSDATA_PREFIX to, (like TESSDATA_PREFIX=/usr/share/tesseract-ocr/tessdata) does not get honored at all.
I simply don't get it. What's going on here?

Ok, I solved the language problem.  After unsetting TESSDATA_PREFIX and simply using:
wget https://github.com/tesseract-ocr/tessdata/raw/4.00/deu.traineddata
Tesseract seems to be able to load the language files from the default /usr/local/share/tessdata again.
But still --oem 1 results in:
Tesseract Open Source OCR Engine v4.00.00alpha with Leptonica
Detected 35 diacritics
Illegal instruction

When using the data files from:
 git clone --depth=1 https://github.com/tesseract-ocr/tessdata.git tessdata-repo
tesseract fails to load the language files.
But when using the data files from: https://github.com/tesseract-ocr/tesseract/wiki/Data-Files
by downloading with:
wget https://github.com/tesseract-ocr/tessdata/raw/4.00/eng.traineddata
I can start tesseract with --oem 0, but --oem 1 or --oem 2 results in the  illegal instruction message

Test with the tif file in testing directory. It works ok for me.
# tesseract phototest.tif phototest --tessdata-dir ../
Tesseract Open Source OCR Engine v4.00.00dev-2067 with Leptonica
Page 1

# tesseract phototest.tif phototest --tessdata-dir ../ --oem 1
Tesseract Open Source OCR Engine v4.00.00dev-2067 with Leptonica
Page 1

# tesseract phototest.tif phototest --tessdata-dir ../ --oem 2
Tesseract Open Source OCR Engine v4.00.00dev-2067 with Leptonica
Page 1

# tesseract -v
tesseract 4.00.00dev-2067
 leptonica-1.74.4
  libjpeg 8d (libjpeg-turbo 1.3.0) : libpng 1.2.50 : libtiff 4.0.3 : zlib 1.2.8

 Found AVX
 Found SSE

When you say ' Tesseract 4.00 Git Version' I take it to mean that you are using the latest source from github to build tesseract.

That's correct.

Please test tesserxct with phototest.tif
https://github.com/tesseract-ocr/tesseract/blob/master/testing/phototest.tif

wget https://github.com/tesseract-ocr/tessdata/raw/4.00/eng.traineddata

that looks wrong to me. There is no 4.00 folder/branch.
The master branch is for 4.00.00alpha.
Get the following file:
https://github.com/tesseract-ocr/tessdata/blob/master/eng.traineddata?raw=true

Looks like there is a tag for 4.00 - https://github.com/tesseract-ocr/tessdata/releases/tag/4.00
So https://github.com/tesseract-ocr/tessdata/raw/4.00/eng.traineddata may be ok.

OK. I tested it with the traineddata above. But also it's the same I'm using here.
I also confirmed that tesseract in indeed using the right data folder.
But again the phototest.tif works fine with --oem 0 and results in the same error "illegal instructions" for any other --oem option or none (default should be --oem 2 if I'm not mistaken)
And although compilation seemed fine. I didn't see an error or warning. So I guess there must be some library missing here.
Also I reinstalled Leptonica and Tesseract multiple times now.
Here's how I've installed the tools:
1. Make sure that the following libraries are installed:

       # nickbe:  I had to replace libpng12-dev for debian jessie

	apt-get install autoconf-archive automake g++ libtool libleptonica-dev pkg-config
	apt-get install libpango1.0-dev

	# sudo apt-get install g++ # or clang++ (presumably)
	sudo apt-get install autoconf automake libtool
	sudo apt-get install autoconf-archive
	sudo apt-get install pkg-config
	sudo apt-get install libpng12-dev
	sudo apt-get install libjpeg-turbo
	sudo apt-get install libtiff5-dev
	sudo apt-get install zlib1g-dev

	sudo apt-get install libicu-dev
	sudo apt-get install libpango1.0-dev
	sudo apt-get install libcairo2-dev

2. Install Leptonica:

	git clone --depth 1 https://github.com/DanBloomberg/leptonica.git leptonica
	cd leptonica
	./autobuild
	./configure
	make
	sudo make install
	ldconfig

3. Install Tesseract:

    git clone --depth 1  https://github.com/tesseract-ocr/tesseract.git tesseract-ocr
    cd tesseract-ocr
    ./autogen.sh

    ./configure --disable-openmp --disable-shared --disable-static
    or
    ./configure        # nickbe: I TESTED BOTH CONFIGURATIONS JUST TO MAKE SURE
    make

    sudo make install
	sudo ldconfig

	# sudo make training
	# sudo make training-install

	sudo make install-langs      # nickbe: Never does anything so far
      sudo ldconfig

4. wget tessdata from https://github.com/tesseract-ocr/tesseract/wiki/Data-Files
   to /usr/local/share/tessdata

   Example: wget https://github.com/tesseract-ocr/tessdata/raw/4.00/eng.traineddata

build with --enable-debug and run with gdb to get additional info.
ShreeDevi

भजन - कीर्तन - आरती @ http://bhajans.ramparivar.com
On Wed, Jul 19, 2017 at 11:05 PM, Nick<EMAIL_ADDRESS>wrote:

OK. I tested it with the traineddata above. But also it's the same I'm
using here.
I also confirmed that tesseract in indeed using the right data folder.
But again the phototest.tif works fine with --oem 0 and results in the
same error "illegal instructions" for any other --oem option or none
(default should be --oem 2 if I'm not mistaken)
And although compilation seemed fine. I didn't see an error or warning. So
I guess there must be some library missing here.
Also I reinstalled Leptonica and Tesseract multiple times now.
Here's how I've installed the tools:

Make sure that the following libraries are installed:
# nickbe:  I had to replace libpng12-dev for debian jessie

apt-get install autoconf-archive automake g++ libtool libleptonica-dev pkg-config
apt-get install libpango1.0-dev
sudo apt-get install g++ # or clang++ (presumably)
sudo apt-get install autoconf automake libtool
sudo apt-get install autoconf-archive
sudo apt-get install pkg-config
sudo apt-get install libpng12-dev
sudo apt-get install libjpeg-turbo
sudo apt-get install libtiff5-dev
sudo apt-get install zlib1g-dev
sudo apt-get install libicu-dev
sudo apt-get install libpango1.0-dev
sudo apt-get install libcairo2-dev

Install Leptonica:

git clone --depth 1 https://github.com/DanBloomberg/leptonica.git leptonica
cd leptonica
./autobuild
./configure
make
sudo make install
ldconfig

Install Tesseract:
git clone --depth 1  https://github.com/tesseract-ocr/tesseract.git tesseract-ocr
cd tesseract-ocr
./autogen.sh
./configure --disable-openmp --disable-shared --disable-static
or
./configure        # nickbe: I TESTED BOTH CONFIGURATIONS JUST TO MAKE SURE
make
sudo make install
sudo ldconfig

sudo make training
sudo make training-install
sudo make install-langs      # nickbe: Never does anything so far
sudo ldconfig

wget tessdata from https://github.com/tesseract-ocr/tesseract/wiki/Data-Files
to /usr/local/share/tessdata
Example: wget https://github.com/tesseract-ocr/tessdata/raw/4.00/eng.traineddata

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/tesseract-ocr/tesseract/issues/1043#issuecomment-316461110,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AE2_oxqBBceuQv-LRbrZSoOB_RyHelUCks5sPj5ngaJpZM4ObwNC
.

Do not install libleptonica-dev with apt-get, since you manually intsall leptonica later.

apt-get uninstall libleptonica-dev

OK I enabled debug. I also installed the gdb package, but I have no experience with it. How can I provide more information?

sudo make install-langs      # nickbe: Never does anything so far

The comment is correct, so there's no point in doing that.

I think quite important information is that I just installed the package on a fresh instance of debian stretch. I had no problems with installating Leptonica or Tesseract, but after everything was installed I have exactly the same behaviour on this machine. Tesseract runs with --oem 0 but throws the "illegal instruction" message when trying to use --oem 2 or 1.
Seems that there's something very profound missing in the installation procedure.

Try after uninstalling libleptonica-dev as Amit suggested.
for gdb, see https://sourceware.org/gdb/onlinedocs/gdb/Backtrace.html
try the following
gdb --args tesseract phototest.tif phototest --oem 1  (use the command
giving errors)
then when gdb starts, enter
run
after programs throws exception, enter
backtrace
ShreeDevi

भजन - कीर्तन - आरती @ http://bhajans.ramparivar.com
On Thu, Jul 20, 2017 at 12:46 AM, Nick<EMAIL_ADDRESS>wrote:

I think quite important information is that I just installed the package
on a fresh instance of debian stretch. I had no problems with installating
Leptonica or Tesseract, but after everything was installed I have exactly
the same behaviour on this machine. Tesseract runs with --oem 0 but throws
the "illegal instruction" message when trying to use --oem 2 or 1.
Seems that there's something very profound missing in the installation
procedure.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/tesseract-ocr/tesseract/issues/1043#issuecomment-316488738,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AE2_ozXbQmrRYDmNhdzcCoOUnNZRqFcIks5sPlYZgaJpZM4ObwNC
.

Ok. I managed to run Tesseract with gdb. Here's the output:

(gdb) set args -l eng --oem 2 test.png out
(gdb) run
Starting program: /usr/local/bin/tesseract -l eng --oem 2 test.png out
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Tesseract Open Source OCR Engine v4.00.00alpha with Leptonica
Detected 35 diacritics

Program received signal SIGILL, Illegal instruction.
tesseract::DotProductAVX (u=0x127aa70, v=0x51dbc60, n=25) at dotproductavx.cpp:70
70            __m256d floats2 = _mm256_loadu_pd(v);
(gdb)

./configure --disable-openmp --disable-shared --disable-static

https://github.com/tesseract-ocr/tesseract/issues/898#issuecomment-315202167
https://github.com/tesseract-ocr/tesseract/issues/943#issuecomment-305408592

change this in configure.ac
AX_CHECK_COMPILE_FLAG([-mavx], [avx=true], [avx=false])
to
AX_CHECK_COMPILE_FLAG([-mavx], [avx=false], [avx=false])
and recompile tesseract again.

btw. I already uninstalled libleptonica-dev before.
Do I have to "make uninstall" before recompiling?

Do I have to "make uninstall" before recompiling?

You mean make uninstall tesseract ?
You don't have to in this case.
Also, what's the output of cat /proc/cpuinfo | grep flags ?

flags           : fpu tsc msr pae cx8 apic cmov pat clflush mmx fxsr sse sse2 ss syscall nx lm constant_tsc rep_good nopl pni pclmulqdq vmx ssse3 cx16 sse4_1 sse4_2 popcnt aes f16c rdrand hypervisor lahf_lm tpr_shadow vnmi flexpriority ept vpid
flags           : fpu tsc msr pae cx8 apic cmov pat clflush mmx fxsr sse sse2 ss syscall nx lm constant_tsc rep_good nopl pni pclmulqdq vmx ssse3 cx16 sse4_1 sse4_2 popcnt aes f16c rdrand hypervisor lahf_lm tpr_shadow vnmi flexpriority ept vpid
flags           : fpu tsc msr pae cx8 apic cmov pat clflush mmx fxsr sse sse2 ss syscall nx lm constant_tsc rep_good nopl pni pclmulqdq vmx ssse3 cx16 sse4_1 sse4_2 popcnt aes f16c rdrand hypervisor lahf_lm tpr_shadow vnmi flexpriority ept vpid

After recompiling everything with the changed flag the new output is:
Tesseract Open Source OCR Engine v4.00.00alpha with Leptonica
Detected 35 diacritics
DotProductAVX can't be used on Android
DotProductAVX can't be used on Android
Aborted

Android?!

According to that output your cpu does not support avx.
Try to edit configure.ac as I said above.

The latest recompile was already done with the modified configure.ac.
That was the output when running:  tesseract -l eng --oem 2 ......
As always --oem 0 works.

OK. You will have to do another change in the code.
I will tell you later/tomorrow what to do next.

In arch/simddetect.h
Change this line
static inline bool IsAVXAvailable() { return detector.avx_available_; }
to
static inline bool IsAVXAvailable() { return false; }
I hope we will finish with this change :-)

It's strange that tesseract -v reports Found AVX while your CPU obviously does not support AVX (see output of /proc/cpuinfo. That's causing the crash which you observe. What kind of CPU are you using? Are you running on a virtual machine?
Could you use the GDB debugger to step through the function SIMDDetect::SIMDDetect (in arch/simddetect.cpp) which is executed right at the beginning? Maybe you have a buggy __get_cpuid function (or a buggy virtual machine). Try to print the value of ecx which is set by that function.
Removing the code avx_available_ = (ecx & 0x10000000) != 0; will work around the problem and fix the crash.

and recompile of course.

Do what I said before listening to @stweil :-)

@stweil
Yes. It's strange.
I want to make sure the problem will be solved after disabling (cheating) avx detection.
If that happen, nickbe will need to undo the 2 changes and recompile. Then you will do your analysis...

What kind of CPU are you using?

cat /proc/cpuinfo | grep name

It's a vServer. Probably XEN but I'm not sure. We do use them quite often without problems. So I have no idea why this case is indeed so strange. I'm recompiling now...

Yay. It's working finally. Thanks you so much guys 💃 Will the changes in the make make it into the official repository.?
So now that I can in fact test the new 4.0 feats, is there a way to speed up scanning? Any switches that are recommended?

Will the changes in the make make it into the official repository?

No, they won't, because those changes disable AVX support which is highly desired: AVX makes Tesseract faster. The problem is most probably caused by your vServer which returns a wrong cpuid. That cpuid claims that your vServer supports AVX, but it does not. You can try to get more more information on that vServer (is it XEN, which version?) and report the problem.
We could add a Tesseract option to select SSE / AVX (overriding the automatic detection). Then Tesseract would still crash by default in your case, but it would be possible to make it work using that new option.

Is this something new to the 4.00 version? Because the 3.x Versions ran just fine.

Yes. AVX is used for the calculation of the dot product which is needed for LSTM (new in 4.00, not used with --oem 0).

Maybe there's a safer method to detect the capability? Can I find out if other methods show the correct capabilities for you guys?
If you like I'd be happy to grant you access to the server.

https://github.com/tesseract-ocr/tesseract/issues/1043#issuecomment-316519350

No I meant maybe there's a better and more secure way for you guys to recognize these kind of features

@nickbe, you could help by providing more information on the kind of vServer which you were using.

Sure.
https://www.df.eu/de/cloud-hosting/
Currently it's the second smallest vServer

I just wrote to Domain Factory (in German, translated here):

One of your customers has reported a problem with the OCR application
Tesseract: https://github.com/tesseract-ocr/tesseract/issues/1043#issuecomment-317283770
The cause of the crash seems to be the CPUID seen from the vServer guest. That CPUID does not fit the real hardware:
According to CPUID, the CPU supports AVX operations. In fact, these lead to a crash.
Doesn't your hardware support AVX (maybe an older XEON CPU)? Probably the VM of the customer migrated from newer hardware (with AVX) to an older hardware (without AVX), and now it still uses the CPUID of the newer hardware.
What do you advise users in this case?
You can also reply directly to GitHub (URL above).

XEN can set the CPUID seen by guests to avoid exactly that kind of problem: it can mask the AVX bit even when running on a new CPU with AVX support, thus allowing migration to an older CPU.

@nickbe, could you please also run cpuid --one-cpu and cpuid --one-cpu --raw and post the output?

Similar problems: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=646549, https://sourceware.org/bugzilla/show_bug.cgi?id=13007.

Nick, Domain Factory support asks for the name of your Jiffy Box. Could you send me your e-mail address (get my address here)? Then I'll forward their request to you.

@nickbe, did you manage to solve the issue?

@amitdo, I had contacted the Nick's provider. They use XEN servers which do not support AVX, but the CPUID which is seen from the vServer claims that AVX is available. As far as I have understood, this happens when a XEN vServer initially runs on a server with AVX, but is migrated to another server without AVX later.
Only the provider can handle that correctly. Either the XEN vServer must always run on servers with AVX, or the XEN configuration must disable the AVX settings in CPUID even if the server has AVX support.
On the Tesseract side we could try to get a more robust AVX detection which not only checks CPUID. In addition we need an option or parameter to override the automatic selection of SSE2 / AVX.

Ok, @stweil. Thanks for the info.

hi guys, yes I successfully solved the problem by following your instruction to patch the settings.
Thanks again for your support here. Very appreciated indeed :)

What does oem mean, and how do I set it in my java project?


Investigate countries with well modeled or easily modeled government agencies

Do a country have very few government agencies?
Are a country's government agencies well or easily modeled in Wikidata?
Maybe all government agencies of a country have an exclusive external identifier?

etc
https://en.wikipedia.org/wiki/Category:Government_agencies_by_country

Progress at https://www.wikidata.org/wiki/Wikidata:Gov_Directory#Add_your_country

This issue was created to make sure we got plenty of data for the MVP/prototype. The Govdirectory Wikidata page now more than covers the case.
https://www.wikidata.org/wiki/Wikidata:WikiProject_Govdirectory#Add_your_country


trace propagate failed

Describe the bug
I have an API which calls another API
I try to set the nginx otel module for the second API
I set the traceparent header in my call.
Nginx always create a new trace despite the propagate option
If I remove the otel module, then only 1 trace is created in Tempo (ofc I haven't the nginx span)
Expected behavior
Tempo is receiving only 1 trace
Your environment
nginx otel 1.26.1
kubernetes
Additional context
the kubernetes ingress otel module is working fine

Please, provide minimum configuration example.


Investigate and implement using assumed roles for the Guardrails scanning tests

Describe the issue
Currently, there is a  Guardrails scan for single account/role. Because I am scanning several combinations, the test requires a fair amount of manual intervention as each acount/role requires to enter the specific AWS credentials
This ticket wants to investigate and implement, if possible,  role assumption, so starting the scrip using  the AWS master admin credentials will be enough as this this account will be assuming all the other accounts/roles in which we are interested
Additional context
Each scan may take up to 10 minutes. I will be taking about 12 scans, so it means about 2h of watching the screen withouth being able to focus the attention on anything else
Definition of done
A script that will iterate through a list of accounts/roles and will only require the master AWS credentials and the Landing zone number

This link seems to be useful
https://aws.amazon.com/premiumsupport/knowledge-center/iam-assume-role-cli/

Scripts created to assume multiple accounts using the credentials of the master account.
Also created file to compare multiple results files
The work can be found at
https://github.com/BCDevOps/aws-sea-guardrail-scanner/tree/main


Add "pessimistic" arrow function rules

There should be a disallowArrowFunctions rule, and a disallowShorthandArrowFunctions rule.
It turns out that you don't need this to write JavaScript. Object-orientation is perfectly viable with functions that return objects. In fact, it might be better, because if you create objects with functions, you can hide information with closures; whereas everything on this has to be publicly accessible.
Since this isn't needed, arrow functions' lexical this isn't useful. Arrow functions are also less versatile than function, because you can't give them names. Arrow functions' tricky syntax is also harmful to maintenance. Adding additional lines to an arrow function which implicitly returns a value will result in that function returning undefined, unless you remember to add an explicit return. The shorthand syntax is also ambiguous in terms of returning objects, as (name) => {id: name} is interpreted as a longhand arrow function with the label id:.
Some people might decide to just eliminate them altogether, since function seems a lot better if you aren't using this. But for people who don't mind this, they might want to reap the perceived benefits of arrow functions while avoiding their syntactic problems, by requiring they be written in the most-generalized form, the longhand form. Therefore, it is important these rules be added.

---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/25101917-add-pessimistic-arrow-function-rules?utm_campaign=plugin&utm_content=tracker%2F281640&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F281640&utm_medium=issues&utm_source=github).

Thanks @jacksonrayhamilton. Great ideas. Would love two separate issues on the rule proposals. Alternatively, if you're up for submitting a PR that lands both, then that would be awesome.

I will gladly implement these rules.

Sometimes it is scary to observe how Crockford ideas influence people so strongly

It's the idea that matters, not the person.
JSLint actually forbids the block (though for a similar reason, ambiguity):

Finally, ES6 provides an even shorter form of function expression that leaves out the words function and return:
(parameters) => expression

JSLint requires the parens around the parameters, and forbids a { left brace after the => fart to avoid syntactic ambiguity.

You can also add https://gist.github.com/qubyte/43e0093274e793cc82ba#gistcomment-1292183 to your list, would be cool if you unite those lists together, so we would have explanation for this rule and why it is useful.
Could in docs or it could be a link to the such page

Should I add the explanation to the documentation for the rules? A quick skim reveals other rules don't contain justifications. Or is there another document I could add it to?

You could create a gist for it add link to the docs or put them directly.

A quick skim reveals other rules don't contain justifications

Would be nice isn't it? Since arrow syntax is "improvement" on ECMAScript previous version, it might be convenient to explain to the user of why we add such a rule.


I am not able to read the data after writing

Here is the code.
const IPFS = require('ipfs')
const OrbitDB = require('orbit-db')
// OrbitDB uses Pubsub which is an experimental feature
// and need to be turned on manually.
// Note that these options need to be passed to IPFS in
// all examples even if not specfied so.
const ipfsOptions = {
  EXPERIMENTAL: {
    pubsub: true
  }
}
// Create IPFS instance
const ipfs = new IPFS(ipfsOptions)
ipfs.on('error', (e) => console.error(e))
ipfs.on('ready', async () => {
  // Create a database
  console.log('database is ready');
  const orbitdb = new OrbitDB(ipfs)
  const db = await orbitdb.docs('documentstore')
  // Add an entry to the database
  //const hash = await db.add('hello world')
  const hash = await db.put({ _id: 'QmAwesomeIpfsHash', name: 'shamb0t', followers: 500 })
        console.log(hash)
  // Get last 5 entries
  //const latest = db.iterator({ limit: -1 }).collect()
  //console.log(JSON.stringify(latest, null, 2))
   const profile = db.get('shamb0t');
  console.log(profile)
})

I do get [] array whenever I try to get the data back. orbitdb folder is created and i am getting back the hash. but no values from the function.
Help pls.

@codeforgeek, docstore requires a field to index on or it will use _id by default. You can retrieve the data with const profile = db.get('QmAwesomeIpfsHash')
If you would like to use db.get('shamb0t') you should create the db using const db = await orbitdb.docs('documentstore', { indexBy: 'name' }) since you are indexing on the name field, does that make sense?

It does make sense. One more question, how can we get all data of the document without passing the id?

I tried what you suggested and it worked but once i close the program and try to get the data back i get blank array.
Refer this code pls.
const IPFS = require('ipfs-api')
const OrbitDB = require('orbit-db')
// OrbitDB uses Pubsub which is an experimental feature
// and need to be turned on manually.
// Note that these options need to be passed to IPFS in
// all examples even if not specfied so.
const ipfsOptions = {
  EXPERIMENTAL: {
    pubsub: true
  }
}
// Create IPFS instance
const ipfs = new IPFS('localhost','5001')

async function test() {
          // Create a database
  console.log('database is ready');
  const orbitdb = new OrbitDB(ipfs)
  const db = await orbitdb.docs('documentstore')
  // Add an entry to the database
  //const hash = await db.add('hello world')
  //const hash = await db.put({ _id: 'QmAwesomeIpfsHash1', name: 'shamb0t', followers: 500 })
    //    console.log(hash)
  // Get last 5 entries
 // const latest = db.iterator({ limit: -1 }).collect()
  //console.log(JSON.stringify(latest, null, 2))
   const profile = db.get('QmAwesomeIpfsHash1');
  console.log(profile)

}

test()

I figured it out. Thanks for the help.

db.load?

Yes @aphelionz .


an illegal memory access was encountered ？

Hi，I am trying to run your code in my device, which only has one GPU v100. Therefore I changed your code about parallel calculating. I just modified few codes like this in train.py, line 81,82:
        self.enc.cuda()
        self.criterion_cls.cuda()

and put the image, gt_labels and img_raw in CUDA by adding the following codes in train,py :
        image = image.cuda()
        image_raw = image_raw.cuda()
        gt_labels = gt_labels.cuda()

Then when I run the code I find the problem:
Config:
 {'NUM_GPUS': 1, 'TRAIN': {'BATCH_SIZE': 16, 'NUM_EPOCHS': 32, 'NUM_WORKERS': 8, 'MASK_LOSS': 0.0, 'PRETRAIN': 5}, 'TEST': {'METHOD': 'multiscale', 'DATA_ROOT': '/fastdata/naraslanov', 'SCALES': [1, 0.75, 1.25, 1.5], 'FLIP': True, 'PAD_SIZE': [768, 768], 'CROP_SIZE': [448, 448], 'CROP_GRID_SIZE': [2, 2], 'BATCH_SIZE': 8, 'BG_POW': 1, 'NUM_CLASSES': 21, 'USE_GT_LABELS': True, 'FP_CUT_SCORE': 0.3}, 'DATASET': {'CROP_SIZE': 448, 'SCALE_FROM': 0.9, 'SCALE_TO': 1.0, 'PATH': 'data/images'}, 'NET': {'MODEL': 'ae', 'BACKBONE': 'vgg16', 'PRE_WEIGHTS_PATH': './models/weights/vgg16_20M.pth', 'OPT': 'SGD', 'LR': 0.001, 'BETA1': 0.5, 'MOMENTUM': 0.9, 'WEIGHT_DECAY': 0.0005, 'LOSS': 'SoftMargin', 'MASK_LOSS_BCE': 1.0, 'BG_SCORE': 0.1, 'FOCAL_P': 3, 'FOCAL_LAMBDA': 0.01, 'PAMR_KERNEL': [1, 2, 4, 8, 12, 24], 'PAMR_ITER': 10, 'SG_PSI': 0.3}, 'MASKS': {'CRF': {'ALPHA_LOW': 4, 'ALPHA_HIGH': 32}}, 'CUDA': False, 'DEBUG': False, 'PYTORCH_VERSION_LESS_THAN_040': False}
Backbone: VGG16
Model: AE
Loading weights from:  ./models/weights/vgg16_20M.pth
Group 0: #13, LR=1.000e-03
Group 1: #13, LR=2.000e-03
Group 2: #26, LR=1.000e-02
Group 3: #13, LR=2.000e-02
Using SGD >>> learning rate = 1.000e-03, momentum = 9.000e-01, weight decay = 5.000e-04
Epoch >>>  0
THCudaCheck FAIL file=/pytorch/aten/src/THC/THCCachingHostAllocator.cpp line=278 error=700 : an illegal memory access was encountered
Traceback (most recent call last):
  File "/home/amax/ZhangFei/1-stage-SS/train.py", line 340, in <module>
    time_call(trainer.validation, "Validation /   Val: ", epoch, trainer.writer_val, trainer.valloader, checkpoint=True)
  File "/home/amax/ZhangFei/1-stage-SS/train.py", line 329, in time_call
    func(*args, **kwargs)
  File "/home/amax/ZhangFei/1-stage-SS/train.py", line 253, in validation
    cls_raw, masks_all, mask_logits = eval_batch(image, gt_labels)
  File "/home/amax/ZhangFei/1-stage-SS/train.py", line 231, in eval_batch
    self.step(epoch, image, gt_labels, train=False, visualise=False)
  File "/home/amax/ZhangFei/1-stage-SS/train.py", line 101, in step
    losses = {"loss_cls": loss_cls.item(),
RuntimeError: CUDA error: an illegal memory access was encountered

However, when I run the orginal code in another device with 2 GPUs, it works well.. ,which means the data and label is fine. I don't know what's going on here

Hi @Ferenas,
were you able to resolve the issue? Provided enough memory on one GPU, the code should run without modification. You just need to specify the gpu ID with CUDA_VISIBLE_DEVICES.
Best,
Nikita

hi @arnike
I have solved the problems, and
I have to tell you it is the code error, in a line that u write as “+= 255”, which will cause the leak index of calculating loss , so I change it to the = 255, then everything works fine.
Btw, this is not an error of GPU, since I test the original parallel code with two GPUs and same problem is raised, so I have to read and understand ur code to solve the issue.

hi @arnike
I have solved the problems, and
I have to tell you it is the code error, in a line that u write as “+= 255”, which will cause the leak index of calculating loss , so I change it to the = 255, then everything works fine.
Btw, this is not an error of GPU, since I test the original parallel code with two GPUs and same problem is raised, so I have to read and understand ur code to solve the issue.

Hi @Ferenas
Could you please provide more details about this problem? Which line  contains “+= 255”?

hi @arnike
I have solved the problems, and
I have to tell you it is the code error, in a line that u write as “+= 255”, which will cause the leak index of calculating loss , so I change it to the = 255, then everything works fine.
Btw, this is not an error of GPU, since I test the original parallel code with two GPUs and same problem is raised, so I have to read and understand ur code to solve the issue.

Hi @Ferenas
Could you please provide more details about this problem? Which line contains “+= 255”?

Hi @DesertsP
line 65, in stage_net.py ,
mask_gt += (1 - weight) * ignore_index
it is supposed to be:
mask_gt = (1 - weight) * ignore_index
since the aim of this code is to extract the points with low confidence and set their values to 255, so the following operation will ignore these points.

Hi @Ferenas,
thanks for your feedback. I do not think, however, that it's a correct solution. Replacing += with = will also assign label 0 to all confident labels (weight is in [0, 1]).
@DesertsP, could you also provide some details of your setup? (GPUs and PyTorch version) I will try to reproduce this problem.
Thanks.

@arnike Yes. I re-install Pytorch 1.0, this issue disappeared. Higher version of Pytorch has this problem.

Hi @Ferenas,
thanks for your feedback. I do not think, however, that it's a correct solution. Replacing += with = will also assign label 0 to all confident labels (weight is in [0, 1]).
@DesertsP, could you also provide some details of your setup? (GPUs and PyTorch version) I will try to reproduce this problem.
Thanks.

Hi @arnike,
Yes, you are right, I cancel the '+' because the weight valule is either 1 or 0 at the very begining of the training, then I thought it was a mistake to '+='. Thanks to the @DesertsP, it might be the pytorch version problems.

@arnike @DesertsP @Ferenas I have fix this bug just adding one line code. You can see it in https://github.com/visinf/1-stage-wseg/pull/15


Update install.md to fix image render

Bug
Docker for Mac install.md was not displaying an image properly. Instead it showed the improperly formatted Markdown.

Fix
Simple edit to complete the Markdown to render the image properly.

Closing because issue already resolved.


Prims MST

Minimum Spanning Tree

Please read the readme file properly. We are not accepting PR in this format. Refer to Contribution.md to understand how we accept PRs. Till then cheers and keep hacking.... !!!
NB: I'm closing all your PR as it is invalid.


Tests should be skipped if required modules are not installed/Cleaning dependencies

I am using some test modules like Test::Exception or Test::Warn. Those tests should be skipped it the modules are not installed and the modules should be removed from dependency list.

Nice to have but not really important. I vote close.


[BUG] - Upgrading from 2023.10.1 to 2023.11.1+ causes nebari deploy to hang

Describe the bug
In version 2023.11.1 kbatch, clearml, and prefect were removed from Nebari.  If you upgrade from a prior version, clearml.tf, kbatch.tf, and prefect.tf persist in ./stages/07-kubernetes-services/ and are not deleted when running nebari render or nebari deploy commands.
Expected behavior
I would expect the removed files to be deleted during the upgrade process
OS and architecture in which you are running Nebari
NixOS - x86-64
How to Reproduce the problem?
Install nebari version 2023.10.1, then run nebari upgrade to version 2024.1.1.  Then run nebari deploy -c nebari-config.yaml and deployment will hang asking for an unset, required terraform variable clearml-enable-forwardauth.
Other
At a minimum, I think we should put a note telling people to manually delete those files when upgrading to version 2023.11.1.

At a minimum, I think we should put a note telling people to manually delete those files when upgrading to version 2023.11.1.

I see that there is exactly that in the upgrade code.  It's possible I missed that as I was hurrying along.


Dynamo DB table creation

added release service database schema
added unit test to test registering release service with the grpc server
added release service endpoint
resolved requested changes
fixed an error found during initializing dynamodb tables, checking error types prevents tables from being created, more details in Jira

to do: deploy on a testing environment

We need to add the semver package fix that @vmilovanovicc introduced to this PR.


Vue - Cordova -Phonon  issue

Hi,
I didnt succeed to make work the pizza-app-with-vue example in Cordova
Cordova dont want this line :
import App from './App'
So i've tried to workaround this, finally i got in console error :
Cannot read property 'os' of undefined
Do you know what's wrong ? Does someone have a cordova - phonon - vue example starter project ?
Thanks

Hi @vitoo,
Thank you for opening this issue.
Which Phonon file are you including?
I updated the Vue example.
Please, reopen this issue if you need more help!


Change test files to MIT license only and use as template where necessary for license tests

Situation
We have currently some test files where we want to test license detection. But this can be confusing about the real license we use.
For example:
https://github.com/mercedes-benz/sechub/blob/eba09aab4ca8c3213d04f0bd70938cab10bf2ec7/sechub-pds-solutions/tern/tests/data/apache2.go
but we even have some test files with GPL - just for testing
Also some tests for license scanning produce only binaries which do not contain the spdx header any longer - so the test results are not as expected.
Wanted
Commercial license scanners could interpret our code as multi licensing etc.
Solution
We could change source code license tests in a way, where we have only the spdx license info at the first line, but we replace the header in a temporary file and do the scanning for the created temp file (so we can simulate different license types and use the file more or less as a template)

Possible solutions
Proposal A
Put the test files under different licenses in the code and in the repository. Use the LICENSES folder as suggested by REUSE project: https://reuse.software/spec/#license-files
Proposal B
Put the test files under MIT and insert the license information during a "generation" step into the files. Basically, make templates out of the files.
The licenses can either be kept as files or downloaded during the generation steps.
Same as proposed solution by @de-jcup
Proposal C
Use a different repository (private or company) and put the test files in.


Possible mistake in this page:

The sentence "Note that this example does not allow for multirow data modifications." is referring to the first code example on this page (it's the one-before-last sentence of the last paragraph before the code example). However, the code example itself seems to have no problem with multirow inserts - in fact, it should perform the same with one or many inserted rows.

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

ID: de204ead-2a80-46ec-6adc-3d8b13977602
Version Independent ID: eb4f715f-eba6-5d39-b2ba-5baae1b58c71
Content: Use the inserted and deleted Tables - SQL Server
Content Source: docs/relational-databases/triggers/use-the-inserted-and-deleted-tables.md
Product: sql
Technology: ****
GitHub Login: @rothja
Microsoft Alias: jroth

@Peled-Zohar -- Zohar, thank you for your feedback.  I am looking into this document.

@rothja -- Jason, please look into this issue #4204.

@Peled-Zohar Thank you. I'll look into this and get back to you.

@Peled-Zohar Thanks for your patience and for the feedback. I see your point in looking at the example. More correctly, I think this article doesn't focus on multi-row inserts, so I'll move that comment and keep the link for more information (instead of the confusing comment about the sample). Once I merge the changes, the git issue will close and the changes will appear live in a day or so. Thank you!


Request to fix installation issues

I have installed carla 0.9.13 several times before. But this time, a problem occurred during installation.
An error occurred while installing CARLA 0.9.13 on Windows 10.
The file with the error is carla\Util\InstallersWin\install-zib.bat.
Please fix it
D:\carla>make launch                                                                                -[Setup]: [Batch params]: --boost-toolset msvc-14.2 --all                                                               -[Setup]: Asynchronous jobs:  28                                                                                -[Setup]: Boost toolset:      msvc-14.2                                                                                -[Setup]: Install directory:  "D:\carla\Build"
-[Setup]: Creating "D:\carla\Build" folder...
-[Setup]: Installing zlib...
-[install_zlib]: [Batch params]: --build-dir "D:\carla\Build"
-[install_zlib]: Retrieving zlib.
"2"개의 인수가 있는 "DownloadFile"을(를) 호출하는 동안 예외가 발생했습니다. "원격 서버에서 (404) 찾을 수 없음 오류를 반
환했습니다."
위치 줄:1 문자:1

(New-Object System.Net.WebClient).DownloadFile('http://www.zlib.net/z ...

  + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
  + FullyQualifiedErrorId : WebException

  -[install_zlib]: Extracting zlib from "zlib-1.2.11.zip".

Expand-Archive : 'D:\carla\Build\zlib-1.2.11.zip' 경로가 없거나 유효한 파일 시스템 경로가 아닙니다.
위치 줄:1 문자:1

Expand-Archive 'D:\carla\Build\zlib-1.2.11.zip' -DestinationPath 'D:\ ...

  + CategoryInfo          : InvalidArgument: (D:\carla\Build\zlib-1.2.11.zip:String) [Expand-Archive], InvalidOperat
 ionException
  + FullyQualifiedErrorId : ArchiveCmdletPathNotFound,Expand-Archive

  -[install_zlib]: Removing "zlib-1.2.11.zip"

D:\carla\Build\zlib-1.2.11.zip을(를) 찾을 수 없습니다.
지정된 파일을 찾을 수 없습니다.
-[install_zlib]: Creating "D:\carla\Build\zlib-source\build"
CMake Error: The source directory "D:/carla/Build/zlib-source" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
-[install_zlib]: [CMAKE ERROR] An error ocurred while executing cmake command.
-[install_zlib]: [CMAKE ERROR] Possible causes:
-[install_zlib]:                - Make sure "CMake" is installed.
-[install_zlib]:                - Make sure it is available on your Windows "path".
-[install_zlib]:                - Make sure you have cmake 3.12.4 or higher installed.
-[install_zlib]: Exiting with error...

-[Setup]:
Ok, and error ocurred, don't panic!
We have different platforms where you can find some help :)

Make sure you have read the documentation:
http://carla.readthedocs.io/en/latest/how_to_build_on_windows/

If the problem persists, you can ask on our Github's "Building on Windows" issue:
https://github.com/carla-simulator/carla/issues/21

Or just use our Discord channel!
We'll be glad to help you there :)
https://discord.gg/42KJdRj
make: *** [setup] 오류 1

I had a same issue.
so I rewrited the file
ZLIB_VERSION=1.2.11
to
ZLIB_VERSION=1.2.12
it worked :)

@Niobium1 Solution worked. Thank you

@Niobium1 worked for me, thanks!


Re-export derives from serde

Fixes #797. @oli-obk I am still not settled on whether this should be on or off by default but I am leaning toward off.

On crates.io, of the 438 crates that depend on serde >=0.9, 17% of them do not depend on serde_derive.

anterofit, app_units, arccstr, blob, bodyparser, bson, chrono, cleverbot_io, core-graphics, cryogen_prelude, cssparser, elastic, elastic_types_derive_internals, envy, euclid, eval, gelf, generic-array, geojson, gluon_language-server, hopper, hyper_serde, ipc-channel, iron-json-response, jfs, json-color, json_io, jsonrpc-lite, jsonrpc-macros, juniper, kubewatch, linked-hash-map, mage, mdbook, meval, microsalt, mysql, ndarray, objectid, ocean, offscreen_gl_context, plist, preferences, record-query, reqwest, rmp-serde, rmpv, rocket_contrib, ruma-identifiers, ruma-signatures, rust_decimal, serde-bench, serde-encrypted-value, serde_ignored, serde_json, serde-pickle, serde-protobuf, serde_test, serde-transcode, serde_urlencoded, serde_utils, serde-value, serde-xml-rs, serde_yaml, sharp_pencil, sidekiq, sidekiq-rs, spaceralk, string_cache, tera, toml, treeflection, treeflection_derive, uhttp_json_api, url_serde, uuid

Some broad categories are:

Data formats (bson, serde_json, serde_yaml, toml)
Only handwritten impls (chrono, linked-hash-map, uuid)
Adapters (serde-encrypted-value, serde_ignored)
General serde helpers (serde_utils, serde-value)
Serde interop for specific libraries (bodyparser, hyper_serde, rocket_contrib, url_serde)
Serde traits in the public API (hopper, jsonrpc-macros, kubewatch, mage, preferences)
Standard library data structures only (cleverbot_io, geojson)

And lots more miscellaneous situations. I think this shows that depending on serde but not serde_derive is a fairly common and diverse use case.
For comparison, pretty much the same fraction of crates (19%) depend on serde >=0.9 but not serde_json so I don't think the number by itself justifies enabling the re-export by default. All three of serde and serde_derive and serde_json provide well-factored and distinguishable functionality so it is fair to expect users to depend on what they need.
I think this change is a last resort for the use case explained in the comment - preserving sanity around a serde cargo cfg. I do not intend to push this as the recommended way to import derives.


Permission denied: 'TEMP/tempStart.wav'

Traceback (most recent call last):
  File "jumpcutter.py", line 158, in <module>
    wavfile.write(sFile,SAMPLE_RATE,audioChunk)
  File "C:\Users\Patrick Mitchell\AppData\Local\Programs\Python\Python36-32\lib\site-packages\scipy\io\wavfile.py", line 328, in write
    fid = open(filename, 'wb')
PermissionError: [Errno 13] Permission denied: 'TEMP/tempStart.wav'

try ruining as root?

Running as root shouldn't be needed for such a tool

tried in an admin power shell, no luck

For me it only works when running as root.
This does require root


Click animations sometimes fire without firing click event

Occasionally, I'll click a button, tab, etc and see the animation fire, but the click event doesn't fire.
This causes an obviously broken feeling experience. Sometimes on a touch screen you might have to click things twice 'cause your finger didn't register or whatever, but when the animation plays, but the click event doesn't fire it's very obvious that your click was registered and it makes the app just look buggy.
What is the expected behavior?
Click event should fire when clicked and/or animation shouldn't play if the click event isn't fired.
What is the current behavior?
Sometimes click events don't fire when a button is clicked, but the material animation plays.
What are the steps to reproduce?
https://angular-material2-issue-trsdzx.stackblitz.io
Load on mobile and click the button repeatedly. Pay attention to the count while clicking. On my phone I always see the animation without the count going up within the first 30 clicks.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Latest version of angular / material (7.0.2).
Only seems to happen on mobile browsers. I've reproduced it on safari/ios and chrome/android.

The ripples indicate that you've put your pointer down on something, not that you've clicked it.

Accidentally found this issue, decided to give it a try.
At the very beginning I clicked around 20 times, everything was nice.
For some hell reason I decided to enable device toolbar(chrome feature), and some number of clicks were just not registered, maybe around 20.
After that when I toggled it back, some of first clicks were not registered also.
Mac, Chrome, x64.
Version 72.0.3626.121 (Official Build) (64-bit);
Version 73.0.3683.86 (Official Build) (64-bit);

P.S. I couldn't see the ripples.

@crisbeto there isn't much difference from a user perspective. If the user taps the button with their finger they see the ripples, but the click event isn't fired.

I understand that Ripple trigger by touchstart event.
But it sometimes separate from button click action, because browser recognize touchend and emit click.
The result is a situation where the ripple is activated but the button is not pressed.(especially on iOS?)
I think the ripple effect should be the same as the button clicked feedback.
I think that's exactly what users expect intuitively.
Material Design Guide also describe below:
Motion confirms keypad input and shows whether or not the action was successful.
https://material.io/design/motion/understanding-motion.html#usage

I think if it enables touch-action, how about.
Is there any trade-offs?
referrence: https://github.com/ionic-team/ionic/blob/2933f61e8da328facc7843a47551e9ca0fdd3b7b/core/src/css/normalize.scss#L137-L157

I think if it enables touch-action, how about.
Are there any trade-offs?
referrence: https://github.com/ionic-team/ionic/blob/2933f61e8da328facc7843a47551e9ca0fdd3b7b/core/src/css/normalize.scss#L137-L157

I am having this issue with my app. The users reports that sometime the buttons does not work... For them, my app look buggy


Pass kwargs to mixin from hash?

Hey guys,
First, thanks for the awesome maintenance you're doing on Stylus. I really appreciate it. :)
I'm wondering if it's currently possible to pass a set of keyword arguments through a mixin from a hash?
I took a run at creating a plugin to handle the process, but didn't really know what I was doing well enough I'm afraid.
What I'm trying to achieve is the ability to create hashes inside styles that define a series of mixins and their associated args to be output against the style. These hashes then get run through an "output-mixins" mixin.
It works beautifully if the mixin being called consumes rest params or if I just apply the values directly against a property, but I haven't been able to figure out how to pass kwargs from a hash, or from a predefined variable. I've also tried to use various BIFs to process the hash into usable kwargs, but didn't succeed. Each of my attempts have led to either the hash being output as a literal, or the comma separated list of key value pairs being processed as the first argument only.
This is where I'm at so far:
Stylus:
@import 'nib'

output-mixins(hash)
	for mixin, props in hash
		if props.pass
			// Can I do something here to convert the hash to passable arguments?
			{mixin}: props.pass
		else
			{mixin}: values(props)

// Example mixin with keyword args
width-height(height=auto, width=100%, min-height=auto, min-width=auto)
	height height
	width width
	min-height min-height
	min-width min-width

.normal_mixin_use
	width-height(height: 100px, width: 90%, min-height: 20px, min-width: 75rem)

.mixin_hash_kwargs
	mixin_hash_kwargs = {
		'width-height': {
			'pass': {
				height: 100px,
				width: 90%,
				min-height: 20px,
				min-width: 75rem
			}
		}
	}
	output-mixins mixin_hash_kwargs

.mixin_hash_rest
	mixin_hash_rest = {
		'border': {
			width: 20px,
			style: solid,
			color: black
		},
		'border-radius': {
			radius: 10px
		}
	}
	output-mixins mixin_hash_rest

Output:
.normal_mixin_use {
  height: 100px;
  width: 90%;
  min-height: 20px;
  min-width: 75rem;
}
.mixin_hash_kwargs {
  height: {"height":"(100px)","width":"(90%)","min-height":"(20px)","min-width":"(75rem)"};
  width: 100%;
  min-height: auto;
  min-width: auto;
}
.mixin_hash_rest {
  border: 20px solid #000;
  -webkit-border-radius: 10px;
  border-radius: 10px;
}

What do you think?
Is there a way to do this that I'm missing? Could I perhaps make it work via a custom js function / plugin? Or am I attempting something that can't really come off at this stage?
Thanks for any insight you can share!
Cheers,
Kezz

Totally agree about the syntax :-)
Is there any news about this feature ? That's only the missing part to my little component framework :-)

@kezzbracey if you are interested, I write a little plugin to do that : https://github.com/hikkyu/advanced-css-component-stylus/blob/master/plugin/callWithObjArg.js
// include plugin
use('./path/callWithObjArg.js')

hash = {
    foo: 'bar'
}

myMixin($foo: 'foo')
    body
        color $foo

callWithObjArg(myMixin, hash)

It's not perfect but work's :-)

That's awesome, thanks a lot for the effort and the sahre @hikkyu :-)


cask: remove newlines when auditing appcast checkpoint

[x] Have you followed the guidelines in our Contributing document?
[x] Have you checked to ensure there aren't other open Pull Requests for the same change?
[x] Have you added an explanation of what your changes do and why you'd like us to include them?
[ ] Have you written new tests for your changes? Here's an example.
[ ] Have you successfully run brew tests with your changes locally?

Companion to https://github.com/caskroom/homebrew-cask/pull/28966.
Tests fail but I need help fixing them. Unsure what to do.

@vitorgalvao Can you create this on your own fork?

@MikeMcQuaid Yes. Apologies. I thought that I had done so but going back on my commands I see the error (cloning mistake).


Failed to remove Tmp directory on Windows after export openvino model

openvino               2024.2.0
openvino-telemetry     2024.1.0
optimum                1.22.0.dev0
optimum-intel          1.18.0.dev0
Script
from optimum.intel import OVModelForCausalLM
from transformers import AutoTokenizer

MODEL_ID = "TinyLlama/TinyLlama-1.1B-Chat-v1.0"

model = OVModelForCausalLM.from_pretrained(MODEL_ID, export=True)
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)

Error log
(optimum-intel-sd-controlnet) PS C:\Users\openvino\chen\demo_optimum-intel-sd-controlnet> python .\test.py
Framework not specified. Using pt to export the model.
The model will be converted with no weights quantization. Quantization of the weights to int8 requires nncf.please install it with `pip install nncf`
Using framework PyTorch: 2.3.1+cpu
Overriding 1 configuration item(s)
        - use_cache -> True
C:\Users\openvino\chen\venv\optimum-intel-sd-controlnet\lib\site-packages\optimum\exporters\openvino\model_patcher.py:467: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
  if sequence_length != 1:
Compiling the model to CPU ...
Traceback (most recent call last):
  File "C:\Users\openvino\AppData\Local\Programs\Python\Python310\lib\shutil.py", line 618, in _rmtree_unsafe
    os.unlink(fullname)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\openvino\\AppData\\Local\\Temp\\tmpjab0hfix\\openvino_model.bin'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\openvino\AppData\Local\Programs\Python\Python310\lib\tempfile.py", line 843, in onerror
    _os.unlink(path)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\openvino\\AppData\\Local\\Temp\\tmpjab0hfix\\openvino_model.bin'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\openvino\AppData\Local\Programs\Python\Python310\lib\weakref.py", line 667, in _exitfunc
    f()
  File "C:\Users\openvino\AppData\Local\Programs\Python\Python310\lib\weakref.py", line 591, in __call__
    return info.func(*info.args, **(info.kwargs or {}))
  File "C:\Users\openvino\AppData\Local\Programs\Python\Python310\lib\tempfile.py", line 859, in _cleanup
    cls._rmtree(name, ignore_errors=ignore_errors)
  File "C:\Users\openvino\AppData\Local\Programs\Python\Python310\lib\tempfile.py", line 855, in _rmtree
    _shutil.rmtree(name, onerror=onerror)
  File "C:\Users\openvino\AppData\Local\Programs\Python\Python310\lib\shutil.py", line 750, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "C:\Users\openvino\AppData\Local\Programs\Python\Python310\lib\shutil.py", line 620, in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())
  File "C:\Users\openvino\AppData\Local\Programs\Python\Python310\lib\tempfile.py", line 846, in onerror
    cls._rmtree(path, ignore_errors=ignore_errors)
  File "C:\Users\openvino\AppData\Local\Programs\Python\Python310\lib\tempfile.py", line 855, in _rmtree
    _shutil.rmtree(name, onerror=onerror)
  File "C:\Users\openvino\AppData\Local\Programs\Python\Python310\lib\shutil.py", line 750, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "C:\Users\openvino\AppData\Local\Programs\Python\Python310\lib\shutil.py", line 601, in _rmtree_unsafe
    onerror(os.scandir, path, sys.exc_info())
  File "C:\Users\openvino\AppData\Local\Programs\Python\Python310\lib\shutil.py", line 598, in _rmtree_unsafe
    with os.scandir(path) as scandir_it:
NotADirectoryError: [WinError 267] The directory name is invalid: 'C:\\Users\\openvino\\AppData\\Local\\Temp\\tmpjab0hfix\\openvino_model.bin'

@helena-intel, I see that you try to fix similar issue: https://github.com/huggingface/optimum-intel/pull/749.
But it seems not work for latest master, Could you please kindly check this issue with reproducer abvoe?

@TianmengChen please verify potential fix after merge: https://github.com/huggingface/optimum-intel/pull/925


The list of pages are not loading in Grav Admin due to flex objects plugin

Hi , I ran on the similar topic : pages are not accessible due to the flex -objects plugin. As well I can't upgrade email and login plugins.

I have the issue on the local site for development purposes and on the production site (for testing purposes).
Any help welcome.
Is there a fix to this issue ?

And here is the screenshot of the error preventing the upgrading of the plugin :

I can't replicate this... I would try the following:

test with a base grav+admin install (nothing else), makes ure that works
try unpublishing your installed plugins one-by-one to see if you can isolate the culprit (most likely a 3rd party plugin).

Try these first and we'll go from there.  Thanks.

Thanks for the reply. I will try this and let you know how it goes

Managed to partially sove the issue : deactivated the flex-objects plugin on pages and re-installed login plugin that wouldn't update


Windows Hello facial recognition doesn't work on Windows 10 1803 in S mode with Intel SR300.

I have Windows 10 1803 in S mode. Windows Hello facial recognition cannot be enabled with my Intel SR300. There is no Virtual Driver installed. Since it's S mode, the Intel SR300 DCM driver cannot be installed either.

[Realsense Customer Engineering Team Comment]
Hi @zxli
the DCM 3.3 is not app at windows store
to install it you will need to switch off the S mode
https://support.microsoft.com/en-us/help/4023898/windows-10-switching-out-of-s-mode


how to run the optmization for a fixed number of epochs ?

from the documentation there seem to be no way to fix the number of optimization iterations (the documentation only describes stopping conditions based on the results, not on the number of iterations).

Yes, downhill uses early stopping to determine when to halt training.
If you really want to run for a fixed number of iterations N, use these parameter settings:
patience=0
min_improvement=0.9999
validate_every=N

This will run one validation after N updates, which will fail (unless somehow the validation error is actually 99.99% better than the initial state), and then training will halt because the patience will be exhausted.

so min_improvement should be float("inf") to be really sure it will stop...

Yes, actually, any value >= 1 will work, too. The relevant line (https://github.com/lmjohns3/downhill/blob/master/downhill/base.py#L265) is:
    if self._best_loss - loss > self._best_loss * self.min_improvement:

So the comparison is between the previous best and the current validation loss; this quantity is limited to the range [-inf, self._best_loss] as long as the loss is nonnegative, so anything 1 or greater for min_improvement should do the trick.

But I notice that using this strategy the params are not set self._best_params at the end.
Using this from dowhill.minimize then gives no access to the optimization result !

Hm, yes, I see how this is a problem.
It might be easiest if I just add a max_updates parameter. To use it, make sure patience is set to a large enough value to guarantee that max_updates iterations will take place during optimization. The rest of the validation infrastructure will keep working as it currently does.


Currently scss/base-buttons isn't able to stand alone

The $bold-font-weight variable isn't declared at the top of the file with the other variables.
I'm currently digging into the missing variable on my fork: https://github.com/johnotander/basscss/compare/update-sass. Though, it looks like it might be an issue with css-scss

Yeah, I'm trying to figure out a good way to handle variable dependencies, but for now, the defaults file should have everything covered https://github.com/jxnblk/basscss/blob/master/scss/_defaults.scss

Yeah, it's definitely in the defaults file. So, I started pulling that file in as well. I'll close this issue now since it seems to be related to css-scss, so I will work on submitting a fix when I get a chance.
Thanks.


Add Cloud Providers in lang ID

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This PR addresses #13929
/language id

I was using wrong email in git commit. I've updated email.

/check-cla

Looks like every commit need to have same account, not only for the latest commit. I think I'll recreate fork and recommit with new fork.


Translate 'ALARM 66' for PIR

It is probably 'low battery warning'.

I think the best solution would be to translate ALARM code 66 to "Low Battery" in the mqtt interface code.
Energenie also have stated that the Contact Sensor also sends a low battery warning, but their app/Hub never reports it!  I'm going to assume ALARM 66 is what they use for this too.

Released in v0.4.0