Fixtures are not passed to the test function when using test.each()

Describe the bug
In the same vein as #4585, fixtures are unavailable when using test.each().
Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-el13eq?file=test%2Fbasic.test.ts
System Info
System:
    OS: macOS 14.1.2
    CPU: (12) arm64 Apple M2 Max
    Memory: 29.42 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.16.1 - ~/.nvm/versions/node/v18.16.1/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v18.16.1/bin/yarn
    npm: 9.5.1 - ~/.nvm/versions/node/v18.16.1/bin/npm
    pnpm: 7.29.1 - ~/.nvm/versions/node/v18.16.1/bin/pnpm
    bun: 1.0.14 - ~/.bun/bin/bun
  Browsers:
    Chrome: 119.0.6045.199
    Edge: 119.0.2151.97
    Safari: 17.1.2
  npmPackages:
    vitest: 1.0.0-beta.6 => 1.0.0-beta.6

Used Package Manager
npm
Validations

[X] Follow our Code of Conduct
[X] Read the Contributing Guidelines.
[X] Read the docs.
[X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
[X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
[X] The provided reproduction is a minimal reproducible example of the bug.

Yes, I expect each case to behave like a regular test.
Is there a particular reason it should not be able to access it ?

How would you access it? Give me code example. In a regular test function the argument is the context, but in test.each the argument is whatever it is you passed down to each function.

It's on the stackblitz : just add a second argument.
const cases = [
  ['config0', 'expected0'],
  ['config1', 'expected1'],
];

myTest.each(cases)(
  'fixtures should be available as part of the second argument',
  ([config, expected], { myFixture }) => {
    expect(myFixture.doSomething(config)).toEqual(expected);
});

It's on the stackblitz : just add a second argument.

This is not how it works. You control the second argument - with your example expected is the second argument

1.0.0 is still in beta right ? The API can still be changed. We agree this is a design flaw, right ?

1.0.0 is still in beta right ? The API can still be changed. We agree this is a design flaw, right ?

What is a design flaw? Can you just give an example of what you expect without breaking changes? We definitely will not make it so the first argument in .each is an array item. This breaks compatibility with Jest and existing Vitest code without any gain.

The design flaw is that one cannot use test.each like any other test.

This is not a flaw, this is literally a design of this method - it's intentionally different. If you don't like it, you can always use forEach or for of and call a test function inside.
Your proposed solution does not benefit existing users. But what we can do is add a context as the last argument instead of the second, so it doesn't break existing code and makes sense with the proposal.

If you add the context as the last parameter it’s a breaking change because one could use a rest argument or simply iterate through the array.
Yes indeed, I could simply use a loop.
Do you know why ˋeach` was designed to be different ? For what purpose/benefit.

If you change the value of the argument receive, it is a breaking change because it will break existing code.
A new feature cannot break existing code.
it was before the fixtures, ok.
In the cases expressed as objects, and therefore passed down as an object, we could inject fixtures in that object as non-enumerable properties. This way, it won’t break existing code.
We could actually do that for the array too now I think about it. It is dark magic though.

I guess it could work if you add an optional options parameter:
const cases = [
  ['config0', 'expected0'],
  ['config1', 'expected1'],
];

myTest.each(cases, { withFixtures: true })(
  'fixtures should be available as part of the second argument',
  ({ myFixture }, config, expected) => {
    expect(myFixture.doSomething(config)).toEqual(expected);
});

If the fixtures are the past parameter, then you cannot use a rest parameter for the values of the case.

#4963 was closed as a dupe of this one, as it also comes from the fact that the test context is not passed down into each (but one can write test.concurrent.each and it "work").
My suggestion there was that when .concurrent was used in the chain, that the each callback instead take an object like TestContext & { args: T } (where T are the args), however, I don't think this works for the fixture case as there's no static indicator that it needs the context (versus the chain could theoretically use some TS type trickery to make it happen).
Maybe the above can be done with that second parameter, like:
test.concurrent.each([
	// ...
])('someName %o', { args, expect } => {
	// ...
}, { withContext: true });

Additionally, can these cases be turned into runtime errors today? E.g. if concurrent, throw with a better error? Or if fixures in use, error? It's not clear that one can write a useful test today with .each, no?
(Also, if this is the place to collect "I need the context in test.each", should the title make that clear?)

My thinking is that a test without expect is probably not a useful test, and you can't access expect for .concurrent without the context, so that situation is neccesarily not going to work correctly (and in my case, just causes spurious failures due to expect being called "outside" of a test).

My thinking is that a test without expect is probably not a useful test, and you can't access expect for .concurrent without the context, so that situation is neccesarily not going to work correctly (and in my case, just causes spurious failures due to expect being called "outside" of a test).

You can (and should) use global expect in concurrent tests as a rule. The only exception is toMatchSnapshot because the name of the snapshot relies on the current test name.
We already throw an error for toMatchInlineSnapshot - we can throw toMatchSnapshot if it's called inside .each without using the local expect, but I don't see any reason to throw an error for .concurrent.each.

Thanks, I didn't realize that it was only snapshots and not the entire thing.

@sheremet-va

You can (and should) use global expect in concurrent tests as a rule.

Slightly off topic but you poked my curiosity. Is there any downside at using a local expect instead of the global one ?

You can (and should) use global expect in concurrent tests as a rule. The only exception is toMatchSnapshot because the name of the snapshot relies on the current test name.

I think currently there are few more expect API which is not concurrent safe. Internally, it comes down to either expect.setState or utils.flag(this, 'vitest-test').
For example, vitest-test state is relevant for toMatchSnapshot (e.g. vitest-test can become empty in concurrent tests and it could lead to puzzling Snapshot cannot be used outside of test message). I haven't tested but I can see vitest-test is also used for expect.soft, expect(...).resolves, expect(...).rejects API, so I suppose these are likely to cause some bad behavior as well.
expect.setState is used to implement expect.assertions and expect.hasAssertions, so they are not meant to be used inside concurrent, which is already mentioned in the doc https://vitest.dev/api/expect.html#expect-assertions

Though it's ugly (both API and also test logs), I think wrapping with describe.each would provide a proper local context for inner test.
https://stackblitz.com/edit/vitest-dev-vitest-mnmqgv?file=test%2Frepro.test.ts
import { test, describe } from 'vitest';

describe.concurrent.each([
  ['hello'],
  ['hi'],
  ['hey']
])(
  'wrapper-suite %s',
  (...params) => {
    test('just-case', ({ expect }) => {
      console.log({ params });
      expect(params[0]).toBeTypeOf('string');
      expect(params).toMatchSnapshot();
    });
  }
);

I think currently there are few more expect API which is not concurrent safe. Internally, it comes down to the usage of either expect.setState or utils.flag(this, 'vitest-test').

I guess you are right. Over time the usage of this increased.
Generally speaking, assertions are just functions that throw an error - you don’t really need to create a separate context (which is a bit expensive to do for every test) just to check if one value is equal to another.

Thanks for all the suggestions! I made some prototype on my PR https://github.com/vitest-dev/vitest/pull/4989 for potential test.each APIs. I wrote Pros/Cons of each approach in terms of API and also implementation. If anyone is interested, I would appreciate feedback.

@hi-ogawa thanks for pulling this out. I'm not sure what I like more API-wise, but Jest compatibility will continue to be important for the next 3-5 years I would say, so I would rule out my own proposition of having it as the first argument.
Is it possible to consider other options ? Each solution have a downside...
// No arrow function
test.each(cases)('many cases', function (...caseArgs) => {
  const { myFixture } = this.getFixtures(); // Or maybe vi.getFixtures() ? But then it doesn't work in concurrent mode :/
});

// No array case
test.each(cases)('fixtures are available though a non-enumerable symbol', function (caseObj) => {
  const { myFixture } = vi.getFixtures(caseObj);
});

If the goal is specifically jest compat, then from reading the API examples in the PR, only each5 with a required context: true options param seems to be possible without potentially breaking someone, no?

each2 allows the test function to return another test function which is the actual test. This might be okay, if nobody ever wrote a test which previously returned something?
each3 just passes in an object { expect, args } as the first param, but this seems directly backwards incpmpatible.
each4 adds the arg as the final arg after all other args from the cases list. Maybe this works but if someone had previously written (...args) => { ... } as their test, now the context will appear there.
each5 requires passing { context: true } after the cases, giving you the context after the args. This seems the most compatible, and is not dissimilar to APIs like Node's fs.readFileSync where an encoding option can cause the overload to change.
each6 is the same as each5 but with the context first. This seems like the best option because one can write ({ expect }, ...args) => {} while with each5, you cannot. (This probably also makes it simpler to write types for.)

Hey, thanks for the quick feedback. Yeah, from the candidate so far, it's very tricky to think about API for jest compatibility while test context/fixture is vitest-only features. Also template string usage test.each`${"arg1"} | ${"arg2"}` is yet another problem, which I don't see the solution right now.
I just wanted to share what I saw while prototyping it, but I'll still keep looking as we might be still missing some ideas.

@JesusTheHun Thanks for the idea. About "No arrow function" API approach const { myFixture } = this.getFixtures(), I think this might be actually fine in terms of supporting "concurrent" use case since we can use testFn.bind to separate context just before test function execution. But the problem is that it might be difficult to do "fixture extraction", which currently relies on manual string parsing of testFn.toString() to look for exact string like ({ myFixture }) => { ... }.

@hi-ogawa so you parse the file to detect fixture usage 🧐
I thought you were using a Proxy to track usage/destructuring.
The only difference would be that the fixture would be created on its first use, instead of before the test, so some timeout gym would be required!

so you parse the file to detect fixture usage 🧐

Not the file, only the function body. This is how it works in Playwright as far as I know. A proxy would trigger too late (when the test starts), we need to prepare all fixtures before the test has started.

we need to prepare all fixtures before the test has started
Can you elaborate on why it must be done before the test starts ?

@hi-ogawa we can require strict rules on how to use it, like import.meta.* constants replacement. This will simplify things a lot !

I thought you were using a Proxy to track usage/destructuring.

I'm not sure but technically proxy approach might be possible to employ in some way, but API would be probably affected by this. For example, const { myFixture } = this.getFixtures() would not be possible because myFixture evaluation is expected to be async. Even if we require await this.getFixtures(),  I don't think fixture evaluation can be implemented with such destructuring, so it would require await this.getFixtures().myFixture, but then API might not be appealing anymore at this point.

I came back to this feature and it looks like I missed the one more suggestion by @jakebailey https://github.com/vitest-dev/vitest/issues/4642#issuecomment-1894155135 about where to put context: boolean flag.
It looks like this one supports template literal usages and typescript inference still works alright. I added it to test.each7 in the draft PR https://github.com/vitest-dev/vitest/pull/4989
myTest.concurrent.each7`
  a          | b
  ${'hello'} | ${2}
  ${'hi'}    | ${3}
`(
  'myTest.each7-context-template-true $a $b',
  async (arg, { expect, myFixture }) => {
   // arg = { a: "hello", b: 2 }
   // arg = { a: "hi", b: 3 }
    expect({ arg, myFixture }).toMatchSnapshot()
  },
  { context: true },
)

While adding more tests, I found a tricky case where args varies length. This is probably not possible to support, but I guess it's okay since context: true will be opt-in.
https://stackblitz.com/edit/vitest-dev-vitest-vnzqwz?file=test%2Frepro.test.ts
import { expect, test } from 'vitest';

test.each([
  [0, 1],
  [2, 3, 4],
])('each %s %s', (...args) => {
  // args = [0, 1]
  // args = [2, 3, 4]
  expect(args).toMatchSnapshot();
});

I came back to this feature and it looks like I missed the one more suggestion by @jakebailey #4642 (comment) about where to put context: boolean flag.

We are deprecating the option in the last argument of test function in #5142, so it would look more like this:
myTest.concurrent.each7`
  a          | b
  ${'hello'} | ${2}
  ${'hi'}    | ${3}
`(
  'myTest.each7-context-template-true $a $b',
  { context: true },
  async (arg, { expect, myFixture }) => {
   // arg = { a: "hello", b: 2 }
   // arg = { a: "hi", b: 3 }
    expect({ arg, myFixture }).toMatchSnapshot()
  },
)

What about having a separate API for this feature? Like test.for(/* array */):
test.concurrent.for([
  [1, 2, 3]
])('example', (first, second, third, context) => {
  context.task.name // example
})

If we can introduce a new API (and thus no need to worry about Jest compat or breaking change), then maybe we should consider supporting this exotic (but currently valid) usages:
// it's still not possible to type-inference nor extract fixture at the last argument
myTest.for([
  [0, 1],
  [2, 3, 4],
])('each %s %s', (...args) => {
  // args = [0, 1, { expect, someFixture }]
  // args = [2, 3, 4, { expect, someFixture }]
});

There are already some suggestions to support this:
https://github.com/vitest-dev/vitest/issues/4642#issuecomment-1837525748
// regardless of each case is array or not, put each case as fixed first argument

myTest.for([
  [0, 1],
  [2, 3, 4],
])('each %s %s', (arg, { expect, someFixture }) => {
  // arg = [0, 1]
  // arg = [2, 3, 4]
});

myTest.for([
  { x: 0 }
  { x: 1 },
])('each %s %s', (arg, { expect, someFixture }) => {
  // arg = { x: 0 }
  // arg = { x: 1 }
});

// still easy to destruct array case
myTest.for([
  [0, 1],
  [2, 3],
])('each %s %s', ([a, b], { expect, someFixture }) => {
  // [a, b] = [0, 1]
  // [a, b] = [2, 3]
});

https://github.com/vitest-dev/vitest/issues/4642#issuecomment-1894155135
// provide each case as a part of context
// not sure if it should be named `arg`, `args`, or something else...

myTest.for([
  [0, 1],
  [2, 3, 4],
])('each %s %s', ({ arg, expect, someFixture }) => {
  // arg = [0, 1]
  // arg = [2, 3, 4]
});

myTest.for([
  { x: 0 }
  { x: 1 },
])('each %s %s', ({ arg, expect, someFixture }) => {
  // arg = { x: 0 }
  // arg = { x: 1 }
});

Personally, the first suggestion looks okay to me. In terms of implementation, I think both typescript overload and fixture extraction becomes simpler with this "fixed first argument" API.

I found that the context is provided if a name is not supplied eg:
myTest.each([
  [0, 1],
  [2, 3, 4],
])((arg, { someFixture }) => {
  // arg = [0, 1]
  // arg = [2, 3, 4]
})

Is not ideal as the results list the tests as <anonymous>, but it does at least expose the context (and fixtures).
I'm not familiar with Jest so this might be expected.

Is not ideal as the results list the tests as <anonymous>, but it does at least expose the context (and fixtures).
I'm not familiar with Jest so this might be expected.
When I try this it appears that the tests never actually run. So while there is no error about the wrapper not existing it will pass whatever expect you put in the body of the test.

it.each([
    ...stuff
  ])((stuff, { wrapper }) => {
    expect(true).toBe(false)
  })

shows all of the tests passing. If you try to console.log anything in the specs it never gets called.

I was able to resolve the above (test.each not running at all) by upgrading:

"@vitejs/plugin-react": "4.0.0",

"@vitejs/plugin-react": "4.2.1",

"vitest": "0.31.3"

"vitest": "1.6.0"

There are already some suggestions to support this:

I like this second approach.


Put dependencies from jquery

Hi, im getting errors of dependencies like:
.knob is not a function
.throttle is not a function

@segux I'll add knob and throttle into dependencies

@segux dependencies are fixed


host infos with nvidia gpu infos

Is it possible to add gpu informations to get_host_info?
I am interested in the number of gpus, the gpu names and the total memory size.
An example to get the information under Linux can be found under:
https://github.com/boeddeker/ipynb_nvidia_stats/blob/master/Nvidia-smi.ipynb
The Idea to get the information is to execute "nvidia-smi" with subprosess and parse the output with xmltodict (or BeautifulSoup).
The alternate pynvml from nvidia is not working with Python3
I could also create a pull request.

Great idea! I've also thought about incorporating GPU information, but didn't get around to actually do it.
Some thoughts:

Its a shame that pynvml is not Python 3 compatible. Especially since it would be very easy to fix. I'm trying to contact NVIDIA. Maybe they'll accept a fix from me.
I'd like to keep the dependencies for sacred lightweight. So if we go with your suggestions I think I'd prefer xmltodict.
Maybe this would also be a good time to make the whole process of collecting host-info more modular and customizable. I'll try to come up with a good way to accomplish that.

To 1: I think NVIDIA has no interest to support pynvml, because in the documentation you can read that it's programmed for python 2.5. Maybe when you contact NVIDIA you can ask them to publish the code on github.

I share your scepticism about the package. It doesn't seem well-maintained in general.
The documentation says it is for Python 2.5+, but actually, I found some statements that need at least Python 2.6 (e.g. except OSError as ose:) :neutral_face:  So in the end it might be better to go with your solution.
Anyways, I've posted to their forum and sent a PM to one of their staff. Let's see.

Hey,
so I've refactored the host info gathering process to allow for easy addition of custom information in the release/0.7 branch. With that you should be able to do this in any experiment code:
from sacred import host_info

@host_info
def gpu():
    return "some information about GPUs"

Sacred would then call that gpu function when collecting the host_info. That should make it very easy to collect custom information.
But I think the GPU thing is a very common usecase so I'd very much like to add that to the library directly. So the next step would be to take your function and add it as an optional entry, such that it is only called when the required dependencies are installed.

Hey,
thanks, with this my problem is solved.
Maybe it is better to do this in the way like the config is generated. Because using global variables results sometimes in strange behavior.
Here an example code how I imagine an interface:
ex = Experiment('Experiment')

@ex.host_info
def host_info_func():
     gpu = dict(...)

def host_info_func2():
     network = dict(...)

ex.host_info(host_info_func2)

Hmm. I'll think about it. It seems unlikely to cause problems, but you are right: better be on the safe side.

This feature is part of the current beta release 0.7b1.  If calling nvidia-smi is successful there is also an automatic gpu entry in the host_info inspired by your code. So thanks again for your input! Unfortunately this slows down the experiment creation process by about 0.2 sec but I think that is ok.
If not, it can be deactivated using the new sacred.SETTINGS dict.
I've decided to keep host_info_getters global.   There are other problems when trying to run several Sacred experiments in the same file, and I couldn't think of a good usecase for that. So I didn't see the advantage.


Inpainting/outpainting image and mask selection

Thank you for the greqt work by the way. I'm hoping you can help with a issue i've been having. Once i generate an image with the mask using inpainting : i'm having a really hard time to select another part of the image for inpainting. Like the button in the controlnet tab in which you can click in the button setcontrolnet image, the button to set the image in inpainting/outpainting does not work. It keeps selecting the first area i used for the first inpainting session. I have to restart photoshop every time. Maybe i'm missing some command to set the image after i selected it with the rectangular tool ?
Thank you very much !

i mean those buttons.

It quite easy to inpaint on another area, you should click on one of these buttons  to close the active session.
then paint white on the newly created Mask -- Paint White to Mask -- temporary layer, then click generate.
you could also edit the mask without closing the session.

Click on the mask preview in the viewer tab, this will reveal the mask layer on the canvas
Modify the white mark by adding or removing from it
Click on the pen button from the mask preview to update the mask
Click generate more button

Thank you for your response, This is what happens, once i try to inpaint after the first time, i did what you said but the image selection becomes white

The behavior that you have mentioned does not seem to be a typical behavior. It also strikes me as odd that none of the generation mode radio buttons is highlighted, which I believe is indicative of an error resulting from the plugin.

Can you check Automatic1111 console for any error messages?
I'll be adding a way soon to view the log messages that the plugin creates. Alternatively, if you're a Programmer, you could view the log output by following the installation instructions for method 3 and then load the plugin using UXP in 'debug' mode. It will open an interactive debugging console like the one you get when you press "F12" in a browser.

uploaded automatic 1111 cmd window logs

sorry they were not in order, i forgot to check that

It seems that initial image doesn't get captured by the plugin, hence why the white image is shown in the preview.
This could be related to a js library called JIMP.
One thing you could try is to change the image processing method in the settings tab. Use the "Slow PC" option which only uses photoshop for image processing.
Let me know if this fixes the issue.

I was having similar issues - usually it would work first time , then any follow up inpainting would result in white background - looking closer it'd set the image i was trying to inpaint as the mask, and the image itself as white.
Changing to Slow PC seems to have fixed this for me.


failed to use annotation

I am using docker on remote mode.
I used
python3 -m pip install --upgrade pip setuptools
python3 setup.py develop

to install environment.
When I am in v2.6 branch, I used  nnictl --version , it shows  999.dev0.
Then I ran mnist-annotation example, the following error message displayed:
root@c30d89d3f9c9:/app/nni/nni-2.6# nnictl create --config examples/trials/mnist-annotation/config.yml -p 8880
Traceback (most recent call last):
  File "/app/nni/nni-2.6/nni/tools/annotation/__init__.py", line 112, in _expand_file_annotations
    annotated_code = code_generator.parse(src.read(), nas_mode)
  File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 707: ordinal not in range(128)

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/bin/nnictl", line 8, in <module>
    sys.exit(parse_args())
  File "/app/nni/nni-2.6/nni/tools/nnictl/nnictl.py", line 286, in parse_args
    args.func(args)
  File "/app/nni/nni-2.6/nni/tools/nnictl/launcher.py", line 83, in create_experiment
    code_dir = expand_annotations(config.trial_code_directory, path)
  File "/app/nni/nni-2.6/nni/tools/annotation/__init__.py", line 97, in expand_annotations
    annotated |= _expand_file_annotations(src_path, dst_path, nas_mode)
  File "/app/nni/nni-2.6/nni/tools/annotation/__init__.py", line 121, in _expand_file_annotations
    raise RuntimeError(src_path + ' ' + '\n'.join(str(arg) for arg in exc.args))
RuntimeError: ./test/ut/sdk/test_protocol.py ascii
b"# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT license.\n\nfrom nni.runtime import protocol\nfrom nni.runtime.protocol import CommandType, send, receive\n\nfrom io import BytesIO\nfrom unittest import TestCase, main\n\n\ndef _prepare_send():\n    protocol._out_file = BytesIO()\n    return protocol._out_file\n\ndef _prepare_receive(data):\n    protocol._in_file = BytesIO(data)\n\n\nclass ProtocolTestCase(TestCase):\n    def test_send_en(self):\n        out_file = _prepare_send()\n        send(CommandType.NewTrialJob, 'CONTENT')\n        self.assertEqual(out_file.getvalue(), b'TR00000000000007CONTENT')\n\n    def test_send_zh(self):\n        out_file = _prepare_send()\n        send(CommandType.NewTrialJob, '\xe4\xbd\xa0\xe5\xa5\xbd')\n        self.assertEqual(out_file.getvalue(), 'TR00000000000006\xe4\xbd\xa0\xe5\xa5\xbd'.encode('utf8'))\n\n    def test_receive_en(self):\n        _prepare_receive(b'IN00000000000005hello')\n        command, data = receive()\n        self.assertIs(command, CommandType.Initialize)\n        self.assertEqual(data, 'hello')\n\n    def test_receive_zh(self):\n        _prepare_receive('IN00000000000006\xe4\xb8\x96\xe7\x95\x8c'.encode('utf8'))\n        command, data = receive()\n        self.assertIs(command, CommandType.Initialize)\n        self.assertEqual(data, '\xe4\xb8\x96\xe7\x95\x8c')\n\n\nif __name__ == '__main__':\n    main()\n"
707
708
ordinal not in range(128)

WhenI switched to v2.5 and ran mnist-annotation, the following error displayed:
'Module' object has no attribute 'last_line'

Is this a bug or is the way I installed it not correct? Did anyone meet the same issue?
Moreover, I have a tiny question about Assessor-curve-fitting. The epoch_num parameter is the epoch number of total training, correct? Since larger epoch_num than training epoch still works.

@bl6g6 thanks for reporting this issue. do you encounter the same error when using local mode with v2.6? or the error only occurs in remote mode?
For your second question about assessor, epoch_num means the total epoch number, the curve-fitting assessor will predict trial's performance on this epoch. It is not supposed to set a number larger than total epoch number (though this assessor still works, it will predict the performance on your specified epoch number by assuming the trial will run such many of epochs).

I was using local mode with V2.5 nni on my local machine(ubuntu18). The error was
'Module' object has no attribute 'last_line'

I cannot updated to v2.6 since when I ran
python3 -m pip install --upgrade pip setuptools
python3 setup.py develop

it shows
running develop
error: [Errno 17] File exists: 'nni_node'

And thanks for your answer about assessor!

I updated to v2.6 and find that it was the problem of loading mnist data(TensorFlow version too high that cannot download mnist data). Both local and remote could use annotation perfectly. Thank you!

I updated to v2.6 and found that it was the problem of loading mnist data(TensorFlow version was so high that cannot download mnist data). Now both local and remote could use annotation perfectly. Thank you!


test_inline_asm failing on linux-32

This is affecting active PRs but only recently (?).
main branch currently broken for test test_inline_asm (numba.tests.test_nrt.TestRefCtPruning) on linux-32.

    Also makes more things vectorize. As title.

    Fixes #6451

:040000 040000 4e4399be05114264ed5e6aa8afa45417347df2d2 8a803e783591d8df25085b30b5c0720434e1bf56 M	numba

Fixed by https://github.com/numba/numba/pull/6591


Initiate a vagrant project with devstack and chef recipes for masakari

Let's add a vagrant project to make an evaluation and a demonstration easy, specially for new members.

I added an experimental support for rhel/centos. It doesn't include masakari installation.

This vagrant file looks great!!  This makes a new member easy to deploy and test it :)
IMO, these kind file shouldn't be under Masakari repository since this is one of tools for Masakari.  For example, ntt-sic/masakari-deploy or ntt-sic/masakari-tool look better.

I committed the codes above at [masakari-deploy repository.] (https://github.com/ntt-sic/masakari-deploy)


Support for Docker checks with Consul

Adds support for Docker checks as described in Consul docs. This runs the check command inside the container.
I've tested this with Consul 0.6 (note that consul interprets the check command's exit code 0 as success, 1 as warning, 2 as critical):
host$ docker run -it --rm -e SERVICE_NAME=test1 -e SERVICE_CHECK_DOCKER_SCRIPT="test -f /tmp/x || exit 2" -e SERVICE_CHECK_DOCKER_SHELL=/bin/sh -p 10011:1234 alpine sh

host$ consul-cli health-service test1
...
      {
        "Node": "ip-10-234-180-74.ec2.internal",
        "CheckID": "service:ip-10-234-180-74.ec2.internal:grave_noyce:1234",
        "Name": "Service 'test1' check",
        "Status": "critical",
        "Notes": "",
        "Output": "",
        "ServiceID": "ip-10-234-180-74.ec2.internal:grave_noyce:1234",
        "ServiceName": "test1"
      }
...

container# touch /tmp/x

host$ consul-cli health-service test1
...
  {
        "Node": "ip-10-234-180-74.ec2.internal",
        "CheckID": "service:ip-10-234-180-74.ec2.internal:grave_noyce:1234",
        "Name": "Service 'test1' check",
        "Status": "passing",
        "Notes": "",
        "Output": "",
        "ServiceID": "ip-10-234-180-74.ec2.internal:grave_noyce:1234",
        "ServiceName": "test1"
      }
...

host$ dig test1.service.consul SRV
...
;; ANSWER SECTION:
test1.service.consul.	0	IN	SRV	1 1 10011 ip-10-234-180-74.ec2.internal.node.us-east-1.consul.
...
container# rm /tmp/x

host$ dig test1.service.consul SRV
# nothing

host$ consul-cli health-service test1
...
      {
        "Node": "ip-10-234-180-74.ec2.internal",
        "CheckID": "service:ip-10-234-180-74.ec2.internal:grave_noyce:1234",
        "Name": "Service 'test1' check",
        "Status": "critical",
        "Notes": "",
        "Output": "",
        "ServiceID": "ip-10-234-180-74.ec2.internal:grave_noyce:1234",
        "ServiceName": "test1"
      }
...

Just realized that https://github.com/gliderlabs/registrator/pull/332 does the same thing. Closing as redundant.


Fix 404 footer width by dropping overridden container

Not sure why it was needed just for 404s?
Fixes #378

There are position utility classes for everything but sticky bottom. There is an example though.

@zoidbergwill Thank you very much for the contribution.
I'll leave this one on Ellen, as it's her field. :)
/cc @ellenkorbes

LGTM

@zoidbergwill All good, thanks. Did whatever they use for the sticky footer there not work for us? It'd be great if we could close that as well.

Will take a look at the sticky footer stuff and make another PR if it works
On 25 October 2017 at 14:19, Marko Mudrinić<EMAIL_ADDRESS>wrote:

Merged #466 https://github.com/kris-nova/kubicorn/pull/466.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/kris-nova/kubicorn/pull/466#event-1309737557, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ACdAzRrQvRu7dO4P4YAUdGrfCIG8CdkSks5svydPgaJpZM4QEvT0
.


add 2023 Hero to homepage

@aniketgargya
Figma

Preview

Are you planning on adding this from the Figma?

@aniketgargya
Figma
Preview
Are you planning on adding this from the Figma?

Yup, added it now.

Are you planning on adding the tiny star/bubble icons as well?

New deployment
Figma
Are you planning on adding the tiny star/bubble icons as well?

I was going to add this along with the next section, because this overlaps both the Hero and Event section.

Sounds good


what does samples.mask do?

`    def forward(self, samples: NestedTensor):
""" The forward expects a NestedTensor, which consists of:
- samples.tensor: batched images, of shape [batch_size x 3 x H x W]
- samples.mask: a binary mask of shape [batch_size x H x W], containing 1 on padded pixels
        It returns a dict with the following elements:
           - "pred_logits": the classification logits (including no-object) for all queries.
                            Shape= [batch_size x num_queries x (num_classes + 1)]
           - "pred_boxes": The normalized boxes coordinates for all queries, represented as
                           (center_x, center_y, height, width). These values are normalized in [0, 1],
                           relative to the size of each individual image (disregarding possible padding).
                           See PostProcess for information on how to retrieve the unnormalized bounding box.
           - "aux_outputs": Optional, only returned when auxilary losses are activated. It is a list of
                            dictionnaries containing the two above keys for each decoder layer.
    """`

As is described in models/deformable_detr.py, what does samples.mask do here?

When batch>=2, the shape of different frames in a  batch may not be the same. And the dataset will pad them into the same shape with zero, so it need the mask to tell which pixels are padded.

When batch>=2, the shape of different frames in a  batch may not be the same. And the dataset will pad them into the same shape with zero, so it need the mask to tell which pixels are padded.

When batch>=2, the shape of different frames in a batch may not be the same. And the dataset will pad them into the same shape with zero, so it need the mask to tell which pixels are padded.

I see. Great thanks

When batch>=2, the shape of different frames in a batch may not be the same. And the dataset will pad them into the same shape with zero, so it need the mask to tell which pixels are padded.

I see. Great thanks

@linjing-ai Could you please explain more about why do we need to filter out the padded area? What if we don't use this manner in the position encoding?

@prismformore The resolution(HxW) of different frames in a batch may not be the same , so we need to pad the smaller ones with zeros to the same size as the larger one. If all the frames have the same resolution, I think that 'mask = torch.zeros((B,H,W))' is okay.

@linjing-ai sorry for not making my question clear. My real question is why don't we just use the same position encoding on different size input. The padding area should not influence the result. Maybe because there will be misalignment when resizing the feature map?


Virus detected on newest OCS Zips

You may have an accidental virus in your OSC app and the other zip file.
https://www.virustotal.com/gui/file/a71dfb5309369d3c551a665cf32d630b61dfa16309bc9efaf6b803db83e880c6

I'm unable to download the OSC software because all my browsers are telling me the files have a virus and there's no way to ignore it and download the software anyways

Check out the zip file inside Unity's packages - shellprotect
This appears to be a misdiagnosis.

https://www.virustotal.com/gui/file/32f210fd21136e8da2c6ba21f086ddf85ea0ec27438bc1dccf7a93b40507b9af
I think I've figured out why. The problem was that after I fixed the code, I was building for 32-bit. I'll push it back up to 1.6.2, thanks for letting me know.

No problem


Emmet: Encode\Decode action & preferences

As I promised before, here’s a detailed description of what’s happening in the code.
Description
I contacted with the developer of Emmet (@sergeche) and made a bit of changes for creating an ability of using asynchronous API, and handle any errors, such as file does not exist, reading errors, write errors etc.
This PR close following issues and PR:  #8569, #8324, #8586, #8542, which were created before.
Changelog
There’s a main changes that this PR make:

Update Emmet to 1.6.0 version. Changelog for Emmet in addition to the asynchronous API:

Added a meta tag for Edge commit
Resolved #428 commit
Fixed annoying issue with locating CSS rule commit
Added code snippets for SVG commit
Added meta:redirect snippet commit
Added more boolean attributes for profile.booleanAttributes commit
Switched to extenal Can I Use database commit

Support of SVG, based on open file extension is added.  (see 1.4).
The process of set/reset settings and snippets for Emmet has been simplify. We don’t have to support undocumented features of Emmet, which don’t have any sense for the end user.
The checking for the case when user specify the path, which open out of the current directory.
Added function buffer in the file src/vs/base/node/request.ts, since the function text returns a string. This function returns the buffer.
Added layer between Emmet and methods Editor for work with the file system (FileAccessor).
FileAccessor is enabled only for actions Encode\Decode and Update Image Size.
The emulator of prompt function, which used in file base64 for transmit path to the Emmet, has been delete (it is not necessary in version 1.6.0).
The action Encode\Decode is again enabled.

Why the base64 has a lot of code?
For user comfortable it’s necessary to process several situations:

Decoding a data:URL image is only available inside a workspace folder.
Checking the validity of path:

The path must be inside of open directory.
The filename must consist valid symbols.

If the file with specified name is already exist, it’s necessary to provide the user a choice (overwrite)

Automated tests
I try to create automatic tests for this command, but got an editor error. The log is below. The source code for the test: Gist.
Despite of error, console.log in the test (inside the test file) file displays the correct result. I can’t find a reason of this.

Error log: Cannot read property 'getStartPosition' of null
    WARNING: Promise with no error callback:58
  { exception:
    TypeError: Cannot read property 'getStartPosition' of null
        at EditorAccessor.getSyntax (C:\projects\vscode-master\out\vs\workbench\parts\emmet\node\editorAccessor.js:93:54)
        at Object.outputInfo (C:\projects\vscode-master\node_modules\emmet\lib\utils\editor.js:57:37)
        at Object.expandAbbreviationAction (C:\projects\vscode-master\node_modules\emmet\lib\action\expandAbbreviation.js:106:27)
        at Object.run (C:\projects\vscode-master\node_modules\emmet\lib\action\main.js:150:21)
        at Object.run (C:\projects\vscode-master\node_modules\emmet\lib\emmet.js:81:23)
        at ExpandAbbreviationAction.BasicEmmetEditorAction.runEmmetAction (C:\projects\vscode-master\out\vs\workbench\parts\emmet\node\emmetActions.js:82:25)
        at C:\projects\vscode-master\out\vs\workbench\parts\emmet\node\emmetActions.js:51:27
        at ExpandAbbreviationAction.EmmetEditorAction._withEmmetPreferences (C:\projects\vscode-master\out\vs\workbench\parts\emmet\node\emmetActions.js:65:17)
        at C:\projects\vscode-master\out\vs\workbench\parts\emmet\node\emmetActions.js:49:23
        at Object.notifySuccess [as _notify] (C:\projects\vscode-master\out\vs\base\common\winjs.base.raw.js:1170:59)
        at Object.state_success_notify.enter (C:\projects\vscode-master\out\vs\base\common\winjs.base.raw.js:852:30)
        at Promise_ctor._Base.Class.define._run (C:\projects\vscode-master\out\vs\base\common\winjs.base.raw.js:1068:29)
        at Promise_ctor._Base.Class.define._completed (C:\projects\vscode-master\out\vs\base\common\winjs.base.raw.js:1036:18)
        at Module._invokeFactory (C:\projects\vscode-master\out\vs\loader.js:755:52)
        at Module._complete (C:\projects\vscode-master\out\vs\loader.js:776:34)
        at Module.resolveDependency (C:\projects\vscode-master\out\vs\loader.js:831:22)
        at ModuleManager._onModuleComplete (C:\projects\vscode-master\out\vs\loader.js:1190:39)
        at ModuleManager._resolve (C:\projects\vscode-master\out\vs\loader.js:1525:22)
        at ModuleManager.defineModule (C:\projects\vscode-master\out\vs\loader.js:1027:18)
        at ModuleManager._onLoad (C:\projects\vscode-master\out\vs\loader.js:1113:34)
        at Object.callback (C:\projects\vscode-master\out\vs\loader.js:1488:31)
        at OnlyOnceScriptLoader.triggerCallback (C:\projects\vscode-master\out\vs\loader.js:1559:36)
        at C:\projects\vscode-master\out\vs\loader.js:1553:80
        at NodeScriptLoader.load (C:\projects\vscode-master\out\vs\loader.js:1727:17)
        at OnlyOnceScriptLoader.load (C:\projects\vscode-master\out\vs\loader.js:1553:37)
        at loadNextPath (C:\projects\vscode-master\out\vs\loader.js:1483:41)
        at Object.errorback (C:\projects\vscode-master\out\vs\loader.js:1491:25)
        at OnlyOnceScriptLoader.triggerErrorback (C:\projects\vscode-master\out\vs\loader.js:1566:36)
        at C:\projects\vscode-master\out\vs\loader.js:1553:141
        at ReadFileContext.callback (C:\projects\vscode-master\out\vs\loader.js:1733:25)
        at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:359:13),
    error: null,
    promise:
    { _creator: null,
      _nextState: null,
      _state:
        { name: 'error',
          enter: [Function],
          cancel: [Function: _],
          done: null,
          then: null,
          _completed: [Function: _],
          _error: [Function: _],
          _notify: [Function: notifyError],
          _progress: [Function: _],
          _setCompleteValue: [Function: _],
          _setErrorValue: [Function: _] },
      _value:
        TypeError: Cannot read property 'getStartPosition' of null
            at EditorAccessor.getSyntax (C:\projects\vscode-master\out\vs\workbench\parts\emmet\node\editorAccessor.js:93:54)
            at Object.outputInfo (C:\projects\vscode-master\node_modules\emmet\lib\utils\editor.js:57:37)
            at Object.expandAbbreviationAction (C:\projects\vscode-master\node_modules\emmet\lib\action\expandAbbreviation.js:106:27)
            at Object.run (C:\projects\vscode-master\node_modules\emmet\lib\action\main.js:150:21)
            at Object.run (C:\projects\vscode-master\node_modules\emmet\lib\emmet.js:81:23)
            at ExpandAbbreviationAction.BasicEmmetEditorAction.runEmmetAction (C:\projects\vscode-master\out\vs\workbench\parts\emmet\node\emmetActions.js:82:25)
            at C:\projects\vscode-master\out\vs\workbench\parts\emmet\node\emmetActions.js:51:27
            at ExpandAbbreviationAction.EmmetEditorAction._withEmmetPreferences (C:\projects\vscode-master\out\vs\workbench\parts\emmet\node\emmetActions.js:65:17)
            at C:\projects\vscode-master\out\vs\workbench\parts\emmet\node\emmetActions.js:49:23
            at Object.notifySuccess [as _notify] (C:\projects\vscode-master\out\vs\base\common\winjs.base.raw.js:1170:59)
            at Object.state_success_notify.enter (C:\projects\vscode-master\out\vs\base\common\winjs.base.raw.js:852:30)
            at Promise_ctor._Base.Class.define._run (C:\projects\vscode-master\out\vs\base\common\winjs.base.raw.js:1068:29)
            at Promise_ctor._Base.Class.define._completed (C:\projects\vscode-master\out\vs\base\common\winjs.base.raw.js:1036:18)
            at Module._invokeFactory (C:\projects\vscode-master\out\vs\loader.js:755:52)
            at Module._complete (C:\projects\vscode-master\out\vs\loader.js:776:34)
            at Module.resolveDependency (C:\projects\vscode-master\out\vs\loader.js:831:22)
            at ModuleManager._onModuleComplete (C:\projects\vscode-master\out\vs\loader.js:1190:39)
            at ModuleManager._resolve (C:\projects\vscode-master\out\vs\loader.js:1525:22)
            at ModuleManager.defineModule (C:\projects\vscode-master\out\vs\loader.js:1027:18)
            at ModuleManager._onLoad (C:\projects\vscode-master\out\vs\loader.js:1113:34)
            at Object.callback (C:\projects\vscode-master\out\vs\loader.js:1488:31)
            at OnlyOnceScriptLoader.triggerCallback (C:\projects\vscode-master\out\vs\loader.js:1559:36)
            at C:\projects\vscode-master\out\vs\loader.js:1553:80
            at NodeScriptLoader.load (C:\projects\vscode-master\out\vs\loader.js:1727:17)
            at OnlyOnceScriptLoader.load (C:\projects\vscode-master\out\vs\loader.js:1553:37)
            at loadNextPath (C:\projects\vscode-master\out\vs\loader.js:1483:41)
            at Object.errorback (C:\projects\vscode-master\out\vs\loader.js:1491:25)
            at OnlyOnceScriptLoader.triggerErrorback (C:\projects\vscode-master\out\vs\loader.js:1566:36)
            at C:\projects\vscode-master\out\vs\loader.js:1553:141
            at ReadFileContext.callback (C:\projects\vscode-master\out\vs\loader.js:1733:25)
            at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:359:13),
      _isException: true,
      _errorId: 58,
      done: [Function: ErrorPromise_done],
      then: [Function: ErrorPromise_then] },
    handler: undefined,
    id: 58,
    parent: undefined }
  TypeError: Cannot read property 'getStartPosition' of null
      at EditorAccessor.getSyntax (C:\projects\vscode-master\out\vs\workbench\parts\emmet\node\editorAccessor.js:93:54)
      at Object.outputInfo (C:\projects\vscode-master\node_modules\emmet\lib\utils\editor.js:57:37)
      at Object.expandAbbreviationAction (C:\projects\vscode-master\node_modules\emmet\lib\action\expandAbbreviation.js:106:27)
      at Object.run (C:\projects\vscode-master\node_modules\emmet\lib\action\main.js:150:21)
      at Object.run (C:\projects\vscode-master\node_modules\emmet\lib\emmet.js:81:23)
      at ExpandAbbreviationAction.BasicEmmetEditorAction.runEmmetAction (C:\projects\vscode-master\out\vs\workbench\parts\emmet\node\emmetActions.js:82:25)
      at C:\projects\vscode-master\out\vs\workbench\parts\emmet\node\emmetActions.js:51:27
      at ExpandAbbreviationAction.EmmetEditorAction._withEmmetPreferences (C:\projects\vscode-master\out\vs\workbench\parts\emmet\node\emmetActions.js:65:17)
      at C:\projects\vscode-master\out\vs\workbench\parts\emmet\node\emmetActions.js:49:23
      at Object.notifySuccess [as _notify] (C:\projects\vscode-master\out\vs\base\common\winjs.base.raw.js:1170:59)
      at Object.state_success_notify.enter (C:\projects\vscode-master\out\vs\base\common\winjs.base.raw.js:852:30)
      at Promise_ctor._Base.Class.define._run (C:\projects\vscode-master\out\vs\base\common\winjs.base.raw.js:1068:29)
      at Promise_ctor._Base.Class.define._completed (C:\projects\vscode-master\out\vs\base\common\winjs.base.raw.js:1036:18)
      at Module._invokeFactory (C:\projects\vscode-master\out\vs\loader.js:755:52)
      at Module._complete (C:\projects\vscode-master\out\vs\loader.js:776:34)
      at Module.resolveDependency (C:\projects\vscode-master\out\vs\loader.js:831:22)
      at ModuleManager._onModuleComplete (C:\projects\vscode-master\out\vs\loader.js:1190:39)
      at ModuleManager._resolve (C:\projects\vscode-master\out\vs\loader.js:1525:22)
      at ModuleManager.defineModule (C:\projects\vscode-master\out\vs\loader.js:1027:18)
      at ModuleManager._onLoad (C:\projects\vscode-master\out\vs\loader.js:1113:34)
      at Object.callback (C:\projects\vscode-master\out\vs\loader.js:1488:31)
      at OnlyOnceScriptLoader.triggerCallback (C:\projects\vscode-master\out\vs\loader.js:1559:36)
      at C:\projects\vscode-master\out\vs\loader.js:1553:80
      at NodeScriptLoader.load (C:\projects\vscode-master\out\vs\loader.js:1727:17)
      at OnlyOnceScriptLoader.load (C:\projects\vscode-master\out\vs\loader.js:1553:37)
      at loadNextPath (C:\projects\vscode-master\out\vs\loader.js:1483:41)
      at Object.errorback (C:\projects\vscode-master\out\vs\loader.js:1491:25)
      at OnlyOnceScriptLoader.triggerErrorback (C:\projects\vscode-master\out\vs\loader.js:1566:36)
      at C:\projects\vscode-master\out\vs\loader.js:1553:141
      at ReadFileContext.callback (C:\projects\vscode-master\out\vs\loader.js:1733:25)
      at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:359:13)
  ....................
  Cannot read property 'getStartPosition' of null
  Error: oops
      at ErrorHandler.unexpectedErrorHandler (C:\projects\vscode-master\test\all.js:184:12)
      at ErrorHandler.onUnexpectedError (C:\projects\vscode-master\out\vs\base\common\errors.js:42:18)
      at Object.onUnexpectedError (C:\projects\vscode-master\out\vs\base\common\errors.js:56:34)
      at C:\projects\vscode-master\out\vs\base\common\winjs.base.js:41:18
      at Array.forEach (native)
      at Timeout._onTimeout (C:\projects\vscode-master\out\vs\base\common\winjs.base.js:38:25)
      at tryOnTimeout (timers.js:224:11)
      at Timer.listOnTimeout (timers.js:198:5)
  .

    1803 passing (18s)
    2 failing

    1) Basic Emmet actions expandAbbreviationTest:
      Error: timeout of 10000ms exceeded. Ensure the done() callback is being called in this test.
        at Timeout.<anonymous> (C:\projects\vscode-master\node_modules\mocha\lib\runnable.js:226:19)

    2) Errors should not have unexpected errors in tests:

        AssertionError: false == true
        + expected - actual

        -false
        +true

        at Context.<anonymous> (C:\projects\vscode-master\test\all.js:175:13)
        at callFn (C:\projects\vscode-master\node_modules\mocha\lib\runnable.js:326:21)
        at Test.Runnable.run (C:\projects\vscode-master\node_modules\mocha\lib\runnable.js:319:7)
        at Runner.runTest (C:\projects\vscode-master\node_modules\mocha\lib\runner.js:422:10)
        at C:\projects\vscode-master\node_modules\mocha\lib\runner.js:528:12
        at next (C:\projects\vscode-master\node_modules\mocha\lib\runner.js:342:14)
        at C:\projects\vscode-master\node_modules\mocha\lib\runner.js:352:7
        at next (C:\projects\vscode-master\node_modules\mocha\lib\runner.js:284:14)
        at Immediate._onImmediate (C:\projects\vscode-master\node_modules\mocha\lib\runner.js:320:5)

  npm ERR! Test failed.  See above for more details.

I also wrote the basic tests for FileAccessor, but i didn’t include them in this PR. They are available in Gist.
This tests are useful after little changes of a class FileAccessor:

In the locateFile method should return this.fileService.existsFile.
In the read method should return buffer и this.fileService.resolveContent.
In the save method should return this.fileService.updateContent.

Because of automatic tests don’t work, I wrote the instructions for manual testing.
Manual tests

Check for encoding and decoding for files from network and disks.

Open the directory and create a CSS file.

Insert the following code into the newly created file:
.test {
    background-image: url(https://avatars3.githubusercontent.com/u/7034281?v=3&s=40);
}

Run Encode\Decode command. The correct result: background-image: url(data:application/octet-stream;base64,/9j/2wCEAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSE…);

Run Encode/Decode command in the same file.

Write the name test.png. File must be saved, and property looks following: background-image: url (test.png);.

Rerun Encode\Decode command. The correct result: as in item 3 above.

Check of processing cancellation of decode and display a simple errors.

Repeat the first three steps described above (1.1 - 1.3).

Run Encode\Decode command and press Escape key. Nothing's going to happen.

Run Encode\Decode and write the following text: ../../test.png. You should see:

Run Encode\Decode and write the following text: test:::image.png. You should see:

Checking display of warnings.

Repeat the first six steps described above (1.1 - 1.5).

Change image url on https://avatars2.githubusercontent.com/u/172399?v=3&s=60.

Run Encode\Decode action and write test.png. You should see:

Agree to overwrite.

Open the file test.png. You should see avatar @egamma.

Checking display warnings about missing files.

Open the directory and create a CSS file.

Insert the following code into the newly created file:
.test {
    background-image: url(https://www.canonium.com/fileNotExist.svg);
}

Run Encode\Decode action. You should see:

Replace the path in background-image property to a new value: fileNotExist.png.

Run Encode\Decode action. You should see:

@mrmlnc I'm sorry but I didn't get to this PR before my vacation and it is getting tight for the July iteration. One issue is that emmet 1.6 adds a new dependency to caniuse-db, that we need to track.

@mrmlnc there is some significant size increase between emmet 1.3.1 and emmet 1.6 and this needs a justification:

emmet 1.3 -> 2.3MB, 130 files
emmet 1.6 -> 9MB, 747 files

While the emmet 1.6 module itself got smaller and is now 1.8 MB, the caniuse-db module adds 7 MB.
So how can the size difference be justified?

Hello, @egamma, you are well rested? :ski: :sunny:
Nice catch. Unfortunately, i have not checked this case. The module CanIuse contains a lot of unnecessary information for us.
The way out of this situation will be building Emmet by Gulp. Theoretically this can solve some issues such as #4076. If you remember, I conducted the tests, but it was on a fast SSD drive.
P.S.: The author plans to completely rewrite Emmet, so we can postpone this matter at any time convenient for you. I don't think a lot of people use this feature Emmet.

@mrmlnc

The way out of this situation will be building Emmet by Gulp.

The way we currently build VS Code is that we  npm install the dependencies.  The build currently doesn't support post install steps for dependencies. My preference would be an emmet-built npm module that we can consume directly. This module should not be VS Code specific and the Atom, Sublime and other Emmet integrations would also benefit from such an optimized module.
One thing we are also considering is to move emmet into an extension.

I don't think a lot of people use this feature Emmet.

Then let's defer it for now. This is still a great PR, thank you :rose:

@egamma,

My preference would be an emmet-built npm module that we can consume directly.

I will discuss this issue with the creator of Emmet.

One thing we are also considering is to move emmet into an extension.

Great idea.

@mrmlnc I'm closing this PR for now.

Hi,
I can not find the Encode/Decode Image to data:URL command in the palette and in the emmet commands list.
What about you guys ? Is it missing for everyone?

VS Code v1.10.2 with default setup
Win 10 pro x64 french

@freMea No this hasn't been implemented in VS Code yet.
You can follow #27978 for updates on this feature


Sauce labs integration

Love the package and using it locally and headless on travis-ci.
Just wondering if you have plans to support sauce labs or browser stack in the future (or just the remote web driver).
Looking forward to all you're upgrades!!

Yes, those are cool things which will help to push this package on a new level. Also, I like your thought.
Feel free to submit a PR if you like to contribute.

So it turns out the phpunit_selenium already is mostly set up to do it. Just overriding the the setup and including an array of browsers with some specific attributes is all that's needed.
Here's a tester I was using, might be helpful.
On a side note I found that using the using see('words','title') wasn't able to retrieve the page title. Might be a known issue though :)
`use Modelizer\Selenium\SeleniumTestCase;
define('SAUCE_HOST', env(SAUCE_USERNAME).':'.env(SAUCE_ACCESS_KEY).'@ondemand.saucelabs.com');
class WebDriverExample extends SeleniumTestCase
{
protected $start_url = 'http://saucelabs.com/test/guinea-pig';
protected function setUp()
{
    $this->setUpLaravel();
    $this->baseUrl = 'http://saucelabs.com/test/guinea-pig';
    $this->setBrowserUrl($this->baseUrl);
}

public static $browsers = [
    [
        'browserName' => 'chrome',
        'host' => SAUCE_HOST,
        'port' => 80,
        'desiredCapabilities' => [
            'version' => '48',
            'platform' => 'Linux',
        ]
    ],
    [
        'browserName' => 'firefox',
        'host' => SAUCE_HOST,
        'port' => 80,
        'desiredCapabilities' => [
            'version' => '45',
            'platform' => 'Linux',
        ],
    ], [
        'browserName' => 'safari',
        'host' => SAUCE_HOST,
        'port' => 80,
        'desiredCapabilities' => [
            'version' => '9',
            'platform' => 'Mac 10.11',
        ],
    ]
];

public function testTitle()
{
    $this->visit('/')->wait(1)->assertContains("I am a page title",$this->title());
}

public function testLink()
{
    $this->visit('/')->see('i am a link')->click('i am a link')->wait(2)->assertContains("I am another page title",$this->title());
}

}`

Okay, so what next we need to do is extract config related things and push it into .env file. Once selenium is started it will look for SAUCE_* is set or not. If yes, then it will not load drivers from SAUCE config/driver.php file.
What say?

Closing for now.


Wandb account required even when not attempting to visualize training

IceNet version: 0.2.0
Python version: 3.8.13
Operating System: CentOS Linux release 7.9.2009 (Core)

Description
Running the training command from icenet-notebooks/01.cli_demonstration.ipynb requires a wandb account, even when selecting 'don't visualize my results'.
It's possible to pass the -nw (--no-wandb) flag to avoid this, but I'd probably still expect the 'don't visualise' option to work.
What I Did
icenet_train notebook_data notebook_testrun 42 -b 2 -e 10 -m -qs 4 -w 4 -n 0.6
2023-02-01 18:05:03.804863: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neura
l Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 AVX512F FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
[01-02-23 18:05:08 :WARNING ] - Setting seed for best attempt at determinism, value 42
[01-02-23 18:05:08 :INFO    ] - Loading configuration dataset_config.notebook_data.json
[01-02-23 18:05:08 :INFO    ] - Training dataset path: ./network_datasets/notebook_data/south/train
[01-02-23 18:05:08 :INFO    ] - Validation dataset path: ./network_datasets/notebook_data/south/val
[01-02-23 18:05:08 :INFO    ] - Test dataset path: ./network_datasets/notebook_data/south/test
wandb: (1) Create a W&B account
wandb: (2) Use an existing W&B account
wandb: (3) Don't visualize my results
wandb: Enter your choice: 3
wandb: You chose 'Don't visualize my results'
wandb: ERROR Error while calling W&B API: user is not logged in (<Response [401]>)

Thanks @ots22, this definitely isn't what we want. The issue will be with the wandb.init call not respecting that we're not uploading / linking to an account. It might be a change in behaviour, or native, that it automatically queries for an initialised wandb system. As things can be saved locally, perhaps there's an option in wandb.init that will prevent this check!

@ots22 there is a -wo / --wandb-offline option, have you tried using that?

Thanks - I found --no-wandb fixed it for me and I didn't investigate further. What is the difference between -nw and -wo?

-wo switches wandb to cache results locally, -nw just turns it off. The message you got was from the wandb library itself, so it might require the use of -wo. These options probably need clearing up a bit as one supersedes the other look at it. 😉


Merge k-sorted Linked List in Java

Description -

[ ] Merger K-sorted Lnked List in java

I have read the guidelines
Please assign this to me

Hey @rudrakshi99 @tarun26091999
I would like to do it in cpp.
Please assign me this issue.

Hello @tarun26091999 @dheerajkotwani @esheetaparulekar @anubhavitis @jeelnathani, I think this is an important question and this should definitely be added in the Algo-Tree and I will start working on it as soon as I get assigned!! as I am a part of GSSoC'21, so I would like to implement this in c++.

Hello, I am a GSSOC'21 participant and would like to contribute to this project.


AppMetrics not picking up other routes than GET favicon.ico

Hey
I have an Asp.net Core app (2.2.2) that I am trying to see web metrics from. We are using Mvc, but App Metrics does not seem to pick up requests to our routes, only for the favicon.ico file (which fails with a 404, but only shows up as GET, and not the whole route.).
I've tried using the latest App.Metrics nugets, and also tried with 3.1.0-alpha-0114.
In startup.cs I am doing this:
services.AddMvc().AddMetrics()

var metrics = AppMetrics.CreateDefaultBuilder()
                .Report.ToInfluxDb("http://<IP_ADDRESS>:8086", "qsrepmet")
                .Build();
services.AddMetrics(metrics);
services.AddMetricsTrackingMiddleware();
services.AddMetricsReportingHostedService();
services.AddMetricsEndpoints();

I've also tried adding the .SetCompatibilityVersion(CompatibilityVersion.Version_2_1), but it didn't help.
And
app.UseMetricsAllMiddleware();
app.UseMetricsAllEndpoints();

Anything obvious that I am doing wrong? I am not that familiar with asp.net core that I could figure this out 🤔

Try the sample app https://github.com/AppMetrics/Samples.V2/blob/master/AspNetCore2.Api.QuickStart/Program.cs

I am also no longer getting any route specific reporting with Asp.Net core 2.2.2 and latest AppMetrics nugets.

@alhardy I tried setting it up quickly using the Quick start instructions (using the correct syntax for the services part, which still is wrong in  the documentation), and that seems to work. Using the other setups from the other instructions though doesn't want to work 🤔

And the difference between those two was that the program.cs method also calls services.AddSingleton<IStartupFilter>(new DefaultMetricsTrackingStartupFilter());. Adding this line to my current implementation makes it recognize the routes!

And yet another comment. Further testing shows that it picks up routes that are defined as
routes.MapRoute(
        name: "areaRoute",
        template: "{area:exists=Home}/{controller=Home}/{action=Index}/{id?}"
);

But not ones that we have by using
[Produces("application/json")]
[Route("api/AppConfigs")]

before a controller 🤔


Changes critical is not for !=

Hi, I was having trouble deploying an application in AppEngine using spotipy Client Credentials Flow. After a lot of debugging, I've realized there's two critical comparisons to a response status 200 made with is not, when they should be made with != since they're comparisons against a number.
Regards

nice catch, thanks for the PR


Include the body content type in Schema

We only want to add the HasJsonBody trait to requests expecting an application/json body, but this information is not currently available
This commit adds the data into the schema object so we can retrieve it when generating request objects.

This is required to fix https://github.com/jlevers/selling-partner-api/issues/711 and replace https://github.com/jlevers/selling-partner-api/pull/716 and https://github.com/jlevers/selling-partner-api/pull/715.
Once this is merged I can create a PR for the selling-partner-api side

Thanks! I have an implementation of this that handles several common content type options sitting on my local branch, but haven't had a chance to test it thoroughly yet. Gonna merge this for now, but just want to give you a heads up that it will probably get overwritten relatively soon.


Changing the platform from armv5tejl to linux_arm

Merge conflict.

I resolved the trivial conflict and merged so that the CI can continue.
@jabrena update your jabrena:master branch before pushing any further fixes to ensure you are in sync.

Oki


Fixed and suppressed several findings from LGTM.com

LGTM.com offers static analysis for open-source projects. It's based on CodeQL engine. The current report for Apache HttpClient is pretty good. There are only 19 findings. I had a look at them, and didn't find anything severe. Nevertheless, I'd like to propose fixing some minor findings and suppressing the rest. Suppressing the warnings would make it simpler to triage new issues in the future.
Here is a list of updates:

Fixed a few possible null dereferences
Fixed a few possible out-of-bound array ops
Suppressed warnings for weak cryptographic algorithms for NTLM and Digest authentication schemes
Suppressed a few false-positives for null dereference
Suppressed a few warnings for overriding a synchronized method without synchronization
Added a couple of test cases

Personally -1, I'm not a fan of adding non-standard, some .com's proprietary annotations and source comments to our sources. I would be more open if this type of annotations were in another file just one does for FindBugs, SpotBugs, Checkstyle, Apache RAT.

@garydgregory I agree with the annotation, but would analyze the rest for validity.

Personally -1, I'm not a fan of adding non-standard, some .com's proprietary annotations and source comments to our sources. I would be more open if this type of annotations were in another file just one does for FindBugs, SpotBugs, Checkstyle, Apache RAT.

Yup, I don't like it either. Unfortunately, it is not possible to add a file with suppressions
https://lgtm.com/help/lgtm/alert-suppression#:~:text=LGTM generates alerts when it,of making the code better.

@artem-smotrakov I agree with @garydgregory. We will happily accept the fixes but without vendor specific annotations.

@garydgregory I agree with the annotation, but would analyze the rest for validity.

@artem-smotrakov please update the PR without vendor specific comments and annotations.

One test failed in the Travis build but I can't reproduce it. Not sure if the update caused this test failures. Is it a known intermittent test failure? I couldn't find any bug in Jira either.

https://travis-ci.org/github/apache/httpcomponents-client/jobs/740163136
I restarted the build just to see if this was random.

One test failed in the Travis build but I can't reproduce it. Not sure if the update caused this test failures. Is it a known intermittent test failure? I couldn't find any bug in Jira either.

There is a known issue that has been causing intermittent test failures for months. I was unable to reproduce anywhere outside Travis CI but hopefully it got finally fixed with apache/httpcomponents-core#227


clean up connect syntax

[ ] Need to change the namedFunction behavior to allow for saving the attribute name itself (what about delimited attributes?)


NUMBERS-84: Checks for NaN and Infinite in Quaternion Normalization

Adding NaN and infinite checks to Quaternion.normalize() and Quaternion.inverse(). I ended up bumping the JDK version from 6 to 8 in order to use Double.isFinite(). If this causes issues, I can rework it.

Coverage remained the same at 92.827% when pulling 693a8c109da636a499403ce9097dff11128cbc3a on darkma773r:numbers-84 into 9186804d0fcc4b21d1ba4b974aa4275232df1bec on apache:master.

I'm closing this since master has changed and it will be easier to open a new one than try to resolve the conflicts.


Enhance handler customization.

I would propose to you this PR fixing #43, #40, #34:

added 2 new methods: NewGzipHandler, NewHandler

with functional options
deprecated old method (I can change if you want)

added a GzipWriter interface

allow some customization (like asked in #34, #40)

This changes:

don't expose previous unexported methods or struct. (like acceptsGzip or others)
don't break current behaviors.

example
package gziphandler

import (
    "bufio"
    "log"
    "net"
    "net/http"
)

type GzipResponseWriterLogger struct {
    GzipResponseWriter
}

func (g *GzipResponseWriterLogger) Write(b []byte) (int, error) {
    log.Printf("Write: %v\n", b)
    log.Printf("ResponseWriter Header: %v\n", g.ResponseWriter.Header())
    return g.GzipResponseWriter.Write(b)
}

func (g *GzipResponseWriterLogger) WriteHeader(code int) {
    log.Printf("WriteHeader: %v\n", code)
    g.GzipResponseWriter.WriteHeader(code)
}

func (g *GzipResponseWriterLogger) Hijack() (net.Conn, *bufio.ReadWriter, error) {
    log.Println("Hijack")
    return g.GzipResponseWriter.Hijack()
}

func (g *GzipResponseWriterLogger) Close() error {
    log.Println("Close")
    return g.GzipResponseWriter.Close()
}

func (g *GzipResponseWriterLogger) Header() http.Header {
    log.Println("Header")
    return g.GzipResponseWriter.Header()
}

func GzipHandlerLogger(h http.Handler) http.Handler {
    wrapper, _ := NewHandler(&GzipResponseWriterLogger{}, CompressionLevel(2), MinSize(1024))
    return wrapper(h)
}

Fixes #43, #40, #34

Hi there, @ldez! Sorry for the delay, I was at GopherCon last week.
While we're interested in using functional options for this package, I'm not quite sure the addition of this interface is really needed. Do you think you could implement this without it?

Sorry, meant to just comment, not close!

The interface GzipWriter (the name is not the best but GzipResponseWriter is already used) allow to add some custom behaviors without needing to add them to this middleware.
I'm not really happy what I did with this interface (unexported methods) but I don't see a cleaner way to do that, if you have an idea I can implement.
But if you think it's not a interesting idea, I can drop this part.
WDYT?

With the merge of #51, functional options have been added.
And without any response I suppose you don't want my PR.


Dht improvments

This code is mostly routing table improvements.
Moved into simpler more traditional kademlia kbucket model.
moved everything in routing table to log from the node.
NOTE : tests might not pass outside the dht package since there still work going on there other prs.
TODO:

update wiki about new model.

Please merge, work will  be continued in swarm2 branch
I will open new issue for -

test other concurrency models. (one channel gateway event loop, spinlock(?))


neonmodem: init at 1.0.4

https://github.com/mrusme/neonmodem
Closes #290386
Description of changes

Things done

Built on platform(s)

[x] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)

[ ] sandbox = relaxed
[ ] sandbox = true

[ ] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[x] Tested basic functionality of all binary files (usually in ./result/bin/)
24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module

[x] Fits CONTRIBUTING.md.

Add a :+1: reaction to pull requests you find important.

Result of nixpkgs-review pr 290467 at 66563e14 run on x86_64-linux 1

1 package built successfully:

neonmodem


Travis test

First test for travis CI integration. Fails at:

$ python test/test_fits2hdf.py
python: can't open file 'download_test_fits.py': [Errno 2] No such file or directory

--------

Converting FITS files to HDFITS..
Creating directory hdf
Input directory:  fits
Output directory: hdf
Dataset creation arguments:
      table_type: DATA_GROUP
     compression: gzip
Traceback (most recent call last):
  File "/home/travis/virtualenv/python2.7.12/bin/fits2hdf", line 9, in <module>
    load_entry_point('fits2hdf==1.0', 'console_scripts', 'fits2hdf')()
  File "/home/travis/virtualenv/python2.7.12/lib/python2.7/site-packages/fits2hdf/file_conversion.py", line 85, in convert_fits_to_hdf
    filelist = os.listdir(dir_in)
OSError: [Errno 2] No such file or directory: 'fits'
Traceback (most recent call last):
  File "test/test_fits2hdf.py", line 164, in <module>
    test_fits2hdf()
  File "test/test_fits2hdf.py", line 48, in test_fits2hdf
    for fits_file in os.listdir('fits'):
OSError: [Errno 2] No such file or directory: 'fits'

The command "python test/test_fits2hdf.py" exited with 1.

Done. Your build exited with 1.


Update swagger

This checklist is used to make sure that common issues in a pull request are addressed. This will expedite the process of getting your pull request merged and avoid extra work on your part to fix issues discovered during the review process.
PR information

[ ] The title of the PR is clear and informative.
[ ] There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
[ ] Except for special cases involving multiple contributors, the PR is started from a fork of the main repository, not a branch.
[ ] If applicable, the PR references the bug/issue that it fixes.
[ ] Swagger files are correctly named (e.g. the api-version in the path should match the api-version in the spec).

Quality of Swagger

[ ] I have read the contribution guidelines.
[ ] My spec meets the review criteria:

[ ] The spec conforms to the Swagger 2.0 specification.
[ ] The spec follows the guidelines described in the Swagger checklist document.
[ ] Validation tools were run on swagger spec(s) and have all been fixed in this PR.

@chingchenmsft Please address the CI failures here first and I'll review your change: https://travis-ci.org/Azure/azure-rest-api-specs/jobs/233407054#L2415.
Thanks!

@chingchenmsft
kindly address the feedback, if the thread stays inactive by next Wednesday 21st o f June we'll need to close it

Closing as requested by Ching


Huber QP canonicalization

Now the Huber function is QP compatible.
I have to say the cvxpy 1.0 canonicalization system very intuitive! I did not imagine it to be so easy.
I copied most of what was already in the conic canonicalizer.
It gives the same results as the conic Huber canonicalization so it seems correct to me. I have also added a unit test.
FIxes #603

Coverage increased (+0.05%) to 82.761% when pulling 33cf151c1788143ed3b927ababa8c4560c616ec9 on bstellato:huber_qp into ab95e20ae648f3074ba6b0a427d6bae55ab219a7 on cvxgrp:master.

Coverage increased (+0.05%) to 82.761% when pulling 33cf151c1788143ed3b927ababa8c4560c616ec9 on bstellato:huber_qp into ab95e20ae648f3074ba6b0a427d6bae55ab219a7 on cvxgrp:master.

Great! Thanks for making the PR!

Thanks! That's nice to hear some validation of the 1.0 system :)


Man page

I can write a man page (in groff) for pacseek if that's something you're interested in.
I was thinking of including the command line flags, default keybinds and the config file options.

@Mudskipper875 That would great!
Thank you,
MO


show remaining time

CPod version:
CPod v1.27.1
Description:
It would be great when clicking the total podcast time,
if it can switched to show remaining time,
so you can see how much time you have listening on this podcast.

like time elapsing in the begging but ETA till finish

Hi, thanks for the suggestion. I should be able to implement this very soon.


debugging StateSmith doesn't work with nuget

I didn't realize that the included symbols reference paths on my computer.
Lots of info here: https://stackoverflow.com/questions/44457552/how-to-debug-code-in-nuget-package-created-by-me
Very helpful tool to analyze nuget: https://nuget.info/
Needs to work with vscode/omnisharp.

I'm a C developer that is learning to become dangerous with C# (although there aren't enough foot guns for my liking).
Any C# gurus out there that can help out with this?


Promote all install methods for CLI in the docs

Closes https://github.com/stellar/stellar-cli/issues/1083

Preview is available here:http://developers-pr733.previews.kube001.services.stellar-ops.com


Apple M1 support

Looks like my dell u3818dw is not recognized on apple m1. It works great on Intel macbook.

Would you be willing to share your machine and remote debug in order to examine the problem?

Hey, same problem as drewwells but dell TN DELL SE2417HGX

It looks like it is hardware problem. No much to do :(

M1 doesn't support DDC, this is how Lunar handles it: https://lunar.fyi/#m1 (TL;DR: either gamma tables which is not great or a very involved but clever Raspberry Pi workaround 😄).

How does m1 control tb3 monitors?

Lunar now works properly so seems somehow doable.

Same issue on m1 pro Mac. Lunar works fine.
@czarny Let me know if I could be of some help here.


feat(go-sdk)!: remove StoreId from API client config

Description

⚠ Breaking change ⚠
Removes the StoreId from the API client, and instead accept the StoreId as a parameter. As discussed in #118, this allows for the removal of the custom patch. A follow-on PR will enable overriding the StoreId per request as we do for the AuthorizationModelId.
If using api_open_fga.go directly, you will now need to pass the StoreId parameter.
References

#118
Review Checklist

[ ] I have clicked on "allow edits by maintainers".
[ ] I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
[ ] The correct base branch is being used, if not main
[ ] I have added tests to validate that the change in functionality is working as expected

java-sdk test failures are not related to this change; #361 to fix


maxSelectedItems attribute is no longer working

maxSelectedItems attribute for multiple select menu seems to no longer work.
max_selected_items field is still defined in @slack/types and
Slack Block Kit Builder does not throw error even if defined max_selected_items in JSON, but the actual component ignores this restriction. In addition, all descriptions about max_selected_items field are removed from the documentation of Slack API.

This removal was backed out by Slack. We have to revert the change of #94.


TP2000-1012: Add extra fields to quota definition edit form

TP2000-1012: Add extra fields to quota definition edit form

Why

Allows users to edit more info on quota definition periods

What

Allows editing of: description, volume, initial volume, critical state, critical threshold, measurement unit, measurement unit qualifier
Maximum precision is always set to 3 so this is not editable

Screenshot looks good, would it be possible to swap Measurements and Volumes around in the list so that volume is above the unit of measurements and measurement unit qualifier options?

Screenshot looks good, would it be possible to swap Measurements and Volumes around in the list so that volume is above the unit of measurements and measurement unit qualifier options?

This was changed after feedback from Patrick. We thought it made more sense to state the units before the volume but tariff managers may feel differently

Codecov Report
Patch coverage: 96.06% and project coverage change: +0.07% :tada:

Comparison is base (896cf2f) 92.59% compared to head (cdcad3a) 92.66%.
Report is 11 commits behind head on master.

:exclamation: Current head cdcad3a differs from pull request most recent head f3755c3. Consider uploading reports for the commit f3755c3 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1023      +/-   ##
==========================================
+ Coverage   92.59%   92.66%   +0.07%
==========================================
  Files         448      451       +3
  Lines       32366    32757     +391
  Branches     2471     2503      +32
==========================================
+ Hits        29970    30355     +385
+ Misses       1918     1915       -3
- Partials      478      487       +9

Files Changed
Coverage Δ

commodities/urls.py
100.00% <ø> (ø)

quotas/urls.py
100.00% <ø> (ø)

common/jinja2.py
90.56% <66.66%> (-3.06%)
:arrow_down:

common/tests/test_tariffs_api.py
94.64% <81.81%> (ø)

reports/reports/quotas_cannot_be_used.py
86.79% <86.00%> (ø)

quotas/forms.py
97.18% <92.30%> (-0.53%)
:arrow_down:

commodities/tests/conftest.py
97.54% <100.00%> (+0.28%)
:arrow_up:

commodities/tests/test_views.py
100.00% <100.00%> (ø)

commodities/views.py
99.06% <100.00%> (+0.13%)
:arrow_up:

common/tariffs_api.py
100.00% <100.00%> (ø)

... and 7 more

... and 20 files with indirect coverage changes

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Screenshot looks good, would it be possible to swap Measurements and Volumes around in the list so that volume is above the unit of measurements and measurement unit qualifier options?

This was changed after feedback from Patrick. We thought it made more sense to state the units before the volume but tariff managers may feel differently

Good to go then :-)


Tests: Let runTestCase() pretty-print expected TokenStream too

Only the actual token stream was pretty-printed. This makes the helper function pretty-print the expected token stream as well (and the diff too). Also added some \n to separate it from the mocha output.

Could you please explain why you did this?
I don't see the benefit. You can see the (usually) formatted token stream in the test file itself. And the calculated difference between two formatted token streams and two non-formatted token streams should be the same (apart from some whitespaces).
Also, a potential problem I see is that the mocha output will be longer which is a bit of a problem because consoles usually only store a fixed number of lines. The output of some more complex test cases can easily exceed 1000 lines because of the (current) diff. (For reference: The number of stored lines in VS Code's terminal is 1000 by default.)
Won't this be even longer with is PR?

Well, it already formatted the actual token stream. Having it display the actual data pretty-printed but not the expected data seems inconsistent. If you want the terse representation then you can just leave out the --pretty flag. For longer tests I would for sure redirect the output to a file for further inspection.
Based on your argument that you can see the formatted token stream in the test file itself, it shouldn't display the expected data at all, but just the actual data.
Not sure about the usefulness of the diff, it's really just the actual data from the first difference on - if there's an extra character in the very first line of a test then you get the full actual data twice. And mocha actually does a better job at showing a mismatch:

Having it display the actual data pretty-printed but not the expected data seems inconsistent.

True, but do need to have the expected token stream formatted?
I only added formatting for the actual token stream because I want to be able to copypaste it.

Based on your argument that you can see the formatted token stream in the test file itself, it shouldn't display the expected data at all [...]

Well, yes kinda. I don't think we gain anything from displaying the expected token stream. After all, you can see it in the test file, so you know exactly what's expected.
The only reason I see for its existence is consistency. Test errors usually have this expected vs actual style, so I guess it makes sense to display the expected token stream. I'm not too sure about this myself.

Not sure about the usefulness of the diff, it's really just the actual data from the first difference on - if there's an extra character in the very first line of a test then you get the full actual data twice. And mocha actually does a better job at showing a mismatch:

(I never gave any thought to our diff...) You're exactly right. Mocha does a way better job. We should just remove our diff.

I spent ~way too much~some time digging through the git blames and found out that the message was added by this commit from #1041.
But strangely, in the PR it was added by a merge commit.
If I had to guess, @Golmote didn't notice this change before merging (@Golmote wouldn't have accepted code indented this badly) and it just stuck around.
Knowing this: What more than the actual token stream and a small diff from mocha do we really need?
Might as well take this chance to make the errors a little simpler.

To be honest, I would scratch the diff and the expected output and just print the actual token stream. This could even be behind another flag, as mocha tells you pretty much everything you need to know. But I guess it doesn't hurt as long as it is printed above what mocha outputs.
Not sure if there is anything else needed. The position of the first difference / error? But that's tricky, because the raw as well as the reformatted token streams differ from the test file, so there's no straightforward way to compute that for the file. What could be helpful though is the location of the test in question, which mocha doesn't tell you.
I committed these changes, let me know what you think:

(without --pretty)

I really like the simplified format.
I added a bit code to also have the line and column number of the first difference at the end of the file path. Most IDEs understand this format, so you can jump directly into the test case at the position of the difference.

Please tell me what you think!
@Simran-B @mAAdhaTTah

I tried it with different white-space in the test file and it seems to point reliably at or behind the position of the deviation. Looks very good to me!

I dig it. :shipit:


Idea: Bring '@elementree/location' into the main repo and add a 'routes' function

import { routes, merge, prepare } from 'https://unpkg.com/elementree'

// varargs function or array?
routes(
  '/items/:id',
  '/user/:name'
)

merge('body', prepare(...))

Application State would be populated a location and route property.  Assuming an address of
.../items/1?sort=asc
Application State would look like:
location: '/items/1?sort=asc',
route: {
  path: {
    id: '1'
  },
  query: {
    sort: 'asc'
  },
  hash: ''
}

With any routes call or the arguments of routes is of length 0, the route property on Application State would be {}

Nope, not really a good idea right now. Let's keep routing a separate repo and library.


update rnn example

This change reintroduces an old example, a recurrent neural network that demonstrates the flexibility of Ray's scheduling. I have updated the code to match the latest Ray API. In addition, there are now several separate scripts:

rnn_monolithic.py is an idiomatic Tensorflow implementations
rnn_ray.py is distributed implementation for Ray
rnn_monolithic_task.py does not use Ray, but structures the computation as we do for Ray

I have also reduced the size of the computation so that it runs in an 8GB vm instance.
At this point I am seeking feedback rather than an immediate merge. I would like to structure this example like the others, where there is a driver.py file. I imagine that the driver.py will just run the test under Ray, whereas we can provide other scripts for running the comparisons to other implementations. Additional tasks remaining include adding documentation and adding this example to the continuous integration test suite.

Nice job! One interesting thing here is that it shows how you could parallelize an RNN by hand. This will be a very interesting example to benchmark and to try to understand what scheduling limitations we run up against as well as what sources of overhead we encounter.
For one benchmark I ran a while ago I remember getting between a 2x and 3x speedup with 3 machines, so not great, but I never successfully tracked down the overhead. If I remember correctly, rnn_monolithic.py and rnn_monolithic_task.py should have roughly the same performance.
Structuring this like the other example applications would be great. I'd focus on the distributed example, and possible include the pure TF example only in the README (although it will be important for benchmarking). When we finally merge it, I think it makes sense to slim down the example a lot (e.g., just one RNN, we don't have to do examples for 1-layer, 2-layers, 3-layers, etc).


Regular updates

Hey @casparjespersen yarn link-check is failing in this PR (see https://circleci.com/gh/iterative/dvc.org/2147) but it's finding links that I removed from the code base. Maybe it's not checking the PF branch but rather the base branch? master in this case. Maybe the logic below isn't correct?
https://github.com/iterative/dvc.org/blob/2982546117fc2451110e8f82678392c9e6077165/.circleci/config.yml#L23-L30

p.s. yarn link-check has no errors when I run it locally on this branch.

@jorgeorpinel you mean @casperdcl not @casparjespersen :)

Yeah this GH handle autocompete is terrible. Keeps wanting me to ping people who might have commented once in a single issue of the project...

Cool, link check is working after #979. Thanks @casperdcl !

As noted in https://github.com/iterative/dvc.org/issues/974#issuecomment-583273943, the link check is currently crashing, preventing the CI checks here from completing ATM. Otherwise this is ready for review.

ok finally got around to reviewing this. Will try to re-fix in a new PR. Not sure why you re-ordered links in exclude-links.txt - probably best to keep sorted.

I think I just sorted them alphabetically by domain name. If you leave a PR review here I'll address in a separate one.

hmm you mean you strip http(s):// before sorting? Seems unnecessarily inconvenient. Will be fixed in #997 anyway...

And www. But no, whatever is easy, as long as we all know what the sorting is. Thanks

p.s. I don't assume the file supports comments (and blank lines)? I.e.
# This is a list of URLs to exclude from scripts/...
# It's ordered with GNU `sort`.

http://<IP_ADDRESS>/
...

I was nearly going to write comments. They should be fine to add (though strictly speaking aren't ignored yet)


Fix for android:exported

Fix for Android 12 update of android:exported error

Should be closed as duplicate of #1158 which was merged into master


Remove unused variable from hamming stub code

There's an i variable provided for the Hamming Code exercise, but it's not part of the function signature.
It's likely a user might also want an integer i, e.g. as an index to iterate characters as part of a do loop, but they also might want to call it index or ptr or something else equally reasonable.
My suggestion here is to remove it and let students decide their approach.

Thanks!


File with 120 images/pages crashes Chrome

I've tried the latest version and a few prior versions of jspdf with large amounts of data, and Chrome crashes each time - sometimes with 70 images, other times with 85-90.  There are 120 total datauri images, and they are complex map images.  Internet Explorer, ironically, allows it to work though it takes 3 to 7 minutes.  The memory in both browsers, though, gets really high and ultimately causes Chrome to crash.  I've tried changing the image compression setting with jspdf which does make a difference in both browsers, but I'm still unable to generate it in Chrome.  Any suggestions or ideas?

What is it you're rendering? HTML / Canvas / SVG? There might be a better
way than as images
On Tue, 11 Oct 2016 at 21:53, atdiff<EMAIL_ADDRESS>wrote:

I've tried the latest version and a few prior versions of jspdf with large
amounts of data, and Chrome crashes each time - sometimes with 70 images,
other times with 85-90. There are 120 total datauri images, and they are
complex map images. Internet Explorer, ironically, allows it to work though
it takes 3 to 7 minutes. The memory in both browsers, though, gets really
high and ultimately causes Chrome to crash. I've tried changing the image
compression setting with jspdf which does make a difference in both
browsers, but I'm still unable to generate it in Chrome. Any suggestions or
ideas?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/MrRio/jsPDF/issues/901, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAC5s3sZZZT5J5HFfVMizJZE4km3Z29Mks5qy_dGgaJpZM4KUF8a
.

--
James Hall
Director
Parallax Agency Ltd
M.<PHONE_NUMBER>0

They're png datauri's that I'm just adding to the page

I think the problem is the addImage-Plugin.
https://github.com/MrRio/jsPDF/blob/master/plugins/addimage.js
Every Image is saved as base64-Text into an Object (line 134). So instead of loading and processing and then kicking it out of the memory, it keeps the images in the memory. There is not even a delete action after it is put into the pdf (line 108), because you dont know if it is used again in another place in the pdf.

I am facing the same issue when I try to add 14 Images to a PDF

@atdiff .I have solved this problem.actually you need to change arrayBufferToBinaryString function in addImage js.

@ashakoshti1988 Hey, oh nice, can you post the fix as a PR?

In addimage.js the below function rotates as many times per character based on base64 conversion.
jsPDFAPI.arrayBufferToBinaryString = function(buffer)  .Just comment the function body and uncomment the below line,
return atob(this.arrayBufferToBase64(buffer));
http://stackoverflow.com/questions/6965107/converting-between-strings-and-arraybuffers

@MrRio i need UTF-8 Conversion in my pdf.even i can develop it in jspdf functionality,but the help is appriciated.so just guide me how to start and from where can i start??

#844

This is fixed in https://github.com/MrRio/jsPDF/pull/1115


Standardize/enforce code formatting on the project

Set up pre-commit and some hooks for anything which runs quickly:

Prettier
Black
tslint
pre-commit

.. etc.

Fyi, we have a tslint precomit hook today, along with some other custom linters, and compilation checks.
We are using another hook using an npm package.

We also have/had formatter hooks.
The delay with the current hooks are a result of the custom strict compiler checks.

This isn't so much about faster as it is about being able to do it for both TS and Python code.

My preference is to stick with existing pre-commit hook husky,

I do not want to be forced to setup a python environment for VSC dev

Existing pre-commit hook (husky) allows us to run code for other languages too. At the end of the day, scripts run by husky are simple shell commands, i.e. python code can be easily executed and configured in scripts section of package.json.

I think it might be tricky to get the commands to be cross-platform (e.g. how do you make executing black cross-platform when python3 and black are typically not on PATH?). I also like that pre-commit has the tools maintain the integration.
But we can give husky a short to begin with and see if we can make it work.

As an alternate view: Why don't we simply use a faster check at the onset of the CI build to handle these pre-commit issues, and give contributors all the information they need to reproduce the CI build 'quick checks' on their own machine should the need arise?
Note: I personally have never been a huge fan of pre-commit checks.
Until I found the npm run -s precommit command so I could run it at my will, I found my enjoyment of checking in somewhat... reduced. I like it when the build machine tells me (quickly, preferably) when I've messed up simple stuff like linting/etc... and then gives me the tools to just check it on my own.

@DonJayamanne why do you not want to install Python to work on the Python extension for VS Code? Inquiring minds want to know! 😉
And I think we can skip doing pre-commit hooks because we have something called extensions. 😁 Pre-commit hooks are great as a standardized way to help make sure people meet some requirement before sending code to CI. But since we have standardized our tooling all the way up to the editor, we can actually just standardize on VS Code extensions to do the formatting for us and then let CI enforce that requirement as @d3r3kk suggested.

k we can skip doing pre-commit hooks because we have something called extensions

I guess this means @ericsnowcurrently will have to start using VS Code.

If this is open, then #611 should also be opened.
@brettcannon /cc


Where can I download the dataset of IIT-CDIP?

The download from the link https://ir.nist.gov/cdip/ is only xml information, not the original image, how can I download the  IIT-CDIP image？

The .cdr files contain the documents.

The .cdr files contain the documents.

hello  I can download the IIT-CDIP-annotations. How do images correspond to json？

but I want to download the diagram corresponding to json and not the original img


Styling fixes

If we add these align style we'll have this bug:

Closing as this makes other changes to the URL patterns as well. Should probably be using CSS for this anyway...

But this package was using these styles in the template, without using CSS.


trying building on ubuntu 17.10 failed

here are errors:
4 warnings and 3 errors generated.
[14/25062] CXX obj/breakpad/client/thread_info.o
warning: unknown warning option '-Wno-address-of-packed-member' [-Wunknown-warning-option]
warning: unknown warning option '-Wno-unused-lambda-capture'; did you mean '-Wno-unused-parameter'? [-Wunknown-warning-option]
warning: unknown warning option '-Wno-user-defined-warnings'; did you mean '-Wno-user-defined-literals'? [-Wunknown-warning-option]
warning: unknown warning option '-Wno-enum-compare-switch'; did you mean '-Wno-enum-compare'? [-Wunknown-warning-option]
4 warnings generated.
ninja: build stopped: subcommand failed.

Can you post the errors? I only see warnings.

dh_clean: mv debian/.debhelper/bucket/files/1d9048b0ac9d4d1dfce7aa4e3a0b59ccfd32db2f7693814aa6f4c778560f5669.tmp third_party/libxml/src/config.guess: No such file or directory
debian/rules:108: recipe for target 'clean' failed
make: *** [clean] Error 2
dpkg-buildpackage: error: fakeroot debian/rules clean gave error exit status 2

How are you trying to build? What happens if you try to apply this patch?: https://github.com/Eloston/ungoogled-chromium/blob/master/resources/patches/inox-patchset/breakpad-use-ucontext_t.patch

just following the instructions for debian 9. What should i do to use the patch?

does it means i'm already using it when building?

No, because it's not used in the Debian 9 patch order list. So, you'll need to apply it yourself.

Building on 17.10 using the instructions in develop works for me. Let me know if you have issues.