alternating results running grunt qunit

after so many years working with Pascal, C/C++, Python, with unit testing and test coverage monitoring, I feel like a beginner again! I'm very new to all the tools I'm using now, so I'm sure I'm missing some very basic points.
I'm writing tests for the front-end of Ghini/ghini.web, using this Gruntfile, and I have this funny alternating failure/success pattern:
mario@rune:~/Local/github/Ghini/ghini.web$ grunt qunit
Running "qunit:files" (qunit) task
Testing public/test/test.html >> Running qunit.spawn: public/test/test.html
>> Running qunit.begin
>> Running qunit.moduleStart:
>> Running qunit.testStart: Object.values
>> PhantomJS error:
>>  TypeError: undefined is not an object (evaluating 'QUnit.jsDump.parse')
>>  [ { file: 'phantomjs://code/bridge.js', line: 40, function: '' },
>>   { file: 'file:///home/mario/Local/github/Ghini/ghini.web/public/test/qunit.js',
>>     line: 882,
>>     function: 'runLoggingCallbacks' },
>>   { file: 'file:///home/mario/Local/github/Ghini/ghini.web/public/test/qunit.js',
>>     line: 1283,
>>     function: 'pushFailure' },
>>   { file: 'file:///home/mario/Local/github/Ghini/ghini.web/public/test/qunit.js',
>>     line: 1042,
>>     function: 'run' },
>>   { file: 'file:///home/mario/Local/github/Ghini/ghini.web/public/test/qunit.js',
>>     line: 1214,
>>     function: '' },
>>   { file: 'file:///home/mario/Local/github/Ghini/ghini.web/public/test/qunit.js',
>>     line: 2271,
>>     function: 'process' },
>>   { file: 'file:///home/mario/Local/github/Ghini/ghini.web/public/test/qunit.js',
>>     line: 2254,
>>     function: 'begin' },
>>   { file: 'file:///home/mario/Local/github/Ghini/ghini.web/public/test/qunit.js',
>>     line: 2215,
>>     function: '' } ]
>> PhantomJS error:
>>  TypeError: undefined is not an object (evaluating 'QUnit.jsDump.parse')
>>  [ { file: 'phantomjs://code/bridge.js', line: 40, function: '' },
>>   { file: 'file:///home/mario/Local/github/Ghini/ghini.web/public/test/qunit.js',
>>     line: 882,
>>     function: 'runLoggingCallbacks' },
>>   { file: 'file:///home/mario/Local/github/Ghini/ghini.web/public/test/qunit.js',
>>     line: 1283,
>>     function: 'pushFailure' },
>>   { file: 'file:///home/mario/Local/github/Ghini/ghini.web/public/test/qunit.js',
>>     line: 1397,
>>     function: 'pushFailure' },
>>   { file: 'file:///home/mario/Local/github/Ghini/ghini.web/public/test/qunit.js',
>>     line: 2039,
>>     function: 'onerror' } ]

>> Running qunit.fail.timeout: undefined
>> PhantomJS timed out, possibly due to a missing QUnit start() call.
Warning: 1/1 assertions failed (0ms) Use --force to continue.

Aborted due to warnings.

I don't change anything, I just run it again, and I can do so immediately or after 10s, it makes no difference:
mario@rune:~/Local/github/Ghini/ghini.web$ grunt qunit
Running "qunit:files" (qunit) task
Testing public/test/test.html >> Running qunit.spawn: public/test/test.html
>> Running qunit.begin
>> Running qunit.moduleStart:
>> Running qunit.testStart: Object.values
.>> Running qunit.testDone: Object.values
>> Running qunit.testStart: String.formatU
.>> Running qunit.testDone: String.formatU
>> Running qunit.testStart: String.formatU-decimal_number
.>> Running qunit.testDone: String.formatU-decimal_number
>> Running qunit.testStart: parse_hash-garden
.>> Running qunit.testDone: parse_hash-garden
>> Running qunit.testStart: parse_hash-map
.>> Running qunit.testDone: parse_hash-map
>> Running qunit.testStart: parse_hash-garden-map
.>> Running qunit.testDone: parse_hash-garden-map
>> Running qunit.testStart: parse_hash-ignore
.>> Running qunit.testDone: parse_hash-ignore
>> Running qunit.testStart: shorten
.>> Running qunit.testDone: shorten
>> Running qunit.testStart: set_alternative
.>> Running qunit.testDone: set_alternative
>> Running qunit.moduleDone:
OK
>> 37 assertions passed (81ms)
>> Coverage:
>> -  Lines: 21.59%
>> -  Statements: 21.33%
>> -  Functions: 12.66%
>> -  Branches: 10.91%

Done.

the only differences with the checked in Gruntfile are the following:
diff --git a/Gruntfile.js b/Gruntfile.js
index 7c7ccc4..b38957b 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -40,4 +40,28 @@ module.exports = function(grunt) {

     // Task to run tests
     grunt.registerTask('test', 'qunit');
+    grunt.event.on('qunit.spawn', function (url) {
+        grunt.log.ok('Running qunit.spawn: ' + url);
+    });
+    grunt.event.on('qunit.fail.load', function (url) {
+        grunt.log.ok('Running qunit.fail.load: ' + url);
+    });
+    grunt.event.on('qunit.begin', function () {
+        grunt.log.ok('Running qunit.begin');
+    });
+    grunt.event.on('qunit.moduleStart', function (name) {
+        grunt.log.ok('Running qunit.moduleStart: ' + name);
+    });
+    grunt.event.on('qunit.testDone', function (name) {
+        grunt.log.ok('Running qunit.testDone: ' + name);
+    });
+    grunt.event.on('qunit.testStart', function (name) {
+        grunt.log.ok('Running qunit.testStart: ' + name);
+    });
+    grunt.event.on('qunit.moduleDone', function (name) {
+        grunt.log.ok('Running qunit.moduleDone: ' + name);
+    });
+    grunt.event.on('qunit.fail.timeout', function (url) {
+        grunt.log.ok('Running qunit.fail.timeout: ' + url);
+    });
 };

grunt-qunit-istanbul normally works as a drop-in replacement for grunt-contrib-qunit task, so no need to load grunt-contrib-qunit in your code. Plus, the config of your task are not part of this package.
Note that grunt-qunit-istanbul is not up-to-date and will not work with QUnit > 2.x, because QUnit.jsDump was removed as of 2.0.0 (See QUnit 2.x Upgrade Guide).
Another approach you can follow (in case you need test coverage) is this one used in QUnit itself: https://github.com/qunitjs/qunit/pull/1079

what do you think? much work to update grunt-qunit-instanbul to QUnit 2? I tried to do the same as in grunt-contrib-qunit/phantomjs/bridge.js (grab dump or jsDump from QUnit), but now I alternate between success and a different failure. and yes, I only need test coverage (publishing), so I might try QUnit alone, if it can do that.
mario@rune:~/Local/github/Ghini/ghini.web$ grunt qunit
Running "qunit:files" (qunit) task
Testing public/test/test.html FFFFFFFFF
>> Object.values
>> Message: Died on test #1 global code@file:///home/mario/Local/github/Ghini/ghini.web/public/test/MyJsUnitTests.js:1:11: undefined is not a function (evaluating 'Object.values(l)')
>> Actual: null
>> Expected: undefined
>> file:///home/mario/Local/github/Ghini/ghini.web/public/test/MyJsUnitTests.js:4:35

>> String.formatU
>> Message: Died on test #1 global code@file:///home/mario/Local/github/Ghini/ghini.web/public/test/MyJsUnitTests.js:9:11: undefined is not a function (evaluating '"abc.{0}-{1}".formatU([5, 6])')
>> Actual: null
>> Expected: undefined
>> file:///home/mario/Local/github/Ghini/ghini.web/public/test/MyJsUnitTests.js:10:39

>> String.formatU-decimal_number
>> Message: Died on test #1 global code@file:///home/mario/Local/github/Ghini/ghini.web/public/test/MyJsUnitTests.js:14:11: undefined is not a function (evaluating '"abc.{0}".formatU([5.1])')
>> Actual: null
>> Expected: undefined
>> file:///home/mario/Local/github/Ghini/ghini.web/public/test/MyJsUnitTests.js:15:35

>> parse_hash-garden
>> Message: Died on test #1 global code@file:///home/mario/Local/github/Ghini/ghini.web/public/test/MyJsUnitTests.js:26:11: Can't find variable: parse_hash
>> Actual: null
>> Expected: undefined
>> file:///home/mario/Local/github/Ghini/ghini.web/public/test/MyJsUnitTests.js:27:32

>> parse_hash-map
>> Message: Died on test #1 global code@file:///home/mario/Local/github/Ghini/ghini.web/public/test/MyJsUnitTests.js:31:11: Can't find variable: parse_hash
>> Actual: null
>> Expected: undefined
>> file:///home/mario/Local/github/Ghini/ghini.web/public/test/MyJsUnitTests.js:32:32

[et cetera]

Do you use any polyfill to shim Object.values(), as this method is part of ES2017 and PhantomJS doesn't support that (the current stable version 2.1.1) ?

What is a “polyfill” ? I have a definition for Object.values() in  my "cuchubo.js" file, is that it? Anyhow, this is the reason I am testing the function. once it works, the next not, once ok, next not, and so on.
Object.values = function(obj) {
    // Object.values({key: 'value'}) => ['value']
    return Object.keys(obj).map(function(key) {return obj[key];});
};

I don't think that is the point: I can make it optional as with
if (Object.values === undefined)
    Object.values = function(obj) {
        // Object.values({key: 'value'}) => ['value']
        return Object.keys(obj).map(function(key) {return obj[key];});
    };

and I still have the same alternating success failure behaviour, with Object.value as well as with all other functions I'm testing.

you know what is interesting now. I removed the “polyfill” and I got one failing test: I ran grunt qunit and I got that single failure, plus all other successes. No alternating behaviour any more. Tried a couple of times and no variation: that single one failing test. Now I fix the failing test, run grunt qunit again and indeed all tests succeed. Next time: that funny failure on all tests.

I just cloned your repo and commented out the line:
grunt.loadNpmTasks('grunt-qunit-istanbul');

and then I run grunt qunit and everything works as expected. Now, you have to take a look at the approach I linked in my comment https://github.com/gruntjs/grunt-contrib-qunit/issues/139#issuecomment-279217859 to integrate coverage.

woops, shame on me and my eyes! I had reacted to your initial comment "remove the useless grunt.loadNpmTasts" by removing the other one. :roll_eyes:

woops... this does work, but wait, you are suggesting I keep grunt-contrib-qunit, not grunt-qunit-istanbul?
I see, I was attempting the opposite way. I'll do my homework and come back if I really don't manage. thanks for your time.

Just ping me and will try to help as much as I can.

well, I have the impression that I have to copy a HUGE amount of configuration stuff from that Gruntfile into mine, something I did not need with grunt-qunit-istanbul. and it's configuration stuff I don't follow, so I would rather fix grunt-qunit-istanbul... I'll try a bit harder, and come back later.

I found a rather simple solution, still using grunt-qunit-istanbul and my Gruntfile.js.
simply mkdir temp before running grunt qunit. the directory is removed after successfully running the tests.

this solves it for me, no need to change anything else.
--- /home/mario/Local/github/Ghini/ghini.web/node_modules/grunt-qunit-istanbul/tasks/qunit.js	2017-02-12 20:09:05.122033295 -0500
+++ /tmp/qunit.js	2017-02-12 20:12:07.122035314 -0500
@@ -237,12 +237,10 @@
         // clear instrumented files folder & generate a new one
         if (options.coverage && options.coverage.instrumentedFiles) {
           if (!fs.existsSync(options.coverage.instrumentedFiles)) {
-            grunt.file.mkdir(options.coverage.instrumentedFiles);
-            options.transport.instrumentedFiles = options.coverage.instrumentedFiles;
-          } else {
-            options.transport.instrumentedFiles = fs.realpathSync(options.coverage.instrumentedFiles);
-            rimraf.sync(options.transport.instrumentedFiles);
+            fs.mkdirSync(options.coverage.instrumentedFiles);
           }
+          options.transport.instrumentedFiles = fs.realpathSync(options.coverage.instrumentedFiles);
+          rimraf.sync(options.transport.instrumentedFiles);
         }

         // write instrumented file information to an temporary file

Sorry, I really had not understood the relation between gruntjs/grunt-contrib-qunit and asciidisco/grunt-qunit-istanbul, and now that I think I got it, I would so much like that asciidisco/grunt-qunit-istanbul be merged into gruntjs/grunt-contrib-qunit.
Any chances?

Doing so will diverge from the goal of this plugin which is running QUnit tests in PhantomJS.
asciidisco/grunt-qunit-istanbul was an attempt (and it succeed) to integrate Istanbul with this plugin, but right now, that plugin is not maintained anymore.
Merging the two plugin will cause a lot of headache. We first need to merge grunt-lib-phantomjs and grunt-lib-phantomjs-istanbul, and then merging the two other ones.
This is not an easy option and there are no plans, as far as I know, to do the merge or to integrate test coverage.
tbh, I still see the solution used by QUnit core team as a proper one, this will save you a lot of time instead of just trying to sync the fork with upstream.

I still see the solution used by QUnit core team as a proper one

I get your point and I am already seeing the headache you refer to, so I hope you do agree we miss basic documentation. :books:
I come to JavaScript from other environments, I am used to reading docs, following them, understanding what I'm doing, and see things work quickly. The task at hand is so basic, isn't it? "configure test coverage and publish it on coveralls", and I'm lost in too many details of an environment I don't master. :person_fencing:
My ideal situation would be "just use one (extra) thing" and "these is the 5 lines configuration you need". :neutral_face:
Maybe other unit testing suites make it easier?

I know documentation is an important thing, but for plugins like this, we only need to document the options and nothing more.
But, I do understand your struggle. I would like to know which part we need to document and I will try to document it as soon as possible.

For coverage, there are plugin that do that: grunt-istanbul for creating and reporting coverage and grunt-coveralls for loading coverage results and submit them to Coveralls.io.
And in case you want to use another unit testing framework, you can take a look at Jasmine  (Grunt plugin and coverage template)

I'll have to close this issue. Feel free to continue the discussion, though :)

I have a nodejs application, so I have both a server and a client program, but let's simplify my use case to just testing the client code. To me, it sounds like a very good example on how to configure this tool.

very small program, registered on github as <user>/<repo>.git
all sources are in public/js/*.js
bit by bit gathering tests in test/test_*.js
publishing test results on travis-ci.org/<user>/<repo>
publishing coverage reports on coveralls.io/github/<user>/<repo>

My focus would be on having the report published on coveralls, and that this be done by travis.

oh, I'm fine with editing the docs, too, once I know what I'm missing there and what to write.

so as of now I have my unit tests nicely running , but no coverage information being collected.
mario@rune:~/Local/github/Ghini/ghini.web$ grunt test
Running "qunit:files" (qunit) task
Testing public/test/test.html .........OK
>> 9 tests completed with 0 failed, 0 skipped, and 0 todo.
>> 37 assertions (in 70ms), passed: 37, failed: 0

Done.

you said I should install grunt-istanbul and grunt-coveralls, I will see how that goes.

now I have installed them, and read and followed (but likely not completely understood) https://www.npmjs.com/package/grunt-istanbul, and my Gruntfile.js is not much more than a copy of the example.
module.exports = function(grunt) {
    // Project configuration.
    grunt.initConfig({
        qunit: {
            files: ['test/test.html'],
            options: {
                reporter: 'spec',
                '--web-security': 'no'
            }
        },
        env: {
            coverage: {
                APP_DIR_FOR_CODE_COVERAGE: '../test/coverage/instrument/public/'
            }
        },
        instrument: {
            files: 'public/js/*.js',
            options: {
                lazy: true,
                basePath: 'test/coverage/instrument/'
            }
        },
        storeCoverage: {
            options: {
                dir: 'test/coverage/reports'
            }
        },
        makeReport: {
            src: 'test/coverage/reports/**/*.json',
            options: {
                type: 'lcov',
                dir: 'test/coverage/reports',
                print: 'detail'
            }
        },
        coveralls: {
            options: { // Options relevant to all targets
                force: false
            },
            qunit: { //
                src: 'report/lcov/lcov.info', // LCOV coverage file (can be string, glob or array)
                options: { // Any options for just this target
                }
            }
        }
    });

    // Load plugins
    grunt.loadNpmTasks('grunt-contrib-qunit');
    grunt.loadNpmTasks('grunt-env');
    grunt.loadNpmTasks('grunt-istanbul');
    grunt.loadNpmTasks('grunt-coveralls');

    // Task to run tests
    grunt.registerTask('test', 'qunit');
    grunt.registerTask('coverage', ['env:coverage', 'instrument', 'test',
                                    'storeCoverage', 'makeReport']);
};

IIUC, I should be informing the test runner that the files to use are the "instrumented" ones, not the original ones, and IIUC, I should be able to do that conditionally, so that I can run grunt test and use my original files, or run grunt coverage and run the same tests on the "instrumented" ones. I do not see how to achieve this.
Even if I hard code "please just use the location of my instrumented files", I don't see much going on there. I give the command grunt coverage, then give find . -mmin -1, and nothing was generated, in particular not in test/coverage/reports.

is it so, that the focus is on node applications? not on browser-run javascript?

Now, you need to send the coverage data from the page (html) to node. To do that, you have to use a custom bridge and inject it into the page. That bridge will send a message using alert (old good times :D).
Following are some steps that will help you get your coverage:
Folder structure
First, we choose a consistent structure:
.
└── coverage/
    ├── instrumented/
    └── report/
        └── ghini/

Bridge
Suppose the file name is public/test/coverage-bridge.js:
(function(QUnit) {

  // Send messages to the parent PhantomJS process via alert! Good times!!
  function sendMessage() {
    var args = [].slice.call(arguments);
    window.alert(JSON.stringify(args));
  }

  // This will fire whenever the test suite ends
  QUnit.done(function() {

    // send coverage data if available
    if (window.__coverage__) {
      sendMessage("qunit.coverage", window.__coverage__);
    }
  });
}(QUnit));

Inject the bridge file
In your Gruntfile and more precisely your qunit task, update it to this:
var path = require("path");

module.exports = function(grunt) {
  // Project configuration.
  grunt.initConfig({
    qunit: {
      files: ['test/test.html'],
      options: {
        "--web-security": "no",

        // This will inject your custom bridge, in addition to
        // the built-in bridge, into your test page
        inject: [
          path.resolve("./public/test/coverage-bridge.js"),
          require.resolve("grunt-contrib-qunit/phantomjs/bridge")
        ]
      }
    },
    // ...
  };

  // ...
};

Listen to the event:
You can then listen to that event in your Gruntfile as follows:
grunt.event.on("qunit.coverage", function(coverage) {
  var reportPath = "coverage/report/ghini/coverage.json";

  // Create the coverage file
  grunt.file.write(reportPath, JSON.stringify(coverage));
});

Move the src file, we want to measure its coverage, around.
For that, you can use the copy task by installing grunt-contrib-copy and configure it in your Gruntfile:
module.exports = function(grunt) {
  // Project configuration.
  grunt.initConfig({
    // ...
    copy: {
      // Moves files around during coverage runs
      "original-to-tmp": {
        src: "public/js/cuchubo.js",
        dest: "public/js/cuchubo.tmp.js"
      },
      "instrumented-to-original": {
        src: "coverage/instrumented/js/cuchubo.js",
        dest: "public/js/cuchubo.js"
      },
      "tmp-to-original": {
        src: "public/js/cuchubo.tmp.js",
        dest: "public/js/cuchubo.js"
      }
    }
  };

  // Load plugins
  grunt.loadNpmTasks("grunt-contrib-copy");
  // ... other plugins
};

Coveralls and istanbul tasks:
instrument: {
  files: "public/js/*.js",
  options: {
    lazy: true,
    basePath: "coverage/instrument/"
  }
},
storeCoverage: {
  options: {
    dir: "coverage/report"
  }
},
makeReport: {
  src: "coverage/report/**/*.json",
  options: {
    type: "lcov",
    dir: "coverage/report",
    print: "detail"
  }
},
coveralls: {
  // Options relevant to all targets
  options: {
    force: false
  },
  qunit: {
    // LCOV coverage file
    src: "coverage/report/lcov.info",
  }
}

Configure tasks to run
// Task to run tests
grunt.registerTask("test", "qunit");
grunt.registerTask("coverage", [
  "env:coverage",
  "instrument",
  "original-to-tmp",
  "instrumented-to-original",
  "test",
  "tmp-to-original",
  "storeCoverage",
  "makeReport",
  "coveralls"
]);

Finally
Your Gruntfile will look like this one: Gruntfile.js
I hope these steps give you some insights on how to configure your tasks.

@mfrasca I just saw your comment https://github.com/gruntjs/grunt-contrib-qunit/issues/139#issuecomment-279696762.
The answer is the two.
You still need node to build your project and run its tests in a headless browser from your terminal without the need to run a browser (Chrome, ...) manually and test.

this brings me a lot of steps further! thanks. I have doubts though, obviously.

when you write »require.resolve("grunt-contrib-qunit/phantomjs/bridge")«, you really mean it literally, or is it »path.resolve("grunt-contrib-qunit/phantomjs/bridge")«, or »path.resolve("node_modules/grunt-contrib-qunit/phantomjs/bridge")«?
where can I read about this 'inject' thing?
I don't understand the role of this inject. here, all it does is blocking for a short while and then I get the error »PhantomJS timed out, ...«. without it, PhantomJS works, but not the rest (funny '.' problem).
where do I get 'copy'? is it part of 'grunt-contrib-qunit', or do you mean 'grunt-copy'? I grabbed the latter, but it complains it is pinned to an older version of grunt.
the copy actions seem to add a trailing line with a single '.' (dot) to my javascript files. obviously the tests fail because of a syntax error.
where we have , the name of a copy operation, we really want 'copy:', isn't it.
when a test fails, how do I make sure the 'copy:restore-origs' is performed anyway?

p.s.: this is the Gruntfile.js, edited.
Is it really common practice?, to use 2ch indents? I always had 4.

ok, I see,

I had to grab grunt-contrib-copy, not grunt-copy, which adds this silly trailing line after copying the file.
also, you really meant what you wrote: inject: [path.resolve("test/coverage-bridge.js"), require.resolve("grunt-contrib-qunit/phantomjs/bridge")],
I now have a json file in the coverage reports, so I guess I should now be almost there.

I still wonder how to make sure a failing test will not break my files... or do I first run the tests before running them with coverage. so if they fail it will stop on the first run, before starting shuffling them around.

really almost there.
Running "coveralls:qunit" (coveralls) task

we did not need the storeCoverage task, because this is already done by the qunit.coverage callback,
coveralls needs the report generated by makeReport,

the problems now are possibly not any more tied to grunt or qunit. and I am looking forward to contributing some documentation for your program. ... :100:

ok, works, now down to describing it for others (and for forgetful myself).
you'll see a pull request soon, I hope, and I hope you will find it useful.

Sorry for not responding soon, I was a little busy.
I see, you're almost there :+1:
I'll try to answer some of your questions.

Is it really common practice?, to use 2ch indents? I always had 4.

Nope, I just used to that style.

when you write »require.resolve("grunt-contrib-qunit/phantomjs/bridge")«, you really mean it literally, or is it »path.resolve("grunt-contrib-qunit/phantomjs/bridge")«, or »path.resolve("node_modules/grunt-contrib-qunit/phantomjs/bridge")«?

require.resolve("grunt-contrib-qunit/phantomjs/bridge") and path.resolve("node_modules/grunt-contrib-qunit/phantomjs/bridge.js") (notice the .js extension) are the same in your case where node_modules and Gruntfile are in the same directory. But in case you don't have a clue in where the modules grunt-contrib-qunit is installed, you have to use require.resolve("grunt-contrib-qunit/phantomjs/bridge") which will return the full filepath of the bridge file.

I had to grab grunt-contrib-copy, not grunt-copy, which adds this silly trailing line after copying the file. (you had written the correct name, I missed it).

Yep, that's it.

also, you really meant what you wrote: inject: [path.resolve("test/coverage-bridge.js"), require.resolve("grunt-contrib-qunit/phantomjs/bridge")], (but I don't see much relationship with its documentation)

That documentation should be updated to be the same as grunt-lib-phantomjs#inject. I forgot to update it when updating the linked one.

we did not need the storeCoverage task, because this is already done by the qunit.coverage callback,

Ahh, yes.

I still wonder how to make sure a failing test will not break my files... or do I first run the tests before running them with coverage. so if they fail it will stop on the first run, before starting shuffling them around.

I'll take a look.


[Minor autocomplete bug?] Clang declspec properties are lower priority

clangd is able to recognize correctly that a property exists and is valid. However, when trying to autocomplete, it is treated as what I would call a "3rd class citizen" option that is usually resorted to VS Code's least likely useful autocomplete entry.
My suggestion is specifically: Treat it similar to how C# treats properties prioritization.
C++:

C#:

System information
Clangd version (from the log, or clangd --version):
clangd extension version: 16.0.2
Operating system: Windows 10 VS Code 1.82.2 Stable

(Moved to server repo as this is a server-side issue independent of the vscode client)

Interesting, because in my clueless digging I found some (but also not many) cases of properties being handled. Example:
https://github.com/llvm/llvm-project/blob/e1a5bb59b91d60c0d87feb78f0e0614589a4c927/clang-tools-extra/clangd/Quality.cpp#L131-L133
However, this may be specific to Obj-C properties, which are tested here: https://github.com/llvm/llvm-project/blob/e1a5bb59b91d60c0d87feb78f0e0614589a4c927/clang-tools-extra/clangd/unittests/HoverTests.cpp#L2921
I couldn't do much on my own to try PR a solution, hopefully someone else can. 👍

Yeah, it looks like the ObjC feature and this language extension use two distinct AST node types (ObjCPropertyDecl vs. MSPropertyDecl). Support for ObjCPropertyDecl has been contributed over time (I think by an Apple engineer), but I don't think anyone has worked on MSPropertyDecl.


docs fix and complete agg functions docs

Proposed changes
Issue Number: close #xxx

Further comments
If this is a relatively large or complex change, kick off the discussion at<EMAIL_ADDRESS>by explaining why you chose the solution you did and what alternatives you considered, etc...

run buildall


feat: Action redesign: Updating the config for MongoDB plugin to use sections and zones format

Description
Action redesign: Updating the config for MongoDB plugin to use sections and zones format
Fixes #35495
Automation
/ok-to-test<EMAIL_ADDRESS>:mag: Cypress test results

[!CAUTION]
🔴 🔴 🔴 Some tests have failed.
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10632073579
Commit: 80e4f91ea714bc1f241ba8d7bfdd34d555d40306
Cypress dashboard.
Tags: @tag.All
Spec:
The following are new failures, please fix them before merging the PR:
cypress/e2e/Regression/ClientSide/Linting/BasicLint_spec.ts
cypress/e2e/Regression/ClientSide/OneClickBinding/PropertyControl_spec.ts
List of identified flaky tests.
Fri, 30 Aug 2024 12:48:31 UTC

Communication
Should the DevRel and Marketing teams inform users about this change?

[ ] Yes
[ ] No

Summary by CodeRabbit
Summary by CodeRabbit

New Features

Enhanced styling capabilities for dynamic input text controls with a new CSS class.
Improved responsiveness of UI elements by removing fixed dimensions for dynamic input text controls.
Revamped MongoDB plugin editor with a more versatile layout and expanded command options, including enhanced commands for querying and additional input fields for better interactivity.

Bug Fixes

Adjusted visibility conditions for input fields based on selected commands to improve user experience.

/build-deploy-preview skip-tests=true

/build-deploy-preview skip-tests=true

/build-deploy-preview skip-tests=true


Grab deployment that is actively deployed

Checklist

[x] Appropriate branch selected (all PRs must first be merged to dev before they can be merged to master)
[x] Any modified or new methods or classes have helpful JSDoc and code is thoroughly commented
[x] The description lists all applicable issues this PR seeks to resolve
[x] The description lists any configuration setting(s) that differ from the default settings
[x] All tests and CI builds passing

Description
Fix #665 by isolating the feed version that is actively deployed. Previously, there could be multiple deployments for that feed version and one which was not active was interfering.

Codecov Report

Merging #666 (ffeaee8) into dev (4cf3c4c) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##              dev     #666      +/-   ##
==========================================
- Coverage   15.68%   15.67%   -0.01%
==========================================
  Files         329      329
  Lines       16797    16799       +2
  Branches     5062     5064       +2
==========================================
  Hits         2634     2634
- Misses      12113    12115       +2
  Partials     2050     2050

Flag
Coverage Δ

unit_tests
15.67% <0.00%> (-0.01%)
:arrow_down:

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

Impacted Files
Coverage Δ

...manager/components/version/FeedVersionNavigator.js
0.00% <0.00%> (ø)

Continue to review full report at Codecov.

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


images/builder: update proto dependencies

See commits for details.

Marking as ready to merge given there is no functional changes in the generated code.


Call 'docker push' correctly while pushing images

Presently tests are failing due to the following error:
/dev/stdin: line 578: push: command not found

The changes were merged in #73 yesterday have a typo:  In file .kokoro/psm_interop_kokoro_lib.sh, line 1141, psm::tools::run_verbose push "${image_name}:${to_tag}" should be psm::tools::run_verbose docker push "${image_name}:${to_tag}".

@arjan-bal could you link the failing test in description?

@purnesh42H Example:  https://source.cloud.google.com/results/invocations/9c8a8e9b-61bd-44f3-91d2-04d538c3b3a8

/easycla

EasyCLA doesn't seem to work, but @gnossen has confirmed this manually:


Update kinesis, utils to 2.16.104

Updates

software.amazon.awssdk:kinesis
software.amazon.awssdk:utils

from 2.16.18 to 2.16.104.
I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.
Configure Scala Steward for your repository with a .scala-steward.conf file.
Have a fantastic day writing Scala!

Adjust future updates
Add this to your .scala-steward.conf file to ignore future updates of this dependency:
updates.ignore = [ { groupId = "software.amazon.awssdk" } ]

Or, add this to slow down future updates of this dependency:
dependencyOverrides = [{
  pullRequests = { frequency = "@monthly" },
  dependency = { groupId = "software.amazon.awssdk" }
}]

labels: library-update, early-semver-patch, semver-spec-patch, commit-count:1

Codecov Report
Base: 88.63% // Head: 88.63% // No change to project coverage :thumbsup:

Coverage data is based on head (10980d8) compared to base (1577788).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #391   +/-   ##
=======================================
  Coverage   88.63%   88.63%
=======================================
  Files          93       93
  Lines        3001     3001
  Branches      170      170
=======================================
  Hits         2660     2660
  Misses        341      341

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.


Doesn't recompile if including a gem that has assets

What happened?

What were you attempting to do?
I was adding Rails Admin to my existing application.

What did you expect to happen?
I expected the app to recompile the assets that are now included with the addition of Rails Admin.

What was the actual behavior? Please provide log output, if possible.
The app reused the cache, and then my app crashed when I navigated to the Rails Admin dashboard once the built container started.

Build Configuration

What platform (pack, kpack, tekton buildpacks plugin, etc.) are you
using? Please include a version.
pack 0.20.0+git-66a4f32.build-2668

What buildpacks are you using? Please include versions.

paketo-buildpacks/ca-certificates 2.3.2
paketo-buildpacks/mri             0.2.4
paketo-buildpacks/bundler         0.1.8
paketo-buildpacks/bundle-install  0.2.3
paketo-buildpacks/node-engine     0.6.2
paketo-buildpacks/yarn            0.4.0
paketo-buildpacks/yarn-install    0.4.0
paketo-buildpacks/rails-assets    0.2.3
paketo-buildpacks/puma            0.0.60

What builder are you using? If custom, can you provide the output from pack inspect-builder <builder>?

full: Pulling from paketobuildpacks/builder
Digest: sha256:7a005cbd13254a3b85c75526802212d41348e4521faab26f5d2adf3565f859bf
Status: Image is up to date for paketobuildpacks/builder:full
full-cnb: Pulling from paketobuildpacks/run
Digest: sha256:fac2ca83109101e0d1dd8c26707f5f58e05ccf52b2c42db95e25bda86b9887b2
Status: Image is up to date for paketobuildpacks/run:full-cnb

Can you provide a sample app or relevant configuration (buildpack.yml,
nginx.conf, etc.)?

Build a basic Rails app.
pack build the app and see it succeed and run successfully.
Add the rails_admin gem to your Gemfile and install
Follow the directions to configure Rails Admin: https://github.com/sferik/rails_admin/wiki/Base-configuration
pack build the app and see it build successfully (assets should be reused from the cache)
Start the app and navigate to the admin page.
See the app crash with an error saying that it cannot find some required assets.

Checklist

[ ] I have included log output.
[ ] The log output includes an error message.
[x] I have included steps for reproduction.

Hey @ryanmoran, this issue has been open for a while. Are you still seeing this problem?


Add experimental feature flag to dashboard assistant

Description
Documentation for new feature flag to enable experimental features like text to visualization or other contextual assistant features.
Issues Resolved
Closes https://github.com/opensearch-project/documentation-website/issues/7856
Version
2.16
Checklist

[x] By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and subject to the Developers Certificate of Origin.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Thank you, @songkant-aws! Do you want to list out the available experimental features here?

For now, we only rolled out text to visualization feature. Once other features are ready, we can iterate the list.


Parsing of cmake-kits.json fails regularly

Brief Issue Summary
Quite often I get the error message [kit] Failed to parse cmake-kits.json: {1} when changing the cmake-kits.json file. After saving the file a few times (without modifications) parsing will succeed.
Sometimes this also seems to happen on start of VSCode.
Expected:
Consistent behavior if cmake-kits.json does not change. In the example below I'd expect the parsing of the file to succeed all the time.
CMake Tools Log
Log from saving a few times, cmake.loggingLevel is at trace.
[kit] Reading kits file c:\work\git\poquid\.vscode\cmake-kits.json
[kit] Failed to parse cmake-kits.json: {1}
[kit] Reading kits file c:\work\git\poquid\.vscode\cmake-kits.json
[kit] Failed to parse cmake-kits.json: {1}
[kit] Reading kits file c:\work\git\poquid\.vscode\cmake-kits.json
[kit] Successfully loaded 2 kits from c:\work\git\poquid\.vscode\cmake-kits.json
[kit] Reading kits file c:\work\git\poquid\.vscode\cmake-kits.json
[kit] Successfully loaded 2 kits from c:\work\git\poquid\.vscode\cmake-kits.json

Platform and Versions

Operating System: Windows 10
CMake Version: 3.15.1
VSCode Version: 1.45.0-insider
CMake Tools Extension Version: 1.3.1
Compiler/Toolchain: Keil ARMClang & Keil ARMCC with custom toolchain file

Other Notes/Information
cmake-kits.json being used (with minor modifications to my productive one, but the same issue can be observed here):
[
  {
    "name": "Keil armclang Chip1",
    "toolchainFile": "C:/work/git/cmake-keil/toolchain-keil-armclang.cmake",
    "cmakeSettings": {
      "TOOLCHAIN_PATH": "C:/ToolsRep",
      "DERIVATIVE": "Chip1",
      "LIB_PATH": "../lib"
    }
  },
  {
    "name": "Keil armcc Chip1",
    "toolchainFile": "C:/work/git/cmake-keil/toolchain-keil-armcc.cmake",
    "cmakeSettings": {
      "TOOLCHAIN_PATH": "C:/ToolsRep",
      "DERIVATIVE": "Chip1",
      "LIB_PATH": "../lib"
    }
  }
]

I know that the provided log is most likely quite insufficient to debug the issue. If there is any way I can provide additional information I'd be happy to do so.

I can't reproduce this. Thinking of what else could be different and of what other info from your might help us find the root cause.

This actually happens to multiple people in my organization, so your guess regarding environment might be correct. I just can't think of what this would be...

Not giving up :).
Is the same happening if you remove the custom kits you have defined in the json file?
I found this similar issue https://stackoverflow.com/questions/59030041/json-parse-gives-error-occasionally-on-parsing-string, but you have no escaping in the snippet you shared. Are those two the only custom kits you define?
I'm still thinking of what else we can do and another idea comes to mind to help us find the root cause. Add some logging related to all it's happening before parsing the json. If it's too inconvenient for you to make your own CMake Tools for this test we can provide a vsix. But I'm thinking now on what to log and where, I'll get back to you.
In the mean time, how is parsing going without your custom kits.

Just checked with an empty array in the file:
[
]

This also fails regularly when parsing.
[kit] Failed to parse cmake-kits.json: {1}
[kit] Failed to parse cmake-kits.json: {1}
[kit] Failed to parse cmake-kits.json: {1}
[kit] Failed to parse cmake-kits.json: {1}
[kit] Failed to parse cmake-kits.json: {1}
[kit] Successfully loaded 0 kits from c:\work\git\poquid\.vscode\cmake-kits.json

It should not be a problem to run build my own CMake Tools, but I won't have time during company time ATM, so earliest during the weekend.

Ok we are going to, brainstorm more about this.

When you have a chance, if you say it's no problem to experiment with CMake Tools yourself, you can modify in src\kits.ts, readKitsFile the line with "failed.to.parse", like this:
log.error(localize('failed.to.parse', 'Failed to parse {0}: {1} : {2}', "cmake-kits.json", e.message, e.stack));
Send us back the output of that.
And I don't know why the code as is now prints {1} for the exception, we'll make sure that will be printing something useful in future.

@andreeis I'll do so, we have a public holiday on Friday anyways...

@andreeis Here the stacktrace that you asked me for:
[kit] Failed to parse cmake-kits.json: Unexpected EOF at line 1 column 2 of the JSON5 data. Still to read: "" : SyntaxError: Unexpected EOF at line 1 column 2 of the JSON5 data. Still to read: ""
  at error (c:\work\git\vscode-cmake-tools\dist\main.js:38451:25)
  at word (c:\work\git\vscode-cmake-tools\dist\main.js:38788:13)
  at value (c:\work\git\vscode-cmake-tools\dist\main.js:38888:56)
  at Object.parse (c:\work\git\vscode-cmake-tools\dist\main.js:38903:18)
  at Object.readKitsFile (c:\work\git\vscode-cmake-tools\dist\main.js:61774:26)
  at async KitsController.readKits (c:\work\git\vscode-cmake-tools\dist\main.js:61947:31)

It weirdly seems that it's much harder to recreate the problem in the much slower running extension development host, but that is just a feeling, no hard data. The cmake-kits.json that I used was the one from the initial bugreport.
PS: In addition to the steps on the 'How to contribute' page of the help I had to do a npm install yarn, you might want to add that.

Still no idea. I am seeing various other complains about json failing to parse occasionally but so far nothing that would help me with ideas for your scenario.
Can you try to temporarily get rid of your local .vscode/cmake-kits.json and move its content to the user level one? Wondering if this happens for the main central kits file.
Another thing you can do if it's not too inconvenient is to create or point us to a small standalone repro.

I did some additional checking, and it seems that the issue occurs during reading of the file, not the parsing. I added an additional output in the error case to dump the read file content:
...
} catch (e) {
  log.error(localize('failed.to.parse', 'Failed to parse {0}: {1} : {2}', "cmake-kits.json", e.message, e.stack));
  log.error(content_str)
  return [];
}
...

Testing with a cmake-kits.json just containing [] I can see that the content_str is empty.
[kit] Failed to parse cmake-kits.json: Unexpected EOF at line 1 column 2 of the JSON5 data. Still to read: "" : SyntaxError: Unexpected EOF at line 1 column 2 of the JSON5 data. Still to read: ""
  at error (c:\work\git\vscode-cmake-tools\dist\main.js:38451:25)
  at word (c:\work\git\vscode-cmake-tools\dist\main.js:38788:13)
  at value (c:\work\git\vscode-cmake-tools\dist\main.js:38888:56)
  at Object.parse (c:\work\git\vscode-cmake-tools\dist\main.js:38903:18)
  at Object.readKitsFile (c:\work\git\vscode-cmake-tools\dist\main.js:61774:26)
  at async KitsController.readKits (c:\work\git\vscode-cmake-tools\dist\main.js:61948:31)
[kit]

I've not seen a case where only part of the file was read, always either all or nothing.
Just a wild guess: could it be that it's reading the file in a state where the new content was not yet written? (assuming the write is not atomic)
cmake-kits.json vs user level cmake-tools-kits.json:
The issue occurs for the user-level file as well, it seems to be more infrequent though.
Repro
I'd be happy to provide a repository, but after the check of the user-level file I'm not sure that would help... I can reproduce the issue by opening a new workspace and placing a .vscode/cmake-kits.json file containing [] into it. Then I just repeatedly save the file. If you think it help I'd not have a problem generating that. Or just save the user-level kits file repeatedly.

Thanks, that is a good idea for our investigation. No need for any additional information.

Maybe useful: I'm more and more guessing that this is a problem with our virus scanner. (MS Defender) - I'm trying to get in touch with our IT to check if we can disable it for purposes of checking if that really is the reason.
I can pretty much get around the issue by inserting a sleep for 100 milliseconds before reading the file. (Interestingly I then get the log message for successful parsing 2-3 times).

I have encountered a similar issue.
Platform:

Operating system: Windows 10
VSCode version: 1.48.0-insider
Node version: 12.13.0
CMakeTools version: 1.4.1
Also happens in vscode version 1.47.1

Same symptoms and steps to reproduce as above. Error appears to be caused by the file being read as empty (checked by logging read file content). Setting a small delay (5-20ms) before reading the file seems to fix the issue.

same issue here, deactivating Windows Defender does not help. (Working on a M2 SSD)


2020.26/ENG-5349 - fix accessibility issues

Why?

Reading all items of the list on entering.
Not reading the first item.
Not announcing the currently selected item.
When typing characters, it announces the character twice.
When the results of the search do not match the keywords, the reader won’t announce the “Sorry, we couldn’t find any position type by that name”.
When selecting a unit using the enter key or tab key, the reader won’t announce the unit selected.

it looks like :shipit:

it looks like :shipit:


Swift compiler error xCode 9.0 beta

This issue has been fixed on master branch in a backwards compatible way.
Will add to next cocoapod release over the weekend with this and other fixes.
:)

Thanks


compiler crash on nested templates

Attempting to compile/parse nested templates crashes cython.  For example:
cdef extern from "test.h":

    cdef cppclass bar[       pass

    cdef cppclass foo[T](T]:
):
        pass

foo[bar[int]]()

Compiling the last line there causes cython to crash with traceback

Traceback (most recent call last):
  File "/home/hoytak/sysroot/bin/cython", line 8, in <module>
    main(command_line = 1)
  File "/home/hoytak/sysroot/lib/python2.6/site-packages/Cython/Compiler/Main.py", line 814, in main
    result = compile(sources, options)
  File "/home/hoytak/sysroot/lib/python2.6/site-packages/Cython/Compiler/Main.py", line 789, in compile
    return compile_multiple(source, options)
  File "/home/hoytak/sysroot/lib/python2.6/site-packages/Cython/Compiler/Main.py", line 761, in compile_multiple
    result = run_pipeline(source, options)
  File "/home/hoytak/sysroot/lib/python2.6/site-packages/Cython/Compiler/Main.py", line 625, in run_pipeline
    err, enddata = context.run_pipeline(pipeline, source)
  File "/home/hoytak/sysroot/lib/python2.6/site-packages/Cython/Compiler/Main.py", line 244, in run_pipeline
    data = phase(data)
  File "Visitor.py", line 272, in Cython.Compiler.Visitor.CythonTransform.__call__ (Cython/Compiler/Visitor.c:4940)
  File "Visitor.py", line 255, in Cython.Compiler.Visitor.VisitorTransform.__call__ (Cython/Compiler/Visitor.c:4700)
  File "Visitor.py", line 163, in Cython.Compiler.Visitor.TreeVisitor._visit (Cython/Compiler/Visitor.c:3258)
  File "/home/hoytak/sysroot/lib/python2.6/site-packages/Cython/Compiler/ParseTreeTransforms.py", line 1271, in visit_ModuleNode
    node.body.analyse_expressions(node.scope)
  File "/home/hoytak/sysroot/lib/python2.6/site-packages/Cython/Compiler/Nodes.py", line 351, in analyse_expressions
    stat.analyse_expressions(env)
  File "/home/hoytak/sysroot/lib/python2.6/site-packages/Cython/Compiler/Nodes.py", line 3368, in analyse_expressions
    self.expr.analyse_expressions(env)
  File "/home/hoytak/sysroot/lib/python2.6/site-packages/Cython/Compiler/ExprNodes.py", line 322, in analyse_expressions
    self.analyse_types(env)
  File "/home/hoytak/sysroot/lib/python2.6/site-packages/Cython/Compiler/ExprNodes.py", line 2888, in analyse_types
    if self.analyse_as_type_constructor(env):
  File "/home/hoytak/sysroot/lib/python2.6/site-packages/Cython/Compiler/ExprNodes.py", line 2797, in analyse_as_type_constructor
    self.function = RawCNameExprNode(self.function.pos, constructor.type)
AttributeError: 'NoneType' object has no attribute 'type'

Thanks!
Migrated from http://trac.cython.org/ticket/666

@scoder this does not occur on 3.0.0a10 anymore


ValueError: read of closed file

If I try to save a file more than once on the server I get this Error message:
ValueError: read of closed file

This appears to be happening due to the FileUpload.files list containing duplicated sets of the files being uploaded

This fails as the state gets stale, especially with exceptions


Add version: VividDesigns.WifiMouseServer version 1.1

Pull request has been created with WinGet Automation :rocket:
Microsoft Reviewers: codeflow:open?pullrequest=https://github.com/microsoft/winget-pkgs/pull/116794&drop=dogfoodAlpha

Reset PR


Simplify tests

Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.90%. Comparing base (c8a5339) to head (df50220).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1089   +/-   ##
=======================================
  Coverage   94.90%   94.90%
=======================================
  Files         102      102
  Lines       10197    10197
=======================================
  Hits         9677     9677
  Misses        365      365
  Partials      155      155

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


Notes on client values and what they're expected to be

It's meant to be prettier to look at too, for easier consumption. Do take a look at the file itself to see how it really looks before hating it. Feel free to hate it after that.

Fixes #243


GlycoEnzDB website is not working.

GlycoEnzDB(https://virtualglycome.org/GlycoEnzDB) your team maintained is not working now.
When I accessed the website, it was return 502 status error.
How could I solve this problem?

We have reset the tomcat server. Thank you very much for bringing this out attention!


IP-23704-Added timeout for hung aws sqs long poll

https://tickets.intelliflo.com/browse/IP-23704
Manual merge of this error handling code from the master branch to the iflo_nuget branch around the ReceiveMessageAsync call.
This should complete or fail within it's 20 seconds configured wait time, but in the event network outage this does not complete and hang indefinitely so a 30 second timeout around it is required so this condition can identified and not hang the polling thread so when the network comes back the polling continues.

@akelly-intelliflo can you please add a link to where this code has been taken from please.
Looks good otherwise, rebase and merge.

@dariusdamalakas  Added the link, should help when the branch gets updated to latest

@akelly-intelliflo  build has failed https://dev-teamcity.intelliflo.com/viewLog.html?buildId=125872&tab=buildResultsDiv&buildTypeId=IntelliFloNuget_JustSayingIflo_Master

MSBuild <IP_ADDRESS> is still there: https://www.nuget.org/packages/MSBuildTasks/<IP_ADDRESS> i

TC passed:
  | #1.0.161 | Tests passed: 158, ignored: 3
merging

| #1.0.162 -- | --


wireguard-vanity-keygen: 0.1.0 -> 0.1.1

Automatic update generated by nixpkgs-update tools. This update was made based on information from https://github.com/axllent/wireguard-vanity-keygen/releases.
meta.description for wireguard-vanity-keygen is: WireGuard vanity key generator
meta.homepage for wireguard-vanity-keygen is: https://github.com/axllent/wireguard-vanity-keygen
meta.changelog for wireguard-vanity-keygen is: https://github.com/axllent/wireguard-vanity-keygen/blob/develop/CHANGELOG.md#011
Updates performed

Golang update

To inspect upstream changes

Release on GitHub

Compare changes on GitHub

Impact
Checks done

built on NixOS
The tests defined in passthru.tests, if any, passed
found 0.1.1 with grep in /nix/store/28xzxyf6ksghyx6j2b4x8xdjadqjfacx-wireguard-vanity-keygen-0.1.1
found 0.1.1 in filename of file in /nix/store/28xzxyf6ksghyx6j2b4x8xdjadqjfacx-wireguard-vanity-keygen-0.1.1

Rebuild report (if merged into master) (click to expand)

2 total rebuild path(s)

2 package rebuild(s)

First fifty rebuilds by attrpath

wireguard-vanity-keygen

Instructions to test this update (click to expand)

Either download from the cache:
nix-store -r /nix/store/28xzxyf6ksghyx6j2b4x8xdjadqjfacx-wireguard-vanity-keygen-0.1.1 \
  --option binary-caches 'https://cache.nixos.org/ https://nixpkgs-update-cache.nix-community.org/' \
  --option trusted-public-keys '
  nixpkgs-update-cache.nix-community.org-1:U8d6wiQecHUPJFSqHN9GSSmNkmdiFW7GW7WNAnHW0SM=
  cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
  '

(The nixpkgs-update cache is only trusted for this store-path realization.)
For the cached download to work, your user must be in the trusted-users list or you can use sudo since root is effectively trusted.
Or, build yourself:
nix-build -A wireguard-vanity-keygen https://github.com/r-ryantm/nixpkgs/archive/6c736be0a1b37863623bd3166cb5e10d6c442880.tar.gz

Or:
nix build github:r-ryantm/nixpkgs/6c736be0a1b37863623bd3166cb5e10d6c442880#wireguard-vanity-keygen

After you've downloaded or built it, look at the files and if there are any, run the binaries:
ls -la /nix/store/28xzxyf6ksghyx6j2b4x8xdjadqjfacx-wireguard-vanity-keygen-0.1.1
ls -la /nix/store/28xzxyf6ksghyx6j2b4x8xdjadqjfacx-wireguard-vanity-keygen-0.1.1/bin

Pre-merge build results
We have automatically built all packages that will get rebuilt due to
this change.
This gives evidence on whether the upgrade will break dependent packages.
Note sometimes packages show up as failed to build independent of the
change, simply because they are already broken on the target branch.
nixpkgs-review result
Generated using nixpkgs-review.
Command: nixpkgs-review

x86_64-linux

:white_check_mark: 1 package built:

wireguard-vanity-keygen

Maintainer pings
cc @arikgrahl for testing.

[!TIP]
As a maintainer, if your package is located under pkgs/by-name/*, you can comment @NixOS/nixpkgs-merge-bot merge to automatically merge this update using the nixpkgs-merge-bot.

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

@NixOS/nixpkgs-merge-bot merge


I can't run it

I have installed all the requeriments, but when i try to run, i get that error

It should work.....this seems to be your own system issue.
Have you installed discord.py for python3?
Also, its recommended running in a virtual environment better in a containerized manner


fail a package that includes font_size in it's preferences

There was recently a discussion on Discord whereby someone was unable to change the font size on specific syntaxes. It initially seemed related to https://github.com/SublimeTextIssues/Core/issues/1551, but it turned out that the package contained a syntax specific settings file with font_size declared. As Sublime Text's Preferences menu -> Settings - Syntax Specific opens the Default preferences and the User syntax specific preferences side by side, it wasn't easy to find that the package declared font_size in it's syntax specific preferences without looking at the package directly.
I propose that packages which set font_size in their preferences should fail the review.
Maybe it'd be a good idea to also have a warning if syntax specific preferences are used, for the human reviewer to check if the readme contains some tips relating to it, to avoid similar problems with other "hidden" preferences.

As a note to myself (and others): there should be other settings that should never be modified.


Exceptions are not logged when running in distributed mode

Describe the bug
When running Locust in a distributed master-worker mode, exceptions are logged in the worker node but do not show up in the Locust "Exceptions" UI section.
Expected behavior
The Locust "Exceptions" tab should show the same traceback as the worker log.
Actual behavior

Steps to reproduce
The master and worker are running from the latest Locust Docker image "locustio/locust", as two containers started with Docker Compose.  The locustfile.py is copied below.
Environment

OS: Fedora 34

Python version: 3.8.11

Locust version: 2.0.0b3

Locust command line that you ran:
Master options: --master -H http://master:8089
Worker options:  --worker --master-host master --loglevel WARNING

Locust file contents (anonymized if necessary):

from locust import HttpUser, task

class QuickstartUser(HttpUser):
    @task
    def run(self):
        raise Exception('asdf')

Does it work in pre-2.0 versions by any chance?

Does this work in 1.6?

@cyberw Thanks for the quick reply
I've just tried with the v1.6.0 Docker image but the problem persists, the exception is not logged in the web UI.

Ok! Then this is more of a feature request, as it has probably never worked. I think this would be moderately hard to do (especially since we dont want to send tons of traffic from master to slave in case it happens a lot). But we should at least show that it doesnt work (a message on that page when running distributet)

Oh I see!  Hm I'm not sure how to change this thread a feature request, but if possible please change the label

It doesnt matter, I just wanted to know if it was a regression or not :)


Add audio search to homepage

Fixes

Fixes #271 by @zackkrida
Pending design review by @panchovm
Description
Adds a SearchTypeToggle component that implements an accessible radio group using two buttons to toggle the selected search type. Then we display this on the home page if enableAudio is true and redirect to the appropriate search endpoint based on the selected search type.
Testing Instructions
Checkout this PR and run npm run dev. Verify that the homepage search works when enableAudio is false. Verify that it also works when it is true and that you can select a search type.

Checklist

[x] My pull request has a descriptive title (not a vague title like Update index.md).
[x] My pull request targets the default branch of the repository (main) or a parent feature branch.
[x] My commit messages follow best practices.
[x] My code follows the established code style of the repository.
[x] I added or updated tests for the changes I made (if applicable).
[ ] I added or updated documentation (if applicable).
[x] I tried running the project locally and verified that there are no visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@panchovm no rush here, but we could use some feedback or a quick mockup on how to make this look better for launch. I'm going to merge this because audio is turned off in production anyway.


SAK-32268 - Delegated Access needs date picker update

@josecebe please rebase this PR to keep it updated.
Thanks.

Done @mpellicer


I believe this fixes toc for command reference

I opened issue #10487 and I think this fixes it

@KathrynEE Could you review this pull request?
Thanks.

@ktoliver - I'm closing this PR. There were more broken links that needed fixing. I'm working on them in https://github.com/MicrosoftDocs/azure-devops-docs-pr/pull/3036.


Saved changes does not get applied in "Results" nor "Editor" view.

open existing query which is saved in "My queries" in "Editor" view
open "..." > "Edit query wiql"
edit query displayed as text (no error shown)
"Save query" button appears active > click it > two issues in console:

close wiql editor with "x"
no change in my query present (even if I force reload), also the modification will not be present if I open the wiql editor again

thanks, Jan

if anyone struggles with this like I do, here is a workaround:
"Wiql Playground" > build query > "Open in queries"

+1, frustrating that such a simple workflow fails with no indication of what's happened. I can't even find my saved query...


Entries only import a single item then fails

I am running the latest version of Import, I have mapped all the fields correctly and I am trying to replace the data. Here is what I get in the logs: Encountered an error running task 4 (Import), step 1 of 216: An exception was thrown: Property "Craft\Import_EntriesRecord.versionId" is not defined. Only the first line imports and then it fails.

What license of Craft are you using?

Ahh its just on a local install using craft.dev but with a Pro trial.

Is it possible to use Import without buying a Craft licence?

Could you try re-installing the plugin?

Hi Bob, tried that and I am still getting the same issue.

I had the same error. "solved" by uncommenting line 242 of Import_EntryService.php:
// Log element id's when successful
// craft()->import_history->version($settings['history'], $element->id);

Hi Gareth, did you click uninstall and then install again?

Hi Bob, trying that gives me the following error:

Using @jkenters solution worked for me though, everything imports when that line is commented out.

Sorry for the late response. Is this bug still actual?

I haven't done anything with it since my last comment so I guess so.

I get this error as well.
Import 0.8.32


styles: Allow camera view to see pointer events

Without this, hovering over the camera view doesn't show the user controls such as volume control / popout. The controls only come up when hovering over the player-name element, but moving the mouse to try to use the controls immediately hides them.

Thanks


Migrate UI to Bootstrap 4

Bootstrap 4 is out and we should probably plan to go for it.

Also plan to move to Font Awesome 5 in the way.


Recommend pipe fail option on GitHub actions uv install?

I'd be happy to open a PR to update the docs, but it wasn't clear to me just yet if this should be recommended.
I set up a github workflow in my company's local github enterprise install with the following step taken from the docs:
 - name: Set up uv
   # Install latest uv version using the installer
   run: curl -LsSf https://astral.sh/uv/install.sh | sh

However, what I found was if the curl command fails this step can still succeed, this can happen because of either curl not being available, some network issue, or something else. I ended up replacing this step with:
  - name: Set up uv
    shell: bash
    run: | # Install latest uv version using the installer
      set -o pipefail
      curl -LsSf https://astral.sh/uv/install.sh | sh

So if the curl command fails it produces an error.
Do you think the docs should be updated in general? Or do you think this is enough of an edge case not to make the instructions overly complicated?

I also encountered this issue while building from the Dockerfile. When running the command RUN curl -LsSf https://astral.sh/uv/install.sh | sh, it failed. However, the next build skips this layer.

Yeah we should set pipefail, PR welcome.
@pplmx I'd highly recommend copying from our Docker image instead of using curl to install (this is covered in the docs too)


cgea1.2, cgea1.3 button handler added

Coverage remained the same at ?% when pulling 4abb6a4a7af3b770b3f65551b5ff593a3180e823 on button_fix into 4ed6baee80d4ac0b2bde564af16a0b9a9e35e5cc on next.


[ES] Translation of concurrency lesson

@erickgnavar @setzer777 It would be great if you can proof read it. Thanks in advance!

 :)

Thank you so much @aleandros, you're killing it 👍

@setzer777 were you able to review these changes?

Thank you @aleandros, sorry for the delays!  If there's any feedback the other translators have they can submit a new PR 😀


New branch focussing on using in-place memory operations where possible?

Hey Gio/Sten,
Thanks for writing this, it explains a lot to me that the four lines of maths-code in the SPIN paper did not.
However, I noticed that a lot, if not all, of the matrix operations in the code produce new matrices that are only used once. That is wasteful, especially if the operations are simple enough to be memory bound (multiplication, addition). The effect is also stronger the bigger the matrix used, which I guess is true for the new dataset.
For example, the code is full of lines such as:
    tmpmat = dist_matrix[indexes,:]
    tmpmat = tmpmat[:,indexes]

This is in lines 130-131, and inside an inner loop. Per the documentation:

Advanced indexing always returns a copy of the data (contrast with basic slicing that returns a view).

Warning

The definition of advanced indexing means that x[(1,2,3),] is fundamentally different than x[(1,2,3)]. The latter is equivalent to x[1,2,3] which will trigger basic selection while the former will trigger advanced indexing. Be sure to understand why this is occurs.

Also recognize that x[[1,2,3]] will trigger advanced indexing, whereas x[[1,2,slice(None)]] will trigger basic slicing.

http://docs.scipy.org/doc/numpy/reference/arrays.indexing.html#advanced-indexing
Since I'm not entirely sure what those lines do at the moment I'm not sure how to rewrite them, but I am sure they can be rewritten to make good use of numpy views and reduce memory allocation/garbage collection.
Another example is on line 97:
mismatch_score = dot(dist_matrix, weights_mat)

Per the numpy docs this produces a new matrix each time - if we pre-allocate mismatch_score and reuse it (assuming the dimensions are constant, and they appear to be) we can do:
dot(dist_matrix, weights_mat, mismatch_score)

This would save the repeated memory allocation (and eventual garbage collection); since this function is also called inside an inner loop and the comment above it complains that it gets quite slow, this might have quite a big effect.
One last example from lines 62-66:
sqd = (arange(1,mat_size+1)[newaxis,:] - arange(1,mat_size+1)[:,newaxis])**2
#make the distance relative to the mat_size
norm_sqd = sqd/wid
#evaluate a normal pdf
weights_mat = exp(-norm_sqd/mat_size)

I haven't tested this, but I based on the documentation I think this can be rewritten to:
sqd = arange(1,mat_size+1)[:,newaxis])**2
# in-place subtraction, note that I've hoisted the unary minus,
# since -(a - b) == b - a
sqd -= (arange(1,mat_size+1)[newaxis,:]
# multiplication is much faster than division, at the cost of negligible rounding error
sqd *= 1.0/(wid*mat_size)
#make the distance relative to the mat_size and evaluate a normal pdf
weights_mat = exp(sqd, sqd)

This would reduce the number of allocated matrices from six to two. The biggest downside would be that the new code is less readable - so I'd annotate it to explain the unoptimised operations in the comments.
If you think it's a good use of my time I would like to make an "in-place operations" branch where I'll try to optimise all of the low-hanging fruit here - I suspect it could speed up the code quite a bit, and even if it turns out not to make too much of a difference it will help me get a feeling for the BackSPIN algorithm.

Thank you for the tip, sure go ahead!

Note that this is a long-term thing, once Sten, Peter and I got some of the more pressing Loom issues sorted out ;)
Here's an article with optimisation tips for Numba and Numpy, might contain some useful stuff:
https://www.ibm.com/developerworks/community/blogs/jfp/entry/Python_Meets_Julia_Micro_Performance?lang=en

So I have been educating myself on the various Profiler tools for python, to see where the bottlenecks of the current Backspin implementation might be.
First, pycallgraph produces pretty pictures that make it easier to follow the way the calls flow, also very useful for a high-level overview. Below is the result of running BackSPIN through this  tool:

That's a very wide graph with so many irrelevant function calls, so I'll lift out the main bottlenecks:

Feature-selection and CEF-tools eat up a good chunk of the time - perhaps something worth looking into as well.
What's interesting is that backSPIN makes one direct call to SPIN - the first one, and then _divide_to_2and_resort make 23. The latter only takes up 20 seconds out of the total 50 spent in SPIN, which tells us that that first SPIN call take up 30 seconds. In the original SPIN paper the authors claim that their algorithm "converges somewhere between O(n²) and O(n³)", so that makes sense.

So now we got the big bottlenecks, let's look at those functions in detail. This is a good introduction article, on profiling a python program line-by-line, although I couldn't get meaningful results out of the memory profiler.
This text file has the full results of running the kernprof CPU profiler on my laptop[0]. Below I'll copy fit_CV, readCEF, _calc_weights_matrix and _sort_neighbourhood, since they are the big bottlenecks:
Function: fit_CV at line 541
Line #      Hits         Time  Per Hit   % Time  Line Contents
==============================================================
   568         1          315    315.0      0.0      log2_m = log2(mu)
   569         1          271    271.0      0.0      log2_cv = log2(cv)
   570
   571         1            5      5.0      0.0      if len(mu)>1000 and 'bin' in fit_method:
   572                                                   #histogram with 30 bins
   573                                                   n,xi = histogram(log2_m,30)
   574                                                   med_n = percentile(n,50)
   575                                                   for i in range(0,len(n)):
   576                                                       # index of genes within the ith bin
   577                                                       ind = where( (log2_m >= xi[i]) & (log2_m < xi[i+1]) )[0]
   578                                                       if len(ind)>med_n:
   579                                                           #Downsample if count is more than median
   580                                                           ind = ind[random.permutation(len(ind))]
   581                                                           ind = ind[:len(ind)-med_n]
   582                                                           mask = ones(len(log2_m), dtype=bool)
   583                                                           mask[ind] = False
   584                                                           log2_m = log2_m[mask]
   585                                                           log2_cv = log2_cv[mask]
   586                                                       elif (around(med_n/len(ind))>1) and (len(ind)>5):
   587                                                           #Duplicate if count is less than median
   588                                                           log2_m = r_[ log2_m, tile(log2_m[ind], around(med_n/len(ind))-1) ]
   589                                                           log2_cv = r_[ log2_cv, tile(log2_cv[ind], around(med_n/len(ind))-1) ]
   590                                               else:
   591         1            1      1.0      0.0          if 'bin' in fit_method:
   592                                                       print 'More than 1000 input feature needed for bin correction.'
   593                                                   pass
   594
   595         1            2      2.0      0.0      if 'SVR' in fit_method:
   596         1            2      2.0      0.0          try:
   597         1<PHONE_NUMBER>19.0      1.2              from sklearn.svm import SVR
   598         1            4      4.0      0.0              if svr_gamma == 'auto':
   599                                                           svr_gamma = 1000./len(mu)
   600                                                       #Fit the Support Vector Regression
   601         1           28     28.0      0.0              clf = SVR(gamma=svr_gamma)
   602         1     27747287 27747287.0     83.8              clf.fit(log2_m[:,newaxis], log2_cv)
   603         1            3      3.0      0.0              fitted_fun = clf.predict
   604         1      4942606 4942606.0     14.9              score = log2(cv) - fitted_fun(log2(mu)[:,newaxis])
   605         1            4      4.0      0.0              params = None
   606                                                       #The coordinates of the fitted curve
   607         1         2451   2451.0      0.0              mu_linspace = linspace(min(log2_m),max(log2_m))
   608         1        16059  16059.0      0.0              cv_fit = fitted_fun(mu_linspace[:,newaxis])
   609         1            4      4.0      0.0              return score, mu_linspace, cv_fit , params

File: Cef_tools.py
Function: readCEF at line 90
Line #      Hits         Time  Per Hit   % Time  Line Contents
==============================================================
    90                                           	@profile
    91                                           	def readCEF(self, filepath, matrix_dtype = 'auto'):
    92                                           		#Delete all the stored information
    93         1           12     12.0      0.0  		self.__init__()
    94                                           		#Start parsing
    95         1           16     16.0      0.0  		with open(filepath, 'rbU') as fin:
    96                                           			# Read cef file first line
    97                                           			self.header, self.row_attr, self.col_attr, self.rows,\
    98         1           35     35.0      0.0  			self.cols, self.flags = fin.readline().rstrip('\n').split('\t')[1:7]
    99         1            4      4.0      0.0  			self.header = int(self.header)
   100         1            2      2.0      0.0  			self.row_attr = int( self.row_attr )
   101         1            2      2.0      0.0  			self.col_attr = int(self.col_attr)
   102         1            2      2.0      0.0  			self.rows = int(self.rows)
   103         1            2      2.0      0.0  			self.cols = int(self.cols)
   104         1            2      2.0      0.0  			self.flags = int(self.flags)
   105         4            8      2.0      0.0  			self.row_attr_values = [[] for _ in xrange(self.row_attr)]
   106                                           			# Read header
   107         3            4      1.3      0.0  			for i in range(self.header):
   108         2           44     22.0      0.0  				name, value = fin.readline().rstrip('\n').split('\t')[:2]
   109         2            2      1.0      0.0  				self.header_names.append(name)
   110         2            2      1.0      0.0  				self.header_values.append(value)
   111                                           			# Read col attr
   112        11           13      1.2      0.0  			for i in range(self.col_attr):
   113        10          641     64.1      0.0  				line_col_attr = fin.readline().rstrip('\n').split('\t')[self.row_attr:]
   114        10           15      1.5      0.0  				self.col_attr_names.append( line_col_attr[0] )
   115        10           34      3.4      0.0  				self.col_attr_values.append( line_col_attr[1:] )
   116                                           			#Read row attr and matrix
   117         1           26     26.0      0.0  			self.row_attr_names += fin.readline().rstrip('\n').split('\t')[:self.row_attr]
   118     19973        19748      1.0      0.1  			for _ in xrange(self.rows):
   119     19972       561393     28.1      2.4  				linelist = fin.readline().rstrip('\n').split('\t')
   120     79888       304938      3.8      1.3  				for n, entry in enumerate( linelist[:self.row_attr] ):
   121     59916        71511      1.2      0.3  					self.row_attr_values[n].append( entry )
   122     19972        26042      1.3      0.1  				if matrix_dtype == 'auto':
   123         1          371    371.0      0.0  					if sum(('.' in i) or ('e' in i) for i in linelist[self.row_attr+1:]) != 0:
   124                                           						matrix_dtype = float
   125                                           					else:
   126         1            1      1.0      0.0  						matrix_dtype = int
   127     19972        18848      0.9      0.1  				try:
<PHONE_NUMBER>2     22452690      1.4     95.7  					self.matrix.append( [matrix_dtype(el) for el in linelist[self.row_attr+1:] ])
   129                                           				except ValueError:
   130                                           					print repr(el), ' is invalid'

Function: _sort_neighbourhood at line 77
Line #      Hits         Time  Per Hit   % Time  Line Contents
==============================================================
    92      2820         3444      1.2      0.0      assert wid > 0, 'Parameter wid < 0 is not allowed'
    93      2820         5937      2.1      0.0      mat_size = dist_matrix.shape[0]
    94                                               #assert mat_size>2, 'Matrix is too small to be sorted'
    95      2820     20713204   7345.1     67.6      weights_mat = _calc_weights_matrix(mat_size, wid)
    96                                               #Calculate the dot product (can be very slow for big mat_size)
    97      2820      9005557   3193.5     29.4      mismatch_score = dot(dist_matrix, weights_mat)
    98      2820       732586    259.8      2.4      energy, target_permutation = mismatch_score.min(1), mismatch_score.argmin(1)
    99      2820        90289     32.0      0.3      max_energy = max(energy)
   100                                               #Avoid points that have the same target_permutation value
   101      2820        66102     23.4      0.2      sort_score = target_permutation - 0.1 * sign( (mat_size/2 - target_permutation) ) * energy/max_energy
   102                                               #sort_score = target_permutation - 0.1 * sign( 1-2*(int(1000*energy/max_energy) % 2) ) * energy/max_energy # Alternative
   103                                               # Sorting the matrix
   104      2820        30351     10.8      0.1      sorted_ind = sort_score.argsort(0)[::-1]
   105      2820         2039      0.7      0.0      return sorted_ind

Function: _calc_weights_matrix at line 46
Line #      Hits         Time  Per Hit   % Time  Line Contents
==============================================================
    61                                               #calculate square distance from the diagonal
    62      2820      1353453    479.9      6.6      sqd = (arange(1,mat_size+1)[newaxis,:] - arange(1,mat_size+1)[:,newaxis])**2
    63                                               #make the distance relative to the mat_size
    64      2820      3373825   1196.4     16.3      norm_sqd = sqd/wid
    65                                               #evaluate a normal pdf
    66      2820      9885674   3505.6     47.8      weights_mat = exp(-norm_sqd/mat_size)
    67                                               #avoid useless precision that would slow down the matrix multiplication
    68      2820       340370    120.7      1.6      weights_mat -= 1e-6
    69      2820       445687    158.0      2.2      weights_mat[weights_mat<0] = 0
    70                                               #normalize row and column sum
    71      2820      1517614    538.2      7.3      weights_mat /= sum(weights_mat,0)[newaxis,:]
    72      2820      1505751    534.0      7.3      weights_mat /= sum(weights_mat,1)[:, newaxis]
    73                                               #fix asimmetries
    74      2820      2235932    792.9     10.8      weights_mat = (weights_mat + weights_mat.T) / 2.
    75      2820         3367      1.2      0.0      return weights_mat

From this we learn the following:

in fit_CV, 83% of the time is spent in clf.fit(log2_m[:,newaxis], log2_cv). Optimise that and we'll get a huge boost
in read_CEF, 95% (!) of the time is spent on the line self.matrix.append( [matrix_dtype(el) for el in linelist[self.row_attr+1:] ]). Optimise that, boost!
in _sort_neighbourhood, despite the comment about the dot-product eating up a lot of time, mismatch_score = dot(dist_matrix, weights_mat) is only 1/3 of the bottleneck; the call to _calc_weights_matrix(mat_size, wid) is much more significant
in _calc_weights_matrix(mat_size, wid), the calls are fairly evenly divided, except for weights_mat = exp(-norm_sqd/mat_size) which takes up half of the time in the function.

So now we know where to start looking for faster alternatives!

First attempts:

re-order and replace maths operations in _calc_weights with faster alternatives (will give slightly different rounding results)
try out place(weights_mat, weights_mat < 0, 0), which is supposedly faster than boolean masking
inline _sort_neighbourhood, and reuse mismatch_score

Function: _calc_weights_matrix at line 60
Line #      Hits         Time  Per Hit   % Time  Line Contents
==============================================================
    75                                               #calculate square distance from the diagonal
    76      2668       731609    274.2      2.7      sqd = arange(1,mat_size+1)[newaxis,:] - arange(1,mat_size+1)[:,newaxis]
    77      2668       435643    163.3      1.6      sqd **= 2
    78
    79                                               ##make the distance relative to the mat_size
    80                                               #norm_sqd = sqd/wid
    81                                               ##evaluate a normal pdf
    82                                               #weights_mat = exp(-norm_sqd/mat_size)
    83      2668     12017917   4504.5     45.0      weights_mat = exp(sqd / (-wid * mat_size))
    84
    85                                               #avoid useless precision that would slow down the matrix multiplication
    86      2668       427798    160.3      1.6      weights_mat -= 1e-6
    87                                               #weights_mat[weights_mat<0] = 0
    88      2668      8695843   3259.3     32.6      place(weights_mat, weights_mat < 0, 0)
    89
    90                                               #normalize row and column sum
    91                                               # weights_mat /= sum(weights_mat,0)[newaxis,:]
    92                                               # weights_mat /= sum(weights_mat,1)[:, newaxis]
    93      2668      2611073    978.7      9.8      weights_mat /= sum(weights_mat,0)[newaxis,:] * sum(weights_mat,1)[:, newaxis]
    94
    95                                               #fix asymmetries
    96                                               #weights_mat = (weights_mat + weights_mat.T) / 2.
    97      2668      1438891    539.3      5.4      weights_mat += weights_mat.T
    98      2668       348823    130.7      1.3      weights_mat *= 0.5
    99      2668         3432      1.3      0.0      return weights_mat

Function: sort_mat_by_neighborhood at line 131
Line #      Hits         Time  Per Hit   % Time  Line Contents
==============================================================
   161                                               # manual inlining of _sort_neighbourhood
   162                                               # to maximise array re-use
   163
   164                                               # original indexes
   165       324          843      2.6      0.0      assert wid > 0, 'Parameter wid < 0 is not allowed'
   166       324         3786     11.7      0.0      indexes = arange(dist_matrix.shape[0])
   167       324          344      1.1      0.0      mismatch_score = None
   168      2992         5342      1.8      0.0      for i in range(times):
   169                                                   #sort the sitance matrix according the previous iteration
   170      2668       590859    221.5      1.4          tmpmat = dist_matrix[indexes,:]
   171      2668      1866980    699.8      4.6          tmpmat = tmpmat[:,indexes]
   172
   173      2668        10232      3.8      0.0          mat_size = tmpmat.shape[0]
   174                                                   #assert mat_size>2, 'Matrix is too small to be sorted'
   175      2668     26782993  10038.6     65.6          weights_mat = _calc_weights_matrix(mat_size, wid)
   176                                                   #Calculate the dot product (can be very slow for big mat_size)
   177                                                   # hackish trick: first loop mismatch_score will be None, so dot()
   178                                                   # creates a new ndarray. After that it will reuse this array.
   179      2668     10463764   3922.0     25.6          mismatch_score = dot(tmpmat, weights_mat, mismatch_score)
   180
   181      2668       509511    191.0      1.2          target_permutation = mismatch_score.argmin(1)
   182      2668       368806    138.2      0.9          energy = mismatch_score.min(1)
   183      2668       103991     39.0      0.3          max_energy = max(energy)
   184
   185                                                   # #Avoid points that have the same target_permutation value
   186                                                   # sort_score = target_permutation - 0.1 * sign( (mat_size/2 - target_permutation) ) * energy/max_energy
   187                                                   # #sort_score = target_permutation - 0.1 * sign( 1-2*(int(1000*energy/max_energy) % 2) ) * energy/max_energy # Alternative
   188                                                   # Sorting the matrix
   189                                                   # sorted_ind = sort_score.argsort(0)[::-1]
   190
   191      2668         4345      1.6      0.0          mat_size /= 2
   192      2668        40461     15.2      0.1          t = sign( (mat_size - target_permutation) )
   193      2668        23923      9.0      0.1          t *= energy/max_energy
   194      2668         8434      3.2      0.0          t *= 0.1
   195      2668        10900      4.1      0.0          sort_score = target_permutation - t
   196      2668        49367     18.5      0.1          sorted_ind = sort_score.argsort(0)[::-1]
   197                                                   #resort the original indexes
   198      2668         8394      3.1      0.0          indexes = indexes[sorted_ind]
   199       324          308      1.0      0.0      return indexes

Results:

re-ordering may have helped a tiny bit, but the exp() call is still the big bottleneck
inlining did not produce faster results!
place() seems slower!

TLDR: Python implementation of BackSPIN algorithm is 40% faster!
(not counting feature selection and reading in the CEF files)
Important: the results will be different after this rewrite!
The reason is that I use a basic floating point optimisation trick where instead of dividing by a matrix by a scalar value x, I first do y = 1/x and then multiply by y - because floating point multiplication is much faster than division, this speeds things up. However, it has slightly different rounding - however, given the error margins used here (that whole cut-off business at -1e-6) I expect that it won't negatively affect the results. Please double-check however!
_calc_weights is profiles as taking 15s instead of 20s, making backSPIN run in about 30s down from 50s. This is probably as good as this gets for now, unless we can really speed up that dot-product line in _sort_neighbourhood:
Total time: 15.0316 s
Function: _calc_weights_matrix at line 60
Line #      Hits         Time  Per Hit   % Time  Line Contents
==============================================================
    75                                               #calculate square distance from the diagonal
    76      2668       713584    267.5      4.7      sqd = arange(1,mat_size+1)[newaxis,:] - arange(1,mat_size+1)[:,newaxis]
    77      2668       437468    164.0      2.9      sqd **= 2
    78                                               ##make the distance relative to the mat_size
    79      2668         6295      2.4      0.0      divisor = 1.0 /  (-wid * mat_size)
    80      2668      8976078   3364.3     59.7      weights_mat = exp(sqd * divisor)
    81                                               #avoid useless precision that would slow down the matrix multiplication
    82      2668       391093    146.6      2.6      weights_mat -= 1e-6
    83      2668       471917    176.9      3.1      weights_mat[weights_mat<0] = 0
    84                                               #normalize row and column sum
    85      2668      2476751    928.3     16.5      weights_mat /= sum(weights_mat,0)[newaxis,:] * sum(weights_mat,1)[:, newaxis]
    86                                               #fix asymmetries
    87      2668      1199511    449.6      8.0      weights_mat += weights_mat.T
    88      2668       355904    133.4      2.4      weights_mat *= 0.5
    89      2668         2982      1.1      0.0      return weights_mat

Total time: 25.528 s
Function: _sort_neighbourhood at line 91
Line #      Hits         Time  Per Hit   % Time  Line Contents
==============================================================
   106      2668         4830      1.8      0.0      assert wid > 0, 'Parameter wid < 0 is not allowed'
   107      2668         6573      2.5      0.0      mat_size = dist_matrix.shape[0]
   108                                               #assert mat_size>2, 'Matrix is too small to be sorted'
   109      2668     15086467   5654.6     59.1      weights_mat = _calc_weights_matrix(mat_size, wid)
   110                                               #Calculate the dot product (can be very slow for big mat_size)
   111      2668      9399555   3523.1     36.8      mismatch_score = dot(dist_matrix, weights_mat)
   112      2668       821260    307.8      3.2      energy, target_permutation = mismatch_score.min(1), mismatch_score.argmin(1)
   113      2668        91982     34.5      0.4      max_energy = max(energy)
   114                                               #Avoid points that have the same target_permutation value
   115      2668        70708     26.5      0.3      sort_score = target_permutation - 0.1 * sign( (mat_size/2 - target_permutation) ) * energy/max_energy
   116                                               #sort_score = target_permutation - 0.1 * sign( 1-2*(int(1000*energy/max_energy) % 2) ) * energy/max_energy # Alternative
   117                                               # Sorting the matrix
   118      2668        44466     16.7      0.2      sorted_ind = sort_score.argsort(0)[::-1]
   119      2668         2130      0.8      0.0      return sorted_ind

Next up, I'll look at read_CEF

This one magic function in Numpy might fix the readCEF troubles:
http://docs.scipy.org/doc/numpy-1.10.0/reference/generated/numpy.loadtxt.html#numpy.loadtxt

@JobLeonard  I took some of your analysis results to try to fix some other bottlenecks, I hope it's OK :) After that I will compare with the original to see if the results are significantly different/speed up is worth it. If you fix a small merge conflict left at the end of backSPIN.py, I can compare your branch too.


Multiple months in page

Is it possible to place e.g. three months in a page? I did give it a try adding multiple mwl-calendar-month-view but with no luck
I think that on mobile devices will be useful to simply scroll top bottom for next months. Is there any way to achieve this?

What was your problem with adding multiple calendars? It should work once configured correctly... Plunker example (may not work 100% correctly as I wrote it on my "smart"phone, but should give you the idea)

Closing in favour of https://github.com/mattlewis92/angular-calendar/issues/322


ENH : add replace param in raw.add_events

see discussion on mailing list.

LGTM +1

approved by @virvw


utils: add method ensure_formula_installed!

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

Reusing common functions, see https://github.com/Homebrew/brew/pull/12465#discussion_r755055468 and https://github.com/Homebrew/brew/pull/12465#discussion_r755159862.
New tests need?

Thanks again @XuehaiPan!


grpc_cli doesn't include the content-type header in its requests

What version of gRPC and what language are you using?
commit 2cfc216cfd58dc247249da87dbefa8bb949c8b9c
Merge: dbc1e27 d4c9867
Author: Nicolas Noble<EMAIL_ADDRESS>Date:   Sat Jul 21 00:23:18 2018 -0700

What operating system (Linux, Windows, …) and version?
Ubuntu Linux 16.04
What runtime / compiler are you using (e.g. python version or version of gcc)
achew22@lappy:~/Projects/grpc (master)$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.10' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.10)

What did you do?
If possible, provide a recipe for reproducing the error. Try being specific and include code snippets if helpful.
I attempted to use the grpc_cli tool per the instructions but was unable to get it to send a request to a service that handled both http and grpc traffic. The server filters based on the content-type header and has GRPC handle if contentType == "application/grpc", HTTP otherwise.
What did you expect to see?
I expected the grpc_cli to set the content-type header to "application/grpc"
What did you see instead?
It didn't set the content-type header
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
Anything else we should know about your project / environment?
Thank you so much!

Do you have any evidence that grpc_cli did not set the header? I think it should and just verified it does.
You can print out the headers with GRPC_TRACE=http and you should see the header.
I suspect you have other issues with grpc_cli.


da.argmin of unique's result

Test:
import dask.array as da
import numpy as np
x = da.arange(40, chunks=10)
y = da.unique(x)
z = da.argmin(y)
z.compute()

Result:
...
  File "<site-packages>/dask/array/reductions.py", line 496, in arg_chunk
    arg[:] = np.ravel_multi_index(total_ind, total_shape)
TypeError: 'float' object cannot be interpreted as an integer

Versions
Python 3.6.3
Dask 0.16.1 installed by pip3 install dask[complete] --user
Numpy 1.14.0

Don't know if this is caused by np.nan in chunks. That ravel_multi_index is probably for calculating offset of each block.

Correct. I don't see an obvious way to fix this. Maybe a better error message? Do you have any suggestions?


Get Started: "Show welcome page on startup" checkbox elements are not aligned

Closed via #162887


Attach documentation to releases

See scipp/plopp#238. Wait until we have another plopp release to ensure it works.
Also:

Add version visible in docs.
Add a link in docs where to find docs for old releases.

Add version visible in docs.

For this, I think we can add the current version to the footer by doing something like "footer_start": ["copyright", "sphinx-version", "doc_version"], in the docs/conf.py file.

Add a link in docs where to find docs for old releases.

Not sure where that one should go. Might make sense next to the current version in the footer, but then maybe it is not so visible? I also thought of using the version selection menu which would just have two entries: the current version and a link to "older versions".
But I am not sure how that would work with respect to being automatically updated on a new release.
It would however have the benefit of being more visible, in the top bar of the page.
@jl-wynen any ideas/opinions?

Maybe add it in an About section, similar to how you have it in Plopp?

I have put this in the footer. I will also add a note on where to find the other versions in an About page.


Redirect handling.

Return HTTP 302 responses when we get a redirect from Werkzeug.
Closes #17

(updated title)
Also, apologies looks like I resolved a merge conflict before you were done working on the PR. GitHub just made it too nice and easy! 😄

heh, easy enough to fix the conflict, just like we likes it

Ace, thanks!


Update dependencies in environment.yml

Add dependencies for all packages which are explicitly imported and used in the codebase.

Change matplotlib dependency to matplotlib-base, which doesn't pull in so many unnecessary transitive dependencies.

Current CI failures are identical with the failures on the main branch, so I don't think that any of them are connected with this PR.

Thank you! I now fixed the tests on the main branch. Can you merge them into you branch and let the tests run there?

All's fine! I merge.


Fix drop down menu in resource gallery

New theme breaks dropdown menu in resource gallery, but fixing the other infrastructure hangups due to the theme were more important. I'll look into this next week.

Will also be needed in the cookbook-gallery

Was focused on the theme update in Cookbooks the last two days. I'm not sure I'll be able to fix this tomorrow (I'll take a look and document if I find anything), so I'm un-assigning myself to signal that someone else should look at this while I'm on PTO and at the SEA conference.

Also noticing that the Cookbooks gallery starts with "=================" when we don't want that.
New Sphinx drop down documentation