Assign fallback ChunkGraph to HotUpdateChunks

Hi, this is my first attempt at a PR for webpack.
It seems there was no ChunckGraph fallback assigned to this plugin. I took the instructions from https://github.com/webpack-contrib/mini-css-extract-plugin/issues/462#issuecomment-551221049 and applied it here as well.

What kind of change does this PR introduce?
Adding ChunckGraph fallback to HotModuleReplacementPlugin. Fixes https://github.com/webpack-contrib/mini-css-extract-plugin/issues/462

Did you add tests for your changes?
No

Does this PR introduce a breaking change?
No

What needs to be documented once your changes are merged?
Nothing as far as I can tell

Thanks

Hi, this is my first attempt at a PR for webpack.

Awesome work for your first PR. 🎉


Add Unit tests to the package mil.nga.giat.geowave.core.cli.prefix

There already are a few tests for classes in this package.  Look at the existing tests to understand them.  This is where a lot of the hard work in decomposing JCommander annotations into commandline tools is done, and ultimately will be reused for REST endpoints as well.  Additional tests should be added for JavassistUtilsTest and PrefixedJCommanderTest.

Tests added in PR #1022


Agent panics when user not found

I'm running the agent in a container where the user is not in /etc/passwd, and so user.Current() returns an error, but since that is ignored and then Sprintf-ed, we get this panic:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x30cbd8]

goroutine 1 [running]:
github.com/buildkite/agent/v3/status.glob..func1()
        /Users/mossity/workspace/superorbital/agent-stack-k8s/agent/status/status.go:38 +0x28
github.com/buildkite/agent/v3/status.init()
        /Users/mossity/workspace/superorbital/agent-stack-k8s/agent/status/status.go:39 +0x5c

cc @DrJosh9000
Repro:
GOOS=linux go build -o bk
docker run -v $PWD:/workspace --rm --entrypoint /workspace/bk bitnami/kubectl:latest

Maybe something like this?
diff --git a/status/status.go b/status/status.go
index 0638cd35..ed840718 100644
--- a/status/status.go
+++ b/status/status.go
@@ -35,7 +35,11 @@ var (
        hostname, _ = os.Hostname()
        username    = func() string {
                user, _ := user.Current()
-               return fmt.Sprintf("%s (%s)", user.Username, user.Uid)
+               if user != nil {
+                       return fmt.Sprintf("%s (%s)", user.Username, user.Uid)
+               } else {
+                       return "unknown (unknown)"
+               }
        }()
        exepath, _ = os.Executable()
        startTime  = time.Now()

Whoops! Thanks for raising. That should be an easy fix.


add configmaps to cluster role resource list.

Signed-off-by: Feifei Jia<EMAIL_ADDRESS>
Is this a new chart
NO.
What this PR does / why we need it:
Add missing resources permission needed by Metrics Server. Ref
Which issue this PR fixes
See above.
Special notes for your reviewer:
Checklist
[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

[ ] DCO signed
[ ] Chart Version bumped
[ ] Variables are documented in the README.md
[ ] Title of the PR starts with chart name (e.g. [stable/mychartname])

Upstream uses pod nanny, and mounts a configmap for that. But this is not used by this helm chart
This helm chart doesn't use any config maps for metrics-server, so I don't think this is necessary.

You are right, the community docker image works fine w/o the configmaps permission. The reason why I submitted this pull request was caused by this error I encountered (using docker image built locally).
E1231 02:07:51.356114       1 reflector.go:156] pkg/mod/k8s.io/client-go@v0.0.0-20191122220542-ed16ecbdf3a0/tools/cache/reflector.go:108: Failed to list *v1.ConfigMap: configmaps "extension-apiserver-authentication" is forbidden: User "system:serviceaccount:kube-system:metrics-server" cannot list resource "configmaps" in API group "" in the namespace "kube-system"
E1231 02:07:52.357663       1 reflector.go:156] pkg/mod/k8s.io/client-go@v0.0.0-20191122220542-ed16ecbdf3a0/tools/cache/reflector.go:108: Failed to list *v1.ConfigMap: configmaps "extension-apiserver-authentication" is forbidden: User "system:serviceaccount:kube-system:metrics-server" cannot list resource "configmaps" in API group "" in the namespace "kube-system"

Should be related to my image.


chore(deps): upgrade dependencies

Upgrades project dependencies. See details in workflow run.

Automatically created by projen via the "upgrade-main" workflow

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

Comparison is base (da78014) 95.69% compared to head (689c264) 95.69%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #824   +/-   ##
=======================================
  Coverage   95.69%   95.69%
=======================================
  Files           1        1
  Lines         395      395
  Branches       53       53
=======================================
  Hits          378      378
  Misses         17       17

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


Add a freshness parameter

What the pull request does
Fixes #23 by warning users if the taxonomy is over 30 days old (give or take a few hours).
Type of change

[ ] :bug: Bug fix (non-breaking change which fixes an issue)
[x] :sparkle: New feature (non-breaking change which adds functionality)
[ ] :boom: Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] :book: This change requires a documentation update

Checklist

[x] The changes are documented

[ ] The docstrings of the different functions describe the arguments, purpose, and behavior
[x] There are examples in the documentation website

[x] The changes are tested
[x] The changes do not modify the behavior of the previously existing functions

If they do, please explain why and how in the introduction paragraph

[x] The Project.toml field version has been updated

Codecov Report

Merging #24 (a525299) into main (eabb3d1) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main       #24   +/-   ##
=========================================
  Coverage   100.00%   100.00%
=========================================
  Files            7         7
  Lines           75        77    +2
=========================================
+ Hits            75        77    +2

Flag
Coverage Δ

unittests
100.00% <100.00%> (ø)

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

Impacted Files
Coverage Δ

src/NCBITaxonomy.jl
100.00% <100.00%> (ø)

Continue to review full report at Codecov.

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


[Question] WriteAsync default behaviour

Greetings. I have a rather simple question. What happens when you try to call _client.Client.WriteAsync(point, "someNonexistentDb")? Will one be created for you? Or nothing will happen / an exception will be thrown?

@Svetomechc That entirely depends on the influx config.

I know this is probably not what you want to hear but @ryantheleach is right. It's not the job of this "adapter library" to take care of that, you as a developer should handle that.
Some people might not want the library to be creating new DB's if they made a typo.

Sounds fair, actually.

I think you should probably get an exception form the influx response though.

Thanks again.
Btw, @pootzko, do you have any plans on keeping this library up to date? I mean, testing against 1.5.x, supporting Flux, etc. ?

I will add a few more features and merge a few PRs in about a month or two when my schedule frees up a bit. And I'll of course run the tests I have against v1.5 (I believe it should all work fine though, as it has been since ~v1.1 where there weren't any issues and the lib just kept working with the newest versions).
I don't think I'll be implementing Flux in the near future though. I don't need it at work at the moment (until Influx decides to deprecate the old query language they're using) and I currently have other things I'm pursuing privately. This would eat up too much of my time.

I too am not ready to adopt a new query language at work. Hopely, they'll continue to support InfluxQL for the time being.


Badges with package size

shields.io has Bundlephobia integration.
Lodash:
Would be nice to have something similar with bundlejs.

I'll get on that

See also https://github.com/okikio/bundlejs/discussions/29.
P.S. I’m still very interested in badges :)

I've started working on it. A beta version should be out in a couple days

There is now a beta API you can try out, https://bundlejs.com/api?q=react, it is very much not production ready and very experimental, but try it out and tell me what you think.

Badges WIP https://github.com/badges/shields/issues/8266

Sweet, thanks for working on this!
(Btw, maybe this is intentional, but FYI: your branch is not a PR to upstream yet.)

That's because I've still got some stuff I've gotta do before making a fully fledged pr.

So, I've got a beta version of badges out. There are some bugs in the Vercel Serverless functions that cause the badge to not be generated properly for large bundles to which the bundlejs website can handle.

You can try it out, using
![bundlejs bundle of react](https://bundlejs.com/api/badge?q=react)

https://github.com/fluent-vue/fluent-vue it works. Function timed out few times.
Some comments:

other badges have label on the left side
bundlejs label could be confusing. bundlephobia has just minified size as a label

Side note https://bundlejs.com/ is broken. Editor never finishes loading

Thanks @Demivan , yeah i can totaly change the order of the file size to bundlejs text.
P.S. I've fixed bundlejs' infinite loading

I tried to update some things but I’m getting errors it seems:
For: https://bundlejs.com/api/badge?q=rehype-raw
{"error":"TypeError: Cannot read properties of undefined (reading 'contents')"}

For: https://bundlejs.com/api/badge?q=micromark
This Serverless Function has timed out.

Your connection is working correctly.

Vercel is working correctly.

(the vercel 504 gateway timeout error)

@wooorm Thanks for that, I'm working on fixing this issue

Good news I've got an even better version releasing this week. It supports badges, complex modules, can return the bundle metafile for https://esbuild.github.io/analyze/, and even gives you the fully bundled code, etc...
Get excited, I'm just waiting for the DNS propagation...before lauching

A little late, but it's now out...badges 👏

[![spring-easing's badge](https://deno.bundlejs.com/?q=spring-easing&badge=detailed&badge-style=for-the-badge)](https://bundlejs.com/?q=spring-easing)

https://twitter.com/jsbundle/status/1634457855746011136?s=20
cc @wooorm

You can also now import bundled bundlejs files and polyfill them using the bundlejs API

Awesome!
Two Qs:

I was missing some docs on what options are available to build the urls

How come the esbuild CLI gives me 15kb, but bundlejs gives me 27kb? 👀:
$ ./node_modules/.bin/esbuild micromark --color=true --global-name=BundledCode --log-level=info --target=esnext --format=esm --bundle --minify --tree-shaking=true --platform=browser | gzip-size
15.2 kB

https://deno.bundlejs.com/?q=micromark
n.b., my assumption is that the platform=browser isn’t actually set. Changing it to --platform=node does report 27kb. In Node, a bunch of extra code is loaded which isn’t needed if the DOM is available

@wooorm It's possible it's grabbing the cjs format of one of the files, from what I can see of the bundle analysis it seems to be grabbing all the right files? Maybe, I'm missing something? 🤔 https://deno.bundlejs.com/?q=micromark&analysis

I can’t open that url: {"error":"TypeError: worker.postMessage is not a function"}

I'll have to look into thus, thanks for taking the time to take a look

The bundle analysis error should now be fixed. Please take a look

@wooorm Fixed. It should now be using index.dom.js

Sweet, works well!

What do you think about using minzipped size on the left (and removing (gzip) on the right)? That’s what I get for shields.io currently:
![](https://img.shields.io/bundlephobia/minzip/preact.svg)
![](https://img.shields.io/bundlephobia/min/preact.svg)

Sure, I can do that

By default it shows the gzipped size, you can use a JSON endpoint shield in the meantime

![](https://img.shields.io/badge/dynamic/json?color=blue&label=bundlejs-(min)&query=$.size.uncompressedSize&url=https://deno.bundlejs.com/?q=react)

@okikio Thank you!

@Demivan Does the badge API work for you? Can I mark this pr as complete?

It timed out few times but it is working now.
Only thing is that I cannot find is how to properly encode string with esbuild config, so shields.io does not complain about wrong url.
![](https://img.shields.io/badge/dynamic/json?color=blue&label=fluent-vue&suffix=%20(bundlejs)&query=$.size.size&url=https://deno.bundlejs.com/?q=fluent-vue)

It either ignores is:
![](https://img.shields.io/badge/dynamic/json?label=fluent-vue&suffix=%20(bundlejs)&query=$.size.size&url=https://deno.bundlejs.com/?q=fluent-vue&config={"esbuild":{"external":["vue"]}})

Or breaks:
![](https://img.shields.io/badge/dynamic/json?label=fluent-vue&suffix=%20(bundlejs)&query=$.size.size&url=https://deno.bundlejs.com/?q=fluent-vue%26config={"esbuild":{"external":["vue"]}})

You can use encodeURIComponent(\https://deno.bundlejs.com/?q=fluent-vue%26config={"esbuild":{"external":["vue"]}}`)` to get a URL safe url,
e.g. https%3A%2F%2Fdeno.bundlejs.com%2F%3Fq%3Dfluent-vue%2526config%3D%7B%22esbuild%22%3A%7B%22external%22%3A%5B%22vue%22%5D%7D%7D I don't do this by default, because it's just really difficult to read

Yeah. I was trying to do that. But as you can see shields.io still complains.
But this is not an issue with bundlejs badges so this issue can be closed.

I'll look into what the best way to solve, and get back to you, for now I'll close this issue

@Demivan https://github.com/badges/shields/issues/9012


IndexError: arrays used as indices must be of integer type

Happens on some audio chunks:
Traceback (most recent call last):
 File whisper/transcribe.py", line 316, in transcribe
   add_word_timestamps(
 File whisper/timing.py", line 323, in add_word_timestamps
   alignment = find_alignment(model, tokenizer, text_tokens, mel, num_frames, **kwargs)
 File whisper/timing.py", line 241, in find_alignment
   start_times = jump_times[word_boundaries[:-1]]
IndexError: arrays used as indices must be of integer (or boolean) type

The problem is this line: https://github.com/openai/whisper/blob/main/whisper/timing.py#L217
It returns a array of float (instead int):
np.pad(np.cumsum([]), (1, 0))
 -->
[0.] instead [0]


passing multiple any[] arrays to Fork join

public function main (string[] args) {
fork {
worker w1 {
any[] a = [];
a -> fork;
}
    worker w2 {
        any[] b = [];
        b -> fork;
    }

} join (all) (map results) {
    println(results);
}

}
Above code gives following error.
[1] error: fail to compile file: index: 32, Size: 32 error: fail to compile file: index: 32, Size: 32
More details in ballerina-dev:
https://groups.google.com/forum/#!topic/ballerina-dev/16o38cH1bjo

Fixed with https://github.com/ballerinalang/ballerina/pull/4326


Player Digging Packet

I couldn't find a PlayerDigging Packet anywhere.

https://github.com/Steveice10/MCProtocolLib/blob/1.8/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerActionPacket.java


Set up CI

Should:
Check for lint errors
Check for format diff
If we can keep times not crazy:
Run e2e playwright tests

blocked on #148 but we had clean lints for a second there it's Capacitor stuff that's breaking it now

closed by #407!


Cosmic Scans Closed (its jover)

Website has been down for over a month

Naman, this is your roommate. Please call me.

Source needs to be removed


I can not find the nms function

Under the lib.layer_utils.proposal_layer.py
There is a sentences keep = nms(proposals, scores.squeeze(1), nms_thresh) in line 44.
When I jumped into the declaration of the function nms, it says I need to import _C from layer_utils.

But I can not find _C under the layer_utils library.

Any one can help me ?


Search results not correct

The returned results from the search contain more data than it should. I have the following code:
...
class MyClass(db.Model):
    __tablename__ = 'my_table'
    __searchable__ = ['first_param, second_param']

    id = db.Column(db.Integer, primary_key=True)
    first_param = db.Column(db.Unicode)
    second_param = db.Column(db.Unicode)
    third_param = db.Column(db.Unicode)

...

results = MyClass.query.filter(...).msearch(keyword, ['first_param, second_param']).paginate(per_page=limit, page=page_no)

The results contain rows that none of the fields match the keyword. Is there anyway way to control how the search is performed?

Adding an analyzer solved the problem.


StringSVGRenderer writes quad beziers as "T" instead of "Q"

Why does the StringSVGRenderer::CurveToV method writes quadratic bezier curves with the "T" command? Should it not use "Q"?
https://github.com/adobe/svg-native-viewer/blob/ef627051444b7c2041860bd4d0fe5232e2ba8aa2/svgnative/ports/string/StringSVGRenderer.cpp#L49
I got a bit confused the first time I saw this.
"T" is the shorthand path command for smooth quadratic bezier curves; it only has one argument as the quad curve control point is implicit (reflection of the control point from the previous command).
"Q" command seems to describe better what "CurveToV" method is doing, as it's the explicit form for the quadratic bezier curve, with two arguments.
I got also confused by the method name "CurveToV". I was expecting more like "QuadTo".
Anyway, no big deal. I just wanted to point this out. Feel free to close this, thanks.

Thank you for finding this. I think the correction is needed. At present, StringSVGRenderer's output is not designed for re-renderable as a graphics, that's why you commented "no big deal"?


Detect disposable email domains during sign ups

Goal
Add an ability to recognize the disposable email domains when the user signs up on the FP Platform.
Reference Github: https://github.com/ivolo/disposable-email-domains

I looked at the docs of the referenced library, can be implemented but anyone has a better idea & alternative about this case?
@mannykary @joshmorel @idjevm @Zaydme @ddveloper @manualzuru

I looked at the docs of the referenced library, can be implemented but anyone has a better idea & alternative about this case?
@mannykary @joshmorel @idjevm @Zaydme @ddveloper @manualzuru

I think that library should work.


30 requests per minute

@rultor release, tag is 0.0.5

@rultor release, tag is 0.0.5

@yegor256 OK, I will release it now. Please check the progress here

@rultor release, tag is 0.0.5

@yegor256 Done! FYI, the full log is here (took me 1min)


Changes LOOSE to LOSE on the losing message

Changes LOOSE to LOSE on the losing message

Nice observation :p


sync service - do not return keyinfo list on exception

Describe the bug

in sync service impl --> _syncFromServer , currently we return keyinfo list when there is exception in syncing a key

for (dynamic serverCommitEntry in syncResponseJson) {
        try {
          final keyInfo =
              KeyInfo(serverCommitEntry['atKey'], SyncDirection.remoteToLocal);
            ....
            .....
        } on Exception catch (e) {
          _logger.severe(
              'exception syncing entry to local $serverCommitEntry - ${e.toString()}');
          return keyInfoList;
        }
      }

Expected behavior

continue syncing other keys when there is an exception syncing a key

Fixed by https://github.com/atsign-foundation/at_client_sdk/pull/625


Proofreading 04272017

Most changes here are grammar/spelling/syntax fixes. Other changes:

The authentication methods in the lists in the beginning of quickstart_authentication.rst were not in the same order as the detailed descriptions below, which was confusing. I reordered them so they match.
Information about getting the UUIDs for Service Principal authentication referred to the "Configure" page. In the new Azure portal this seems to be referred to as "Settings", not "Configure," so I changed it. I realized after doing so that maybe the docs don't target the new portal yet, but I couldn't find "Configure" in the old portal either, so I left it. Happy to revert this if I'm wrong.

Thanks @v-iam !
Please consider everything is written for the new portal, except this page .
Happy to merge :)

Codecov Report

Merging #1108 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1108   +/-   ##
=======================================
  Coverage   56.46%   56.46%
=======================================
  Files        2050     2050
  Lines       57454    57454
=======================================
  Hits        32442    32442
  Misses      25012    25012

Continue to review full report at Codecov.

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


refactor: improve build script, use themes/ directory instead of dist/

That's great, thanks. The previous build script was kinda a hack lol.


Improve documentation

[ ] Add motivational section to README
[ ] Add design guidelines (self-contained, performance, embedded use)
[ ] Add build/installation instructions (copy fsm.hpp, link to latest dist, configure, make)
[ ] Add guards examples (player with autoplay/autoeject)
[ ] Add row examples (plain functions, lambdas, std::function, static members...)
[ ] Add links/badges to Travis and coveralls.io

https://github.com/eddyxu/cpp-coveralls


Making changes to Azure Functions Max Batch Size

Explicitly specify bytes as input type to max batch size field for azure functions output.

@viskri-msft : Thanks for your contribution! The author, @mamccrea, has been notified to review your proposed change.

@viskri-msft : Thanks for your contribution! The author, @mamccrea, has been notified to review your proposed change.

@JasonWHowell: I'm sorry - only the author of this article, @mamccrea, can sign off on your changes. But we do have an exception process - if you are on the Microsoft content or product team for this product area, you can ask the PR review team to review and merge it by sending mail to the techdocprs alias.

#sign-off


Couple errors - websockets timeout

Log Details (WARNING)
Logger: homeassistant.helpers.entity
Source: helpers/entity.py:284
First occurred: 6:19:36 PM (1 occurrences)
Last logged: 6:19:36 PM
Updating state for media_player.tv_58_sala (<class 'custom_components.samsungtv_tizen.media_player.SamsungTVDevice'>) took 0.510 seconds. Please report it to the custom component author.
error number 2 i got today
Logger: homeassistant.core
Source: custom_components/samsungtv_tizen/websockets.py:152
First occurred: 6:19:23 PM (1 occurrences)
Last logged: 6:19:23 PM
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/websocket/socket.py", line 102, in recv
bytes = _recv()
File "/usr/local/lib/python3.7/site-packages/websocket/_socket.py", line 84, in _recv
return sock.recv(bufsize)
File "/usr/local/lib/python3.7/ssl.py", line 1056, in recv
return self.read(buflen)
File "/usr/local/lib/python3.7/ssl.py", line 931, in read
return self._sslobj.read(len)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 551, in _update_entity_states
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 284, in async_update_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 314, in _async_write_ha_state
attr = self.capability_attributes
File "/usr/src/homeassistant/homeassistant/components/media_player/init.py", line 785, in capability_attributes
source_list = self.source_list
File "/config/custom_components/samsungtv_tizen/media_player.py", line 535, in source_list
self._gen_installed_app_list()
File "/config/custom_components/samsungtv_tizen/media_player.py", line 341, in _gen_installed_app_list
app_list = self._ws.app_list()
File "/config/custom_components/samsungtv_tizen/websockets.py", line 237, in app_list
'to': 'host'
File "/config/custom_components/samsungtv_tizen/websockets.py", line 109, in _ws_send
self.open()
File "/config/custom_components/samsungtv_tizen/websockets.py", line 152, in open
response = self._process_api_response(self.connection.recv())
File "/usr/local/lib/python3.7/site-packages/websocket/_core.py", line 313, in recv
opcode, data = self.recv_data()
File "/usr/local/lib/python3.7/site-packages/websocket/_core.py", line 330, in recv_data
opcode, frame = self.recv_data_frame(control_frame)
File "/usr/local/lib/python3.7/site-packages/websocket/_core.py", line 343, in recv_data_frame
frame = self.recv_frame()
File "/usr/local/lib/python3.7/site-packages/websocket/_core.py", line 377, in recv_frame
return self.frame_buffer.recv_frame()
File "/usr/local/lib/python3.7/site-packages/websocket/_abnf.py", line 361, in recv_frame
self.recv_header()
File "/usr/local/lib/python3.7/site-packages/websocket/_abnf.py", line 309, in recv_header
header = self.recv_strict(2)
File "/usr/local/lib/python3.7/site-packages/websocket/abnf.py", line 396, in recv_strict
bytes = self.recv(min(16384, shortage))
File "/usr/local/lib/python3.7/site-packages/websocket/_core.py", line 452, in _recv
return recv(self.sock, bufsize)
File "/usr/local/lib/python3.7/site-packages/websocket/_socket.py", line 105, in recv
raise WebSocketTimeoutException(message)
websocket._exceptions.WebSocketTimeoutException: The read operation timed out

Looks a lot like this one: https://github.com/jaruba/ha-samsungtv-tizen/issues/65


Multiple class constructors in Scala: no real Java equivalent.

In Java, one can use different constructors to instantiate a class
public class toto
  /** First constructor */
  public toto(Integer arg1) {
    // some stuff
  }

  /** Second constructor */
  public toto(String arg2) {
    // some stuff
  }
}

This is what is used in GeoSpark to instantiate RDD[T] for example.
As far as I know, there is no direct equivalent in Scala... So the structure will differ.

yeah, the overloading constructor has to directly call default/another overloading constructor.
As a workaround, can we use the Object and call the appropriate constructor after having done some custom operations?

Solution chosen: combine object + class.
e.g. Point3DRDD.scala:
object Point3DRDD {
  def apply(rdd : RDD[Point3D], isSpherical: Boolean): Point3DRDD = {
    new Point3DRDD(rdd, isSpherical)
  }
}

class Point3DRDD(rdd : RDD[Point3D], override val isSpherical: Boolean) extends Shape3DRDD[Point3D] {
  def this(spark : SparkSession, filename : String, colnames : String, isSpherical: Boolean,
      format: String, options: Map[String, String] = Map("" -> "")) {
    this(CustomPoint3DRDD(spark, filename, colnames, isSpherical, format, options), isSpherical)
  }

  // Put as many different this() as you wish
}


Only include amounts between people in the same community

@ljharb via Twitter:

“top givers” and “top receivers” totals should only include amounts between peeps that are both in the same group.

---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/410025-only-include-amounts-between-people-in-the-same-community?utm_campaign=plugin&utm_content=tracker%2F85909&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F85909&utm_medium=issues&utm_source=github).

Closed until communities (or tags) return.


Don't Merge! PR real time test for target branch full build

Docs Build status updates of commit 69b1b93:
:clock10: Full build: the average full build time is 5 min(s) 14 sec(s), this is based on the last 30 build(s) for this repository.

Docs Build status updates of commit 69b1b93:
:warning: Validation status: warnings

File
Status
Preview URL
Details

docs-ref-conceptual/testing.md
:warning:Warning
View (azure-cli-latest) View (azure-cli-2017-03-09-profile) View (azure-cli-2018-03-01-hybrid)
Details

docs-ref-conceptual/testing.md

[Warning] Missing attribute: either ms.prod or ms.service is required. Use ms.prod for on-premise products, or ms.service for cloud services.
[Warning] Missing attribute: title.
[Warning] Missing attribute: either ms.prod or ms.service is required. Use ms.prod for on-premise products, or ms.service for cloud services.
[Warning] Missing attribute: title.
[Warning] Missing attribute: either ms.prod or ms.service is required. Use ms.prod for on-premise products, or ms.service for cloud services.
[Warning] Missing attribute: title.

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.


Long not being pinned is now pulling in ESM version

google-gax is used by the @google-cloud libraries (eg https://github.com/googleapis/nodejs-compute/blob/main/package.json#L123).
google-gax seems to reference the library long (eg https://github.com/googleapis/gax-nodejs/blob/main/protos/operations.d.ts#L17), but that dependency is not in the package.json.
long changed to ESM in version 5, which causes our builds to currently fail with:
node_modules/google-gax/build/protos/operations.d.ts(17,23): error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.

It feels like google-gax (which isn't ESM) should pin long to 4.0.0 in order to ensure compatibility with non-esm apps, until google-gax itself switches to esm.
We've worked around this by:
  "peerDependencies": {
    "@google-cloud/compute": "3.1.2",
    "long": "4.0.0"
  }

+1 to this.
@google-cloud/profiler is seeing test failures related to this (I assume users would be similarly impacted).  My team has not explored work-arounds yet.

Thank you for the report, I'm looking and will likely ping long to the non-ESM version.

google-gax v2.30.3 is coming soon.


(WIP) Run tests in real browsers with Karma

Goals of this branch:

get all of our tests running together (no separate rendering and non-rendering tests)
get our tests running in multiple browsers

There is no need to have a separate process for running rendering tests.  In cases where we want to test functionality that only exists in limited browsers, we can use the existing where() function in our test extensions.
I've set up an account for the project on Sauce Labs, and there we can test in all browser/os combos we want to support.  I've included an initial configuration that will run tests on Chrome, Firefox, Safari, IE 11, and Edge when the tests are run on Travis.  During development, I suggest we run tests in Chrome - although this can be configured.
There is more work to do, but if anybody wants to try it out, to run tests once, do this:
npm run karma -- --single-run

And to keep the tests running continuously:
npm run karma

For the continuous run case, more work is needed to update things as the dependency tree changes.

Out of curiosity will this aim to get the tests, at least when running locally for development, in a headless Chrome if supported? (has been as of Chrome 59 AFAIK)

I am happy you have started this, Tim. Looking good so far. Can you outline the remaining steps? I might lend a hand for certain tasks.

Out of curiosity will this aim to get the tests, at least when running locally for development, in a headless Chrome if supported? (has been as of Chrome 59 AFAIK)

@bjornharrtell - it is straightforward to use Karma with Chrome in headless mode, but I'm not sure there is a good reason to do so.  Here is the required karma.config.js change:
diff --git a/test/karma.config.js b/test/karma.config.js
index dbd1943..0f2798b 100644
--- a/test/karma.config.js
+++ b/test/karma.config.js
@@ -93,7 +93,17 @@ module.exports = function(karma) {
     });
   } else {
     karma.set({
-      browsers: ['Chrome']
+      browsers: ['ChromeHeadless'],
+      customLaunchers: {
+        ChromeHeadless: {
+          base: 'Chrome',
+          flags: [
+            '--no-sandbox',
+            '--headless',
+            '--remote-debugging-port=9222'
+          ]
+        }
+      }
     });
   }
 };

The nice thing about running the tests in Chrome (with a head) is that you can quickly open the debug page and start debugging failing tests.  With headless Chrome, you can do the same, but you need to first open another instance of Chrome (with a head) and attach it to the test server.  It may be that the headless version has a faster startup time (I haven't tried), but I think the common use case during development is to be able to add and quickly debug failing tests.

Can you outline the remaining steps?

@marcjansen here is what remains:

[ ] make things work when updating dependencies (and avoid redundant file watchers)
[ ] pull the rendering tests into the same directly structure as the rest of the tests, adding where('WebGL') calls for WebGL-specific tests
[ ] get rid of the old test runners

I'm starting at the top right now.

I agree @tschaub, not sure why I focused on local development. But I think the remaining interesting case is replacing PhantomJS in CI.

But I think the remaining interesting case is replacing PhantomJS in CI.

Right.  Two good alternatives on Travis: run all tests in Firefox (we could do this right now) or run all tests in multiple browsers using Sauce connect (what this branch will enable).

I'm uncertain about how to proceed with the WebGL renderer.  The renderer doesn't work for me (in Chrome or Firefox), so the rendering tests fail as well.  I'd like to make a condition (e.g. with where('WebGL')) that only runs the tests where we expect the renderer to work - but I don't know how to determine that.
Here is an example of the WebGL renderer in Chrome 59 for me:

So it should be no surprise that rendering tests fail.

To move forward with this, we need a decision on what to do with the WebGL rendering tests.  The WebGL renderer doesn't work on my os/browser combos (and the tests do not pass).  So for now, where('WebGL') prefixed tests are always skipped.  If someone can write an expression that evaluates to true where the tests pass, we can conditionally run them.

May I have the layer producing those artifacts, @tschaub? I'm currently trying to come up with a straightforward fix, as with very detailed polygons I also experience some problems on smaller scales. It would be nice to have more problematic layers to play with.

May I have the layer producing those artifacts, @tschaub?

@GaborFarkas - the screenshot in https://github.com/openlayers/openlayers/pull/6953#issuecomment-312724697 is from our examples/vector-layer.js using the WebGL renderer.

There is a bit of work left to get tests passing in Safari and Edge.  The rendering tests are failing in both.  In addition, both are missing new URL(url).searchParams so we'll need to rework the tests that use that.  I'll leave that for another PR.

I've left the coverage stuff out for now.  We can bring this back in after making a few other tooling changes.


Add user entry point tracking [#OSF-6070]

Purpose

Keep track of the user entry points (OSF, OSF for Meetings, Preregistration, Institution) on Keen.
Changes

Add user_entry_point to global variables. Add entry_point property to currentUser in base.mako.
Side effects

Ticket

https://openscience.atlassian.net/browse/OSF-6070

LGTM!

Why do we need to put this into the templates/JS? Couldn't we just use a script that queries the database for system tags?

We can. Do you mean write a function in python to get the system tags then pass it as context?

@sloria, we added it to keen so that we can do user-origin focused queries entirely within keen.  E.g. "What are the most popular pages for institutional users?"  "Do users who join via OSF4M check out other parts of our site"

@felliott Thanks for the clarification
@jeffreyliu3230 Just one minor suggestion above; otherwise good to merge.

Updated!

@sloria I changed the name of the context variable to follow the naming rule. Should be ready to merge.


[Bug]: A useful, descriptive title

What happened and in what context?
Updated Telegram Bot with KIAUH to v1.4.1.-14
Now command /photo is not working any more.
KIAUH v3.1.0-95
Moonraker: v0.7.1.-376
Config Camera
[camera]
host: http://localhost:8080/?action=stream

Removed and fresh installed Telegram-Bot again via KIAUH. Same issue.
If needed, paste the relevant bot log contents here.
Empty.
If needed, paste the relevant bot journal contents here.
Feb 18 20:15:36 fluiddpi python[3512]: 2022-02-18 20:15:36,831 - camera - WARNING - Reading video frames queue exception <built-in method with_traceback of Empty object at 0xa40643e8>
Feb 18 20:15:36 fluiddpi python[3512]: 2022-02-18 20:15:36,763 - camera - WARNING - Reading video frames queue exception <built-in method with_traceback of Empty object at 0xa40643e8>
What branch does this occur on?
master
Reports only on latest master or development branches!

[X] I have updated to latest development/master version before submitting the bug

This is not a bug. Please read release notes before updating.

Ahh thx - found it. For others:
/photo is removed. /status is now the replacement, and sends a picture together with configurable info on the printer.


Investigate failed upgrade scenario 07 nightly test

Brief investigation of https://drone-auto-casper-network.casperlabs.io/casper-network/casper-node/8450/1/4 shows that node-3 successfully upgraded and ran in Validate mode until executing block c88c..cee1 at height 120.  At this point, it fell back from Validate to KeepUp, but the block synchronizer eventually became stuck repeatedly reporting need next: Nothing with 0 peers.  Eventually (after 3 mins) it switched to CatchUp and began to sync leap, but before this could be completed, the test deemed the node to have stalled and failed the test.

The root cause of this problem was a combination of 2 factors:

faulty behavior in validate.rs where a BlockSync instruction from the accumulator would kick the node into KeepUp mode, fixed in this PR already.
a race condition where the block was executed in validate mode and announced as a meta block (executed, not yet marked complete) and the accumulator emitted the effect to mark the block complete in storage, but validate_instruction was called before that could happen, leading to the behavior in the first bullet point.

From my point of view, this particular bug can be closed. However, I would note there is no mechanism of ensuring the block is marked complete in one swoop after being announced as meta block, so any existing or future logic relying on complete block semantics should be designed with this in mind.


Failed to process Jellyfin item.

Description
Some tv series data cannot be sync
Version
1.1.1
Steps to Reproduce
1、Add movie to jellyfin
2、Movies can be seen in the jellyfiin library
3、Jellyseerr Sync log error
Screenshots
No response
Logs
2022-09-16T00:40:09.832Z [error][Jellyfin Sync]: Failed to process Jellyfin item. Id: bd15de95b71da867ff6c4ad05e2fab67{"errorMessage":"[TMDb] Failed to get TV show using the external TVDB ID: [TMDb] Failed to find by external ID: Client network socket disconnected before secure TLS connection was established","jellyfinitem":{"AirDays":["Sunday"],"AirTime":"6:00 AM","BackdropImageTags":["aded46fb7afc4223466b3de80b4c939e","b066279edbf33787c7ee8f7491088cd2"],"ChannelId":null,"ChildCount":12,"CommunityRating":8.5,"EndDate":"2020-04-26T00:00:00.0000000Z","Id":"bd15de95b71da867ff6c4ad05e2fab67","ImageBlurHashes":{"Backdrop":{"aded46fb7afc4223466b3de80b4c939e":"W:L:_px[xsoMNHxa_4spR-ofn%ogtnofafkCodWE-:kBjYoMX8oL","b066279edbf33787c7ee8f7491088cd2":"WTIFbtu4%#oJIpoe?^jFRjWVs:tRK5jFRPxujZt7%#WBo0t7R+jY"},"Banner":{"642a70ac0965e58706be29846b5726c8":"HvI}B_.5oxsA$|oJs:xZxs~T%KWWRks-oKoLs:oe"},"Primary":{"0e435799cb47870b813da931681f88e1":"dWGSlgo}x]%M?^oft6tQKOt7RjR*XSR+M|jZo|WVjtae"},"Thumb":{"a8129c0e49716577ff2f48f49ad5147c":"NSI=rj4Tbv%#NGtRpI%Le.f+x]ozI:xuWAn$ofog"}},"ImageTags":{"Banner":"642a70ac0965e58706be29846b5726c8","Logo":"0cb105fc0d143d8af08de82638fe4d3c","Primary":"0e435799cb47870b813da931681f88e1","Thumb":"a8129c0e49716577ff2f48f49ad5147c"},"IsFolder":true,"LocationType":"FileSystem","Name":"正常人","OfficialRating":"TV-MA","PremiereDate":"2020-04-26T00:00:00.0000000Z","ProductionYear":2020,"RunTimeTicks":17999998976,"ServerId":"b18df28181334f129faa90bdc99281a7","Status":"Ended","Type":"Series","UserData":{"IsFavorite":false,"Key":"tt9059760","PlayCount":0,"PlaybackPositionTicks":0,"Played":false,"UnplayedItemCount":12}}}

Platform
desktop
Device
server
Operating System
docker
Browser
docker
Additional Context
No response
Code of Conduct

[X] I agree to follow Overseerr's Code of Conduct

It's a TMDB id error. Can you hop onto discord and ill help you solve this?


descriptive error handler for 405 errors

Issue
It is possible to obtain an ambiguous HTTP 405 error with certain malformed URLs--e.g., with two back-slashes. Technically, these are actually 400s. In any case, it would help to reduce the ambiguity.

Solution
Capture responses with code 405 and return a custom response.

This will be handled by the gateway instead of by the API.


Syntax highlighting for ACL files not working on Linux

Syntax highlighting for ACL files not working on Linux, but it works fine on Windows and Mac,
Context
Reported on Rocket chat by jdockter
Expected Behavior
It should work the same on all platforms
Actual Behavior
Error checking works, but the colour highlighting does not.
Possible Fix
There is a type in the syntax file name that needs fixing.
Steps to Reproduce
Open a permissions.acl file on Ubuntu and you will not get syntax highlighting like you do on other platforms for acl files.
Existing issues
None
Context
Syntax highlighting for ACL files not working on Linux, but it works fine on Windows and Mac,

Caused by a simple typo in a file name.

Just fixed


MDBE: Design document for adding type support to the Query Engine

Design document:

What does it mean to add type to Query Engine?
Do all relations work?

Note: Carry over to next sprint.

We have a design document, so I'm marking this as done


Missing documentation of new Aliases list on Team resources

On the opslevel_team resource and datasource the API now exposes a Aliases list that captures all of the aliases.  This need to be present in the documentation.

Closing since this is covered


Using typename instead of using for HTrajectory in order to prevent name hiding

https://github.com/optframe/optframe/blob/a73633f4ffa122a56db4d9e7bd529ef4061ab9f7/src/OptFrame/Experimental/VShuffle.hpp#L43

Method exec was now removed.


Refactor monitoring code

I'd like to move the monitoring code from bigchaindb.core.Bigchain to the modules bigchaindb.block and bigchaindb.voter.
Why? For three main reasons:

to keep the Bigchain class cleaner
the call to monitor = Monitor() (core.py:15) might trigger bigchaindb.config_utils.autoconfigure before other configuration functions
because bigchaindb.block and bigchaindb.voter are the places where the computation happens.

Unfortunately #153 partially depends on this issue. I can use a workaround to have #153 merged on develop but this issue should be fixed relatively soon.

@rhsimplex any thoughts on that?

Oh hi just saw this, sorry. Yeah I don't see why not. Do you need anything from me?


Proposal: sign_setlist

Is your feature request related something that is currently hard to do? Please describe.
Per https://groups.google.com/d/msg/vim_dev/aW2buOgZ6qI/fpxkp-V8AQAJ
In https://github.com/leitzler/govim (master branch) Pontus is adding support to govim for signs that correspond to quickfix entries.
This is done by calling sign_place/sign_unplace as required to get the signs for a buffer in the correct state.
If there are lots of errors in a file, then there can be a large number of calls to sign_place/sign_unplace made by govim in rapid succession.
Describe the solution you'd like
A function:
sign_setlist({bfnr}, {list} [, {action}])

that sets the signs for buffer {bufnr} to {list}. {action} is similar to setqflist in that the caller can specify whether to create, replace or add to existing signs.
Describe alternatives you've considered
The only apparent alternative at the moment is to call sign_getplaced and then make the necessary calls to sign_place/sign_unplace; over a channel this becomes expensive.
Additional context
n/a

Hi,
On Tue, Jun 18, 2019 at 2:37 AM Paul Jolly<EMAIL_ADDRESS>wrote:

Is your feature request related something that is currently hard to do? Please describe.
Per https://groups.google.com/d/msg/vim_dev/aW2buOgZ6qI/fpxkp-V8AQAJ
In https://github.com/leitzler/govim (master branch) Pontus is adding support to govim for signs that correspond to quickfix entries.
This is done by calling sign_place/sign_unplace as required to get the signs for a buffer in the correct state.
If there are lots of errors in a file, then there can be a large number of calls to sign_place/sign_unplace made by govim in rapid succession.
Describe the solution you'd like
A function:
sign_setlist({bfnr}, {list} [, {action}])
that sets the signs for buffer {bufnr} to {list}. {action} is similar to setqflist in that the caller can specify whether to create, replace or add to existing signs.

Instead of adding a new function for placing multiple signs, what
about modifying the
existing sign_place() function to accept a List argument. Each list
item is a dictionary
specifying the attributes of a sign. We can do a similar change to the
sign_unplace()
function to remove a placed sign.
Thinking about this some more, we should modify the existing
sign_place() function
to always accept a List argument. This will simplify the function. This won't be
backward compatible. But the sign functions were recently added. So I am not
sure how many plugins have started using the sign_place() function.

Yegappan

Describe alternatives you've considered
The only apparent alternative at the moment is to call sign_getplaced and then make
the necessary calls to sign_place/sign_unplace; over a channel this becomes expensive.
Additional context
n/a

Thinking about this some more, we should modify the existing sign_place() function to always accept a List argument

Just to say, I don't have any strong feelings either way. I'll defer to those with more experience of the Vim API and how changes are made.

Thinking about this some more, we should modify the existing
sign_place() function to always accept a List argument

Just to say, I don't have any strong feelings either way. I'll defer
to those with more experience of the Vim API and how changes are made.

The current sign_place() function is basically mimicking ":sign place".
One of the quircks is that it takes a file name, not a buffer number.
It also has an optional {id}, where zero means it's not passed in.
Adding a new function that takes a list of dictionaries could be a good
alternative. We then do need to validate the entries to check if the
required keys are included.  It will then be possible to either pass a
buffer number or a file name.
--
Facepalm reply #9: "Speed up, you can drive 80 here" "Why, the cars behind us
are also driving 60"
/// Bram Moolenaar --<EMAIL_ADDRESS>-- http://www.Moolenaar.net   \
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \
\\  an exciting new programming language -- http://www.Zimbu.org        ///
\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

Hi Bram,
On Sat, Jun 29, 2019 at 5:57 AM Bram Moolenaar
<EMAIL_ADDRESS>wrote:

Thinking about this some more, we should modify the existing
sign_place() function to always accept a List argument

Just to say, I don't have any strong feelings either way. I'll defer
to those with more experience of the Vim API and how changes are made.

The current sign_place() function is basically mimicking ":sign place".
One of the quirks is that it takes a file name, not a buffer number.

The sign_place() function accepts either a buffer name or a buffer
number. The {expr} argument to sign_place() is same as the {expr}
argument to bufname().

It also has an optional {id}, where zero means it's not passed in.

Yes. Converting sign_place() to accept a List of dicts will make this
simpler.

Adding a new function that takes a list of dictionaries could be a good
alternative. We then do need to validate the entries to check if the
required keys are included. It will then be possible to either pass a
buffer number or a file name.

I have the changes for this ready to go (including the check for existence
of the required keys). I will merge my local changes with the recent
changes to sign.c/evalfunc.c and create a pull request.

Yegappan

Hi,
On Sat, Jun 29, 2019 at 6:34 AM Yegappan Lakshmanan<EMAIL_ADDRESS>wrote:

Hi Bram,
On Sat, Jun 29, 2019 at 5:57 AM Bram Moolenaar
<EMAIL_ADDRESS>wrote:

Thinking about this some more, we should modify the existing
sign_place() function to always accept a List argument

Just to say, I don't have any strong feelings either way. I'll defer
to those with more experience of the Vim API and how changes are made.

The current sign_place() function is basically mimicking ":sign place".
One of the quirks is that it takes a file name, not a buffer number.

The sign_place() function accepts either a buffer name or a buffer
number. The {expr} argument to sign_place() is same as the {expr}
argument to bufname().

It also has an optional {id}, where zero means it's not passed in.

Yes. Converting sign_place() to accept a List of dicts will make this
simpler.

Adding a new function that takes a list of dictionaries could be a good
alternative. We then do need to validate the entries to check if the
required keys are included. It will then be possible to either pass a
buffer number or a file name.

I have the changes for this ready to go (including the check for existence
of the required keys). I will merge my local changes with the recent
changes to sign.c/evalfunc.c and create a pull request.

I have created PR #4602 (https://github.com/vim/vim/pull/4602) for this.
I have simplified the sign_place(), sign_unplace() and sign_getplaced()
functions. Took some time to make these changes as the sign tests heavily
use these functions. Note that this change is not backward compatible.

Yegappan

Yegappan wrote:

Thinking about this some more, we should modify the existing
sign_place() function to always accept a List argument

Just to say, I don't have any strong feelings either way. I'll defer
to those with more experience of the Vim API and how changes are made.

The current sign_place() function is basically mimicking ":sign place".
One of the quirks is that it takes a file name, not a buffer number.

The sign_place() function accepts either a buffer name or a buffer
number. The {expr} argument to sign_place() is same as the {expr}
argument to bufname().

It also has an optional {id}, where zero means it's not passed in.

Yes. Converting sign_place() to accept a List of dicts will make this
simpler.

Adding a new function that takes a list of dictionaries could be a good
alternative. We then do need to validate the entries to check if the
required keys are included. It will then be possible to either pass a
buffer number or a file name.

I have the changes for this ready to go (including the check for existence
of the required keys). I will merge my local changes with the recent
changes to sign.c/evalfunc.c and create a pull request.

I have created PR #4602 (https://github.com/vim/vim/pull/4602) for this.
I have simplified the sign_place(), sign_unplace() and sign_getplaced()
functions. Took some time to make these changes as the sign tests heavily
use these functions. Note that this change is not backward compatible.

The sign functions were added more than half a year ago.  I don't think
a change that is not backward compatible will be appreciated.
I think for sign_define() we can support both the old arguments and a
list argument.  for sign_getplaced() we don't need changes.  For
place/unplace add a new "list" function:
sign_define({name} [, {dict}])
sign_define({list})

sign_getplaced([{expr} [, {dict}]])

sign_place({id}, {group}, {name}, {expr} [, {dict}])
sign_placelist({list})

sign_unplace({group} [, {dict}])
sign_unplacelist({list})

Does that sound reasonable?
--
An extraordinary TALL KNIGHT in all black (possibly John with Mike on his
shoulders) walks out from the dark trees.  He is extremely fierce and
gruesome countenance.  He walks towards KING ARTHUR and PATSY, who are
wazzing like mad.  (Salopian slang, meaning very scared.  almost to the
point of wetting oneself, e.g. before an important football match or
prior to a postering.  Salopian slang meaning a beating by the school
praeposters.  Sorry about the Salopian slant to this stage direction - Ed.)
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar --<EMAIL_ADDRESS>-- http://www.Moolenaar.net   \
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \
\\  an exciting new programming language -- http://www.Zimbu.org        ///
\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

Hi Bram,
On Mon, Jul 1, 2019 at 1:38 PM Bram Moolenaar<EMAIL_ADDRESS>wrote:

Yegappan wrote:

Thinking about this some more, we should modify the existing
sign_place() function to always accept a List argument

Just to say, I don't have any strong feelings either way. I'll defer
to those with more experience of the Vim API and how changes are made.

The current sign_place() function is basically mimicking ":sign place".
One of the quirks is that it takes a file name, not a buffer number.

The sign_place() function accepts either a buffer name or a buffer
number. The {expr} argument to sign_place() is same as the {expr}
argument to bufname().

It also has an optional {id}, where zero means it's not passed in.

Yes. Converting sign_place() to accept a List of dicts will make this
simpler.

Adding a new function that takes a list of dictionaries could be a good
alternative. We then do need to validate the entries to check if the
required keys are included. It will then be possible to either pass a
buffer number or a file name.

I have the changes for this ready to go (including the check for existence
of the required keys). I will merge my local changes with the recent
changes to sign.c/evalfunc.c and create a pull request.

I have created PR #4602 (https://github.com/vim/vim/pull/4602) for this.
I have simplified the sign_place(), sign_unplace() and sign_getplaced()
functions. Took some time to make these changes as the sign tests heavily
use these functions. Note that this change is not backward compatible.

The sign functions were added more than half a year ago.  I don't think
a change that is not backward compatible will be appreciated.
I think for sign_define() we can support both the old arguments and a
list argument.  for sign_getplaced() we don't need changes.  For
place/unplace add a new "list" function:
    sign_define({name} [, {dict}])
    sign_define({list})

    sign_getplaced([{expr} [, {dict}]])

    sign_place({id}, {group}, {name}, {expr} [, {dict}])
    sign_placelist({list})

    sign_unplace({group} [, {dict}])
    sign_unplacelist({list})

Does that sound reasonable?

Instead of adding the new sign_placelist() and sign_unplacelist() functions,
how about modifying the existing sign_place() and sign_unplace() functions
to also accept a {list} argument (similar to the sign_define() function above)?
So the new set of functions will be like below:
     sign_define({name} [, {dict}])
     sign_define({list})

     sign_getplaced([{expr} [, {dict}]])

     sign_place({id}, {group}, {name}, {expr} [, {dict}])
     sign_place({list})

     sign_unplace({group} [, {dict}])
     sign_unplace({list})

Yegappan

My only comment here would be that sign_setlist as proposed in my original description not only handles setting of signs but also unsetting. That is, it ensures the buffer's sign list reflects the argument. Because in the context of my example I have the list of errors for a buffer (the same list that populates the quickfix window) and I simply want to say "now ensure the signs for this buffer are this list X", just as I call setqflist to update the quickfix window.
So from a selfish perspective I'd prefer not to have to keep track of/derive the delta to be applied, I'd like to just call a function that does all of that for me.

My only comment here would be that sign_setlist as proposed in my
original description not only handles setting of signs but also
unsetting. That is, it ensures the buffer's sign list reflects the
argument. Because in the context of my example I have the list of
errors for a buffer (the same list that populates the quickfix window)
and I simply want to say "now ensure the signs for this buffer are
this list X", just as I call setqflist to update the quickfix
window.
So from a selfish perspective I'd prefer not to have to keep track
of/derive the delta to be applied, I'd like to just call a function
that does all of that for me.

That's just one use case.  It's easy enough to clear all signs and then
add a list of signs.  Since we need a function to add a list and a
function clear all signs, also having a function for setting a list
would duplicate functionality.
--
Proverb: A nightingale that forgets the lyrics is a hummingbird.
/// Bram Moolenaar --<EMAIL_ADDRESS>-- http://www.Moolenaar.net   \
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \
\\  an exciting new programming language -- http://www.Zimbu.org        ///
\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

Yegappan wrote:

Thinking about this some more, we should modify the existing
sign_place() function to always accept a List argument

Just to say, I don't have any strong feelings either way. I'll defer
to those with more experience of the Vim API and how changes are made.

The current sign_place() function is basically mimicking ":sign place".
One of the quirks is that it takes a file name, not a buffer number.

The sign_place() function accepts either a buffer name or a buffer
number. The {expr} argument to sign_place() is same as the {expr}
argument to bufname().

It also has an optional {id}, where zero means it's not passed in.

Yes. Converting sign_place() to accept a List of dicts will make this
simpler.

Adding a new function that takes a list of dictionaries could be a good
alternative. We then do need to validate the entries to check if the
required keys are included. It will then be possible to either pass a
buffer number or a file name.

I have the changes for this ready to go (including the check for existence
of the required keys). I will merge my local changes with the recent
changes to sign.c/evalfunc.c and create a pull request.

I have created PR #4602 (https://github.com/vim/vim/pull/4602) for this.
I have simplified the sign_place(), sign_unplace() and sign_getplaced()
functions. Took some time to make these changes as the sign tests heavily
use these functions. Note that this change is not backward compatible.

The sign functions were added more than half a year ago.  I don't think
a change that is not backward compatible will be appreciated.
I think for sign_define() we can support both the old arguments and a
list argument.  for sign_getplaced() we don't need changes.  For
place/unplace add a new "list" function:
    sign_define({name} [, {dict}])
    sign_define({list})

    sign_getplaced([{expr} [, {dict}]])

    sign_place({id}, {group}, {name}, {expr} [, {dict}])
    sign_placelist({list})

    sign_unplace({group} [, {dict}])
    sign_unplacelist({list})

Does that sound reasonable?

Instead of adding the new sign_placelist() and sign_unplacelist() functions,
how about modifying the existing sign_place() and sign_unplace() functions
to also accept a {list} argument (similar to the sign_define() function above)?
So the new set of functions will be like below:
     sign_define({name} [, {dict}])
     sign_define({list})

     sign_getplaced([{expr} [, {dict}]])

     sign_place({id}, {group}, {name}, {expr} [, {dict}])
     sign_place({list})

     sign_unplace({group} [, {dict}])
     sign_unplace({list})

Hmm, it would work, of course, but is it better?  I don't think so.  The
documentation for sign_place() would be two complete different sections,
one explaining the first set of arguments and one explaining the {list}
argument.  That doesn't make it simpler for the user.
It's true that having both sign_place() and sign_placelist() makes the
list of functions longer, but since the meaning is obvious I don't think
it matters much.
--
'I generally avoid temptation unless I can't resist it."
-- Mae West
/// Bram Moolenaar --<EMAIL_ADDRESS>-- http://www.Moolenaar.net   \
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \
\\  an exciting new programming language -- http://www.Zimbu.org        ///
\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

That's just one use case.

Yes, indeed: quite accept that I'm only speaking about my particular use case here.
The reason behind me being attracted to this approach is that it makes it simpler from a channel-based plugin to do everything with a single call (reduces round trips), which also means less flicker for the user. As I understand it, with two calls (clear then set) there is potential (likely?) for flickering.

Paul Jolly wrote:

That's just one use case.

Yes, indeed: quite accept that I'm only speaking about my particular
use case here.
The reason behind me being attracted to this approach is that it makes
it simpler from a channel-based plugin to do everything with a single
call (reduces round trips), which also means less flicker for the
user. As I understand it, with two calls (clear then set) there is
potential (likely?) for flickering.

It would do the same thing, only with one function instead of two.
So long as Vim keeps busy there will be no redraw.  If you pause, then
yes.  Why would there be an extra round trip?  The function calls can be
in one message, right?
--
Futility Factor: No experiment is ever a complete failure - it can always
serve as a negative example.
/// Bram Moolenaar --<EMAIL_ADDRESS>-- http://www.Moolenaar.net   \
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \
\\  an exciting new programming language -- http://www.Zimbu.org        ///
\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

The function calls can be in one message, right?

Very true.

Hi Bram,
On Mon, Jul 1, 2019 at 1:38 PM Bram Moolenaar<EMAIL_ADDRESS>wrote:

I have created PR #4602 (https://github.com/vim/vim/pull/4602) for this.
I have simplified the sign_place(), sign_unplace() and sign_getplaced()
functions. Took some time to make these changes as the sign tests heavily
use these functions. Note that this change is not backward compatible.

The sign functions were added more than half a year ago.  I don't think
a change that is not backward compatible will be appreciated.
I think for sign_define() we can support both the old arguments and a
list argument.  for sign_getplaced() we don't need changes.  For
place/unplace add a new "list" function:
    sign_define({name} [, {dict}])
    sign_define({list})

    sign_getplaced([{expr} [, {dict}]])

    sign_place({id}, {group}, {name}, {expr} [, {dict}])
    sign_placelist({list})

    sign_unplace({group} [, {dict}])
    sign_unplacelist({list})

Does that sound reasonable?

I have created PR #4636 that implements the above functions.
https://github.com/vim/vim/pull/4636

Yegappan

Yegappan wrote:

On Mon, Jul 1, 2019 at 1:38 PM Bram Moolenaar<EMAIL_ADDRESS>wrote:

I have created PR #4602 (https://github.com/vim/vim/pull/4602) for this.
I have simplified the sign_place(), sign_unplace() and sign_getplaced()
functions. Took some time to make these changes as the sign tests heavily
use these functions. Note that this change is not backward compatible.

The sign functions were added more than half a year ago.  I don't think
a change that is not backward compatible will be appreciated.
I think for sign_define() we can support both the old arguments and a
list argument.  for sign_getplaced() we don't need changes.  For
place/unplace add a new "list" function:
    sign_define({name} [, {dict}])
    sign_define({list})

    sign_getplaced([{expr} [, {dict}]])

    sign_place({id}, {group}, {name}, {expr} [, {dict}])
    sign_placelist({list})

    sign_unplace({group} [, {dict}])
    sign_unplacelist({list})

Does that sound reasonable?

I have created PR #4636 that implements the above functions.
https://github.com/vim/vim/pull/4636

Thanks!  It looks good.  I'll wait a couple of days to give others a
chance to comment.

DENNIS:  Ah, now we see the violence inherent in the system.

DENNIS:  Oh!  Come and see the violence inherent in the system!
HELP! HELP!  I'm being repressed!
The Quest for the Holy Grail (Monty Python)
/// Bram Moolenaar --<EMAIL_ADDRESS>-- http://www.Moolenaar.net   \
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \
\\  an exciting new programming language -- http://www.Zimbu.org        ///
\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

Hi all,
On Tue, Jul 9, 2019 at 12:53 PM Bram Moolenaar<EMAIL_ADDRESS>wrote:

Yegappan wrote:

On Mon, Jul 1, 2019 at 1:38 PM Bram Moolenaar<EMAIL_ADDRESS>wrote:

I have created PR #4602 (https://github.com/vim/vim/pull/4602) for this.
I have simplified the sign_place(), sign_unplace() and sign_getplaced()
functions. Took some time to make these changes as the sign tests heavily
use these functions. Note that this change is not backward compatible.

The sign functions were added more than half a year ago.  I don't think
a change that is not backward compatible will be appreciated.
I think for sign_define() we can support both the old arguments and a
list argument.  for sign_getplaced() we don't need changes.  For
place/unplace add a new "list" function:
    sign_define({name} [, {dict}])
    sign_define({list})

    sign_getplaced([{expr} [, {dict}]])

    sign_place({id}, {group}, {name}, {expr} [, {dict}])
    sign_placelist({list})

    sign_unplace({group} [, {dict}])
    sign_unplacelist({list})

Does that sound reasonable?

I have created PR #4636 that implements the above functions.
https://github.com/vim/vim/pull/4636

Thanks!  It looks good.  I'll wait a couple of days to give others a
chance to comment.

I am including the documentation update from the PR below.
Let me know if you have any comments on the new functionality.

Yegappan

sign_define({name} [, {dict}])
sign_define({list})
Define a new sign named {name} or modify the attributes of an
existing sign.  This is similar to the |:sign-define| command.
            Prefix {name} with a unique text to avoid name collisions.
            There is no {group} like with placing signs.

            The {name} can be a String or a Number.  The optional {dict}
            argument specifies the sign attributes.  The following values
            are supported:
               icon         full path to the bitmap file for the sign.
               linehl       highlight group used for the whole line the
                            sign is placed in.
               text         text that is displayed when there is no icon
                            or the GUI is not being used.
               texthl       highlight group used for the text item

            If the sign named {name} already exists, then the attributes
            of the sign are updated.

            The one argument {list} can be used to define a list of signs.
            Each list item is a dictionary with the above items in {dict}
            and a 'name' item for the sign name.

            Returns 0 on success and -1 on failure.  When the one argument
            {list} is used, then returns a List of values one for each
            defined sign.

            Examples:
                    call sign_define("mySign", {"text" : "=>", "texthl" :
                                    \ "Error", "linehl" : "Search"})
                    call sign_define([{'name' : 'sign1', 'text' : '=>'},
                            \ {'name' : 'sign2', 'text' : '!!'}])

sign_undefine([{name}])
sign_undefine({list})
Deletes a previously defined sign {name}. This is similar to
the |:sign-undefine| command. If {name} is not supplied, then
deletes all the defined signs.
            The one argument {list} can be used to undefine a list of
            signs. Each list item is the name of a sign.

            Returns 0 on success and -1 on failure.  For the one argument
            {list} call, returns a list of values one for each undefined
            sign.

            Examples:
                    " Delete a sign named mySign
                    call sign_undefine("mySign")

                    " Delete signs 'sign1' and 'sign2'
                    call sign_undefine(["sign1", "sign2"])

                    " Delete all the signs
                    call sign_undefine()

sign_placelist({list})
Place one or more signs.  This is similar to the
|sign_place()| function.  The {list} argument specifies the
List of signs to place. Each list item is a dict with the
following sign attributes:
buffer          buffer name or number. For the
accepted values, see |bufname()|.
group           sign group. {group} functions as a
namespace for {id}, thus two groups
can use the same IDs. If not specified
or set to an empty string, then the
global group is used.   See
|sign-group| for more information.
id              sign identifier. If not specified or
zero, then a new unique identifier is
allocated. Otherwise the specified
number is used. See |sign-identifier|
for more information.
lnum            line number in the buffer {expr} where
the sign is to be placed. For the
accepted values, see |line()|.
name            name of the sign to place. See
|sign_define()| for more information.
priority        priority of the sign. When multiple
signs are placed on a line, the sign
with the highest priority is used. If
not specified, the default value of 10
is used. See |sign-priority| for more
information.
            If {id} refers to an existing sign, then the existing sign is
            modified to use the specified {name} and/or {priority}.

            Returns a List of sign identifiers. If failed to place a
            sign, the corresponding list item is set to -1.

            Examples:
                    " Place sign s1 with id 5 at line 20 and id 10 at line
                    " 30 in buffer a.c
                    let [n1, n2] = sign_place([{'id' : 5, 'name' : 's1',
                                    \ 'buffer' : 'a.c', 'lnum' : 20},
                                    \ {'id' : 10, 'name' : 's1',
                                    \ 'buffer' : 'a.c', 'lnum' : 30}])

                    " Place sign s1 in buffer a.c at line 40 and 50
                    " with auto-generated identifiers
                    let [n1, n2] = sign_place([{'name' : 's1',
                                    \ 'buffer' : 'a.c', 'lnum' : 40},
                                    \ {'name' : 's1', 'buffer' : 'a.c',
                                    \ 'lnum' : 50}])

sign_unplacelist({list})
Remove previously placed signs from one or more buffers.  This
is similar to the |sign_unplace()| function.
            The {list} argument specifies the List of signs to remove.
            Each list item is a dict with the following sign attributes:
                    buffer  buffer name or number. For the accepted
                            values, see |bufname()|. If not specified,
                            then the specified sign is removed from all
                            the buffers.
                    group   sign group name. If not specified or set to an
                            empty string, then the global sign group is
                            used. If set to '*', then all the groups
                            including the global group are used.
                    id      sign identifier. If not specified, then all
                            the signs in the specified group are removed.

            Returns a List where an entry is set to 0 if the corresponding
            sign was successfully removed or -1 on failure.

            Example: >
                    " Remove sign with id 10 from buffer a.vim and sign
                    " with id 20 from buffer b.vim
                    call sign_unplace([{'id' : 10, 'buffer' : "a.vim"},
                                    \ {'id' : 20, 'buffer' : 'b.vim'}])

The function calls can be in one message, right?

Very true.

As a follow up to this point (and hopefully not straying too far off topic on this thread), we now have a first cut of batching calls in govim (which could easily be extended to include the other channel functions if required):
https://github.com/myitcv/govim/commit/bcba0c82cb9e5e86ffb3a9ca55c196d3c1a3e0f1
(which was then accompanied by a later bug fix https://github.com/myitcv/govim/commit/2848a08d70f9b5ab2a834bbe0119dfa43aed79dc)
The approach works well.
That said, the changes in this will likely still be a benefit I'd assume? Because we move from multiple function calls to two calls with list arguments.

Hi,
On Tue, Jun 18, 2019 at 2:37 AM Paul Jolly<EMAIL_ADDRESS>wrote:

Is your feature request related something that is currently hard to do? Please describe.
Per https://groups.google.com/d/msg/vim_dev/aW2buOgZ6qI/fpxkp-V8AQAJ
In https://github.com/leitzler/govim (master branch) Pontus is adding support to govim for signs that correspond to quickfix entries.
This is done by calling sign_place/sign_unplace as required to get the signs for a buffer in the correct state.
If there are lots of errors in a file, then there can be a large number of calls to sign_place/sign_unplace made by govim in rapid succession.
Describe the solution you'd like
A function:
sign_setlist({bfnr}, {list} [, {action}])
that sets the signs for buffer {bufnr} to {list}. {action} is similar to setqflist in that the caller can specify whether to create, replace or add to existing signs.
Describe alternatives you've considered
The only apparent alternative at the moment is to call sign_getplaced and then make the necessary calls to sign_place/sign_unplace; over a channel this becomes expensive.
Additional context
n/a

The support for this has now been merged in patch 8.1.1682.
Let me know if there are any issues with the functionality.

Yegappan


A  shortcoming of grammar color displaying in typescript

VSCode Version: 1.7.2
OS Version: Windows 10 x64

Steps to Reproduce:
There is a shortcoming of grammar color displaying in typescript, as follow:

 interface Itest {
	a: 'a1' // a1 is good
		| 'a2' // a2 is good
		| 'a3' // a3 is good
	b: {
		a: 'a1'
			| 'a2' // oh , the color is not good !
			| 'a3' // oh , the color is not good !
	}
}

Sometimes we want to give clear indication of  the meanings of every items of  String Literal Types in inline comment, so we would break String Literal Types into many lines.

This issue was moved to Microsoft/TypeScript-TmLanguage#376


Server multiple CPU support

How can i add support to use my 2 CPU'S?
Looks like all the scrips run on one core only.
I'm very new at this, so thanks for your help.

https://github.com/ageitgey/face_recognition#speeding-up-face-recognition
Face recognition can be done in parallel if you have a computer with multiple CPU cores. For example if your system has 4 CPU cores, you can process about 4 times as many images in the same amount of time by using all your CPU cores in parallel.
If you are using Python 3.4 or newer, pass in a --cpus <number_of_cpu_cores_to_use> parameter:
$ face_recognition --cpus 4 ./pictures_of_people_i_know/ ./unknown_pictures/
You can also pass in --cpus -1 to use all CPU cores in your system.

Just to clarify, is there is no way to use multiple CPUs to generate a single face encoding?


nimIntegrate

This is WIP, for comments from @paul-vdb @perrydv and (if interested) @danielturek .
Based on initial work by Paul and Perry, this creates a new DSL keyword, nimIntegrate that behaves like R's integrate, calling out to Rqdag{s,i} for bounded and unbounded 1-d numerical integration.
Some things to consider:

[ ] This allows a user to pass additional params to the integrand via a required (but could be ignored) param = double(1) argument to nimIntegrate. The user then has to unpack information from this for use in integrand function (the integrand function can ignore the argument, but it is required that it have the argument). Not sure if we want to try to make this more user-friendly (or indeed how to do that).
[ ] The user must provided a vectorized integrand. Not sure if we want to relax this and make possible a non-vectorized that we then vectorize in NimIntegrateProblem::fn in nimIntegrate.cpp.
[ ] For the moment, we just return the estimated integrand. R's integrate returns an error estimate and indeed a full list with diagnostic info. We could handle this using functionality similar to nimOptim, in which case the user's nimbleFunction that uses nimIntegrate() would have to unpack the output list. Perhaps it's enough in this initial release to leave as is. [update 2023-12-18: we plan to start with returning a 2-vector of the value and the uncertainty and in future work allow the user to indicate whether to return just the result, the 2-vector, or a list where the list would also contain the string-typed result message.] [update 2024-01-03: actually might as well return 3-vec with ierr as the code for the message and tell the user the code mapping. To do this we will allocate a nimArray of length 3 in the nimIntegrate class, return that array and have sizeExpr be 3 in sizeIntegrate. We don't think there will be any issue with memory deallocation.]
[ ] We allocate temp working space for Rqdag{s,i} in the work and iwork arrays. This is done when the "problem" object is created, so presumably happens every time nimIntegrate is invoked. I'm not seeing a good way to create those working objects only once. I guess we could allow the user to create them in their nimbleFunction and pass them in. [update 2024-01-03: Perry suggested use of static class vectors so that the temp arrays are shared by all members of the class and we resize the array as needed. Likely leave this for future work.]
[ ] Perhaps use std vectors.
[ ] Testing, roxygen, and manual are all set up.

Some example code:
integrand <- nimbleFunction(
    run = function(x = double(1), theta = double(1)) {
        return(x*theta[1])
    returnType(double(1))
  }
)

foo <- nimbleFunction(
    run = function(theta = double(0), lower = double(0), upper = double(0)) {
        tmp = c(theta, 0)
    return(integrate(integrand, lower, upper, tmp))
    returnType(double())
  }
)

cfoo <- compileNimble(foo)

foo(3.1415927, 0,1)
cfoo(3.1415927, 0,1)

# With a model:

code <- nimbleCode({
    sigma ~ dunif(0,5)
    tau ~ dunif(0,5)
    mu0 ~ dnorm(0, sd = 100)
    for(i in 1:n)
        y[i] ~ dintglmm(mu0,sigma,tau)
})

integrand <- nimbleFunction(
    run = function(mu = double(1), pars = double(1)) {
        result = exp(dnorm(pars[1], mu, sd = pars[3]) + dnorm(mu, pars[2], sd = pars[4]))
        return(result)
        returnType(double(1))
    }
)

dintglmm <- nimbleFunction(
    run = function(x = double(0), mu0 = double(0), sigma = double(0),
                   tau = double(0), log = integer(0, default = 0)) {
        returnType(double(0))
        pars <- c(x,mu0,sigma,tau)
        prob <- integrate(integrand, -100, 100, pars)
        if(log) return(log(prob)) else return(prob)
    },

    )

m <- nimbleModel(code, data = list(y = rnorm(5)), constants = list(n=5),
                 inits = list(mu0 = 0, sigma = 1, tau = 1))
cm <- compileNimble(m)
cm$calculate('y')

Ok, I have an essentially full-featured version of nimIntegrate set up. (A bit ago I thought it might be more bare-bones, but it was pretty straightforward to get everything going.)
The output is a 3-vector containing the estimate, uncertainty and a result code. We could implement variations down the road, but I'm pretty happy with it as is.
@paul-vdb particularly given your experience with using numerical integration in models, would like any thoughts you have on the user interface and roxygen/manual.
@perrydv let me know if you see any technical issues in terms of the C++.

Actually, @perrydv one thing I'd like input on is the following. If we try to have the param argument be an expression rather than the name of a variable such as integrate(integrand, lower, upper, c(theta,0)), as seen in the last test in test-integrate.R, then we get this C++ compilation issue because integrate is expecting a nimArray as the param argument.
> printErrors()
using C++ compiler: ‘g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
P_31_rcFun_R_GlobalEnv67.cpp: In function ‘NimArr<1, double> rcFun_R_GlobalEnv67(double, double, double)’:
P_31_rcFun_R_GlobalEnv67.cpp:51:22: error: no matching function for call to ‘nimIntegrate(NimArr<1, double> (&)(NimArr<1, double>&, NimArr<1, double>&), double&, double&, Eigen::CwiseNullaryOp<concatenate1Class<long int, std::vector<double>, double>, Eigen::Matrix<double, -1, -1> >, int, double, double, bool)’
   51 | output = nimIntegrate(rcFun_R_GlobalEnv66, ARG2_lower_, ARG3_upper_, nimCd((ConcatenateInterm_60)), 100, 0.0001220703125, 0.0001220703125, true);
      |          ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from P_31_rcFun_R_GlobalEnv67.h:11,
                 from P_31_rcFun_R_GlobalEnv67.cpp:13:
/tmp/nim-int3/nimble/include/nimble/nimIntegrate.h:97:19: note: candidate: ‘template<class Fn> NimArr<1, double> nimIntegrate(Fn, double, double, NimArr<1, double>&, int, double, double, bool)’
   97 | NimArr<1, double> nimIntegrate(
      |                   ^~~~~~~~~~~~
/tmp/nim-int3/nimble/include/nimble/nimIntegrate.h:97:19: note:   template argument deduction/substitution failed:
P_31_rcFun_R_GlobalEnv67.cpp:51:75: note:   cannot convert ‘concatenate_impl<Eigen::Matrix<double, -1, -1> >::concatenate<std::vector<double> >(ConcatenateInterm_60)’ (type ‘Eigen::CwiseNullaryOp<concatenate1Class<long int, std::vector<double>, double>, Eigen::Matrix<double, -1, -1> >’) to type ‘NimArr<1, double>&’
   51 | output = nimIntegrate(rcFun_R_GlobalEnv66, ARG2_lower_, ARG3_upper_, nimCd((ConcatenateInterm_60)), 100, 0.0001220703125, 0.0001220703125, true);

I'm not sure whether we want to error trap and tell users they need to manually 'lift' the expression for param.

@paciorek sorry for my lack of response on this thread. Of course, now that I want to have this function already in Nimble, I am more motivated to help out. I am happy to help out with some rOxygen. I actually have a very explicit example right now playing around with a generalized von mises distribution that uses R's integrate function. What do you need from me explicitly? My opinion on the function needing to be vectorized I would say that would be very convenient if that is possible internally. It is very annoying on the user end to do this when using integrate help file suggests "Vectorize(fn)".

@paciorek Played around a little with nimIntegrate and I love that it is in there. I made a generalized von Mises with it that is silly simple with the integrate function. Awesome work!
integrand <- nimbleFunction(
    run = function(x = double(1), theta = double(1)) {
        return( exp(theta[1] * cos(x) + theta[2] * cos(2 * (x + theta[3]))) )
        returnType(double(1))
})
dGenVonMises <- nimbleFunction(
  run = function(x = double(1), mu1 = double(), mu2 = double(), kappa1 = double(), kappa2 = double(), limits = double(1)){
    range <- limits[2] - limits[1]
    mu1R <- (mu1 - range/2)/range*2*pi
    mu2R <- (mu2 - range/2)/range*2*pi
    z <- (x - range/2)/range*2*pi
    d = (mu1R - mu2R) %% pi
    num <- exp(kappa1 * cos(z - mu1R) + kappa2 * cos(2 * (z - mu2)))
    tmp <- c(kappa1, kappa2, d)
    den <- nimIntegrate(integrand, lower = 0, upper = 2*pi, tmp)[1]
    dens <- num/den
    return(dens*2*pi/range)
    returnType(double(1))
  }
)

cgvonmises <- compileNimble(dGenVonMises)
x <- 0:360
# plot(x, circular::dgenvonmises(circular(x, type = "angles", units = "degrees"), -1, 1, 2, 1))
plot(x, cgvonmises(x, mu1=20, mu2=300, kappa1=2, kappa2=1, limits = c(0, 360)), type = 'l')

Thanks @paul-vdb . I may try to make use of your example in the manual section in nimIntegrate.

@paciorek The main thing I would highlight in the roxygen is that we have to pass all the parameters into the param vector of the integrand, unlike R which can you can call via
integrate(integrand, lower = -Inf, upper = Inf, mu = 0, sigma = 2)

where here they have can only have two arguments to the integrand. 1) a single dimension for integrating in vector format, 2) an object (vector, matrix, array...) containing all the parameters for integration.
nimIntegrate(integrand, lower = -Inf, upper = Inf, param = c(0,2))

I think when nimble functions with setup code are eventually allowed into model code (@perrydv which sounds very soonish?), then we can adapt some of these restrictions via defining constants separately in a method before calling nimIntegrate. Also, having the integrand in a method instead of a separate function will be great.
I think for a user interested in integration it totally meets the objective. I'll think of a more compelling NHPP model to fit to add to the manual to actually show people when it might be useful. Although so easily adding a generalized von Mises is very compelling to me! Note that the example I added doesn't match the circular package as their example is only a distribution for radians. I've added the Jacobian to make it the distribution for the original input (e.g. day of the year, degrees etc.) which is what I personally wanted it for.

@paciorek I am starting to do a code review on this. One thing is can you check against #1378 (now merged into devel)? I think there, in fixing a nimOptim issue, you had modified exprClasses_setSizes with a special case used only by nimOptim, and now in this PR you are using the same approach for nimIntegrate. But I had revised your changes to #1378 in a way that I thought was more consistent with the system and less of a hot-wired special case, and my version of those little bits are what got merged into devel. So right now your nimIntegrate code would revert to the intermediate version you had in #1378 before I changed it. I think it would be better to use the later (now merged) approach for nimIntegrate as well. Let me know if you want me to make these changes.

Alright I'm seeing a few other issues. It looks like the use of eval in keyword processing could cause a problem if the user has done rol.tel = my_tol, i.e. passed a local variable. And it looks like we could imitate sizeOptim to handle cases where f is either a method, a method of another  nimbleFunction, or an RCfunction. I know we are just aiming for basics, but it seems like it's all there to imitate and maybe was just not clear or familiar. Seeing these, I will plan to make changes directly unless you'd prefer me not to.

@paciorek A couple of questions: It looks like R's integrate also returns the number of subdivisions use in the integration. It looks like we have access to that internally and could include it to make the return vector be length 4. Did you not want to do that or should we do that to be more complete? Also, the R-style lazy evaluation defaults of abs.tol = rel.tol can't work in compiled code, so I will make rel.tol default to the same as abs.tol's default. That does mean that changing rel.tol will not automatically change abs.tol by default.

I believe I left out the number of subdivisions because it is controlled by the user so it didn't seem necessary to tell them what they put in.
As far as lazy eval, I was trying to mimic what we do with the args of the gamma distribution (scale and rate), and really thought I had done it correctly in the keyword processing. Can you say more about what the integrate keyword processing is doing wrong? That all happens at compile time, so aren't we free to be quite flexible about how we transform the code that a user provides?

@paciorek Take a look at what I did here. A remaining use case that we could try to support would be using nimIntegrate directly in a model. But I suspect we are happy to defer that because it is easy enough to write a nimbleFunction to wrap a call to nimIntegrate, as you demonstrated in test-integrate. See test-integrate to walk through the changes in functionality that I made.

I'm now catching comments in the thread that I didn't see before I pushed code.

I think you are right that we can implement the rel.tol = abs.tol in keyword processing. I was focused on changing how we catch use of .Machine$double.eps and missed what you had done for the default handling. I think we can combine ideas with another edit. Note however that setting the code for rel.tol to the code for abs.tol could be weird in some situations, e.g. abs.tol = foo(x) where either foo(x) is very costly (and gets called twice) or where foo(x) is stochastic (and gets called twice). Neither scenario seems very likely.
Oh, without thinking about it I wondered if subdivisions is ever different due to some algorithm steps than what the user provided. But if not then I agree.

BTW having param be an expression should now work and is shown in testing.

Testing hung on test-ADlaplace, presumably unrelated to this PR. I'm merging and we'll deal with any actual issues on devel.


Notebook Editor ignores (and even overrides) env setting from jupyter kernel

Jupyter kernel definitions allow to specify environment variables in their kernel.json files:
  "env": {
    "PYTHONPATH": "/vol/tensorflow/1.12/lib/python3.6/site-packages",
    "LD_LIBRARY_PATH": "/vol/tensorflow/1.12/libcuda"
  },

However, these settings are ignored and even overridden by the jupyter server started from vscode, which is very annoying. Starting my jupyter server externally and just reusing it from vscode, everything works as expected (the PYTHONPATH is considered and the variables are kept).
In this context, I noticed another issue: the command "Specify local or remote Jupyter server for connections" doesn't really allow to enter a new connection: Enter is just ignored. I had to go through settings to change this config.

Using the config setting
"python.dataScience.useDefaultConfigForJupyter": false
everything works as expected from vscode as well. Looks like this feature is messing up the kernel config.

Hm. The config setting saves the environment for the first run (before it wasn't considered at all).
However, the env section is still overridden in the kernel.json config file.

We should only be overwriting the kernel.json file if it has a section like so:
 "metadata": {
    "interpreter": {
      "architecture": 3,
      "path": "C:\\Users\\rchiodo.REDMOND\\AppData\\Local\\Continuum\\miniconda3\\envs\\test2\\python.exe",
      "version": {
        "options": {
          "loose": false,
          "includePrerelease": false
        },
        "loose": false,
        "raw": "3.6.10-final",
        "major": 3,
        "minor": 6,
        "patch": 10,
        "prerelease": [
          "final"
        ],
        "build": [],
        "version": "3.6.10-final"
      },
      "sysPrefix": "C:\\Users\\rchiodo.REDMOND\\AppData\\Local\\Continuum\\miniconda3\\envs\\test2",
      "fileHash": "1de1ffc46ea52acfa109f052b227568d7b5c7c6b9741985888d118a062e552b1075ddd11a06dfbf67032c3f3fc4423e72f77686286199f24f7ea983cfd5cbff6",
      "companyDisplayName": "Anaconda, Inc.",
      "type": "Conda",
      "envPath": "C:\\Users\\rchiodo.REDMOND\\AppData\\Local\\Continuum\\miniconda3\\envs\\test2",
      "envName": "test2",
      "displayName": "Python 3.6.10 64-bit ('test2': conda)"
    }
  }

What do you see for the command 'Specify local or remote Jupyter server for connections'. It should show this:

You can then mouse or arrow down to either a setting you've used in the past or pick 'existing'. That then requires you type in a new uri.

The default 'hostname' there has to be changed.

Sorry should have said why we update the environment on kernels with 'interpreter' metadata. These are kernels generated by us that are supposed to map to specific python environments you have. If that environment changes, we want it to still work, so we force an update to the 'env' field in the kernel.json.
If you want a kernel that you can change the environment in, you should be able to create a fresh one.
In fact that's what I did when fixing this bug here:
https://github.com/microsoft/vscode-python/issues/11749

Can I add, Jupyter launched via VSCode doesnt respect sys.path
Even if i add something to sys.path, it is unable to find the module.
Works fine via web though

Can I add, Jupyter launched via VSCode doesnt respect sys.path
Even if i add something to sys.path, it is unable to find the module.
Works fine via web though

Not sure what you mean by that. How do you add something to the sys.path in the kernel before you start it?

Let's keep this issue focussed on the env overriding... Yes, I modified the kernel.json created by vscode. Maybe I shouldn't have done this. Removing the metadata section from kernel.json everything works as expected. Closing here.


Download test input and if possible solution for that day

Would be a nice feature to also automatically fetch the test input and if possible the solution for it automatically, to easily validate ones program to work. It would be very convenient and a very quick way to validate if a solution is even remotely correct

There already is the -x flag for fetching and using the example input. The solution might be difficult to identify in HTML.