[pkg/util/kubernetes][CONTINT-477] add rate_limit_queries_remaining_min telemetry in cluster agent external metrics server

What does this PR do?
This PR adds rate_limit_queries_remaining_min telemetry in cluster agent external metrics server. This metric represents the minimum of number of remaining requests over the last 2*refresh_period that the datadog client can send to the backend.
rate_limit_queries_remaining_min is updated in 2 cases:

The new received rate limit remaining queries is less than the existing value of rate_limit_queries_remaining_min
rate_limit_queries_remaining_min has not been updated for more than 2 * refresh_period

The refresh period is set to 30 seconds by default.
Motivation
As Datadog Cluster-Agent user, I would like to monitor the state of the external-metrics server to better react in case of Datadog API query Rate-limit errors, since it can impact my applications autoscaling.
The official datadog-cluster-agent integration already provide some metrics to see the current rate limit state by API key. It works fine when the Rate Limit quota is set for a period of 1h hour.
For example a customer can send 20k queries per hour. So the metric (generated every 15sec) can decrease during the 1 hour period. and create a monitor if the metrics return only 10% of the quota.
But with new rate limit configuration for large customer, this metric become useless since the Rate-Limit period is now 10sec. For example 200 queries every 10sec. Which make the value flaky and inaccurate when this metric is generated every 15sec.
Having a metric that indicates the minimum value of rate_limit_queries_remaining over some period of time will be useful to stabilise the metric to better react to rate limit errors in advance.
Additional Notes

The cluster agent sends 0-N queries to the backend every refresh period
Currently, rate_limit_queries_remaining is updated only after the response of the last (N-th) query is received.
This makes the metric flaky, especially when the Rate-Limit period becomes small.
With this new metric, the minimum value of rate_limit_queries_remaining is conserved during at least 2*refresh_period, and is investigated after every single query sent to the backend, which makes the metric less flaky and more useful to create monitors to be alerted before rate limit error occurs.

Possible Drawbacks / Trade-offs
In order for rate_limit_queries_remaining and rate_limit_queries_remaining_min to show significant difference, the cluster agents need to a lot of queries (so we need to have several HPA/WPA) to the backend.
Describe how to test/QA your changes

Start the cluster agent on a cluster that has several HPA/WPA, collecting external metrics via complex queries.
Run the following command several times on the leader cluster agent: datadog-cluster-agent telemetry | grep rate_limit_queries_remaining
The result will show you both rate_limit_queries_remaining and rate_limit_queries_remaining_min.
You should find that rate_limit_queries_remaining_min is always less than rate_limit_queries_remaining and that it takes at 2*refresh_period (by default 60 seconds) to increase.

Doing this test produced the following consecutive outputs:
# HELP rate_limit_queries_remaining number of queries remaining before next reset
# TYPE rate_limit_queries_remaining gauge
rate_limit_queries_remaining{endpoint="/api/v1/query",join_leader="true"} 353
# HELP rate_limit_queries_remaining_min minimum number of queries remaining before next reset observed during an expiration interval of 2*refresh period
# TYPE rate_limit_queries_remaining_min gauge
rate_limit_queries_remaining_min{endpoint="/api/v1/query",join_leader="true"} 197
adelhajhassan@COMP-Y0K2MF67D1 ~ % kubectl exec datadog-cluster-agent-6cdb6df59b-sktds   -n datadog-agent -- datadog-cluster-agent telemetry | grep rate_limit_queries_remaining
# HELP rate_limit_queries_remaining number of queries remaining before next reset
# TYPE rate_limit_queries_remaining gauge
rate_limit_queries_remaining{endpoint="/api/v1/query",join_leader="true"} 294
# HELP rate_limit_queries_remaining_min minimum number of queries remaining before next reset observed during an expiration interval of 2*refresh period
# TYPE rate_limit_queries_remaining_min gauge
rate_limit_queries_remaining_min{endpoint="/api/v1/query",join_leader="true"} 197
adelhajhassan@COMP-Y0K2MF67D1 ~ % kubectl exec datadog-cluster-agent-6cdb6df59b-sktds   -n datadog-agent -- datadog-cluster-agent telemetry | grep rate_limit_queries_remaining
# HELP rate_limit_queries_remaining number of queries remaining before next reset
# TYPE rate_limit_queries_remaining gauge
rate_limit_queries_remaining{endpoint="/api/v1/query",join_leader="true"} 386
# HELP rate_limit_queries_remaining_min minimum number of queries remaining before next reset observed during an expiration interval of 2*refresh period
# TYPE rate_limit_queries_remaining_min gauge
rate_limit_queries_remaining_min{endpoint="/api/v1/query",join_leader="true"} 197
adelhajhassan@COMP-Y0K2MF67D1 ~ % kubectl exec datadog-cluster-agent-6cdb6df59b-sktds   -n datadog-agent -- datadog-cluster-agent telemetry | grep rate_limit_queries_remaining
# HELP rate_limit_queries_remaining number of queries remaining before next reset
# TYPE rate_limit_queries_remaining gauge
rate_limit_queries_remaining{endpoint="/api/v1/query",join_leader="true"} 354
# HELP rate_limit_queries_remaining_min minimum number of queries remaining before next reset observed during an expiration interval of 2*refresh period
# TYPE rate_limit_queries_remaining_min gauge
rate_limit_queries_remaining_min{endpoint="/api/v1/query",join_leader="true"} 197
adelhajhassan@COMP-Y0K2MF67D1 ~ % kubectl exec datadog-cluster-agent-6cdb6df59b-sktds   -n datadog-agent -- datadog-cluster-agent telemetry | grep rate_limit_queries_remaining
# HELP rate_limit_queries_remaining number of queries remaining before next reset
# TYPE rate_limit_queries_remaining gauge
rate_limit_queries_remaining{endpoint="/api/v1/query",join_leader="true"} 376
# HELP rate_limit_queries_remaining_min minimum number of queries remaining before next reset observed during an expiration interval of 2*refresh period
# TYPE rate_limit_queries_remaining_min gauge
rate_limit_queries_remaining_min{endpoint="/api/v1/query",join_leader="true"} 220
adelhajhassan@COMP-Y0K2MF67D1 ~ % kubectl exec datadog-cluster-agent-6cdb6df59b-sktds   -n datadog-agent -- datadog-cluster-agent telemetry | grep rate_limit_queries_remaining
# HELP rate_limit_queries_remaining number of queries remaining before next reset
# TYPE rate_limit_queries_remaining gauge
rate_limit_queries_remaining{endpoint="/api/v1/query",join_leader="true"} 332
# HELP rate_limit_queries_remaining_min minimum number of queries remaining before next reset observed during an expiration interval of 2*refresh period
# TYPE rate_limit_queries_remaining_min gauge
rate_limit_queries_remaining_min{endpoint="/api/v1/query",join_leader="true"} 248

Reviewer's Checklist

[ ] If known, an appropriate milestone has been selected; otherwise the Triage milestone is set.
[ ] Use the major_change label if your change either has a major impact on the code base, is impacting multiple teams or is changing important well-established internals of the Agent. This label will be use during QA to make sure each team pay extra attention to the changed behavior. For any customer facing change use a releasenote.
[ ] A release note has been added or the changelog/no-changelog label has been applied.
[ ] Changed code has automated tests for its functionality.
[ ] Adequate QA/testing plan information is provided if the qa/skip-qa label is not applied.
[ ] At least one team/.. label has been applied, indicating the team(s) that should QA this change.
[ ] If applicable, docs team has been notified or an issue has been opened on the documentation repo.
[ ] If applicable, the need-change/operator and need-change/helm labels have been applied.
[ ] If applicable, the k8s/<min-version> label, indicating the lowest Kubernetes version compatible with this feature.
[ ] If applicable, the config template has been updated.

Thanks @AliDatadog and @vboulineau for your remarks
I've updated the PR accordingly


Modular Admin Node.js SDK Alpha Preview

Hey everyone,
We are introducing a new version of the Firebase Admin Node.js SDK.
If you are interested in trying it:

Please join our group via this form
Check out our alpha documentation website

The website has a guide on getting started and the API reference. We'll be updating the site soon with a list of common use cases.
We hope you all like the new changes and we also hope to hear feedback from you over in our Admin SDK Discussion Board.
What's new in this version?
Admin SDK currently exposes a single global namespace that houses all other sub-namespaces, types and functions. The new version of the SDK exposes several module entry points, which allows you to import each Firebase product (e.g. Auth,  Firestore, RTDB etc) separately.
Is it fully modular like the Beta Web SDK?
Not quite. While we expose different products as separate module entry points, the individual product-level operations are still exposed as methods on an object. In other words, the product-level operations are not treeshakeable. We drew the line here since further modularization does not result in significant gains in terms of import sizes, and also it’s more consistent with the other server-side Node.js libraries shipped by Google Cloud.
Can I use it with native ESM modules?
The Admin SDK is still shipped as a CommonJS (CJS) package, and currently doesn’t provide any ESM entry points. You can still use it with native ESM code (available in Node 12 and up), but you will have to use the ESM-CJS interop mode. This means you will not be able to use named imports. Let us know how important this use case is for your applications, and we can certainly revisit this topic in our next development iterations.

If you had a chance to try our alpha preview, please take 2 minutes to submit some feedback. Survey link available at #1332


SVG image import as ReactComponent - Failed to compile

Is this a bug report?
Yes. I think so: this project was working fine when I last updated it on Feb 27th. I haven't made any changes to the code since then. I have installed things through npm globally for other projects. I'm not sure if that would effect this project, but it's the only thing I can think of that would cause this.

Did you try recovering your dependencies?

Yes. npm version is 6.9.0
Which terms did you search for in User Guide?

Import ReactComponent as
Import react SVG
React SVG component
SVGR React
SVGR node module
SVGO React
pBabelTransform = async jsCode => new Promise
Environment

Environment:
OS:  macOS 10.14.3
Node:  6.10.2
Yarn:  1.13.0
npm:  6.9.0
Watchman:  Not Found
Xcode:  Not Found
Android Studio:  Not Found
Packages: (wanted => installed)
react: ^16.8.0-alpha.0 => 16.8.0-alpha.0
react-dom: ^16.7.0-alpha.0 => 16.7.0-alpha.0
react-scripts: ^2.1.3 => 2.1.3
Steps to Reproduce

npm start
error in terminal

Expected Behavior

import { ReactComponent as SwordsIcon } from './img/sword.svg';
Should load SVGs into React project to be used as components.
Example: <SwordsIcon />
Actual Behavior

Fails to compile:
./src/img/sword.svg (./node_modules/@svgr/webpack/lib?-prettier,-svgo!./src/img/sword.svg)
/Users/ckj/Desktop/oligopoly/node_modules/@svgr/webpack/lib/index.js:35
  const pBabelTransform = async jsCode => new Promise((resolve, reject) => {
                                ^^^^^^
SyntaxError: Unexpected identifier

Since the project hasn't changed, I'm really suspecting that it's environment related, but I'm not sure what caused it or when it happened. I'm confused because I thought each create-react-app project was self contained and managed its own configuration. ¯_(ツ)_/¯
Reproducible Demo

Clone this branch of my project
Open project dir in terminal
$ npm i
$ npm start
View terminal error
Help me please! ;)

Okay it's my environment. I cannot even use create-react-app now, and I'm getting errors about my node version. I'm not sure how this happened - I only follow installation guides from trusted sources. I cannot update beyond node version 6.10.2. Not sure what's going on.


Errors in the annotations section of the functional test summary

Steps to reproduce

Go to one of the last few runs of functional test workflow
Go to the Summary tab
See the annotations section
View the errors

Observed behavior
Example run: https://github.com/radius-project/radius/actions/runs/9181518673

Desired behavior
No errors and warnings
Workaround
No response
rad Version
edge
Operating system
No response
Additional context
No response
Would you like to support us?

[ ] Yes, I would like to support you

AB#12399

Very good find! Looks like all of these are coming from the cache action https://github.com/radius-project/radius/actions/runs/9181518673/job/25248548649#step:9:59

Notes:
We started seeing this error after this  PR was merged.
There is open PR to address this issue : https://github.com/actions/toolkit/pull/1704


readline problems

rl_completion_suppress_quote is (erroneously?) not found. No matter what I point ./configure at, it never finds rl_completion_suppress_quote, introduced in readline 5 (https://cnswww.cns.cwru.edu/php/chet/readline/CHANGES). I've hand-verified that the readline that it's pointing at has this variable. if i comment out the readline.require_func checks, configure succeeds, but make does indeed break.
if i download readline and build it and point gitsh at it, it fails
➔ CPPFLAGS="-I/Users/john/tmp/build/usr/local/include/readline/" LDFLAGS="-L/Users/john/tmp/build/usr/local/lib/" ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for ruby... /usr/bin/ruby
checking for ruby... (cached) /usr/bin/ruby
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for ruby version... ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
checking for tgetnum() in -lncurses... yes
checking for readline/readline.h... yes
checking for readline/history.h... yes
checking for readline() in -lreadline... no
extconf.rb:51:in `<main>': readline not found (RuntimeError)
configure: error: Failed to configure Ruby extension

i can't use --with-readline-dir

configure: WARNING: unrecognized options: --with-readline-dir

even though the error output of ./configure says i can...
Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
	--with-curses-dir
	--without-curses-dir
	--with-curses-include
	--without-curses-include=${curses-dir}/include
	--with-curses-lib
	--without-curses-lib=${curses-dir}/
	--with-ncurses-dir
	--without-ncurses-dir
	--with-ncurses-include
	--without-ncurses-include=${ncurses-dir}/include
	--with-ncurses-lib
	--without-ncurses-lib=${ncurses-dir}/
	--with-termcap-dir
	--without-termcap-dir
	--with-termcap-include
	--without-termcap-include=${termcap-dir}/include
	--with-termcap-lib
	--without-termcap-lib=${termcap-dir}/
	--with-readline-dir
	--without-readline-dir
	--with-readline-include
	--without-readline-include=${readline-dir}/include
	--with-readline-lib
	--without-readline-lib=${readline-dir}/
	--with-ncurseslib
	--without-ncurseslib
	--with-readlinelib
	--without-readlinelib

please advise. thanks!

have_library("readline", "readline") is false

the above was with default ruby on macos sierra
now i've installed ruby 2.4 with macport and pointed the config script to it, and it worked
RUBY=$(which ruby) ./configure
no library dir config needed
because macports ruby has readline properly built in?
anyway, would be nice for it to work with default ruby. lmk if you want me to experiment more on my machine or want more info.

https://gist.github.com/jjb/45c129380e2f344df19b618e1f0075b9

Thanks for the detailed error report, @jjb. I've not had trouble using default macOS system Ruby or heard of similar problems, but I've personally only tested on El Cap so far.
@mike-burns This sounds like it might be a little similar to the problems you had packaging for OpenBSD. Do you think the patch you applied there is likely to help with this issue too?

Yes that is exactly the issue I ran into on OpenBSD.
My diff is not in the ports tree yet (on my todo list) but the patch is here: https://marc.info/?l=openbsd-ports&m=148340820830595&w=2
In configure around line 3763 the patch passes --with-readline-include, --with-readline-lib, and --with-readlinelib to extconf.rb.

I'm seeing this same error on a brand new Mac:
==> ./configure --disable-silent-rules --prefix=/usr/local/Cellar/gitsh/0.11.1
Last 15 lines from /Users/jakecard/Library/Logs/Homebrew/gitsh/01.configure:
	--without-termcap-include=${termcap-dir}/include
	--with-termcap-lib
	--without-termcap-lib=${termcap-dir}/
	--with-readline-dir
	--without-readline-dir
	--with-readline-include
	--without-readline-include=${readline-dir}/include
	--with-readline-lib
	--without-readline-lib=${readline-dir}/
	--with-ncurseslib
	--without-ncurseslib
	--with-readlinelib
	--without-readlinelib
extconf.rb:51:in `<main>': readline not found (RuntimeError)
configure: error: Failed to configure Ruby extension

What steps should I take to fix this?

@jakeboxer my gist above might be helpful

@jjb appreciate it! This is a work computer and I want to avoid tacking on things like MacPorts and other versions of Ruby, so for now I think I'll hold off for a fix, but I'll probably use that on my personal computer. Thanks!

@jjb @jakeboxer I just had an identical error when trying to install with homebrew. The steps in the gist fixed it, but it only works if you run the commands from inside a cloned repo of the project.
So I would just add to the beginning of the gist:
git clone git@github.com:thoughtbot/gitsh.git
cd gitsh
.
.
.

I'm not sure if this was obvious, just putting it our there, because at first I was just trying to run the commands from a random directory.
Thanks for the gist @jjb!

@joesasson updated, thanks!

@jakeboxer There are some instructions in the INSTALL file for non-homebrew installs of gitsh with homebrew Readline:
https://github.com/thoughtbot/gitsh/blob/master/INSTALL#L52-L54
Does that help at all?

@georgebrock oh sorry, I'm doing a homebrew install on both my work and personal computers, I just want to avoid adding in MacPorts and installing extra versions of Ruby and readline on my work computer :smile:

You'll definitely need to install Readline—as far as I'm aware macOS only ships with libedit, which gitsh no longer supports—but you shouldn't need an additional Ruby.

How does one install Readline without installing MacPorts, Homebrew, or some other package manager? Is there a tarball that one can configure/make/sudo make install to be on our way?

@philippec i think you won't have a good experience trying to install it from source. even the gnu people don't give clear instructions how https://cnswww.cns.cwru.edu/php/chet/readline/rltop.html#Distributions

@jjb that's unfortunate. It means that I have to keep on using v0.10 for now until it breaks.
FWIW I downloaded the source and configure/make/sudo make install and that seemed to work, but then doing the same on gitsh did not build "out of the box" like previous versions did.
I respect the choice that the authors made to require Readline, and I realize that it probably can't be bundled in the install, but I find it a pity that it now has an external dependency.

It is possible to install Readline from source: ./configure && make && make install worked fine for me on macOS Sierra with the latest tarball from https://ftp.gnu.org/gnu/readline/
Configuring gitsh to find Readline in a specific non-standard directory is more tricky, which is why using Homebrew is pretty helpful right now. We should be able to support some additional options in the gitsh configure script to make this easier.

@jjb @philippec Here are the commands I used to build and install Readline and gitsh from source. There are two tricks to making this work:

Building Readline as a macOS universal binary, because that's how system Ruby on macOS builds C extensions, so it needs multiple architectures to link properly.
Making sure gitsh finds your version of Readline.

I was trying this out, so I was using a prefix under my home directory as a sandbox. If you want to use this for a real installation, I suggest modifying everything that refers to $HOME/gitsh-test to something more sensible, like /usr/local. You may also need to use sudo for the various make install commands.
# Get Readline
curl -O https://ftp.gnu.org/gnu/readline/readline-7.0.tar.gz
tar -zxf readline-7.0.tar.gz
cd readline-7.0

# Build Readline
env CFLAGS="-arch x86_64 -arch i386" LDFLAGS="-arch x86_64 -arch i386" \
    ./configure --prefix="$HOME/gitsh-test/"
make
make install
cd ..

## Get gitsh
curl -OL https://github.com/thoughtbot/gitsh/releases/download/v0.11.1/gitsh-0.11.1.tar.gz
tar -zxf gitsh-0.11.1.tar.gz
cd gitsh-0.11.1

# Build gitsh
env CPPFLAGS="-I$HOME/gitsh-test/include" LDFLAGS="-L$HOME/gitsh-test/lib" \
    ./configure --prefix="$HOME/gitsh-test"
make
make install
cd ..

# Test the installed version is working
$HOME/gitsh-test/bin/gitsh

Given that

it is possible to install from source on macOS,
I've written down how to make that work,
we recommend installing via Homebrew, and
I've opened #284 to fix the more complex OpenBSD case,

I'm going to close this. Please re-open if you have further problems.

Some more followup in case folks find this thread in the future
I was just running into this problem yet again, even when using my gist recipe.
Then I realized that even though I had done sudo port select ruby ruby24, because I hadn't opened a new Terminal window, I was still on the OS ruby with the old readline version.
I've now updated the gist to reflect this, and all is well again.
I don't know if / how much this problem was causing the problems I described in my original post above... 🤦♂

gist still works for ruby 2.5
https://gist.github.com/jjb/45c129380e2f344df19b618e1f0075b9

still works for macOS 10.14 and gitsh 0.14

still works for macOS 13, gitsh 0.14, ruby 3.2


Test against latest immudb releases

Signed-off-by: Jeronimo Irazabal<EMAIL_ADDRESS>

Hey @jeroiraz, thanks for the PR! Let's change 1.3.0 -> 1.3.2 rather than adding new jobs. Also, assert_match takes a string, which is a little nicer when you don't need any special regex characters.

Hey @jeroiraz, thanks for the PR! Let's change 1.3.0 -> 1.3.2 rather than adding new jobs. Also, assert_match takes a string, which is a little nicer when you don't need any special regex characters.

Thanks for the feedback. I've made the changes

Awesome, thanks!


Add libexif in README.md

As mentioned in #480, from cups-filters 1.28.16, libexif is now required and is now mentioned in the README.md as well.
In libcupsfilters's INSTALL, it's already mentioned that libexif is required to get the image resolution.
I am new to this so please let me know if there's anything.
Thanks in advance!

No need for explicit mention of libexif in README.md, as we already require libcupsfilters and libppd, and we do not mention libjpeg, libpng, QPDF, and anything else needed by libcupsfilters.
But thank you anyway for the PR.

What shall be done for the issue #480?


Broken pipe with custom env and SubprocVecEnv multiple envs

I was unable to run ppo2 with SubprocVecEnv and multiple envs.
I get broken pipe always.
Is there a working code of a simple custom env with ppo2 and SubprocVecEnv (learning + running)?
I didn't find any working examples.
I tried:
self.env = DummyVecEnv([lambda: self.env])
self.env = VecNormalize(self.env, True, True, 10., 10.)
num_cpu = 2,4 or 12
self.env = SubprocVecEnv([lambda: self.env for i in range(num_cpu)])
or
self.env = SubprocVecEnv([self.make_env(self.env, i) for i in range(num_cpu)])
where
def make_env(env_id, rank, seed=0):
def _init():
env = gym.make(env_id)
env.seed(seed + rank)
return env
set_global_seeds(seed)
return _init

Please format code in codeblocks for easier reading. Also include system information (python/library versions, OS info, etc). Meanwhile see docs on vecenvs.

Python 3.6.5 :: Anaconda, Inc.
Windows 10 pro N
Veriion 1903
Core i7, 16 GB
I read the docs. Is there a working example of custom gym env with ppo2ת subprocenv and multiple envs?

The examples should work just by changing DummyVecEnv to SubProcVecEnv. Please include full code that raises the exception and full stacktrace of the error.

The multiprocessing example is not with custom env.
It works well with predefined envs but fails with custom env.

Ah, sorry, I completely missed the "custom env" part that was in the title... My bad!
Unfortunately we do not offer tech support for custom envs. VecEnvs work with custom environments (many examples around the issues here), but something in your environment is causing trouble with multiprocessing library. It could that something in OS does not like about your environment, or something can not be serialized or something completely different. Sorry for not being helpful.

I tried this:
`import gym
from gym import error, spaces, utils
from gym.utils import seeding
class basic_custom_env(gym.Env):
metadata = {'render.modes': ['human']}
def init(self):
print('init basic')
def step(self, action):
    print('step')

def reset(self):
    print('reset')

def render(self, mode='human'):
    print('render')

def close(self):
    print('close')`

and then:
`import gym
import numpy as np
from stable_baselines.common.policies import MlpPolicy
from stable_baselines.common.vec_env import SubprocVecEnv
from stable_baselines.common import set_global_seeds, make_vec_env
from stable_baselines import PPO2
from basic_custom_env import basic_custom_env
def make_env(env_id, rank, seed=0):
"""
Utility function for multiprocessed env.
:param env_id: (str) the environment ID
:param num_env: (int) the number of environments you wish to have in subprocesses
:param seed: (int) the inital seed for RNG
:param rank: (int) index of the subprocess
"""
def _init():
    env = gym.make(env_id)
    env.seed(seed + rank)
    return env
set_global_seeds(seed)
return _init

if name == 'main':
#   env_id = "CartPole-v1"
env_id = basic_custom_env()
num_cpu = 4  # Number of processes to use
# Create the vectorized environment
env = SubprocVecEnv([make_env(env_id, i) for i in range(num_cpu)])
# Stable Baselines provides you with make_vec_env() helper
# which does exactly the previous steps for you:
# env = make_vec_env(env_id, n_envs=num_cpu, seed=0)

model = PPO2(MlpPolicy, env, verbose=1)
model.learn(total_timesteps=10)

obs = env.reset()
for _ in range(10):
    action, _states = model.predict(obs)
    obs, rewards, dones, info = env.step(action)
    env.render()`

I get this error:
Process SpawnProcess-4:
Traceback (most recent call last):
File "C:\Users\me\Anaconda3\lib\multiprocessing\process.py", line 258, in _bootstrap
self.run()
File "C:\Users\me\Anaconda3\lib\multiprocessing\process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "c:\users\me\stable-baselines\stable_baselines\common\vec_env\subproc_vec_env.py", line 13, in _worker
env = env_fn_wrapper.var()
File "E:\test _basic_custom_env.py", line 20, in _init
env = gym.make(env_id)
File "C:\Users\me\Anaconda3\lib\site-packages\gym\envs\registration.py", line 145, in make
return registry.make(id, **kwargs)
File "C:\Users\me\Anaconda3\lib\site-packages\gym\envs\registration.py", line 89, in make
spec = self.spec(path)
File "C:\Users\me\Anaconda3\lib\site-packages\gym\envs\registration.py", line 106, in spec
if ':' in path:
TypeError: argument of type 'basic_custom_env' is not iterable

The code is still not in proper codeblocks ``` like this ```. Also this is not a place for technical support.

I suceeded to create SubprocVecEnv with 'fork' (only 'fork' works for me). Model is trained with multiprocessing, however when trying to predict, I do this:
env.training = False
env.norm_reward = False
obs = env.reset()
dones = False
action, _states = model.predict(obs, deterministic=deterministic)
I get this error:
ValueError : Error: Unexpected observation shape (12, 1, 1106) for Box environment, please use (1106,) or (n_env, 1106) for the observation shape.
I then tried this:
obs = obs[:,0,:] or obs = obs[0,0,:]
and still get an error.
How should I preprocess the observation for 12 env's?

Looking at the error and the fixes alone it should work. Again, this is not a place for tech support (bugs or issues or enhancements only), and you need to include full source code to get the error to get any help.

I had the observation as:
obs = obs[:,0,:]
Do I have to do the same with action?
Since with subprocenv I get an array of n_envs * action and it doesn't work.
I tried
obs = obs[:,0,:]
action, _states = model.predict(obs, deterministic=True)
obs, rewards, dones, info = self.env.step(action[0])
And it fails in the step.

You should probably index it with obs = obs[0], not obs = obs[:, 0, :] because with multiple envs the observations from different envs is stacked on first axis.
Closing this as "no tech support".


Can custom helper return object?

"{{someParentContextField}}
{{#with helperWhichReturnsObject}}
{{fieldFromHelperReturnedObject}}
{{/with}}"
Wondering if above is feasible. Any help is appreciated.

Unfortunately in current version it's not possible.
I've implemented such functionality in my fork zjklee/Handlebars.CSharp and currently working on back-porting the changes. For the whole list of changes please see zjklee/Handlebars.CSharp/pull/3
The correct template should look like this:
{{#with (helperWhichReturnsObject)}}
  {{fieldFromHelperReturnedObject}}
{{/with}}

The only difference is that you need to call the helper with return value as a sub-expression.

Thanks zjklee for the information!

Thanks zjklee for the information!


CUDA kernel compilation fails with GCC 6

With GCC 6, C++ version used defaults to C++11, with breaks cuda kernel compilation.
To use chainer with GCC 6, a fix is to add
options += ('-Xcompiler', '--std=c++98')

to the compile_with_cache function in cupy/cuda/compiler.py.
It would be nice to integrate this (probably in a more clean way) in the distributed package, so that users like me with distributions shipping GCC 6 don't have to patch at each upgrade.
I believe such a change would be fully backwards-compatible, as --std=c++98 has been a valid option for GCC for years.

Thank you for reporting. Although GCC 6 is not supported officially by CUDA 7.5 and CUDA 8.0RC, I agree that it is useful if Chainer works with GCC 6.

options += ('-Xcompiler', '--std=c++98')

Just adding this statement may break backward compatibility because compile_with_cache receives options (e.g. incompatible with --std=c++11). Instead of hard-coding, we should modify cupy to allow users to specify compiler options.

With GCC 6, C++ version used defaults to C++11

GCC 6 uses C++14 by default.

Hi, I found that for CUDA 8.0 (nvcc 8.0) and GCC 6.3, an extra hack is required to make chainer work.
What exactly needed is to comment-out line 119 of /usr/local/cuda/include/host_config.h as follows:
#if __GNUC__ > 5

//#error -- unsupported GNU version! gcc versions later than 5 are not supported!

#endif /* __GNUC__ > 5 */

This hack originally comes from a wiki page of caffe:
https://github.com/BVLC/caffe/wiki/GeForce-GTX-1080,---CUDA-8.0,---Ubuntu-16.04,---Caffe


Fix missed value from Info.plist

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


Unable to compile examples: "The C Compiler [...] is not able to compile a simple test program"

I am currently unable to build your examples as described without modifying the Toolchain file.
Problem Description
I tried building your examples just as descrbed in the markdown file. After a first run, i set the board in BoardOptions.cmake to the arduino due (also tested with arduino uno). Re-running the cmake command leads to the following error:
> cmake -D CMAKE_TOOLCHAIN_FILE=../Arduino-toolchain.cmake ../Examples
-- Found Arduino Platform: /home/wilbrandt/.arduino15/packages/arduino/hardware/avr/1.8.2
-- Found Arduino Platform: /home/wilbrandt/.arduino15/packages/arduino/hardware/sam/1.6.12
-- Selected Arduino Board: Arduino Due (Programming Port) [sam.arduino_due_x_dbg]
-- The C compiler identification is GNU 4.8.3
-- The CXX compiler identification is GNU 4.8.3
-- Check for working C compiler: /home/wilbrandt/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-gcc
-- Check for working C compiler: /home/wilbrandt/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-gcc -- broken
CMake Error at /usr/share/cmake-3.10/Modules/CMakeTestCCompiler.cmake:52 (message):
  The C compiler

    "/home/wilbrandt/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-gcc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/wilbrandt/projects/tracked_robot/arduino_firmware/Arduino-CMake-Toolchain/Examples_build/CMakeFiles/CMakeTmp

    Run Build Command:"/usr/bin/make" "cmTC_5a574/fast"
    /usr/bin/make -f CMakeFiles/cmTC_5a574.dir/build.make CMakeFiles/cmTC_5a574.dir/build
    make[1]: Entering directory '/home/wilbrandt/projects/tracked_robot/arduino_firmware/Arduino-CMake-Toolchain/Examples_build/CMakeFiles/CMakeTmp'
    CMakeFiles/cmTC_5a574.dir/build.make:67: *** missing separator.  Stop.
    make[1]: Leaving directory '/home/wilbrandt/projects/tracked_robot/arduino_firmware/Arduino-CMake-Toolchain/Examples_build/CMakeFiles/CMakeTmp'
    Makefile:126: recipe for target 'cmTC_5a574/fast' failed
    make: *** [cmTC_5a574/fast] Error 2

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)

-- Configuring incomplete, errors occurred!

Workaround
After some googling this seems to be a common issue when crosscompiling with cmake. I was able to work around this problem by bypassing the compiler tests completely, but this doesn't seem like the correct way to do this. My workaround was simply adding the two lines
SET (CMAKE_C_COMPILER_WORKS 1)
SET (CMAKE_CXX_COMPILER_WORKS 1)

to Arduino-toolchain.cmake.
System
I am not quite sure which information is relevant to you, so i'll just post some system information here. I work on an ubuntu 18.04.4.
> cmake --version
cmake version 3.10.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

I use the current Arduino IDE with version 1.8.12.
Conclusion
As this seems to be a common problem with cross-compiling, it would be nice to find a usable fix for this. As i don't have any experience cross-compiling with cmake, any help would be appreciated.

This *** missing separator seems to be same/similar to the issue #25? Please attach the generated ArduinoSystem.cmake. Will try to see if there is any issue in that file.
I will not suggest to use CMAKE_C_COMPILER_WORKS, CMAKE_CXX_COMPILER_WORKS. I think it will just delay the error to the build time.


#19 review important!

I added new favico using the desing on #14.  Please check if it's okay. Just a suggestion.

I'll merge this. However, we better have a favicon designed for the purpose.
The favicon also better be optimized for different devices: https://favicon.io/favicon-converter/


NoSuchMethodError on query with Publisher failing with error

Expecting query for following @GraphQLQuery  to return a ExecutionResult containing an error.
Actual the query throws a NoSuchMethodError.
The @GraphQLQuery declaration:
public class QueryService {
	@GraphQLQuery
	public Publisher<String> error() {
		return Flowable.error(new RuntimeException());
	}
}

The GraphQL query:
QueryService service = new QueryService();
GraphQLSchema schema = new GraphQLSchemaGenerator()
	.withBasePackages(QueryService.class.getPackage().getName())
	.withOperationsFromSingleton(service)
	.generate();
GraphQL graphQL = GraphQL.newGraphQL(schema).build();
graphQL.execute("query{error}"); // ==> throws NoSuchMethodError

Version: spqr 0.9.9 with graphql-java 12.0.
JUnit 5 TestCase to reproduce the error:
SpqrIssue.java.txt

JUnit 5 TestCase extended:
SpqrIssue.java.withMutationSubscription.txt
GraphQL mutation on @GraphQLMutation throws NoSuchMethodError too.
GraphQL subscription on @GraphQLSubscription works as I expecting.

graphql-java v12 is not supported. Do not expect you can simply upgrade a core dependency to a new major release and have everything magically working.

Follow this issue for updates.


feature/ allow pconst nconst to do without the sign

https://github.com/jymchng/typenum-consts/blob/feature/computer/src/tnconst_impl.rs#L21
lead to pconst_impl

prefixing sign now raises compile error


Add timestamp to profiler report query

Description
Resolves an issue where warnings were printed and profiler reports were not being included in output. This was caused by a change in UQL where the timestamp is no longer automatically included in results. The fix is to explicitly query for the timestamp where needed (note this does not apply to the optimize configure command as that was not checking for/using the timestamp column)
Also includes addition of -v logging of the workloadId corresponding to the report being processed
Type of Change

[x] Bug Fix
[ ] New Feature
[ ] Breaking Change
[ ] Refactor
[ ] Documentation
[ ] Other (please describe)

Checklist

[x] I have read the contributing guidelines
[x] Existing issues have been referenced (where applicable)
[x] I have verified this change is not present in other open pull requests
[x] Functionality is documented
[x] All code style checks pass
[ ] New code contribution is covered by automated tests
[x] All new and existing tests pass

Codecov Report

Merging #136 (c5f2775) into main (62d908f) will not change coverage.
The diff coverage is n/a.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.
@@           Coverage Diff           @@
##             main     #136   +/-   ##
=======================================
  Coverage   32.34%   32.34%
=======================================
  Files          27       27
  Lines        3568     3568
=======================================
  Hits         1154     1154
  Misses       2323     2323
  Partials       91       91


Added RHOMBIO_L476VG with code 1500 to platform_database.py

Description
Added RHOMBIO_L476VG with code 1500 to platform_database.py
Pull request type
[ ] Fix
[ ] Refactor
[X] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers
@marcelosalazar

Please update to RHOMBIO_L476DMW1K
I've updated the online database.

Thanks @MarceloSalazar, I have updated the repo with the updated name

Thanks for your support, bridadan!


Sync seems inconsistent

Hi there,
I've got a headless build which is awesome, its been live for over a year now 🚀
Recently the products syncs seems to have stopped working / they only sometimes work which is quite odd.
Ive found that creating a product from scratch syncs fine (80% of the time), but updating any of the products just doesn't work. Or I can get it to work on some updates, however i'm not sure what fields are triggering the update if that makes sense.
Ive had a look at my server logs and it looks like i'm getting a 422 error - just not sure what to do with it:
Error: Request failed with status code 422
The set up is exactly the same, with my live url web-hooks added, ive also tried changing the Shopify API version but no luck.
Any pointers? 🤞 The deletion endpoint is fine too
Heres my shopify-product-update.js file for reference:
/* eslint-disable no-unused-vars */

import axios from 'axios'
import sanityClient from '@sanity/client'
import crypto from 'crypto'
import { nanoid } from 'nanoid'

const getRawBody = require('raw-body')
const jsondiffpatch = require('jsondiffpatch')

// Sanity
// Setup Sanity connection
const sanity = sanityClient({
  dataset: process.env.NEXT_PUBLIC_SANITY_DATASET,
  projectId: process.env.NEXT_PUBLIC_SANITY_PROJECT_ID,
  token: process.env.SANITY_API_TOKEN,
  apiVersion: '2022-08-30',
  useCdn: false,
})

// Turn off default NextJS bodyParser, so we can run our own middleware
export const config = {
  api: {
    bodyParser: false,
  },
}

// Custom Middleware to parse Shopify's webhook payload
const runMiddleware = (req, res, fn) => {
  new Promise((resolve) => {
    if (!req.body) {
      let buffer = ''
      req.on('data', (chunk) => {
        buffer += chunk
      })

      req.on('end', () => {
        resolve()
        req.body = JSON.parse(Buffer.from(buffer).toString())
      })
    }
  })
}

export default async function send(req, res) {
  // bail if it's not a post request or it's missing an ID
  if (req.method !== 'POST') {
    console.log('must be a POST request with a product ID')
    return res
      .status(200)
      .json({ error: 'must be a POST request with a product ID' })
  }

  /*  ------------------------------ */
  /*  1. Run our middleware
  /*  2. check webhook integrity
  /*  ------------------------------ */

  // run our middleware to extract the "raw" body for matching the Shopify Integrity Key
  await runMiddleware(req, res)
  const rawBody = await getRawBody(req)

  // get request integrity header
  const hmac = req.headers['x-shopify-hmac-sha256']
  const generatedHash = await crypto
    .createHmac('sha256', process.env.SHOPIFY_WEBHOOK_INTEGRITY)
    .update(rawBody, 'utf8', 'hex')
    .digest('base64')

  // bail if shopify integrity doesn't match
  if (hmac !== generatedHash) {
    console.log('not verified from Shopify')
    return res.status(200).json({ error: 'not verified from Shopify' })
  }

  // extract shopify data
  const {
    body: { status, id, title, description, handle, options, variants, tags },
  } = req

  console.log('here be the tags: ', tags)

  console.log('here be the body: ', req)

  /*  ------------------------------ */
  /*  Construct our product objects
  /*  ------------------------------ */

  // Define product document
  const product = {
    _type: 'product',
    _id: `product-${id}`,
  }

  // Define product options if there are more than one variant
  const productOptions =
    variants.length > 1
      ? options.map((option) => ({
          _key: option.id,
          _type: 'productOption',
          name: option.name,
          values: option.values,
          position: option.position,
        }))
      : []

  // Define product fields
  const productFields = {
    wasDeleted: false,
    isDraft: status === 'draft' ? true : false,
    productTitle: title,
    productID: id,
    description: description,
    slug: { current: handle },
    price: variants[0].price * 100,
    comparePrice: variants[0].compare_at_price * 100,
    sku: variants[0].sku || '',
    tags: tags,
    inStock: variants.some(
      (v) => v.inventory_quantity > 0 || v.inventory_policy === 'continue'
    ),
    lowStock:
      variants.reduce((a, b) => a + (b.inventory_quantity || 0), 0) <= 10,
    options: productOptions,
  }

  // Define productVariant documents
  const productVariants = variants
    .sort((a, b) => (a.id > b.id ? 1 : -1))
    .map((variant) => ({
      _type: 'productVariant',
      _id: `productVariant-${variant.id}`,
    }))

  // Define productVariant fields
  const productVariantFields = variants
    .sort((a, b) => (a.id > b.id ? 1 : -1))
    .map((variant) => ({
      isDraft: status === 'draft' ? true : false,
      wasDeleted: false,
      productTitle: title,
      productID: id,
      variantTitle: variant.title,
      variantID: variant.id,
      price: variant.price * 100,
      comparePrice: variant.compare_at_price * 100,
      sku: variant.sku || '',
      inStock:
        variant.inventory_quantity > 0 ||
        variant.inventory_policy === 'continue',
      lowStock: variant.inventory_quantity <= 5,
      options:
        variants.length > 1
          ? options.map((option) => ({
              _key: option.id,
              _type: 'productOptionValue',
              name: option.name,
              value: variant[`option${option.position}`],
              position: option.position,
            }))
          : [],
    }))

  // construct our comparative product object
  const productCompare = {
    ...product,
    ...productFields,
    ...{
      variants: productVariants.map((variant, key) => ({
        ...variant,
        ...productVariantFields[key],
      })),
    },
  }

  /*  ------------------------------ */
  /*  Check for previous sync
  /*  ------------------------------ */

  // Setup our Shopify connection
  const shopifyConfig = {
    'Content-Type': 'application/json',
    'X-Shopify-Access-Token': process.env.SHOPIFY_API_PASSWORD,
  }

  // Fetch the metafields for this product
  const shopifyProduct = await axios({
    url: `https://${process.env.SHOPIFY_STORE_ID}.myshopify.com/admin/api/2022-10/products/${id}/metafields.json`,
    method: 'GET',
    headers: shopifyConfig,
  })

  // See if our metafield exists
  const previousSync = shopifyProduct.data?.metafields.find(
    (mf) => mf.key === 'product_sync'
  )

  // Metafield found
  if (previousSync) {
    console.log('Comparing previous sync...')

    // Differences found
    if (jsondiffpatch.diff(JSON.parse(previousSync.value), productCompare)) {
      console.log('discrepancy found...')

      // update our shopify metafield with the new data before continuing sync with Sanity
      axios({
        url: `https://${process.env.SHOPIFY_STORE_ID}.myshopify.com/admin/api/2022-10/products/${id}/metafields/${previousSync.id}.json`,
        method: 'PUT',
        headers: shopifyConfig,
        data: {
          metafield: {
            id: previousSync.id,
            value: JSON.stringify(productCompare),
            value_type: 'string',
          },
        },
      })

      // No changes found
    } else {
      console.log('no difference, sync complete!')
      return res
        .status(200)
        .json({ error: 'nothing to sync, product up-to-date' })
    }
    // No metafield created yet, let's do that
  } else {
    console.log('Metafield not found, create new')
    axios({
      url: `https://${process.env.SHOPIFY_STORE_ID}.myshopify.com/admin/api/2022-10/products/${id}/metafields.json`,
      method: 'POST',
      headers: shopifyConfig,
      data: {
        metafield: {
          namespace: 'sanity',
          key: 'product_sync',
          value: JSON.stringify(productCompare),
          value_type: 'string',
        },
      },
    })
  }

  /*  ------------------------------ */
  /*  Begin Sanity Product Sync
  /*  ------------------------------ */

  console.log('product sync starting...')

  let stx = sanity.transaction()

  // create product if doesn't exist
  stx = stx.createIfNotExists(product)

  // unset options field first, to avoid patch set issues
  stx = stx.patch(`product-${id}`, (patch) => patch.unset(['options']))

  // patch (update) product document with core shopify data
  stx = stx.patch(`product-${id}`, (patch) => patch.set(productFields))

  // patch (update) title & slug if none has been set
  stx = stx.patch(`product-${id}`, (patch) =>
    patch.setIfMissing({ title: title })
  )

  // create variant if doesn't exist & patch (update) variant with core shopify data
  productVariants.forEach((variant, i) => {
    stx = stx.createIfNotExists(variant)
    stx = stx.patch(variant._id, (patch) => patch.set(productVariantFields[i]))
    stx = stx.patch(variant._id, (patch) =>
      patch.setIfMissing({ title: productVariantFields[i].variantTitle })
    )
  })

  // grab current variants
  const currentVariants = await sanity.fetch(
    `*[_type == "productVariant" && productID == ${id}]{
      _id
    }`
  )

  // mark deleted variants
  currentVariants.forEach((cv) => {
    const active = productVariants.some((v) => v._id === cv._id)
    if (!active) {
      stx = stx.patch(cv._id, (patch) => patch.set({ wasDeleted: true }))
    }
  })
  const result = await stx.commit()

  console.log('sync complete!')

  res.statusCode = 200
  res.json(JSON.stringify(result))
}

TIA

Hey there @SidNewman sorry for the delay (busy end of the year over here)!
This definitely sounds odd. A 422 error is not something we return anywhere in the product-update API route, which tells me maybe something is malformed coming from Shopify when the webhook fires? Without more details it's hard to understand what a solution could be.
Unfortunately, I won't be working on updating HULL until the new year, and I don't have plans to continue to maintain a custom sync function in the next release.
Instead I'll be opting to use the Sanity Connect app alongside the new hydrogen-react library.
Going to close this for now, but feel free to follow-up if more details come to light about the issue you're experiencing! 🤘


Font filtering now respects the default setting.

Per the discussion on https://github.com/bjornbytes/lovr/issues/536.  The default filter setting is now flowed through and used as the font filter.
However, there's a caveat: previously (before this PR) font filter was set to bilinear, as default and always. With this change, it's now configurable, but the default is now trilinear (which is the default for the textures.)
Probably not an issue, but just wanted to bring this up in case it is.
I tested this on Linux and Windows and it fixes my issue.

Thanks!  I think trilinear is okay because font textures don't have mipmaps.


The analysis server process is not spawned

Describe the bug
It looks like running dart run custom_lint (or dart run custom_lint --watch) is not spawning the process in which the analysis server would normally run. This results in lints never running, and an inability to debug them (there is no VM service URI printed, I guess because that is normally printed by the analysis server subprocess).
To Reproduce
Run dart create -t package testing && cd testing && dart pub add analyzer analyzer_plugin custom_lint_builder && dart pub add -d custom_lint && rm -rf example test lib/src.
Change lib/testing.dart to the example provided in the README:
import 'package:analyzer/error/listener.dart';
import 'package:custom_lint_builder/custom_lint_builder.dart';

PluginBase createPlugin() => _ExampleLinter();

class _ExampleLinter extends PluginBase {
  @override
  List<LintRule> getLintRules(CustomLintConfigs configs) => [
        MyCustomLintCode(),
      ];
}

class MyCustomLintCode extends DartLintRule {
  MyCustomLintCode() : super(code: _code);

  static const _code = LintCode(
    name: 'my_custom_lint_code',
    problemMessage: 'This is the description of our custom lint',
  );

  @override
  void run(
    CustomLintResolver resolver,
    ErrorReporter reporter,
    CustomLintContext context,
  ) {
    context.registry.addVariableDeclaration((node) {
      reporter.reportErrorForNode(code, node);
    });
  }
}

Add the following to analysis_options.yaml:
analyzer:
  plugins:
    - custom_lint

Run dart run custom_lint --watch. No VM service URI is reported. If we create a test file on which we expect the lint to run, we still get no errors reported when running dart run custom_lint --watch.
Expected behavior
The VM service URI should be printed, the analysis server started and the lints working.

Ok, so it looks like the issue arises because you can't use a plugin within the package that declares that plugin. Could've sworn it used to work.
It'd be nice if this was possible because it means you're able to test your plugins with debugging support without having to create a secondary "dummy" project that exists just to depend on your lint.


ignore .status files from package:testing from linter/normalize

Presumit checks seem to be trying to process the .status files used by package:testing.
These files have a different format and should be treated differently.
@whesse @peter-ahe-google

Fixed by bb42e9dad348315e75a93f0614915f0d0cdb3c5a


KDE ViewportCommand::InnerSize is undone via instantaneous WindowEvent::Resized

Describe the bug

When running egui under kde the window cannot be resized programmatically.
This is not fixed by https://github.com/emilk/egui/pull/4211 nor https://github.com/emilk/egui/pull/4182.
Here's a truncated annotated WAYLAND_DEBUG spew:
# The window buffer is created at size 875x597 (wl_buffer@87)
[1863912.251]  -> zwp_linux_buffer_params_v1@85.create_immed(new id wl_buffer@87, 875, 597, 875713112, 0)
# Previous buffer is destroyed
[1863912.694]  -> wl_buffer@61.destroy()
# New buffer (wl_buffer@87) is attached to window
[1863928.273]  -> wl_surface@25.attach(wl_buffer@87, 0, 0)
# Client requests resize to 1280x720
[1871323.978]  -> xdg_surface@26.set_window_geometry(0, 0, 1280, 720)
[1871323.983]  -> wp_viewport@29.set_destination(1280, 720)
[2024-03-28T15:47:08Z INFO  egui_winit] ViewportCommand::InnerSize, not will be delivered later with the [WindowEvent::Resized]
[1871324.007]  -> xdg_toplevel@27.unset_fullscreen()
# New window buffer is created at size 1280x720 (wl_buffer@100)
[1871329.109]  -> zwp_linux_buffer_params_v1@98.create_immed(new id wl_buffer@100, 1280, 720, 875713112, 0)
# Previous buffer is destroyed (wl_buffer@87)
[1871329.698]  -> wl_buffer@87.destroy()
# Compositor requests the client resize to 875x597
[1871330.256] xdg_toplevel@27.configure(875, 597, array[4])
# Client resizes to 875x597
[1871330.318]  -> xdg_surface@26.set_window_geometry(0, 0, 875, 597)
[1871330.323]  -> wp_viewport@29.set_destination(875, 597)
# New window buffer is created at size 875x597 (wl_buffer@109)
[1871334.217]  -> zwp_linux_buffer_params_v1@64.create_immed(new id wl_buffer@109, 875, 597, 875713112, 0)
# Previous buffer is destroyed (wl_buffer@100)
[1871334.574]  -> wl_buffer@100.destroy()
# New buffer (wl_buffer@109) is attached to window
[1871338.805]  -> wl_surface@25.attach(wl_buffer@109, 0, 0)

Full WAYLAND_DEBUG log
I think the<EMAIL_ADDRESS>is becoming a WindowEvent::Resized and undoing the resize.
I'm not certain but it could be that the wl_buffer@87.destroy() of the currently attached buffer is triggering a configure.
This happens on KDE but not weston or Gnome. The winit example client doesn't exhibit this behaviour.
To Reproduce
Steps to reproduce the behavior:

Run KDE
You can launch a nested KDE session via:

export $(dbus-launch)
kwin_wayland --xwayland --no-lockscreen

Run the egui demo:
If you're running nested:

WAYLAND_DEBUG=1 WAYLAND_DISPLAY=wayland-1 cargo run -p egui_demo_app [--features wgpu]

Resize the window using the "Resize to..." drop-down.
Note that the window doesn't change size

Expected behavior

Window should resize.
Screenshots

Desktop (please complete the following information):

OS: Fedora 39 (plasma)

Additional context

This was brought to my attention by ruffle developers: https://github.com/ruffle-rs/ruffle/pull/15781

Could you re-open this


Change heading levels

Make consistent with heading CSS changes made pre-Xmas.  Please see published sample.

This change is

Please don't commit yet - this is an example for a discussion around "should headings start at  or "

@steveperry-53   What's your progress on this?

@jaredbhatti, This work was done some time ago in https://github.com/kubernetes/kubernetes.github.io/pull/2287.
@craigbox, Can we just close this?

Thanks Steve!

Pinged Craig, he said "go ahead and close"


我想用分詞器

I would like to use IKTokenizer with other filters.

already in master

the feature already have in master


Refactor collect_one_epoch_experience function in OffPolicyAlgorithm

Refer https://github.com/yamatokataoka/reinforcement-learning-replications/issues/59

Todos

Move action selection to model function
Move replay_buffer.add_one_epoch_experience to each model


Feature: Provide "html_description" on SimpleEpisode and FullEpisode

Can we add the property "html_description" returned from Spotify-endpoints for v1/shows/{id}/episodes and /v1/episodes/{id}
The Description member populated from the "description" property supplied by these endpoints strips html-tags which means the text is often malformed.
For example; html_description will return text such as:
.... lorem<br />ipsum ...
The description field returns text such as:
... loremipsum ...
The result is the text provided by the Description member of SimpleEpisode and FullEpisode is often not what was intended when entered by the author.
I am prepared to create a pull-request if this is the correct process to follow. I am also prepared to fork if this is outside the scope of the project,
The package is being used to drive the cultpodcasts.com website which is proving helpful to academic researchers. Your package has been very helpful in making this happen. Thank you

Hey,
This was a small addition, so I included it in SpotifyAPI Web 7.1.1.
Let me know if everything checks out!


Variable naming convention

To make  each developer's coding style consistent with each other, we need to define a basic rule for variable defining

unify import order:
1. python library
# blank line
2. 3rd party library
# blank line
3. matchzoo classes, functions or modules.


What is the current status of this work?

Hi again @lgautier !
I wanted to connect and finally close the loop on all of this work. We are still using my original wrappers internally (the basis of R6a), which largely continue to work well, but I'd like to port our code over to upstream wrappers where possible to reduce the maintenance burden internally (and to help yourself and others to have a robust set of wrapper that they can use also).
I played with the existing code here and found lots of rough edges in your port of my original contribution (R6a), and even more rough edges in the experimental class generation code (R6b). I'm more than happy to work with you to get a robust implementation working, and then prove that it works by porting our fairly complex use-cases onto this upstream code; assuming you remain interested.
What follows are some general thoughts about the direction in which we might move to finish this body of work.

I think I generally like the class generation procedure over wrapping just the current state of R6 instances/classes in the R interpreter; though in practice this basically only provides some extra metadata (since the R interpreter state/class MRO/etc is the only one that matters). Since the R state is what matters here, I wonder if the implementation of R6b can't be simplified to be a little more like R6a. I'm happy to come up with an example implementation to demonstrate this if you are interested. Once we find something we are happy with I think we can just provide a single implementation. I won't be offended if R6a disappears.

Minor point: perhaps we can name the Python module rpy2_r6 rather than using capitals?

How should the collaboration work here? Would it make sense, after I have a rough draft of (1) above, to schedule some live conversation time to homogenise more quickly? Are there any other considerations I'm missing?

Thanks again for your openness to contributions!

Hi,
I am afraid that the status is "possibly a good start, but this needs attention, more tests for design (how practical or helpful is this), more documentations and examples, and more automated tests". I only got time very recently to fix it to pass current tests, with the aim of having a release on Pypi by the end of the year.
I am happy to welcome additional participants, including opinionated participation. The r6a and r6b modules highlight that I am still at the stage of think about the API. r6a is based on a submission you made back when the code was on bitbucket. There was at least one more thing with that submission if I remember correctly, although I can't remember what it was. May be it was some form of plug/unplug feature for the conversion system. Unfortunately the bitbucket repository is gone. The current r6a is the combined result of teasing that out, and my likely incomplete understanding of the intent in places.
Answers to the numbered points:
1/
The intent with r6b is to mirror more completely R6 classes as Python classes, including class inheritance lineages, and allow type checking / type hints on the Python side (rpy2 is almost passing a mypy check). I did try sophisticated class mappings with S4 (another OOP system in R) in the past, but it partly collapsed under the complexity of ensuring that the mapping is safe, working in all cases, is possible to debug, and is not unreasonably hard to use. Multiple dispatch in S4 did not help. R6 is closer to Python's OOP so I have hopes that this can work better. At the same time I am aware that metaprogramming automagic can turn an initial apparent convenience into a troubleshooting nightmare for a user when the need inevitably occurs when the use-cases get more complex. If you have a way to bring "what could work in practice" in r6b to r6a, this is great.
2/
I don't think there is a large user-base for this package yet, and it would makes this more PEP8-compliant. Works for me.
3/
I have a couple of unwritten (and likely not complete thought through) ideas from experimenting with S4 conversion in the past. You have used R6 conversion between Python and R in anger, and have ideas from that (and would likely be able to point out what is unpractical in the directions I am considering). I am happy to chat about how this could be organized, either before or after a draft. Send me an email.

The renaming of the package from rpy_R6 to rpy2_r6 is merged in the main branch. To be complete I should probably rename the repository itself from rpy2-R6 to rpy2-r6.
PROs:

Homogeneous naming scheme.

CONs:

All URLs to the old name probably broken, Also may be I can create a clone with the name as a  mirror.

Nice! I doubt there are many links to the old name (and GitHub redirects anyway for a good time). I'll follow up about the other items when I get a chance!

If there is a redirect this is a no-brainer. Renamed to rpy2-r6. Thanks.

Release 0.0.1 is now on Pypi:  https://pypi.org/project/rpy2-r6/
This ensures that the project name is not taken.


Cast an exception when two controllers try to map the same uri?

I just spent 20 minutes figuring out why one page wasn't displaying something... Turned out I had previously created a @Page annotation for the same uri somewhere a while ago and forgotten to remove it. Would this be a good idea?

Apologies for the late reply.
Yes, this would make sense for the bean annotations.
In the low-level routes mechanism, it is possible to override a route by registering another handler, so collisions are expected.


header logo issue

Hello,
clicking on KB leads to the dashboard, no prob.
After installation of Customizer, and uploading a new header logo, it appears where expected, but link does not work; it contains twice the link to the installation domain
Original KB header link :
https://board.micylou.com/?controller=DashboardController&action=show
Link with header logo loaded by Customizer :
https://board.micylou.com/board.micylou.com/?controller=DashboardController&action=show
Installation info :
Application version: 1.2.18
PHP version: 7.4.13
PHP SAPI: apache2handler
HTTP Client: cURL
OS version: Linux 5.4.0-58-generic
Database driver: mysql
Database version: 10.3.25-MariaDB-0ubuntu<IP_ADDRESS>

Unfortunately, I just tested with v1.2.18, and I did not have the same issue.
Check your application settings URL just to make sure thats not where your issue lies:

Unfortunately, I just tested with v1.2.18, and I did not have the same issue.
Check your application settings URL just to make sure thats not where your issue lies:

Hello,
It looks just good ; if I remove the header logo, the letters KB are back, and the link works; I only have ths issue if I upload a new file (in this case the Micylou png image).
From: Craig Crosby<EMAIL_ADDRESS>Reply to: creecros/Customizer<EMAIL_ADDRESS>Date: Thursday, 7 January 2021 at 22:50
To: creecros/Customizer<EMAIL_ADDRESS>Cc: Jean-Paul Dochy<EMAIL_ADDRESS>Author<EMAIL_ADDRESS>Subject: Re: [creecros/Customizer] header logo issue (#122)
Unfortunately, I just tested with v1.2.18, and I did not have the same issue.
Check your application settings URL just to make sure thats not where your issue lies:
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

please list all your plugins in use. whatever your issue is, I dont believe its specific to customizer, as I just tested it, and there is no issue, so its clear to me, there is an unknown variable in play.

Here they are :
From: Craig Crosby<EMAIL_ADDRESS>Reply to: creecros/Customizer<EMAIL_ADDRESS>Date: Friday, 8 January 2021 at 00:58
To: creecros/Customizer<EMAIL_ADDRESS>Cc: Jean-Paul Dochy<EMAIL_ADDRESS>Author<EMAIL_ADDRESS>Subject: Re: [creecros/Customizer] header logo issue (#122)
please list all your plugins in use. whatever your issue is, I dont believe its specific to customizer, as I just tested it, and there is no issue, so its clear to me, there is an unknown variable in play.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Here they are :
From: Craig Crosby<EMAIL_ADDRESS>Reply to: creecros/Customizer<EMAIL_ADDRESS>Date: Friday, 8 January 2021 at 00:58
To: creecros/Customizer<EMAIL_ADDRESS>Cc: Jean-Paul Dochy<EMAIL_ADDRESS>Author<EMAIL_ADDRESS>Subject: Re: [creecros/Customizer] header logo issue (#122)
please list all your plugins in use. whatever your issue is, I dont believe its specific to customizer, as I just tested it, and there is no issue, so its clear to me, there is an unknown variable in play.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

@jpdochy your list is empty, try logging into github to respond.

@jpdochy your list is empty, try logging into github to respond.

and just to confirm, Gantt is the last plugin on the list? I dont want to moss something.
and did you see my previous reply?
Also, by defualt, it shouldnt be ?controller=DashboardController&action=show, should just be https://example.kanboard.com/dashboard, so....what's goin on there?

and just to confirm, Gantt is the last plugin on the list? I dont want to moss something.
and did you see my previous reply?
Also, by defualt, it shouldnt be ?controller=DashboardController&action=show, should just be https://example.kanboard.com/dashboard, so....what's goin on there?

Update notifier is the last one, just under gantt, all others are on the screenshot.
And if I remove the header logo, uploaded with Customizer, it  works back all right... That's why I don't get it.
Application url :

Update notifier is the last one, just under gantt, all others are on the screenshot.
And if I remove the header logo, uploaded with Customizer, it  works back all right... That's why I don't get it.

And therefore, I know where the double address comes from, it’s the htttp rewrite to https set up in Apache.
Thanks a lot for your support, it’s all solved now.
Cheers,
Jean-Paul
From: Craig Crosby<EMAIL_ADDRESS>Reply to: creecros/Customizer<EMAIL_ADDRESS>Date: Friday, 8 January 2021 at 01:50
To: creecros/Customizer<EMAIL_ADDRESS>Cc: Jean-Paul Dochy<EMAIL_ADDRESS>Mention<EMAIL_ADDRESS>Subject: Re: [creecros/Customizer] header logo issue (#122)
actually, I see your issue. its your application settings url. your missing the https://
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.

And therefore, I know where the double address comes from, it’s the htttp rewrite to https set up in Apache.
Thanks a lot for your support, it’s all solved now.
Cheers,
Jean-Paul
From: Craig Crosby<EMAIL_ADDRESS>Reply to: creecros/Customizer<EMAIL_ADDRESS>Date: Friday, 8 January 2021 at 01:50
To: creecros/Customizer<EMAIL_ADDRESS>Cc: Jean-Paul Dochy<EMAIL_ADDRESS>Mention<EMAIL_ADDRESS>Subject: Re: [creecros/Customizer] header logo issue (#122)
actually, I see your issue. its your application settings url. your missing the https://
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.

it was literally the first thing I told you to check 😜

it was literally the first thing I told you to check 😜


vsts work item create: ability to link related work items

Something like this would be super useful for our team:
vsts work item create ...required args... --parent xxxxxxxxxx
vsts work item create ...required args... --related xxxxxxxxxx

cc @adkinn

This is my #1 top request - I am using VSTS CLI to clone projects from a master template project... but without the ability to set parent / related I am left with tons of "un-parented"  tasks and PBIs with no child tasks

Very important for us as well!

@jdanyow @leeberg @peteg18 Please have a look at #125 to see if it would fit your needs.

Its been 8 months since the pull request is being submitted. @tedchamb, any news on that?

@VelinGeorgiev, all I can say is that there is going to be a large round of investment in the cli coming soon.  These PRs are on the list.

Thanks for the update @tedchamb! Looking forward for that new update.

I am proposing we start with 3 commands
az boards work-item relation add
az boards work-item relation remove
az boards work-item relation-type list
this should solve most of the customer scenarions
also in
az boards work-item show we should be getting all the fields (including relations)
Using az boards work-item relation-type list users can list the types of relations supported in the Org
like https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/work item relation types/list?view=azure-devops-rest-5.0
then they can use oppositeEndReferenceName from this command to
az boards work-item relation add
az boards work-item relation remove
which will look something like this
az boards work-item relation add --id 4 --relation System.LinkTypes.Hierarchy-Forward=1,2,3
cc: @geverghe  @snankani  @ishitam8

FYI - @jdanyow , @leeberg , @peteg18 , @vbossica , @VelinGeorgiev

Will this PR include --parent on create or will that come in a follow-up?  Excited to see this being worked on! :)

Will this PR include --parent on create or will that come in a follow-up? Excited to see this being worked on! :)

at least not as part of the first cut, we will see how much popular this scenario is before implementing that.
Although this is still be achievable in 2 steps, i.e. first create and then link

This will be available in next release, planned for something late this week or next week.
Closing this Issue as ability to link work items is added.
In case some other feature request/ enhancement is needed. Please raise a different issue.


Sticky Notes

Project Description :
A sticky notes application with proper features of adding and deleting notes.
Tech Stack :
HTML , CSS and Javascript
Preview of Application :

I am a GSSOC22 participant. I would like to work on this project. Kindly assign it to me!

@sreelakshmig009 please add the GSSoC label to the project.


Vulnerability in http-cache-semantics dependency

Hello,
Thank you for this tool.
There is a high security vulnerability in http-cache-semantics <4.1.1 and for an unknown reason using an "overrides" in the root package.json file of the CDK project doesn't force the update the package.

This has been resolved.


Adding the CodeCov results to README.md

This change adds the code coverage results of develop branch to README.md, which will let the visitors and the current developers see the results directly at the repo's homepage!
Thanks!

Codecov Report

Merging #190 into develop will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff            @@
##           develop     #190   +/-   ##
========================================
  Coverage    69.02%   69.02%
========================================
  Files          151      151
  Lines         5366     5366
  Branches       878      878
========================================
  Hits          3704     3704
  Misses         974      974
  Partials       688      688

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 9e94726...65c1b3b. Read the comment docs.

Should I try making the CodeCov work for newer versions as well? The current CodeCov solution might be incomplete as we only have the setup for openjdk8 (which is not the latest version).
The repo uses oraclejdk12, so, I'll have a go at it if you say so.
Thanks!

Yeah, the newest version is always a good idea, at least in my opinion ;)


Feature Request: "Use Identical Cast" doesn't look like it's working when caught Collectables

Added by #17 "Use Identical Cast" option does not look like it's working when caught Collectables.
I think changing this will work but I have no idea to change.
https://github.com/InitialDet/AutoHook/blob/main/AutoHook/Configurations/AutoCastsConfig.cs#L228
Do you plan to support it ?

Thats weird, I'll take a look at it.

Sorry for the delay, it should be fine now

Seems to be working fine, thanks <3


NTR: Juvenile Idiopathic Scoliosis

For new term requests, please provide the following information:
Preferred term label
juvenile idiopathic scoliosis
Synonyms
N/A
Textual definition
A scoliosis with no known cause arising in a juvenile.
Suggested parent term
MONDO_0000726 idiopathic scoliosis
Attribution
https://orcid.org/0000-0001-5208-3432

related to https://github.com/kids-first/kf-study-imports/issues/509


[BUG] ccharp language is not showing on code text spliter

I am running flowise locally. all languages are not showing in code splitter. (ccharp)
I could see c sharp is supported in Lang chain splitter. is there any way to use or write custom splitter for this.
Thanks

I think we just need to add to the list: https://github.com/FlowiseAI/Flowise/blob/main/packages/components/nodes/textsplitters/CodeTextSplitter/CodeTextSplitter.ts#L33


choices support

hmm
import { buildHelp, parseArgs as original } from "jsr<EMAIL_ADDRESS>
const directions = ["north", "south", "east", "west"] as const;
type DirectionType = typeof directions[number];

function parseArgs(args: string[], options: Parameters<typeof original>[1]): ReturnType<typeof original> & { direction: DirectionType } {
    const parsed = original(args, options) as ReturnType<typeof original> & { direction: DirectionType };
    if (parsed.direction !== undefined && !directions.includes(parsed.direction as DirectionType)) {
        console.log(buildHelp(options));
        console.log(`Invalid direction: ${parsed.direction}`);
        Deno.exit(1);
    }
    return parsed
}

const parsed = parseArgs(["--version", "1.0.0"], {
    string: ["version", "direction"], // Type 'string' is not assignable to type never.
    required: ["direction"],
    boolean: ["color"], // Type 'boolean' is not assignable to type never.
    alias: { v: "version" },
} as const);
console.dir(parsed, { depth: null });


test(attendee): add test cases for attendee apis

Types of changes
Thanks for sending a pull request! Please fill in the following content to let us know better about this change.
Please put an x in the box that applies

[ ] Bugfix
[ ] New feature
[ ] Refactoring
[ ] Breaking change (any change that would cause existing functionality to not work as expected)
[ ] Documentation Update
[X] Other (please describe)
testing for attendee #1142

Description
Describe what the change is
You don't need to explain HOW you change the code. Your code, including comments in the code should explicitly
self-describe enough about how you change the code.
Steps to Test This Pull Request
Steps to reproduce the behavior:

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

Expected behavior
A clear and concise description of what you expected to happen.
Related Issue
If applicable, refernce to the issue related to this pull request.
More Information
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here. You may also want to refer
to how to wirte the perfect pull request

CI 沒過要檢查一下 flake8 warnings


Pipe/flow/chain type support

Search Terms
recursive, flow, pipe, chain

Suggestion
I do not have a specific implementation in mind to support this. There is a decent existing solution by a stackoverflow user @jcalz, which does its best given what typescript is able to accomplish now. I have created this issue to more to specifically point out the current limitation of typescript in regard to this feature, and the current use cases. This feature request falls under the larger umbrella of recursive type inference.
At its most broad, I would like to suggest that typescript include some form of an official Chain type that developers can use.
Unanswered Questions

should this type have an official implementation with a max recursion value? pipe: Chain<In, Out, number>
will this design pattern cease to be relevant if the tc39 pipeline proposal is integrated into javascript?

Use Cases
There are a number of implementations for javascript pipes in common libraries.

lodash pipe
rxjs pipe
ramda pipe

Related Issues
https://github.com/Microsoft/TypeScript/issues/27102
https://github.com/Microsoft/TypeScript/issues/28505

Examples
a typical implementation looks like this:
function pipe<T, A>(arg1: (in: T) => A): A
function pipe<T, A, B>(arg1: (in: T) => A, arg2: (in: A) => B): (in: T) => B
function pipe(...args: any[]): (in: any) => any

const strToNumber = (str: string) => parseInt(str)
const add = (x: number) => (y: number) => x + y
const safeAdder = pipe(strToNumber, add(5))
const out: number = safeAdder('6') // returns 11

The limitation of the current implementation is that if you use a typed pipe function with more arguments than the written overloads, you run lose type inference.
Checklist
My suggestion meets these guidelines:

[ ] This wouldn't be a breaking change in existing TypeScript/JavaScript code
[ ] This wouldn't change the runtime behavior of existing JavaScript code
[X] This could be implemented without emitting different JS based on the types of the expressions
[X] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
[X] This feature would agree with the rest of TypeScript's Design Goals.

I suppose if were spitballing, Ill take a stab as well. I do think thats a decent idea, but its a little hairy because the generic param ...A has to read the function argument indexes to figure out what its minimum length is and ...restOperators: Operator<A[0], A[1]>[] doesnt actually specify that the pattern is repeating. I believe what we need is some sort of recursive structure so heres another thought:
type Operation<In,Out> = (x: In) => Out

pipe2<T, U, V, X, Y, ...A extends [Operation<T,U>, Operation<U,V>, ...A],  (...ops: A[], opLast<X,Y>): Y {

}

but even this doesnt really describe that the 2nd and 3rd arguments should follow the same pattern as the 1st and 2nd.

My vote would be to describe such types using something similar to the mathematical notation where n is used to describe a series, which is then defined by relationships between members of that series.
function pipe<T[n]>(...operators: Array<OperatorFunction<T[n], T[n+1]>>): Observable<T[n]> {
...
}

export type TransformFn<I = unknown, O = unknown> = (input: I) => O;

export type TransformPipe<F, T extends TransformFn[]> = T extends [
  TransformFn<F, infer O1>,
  ...infer Rest
]
  ? Rest extends TransformFn[] ? [TransformFn<F, O1>, ...TransformPipe<O1, Rest>] : [TransformFn<F, O1>]
  : T

function pipe<V, H extends TransformFn[]>(v: V, ...t: TransformPipe<V, H>): TransformPipe<V, H> {}

i manage to get it to "work" but looks like a typescript error

I managed to implement a pipe function type. Instead of overloading, it uses tuple rest args and recursion.
There are 2 flavors of the pipe type. One returns a function (Pipe), and the other has a value as the first argument and immediately executes (PipeValue).
// A is argument type, R is return type
type Fn<A = any, R = any> = (a: A) => R;

type PipeResult<A, T extends Fn[]> = T extends [Fn<any, infer R>, ...infer Rest]
    ? Rest extends [Fn, ...any]
        ? PipeResult<A, Rest>
        : Fn<A, R>
    : never;

type PipeArgs<A, T extends Fn[]> = T extends [Fn<any, infer R>, ...infer Rest]
    ? Rest extends [Fn, ...any]
        ? [Fn<A, R>, ...PipeArgs<R, Rest>]
        : [Fn<A, R>]
    : T;

// usage: pipe(fn0, fn1, fn2...)(x)
type Pipe = <A, T extends Fn[]>(...fns: PipeArgs<A, T>) => PipeResult<A, T>;

// usage: pipe(x, fn0, fn1, fn2...)
type PipeValue = <A, T extends Fn[]>(a: A, ...fns: PipeArgs<A, T>) => ReturnType<PipeResult<A, T>>;

// example implementation (I apologize for my liberal use of any)
const pipe: Pipe = ((...fns: any[]) => (x: any) => fns.reduce((v, f) => f(v), x)) as any;
const pipeValue: PipeValue = ((x: any, ...fns: any[]) => fns.reduce((v, f) => f(v), x)) as any;

It correctly identifies the first incorrect argument.
The return type of the pipe function is correctly inferred even if there are incorrect arguments.

Works great @profound7. I wonder, is it also possible to optionally infer the value of the first function from the composed function argument?
// Works great, 2 is checked to be a number
const x = pipe((a: number) => a.toString(), x => +x)(2)

// Could we infer `a` in the first function to be the type inferred from 2 (Number | '2')?
const y = pipe(a => a.toString(), x => +x)(2)

@profound7, unfortunately this still performs worse that overloads implementations, since it can not infer types from a previous function in a chain:
pipe(
    (n: number) => n * 2,
    (n) => {}, // n should be `number`
//   ^? (parameter) n: any
);

This looks to be a Typescript bug, since the playground even suggests that n should be a number when you start typing the second function. But when you hover over it, typescript says n is any.
Is there any progress to fully support chain types in Typescript? The issue is here since 2019...

This is the best (shortest & fullest) solution I've made so far:

It correctly infers up to 7 piped function (using overloads)
It type checks any number of functions (using @profound7's recursive method)
It always infers the right return type
It supports an arbitrary number of arguments for the first function
It is written as short as possible while keeping readability

Try it on the playground!
type Fn<A = any[], Z = any> = (...args: A extends any[] ? A : [A]) => Z;

type Arg1<A, Z> = [Fn<A, Z>];
type Arg2<A, B, Z> = [Fn<A, B>, Fn<[B], Z>];
type Arg3<A, B, C, Z> = [...Arg2<A, B, C>, Fn<[C], Z>];
type Arg4<A, B, C, D, Z> = [...Arg3<A, B, C, D>, Fn<[D], Z>];
type Arg5<A, B, C, D, E, Z> = [...Arg4<A, B, C, D, E>, Fn<[E], Z>];
type Arg6<A, B, C, D, E, F, Z> = [...Arg5<A, B, C, D, E, F>, Fn<[F], Z>];
type Arg7<A, B, C, D, E, F, G, Z> = [...Arg6<A, B, C, D, E, F, G>, Fn<[G], Z>];
type ArgAny<A, B, C, D, E, F, G, H, Z extends Fn[]> = [
  ...Arg7<A, B, C, D, E, F, G, H>,
  ...Args<H, Z>
];

type Args<A, Z extends Fn[]> = Z extends [Fn<any, infer R>, ...infer Rest]
  ? Rest extends [Fn, ...any]
    ? [Fn<A, R>, ...Args<R, Rest>]
    : [Fn<A, R>]
  : Z;

type Result<A, Z extends Fn[]> = Z extends [Fn<any, infer R>, ...infer Rest]
  ? Rest extends [Fn, ...any]
    ? Result<A, Rest>
    : Fn<A, R>
  : never;

type Pipe = {
  <A>(): Fn<A, A extends any[] ? A[0] : A>;
  <A, Z>(...fn: Arg1<A, Z>): Fn<A, Z>;
  <A, B, Z>(...fn: Arg2<A, B, Z>): Fn<A, Z>;
  <A, B, C, Z>(...fn: Arg3<A, B, C, Z>): Fn<A, Z>;
  <A, B, C, D, Z>(...fn: Arg4<A, B, C, D, Z>): Fn<A, Z>;
  <A, B, C, D, E, Z>(...fn: Arg5<A, B, C, D, E, Z>): Fn<A, Z>;
  <A, B, C, D, E, F, Z>(...fn: Arg6<A, B, C, D, E, F, Z>): Fn<A, Z>;
  <A, B, C, D, E, F, G, Z>(...fn: Arg7<A, B, C, D, E, F, G, Z>): Fn<A, Z>;
  <A, B, C, D, E, F, G, H, Z extends Fn[]>(
    ...fn: ArgAny<A, B, C, D, E, F, G, H, Z>
  ): Result<A, Z>;
};

If you can think of a better/shorter solution, please post it in this thread and tag me. Thanks.

@Azarattum great, thanks for sharing! It's me or x resolves to any instead of number in the line 53?

@Bessonov this is by design. I did this intentionally to demonstrate that type inference works only for the first 7 functions. Since they are implemented manually with overloads. The rest is just type checked but not inferred. So, if you write   (x: string) => 123, on the line 53, you'll get an error. This is a typescript limitation see https://github.com/microsoft/TypeScript/issues/50468.

I've made an updated version which:

Supports a pipeline pattern (with automatic pipe inference)
Supports inference when used as a callback
Supports spread arguments (with the best inference possible)

Playground

Code
type Fn<A = any[], Z = any> = (...args: A extends any[] ? A : [A]) => Z;

type Arg1<A, Z> = [Fn<A, Z>];
type Arg2<A, B, Z> = [Fn<A, B>, Fn<[B], Z>];
type Arg3<A, B, C, Z> = [...Arg2<A, B, C>, Fn<[C], Z>];
type Arg4<A, B, C, D, Z> = [...Arg3<A, B, C, D>, Fn<[D], Z>];
type Arg5<A, B, C, D, E, Z> = [...Arg4<A, B, C, D, E>, Fn<[E], Z>];
type Arg6<A, B, C, D, E, F, Z> = [...Arg5<A, B, C, D, E, F>, Fn<[F], Z>];
type Arg7<A, B, C, D, E, F, G, Z> = [...Arg6<A, B, C, D, E, F, G>, Fn<[G], Z>];
type ArgAny<A, B, C, D, E, F, G, H, Z extends Fn[]> = [
  ...Arg7<A, B, C, D, E, F, G, H>,
  ...Args<H, Z>
];

type Args<A, Z extends Fn[]> = Z extends [Fn<any, infer R>, ...infer Rest]
  ? Rest extends [Fn, ...any]
    ? [Fn<A, R>, ...Args<R, Rest>]
    : [Fn<A, R>]
  : Z;

type Result<Z> = Z extends [...any, Fn<any[], infer R>]
  ? R
  : Z extends Fn<any[], infer R>[]
  ? R
  : Z;

type To<A, Z, Y> = Y extends false
  ? Fn<A extends [infer T] ? T : A, Result<Z>>
  : Result<Z>;

type Pipe<X = unknown, Y = false> = {
  <A = X>(): Fn<A, A extends any[] ? A[0] : A>;
  <Z, A = X>(..._: Arg1<A, Z>): To<A, Z, Y>;
  <B, Z, A = X>(..._: Arg2<A, B, Z>): To<A, Z, Y>;
  <B, C, Z, A = X>(..._: Arg3<A, B, C, Z>): To<A, Z, Y>;
  <B, C, D, Z, A = X>(..._: Arg4<A, B, C, D, Z>): To<A, Z, Y>;
  <B, C, D, E, Z, A = X>(..._: Arg5<A, B, C, D, E, Z>): To<A, Z, Y>;
  <B, C, D, E, F, Z, A = X>(..._: Arg6<A, B, C, D, E, F, Z>): To<A, Z, Y>;
  <B, C, D, E, F, G, Z, A = X>(..._: Arg7<A, B, C, D, E, F, G, Z>): To<A, Z, Y>;
  <B, C, D, E, F, G, H, Z extends Fn[], A = X>(
    ..._: ArgAny<A, B, C, D, E, F, G, H, Z>
  ): To<A, Z, Y>;
  <Z extends Fn[], A = X>(..._: Args<A, Z>): To<A, Z, Y>;
};

type Pipeline = <T extends any[]>(...data: T) => Pipe<T, true>;

Examples
// Pipe simple example
const data = pipe(
  (x: boolean, s: string) => 123,
  (x) => [],
  (x) => ({}),
  (x) => 123,
  (x) => "123",
  (x) => false,
  (x) => "123",
  // Arguments below are not inferred automatically
  (x: string) => 123,
  (x: number) => 123,
  (x) => 123,
  (x: number) => ["123"],
);
const result1 = data(true, "123");

// Pipeline verbose example
const process = pipeline(123, 321);
const result2 = process(
  (x, y) => x * y,
// ^? (parameter) x: number
  (x) => x.toString(),
  (x) => x.toUpperCase()
)

// Pipeline simple example
const result3 = pipeline("123")(
  (x) => x.toUpperCase(),
  (x) => ({ data: x })
)

// Function callback example
function test(callback: (x: string, y: number) => number) {}

test(pipe(
  (x, y) => x.toUpperCase() + y.toPrecision(),
// ^? (parameter) x: string
  (x) => +x
))

// Spread arguments example
const result4 = pipe(
//    ^? const result4: string | number
// This became an array, not a tuple. Therefore there is no "last" function.
//   We make our best guess which is a union of all returns.
  ...[
    (s:any) => 123,
    (s:any) => "123"
  ]
)(42);

@profound7
any chance you could modify your solution to enable async functions?

@olmo-hake you can check out my full pipe/pipeline implementation that I’m using for my libfun library here. It supports promises and other promise-like monadic structures.

I made this work with async its not clean but works well:
type IsPromise = T extends Promise ? true : false;
type SomePromise<T extends any[]> = T extends [infer First, ...infer Rest]
? IsPromise extends true
? true
: SomePromise
: false;
type Fn<A extends unknown[], R> = (...args: A) => R;
type Last<T extends any[]> = T extends [...any[], infer L] ? L : never;
type Result<R extends unknown[]> = SomePromise extends true
? (...args: [R[0]]) => Promise<Last<Awaited>>
: (...args: [R[0]]) => Last<Awaited>;
type ChainOverload = {
<A extends unknown[], R0>(fn0: Fn<A, R0>): (...args: A) => Result<[R0]>;
<A extends unknown[], R0, R1>(fn0: Fn<A, R1>, fn1: Fn<[Awaited], R1>): Result<
[R0, R1]

;
<A extends unknown[], R0, R1, R2>(
fn0: Fn<A, R0>,
fn1: Fn<[Awaited], R1>,
fn2: Fn<[Awaited], R2>
): Result<[R0, R1, R2]>;

<A extends unknown[], R0, R1, R2, R3>(
fn0: Fn<A, R0>,
fn1: Fn<[Awaited], R1>,
fn2: Fn<[Awaited], R2>,
fn3: Fn<[Awaited], R3>
): Result<[R0, R1, R2, R3]>;
<A extends unknown[], R0, R1, R2, R3, R4>(
fn0: Fn<A, R0>,
fn1: Fn<[Awaited], R1>,
fn2: Fn<[Awaited], R2>,
fn3: Fn<[Awaited], R3>,
fn4: Fn<[Awaited], R4>
): Result<[R0, R1, R2, R3, R4]>;
<A extends unknown[], R0, R1, R2, R3, R4, R5>(
fn0: Fn<A, R0>,
fn1: Fn<[Awaited], R1>,
fn2: Fn<[Awaited], R2>,
fn3: Fn<[Awaited], R3>,
fn4: Fn<[Awaited], R4>,
fn5: Fn<[Awaited], R5>
): Result<[R0, R1, R2, R3, R5, R5]>;
// todo: add more here ...
};
const chain: ChainOverload = (() => {}) as any;
const final = chain(
(one: string) => one,
async (two) => Number(two),
(three) => three
);
export const result: number = await final('hey');

Also I guess:

import { Is } from '@janekeilts/is';
import { Pipe } from '@Pipe';

type SingleArgFunction = (arg: any) => any;

export const pipe: Pipe= (...fns: SingleArgFunction[]) => {
  const somePromise: boolean = fns.some(Is.Function.async);

  return somePromise
    ? async (arg: any) => {
        let result = arg;

        for (const fn of fns) result = await fn(result);

        return result;
      }
    : (arg: any) => {
        let result = arg;

        for (const fn of fns) result = fn(arg);

        return result;
      };
};


Python: 1.4 what is programming language#77.md

Python: 1.4 what is programming language#77
video contribution by subhoshree pattnaik,python batch 1

Description 📜
Python: 1.4 what is programming language#77
video contribution by subhoshree pattnaik, python batch 1
Fixes # <77>

Type of change 📝

[x] Video (Animations, screen-recordings, presentations and regular explanatory films are all possibilties etc)

Domain of Contribution 📊

[x] Python

Checklist ✅

[x] I follow Contributing Guidelines & Code of conduct of this project.
[x] I have performed a self-review of my own code or work.
[x] I have commented my code, particularly in hard-to-understand areas.
[x] My changes generates no new warnings.
[x] I'm GWOC'21 contributor

Screenshots / Gif (Optional) 📸

@ankurg132 could you please review my issue

/keywordlabeler add python

This looks good to me! @adityabisoi you can merge this one!


Sub-Task 3.2: Confirm logout cancel

Task: when user is met with thee dialog box confirming logout and clicks "cancel"; session remains untouched and user is still logged in.

Deleting issue, linked to: US#3


Fix encoding error when using sphinx to build docs

When I followed the available instructions to build the documentation (i.e. cloning the gh-pages branch as described an installing your sphinx-julia package) I ran into the following error:
>> make html
sphinx-build -b html -d build/doctrees   source ../../QuantumOptics.jl-docs/html
Running Sphinx v1.4.6
WARNING: the config value 'copyright' is set to a string with non-ASCII characters; this can lead to Unicode errors occurring. Please use Unicode strings, e.g. u'Content'.
PyJulia not found - using slower alternative.
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date

Encoding error:
'ascii' codec can't decode byte 0xc3 in position 18: ordinal not in range(128)
The full traceback has been saved in /tmp/sphinx-err-UOKOhp.log, if you want to report the issue to the developers.
Makefile:57: recipe for target 'html' failed
make: *** [html] Error 1

I tried several things, but finally this post on stackoverflow pointed me in the right direction. Adding from __future__ import unicode_literals in the first line of the conf.py file did the trick.
The error itself probably had something to do with the python version on my Linux distribution, the default encoding or something the like. Adding this line might help other people avoid this issue altogether.

Coverage remained the same at 0.0% when pulling 5ac12681589795139706dcee318198e19e529977 on david-pl:docs-encoding-fix into 662a9a0000db109d500662e0e89dfd244bb89d1b on bastikr:master.

Apparently you are using python2 to run sphinx while I always used python3. It's great that this is the only change needed to make it run on both.


Enums & array inputTypes

Hello,
Firstly thanks for this awesome library. I really like the builder style syntax, in my opinion this is much cleaner than zeus for example.
I got several problems on using this with hasura graphql:

The order by enum is parsed as string instead of a enum value:

import { query, order_by, $ } from '@/__generated__/api';
 query((q) => [
 q.organisations({ order_by: [{ name: order_by.asc_nulls_last }] }, (o) => [
    o.id,
    o.name,
    o.slug,
    o.subscription((s) => [s.plan, s.status]),
  ]),
]);

will be parsed into:
organisations(order_by: [{name: "asc_nulls_last"}]) {
    id
    name
    slug
    subscription {
      plan
      status
    }
  }

Secondly when I try to use order_by as an variable inside the order_by array like this:

query((q) => [
  q.organisations({ order_by: [{ name: $('order_by_name')}] as const }, (o) => [
    o.id,
    o.name,
    o.slug,
    o.subscription((s) => [s.plan, s.status]),
  ]),
]);

I get typescript circularly references error. The reason is probably due the circular relationships, for eg: organisations -> subscriptions -> organisations.
Only possible solution is to make the whole order_by as a variable:
query((q) => [
  q.organisations({ order_by: $('order_by') }, (o) => [
    o.id,
    o.name,
    o.slug,
    o.subscription((s) => [s.plan, s.status]),
  ]),
])

But this is not optimal

Additionally, I wonder how I can mark a variable nullable or not nullable and have an possible union.

I think many of these problems of inputTypes could be solved when the user must explicity define the type:
q.organisations({ order_by: [{ name: $('order_by_name', 'order_enum!')}] }, (o) => [
    o.id,
    o.name,
    o.slug,
    o.subscription((s) => [s.plan, s.status]),
  ]),

And apply the type match that makes ts happy. So when providing $('order_by_name', 'String!') typescript will complain.
Thanks

Hi @ilijaNL
Thanks for reporting the problem.
I believe I found a fix for both of your issues, available here: https://github.com/typed-graphql-builder/typed-graphql-builder/pull/21
Could you please look at it (especially the tests) and let me know if it looks good from your side? If so I'll merge and publish a new release
P.S. It looks like TS doesn't give good error messages when the types are recursive but its possible to debug with a non-recursive version of the type which is how I went about it
P.P.S. The ability to specify explicit variable types sounds like an interesting feature, and so does controlling nullability / optionality. Will give it some thought.

@spion Thanks for the quick response. I checked your pr's, the enums seems to work. Next I left some comments on the #22  PR.


Typo "[GitHub Action]"→"[GitHub Actions]"

https://docs.microsoft.com/en-us/azure/governance/policy/tutorials/policy-as-code-github
https://github.com/MicrosoftDocs/azure-docs/blob/main/articles/governance/policy/tutorials/policy-as-code-github.md
#PingMSFTDocs

@hyoshioka0128 : Thanks for your contribution! The author(s) have been notified to review your proposed change.


Add top-level NewCase properties to API docs & use to validate create requests

Note: Also needed to move the express handlers for API endpoints to be registered after the open api validator is installed -- without this, it wasn't actually validating
Next few PRs will be fleshing out the sub-props

 Design & implement 'Case' API entity


Project Setup

Could You please add directions on how to set up this project and run it ?

I completely agree. I'm familiar with Visual Studio, but I don't know how to run this project.  I would look for a solution file, but there is none.  Please help! Would love to be able to run it.

This tutorial helps, but I still don't know how to run this project: https://www.youtube.com/watch?v=MawL2dQIZ7s

Get Unity 2021.3.9f1 Personal
Download this project to your hard drive
Open Unity and then from the file menu choose "Open Project"
Point it to the directory where you downloaded this project
at the Top of Unity there should be a Play button. Hit it and you get a black window that does digit recognition

Thanks for the reply. I will do that.


add script for whiteboard sample collection

@Flova

we may should rename it to a more clear description like live_video_data_collection, for example

I agree. Maybe just real_world_data_collection.py?

Addressing the comments in #10 and #8 I would like to have a consistent output format. This is also not the case here. But I honestly like it in this case, because we have a 1 to many relationship for each sample and it makes it easier to verify the data afterward. But we should think about adding a script that creates individual samples in the common format in the end.