[iOS] launchImageLibrary subsequent calls do not work after being called once

Description
On iOS, I can make a call to launchImageLibrary, select an image/video, and then do some stuff with it. Now I want to call launchImageLibrary and select a new image/video, however after the second call to launchImageLibrary nothing appears on the screen and the callback passed is never called with any error
How to repeat issue and example

call launchImageLibrary
either cancel or choose a picture
call launchImageLibrary again with the exact same arguments
nothing happens and no error is given

Solution
Subsequent calls to launchImageLibrary should work, regardless of whether its been called already
Additional Information

Image Picker version: v3.0.0-vnext.1
React Native version: 0.62.2
Platform: iOS
Development Operating System: MacOS
Dev tools: XCode 12
iOS version: 13.4.1

This is also an issue on the stable release version of 2.3.1

I've found some additional logs that help track down the issue. It seems a lot of calls on the ios side related to the UI are not happening on the main thread. These logs appear immediately after the first call to launchImageLibrary, but do not appear on subsequent calls to the same method.
Logs.txt

I am not able to reproduce your issue on vnext branch. Show your code to debug futher.

Hi, just upgraded from 2.3.1 to vnext.2, and so far so good, looks promising !
No issue as @scousino mentioned...
Would you share some code to help you ?

Hi, there isn't much code to show as its a simple interaction. The only other possible thing I can think of is I show a modal selector from react-native-modal-selector, and then open the camera or the image library, based on the selection. However, like I mentioned it always opens on the first time, but never after that. On Android I do not see this specific problem.
This is how I launch the image library.
launchImageLibrary(
                { mediaType: mediaType.imagePickerMediaType, quality: 1 },
                (res) => imgPickerCallback(res, mediaType.enumMediaType, true),
            );

There must be some conflict between react-native-modal-selector and iOS picker. Make sure to close the react-native-modal-selector and then call launchImageLibrary probably for now use  setTimeout to wait for the modal to close or we have callback like onModalClose etc then call this library on that.

Yeah I thought the same thing and already have that implemented. That is how I got it to open the image library at all. Now, with the setTimeout, I'm running into my described issue. My callback, imPickerCallback isn't even called with an error on subsequent launchImageLibrary calls. So, something in that call bails out, but with no error.

I may not be able to help you, I have tested this on react-native modal it works. I think your issue is out of scope of this library.

I have found a new log that I think should shed light on the issue:
Attempt to present <UIImagePickerController: 0x10b03dc00> on <RCTModalHostViewController: 0x113f8e0f0> (from <RCTModalHostViewController: 0x113f8e0f0>) whose view is not in the window hierarchy.

also @ravirajn22 I used react-native-modal-selector, not react-native-modal

@scousino might be worth trying to reproduce in the example app and also comparing differences.

I'll try this now, as a side note I would recommend adding a README about how to run the example app

@Johan-dutoit and @ravirajn22 I've tried to reproduce on the example app, and the side effect of calling launchImageLibrary after a modal selection, while using a setTimeout as recommended above, still shows incorrect behavior. Now, the example app just crashes out entirely.
I've created a fork and a branch on that fork with my changes here

Also I'm not sure the example app should have code that references the local react-native-image-picker package. Wouldn't it make more sense to use released and deployed versions via npm?

I'm in agreement with you, It's just been easier to test local changes while it still points locally.  I think once we've reached a stable release, then it's definitely worth changing over to the npm version.

I have found a new log that I think should shed light on the issue:
Attempt to present <UIImagePickerController: 0x10b03dc00> on <RCTModalHostViewController: 0x113f8e0f0> (from <RCTModalHostViewController: 0x113f8e0f0>) whose view is not in the window hierarchy.

Same problem here, this module is not usable in this condition...

When using react-native modal or derivate libraries to show the options and closing them, Make sure the Modal is closed completely before calling the library methods. Because the library opens a View which attaches to previous view, since the previous view is closed the launchImageLibrary or launchCamera cannot attach to any view and the error happens. This is a known in issue in react-native when dealing with Closing and opening a iOS modal simultaneously.

in my case, I set timeout and it work well

This solved my issue
  launchSelection(func) {
    this.setState({ modalVisible: false }, () => setTimeout(func, 1000));
  }

This solved my issue
  launchSelection(func) {
    this.setState({ modalVisible: false }, () => setTimeout(func, 1000));
  }

This isn't really a work around. Adding a timeout negatively impacts UX. Is there a correct work around or perhaps a fix?

This solved my issue
  launchSelection(func) {
    this.setState({ modalVisible: false }, () => setTimeout(func, 1000));
  }

this one is works for me. i also change the timeout duration to 300 for better UX and it works well too.

using timeout when calling the launchCamera or launchImageLibrary after update modal state to false is work for me. and I set timeout duration to 500 for better UX and it works well too
() => {
  await setShowOption(false);
  setTimeout(() => launchCamera(cameraOption, responseHandler), 500)
}

This worked for me

This isn't really a work around. Adding a timeout negatively impacts UX. Is there a correct work around or perhaps a fix?
Is there a way to build in callbacks for when modals are effectively off-screen and cleaned up?

I believe this should be the actual solution that is looked into or something of that nature. Using timeouts is a hack that creates dumb UX

This was the solution for me today. Everything seemed to be working, I would select the picture, the picture would load in my UI and then the app would freeze and I couldn't click anything. This was very hard to debug.


delete joinTime from the response of create position

What is the purpose of the change
Deletes joinTime from the response of create position. This is just extra boilerplate, its not doing anything.
Testing and Verifying
This change is a trivial rework / code cleanup without any test coverage.
Documentation and Release Note

[ ] Does this pull request introduce a new feature or user-facing behavior changes?
[ ] Changelog entry added to Unreleased section of CHANGELOG.md?

Where is the change documented?

[ ] Specification (x/{module}/README.md)
[ ] Osmosis documentation site
[ ] Code comments?
[ ] N/A

Merging with one ACK since the change is simple


Override scan data/time

It would be great to have an option to override the data time section of when the scan is performed in order to look at historic data. Like -t in Soda SQL.

SODA-972

I do believe this is complete and merged... @albinkjellin Ok to close?

there is an option to use -t or --data-timestamp


[Common Voice] Make sure bytes are correctly deleted if path exists

path should be set to local path inside audio feature if exist so that bytes can correctly be deleted.

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

cool that you noticed that we store unnecessary bytes again :D


Allow extra arguments with ping.

[x] I've read and understood the Contributing guidelines and have done my best effort to follow them.
[x] I've read and agree to the Code of Conduct.
[x] I've been mindful about doing atomic commits, adding documentation to my changes, not refactoring too much.
[x] I've a descriptive title and added any useful information for the reviewer. Where appropriate, I've attached a screenshot and/or screencast (gif preferably).
[x] I've written tests to cover the new code and functionality included in this PR.
[x] I've read, agree to, and signed the Contributor License Agreement (CLA).

PR Summary
Added functionality to the Server.ping function that allows the user to include an ID as well as any other key:value pairs that they want.
I wrote this because I wanted to associate pong messages with the corresponding ping to ensure I wasn't missing any and the only way to do that from user code was to bypass ping.
There are a few parts that I am unsure about:

The return value from send_to_websocket. I wanted to return something that would inform the user that the message didn't go through. More mature developers may have an opinion of whether that is useful or not.
I've never written docstrings for a function with **kwargs, so that may be wrong as well.
I considered generating a random ID if no ID was included but decided that was overstepping. If anyone thinks that is a good idea, I can add it.

Related Issues
N/A
Test strategy
I added tests to check that ping forwards the extra arguments correctly.

 Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

Thank you very much for taking the time to make this PR. This project no longer supports version 1.x as we've described here.
Allow me to close this and for the state of v2, please refer to https://github.com/slackapi/python-slackclient/pull/322#issuecomment-611438842.


Core Lightning Gateway Docker image

https://github.com/fedimint/fedimint/blob/master/flake.nix#L734-L775
This doesn't currently do anything useful. It runs ln_gateway which isn't right. It should instead run lightnignd, pass the plugin's path and fedimint-cfg to lightningd either in the config / cli like this. This enables lightningd to run, and the gateway to run as a plugin.

From my experiments with our existing gateway docker container, bitcoin-cli also needs to be in the PATH for lightningd to startup correctly.

Looks like you can put RPC credentials in the lightning config file https://lightning.readthedocs.io/lightningd-config.5.html#bitcoin-control-options

Related: #2098

I wonder if there is an existing Docker image for core lightning which has a convenient way to pass in new plugins and instantiate them as we like.

There is no one that did pre-package stuff for this, but I have all the pieces to solve this.
In the past I did some experimentation:

https://github.com/clightning4j/clightning4j-node as a custom image
https://github.com/coffee-tools/coffee as a plugin manager

but I never put these two in the same docker image because coffee is new. It will be fun to research on it

I wonder if there is an existing Docker image for core lightning which has a convenient way to pass in new plugins and instantiate them as we like.

There is no one that did pre-package stuff for this, but I have all the pieces to solve this.
In the past I did some experimentation:

https://github.com/clightning4j/clightning4j-node as a custom image
https://github.com/coffee-tools/coffee as a plugin manager

but I never put these two in the same docker image because coffee is new. It will be fun to research on it

Thanks @vincenzopalazzo
Should we actually be looking to package a custom docker image like you did with https://github.com/clightning4j/clightning4j-node  or do you suspect the way users consume core-ln plugins will change short term with plugin-manager efforts like https://github.com/coffee-tools/coffee
My intuition is, Fedimint just packages and releases a plugin binary which can then be installed by any user through standard plugin management, regardless of how the user deploys their CLN node

Should we actually be looking to package a custom docker image like you did with https://github.com/clightning4j/clightning4j-node or do you suspect the way users consume core-ln plugins will change short-term with plugin-manager efforts like https://github.com/coffee-tools/coffee

Due to that, we do not know how much effort and what the problem we find with just plugging in the plugins, we should start an experimentation maybe with a fork of https://github.com/clightning4j/clightning4j-node and integrate the functionality that we need.
Later, when we have a PoC we can start to think to propose to integrate coffee in the official docker image of blockstream.
What do you think?

IMO the fedimint project should not maintain a docker image for Core Lightning. People should probably just use https://hub.docker.com/r/elementsproject/lightningd. But the docs in that link seem to just be the Core Lightning README. It's not clear at all how to use a plugin (e.g. our gateway-cln-extension) in that docker image.

I agree with you but I am not a Blockstream member so I do not know if they want to support the idea that I proposed in my previous message.
However, as one core contributor with a PoC I can propose a RFC to make this change, but without any RFC I do not think this will happens with just my help.

I'm unsure how to use a plugin (e.g. our gateway-cln-extension) in that docker image.

The only way that you have is or you share the plugin directory with the docker directory (I do not know if this works) or you log in inside the docker image and install it, but both are  on users

Closing this. Fedimint won't maintain our own Docker image for Core Lightning.


Eval only predict stream in cxflow predict

eval only predict stream in cxflow predict
add regression test
fix bug when no stream was iterated in cxflow predict with main_loop.skip_zeroth_epoch=True

edit by @FloopCZ: removed the automatic closure of #76

Thank you for this, it makes more sense than the current behavior.

Looks good, thank you for the additional code polish!


Get CompletionItemKind at position

I have a DefinitionProvider, and I was wondering is there a way to get the CompletionItemKind at a particular position?
So take this for example:
Database::get();

When I Ctrl+Click on Database I would get the Class CompletionItemKind

Not really sure what you mean? The DefinitionProvider is meant to aid users in navigating source code. Given a position, get the symbol, and return one or many locations where it is defined. Different commands and actions, like go to definition, preview definition etc, use this data provider.
Is that you want to enrich the hover you see when doing Ctrl+MouseOver on a symbol? Generally all language features are also exposed as commands. Using executeCommand you can retrieve the same data the UI gets and use that to implement another data provider - like HoverProvider - tho there is no special gesture for Ctrl+MouseOver just the general hover provider.

Basically what I want is when you ctrl+click for it to go to the correct definition.
Sometimes there are classes with the same name as a method in another class. How does it know which one you actually want?
Currently our provider finds and returns the first one it finds. So you could either go to the class or to the method. When we add properties the same thing goes for here..
I haven't tried using a list of items yet. Will they resolve themselves to the proper item when you ctrl+click?

To clarify, ctrl+click is just another gesture for the Go to Definition, so I assume you are implementing a DefinitionProvider.
Generally, VS Code does support multiple definition of a symbol cos that actually happens - think of TypeScript interface/variables merge or C# open classes. So, the UI will show a list when multiple definitions for a symbol have been computed:

Currently our provider finds and returns the first one it finds.

You mean 'find' as in textual search? That would one way to do but to get a correct result you must run a really semantic analysis which knows these kind of things. What language is this for?

The language is PHP, and what we do is build the AST using the language server, and then store it in a variable workspaceTree. When vscode asks the server for list of items, it searches the tree (this is what I mean by find).
Here is the provider I wrote that asks the server for the word it is looking for a definition:
import {
    workspace, Range, Location, Uri,
    DefinitionProvider, TextDocument, Position, CancellationToken
} from 'vscode';
import { RequestType } from 'vscode-languageclient';
import Crane from '../crane';

export class PHPDefinitionProvider implements DefinitionProvider {

    public provideDefinition(document: TextDocument, position: Position, token: CancellationToken): Thenable<Location> {
        return workspace.saveAll(false).then(() => {
            return this.findDefinition(document, position, token);
        });
    }

    public findDefinition(document: TextDocument, position: Position, token: CancellationToken): Thenable<Location> {
        return new Promise((resolve, reject) => {

            let wordRange: Range = document.getWordRangeAtPosition(position);
            let word: string = document.getText(wordRange);

            var findDefinition: RequestType<{path:string,word:string}, {path:string,position:any}, any> = {method: 'findDefinition'};
            Crane.langClient.sendRequest(findDefinition, {
                path: document.uri.fsPath,
                word: word
            }).then(result => {
                var uri: Uri = Uri.parse('file://' + result.path);
                var location = new Location(uri, new Range(result.position.startLine - 1, result.position.startChar, result.position.endLine - 1, result.position.endChar));
                resolve(location);
            });
        });
    }
}

as you can see it gets the word using document.getText(wordRange), my thought was that I could also send the SymbolKind to the server such as SymbolKind.Class, SymbolKind.Method, etc. this way I could search the tree for just methods, or just classes instead of searching the tree for everything.

Ok - as said before you could use the api commands to get to the completion items at a position but someone has to compute that info? The provider that ships with VS Code isn't very smart but consults a static list of symbols.
Generally, you need an AST and a symbol/type information. Generally it's like this ast node maps to type and type maps to symbol. The symbol knows where it is defined - either a ast location or some lib location (thing of a dll or so).
Closing this as question since it out of scope for VS Code

Okay, I see now! I probably want to execute vscode.executeWorkspaceSymbolProvider.
Thanks for the info!


24H Event/Driver switch

Hello, can you tell me how to setup an 24h event with driver switch?
I tried to set multiple GUID's for one car, but we can still join?
How should the guids be splitted maybe?
Thank you :-)

Does Assetto Corsa even support this kind of stuff? I doubt about it....if so, this is pretty much unrelated with AC Server Manager

As far as I am aware this isn't possible at all in Assetto Corsa, so unfortunately we can't do anything to implement it.


Pass request options to interceptor

Hi all,
I'm trying to add a custom interceptor to the Balena request.
Everything works as expected, however, only when a BalenaRequestError occurs, the Request Options are passed in the error.
I'm using the SDK to communicate to my openBalena instance, where I can only login using the credentials. But after 7 days, the token expires. I'm trying to fix this by adding an "error" interceptor, which handles errors when the authorization fails (like an Unauthorized response, or a Balena error: BalenaNotLoggedIn, BalenaExpiredToken or BalenaMalformedToken). But because the request options aren't passed with every error, I can't retry the request after I force reauthentication again.

I've already tested it by forcing a BalenaRequestError, which responds Unauthorized and retrying the request using:
sdk.request.send(error.requestOptions);

This works as expected, so it'd be awesome if I can also handle the rest of the errors by passing the request options to every error.
Thanks in advance!

Hi,
Can you clarify whether you are using the requestError or the responseError interceptor?
The reason only BalenaRequestError errors include the request options is that the rest of the errors you mentioned (eg responseError) are thrown during the normalization process of the request options. Would it be fine with you if we offered those options even in this uh/half-processed state?

Hi @thgreasi,
First of all, sorry for my late response.
If I understand correctly, you're asking if it's fine to pass the request options with every error, even if the error occur'd before the request?
If so, yes. That would be ideal. The problem is I can't retry the request on a failure whatsoever. I'm using openBalena, where I have to use login via credentials. However, when the JWT token isn't valid anymore, it won't try to login again which I understand. But I can force the login again on that error and retry the request via the interceptors. But I don't know which request is being executed at time of error, because it's a global interceptor.
Next to that, for error logging, it's also handy to always know which requests triggered the error. Maybe in most cases you won't need it, but I think the more data you have while an error occurs, the better.
Let me know what you think!


I've just try your component, but when I import import VueBingMaps from 'vue-bing-maps'; I got bug can't load vue-bing-maps. Could you please help me to use it?

Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:

Go to '...'
Click on '....'
Scroll down to '....'
See error

Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):

OS: [e.g. iOS]
Browser [e.g. chrome, safari]
Version [e.g. 22]

Smartphone (please complete the following information):

Device: [e.g. iPhone6]
OS: [e.g. iOS8.1]
Browser [e.g. stock browser, safari]
Version [e.g. 22]

Additional context
Add any other context about the problem here.

I messed up when creating the package.json file as the main property does not correctly map to the main entry point of the build module.  I will push an update to fix this shortly.

Oh, thanks you so much, i’m not pro with vue


Builded still a long loading Building module bundle for production... And nerver stop

I am use npx @vue/cli create .  build vue project.
Then i am use npm i prerender-spa-plugin-next
This is my text of the vue.config.js
const { defineConfig } = require('@vue/cli-service');
const PrerenderSPAPlugin = require('prerender-spa-plugin-next');

module.exports = defineConfig({
    transpileDependencies: true,
    publicPath:'/',
    configureWebpack:config => {
        const prerenderCfg = new PrerenderSPAPlugin({
            routes: ["/", "/about"],
            renderOptions: {
                renderAfterDocumentEvent: "prerender",
            },

            rendererOptions: {
                // headless: false,
                renderAfterDocumentEvent: "render-event",
                // inject: {},
                // timeout: 10000,
            },
        });
        config.plugins.push(prerenderCfg);
    }
})

This is the result. never stop.

You use renderAfterDocumentEvent: "render-event", but never mention actually implementing this event in your vue app, if this event is not received, the build will never finish document.dispatchEvent(new Event('render-event))
You should also delete the renderOptions option which doesn't exist

You use renderAfterDocumentEvent: "render-event", but never mention actually implementing this event in your vue app, if this event is not received, the build will never finish
You need to fire document.dispatchEvent(new Event('render-event')) in your app's mounted hook
You should also delete the renderOptions option which doesn't exist

Thank you help me. Actually  i worte document.dispatchEvent(new Event('render-event')) in App.vue. but it still never finish.
Now it ok after deleted when i seen your told should delete the renderOptions.
Thank you very much


Need a CICD pipeline for continuous integration and deployment

Is there an open-source CICD to support nocode build and deployment?

Try to run the command ___________________________ to generate Jenkinsfile then import it to Jenkins server


Compile error

The first time that I installed, it was missing Zlib, so I installed zlib1g-dev. Now I have this (I removed all of the unused-value and strict-aliasing warnings):
><EMAIL_ADDRESS>install /home/user/project/node_modules/nodegit
> node lifecycleScripts/install

nodegit] Fetching binary from S3.
[nodegit] Failed to install prebuilt binary, building manually.
[nodegit] Making sure dependencies are available and native code is generated
[nodegit] Everything is ready to go, attempting compilation
[nodegit] Building native node module.
{ [Error: Command failed: /bin/sh -c /home/user/project/node_modules/nodegit/node_modules/.bin/pangyp rebuild
In file included from ../vendor/openssl/openssl/include/openssl/bio.h:1:0,
                 from ../vendor/openssl/openssl/include/openssl/../../crypto/evp/evp.h:75,
                 from ../vendor/openssl/openssl/include/openssl/evp.h:1,
                 from ../vendor/libssh2/src/openssl.h:45,
                 from ../vendor/libssh2/src/crypto.h:44,
                 from ../vendor/libssh2/src/libssh2_priv.h:132,
                 from ../vendor/libssh2/src/openssl.c:41:

... REMOVED A WHOLE BUNCH OF WARNINGS ...

In file included from ../src/../include/wrapper.h:11:0,
                 from ../src/nodegit.cc:6:
../node_modules/nan/nan.h:324:27: error: redefinition of ‘template<class T> v8::Local<T> Nan::imp::NanEnsureHandleOrPersistent(const v8::Local<T>&)’
   NAN_INLINE v8::Local<T> NanEnsureHandleOrPersistent(const v8::Local<T> &val) {
                           ^
../node_modules/nan/nan.h:319:17: note: ‘template<class T> v8::Handle<T> Nan::imp::NanEnsureHandleOrPersistent(v8::Handle<T>&)’ previously declared here
   v8::Handle<T> NanEnsureHandleOrPersistent(const v8::Handle<T> &val) {
                 ^
../node_modules/nan/nan.h:344:27: error: redefinition of ‘template<class T> v8::Local<T> Nan::imp::NanEnsureLocal(v8::Handle<T>&)’
   NAN_INLINE v8::Local<T> NanEnsureLocal(const v8::Handle<T> &val) {
                           ^
../node_modules/nan/nan.h:334:27: note: ‘template<class T> v8::Local<T> Nan::imp::NanEnsureLocal(const v8::Local<T>&)’ previously declared here
   NAN_INLINE v8::Local<T> NanEnsureLocal(const v8::Local<T> &val) {
                           ^
../node_modules/nan/nan.h:757:13: error: ‘node::smalloc’ has not been declared
     , node::smalloc::FreeCallback callback
             ^
../node_modules/nan/nan.h:757:35: error: expected ‘,’ or ‘...’ before ‘callback’
     , node::smalloc::FreeCallback callback
                                   ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’:
../node_modules/nan/nan.h:761:50: error: ‘callback’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                  ^
../node_modules/nan/nan.h:761:60: error: ‘hint’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                            ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:
../node_modules/nan/nan.h:768:67: error: call of overloaded ‘New(v8::Isolate*, const char*&, uint32_t&)’ is ambiguous
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
../node_modules/nan/nan.h:768:67: note: candidates are:
In file included from ../node_modules/nan/nan.h:25:0,
                 from ../src/../include/wrapper.h:11,
                 from ../src/nodegit.cc:6:
/home/user/.node-gyp/4.2.6/src/node_buffer.h:31:40: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
/home/user/.node-gyp/4.2.6/src/node_buffer.h:31:40: note:   no known conversion for argument 3 from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’
/home/user/.node-gyp/4.2.6/src/node_buffer.h:43:40: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
/home/user/.node-gyp/4.2.6/src/node_buffer.h:43:40: note:   no known conversion for argument 2 from ‘const char*’ to ‘char*’
In file included from ../src/../include/wrapper.h:11:0,
                 from ../src/nodegit.cc:6:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’:
../node_modules/nan/nan.h:772:61: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), ((size_t)size))’ from ‘v8::MaybeLocal<v8::Object>’ to ‘v8::Local<v8::Object>’
     return node::Buffer::New(v8::Isolate::GetCurrent(), size);
                                                             ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanBufferUse(char*, uint32_t)’:
../node_modules/nan/nan.h:779:12: error: ‘Use’ is not a member of ‘node::Buffer’
     return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
            ^
make: *** [Release/obj.target/nodegit/src/nodegit.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/user/project/node_modules/nodegit/node_modules/pangyp/lib/build.js:272:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 3.16.0-4-amd64
gyp ERR! command "/usr/bin/nodejs" "/home/user/project/node_modules/nodegit/node_modules/.bin/pangyp" "rebuild"
gyp ERR! cwd /home/user/project/node_modules/nodegit
gyp ERR! node -v v4.2.6
gyp ERR! pangyp -v v2.3.3
gyp ERR! not ok
]
  killed: false,
  code: 1,
  signal: null,
  cmd: '/bin/sh -c /home/user/project/node_modules/nodegit/node_modules/.bin/pangyp rebuild' }
undefined

><EMAIL_ADDRESS>prepublish /home/user/project/node_modules/nodegit
> node lifecycleScripts/prepareForBuild.js

[nodegit] Detecting vendor/libgit2/fb6df50b7f250a4fd8b2fab257f119a5185e9bf5.
[nodegit] Detecting vendor/libssh2/1.4.3.
[nodegit] Detecting vendor/http_parser/2.5.0.
[nodegit] Detecting generated code.
[nodegit] vendor/libgit2/fb6df50b7f250a4fd8b2fab257f119a5185e9bf5 already exists.
[nodegit] vendor/libssh2/1.4.3 already exists.
[nodegit] vendor/http_parser/2.5.0 already exists.
[nodegit] Generated code is intact.

Debian Jessie x86_64
GCC 4.9.2-2
libstdc++-4.9-dev 4.9.2-10
Just wondering, but shouldn't the Ubuntu prebuilt binary work on Debian just as well? How can I see what specifically failed in installing that binary? I'm sure that it's missing some dependency.
Thanks!

Why are you installing 0.4.1 instead of the latest?

I didn't notice that! The project that requires it hasn't updated its dependencies. Version 0.10.0 worked fine. I don't know if it's compatible with the project, but that issue isn't relevant here.
Thanks for your quick reply.

Np. Thanks for the issue!


(Question) Converting BC4 to BMP with texconv

When converting a BC4 (dds) texture to BMP, the WIC encoder by default creates a palette .bmp file. When I specify -f rgba then it generates an RGB image, but uses black/white coloring, meaning it sets all 3 channels red, green, and blue to the same value.
Contrary, when doing the same with a BC5 texture, red and green are set, while blue is zero.
Is there a way to let texconv similarly generate a .bmp file with only the red channel set, while green and blue are zero?

The default decompress format for BC4 maps to DXGI_FORMAT_R8_UNORM which is a single red channel (BC4 encodes just one channel). When DXGI_FORMAT_R8_UNORM is passed to the WIC writer, the default format for WIC maps to GUID_WICPixelFormat8bppGray. For the .BMP codec, this is written as a BI_RLE8 which is a palette mode, and the BMP palette is the identity (0-255 maps to greyscale colors 0-255).
The default decompress format for BC5 maps to DXGI_FORMAT_R8G8_UNORM which is a two channel format (BC5 encodes two channels). When DXGI_FORMAT_R8G8_UNORM is passed to the WIC writer, there is no WIC format that exactly matches so that writer fails. Therefore, you have to provide the target format you want to use.
With that out the way, when you provide -f rgba the target format for the conversion becomes  DXGI_FORMAT_R8G8B8A8_UNORM.  The tool first decompresses BC4 to R8, then converts from R8 to R8G8B8A8. The default behavior for such conversions is to do a 'greyscale expansion' as you see.
If on the other hand you provide a BC5, then it decompresses to R8G8, then converts R8G8 to R8G8B8A8. The default behavior for such conversions is to copy R to red, G to green, and set B to zero, and A to 1.
From my understanding of your question, you want BC4 to write out to R8G8B8A8 where R is red, G is 0, B is zero, and A is 1. You can do this with the -swizzle option. In your case -swizzle r001 which will copy the red channel and then set the other channels to fixed values.


Express.js Working Example

Thank you very much for this amazing lib! Great job!
I would like to use pdf-lib in my express.js app. Below is a working example of an express.js app sending a Hello World pdf which Chrome reads just fine.
Am I doing things correctly?
'use strict';

var PdfLib = require('pdf-lib');
var PDFDocument = PdfLib.PDFDocument;
var StandardFonts = PdfLib.StandardFonts;
var rgb = PdfLib.rgb;

var express = require('express');
var app = express();
var port = 3000;

async function createPdf() {
	var pdfDoc = await PDFDocument.create();
	var timesRomanFont = await pdfDoc.embedFont(StandardFonts.TimesRoman);
	var page = pdfDoc.addPage();
	var { width, height } = page.getSize();
	var fontSize = 30;
	page.drawText('Hello World', {
		x: 50,
		y: height - 4 * fontSize,
		size: fontSize,
		font: timesRomanFont,
		color: rgb(0, 0.53, 0.71),
	});
	var pdfBytes = await pdfDoc.save();
        var pdfBuffer = Buffer.from(pdfBytes.buffer, 'binary');
	return pdfBuffer;
}

app.get('/', function(req, res) {
	createPdf().then(function(pdfBuffer) {
		res.status(200);
		res.type('pdf');
		res.send(buffer);
	}).catch(function (err) {
		res.status(500);
		res.send(err.message);
	});
});

app.listen(port, function() {
	console.log(`Example app listening on port ${port}!`);
});

Hello @dhollenbeck!
Your implementation looks good to me. Are you running into any problems with this? Or did you just want a sanity check of your code?

The example code above works correctly with no problems. I just posted it in case it helps others. @Hopding your work is awesome. Thank you so much.

Thanks for this example! It seems that by default express doesn't handle Uint8Array nicely and returns the data in a weird format. Solution seems to be to return a Buffer: https://github.com/expressjs/express/issues/2910

Thank you! I was doing this in a serverless environment, and was wondering what was causing an issue! This works perfectly, even though Buffer is throwing an error in my env.

Thank you for solution.

I was already loosing my nerves on this. Thanks, you have saved my sanity.


Group matched terms

We matched records keywords with 160 terms from the soil health knowledge graph. These terms need to be grouped into categories (like 6 categories) for the catalogue filtering. The hierarchy can be defined and included into pycsw. Later on it can be added to the knowledge graph.  soilwise-he/soil-health-knowledge-graph#15
An example of the grouping: Benchmarks glossary
Current filtering bar: Soilwise Catalogue
Matched terms to be grouped:  terms.csv

Term
Count
Broader

soil
1893

nitrogen
564
soil chemical properties

water
529

ecosystems
486
soil functions

carbon
451
soil chemical properties

typological classification
374

soc
277
soil chemical properties

soil organic matter
201
soil chemical properties

climate
198
soil functions

biodiversity
192
soil functions

plants
174
soil functions

soil pollution
161
soil threats

intrinsic soil properties
124
soil properties

microbial biomass
116
soil biological properties

nutrients
111
soil functions

vegetation
107

land management
101

soil productivity
95
productivity

soil health
94

air
88

decomposition
87
soil functions

soil management
74

soil erosion
72
soil threats

bulk density
69
soil physical properties

organic carbon
67
soil chemical properties

soil properties
66

mineral fertilisers
60

desertification
58
Soil threats

soil threats
57

cation exchange capacity
57
soil chemical properties

respiration
56
soil biological properties

soil restoration
56

ecosystem services
52

soil physical properties
45

soil functions
44

food production
38
soil functions

water holding capacity
36
soil physical properties

ecosystem functions
34

soil stability
34
soil physical properties

mineralisation
34
soil function

soil structure
33
soil physical properties

soil protection
32

compaction
28
soil threats

plant residues
28
soil biological properties

productivity
27
soil functions

urbanisation
26
soil threats

land cover change
26

water conservation
24
soil functions

soil degradation
24
soil threats

soil biodiversity
22
soil functions

cultivation
22

agricultural subsidies
21

carbon stocks
21
soil chemical properties

compost
20

water quality
20

soil fertility
19
Soil functions

land degradation
19
Soil threats

soil variability
18
Soil properties

indicators
18

terrestrial ecosystems
17

risk assessment
16
soil threats

water purification
15
soil functions

soil organic carbon loss
15
soil threats

aggregate stability
15
soil physical properties

acidification
14
Soil threats

spatial data
13

contamination
12
soil threats

soil carbon stock
12
soil chemical properties

forest floors
12

air quality
11

stabilisation
11

sewage sludge
11

soil nutrient status
11
soil chemical properties

organic compounds
10

biomaterials
10

environmental quality
10

water erosion
10
soil threats

surface run-off
9

available water capacity
9
soil physical properties

micronutrient availability
9
soil chemical properties

antibiotics
9
contamination

mineral compounds
9

food security
9

hydrogen
9

oxygen
9

alfisols
8
soil classification

soil layers
8

digestate
8

luvisols
7
soil classification

time
7

earth
7

sustainable development goal
7

soil chemical properties
7
soil properties

soil biological activity
7
soil biological properties

wind erosion
6
soil threats

hydrological cycle
6

net biome productivity
6
productivity

land productivity
5
productivity

soil processes
5

water infiltration
5
soil physical properties

organic matter accumulation
5
soil processes

SOC content
5
soil chemical properties

soil health indicator
5

soil carbon stocks
5
soil chemical properties

nutrient depletion
5
soil threat

soil cover
4

soil sealing
4
soil physical properties

soil nutrient availability
4
soil chemical properties

agricultural management inputs
4

environmental degradation
3
soil threats

soil carbon concentrations
3
soil chemical properties

soil rehabilitation
3

space
3

climate resilience
3
soil functions

entisols
3
Soil classification

soil functioning
3

labile fraction of SOC
3
soil chemical properties

soc stock
3
soil chemical properties

leptosols
3
Soil classification

lixisols
3
Soil classification

water capacity
2
soil physical properties

chemical composition of SOC
2
soil chemical properties

crop yield response
2
soil biological properties

soil attributes
2

land cultivation
2

biochemical processes
2

soil potential
2

animal manure
2

soil quality
2

contaminated sites
2
soil threats

terrestrial layer
2

crusting
2
soil physical properties

degraded soils
2
soil threats

soil physical degradation
2
soil threats

animal health
2
soil services

SOM loss
2
soil threats

soil parameters
1

wind erosion rate
1
soil physical properties

thresholds
1

land management changes
1

soil services
1

society
1

soil threat
1

plant health
1
soil services

soil capability
1
soil functions

salinisation
1
soil threats

soil function indicators
1
soil functions

regulating services
1
ecosystem services

natural capital
1
soil functions

human health
1

spatial quantification
1

soil temperature fluctuations
1
soil physical properties

soil condition
1
soil physical properties

structural soil stability loss
1
soil threats

soil biological properties
1
soil properties

developing countries
1

soil physical properties
1
soil properties

soil excavation
1
soil threats

world reference base for soil resources
1
soil classification

Great effort @pvgenuchten !
A few quick comments at first sight:
I noticed terms like “soil chemical properties” and “chemical soil properties” are phrased differently. Unifying these under one consistent term would be helpful for clarity.
For terms like “soil nutrient availability” and “nutrients,” it could be worth thinking about whether they both fit well under “Chemical soil property” or if it makes sense to create a new subcategory for granularity.
Some terms, such as “soil biodiversity” and “biodiversity,” seem to show up in different categories, which might make them a bit unclear. Maybe defining each category’s scope more clearly could help avoid overlaps like this.

risk assessment | brother | Soil treats
organic matter accumulation - brother - soil processes
regulating services  - brother - ecosystem services

@lbtgnn68 I added your suggestions to the table above, would be good to move this to a dedicated table file

Again,
@pvgenuchten , @Aricha9801, would it be feasible to manage our SKOSs with some dedicated tool?

Term
Broader

air   quality
human health

animal   manure
biomaterials

biochemical   processes
soil processes

biomaterials
agricultural management inputs

compost
biomaterials

cultivation
soil services

digestate
biomaterials

food   security
human health

forest   floors
soil cover

land   cover change
indicators

land   cultivation
soil cover

land   management changes
indicators

mineral   compounds
soil chemical properties

mineral   fertilisers
agricultural management inputs

organic   compounds
soil chemical properties

sewage   sludge
biomaterials

soil   quality
human health

surface   run-off
soil physical properties

vegetation
soil cover

water   quality
human health

Here the best I could do. @cdonmez16 , @fennyvanegmond , please check about consistents of term associations!

Broader
Term
Count

agricultural   management inputs
biomaterials
10

agricultural   management inputs
mineral fertilisers
60

biochemical   processes
decomposition
87

biochemical   processes
mineralisation
34

biochemical   processes
stabilisation
11

biomaterials
animal manure
2

biomaterials
compost
20

biomaterials
digestate
8

biomaterials
plant   residues
28

biomaterials
sewage sludge
11

carbon
carbon   stocks
21

carbon
organic   carbon
67

carbon
soil   carbon concentrations
3

carbon
soil   carbon stocks
5

contamination
antibiotics
9

developing   countries
sustainable development goal
7

earth
space
3

earth
terrestrial layer
2

ecosystem   services
biodiversity
192

ecosystem   services
climate   resilience
3

ecosystem   services
environmental quality
10

ecosystem   services
food   production
38

ecosystem   services
hydrological cycle
6

ecosystem   services
regulating   services
1

ecosystem   services
soil services
1

ecosystems
ecosystem functions
34

ecosystems
ecosystem services
52

environmental   quality
animal   health
2

environmental   quality
human health
1

environmental   quality
plant   health
1

human   health
air quality
11

human   health
food security
9

human   health
soil quality
2

human   health
water quality
20

indicators
land cover change
26

indicators
land management changes
1

indicators
thresholds
1

land   management
agricultural management inputs
4

natural   capital
time
7

organic   carbon
soc
277

organic   carbon
soil   organic matter
201

organic   compounds
carbon
451

organic   compounds
hydrogen
9

organic   compounds
oxygen
9

productivity
crop   yield response
2

productivity
land   productivity
5

productivity
net   biome productivity
6

productivity
soil   productivity
95

regulating   services
organic   matter accumulation
5

regulating   services
water   conservation
24

regulating   services
water   purification
15

soc
chemical   composition of SOC
2

soc
labile   fraction of SOC
3

soc
SOC   content
5

soc
soc   stock
3

soil   biological properties
microbial   biomass
116

soil   biological properties
respiration
56

soil   biological properties
soil   biological activity
7

soil   carbon stocks
soil   carbon stock
12

soil   chemical properties
cation   exchange capacity
57

soil   chemical properties
micronutrient   availability
9

soil   chemical properties
mineral compounds
9

soil   chemical properties
organic compounds
10

soil   chemical properties
soil   nutrient availability
4

soil   chemical properties
soil   nutrient status
11

soil   classification
alfisols
8

Soil   classification
entisols
3

Soil   classification
leptosols
3

Soil   classification
lixisols
3

soil   classification
luvisols
7

soil   cover
forest floors
12

soil   cover
land cultivation
2

soil   cover
vegetation
107

soil   function indicators
soil   biodiversity
22

soil   functions
natural   capital
1

Soil   functions
soil   fertility
19

soil   functions
soil   function indicators
1

soil   nutrient availability
nitrogen
564

soil   organic carbon loss
SOM   loss
2

soil   physical properties
aggregate   stability
15

soil   physical properties
available   water capacity
9

soil   physical properties
bulk   density
69

soil   physical properties
soil   condition
1

soil   physical properties
soil   stability
34

soil   physical properties
soil   structure
33

soil   physical properties
surface run-off
9

soil   physical properties
water   capacity
2

soil   physical properties
water   holding capacity
36

soil   physical properties
wind   erosion rate
1

soil   processes
biochemical processes
2

soil   processes
soil   temperature fluctuations
1

soil   processes
water   infiltration
5

soil   properties
intrinsic   soil properties
124

soil   properties
soil attributes
2

soil   properties
soil   biological properties
1

soil   properties
soil   chemical properties
7

soil   properties
soil parameters
1

soil   properties
soil physical properties
45

soil   services
cultivation
22

soil   services
nutrients
111

Soil   threats
acidification
14

soil   threats
compaction
28

soil   threats
contamination
12

Soil   threats
crusting
2

Soil   threats
desertification
58

soil   threats
environmental   degradation
3

Soil   threats
land   degradation
19

Soil   threats
nutrient   depletion
5

soil   threats
salinisation
1

soil   threats
soil   degradation
24

soil   threats
soil   erosion
72

soil   threats
soil   organic carbon loss
15

soil   threats
soil   physical degradation
2

soil   threats
soil   pollution
161

Soil   threats
soil   sealing
4

soil   threats
soil threat
1

soil   threats
structural   soil stability loss
1

soil   threats
urbanisation
26

soil   threats
water   erosion
10

soil   threats
wind   erosion
6

spatial   data
spatial quantification
1

spatial   quantification
contaminated   sites
2

spatial   quantification
degraded   soils
2

spatial   quantification
productivity
27

spatial   quantification
risk   assessment
16

spatial   quantification
soil   capability
1

spatial   quantification
soil   variability
18

terrestrial   ecosystems
air
88

terrestrial   ecosystems
plants
174

terrestrial   ecosystems
society
1

terrestrial   ecosystems
soil
1893

terrestrial   ecosystems
water
529

terrestrial   layer
terrestrial ecosystems
17

agricultural subsidies
21

climate
198

developing countries
1

earth
7

ecosystems
486

indicators
18

land management
101

soil cover
4

soil functioning
3

soil functions
44

soil health
94

soil health indicator
5

soil layers
8

soil management
74

soil potential
2

soil processes
5

soil properties
66

soil protection
32

soil rehabilitation
3

soil restoration
56

soil threats
57

spatial data
13

typological classification
374

thanx @lbtgnn68 for your efforts, we're currently processing the file to a real csv open to your contributions.
related to your question on skos/rdf, yes, the idea is we bring this knowledge into the knowledge graph, advertised via https://voc.soilwise-he.containers.wur.nl/ and https://sparql.soilwise-he.containers.wur.nl/sparql/

Just check about my last update of the table... Now I stop updating it!

Indee I noticed that https://soilhealthbenchmarks.eu/glossary/ had already grouped those terms so I cannot add any support. My aggregation was just tempative and is not finalized. Cannot you reuse their contribution?


Fix typo and link to your blog

Hallo!
I appreciate your openness, I hope other companies will get inspired by it.
I was reading your document while making an application and noticed a typo and a missing link. 👍
Fix typo in hiring_process section
Add link in what_love_picnic section

@Mordavolt Glad to be of help! :)


prevent misuse of PyTuple_Pack

This prevents simple mistakes such as the following
https://github.com/jpype-project/jpype/blob/66f8c6c07e051eb430326418798736004b0f833b/native%2Fpython%2Fpyjp_number.cpp#L390

Minor suggestion.... given that all uses of this function should be placed in a JPPyObject wrapper via call to we don't leak it would seem like combining the two would make sense.   It would take some minor reworking of a few sections which were already dangerous for exceptions.

Minor suggestion.... given that all uses of this function should be placed in a JPPyObject wrapper via call to we don't leak it would seem like combining the two would make sense.   It would take some minor reworking of a few sections which were already dangerous for exceptions.

Agreed. I'll do this tonight.

The changes were mostly painless. I only had to think about one change which was in PyJPClass_FromSpecWithBases. I left a comment where it should not be used in that function.

Merge for upcoming release.


Segmentation Fault - Upon page.open

When running this script with version 1.9.0 of PhantomJS, I get a segmentation fault:
var system = require ("system");
var fs = require ("fs");
var page = require ("webpage").create ();

if (system.args.length < 2) {
    console.log ("Page not specified.");
    phantom.exit (1);
}
var url = system.args[1];

page.viewportSize = { width: 800, height: 800 };

page.open (url, function (status) {
    // The page is now loaded, maybe.
    if (status !== "success") {
	// The page failed to load!
	console.log ("Failed to load page: " + url);
	phantom.exit (1);
    } else {
	page.render ("4ch_test.png");
	console.log ("Starting...");
	// The page did load after all.
	page.evaluate (function () {
	    // Strip out the image URLS.
	    console.log ("Images on this page are:");
	    var image_links_list = document.querySelectorAll ("a.fileThumb");
	    for (i = 0; i < image_links_list.length; i ++) {
		console.log ("https:" + image_links_list[i].href);
	    }
	});

	// Exit successfully.
	phantom.exit (0);
    }
});

The script is used to aggregate a list of all images in a thread on the 4chan imageboard. It is called with the thread URL an its first command line argument. The thread must be active, i.e. not 404 in order to reproduce the segmentation fault.
The segmentation fault occurs shortly after spawning a new thread. The new thread's entry function has been given a void* pointer to NULL. I put a breakpoint on pthead_create to observe the stack just before the new thread is entered. Although not shown below, this seems to be during the domain name resolution stage for www.google-analytics.com. Some GDB output:
(gdb) b pthread_create
Breakpoint 1 at 0x40ee80
(gdb) r get_imgs.js http://boards.4chan.org/wg/res/5600995
Starting program: /usr/bin/phantomjs get_imgs.js http://boards.4chan.org/wg/res/5600995

... Then later (the number of breakpoints encountered appears random) ...
Breakpoint 1, 0x000000000040ee80 in pthread_create@plt ()
(gdb) bt
#0  0x000000000040ee80 in pthread_create@plt ()
#1  0x0000000001a0bf77 in QThread::start (this=this@entry=0x7fffa4006720, priority=priority@entry=QThread::InheritPriority) at thread/qthread_unix.cpp:640
#2  0x0000000001a0255d in QThreadPoolPrivate::startThread (this=this@entry=0x7fffa4005400, runnable=runnable@entry=0x7fffa4004c00) at concurrent/qthreadpool.cpp:260
#3  0x0000000001a02c83 in QThreadPoolPrivate::tryStart (this=0x7fffa4005400, task=0x7fffa4004c00) at concurrent/qthreadpool.cpp:178
#4  0x0000000001a031e3 in QThreadPool::start (this=this@entry=0x7fffa4005340, runnable=0x7fffa4004c00, priority=priority@entry=0) at concurrent/qthreadpool.cpp:474
#5  0x000000000198ffd6 in QHostInfoLookupManager::work (this=this@entry=0x7fffa40052d0) at kernel/qhostinfo.cpp:633
#6  0x00000000019900d3 in QHostInfoLookupManager::scheduleLookup (this=this@entry=0x7fffa40052d0, r=r@entry=0x7fffa4004c00) at kernel/qhostinfo.cpp:652
#7  0x000000000199103d in QHostInfo::lookupHost (name=..., receiver=receiver@entry=0x7fffa4006a60, member=member@entry=0x1fb5b90 "1_q_startConnecting(QHostInfo)") at kernel/qhostinfo.cpp:202
#8  0x0000000001991b7e in qt_qhostinfo_lookup (name=..., receiver=receiver@entry=0x7fffa4006a60, member=member@entry=0x1fb5b90 "1_q_startConnecting(QHostInfo)",
    valid=valid@entry=0x7fffab6f9f50, id=id@entry=0x7fffa40171cc) at kernel/qhostinfo.cpp:722
#9  0x00000000019b06ba in QAbstractSocket::connectToHostImplementation (this=0x7fffa4006a60, hostName=..., port=<optimized out>, openMode=...) at socket/qabstractsocket.cpp:1417
#10 0x00000000019b25c9 in QAbstractSocket::qt_static_metacall (_o=<optimized out>, _id=<optimized out>, _a=<optimized out>, _c=<optimized out>)
    at .moc/release-static/moc_qabstractsocket.cpp:154
#11 0x0000000001b01215 in QMetaMethod::invoke (this=this@entry=0x7fffab6fa310, object=object@entry=0x7fffa4006a60, connectionType=connectionType@entry=Qt::DirectConnection, returnValue=...,
    val0=..., val1=..., val2=..., val3=..., val4=..., val5=..., val6=..., val7=..., val8=..., val9=...) at kernel/qmetaobject.cpp:1664
#12 0x0000000001b03330 in QMetaObject::invokeMethod (obj=0x7fffa4006a60, member=member@entry=0x1fb5c5b "connectToHostImplementation", type=type@entry=Qt::DirectConnection, ret=..., val0=...,
    val1=..., val2=..., val3=..., val4=..., val5=..., val6=..., val7=..., val8=..., val9=...) at kernel/qmetaobject.cpp:1179
#13 0x00000000019a87f9 in invokeMethod (val9=..., val8=..., val7=..., val6=..., val5=..., val4=..., val3=..., val2=..., val1=..., val0=..., type=Qt::DirectConnection,
    member=0x1fb5c5b "connectToHostImplementation", obj=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs.h:418
#14 QAbstractSocket::connectToHost (this=<optimized out>, hostName=..., port=port@entry=80, openMode=...) at socket/qabstractsocket.cpp:1332
#15 0x00000000019f2e1f in QHttpNetworkConnectionChannel::ensureConnection (this=0x7fffa4068538) at access/qhttpnetworkconnectionchannel.cpp:626
#16 0x00000000019ef690 in QHttpNetworkConnectionPrivate::_q_startNextRequest (this=this@entry=0x7fffa4005610) at access/qhttpnetworkconnection.cpp:862
#17 0x00000000019ef8f1 in QHttpNetworkConnectionPrivate::queueRequest (this=0x7fffa4005610, request=...) at access/qhttpnetworkconnection.cpp:501
#18 0x00000000019efb89 in QHttpNetworkConnection::sendRequest (this=<optimized out>, request=...) at access/qhttpnetworkconnection.cpp:931
#19 0x000000000197b4a3 in QHttpThreadDelegate::startRequest (this=0x2d81150) at access/qhttpthreaddelegate.cpp:293
#20 0x00000000019d87cd in QHttpThreadDelegate::qt_static_metacall (_o=0x2d81150, _c=2876218464, _id=27314080, _a=0x7fffa4006720) at .moc/release-static/moc_qhttpthreaddelegate_p.cpp:116
#21 0x0000000001b0ad6e in QObject::event (this=0x2d81150, e=<optimized out>) at kernel/qobject.cpp:1191
#22 0x0000000001484f6c in QApplicationPrivate::notify_helper (this=this@entry=0x2a3c880, receiver=receiver@entry=0x2d81150, e=e@entry=0x2d81830) at kernel/qapplication.cpp:4562
#23 0x000000000148a9d7 in QApplication::notify (this=0x7fffffffdb90, receiver=0x2d81150, e=0x2d81830) at kernel/qapplication.cpp:4423
#24 0x0000000001af956d in QCoreApplication::notifyInternal (this=0x7fffffffdb90, receiver=receiver@entry=0x2d81150, event=event@entry=0x2d81830) at kernel/qcoreapplication.cpp:946
#25 0x0000000001afc4cd in sendEvent (event=0x2d81830, receiver=0x2d81150) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#26 QCoreApplicationPrivate::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0x2d1cb30) at kernel/qcoreapplication.cpp:1567
#27 0x0000000001b202df in QEventDispatcherUNIX::processEvents (this=0x7fffa40008c0, flags=...) at kernel/qeventdispatcher_unix.cpp:909
#28 0x0000000001af851f in QEventLoop::processEvents (this=this@entry=0x7fffab6faea0, flags=...) at kernel/qeventloop.cpp:149
#29 0x0000000001af8846 in QEventLoop::exec (this=this@entry=0x7fffab6faea0, flags=...) at kernel/qeventloop.cpp:200
#30 0x0000000001a0a4df in QThread::exec (this=<optimized out>) at thread/qthread.cpp:542
#31 0x0000000001a0c8bf in QThreadPrivate::start (arg=0x2d1ca40) at thread/qthread_unix.cpp:338
#32 0x00007ffff5180f3a in ?? ()
#33 0x0000000000000000 in ?? ()
(gdb) up 7
#7  0x000000000199103d in QHostInfo::lookupHost (name=..., receiver=receiver@entry=0x7fffa4006a60, member=member@entry=0x1fb5b90 "1_q_startConnecting(QHostInfo)") at kernel/qhostinfo.cpp:202
202	in kernel/qhostinfo.cpp
(gdb) print name
$16 = (const QString &) @0x7fffab6fa6b0: {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 2913}, alloc = 0, size = 0, data = 0x29f929a <QString::shared_null+26>,
    clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 5}, alloc = 0, size = 0,
    data = 0x29f927a <QString::shared_empty+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x2d7da00,
  static codecForCStrings = 0x0}
(gdb) print *(name.d)
$17 = {ref = {_q_value = 8}, alloc = 12, size = 12, data = 0x2d7da1a, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 1, reserved = 890, array = {49}}
(gdb) print * (const char[24] *) ((name.d)->data)
$18 = "1\000.\000t\000.\000\064\000c\000d\000n\000.\000o\000r\000g"
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
[Switching to LWP 22762]
JSC::cti_op_jtrue (args=0x7fffffffd220) at ../../JavaScriptCore/jit/JITStubs.cpp:2846
2846	../../JavaScriptCore/jit/JITStubs.cpp: No such file or directory.
(gdb) bt
#0  JSC::cti_op_jtrue (args=0x7fffffffd220) at ../../JavaScriptCore/jit/JITStubs.cpp:2846
#1  0x00007fffac0d92bf in ?? ()
#2  0x0000000000000000 in ?? ()
(gdb) print args
$19 = (void **) 0x7fffffffd220
(gdb) print *args
$20 = (void *) 0x0

Please upgrade to PhantomJS 2. 1.9.x is no longer supported, and known to have many crasher bugs that are fixed in 2 version.


How to close the FPS counter on Bloxstrap?

I think you must have imported it as a FFlag or something, because iirc that only shows up if FFlagDebugDisplayFPS is set true. And there is no way to toggle it off without removing the FFlag from your settings.
To remove it go to Fast Flags then scroll down to the Fast Flag Editor then find FFlagDebugDisplayFPS and either set it to False or just remove it.
But I could very well be wrong about the FFlag name.


Support Vietnamese

Support translate number to words for Vietnamese

Coverage decreased (-0.06%) to 99.232% when pulling 1f4eae3058322a2f4bca50aeb044d29051662c28 on duyetpt:feature/vietnamese into<PHONE_NUMBER>4b89516edd84273b78a776af1c348d on kslazarev:master.

Coverage increased (+0.7%) to 100.0% when pulling 717b28746f3c23e03f66c14be5ffe6fd31021c4a on duyetpt:feature/vietnamese into<PHONE_NUMBER>4b89516edd84273b78a776af1c348d on kslazarev:master.

Coverage increased (+0.7%) to 100.0% when pulling 717b28746f3c23e03f66c14be5ffe6fd31021c4a on duyetpt:feature/vietnamese into<PHONE_NUMBER>4b89516edd84273b78a776af1c348d on kslazarev:master.

Thank you!


Timeout not working as expected with MQTT

Ubuntu 14.04
Master Branch
Python 2.7.6
Protocol:  MQTT
Timeouts are taking longer than I expect, in the example below my expectation is 5 seconds for timeout. I believe I am setting the timeout setting properly.
I am testing this by allowing the code to proceed all the way to the first print statement, where I have a breakpoint. I then disconnect my eth0 and wait for the timeout.
Code Snippet
        self.client.set_option("messageTimeout", 5)

        .....

        print time.time()
        self.client.send_event_async(event, send_confirmation_callback, 1)

        while WAITING_ON_RESPONSE:
            time.sleep(.250)

        print CONFIRMATION_RESULT
        if CONFIRMATION_RESULT == IoTHubClientConfirmationResult.MESSAGE_TIMEOUT:
            print "timeout"
            print time.time()

The log output
1496425120.14
MESSAGE_TIMEOUT
timeout
1496425242.05

@bearrito thanks for reporting this issue.  I will work getting a local repro and provide updates as I have them.

No problem!
Please do let me know if you need any help. I'm happy to pull a bugfix branch and try on my side.

@bearrito in reviewing the sample, MESSAGE_TIMEOUT is declared in milliseconds, are you sure you have set your value to 5 seconds, not 5 milliseconds?
# messageTimeout - the maximum time in milliseconds until a message times out.
# The timeout period starts at IoTHubClient.send_event_async.
# By default, messages do not expire.
MESSAGE_TIMEOUT = 50000

This declares the timeout as 50 seconds.

I'll check, but that seems like it would strengthen the case for timeout having a bug?

Went back and checked. Looks like a problem in the way we were building clients.
For any future readers, I can attest this is working fine with the master branch at the time of writing.


How to break a big continuous line?

I have this line on my grammar:
        productions : new_line* ( space* non_terminal_start space* "->" space* non_terminals space* end_symbol )* space* non_terminal_start space* "->" space* non_terminals space* end_symbol?

I would like to break it like this:
        productions : new_line* ( space* non_terminal_start space* "->" space* non_terminals space* end_symbol )*
                      space* non_terminal_start space* "->" space* non_terminals space* end_symbol?

But the lark does not like it when I try to run it:
Traceback (most recent call last):
  File "F:\Python\lib\site-packages\lark\parsers\lalr_parser.py", line 46, in get_action
    return states[state][key]
KeyError: 'OP'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "unit_tests.py", line 7, in <module>
    from source.grammar import ChomskyGrammar
  File "D:\grammar.py", line 21, in <module>
    class ChomskyGrammar():
  File "D:\grammar.py", line 67, in ChomskyGrammar
    """, start='productions' )
  File "F:\Python\lib\site-packages\lark\lark.py", line 153, in __init__
    self.grammar = load_grammar(grammar, source)
  File "F:\Python\lib\site-packages\lark\load_grammar.py", line 599, in load_grammar
    tree = self.canonize_tree.transform( self.parser.parse(grammar_text+'\n') )
  File "F:\Python\lib\site-packages\lark\parser_frontends.py", line 37, in parse
    return self.parser.parse(token_stream)
  File "F:\Python\lib\site-packages\lark\parsers\lalr_parser.py", line 71, in parse
    action, arg = get_action(token.type)
  File "F:\Python\lib\site-packages\lark\parsers\lalr_parser.py", line 50, in get_action
    raise UnexpectedToken(token, expected, seq, i)
lark.common.UnexpectedToken: Unexpected token Token(OP, '*') at line 3, column 29.
Expected: dict_keys(['_COLON', '_DOT'])
Context: <no context>

I tried to put "\" (backslash) at the end of the first line, but still the same.
It work fine if I do not break the line and keep it like this:
        productions : new_line* ( space* non_terminal_start space* "->" space* non_terminals space* end_symbol )* space* non_terminal_start space* "->" space* non_terminals space* end_symbol?

You're right, the syntax currently doesn't support it. I recommend that you write it differently anyway:
    productions : new_line* ( nts_space "->" nt_space end_symbol )* nts_space "->" nt_space end_symbol?
    nt_space: space* non_terminals space*
    nts_space: space* non_terminal_start space*

Also, it's better to use %ignore SPACE instead of adding it all over the grammar, both for readability and performance.

I was using %ignore SPACE but one of my productions need to match an space explicitly:
production    : ( ( epsilon | terminal | non_terminal )+ space+ )*

So my tree should look like this for the input expression S -> S SS:
production
  non_terminal  S
  non_terminal
    S
    S
production
  epsilon

But it does not work like this when I use %ignore SPACE. My tree most times look like this for the input expression S -> S SS:
production
  non_terminal
    S
    S
    S
production
  epsilon

When using dynamic Earley (which is the default algorithm), you can %ignore SPACE and still use SPACE terminals explicitly when you need to.

It seems to not be working. This is my full grammar with ignore spaces:
    _parser = lark.Lark( r"""
        productions   : new_line* ( non_terminal_start "->" non_terminals end_symbol )* non_terminal_start "->" non_terminals end_symbol?
        non_terminals : production ( "|" production )*
        production    : ( ( epsilon | terminal | non_terminal )+ space+ )* ( epsilon | terminal | non_terminal )+
        // Forces them to appear in the tree as branches
        epsilon         : [] | "&"+
        end_symbol      : ";"* new_line new_line*
        terminal        : ( SIGNED_NUMBER | LCASE_LETTER | dash_phi_hyphen )+
        non_terminal    : UCASE_LETTER+ ( UCASE_LETTER | DIGIT | quote )*
        new_line        : NEWLINE
        quote           : "'"
        dash_phi_hyphen : "-"
        space           : " "

        // Rename the start symbol, so when parsing the tree it is simple to find it
        non_terminal_start : non_terminal

        // Import common definitions
        %import common.INT
        %import common.DIGIT
        %import common.UCASE_LETTER
        %import common.LCASE_LETTER
        %import common.SIGNED_NUMBER
        %import common.NEWLINE
        %import common.WS_INLINE

        // Set to ignore white spaces
        %ignore WS_INLINE
    """, start='productions' )

Parsing S -> & | SS SSS results wrongly in S -> & | SSSSS.
This is my grammar with spaces well defined (without ignore spaces):
    _parser = lark.Lark( r"""
        productions   : new_line* ( space* non_terminal_start space* "->" space* non_terminals space* end_symbol )* space* non_terminal_start space* "->" space* non_terminals space* end_symbol?
        non_terminals : production ( "|" production )*
        production    : space* ( ( epsilon | terminal | non_terminal )+ space+ )* ( epsilon | terminal | non_terminal )+ space*

        // Forces them to appear in the tree as branches
        epsilon         : [] | "&"+
        end_symbol      : ";"* space* new_line ( new_line | space )*
        terminal        : ( SIGNED_NUMBER | LCASE_LETTER | dash_phi_hyphen )+
        non_terminal    : UCASE_LETTER+ ( UCASE_LETTER | DIGIT | quote )*
        new_line        : NEWLINE
        quote           : "'"
        dash_phi_hyphen : "-"
        space           : " "

        // Rename the start symbol, so when parsing the tree it is simple to find it
        non_terminal_start : non_terminal

        // Import common definitions
        %import common.INT
        %import common.DIGIT
        %import common.UCASE_LETTER
        %import common.LCASE_LETTER
        %import common.SIGNED_NUMBER
        %import common.NEWLINE
        %import common.WS_INLINE

        // Set to ignore white spaces
        // %ignore WS_INLINE
    """, start='productions' )

Parsing S -> & | SS SSS results correctly in S -> & | SS SSS.

The thing is, both S -> & | SS SSS and S -> & | SSSSS are legal parses in your grammar. The second version chooses the "correct" parse due to a chance of how the weighting works. It might not hold if you make too many changes to the grammar.
If it works for you, that's fine. But what I would do, is either

Specify the correct amounts / ratio in the grammar (just so you're away, there is the ~ operator)

Use ambiguity="explicit" and choose the right derivation myself.

I used ambiguity, but the output have no _ambig node for the input S -> S SS | &:
+ productions
+   new_line
+
+   non_terminal_start
+     non_terminal  S
+   non_terminals
+     production
+       non_terminal
+         S
+         S
+         S
+     production
+       epsilon
+   end_symbol
+     new_line

Grammar:
    _parser = lark.Lark( r"""
        productions   : new_line* ( non_terminal_start "->" non_terminals end_symbol )* non_terminal_start "->" non_terminals end_symbol?
        non_terminals : production ( "|" production )*
        production    : ( ( epsilon | terminal | non_terminal )+ space+ )* ( epsilon | terminal | non_terminal )+

        // Forces them to appear in the tree as branches
        epsilon         : [] | "&"+
        end_symbol      : ";"* new_line+
        terminal        : ( SIGNED_NUMBER | LCASE_LETTER | dash_phi_hyphen )+
        non_terminal    : UCASE_LETTER+ ( UCASE_LETTER | DIGIT | quote )*
        new_line        : NEWLINE
        quote           : "'"
        dash_phi_hyphen : "-"
        space           : " "

        // Rename the start symbol, so when parsing the tree it is simple to find it
        non_terminal_start : non_terminal

        // Tells the tree-builder to inline this branch if it has only one member
        ?non_terminal_epsilon : non_terminal | epsilon

        // Stops Lark from automatically filtering out these literals from the tree
        null   : "null"
        true   : "true"
        false  : "false"

        // Import common definitions
        %import common.INT
        %import common.DIGIT
        %import common.UCASE_LETTER
        %import common.LCASE_LETTER
        %import common.SIGNED_NUMBER
        %import common.NEWLINE
        %import common.WS_INLINE

        // Set to ignore white spaces
        %ignore WS_INLINE
    """, start='productions', parser='earley', ambiguity="explicit" )

Ignore the last message. Running it the example outside the application showed an ambiguous tree:
_ambig
  productions
    non_terminal_start
      non_terminal  S
    non_terminals
      production
        non_terminal
          __anon_plus_9 S
          __anon_star_10
            S
            S
      production
        epsilon &
  productions
    non_terminal_start
      non_terminal  S
    non_terminals
      production
        non_terminal
          __anon_plus_9 S
          __anon_star_10
            S
            S
      production
        epsilon
        epsilon
  productions
    non_terminal_start
      non_terminal  S
    non_terminals
      production
        non_terminal
          __anon_plus_9 S
          __anon_star_10
            S
            S
      production
        epsilon
        space
        epsilon &
  productions
    non_terminal_start
      non_terminal  S
    non_terminals
      production
        non_terminal
          __anon_plus_9 S
          __anon_star_10
            S
            S
      production
        epsilon
        space
        epsilon
        epsilon
  productions
    non_terminal_start
      non_terminal  S
    non_terminals
      production
        non_terminal
          __anon_plus_9 S
          __anon_star_10
            S
            S
      production
        epsilon &
        epsilon
  productions
    non_terminal_start
      non_terminal  S
    non_terminals
      production
        non_terminal
          __anon_plus_9 S
          __anon_star_10
            S
            S
      production
        epsilon
        space
        epsilon &
        epsilon

I managed to nail down the ambiguity to this minimal example:
#! /usr/bin/env python
# -*- coding: utf-8 -*-

import lark

_parser = lark.Lark( r"""
    productions   : new_line* non_terminal_start "->" non_terminals end_symbol?
    non_terminals : production
    production    : ( ( epsilon | terminal | non_terminal )+ space )+

    epsilon         : "&"
    end_symbol      : new_line
    terminal        : LCASE_LETTER
    non_terminal    : UCASE_LETTER
    new_line        : NEWLINE
    quote           : "'"
    dash_phi_hyphen : "-"
    space           : " "

    non_terminal_start : non_terminal

    %import common.UCASE_LETTER
    %import common.LCASE_LETTER
    %import common.NEWLINE
    %import common.WS_INLINE
    %ignore WS_INLINE
""", start='productions', parser='earley', ambiguity="explicit" )

tree = _parser.parse( "S -> S S " )
print( tree.pretty() )

Changing the line:
production    : ( ( epsilon | terminal | non_terminal )+ space )+

To:
production    : ( ( epsilon | terminal | non_terminal )+ space )

Solves the ambiguity. If I understand correctly, the ambiguity is caused by the white space. Then, the only way to fix it, is not to ignore the whitespaces?

You're right, the syntax currently doesn't support it.

Is this still true? It seems that in lark 1.1.8 backslashes do allow you to break up a long line, but I'm not sure.
This is valid, for example:
filter_condition: \
    "start" "(" DATE_STRING ")" -> start
    | "end" "(" DATE_STRING ")" -> end

But not this:
filter_condition: \
    // a comment here messes things up
    "start" "(" DATE_STRING ")" -> start
    | "end" "(" DATE_STRING ")" -> end

This might be unintentional behavior because I don't see documentation for it.

You're right, the syntax currently doesn't support it.

Is this still true? It seems that in lark 1.1.8 backslashes do allow you to break up a long line, but I'm not sure.

I think so. I was trying to break a lengthy statement while you broke it at the | operator in your example.

But not this:
filter_condition: \
    // a comment here messes things up
    "start" "(" DATE_STRING ")" -> start
    | "end" "(" DATE_STRING ")" -> end

Adding a backlash at the end of the comment should work. At least this is how you do it in one-line commands break across multiple lines in Linux bash scripting:
filter_condition: \
    // a comment here messes things up \
    "start" "(" DATE_STRING ")" -> start
    | "end" "(" DATE_STRING ")" -> end

Adding a backslash to the end of the comment doesn't seem to do anything. It seems that the backslash is a very crude line continuation "instruction" (dunno if I have the terminology correct), so this:
filter_condition: \
    // a comment here messes things up \
    "start" "(" DATE_STRING ")" -> start
    | "end" "(" DATE_STRING ")" -> end

Gets translated to this:
filter_condition: // a comment here messes things up
    "start" "(" DATE_STRING ")" -> start
    | "end" "(" DATE_STRING ")" -> end

Which is equivalent to this:
filter_condition:
    "start" "(" DATE_STRING ")" -> start
    | "end" "(" DATE_STRING ")" -> end

Which is invalid. 😄
I tested this locally and all three versions yield similar errors.


allow file revisioning to be disabled

@TamCore, Thanks for the pull request. I added support for this in 953c6e535c036fde112885f9811581e25f552616. If you're still using the project, would you mind pulling the new code base and evaluating this new feature?

Actually, I didn't add support for that yet. My bad.
I used your suggestion to create #62 to handle disabling backups and also added a config option to exclude file backups by path and wildcard pattern. I would love your feedback if you're still using the project.

FYI this feature has been merged into the master branch. Add BACKUPS=false to the config file to disable backups locally.


Error when subscribe to snapshotChanges or any observable

Version info
@angular/cli: 1.6.8
@angular/core: ^5.2.0
firebase: ^5.0.2
angularfire2: ^5.0.0-rc.9
Node: 8.9.4
How to reproduce these conditions
const observable = this.todoDB.snapshotChanges().subscribe()
or
*ngFor="let item of observable | async"
Debug output
Errors in the JavaScript console
zone.js:192 Uncaught TypeError: Object(...) is not a function
at SwitchMapSubscriber.eval [as project] (changes.js:7)
at SwitchMapSubscriber._next (switchMap.js:91)
at SwitchMapSubscriber.Subscriber.next (Subscriber.js:95)
at RefCountSubscriber.Subscriber._next (Subscriber.js:131)
at RefCountSubscriber.Subscriber.next (Subscriber.js:95)
at Subject.next (Subject.js:56)
at ConnectableSubscriber.Subscriber._next (Subscriber.js:131)
at ConnectableSubscriber.Subscriber.next (Subscriber.js:95)
at Notification.observe (Notification.js:32)
at AsyncAction.DelaySubscriber.dispatch (delay.js:91)
Expected behavior
Subscribe to an observable
Actual behavior
Cannot subscribe

Your sample actually returns a subscription, not an observable.
const subscription = this.todoDB.snapshotChanges().subscribe()

Instead leave off the subscribe to get the observable
const observable = this.todoDB.snapshotChanges();


Treaty 2 unknown status and value types in error

The Issue
const { data, error } = await client.api.inbox({ chatId: chatId }).get()

// the types show as :
// const data: {
//                id: number
//                message: string
//               }

// const error: {
//              status: unknown
//              value: unknown
                 }

I'm not sure if this is how its supposed to be with treaty 2 but I had proper error types in v1

Same here — I'd expect it to use the return type of my onError function:
.onError(({ code, error }): { code: string } | { code: string, details: ValidationError | string } => { ... })

But even with it explicitly defined here, the error type in the client is just unknown/unknown.

It seems viable to have errors be completely type safe, since the status codes are known (custom errors get registered with .error()), and value could just be the return type of onError...?


Changed AutoConfiguredNSubstituteCustomization to return finite sequences for abstract types implementing IEnumerable

This PR fixes #350.
It sets up auto-configured NSubstitute mocks that returns IEnumerator<T> and any abstract type implementing IEnumerable<T> to return a finite sequence.
Note that for interfaces like this:
public interface IMyList<T> : IEnumerable<T>
{
    int Count { get; }
}

list.Count will not be equal to list.Count(), since the former will be setup to return from AutoFixture while the latter will be processed by LINQ and will return the count of the GetEnumerator() items.

Thank you for submitting this pull request.
Right now, I'm extraordinarily busy, so may first have time to look at this next week :sweat:

Thank you for your contribution! It' now live as AutoFixture.AutoNSubstitute 3.24.1, and AutoFixture 3.24.1.


Added a new command to change version

Added upgrade command to change version of the litmusctl binary, works like sudo litmusctl update 1.1.0, tested on linux arm64 architecture. It works for every version that exists, meaning not only it can upgrade but downgrade as well, but the command upgrade is already taken hence I chose update.
Fixes #3307

@kartikaysaxena the build pipeline is failing due to unused homeDir package name, this is not actually an issue, but as a fix you can replace "github.com/mitchellh/go-homedir" with homedir "github.com/mitchellh/go-homedir"


Extended functionality and documentation

Content of this PR:

Provide support for more GAP functions of the ToricVarieties_project, including Betti numbers.
Initiate documentation.

@lkastner @fingolfin : I am uncertain if I meet all Oscar standards with the documentation. I can produce the documentation locally (julia make.jl in the docs folder). What additional steps are needed to publish this documentation on github?
@lkastner Are you ok with the new wrapper functions?
@fingolfin I am uncertain what to make to the following Gap <-> Julia behaviour. On the one hand, execute th following in Julia:

using JToric
P2 = projective_space( 2 )
ith_betti_number( P2, 0 )
-2

The correct answer is 1, not -2.
The wrapper function ith_betti_number executes the corresponding gap function. If I directly execute this gap code, then I indeed obtain the correct answer 1 (after fixing a bug yesterday):

LoadPackage( "ToricVarieties" );
P2 := ProjectiveSpace( 2 );
ith_betti_number( P2, 0 );
1

So it looks as if the Gap return value 1 is turned into a -2 in Julia. Am I missing something? Suggestions?
[Aside: This is the reason why I am currently excluding the computation of the 0-th Betti numbers from the tests.]

For publishing: you'll need a step doing that in your GitHub Actions. This is described in the Documenter.jl documentation. For a practical example, see here for how GAP.jl does it -- you may or may not want to remove the part where it runs the doctests.

I'll look into the ith_betti_number weirdness.

@HereAround I could not reproduce the "-2" at first because I get this error instead:
julia> ith_betti_number(P2, 0)
#I  The Julia package 'Polymake' cannot be loaded.
ERROR: Error thrown by GAP: Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 2nd choice method found for `FacetInequalities' on 1 arguments at /Users/mhorn/.julia/artifacts/8f22bf2645df36936a8a74cea9de55d6070017ed/share/gap/lib/methsel2.g:249 called from
FacetInequalities( polytope ) at /Users/mhorn/.julia/gaproot/v4.12/pkg/NConvex/gap/Polytope.gi:789 called from
NormalFan( PolytopeOfVariety( variety ) ) at /Users/mhorn/.julia/packages/CapAndHomalg/PE2rB/pkg/ToricVarieties_project/ToricVarieties/gap/ProjectiveToricVarieties.gi:88 called from
FanOfVariety( variety ) at /Users/mhorn/.julia/packages/CapAndHomalg/PE2rB/pkg/ToricVarieties_project/ToricVarieties/gap/ToricVarieties.gi:1026 called from
<function "ithBettiNumber for toric varieties">( <arguments> )
 called from read-eval loop at *defin*:0

Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] ThrowObserver(depth::Int32)
   @ GAP ~/.julia/packages/GAP/9XZl9/src/GAP.jl:63
 [3] _call_gap_func(func::GAP.GapObj, a1::GAP.GapObj, a2::Int64)
   @ GAP ~/.julia/packages/GAP/9XZl9/src/ccalls.jl:268
 [4] call_gap_func_nokw
   @ ~/.julia/packages/GAP/9XZl9/src/ccalls.jl:222 [inlined]
 [5] (::GAP.GapObj)(a1::GAP.GapObj, a2::Int64)
   @ GAP ~/.julia/packages/GAP/9XZl9/src/ccalls.jl:233
 [6] ith_betti_number(v::NormalToricVariety, i::Int64)
   @ JToric ~/Projekte/OSCAR/JToric/src/AttributesAndMethods.jl:583
 [7] top-level scope
   @ REPL[12]:1

I think this is caused by JConvex doing JuliaImportPackage("Polymake") -- but in the Julia project I have, there is only one top-level package (JToric), so this doesn't work, even though I have Polymake.jl installed.
This could be addressed in various ways; e.g. JToric could, in its __init__ function, do something like GAP.Globals.__Polymake_jl = Polymake and then JToric could look at the Julia module object... see also https://github.com/oscar-system/GAP.jl/issues/687

Indeed, with Polymake.jl loaded, I can also reproduce this from the GAP prompt, so I would suggest taking a look at the code in JConvex:
julia> JToric.GAP.prompt()
gap> LoadPackage( "ToricVarieties" ); # of course it was already loaded by JToric
true
gap> P2 := ProjectiveSpace( 2 );
<A projective toric variety of dimension 2>
gap> ithBettiNumber(P2, 0);
-2

Just to illustrate how I think one can avoid using JuliaImportPackage, consider this (executed in  Julia session after I did using JToric, Polymake)
julia> Polymake.version()
v"4.4.0"

julia> JToric.GAP.Globals.pm = Polymake
Polymake

julia> JToric.GAP.prompt()
gap> pm.version();
<Julia: v"4.4.0">

Ok. It seems we have multiple issues here.

Properly call/import Polymake in JToric. If I understand correctly, then you propose to extend the __init__ of JToric by JToric.GAP.Globals.pm = Polymake and then making the calls to Polymake via pm.prefered_function? I understand you correctly?
The ith_betti_number. Good point! Indeed

julia> using JToric;
julia> P2 = projective_space( 2 );
julia> GAP.Globals.FVector( GAP.Globals.FanOfVariety( P2.GapNTV ) )
GAP: [ 3, 0 ]

This should be the number of 1 and 2-dimensional cones, i.e. should be [3,3]. I will investigate.

Yes regarding point 1. -- except that pm was just an example, it might be better to call it something like __Polymake or __PolymakeFromJulia or so or POLYMAKE_JULIA_MODULE or whatever, just to avoid clashes with user objects.

Another thing: I noticed that in JConvex, you use JuliaEvalString a lot. That's inefficient and should almost never be necessary. It also leads to hard to debug code.
For example, if one defined pm as above, then this works just fine in GAP: pm.polytope.Polytope()
However, it also seems as if your function Polymake_V_Rep_command_string constantly creates new Polymake objects? Is there a reason why you don't just create one of these once, and keep it around? Or am I misunderstanding the code?

@fingolfin :
Thank you for suggesting these improvements! To handle them efficiently, I have opened the following issues:

https://github.com/oscar-system/JToric.jl/issues/40
https://github.com/homalg-project/ToricVarieties_project/issues/140
https://github.com/homalg-project/ToricVarieties_project/issues/141

I will try to close them soonish.

I am utterly surprised by the failures in Julia 1.4 to 1.7. Suggestions/pointers highly appreciated.
Here are a few observations:

The most common error in these failure is

Error thrown by GAP: Error, List Element: [3] must have an assigned value in

This in turn happens in NConvex's method RaysInFaces, the counter-part of which I recently modified in JConvex (see https://github.com/homalg-project/ToricVarieties_project/commit/e61debfafa0ff761f268b6ee40271c8a43a60ed4 and https://github.com/homalg-project/ToricVarieties_project/commit/7e27c8e11c58dbdfee09377c3cdc043760d5427f) to fix the issue with ith_betti_number. This would raise the suspicion that there may still be a related issue somewhere.

I increased the package version for the GAP-package JConvex after this change. However, I forgot to update this in JToric, i.e. forgot to change

GAP.Packages.load( "JConvex", "2021.08.12", install = false )

to

GAP.Packages.load( "JConvex", "2021.09.05", install = false )

JToric should trigger a warning, in case this version cannot be loaded. Either this warning is suppressed during the tests, or I missed it.

I cannot reproduce these failure locally. To broaden my local tests, I tried to upgrade to Julia 1.6, but encountered other errors. So I eventually returned to Julia 1.5.4. Here is the output of my local test (removing my local paths):

Testing JToric
┌ Error: Pkg.Resolve.ResolverError("Unsatisfiable requirements detected for package Polymake [d720cf60]:\n Polymake [d720cf60] log:\n ├─possible versions are: [0.1.0-0.1.1, 0.2.0-0.2.2, 0.3.0-0.3.3, 0.4.0-0.4.3, 0.5.0-0.5.7] or uninstalled\n ├─restricted to versions 0.5 by JToric [9bfa4af0], leaving only versions 0.5.0-0.5.7\n │ └─JToric [9bfa4af0] log:\n │   ├─possible versions are: 0.1.0 or uninstalled\n │   └─JToric [9bfa4af0] is fixed to version 0.1.0\n └─restricted to versions 0.5.8 by an explicit requirement — no versions left", nothing)
└ @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/Pkg/src/Operations.jl:1427
Status /tmp/jl_IzUzkh/Project.toml
[c4774649] CapAndHomalg v1.1.8
[c863536a] GAP v0.6.2
[9bfa4af0] JToric v0.1.0 ~/path/to/JToric
[f1435218] Oscar v0.6.0
[d720cf60] Polymake v0.5.7
[44cfe95a] Pkg
[8dfed614] Test
Status /tmp/jl_IzUzkh/Manifest.toml
[c3fe647b] AbstractAlgebra v0.21.0
[e21ec000] Antic_jll v0.200.500+0
[d9960996] Arb_jll v200.2000.0+0
[56f22d72] Artifacts v1.3.0
[b99e7846] BinaryProvider v0.5.10
[6e34b625] Bzip2_jll v1.0.6+5
[83423d85] Cairo_jll v1.16.0+6
[fcfa6d1b] Calcium_jll v0.400.100+0
[c4774649] CapAndHomalg v1.1.8
[e66e0078] CompilerSupportLibraries_jll v0.3.4+0
[1f15a43c] CxxWrap v0.11.2
[ffbed154] DocStringExtensions v0.8.5
[2e619515] Expat_jll v2.2.7+6
[e134572f] FLINT_jll v200.800.0+1
[a3f928ae] Fontconfig_jll v2.13.1+14
[d7e528f0] FreeType2_jll v2.10.1+5
[559328eb] FriBidi_jll v1.0.5+6
[c863536a] GAP v0.6.2
[5cd7a574] GAP_jll v400.1190.205+0
[de1ad85e] GAP_lib_jll v400.1190.200+0
[e8aa6df9] GLPK_jll v5.0.0+0
[781609d7] GMP_jll v6.1.2+6
[78b55507] Gettext_jll v0.20.1+7
[7746bdde] Glib_jll v2.59.0+4
[3b182d85] Graphite2_jll v1.3.13+4
[3c863552] Graphviz_jll v2.42.3+1
[2e76f6c2] HarfBuzz_jll v2.6.1+10
[3e1990a7] Hecke v0.10.20
[a51ab1cf] ICU_jll v67.1.0+3
[692b3bcd] JLLWrappers v1.3.0
[682c06a0] JSON v0.21.2
[9bfa4af0] JToric v0.1.0 ~/path/to/JToric
[dd4b983a] LZO_jll v2.10.0+3
[e9f186c6] Libffi_jll v3.2.1+4
[d4300ac3] Libgcrypt_jll v1.8.5+4
[7add5ba3] Libgpg_error_jll v1.36.0+3
[94ce4f54] Libiconv_jll v1.16.0+8
[4b2f31a3] Libmount_jll v2.34.0+3
[38a345b3] Libuuid_jll v2.34.0+7
[472f376f] LoadFlint v0.6.1
[3a97d323] MPFR_jll v4.1.0+1
[1914dd2f] MacroTools v0.5.8
[90100e71] MongoC_jll v1.16.2+1
[4fe8b98c] Mongoc v0.6.2
[14a3606d] MozillaCACerts_jll v2021.1.19+0
[68e3532b] Ncurses_jll v6.1.0+5
[2edaba10] Nemo v0.26.1
[76642167] Ninja_jll v1.10.2+0
[458c3c95] OpenSSL_jll v1.1.1+6
[f1435218] Oscar v0.6.0
[2f80f16e] PCRE_jll v8.42.0+4
[80dd9cbb] PPL_jll v1.2.0+1
[36c8627f] Pango_jll v1.42.4+10
[69de0a69] Parsers v2.0.3
[83958c19] Perl_jll v5.30.3+2
[30392449] Pixman_jll v0.40.0+0
[d720cf60] Polymake v0.5.7
[21216c6a] Preferences v1.2.2
[fb686558] RandomExtensions v0.4.3
[05236dd9] Readline_jll v8.0.4+1
[ae029012] Requires v1.1.3
[bcd08a7b] Singular v0.6.0
[43d676ae] Singular_jll v402.100.101+0
[fa267f1f] TOML v1.0.3
[02c8fc9c] XML2_jll v2.9.10+3
[aed1982a] XSLT_jll v1.1.33+4
[4f6342f7] Xorg_libX11_jll v1.6.9+4
[0c0b7dd1] Xorg_libXau_jll v1.0.9+4
[a3789734] Xorg_libXdmcp_jll v1.1.3+4
[1082639a] Xorg_libXext_jll v1.3.4+4
[ea2f1a96] Xorg_libXrender_jll v0.9.10+4
[14d82f49] Xorg_libpthread_stubs_jll v0.1.0+3
[c7cfdc94] Xorg_libxcb_jll v1.13.0+3
[c5fb5394] Xorg_xtrans_jll v1.4.0+3
[83775a58] Zlib_jll v1.2.11+18
[3161d3a3] Zstd_jll v1.4.8+0
[508c9074] bliss_jll v0.73.0+1
[28df3c45] boost_jll v1.71.0+3
[f07e07eb] cddlib_jll v0.94.10+1
[1493ae25] lib4ti2_jll v1.6.9+2
[3eaa8342] libcxxwrap_julia_jll v0.8.5+1
[b53b4c65] libpng_jll v1.6.37+6
[4d8266f6] libpolymake_julia_jll v0.4.305+0
[ae4fbd8f] libsingular_julia_jll v0.17.5+0
[3873f7d0] lrslib_jll v0.3.2+0
[55c6dc9b] nauty_jll v2.6.12+1
[6690c6e9] normaliz_jll v300.900.0+0
[7c209550] polymake_jll v400.400.2+0
[fe1e1685] snappy_jll v1.1.8+1
[2a0f44e3] Base64
[ade2ca70] Dates
[8ba89e20] Distributed
[b77e0a4c] InteractiveUtils
[76f85450] LibGit2
[8f399da3] Libdl
[37e2e46d] LinearAlgebra
[56ddb016] Logging
[d6f4376e] Markdown
[a63ad114] Mmap
[44cfe95a] Pkg
[de0858da] Printf
[9abbd945] Profile
[3fa0cd96] REPL
[9a3f8284] Random
[ea8e919c] SHA
[9e88b42a] Serialization
[6462fe0b] Sockets
[2f01184e] SparseArrays
[10745b16] Statistics
[8dfed614] Test
[cf7118a7] UUIDs
[4ec0a83e] Unicode
[ Info: Generating module common
[ Info: Generating module ideal
[ Info: Generating module graph
[ Info: Generating module fulton
[ Info: Generating module fan
[ Info: Generating module group
[ Info: Generating module polytope
[ Info: Generating module topaz
[ Info: Generating module tropical
[ Info: Generating module matroid
Welcome to JToric 0.1.0
Enjoy this software to perform computations on toric geometry!
┌ Warning: Can (current) only tell for ample toric divisors if they are very ample.
└ @ JToric ~/path/to/JToric/JToric/src/ToricDivisors.jl:144
┌ Warning: Can (current) only tell for ample toric divisors if they are very ample.
└ @ JToric ~/path/to/JToric/JToric/src/ToricDivisors.jl:144
Test Summary: | Pass  Total
JToric.jl     |  102    102
Testing JToric tests passed

I see that there is an issue with the required version of Polymake, which I cannot seem to install (yet other errors...). Still, this appears to be utterly unrelated to

Error thrown by GAP: Error, List Element: [3] must have an assigned value in

All in all - I am a bit lost for ideas what might cause this issue. Suggestions and advice appreciated.

GAP.Packages.load( "JConvex", "2021.08.12", install = false )  ultimately passes the version string to GAP's LoadPackage which interprets it as "at least version 2021.08.12" so it behaves as I would expect... try "=2021.08.12" ! See also https://www.gap-system.org/Manuals/doc/ref/chap76.html#X79B373A77B29D1F5

I can't help with the GAP error: that's  problem in your code which I don't know. The error has the exact same meaning as in regular GAP: some code tries to access index 3 in a list where that position is  ot bound -- e.g. because the list has fewer than 3 elements. The backtrace tells you where this happened)
regarding Julia versions: julia 1.6 will most likely become the next LTS version and we'll start requiring it in all our packages once that happens. So I'd recommend to switch to that.
Regarding that log you posted with Polymake version clashes: looks like your package environment has stuff installed that blocks updating to the latest Polymake; eg an outdated Oscar version. Try removing all you don't need; or remove all and add back what you need; or just use a fresh environment (I strongly recommend learning about Julia environmenta)

Thx @fingolfin . I'll investigate more.

@fingolfin I have reformatted all structs into camelCase. Also, I reverted the commit regarding GAP.Globals.POLYMAKE_JULIA_MODULE that you commented on above.
With these changes - are you ready to approve this PR?


Add error check to detect_clearsky

[x] Closes #2005
[x] I am familiar with the contributing guidelines
[x] Tests added
[x] Updates entries in docs/sphinx/source/reference for API changes.
[x] Adds description and name entries in the appropriate "what's new" file in docs/sphinx/source/whatsnew for all changes. Includes link to the GitHub Issue with :issue:`num` or this Pull Request with :pull:`num`. Includes contributor name and/or GitHub username (link with :ghuser:`user`).
[x] New code is fully documented. Includes numpydoc compliant docstrings, examples, and comments where necessary.
[x] Pull request is nearly complete and ready for detailed review.
[x] Maintainer: Appropriate GitHub Labels (including remote-data) and Milestone are assigned to the Pull Request and linked Issue.

Adds a check on window_length in clearsky.detect_clearsky to ensure window_length contains at least 3 data points.

Adding a bit of scope here. #1784 added a function to lookup thresholds from Jordan and Hansen (2023). That paper extended the detect_clearsky algorithm to plane-of-array (POA) data. #1784 didn't update the docstring to describe the new capability.

Thanks @cwhanse!


domready event for InfoWindow

I want to apply style based on data to info window. I want to do customization based on this SO answer. But  domready is not being worked for InfoWindow. How can I attach that event?
https://plnkr.co/edit/tfS7gWbJSMLthVeBvhI0?p=preview

What steps should we try in your demo to see the problem?

Just close the opened info window and reopen it.
Current behavior

domready event is not being hit.

Expected/desired behavior

domready event should be hit

@ronak90  Same problem, can you fix this?


Germline naming

Have corrected rubocop issues which were straightforward and not needed logic/code rewriting (not in scope of this work) .

@ollietulloch I have now worked on the review comments and rematched the counts , thank you 🙏


Not working at all

I am trying to get SPutility to work in Sharepoint online. I could not get any scripts to work in neither script editor nor content editor web parts. I don't have access to custom forms advanced mode editing (yet - i hope i will get it soon from the admin). I managed to find a workaround by using Form HTML webpart and editing its source code and putting my script there. jQuery works and gives me the test alert, but nothing happens when i try to get an alert from SPUtility. ( I also tried using some functions on the form like autocomplete but no luck there as well. Here's the code:
<script language="javascript" type="text/javascript" src="/SiteAssets/jquery-3.2.1.js"></script>
<script language="javascript" type="text/javascript" src="/SiteAssets/jquery.SPServices.min.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
 alert("jQuery");
alert($().SPServices.SPGetCurrentSite());
});
</script>

Have you tried:
var thisSite = $().SPServices.SPGetCurrentSite();
alert(thisSite);

I think you've mixed up projects and meant to ask about SPServices


Update 3. Startup, Hosting and Middleware.md

@davidfowl removed the custom port stuff in https://github.com/jongalloway/aspnetcore-workshop/commit/704d10a047e17bfaf14cff6602074038a02a7004

never mind. david just reverted https://github.com/jongalloway/aspnetcore-workshop/commit/c9801e027bbac249a85a43e665797cc66d5d0729, so all is good again.


replace placeholder values with real years in LICENSE file

When you think that you cannot be more dumb than that.
Thanks mate, that copy & paste killed me.


Cannot connect to amqp://guest:**@localhost:5672//: Error opening socket: a socket error occurred.

Hello,
I am on a managed dedicated server, and just about everything seems to be set up correctly with WM2.
When I try to run celery.sh, I encounter this error:
Cannot connect to amqp://guest:**@localhost:5672//: Error opening socket: a socket error occurred.
This is the broker setting in settings.py:
BROKER_URL = 'amqp://guest:guest@localhost:5672/'

Is RabbitMQ running?

I am following the troubleshooting directions on https://github.com/karamanolev/WhatManager2/wiki/Troubleshooting and have forwarded the workaround to the person managing the server.
Thank you for the very quick response. Once I get this fixed, and assuming everything else is configured properly (they appear to be), do you think the entire system will work as expected? Transfer -> transcode -> upload

RabbitMQ is now running, but I am not seeing any transcoding actually occurring. I am adding IDs to: [my host]/transcode/
I also have the following added to crontab -e (my host is set properly on my end)

curl http://[my host]/transcode/update

When I attempt to visit that URL in my browser, I see this error:
KeyError at /transcode/update
'Torrent not found in result'
I feel like I'm getting close to having this awesome thing functioning properly... so close!