proposal: math: Make -integer special cases for Gamma and Lgamma consistent

Straight from the documentation:
Gamma(+0) = +Inf
Gamma(-0) = -Inf
Gamma(x) = NaN for integer x < 0

Lgamma(-integer) = +Inf

Gamma(x) treats x = 0 and x = -integer differently for  without proper justification. Presumably it is this way since the sign would depend on whether the negative integer (e.g. -1) is approached from above or below, and there is no way to represent that for non-positive integers except 0 (since Go supports ±0).
However, Lgamma(x) does not make this distinction and always reports the sign of Gamma(-integer) to be positive (questionable given the above point about approaching from above or below). https://play.golang.org/p/o-hiBPerYLS
I propose that this behaviour is changed to be consistent. Either both Gamma(-int) and Lgamma(-int) should return NaN or both should return ±Inf. In particular, I propose that the value is Inf and the sign is determined by the sign of the residue, i.e. Res(Gamma, -n) = (-1)**n / n!.
Adopting this convention would make the functions consistent with each other and would provide a justification for the special behaviour chosen. It would also be consistent with the expected sign given by a ratio of Gamma functions, e.g. Pochhammer(-4, 1) = Gamma(-3)/Gamma(-4) = -4, which is well defined negative number (see http://www.wolframalpha.com/input/?i=pochhammer(-4,1)). (Note I'm not suggesting the standard library must implement ratios of Gamma functions, but it would be sensible for the signs to be consistent in my opinion).

I have suggested these changes here: https://go-review.googlesource.com/#/c/go/+/105397

The behavior cannot be changed if it's not a bug.

@cznic It is a bug from the point of view of that if I define g := Gamma(x) and lg, s := Lgamma(x) then I would expect
g == float64(s) * Exp(lg)

to evaluate to true. Currently it does evaluate to true except for non-positive integers.

then I would expect

Please specify if that's

the only reasonable/correct expectation (reference welcome and should go into the docs)
the common expectation (probably seen in most other languages)
your preference

Admitted, from the above it's clear I haven't looked at the math background of the problem at all, shame on me.

@cznic
I'll try to expand on each of those bullet points:

the only reasonable/correct expectation (reference welcome and should go into the docs)

In a strict mathematical sense, Gamma and by extension Lgamma are not well defined at non-negative integers; the Gamma function is not analytic at these points. From this point of view, the correct approach would be to have both functions return NaN. See here for example. Because Gamma is not analytic at the non-negative integers, i.e. it is discontinuous, the sign of the at those points is ambiguous - the formal limit doesn't exist. However, what is unambiguous is that Gamma is divergent at non-negative integers, i.e. the absolute value is always +Inf.

the common expectation (probably seen in most other languages)

I've looked at some of the major languages used in scientific computing: Python, Mathematica, Matlab, and C/C++.
Gamma(-int): Python (scipy.special.gamma), Matlab and Mathematica return +Inf, C/C++ return NaN.
Lgamma(-int): Python (scipy.special.gammaln) and C/C++ return +Inf (but without any sign information for Gamma). Matlab's equivalent throws an error for negative arguments.

my preference

To be clear, my preference is for Gamma and Lgamma to reflect a consistent view, like the other languages I have tested do. I see several ways of doing this:

Make Lgamma and Gamma return NaN (since the sign isn't well defined, and Lgamma returns the sign)
Make both functions return +Inf and set the sign to be +1 in Lgamma. This requires changing Gamma to return +Inf instead of NaN. This is the approach in Python (SciPy) and Mathematica. However, it is not strictly true in the mathematical sense.
Adopt a convention for the sign that is based on the residue of Gamma. This is, to my knowledge, not done in other languages, and is also not strictly mathematically true, but it would make both functions consistent with each other and with the sign observed in a ratio of Gamma functions.
Follow the C/C++ convention. This, to me, is not feasible because the C Lgamma function does not take a view on the sign of Gamma, whereas the Go implementation does. The Go implementation correctly gives the absolute value as +Inf, but incorrectly (because it is not defined) gives the sign as +1. If we are willing to accept having a mathematically incorrect sign returned from Lgamma, then ultimately it makes sense to return +Inf from Gamma too, which is what I have called option 2 here.

The change I have pushed implements option 3. However, to be clear, any of the above would be more desirable than the current behavior.
Additionally, looking again at the code for Gamma, it seems like there is an inconsitency in the code itself.
        q := Abs(x)
	p := Floor(q)
	if q > 33 {
		if x >= 0 {
			y1, y2 := stirling(x)
			return y1 * y2
		}
		// Note: x is negative but (checked above) not a negative integer,
		// so x must be small enough to be in range for conversion to int64.
		// If |x| were >= 2⁶³ it would have to be an integer.

/*<<< This sets the sign to +1 or -1 if based on whether Floor(Abs(x)) is even or odd. >>>*/
		if ip := int64(p); ip&1 == 0 {
			signgam = -1
		}
		z := q - p
		if z > 0.5 {
			p = p + 1
			z = q - p
		}
		z = q * Sin(Pi*z)
/*<<< This returns ±Inf if z is an integer, with the sign decided above. >>>*/
		if z == 0 {
			return Inf(signgam)
		}
                (... etc.)

See the comments marked by /*<<< ... >>>*/. On the face of it, this looks like it is possible, at least for x<-33 for Gamma to return ±Inf when x=-int. Indeed, if I take out the isNegInt special case, this is exactly what I find. The sign here is the opposite of that of the residue.
	all_test.go:2478: Gamma(-35) = +Inf, want NaN
	all_test.go:2478: Gamma(-36) = -Inf, want NaN
	all_test.go:2478: Gamma(-37) = +Inf, want NaN

The goal of the Go math package is to follow the C/C++ convention. It also sounds like we do that:
$ go doc math.Gamma
...
    Gamma(-0) = -Inf
    Gamma(x) = NaN for integer x < 0
    Gamma(-Inf) = NaN
    Gamma(NaN) = NaN
$ go doc math.Lgamma
...
    Lgamma(-integer) = +Inf
    Lgamma(-Inf) = -Inf
    Lgamma(NaN) = NaN
$

and you wrote:

Gamma(-int): Python (scipy.special.gamma), Matlab and Mathematica return +Inf, C/C++ return NaN.
Lgamma(-int): Python (scipy.special.gammaln) and C/C++ return +Inf (but without any sign information for Gamma). Matlab's equivalent throws an error for negative arguments.

It sure looks like Go is already matching C/C++. You say that for Lgamma the C/C++ routines return "without any sign information for Gamma" but that's actually not so. There is an external global int signgam that it sets. Is the problem that Go is setting signgam differently?
Again the goal is to match C/C++, and it looks like we're doing that. Am I missing something?

@rsc I admittedly missed the signgam global int. According to the POSIX documentation for tgamma(x), the behaviour may change in the future to throw a pole error for x=-int instead of the domain error currently thrown. For the sake of clarity, here is the relevant section:

FUTURE DIRECTIONS
It is possible that the error response for a negative integer argument may be changed to a pole error and a return value of ±Inf.

This is also stated in the C++ docs:

POSIX requires that a pole error occurs if the argument is zero, but a domain error occurs when the argument is a negative integer. It also specifies that in future, domain errors may be replaced by pole errors for negative integer arguments (in which case the return value in those cases would change from NaN to ±∞).

Once signgam is taken into consideration, then it does seem that Go currently matches the existing C/C++ standard. As the quotes above from the C/C++ documentation show, however, this standard seems to be heading in the direction of what I was suggesting.
Do you have any further thoughts, with that in mind? Would you prefer to wait until the C/C++ standard changes and then change the Go standard to continue to match?

Yes, as a general guideline we want to follow C and POSIX, not lead them.

Given that we aimed to match C and do match C, closing this.
If C changes, we might still choose to leave Go alone, for purposes of maintaining backwards compatibility.


Help with coding

Is there any chance to help me to implement this code for a GUI?
What I exactly need is to run few commands to get SoC and temperature values. I'm new on this topic and any help would be appreciated. I have been reading the protocol and I think I understand how it works but I don't know how to send a command using a python script.

Hi,
A simple "hello" is always welcome :-)
Basically, the library implements most of the commands. There are some examples here.
Once you choose a GUI lib (tkinter for example), you just have to interface with this library and it should work :-)
Maybe I'll write an example if I have the time, but I don't guarantee it.
Cheers

Oh man...I'm so sorry, for real. My comment was rude (english is not my native language so I was stupdly focus trying to explain myself), I apologize. Let me start over.
 I was able to use most of the commands except "p.get.values()".
I found your project meanwhile I was trying to use the pylon protocol myself but I don't have enough knowledge to do it. I will try to do what you told me. I'm currently using "pysimplegui" to make my GUI. Any example would be appreciated if you have time.
Thank you very much for the fast answer tho.
Cheers.

No problem.
Something like that should do the job:

import tkinter as tk
from time import time
from pylontech import Pylontech

p = Pylontech()

def update():
    vals = p.get_values()
    bv = vals.Module[0].Voltage
    bi = vals.Module[0].Current
    tot_power = vals.TotalPower
    batv_v.config(text=f"{bv} V")
    bati_v.config(text=f"{bi} A")
    batp_v.config(text=f"{tot_power} W")
    root.after(5000, update)

# Create the main window
root = tk.Tk()
root.title("Pylontech Display")

# Create a label widget for displaying the time
batv_l = tk.Label(root, text="Battery Voltage")
batv_l.grid(column=0, row=0)
batv_v = tk.Label(root, text="xx V")
batv_v.grid(column=1, row=0)

bati_l = tk.Label(root, text="Battery Current")
bati_l.grid(column=0, row=1)
bati_v = tk.Label(root, text="xx A")
bati_v.grid(column=1, row=1)

batp_l = tk.Label(root, text="Battery Power")
batp_l.grid(column=0, row=2)
batp_v = tk.Label(root, text="xx W")
batp_v.grid(column=1, row=2)

time_label2 = tk.Label(root, font=('Helvetica', 48), pady=20)
#time_label2.pack()

# Initialize the time display
update()

# Start the Tkinter event loop
root.mainloop()

Cheers

PS: If you create a nice UI, it'd be great if you could do an MR someday so we can add it to the repo !

Hello mate 😊,
Thank you a lot! That's the example that I need it to know how the info was grouped within the response.
When I finish the GUI, you can be sure I will do an MR and if you like the GUI enough, it would be awesome to add it here and help another people.
Thank you one more time for being so quick to answer.
Cheers


Add MinIO, MinIO Client images and refactor Docker Registry Dockerfile

Description
Changes proposed in this pull request:

as in title :tada:

/retest


Client Certificate Support

Hi,
I need to implement client certificates in our application.  The current build of 3.2.2 does not support this and required me to modify a few options in the request setup.  Can you please include this in future builds so that the client can specify the following options: passphrase, pfx, ca, key, crt.
Just in case anyone else needs to search this issue: node restler client certificate.
Thanks
this.request = proto.request({
host: this.url.hostname,
port: this.url.port,
path: this._fullPath(),
method: this.options.method,
headers: this.headers,
rejectUnauthorized: this.options.rejectUnauthorized,
passphrase: this.options.passphrase,
pfx: this.options.pfx,
ca: this.options.ca,
key: this.options.key,
cert: this.options.cert
});
Example:
options = {
key: fs.readFileSync('../path/to/key.key'),
cert: fs.readFileSync('../path/to/cert.crt'),
ca: [fs.readFileSync('../path/to/clientcert.crt')],
passphrase: 'mypass'
};
// or
options = {
pfx: fs.readFileSync('../path/to/pfx.pfx'),
passphrase: 'mypass'
}
json = {
myData: 'topost'
};
url = 'https://myurl.com';
return restler.postJson(url, json, options).on("complete", (function(_this) {
return function(resResponse) {
console.log(resResponse)
});
};
}));

IS this issue addressed?


ability to compile a script as a library

It would be wonderful if we could add a [lib] section to the script, choose the crate-type and have it appear compiled next to the script.

@joseluis Thanks for the suggestion, sounds interesting. Thinking about it and experimenting.

I'm happy to hear that. I'm realizing now that it would make sense then to be able to do a similar thing with the binary, being able to have it appear compiled in the same dir. What do you think?


[BUG]

I created a simple integration (see simple_integration.txt). After I finished I deployed the integration, but the integration fails to run. From the GUI it's not sure what's happening.
To Reproduce
Steps to reproduce the behavior:

Go to the main page
Import the yaml (simple_integration.txt)
the extensions is .txt by the way, because GitHub won't let me upload yaml files.
Click on 'deploy.'
The console:

Error processing deployment: Operation: [list]  for kind: [Pod]  with name: [null]  in namespace: [default]  failed.
Expected behavior
I would expect some feedback why the error occurs and what to do to prevent it. Is it not possible yet, or do I need to configure some link to Kubernetes?
Logs
See attached files
Environment (please complete the following information):

OS: [e.g. "Windows 10, running in Docker"]
Kaoto Version [0.5]

Additional context
Add any other context about the problem here.
Attached FiIes
simple_integration.log
simple_integration.txt

Closing since we have another issue open for this and are now pointing to this issue for more context.


Feature/eak 365

[EAK-365] implemented RequestAttributeInjector; template method refactoring

I have read the CLA Document and I hereby sign the CLA


Unable to set focus to buttons inside Modal

Unable to set focus to buttons inside a Modal.
Expected Behavior
Should be able to set focus via Refs.
Current Behavior
Unable to get focus.
Possible Solution

Steps to Reproduce
https://codesandbox.io/s/orbit-sandbox-f31lj
Context (Environment)
I am looking to set focus when the modal loads automatically to a button in the footer

Thanks for the issue @kabh! Even that managing focus manually is not necessary for Modal component and it breaks the WCAG guidelines then, there is issue inside the ModalFooter component that needs to be fixed.

@kabh Fix released in version 0.48.0. Just make sure the you will call the focus after more than 15 milliseconds, as the Modal is trying to handle the focus on it's own.
https://github.com/kiwicom/orbit-components/blob/76195f5364e1af2bf4bba63fb4a3b55a2cc2cad4/src/Modal/index.js#L363-L374

Thank you !


notify: add webex notifier

Thanks for suggesting this change. Unfortunately, we are currently not accepting new integrations as noted in the documentation.
We can only provide the stability and performance we want to provide if we can properly maintain the codebase. This includes, amongst others, test integrations in an automated and scalable fashion. For this reason, we are suggesting people integrate with the help of our generic interfaces. We have an integrations page on which integrations using our generic interfaces are listed.
Even if existing integrations can not be tested in an automated fashion, we will not remove them for reasons of compatibility. This also means that any additions we take on, or any changes to existing integrations we make or accept, will mean maintaining and testing these until at least the next major version, realistically even beyond that.
Feel free to question this answer on our developer mailing list, but be aware it's unlikely that you will get a different answer.


Add Fee Alert for the create Bot flow.

not needed. don't kill the app by making fees an issue. fees are changing.


Remove unused files, unused imports, commented out code, and update NPM packages

General cleanup

@tachyons Can you merge this. I don't seem to have write access. (also please give me write access too)


Add a multi-line text editor for exported strings

Godot version:
3.1 beta 4
Issue description:
Editing exported strings is very uncomfortable when you want to use them as multi-line text because new lines can only be added by copying text from an external text editor.
My suggestion is to add a button to the right side of the line edit that opens a window where you can edit mult-line text.

You can already use export(String, MULTILINE) var text for that, see https://docs.godotengine.org/en/latest/getting_started/scripting/gdscript/gdscript_basics.html#exports

You can already use export(String, MULTILINE) var text for that, see https://docs.godotengine.org/en/latest/getting_started/scripting/gdscript/gdscript_basics.html#exports

Is this possible in C#? this is not mentioned in https://docs.godotengine.org/en/latest/getting_started/scripting/c_sharp/c_sharp_differences.html#other-differences

[Export(PropertyHint.MultilineText)] should be the C# variation

It would be good to enhance the C# docs linked accordingly, it's quite terse currently on how options are available for [Export].

[Export(PropertyHint.MultilineText)] should be the C# variation

Thank you so much.


(May not be needed) Map between OS locales and our language locales

Depends on whether the OS knows of pa-in vs pa etc

Handled in f67c126f6fd664c1a91e9396dfc11c85dd28dbce


Segmentation fault (core dumped) when moving model to cuda device on Jetson Xavier

I am trying to run some mmdetection3d demos on a Jetson Xavier. I tried to run the FCOS3D and SECOND demo. It works when my device is the cpu, however when I want to select the GPU device, the code fails when trying to send the loaded model to the device. I get a Segmentation fault (core dumped) error.  (line 76 in https://github.com/open-mmlab/mmdetection3d/blob/master/mmdet3d/apis/inference.py)
When I start python 3.6 interactively I am able to send normal torch models to the device as well as torch tensors.
Why am I getting this segmentation fault error when trying to run the mmdetection3d demo's? Is something wrong with the environment I installed?
My environment looks like this:
sys.platform: linux
Python: 3.6.9 (default, Apr 18 2020, 01:56:04) [GCC 8.4.0]
CUDA available: True
GPU 0: Xavier
CUDA_HOME: /usr/local/cuda
NVCC: Cuda compilation tools, release 10.2, V10.2.8
GCC: aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0
PyTorch: 1.6.0
PyTorch compiling details: PyTorch built with:

GCC 7.5
C++ Version: 201402
OpenMP 201511 (a.k.a. OpenMP 4.5)
NNPACK is enabled
CPU capability usage: NO AVX
CUDA Runtime 10.2
NVCC architecture flags: -gencode;arch=compute_53,code=sm_53;-gencode;arch=compute_62,code=sm_62;-gencode;arch=compute_72,code=sm_72
CuDNN 8.0
Build settings: BLAS=MKL, BUILD_TYPE=Release, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -fopenmp -DNDEBUG -DUSE_XNNPACK -DUSE_INTERNAL_THREADPOOL_IMPL -DUSE_VULKAN_WRAPPER -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow, FORCE_FALLBACK_CUDA_MPI=1, USE_CUDA=ON, USE_EIGEN_FOR_BLAS=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=OFF, USE_MKLDNN=OFF, USE_MPI=ON, USE_NCCL=0, USE_NNPACK=ON, USE_OPENMP=ON, USE_STATIC_DISPATCH=OFF,

TorchVision: 0.7.0a0+6631b74
OpenCV: 4.6.0
MMCV: 1.6.2
MMCV Compiler: GCC 7.5
MMCV CUDA Compiler: 10.2
MMDetection: 2.25.2
MMSegmentation: 0.29.0
MMDetection3D: 1.0.0rc5+fcb4545
spconv2.0: False
I hope you can help, Thanks!

Hi, could you provide more error info? And I suggest you can try to check your PyTorch env.
import torch
models = torch.nn.Linear(3,3).cuda()
x = torch.rand(3,3).cuda()
print(models(x))

@VVsssssk
Hello, I have encountered a similar problem. When I transfer the model to CUDA, there will be segment errors.
Can you help me?
My env is:
sys.platform: linux
Python: 3.8.19 (default, Mar 20 2024, 19:58:24) [GCC 11.2.0]
CUDA available: True
GPU 0,1: NVIDIA A800 80GB PCIe
CUDA_HOME: /usr
NVCC: Build cuda_11.5.r11.5/compiler.30672275_0
GCC: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
PyTorch: 1.9.1+cu111
PyTorch compiling details: PyTorch built with:
GCC 7.3
C++ Version: 201402
Intel(R) Math Kernel Library Version 2020.0.0 Product Build 20191122 for Intel(R) 64 architecture applications
Intel(R) MKL-DNN v2.1.2 (Git Hash 98be7e8afa711dc9b66c8ff3504129cb82013cdb)
OpenMP 201511 (a.k.a. OpenMP 4.5)
NNPACK is enabled
CPU capability usage: AVX2
CUDA Runtime 11.1
NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_86,code=sm_86
CuDNN 8.0.5
Magma 2.5.2
Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.1, CUDNN_VERSION=8.0.5, CXX_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/c++, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.9.1, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON,
TorchVision: 0.10.1+cu111
OpenCV: 4.9.0
MMCV: 1.4.0
MMCV Compiler: GCC 7.3
MMCV CUDA Compiler: 11.1
MMDetection: 2.14.0
MMSegmentation: 0.14.1
MMDetection3D: 0.17.1+f110797


is there any hxcpp version example?

is there any hxcpp version example?
all test is node version.it's difficult  to know how to use in hxcpp

Cpp is currently not supported. Maybe later ;)


feat: smart currency choosing

Close #702

To Test

[ ] No STRK, give ETH as base currency
[ ] No ETH, no STRK, gives ETH as a base currency
[ ] X ETH, 4X STRK, gives STRK
[ ] X ETH, 2X STRK, gives ETH
[ ] Not enough STRK gives ETH
[ ] Not enough ETH gives STRK


StepContent doesn't resize when content changes

Problem description
If content grows vertically in a StepContent element, the content at the bottom of that element can become clipped.
Steps to reproduce
Create a vertical stepper.
Create a React component that renders a button, and when that button is clicked, toggle a flag that causes a TextField to be rendered below it.
In your StepContent, add that component.  Add the usual "Next" and "Back" buttons below it.
When clicking the button, the Next and Back buttons should get pushed down and clipped to some degree.
Versions

Material-UI: 0.15.0
React: 15.1.0
Browser: Chrome

Extra notes
I poked around a bit and couldn't find any kind of exposed method for telling the stepper it needs to recompute its size.  It seems like it'd be a pretty difficult problem to watch the content for size changes.  I'm not sure what the right solution is, but it's very limiting to be unable to dynamically change content in a step.
In one of my steps, the user is asked to add several tags to a piece of content, and those tags appear below the TextField as they're submitted.  This pushes the Next and Back buttons out of the content box and hides them, such that the user can only go forward by deleting all of their tags.
I tried fixing this by making the stepper expand to the full height of my browser, but that screws up the stepper layout.

This has already been fixed on HEAD #4203


Set up CI + Code Coverage

I think it would be great if there was an indication of the project being buildable and of the % of code covered by automatic tests.
Would you consider setting up CI (e.g. Travis) + export code coverage (to codeclimate/codecov/coveralls..)
I came across several how-tos for TypeScript (most of them are mentioning istanbul and mocha), so it should be doable.
If you need some inspiration regarding yml files, look at the Kentico repos, e.g.:

https://github.com/Kentico/delivery-sdk-php
https://github.com/Kentico/delivery-sdk-net

Thanks for the idea! Seems that the Travis is now working for the Master branch -> https://github.com/Enngage/KenticoCloudDeliveryTypeScriptSDK
I will take a look at the code coverage options.

done, closing.

awesome!


Maintain request header casing.

While headers are meant to be case sensitive, many servers do not
respect this.  Node maintains the casing of the request headers in order
to work with this and http-browserify should do likewise in order to be
consistent with the node implementation.
This patch maintains the casing with which the header was last set, e.g.
setting header "fOo", then header "Foo" will still only send one header,
but will use the final casing "Foo".  This is compatible with the node implementation.

Resolves #91

Added tests.
Note that this fix maintains the case insensitive access (to set, get and delete) but still sends the headers in the case given.

@substack I notice that there hasn't been a lot of activity here recently (big queue of unmerged PRs, mainly old) - is this still maintained?

Please merge or close if there's no interesting in fixing this bug.


Cache turn-by-turn conversation in Anthropic Claude

Description
This implements turn-by-turn conversation caching for Claude, in addition to the pre-existing system message caching.
See: https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching
Perhaps we should enable this by default?
Checklist

[x] The base branch of this PR is dev, rather than main
[x] The relevant docs, if any, have been updated or created

Testing

Add "cacheConversation": true to the anthropic config. Like:

{
      "title": "Claude 3.5 Sonnet",
      "provider": "anthropic",
      "model": "claude-3-5-sonnet-20240620",
      "apiKey": "<YOUR_API_KEY>",
      "cacheSystemMessage": true,
      "cacheConversation": true
    }

uncomment the following line in Anthropic.ts: if (value.type == "message_start") console.log(value);
Select the claude model, add at least 1000 tokens context
When running in the debugger, see in the debug console things like:

{input_tokens: 4, cache_creation_input_tokens: 1212, cache_read_input_tokens: 0, output_tokens: 2}

then the next request:
{input_tokens: 4, cache_creation_input_tokens: 224, cache_read_input_tokens: 1212, output_tokens: 1}

Hopefully Anthropic will soon put caching statistics in their api console as well.

Love this! Yeah I think we'll want to make this default after a very short period of sanity check testing

@sestinj Ready for re-review!


Change DateTimeFormatSpec delimiter

Support for new DateTime format:
EPOCH|<timeUnit>(|<size>)
EPOCH|SECONDS
EPOCH|MINUTES|5
SDF|<timeFormat>(|<timezone>)
SDF|yyyy-MM-dd
SDF|yyyy-MM-dd'T'HH:mm:ss'Z'|America/Chicago
TIMESTAMP

Ref issue: #8632

Codecov Report

Merging #8779 (63d795c) into master (73316a6) will decrease coverage by 41.53%.
The diff coverage is 0.00%.

:exclamation: Current head 63d795c differs from pull request most recent head 5b00bcc. Consider uploading reports for the commit 5b00bcc to get more accurate results

@@              Coverage Diff              @@
##             master    #8779       +/-   ##
=============================================
- Coverage     68.51%   26.97%   -41.54%
+ Complexity     4601        1     -4600
=============================================
  Files          1736     1724       -12
  Lines         91196    90897      -299
  Branches      13633    13609       -24
=============================================
- Hits          62480    24523    -37957
- Misses        24330    64046    +39716
+ Partials       4386     2328     -2058

Flag
Coverage Δ

integration1
26.97% <0.00%> (-0.07%)
:arrow_down:

unittests1
?

unittests2
?

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

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


6.0 Feedback:  tray slide out looks choppy when clicking run protocol

Overview
The menu that slides out when trying to run a protocol seems choppy
Current Behavior
Slide out tray comes out in a few motions
Expected Behavior
one smooth motion
Steps To Reproduce

Open 6.0.0 app
Go to protocol
click ... on one of the protocols
click run

https://user-images.githubusercontent.com/106115893/172425611-8d9180c3-8724-4f62-9caf-9b95f56ea57c.mov
Operating system
Mac
Robot setup or anything else?
No response

Seems that this has been solved.


Question about prediction using scaling law

Dear authors, I am recently reading your amazing working of this paper, however I encounter a calculation problem while trying to predict loss.
For figure 5 left, I choose 8.7B parameters, 187B tokens and 0.14 unique tokens as an example and follow this program:
import math

alpha = 0.3526596
beta = 0.3526596
A = math.exp(6.255414)
B = math.exp(7.3049974)
E = math.exp(0.6254804)

a = beta / (alpha + beta)
b = alpha / (alpha + beta)
G = pow((alpha * A) / (beta * B), 1/(alpha + beta))
# C = 9.3e21
# D_opt = (1 / G) * pow(C / 6, b)
# N_opt = G * pow(C / 6, a)
# print(f"D_opt: {'{:.2e}'.format(D_opt)}, N_opt: {'{:.2e}'.format(N_opt)}")

N = 8.7e9
D = 178e9
U_d = D / 7
U_n = min(pow(U_d*G, beta/alpha)*G, N)
R_n = max(N / U_n - 1, 0)
R_d = D / U_d - 1
R_nn = 5.309743
R_dd = 15.387756
L = E + (A / pow(U_n + R_nn * U_n * (1 - math.exp(-R_n / R_nn)), alpha)) + (B / pow(U_d + U_d*R_dd*(1 - math.exp(-R_d / R_dd)), beta))
print(f"Predicted loss: {L}")

The final output is 2.237666982866588 which is not close to 2.38 reference to the figure. I think there must be something wrong with the paramters, but I can not find it out. Could you please tell me what's wrong with my understanding of the scaling law?

The loss values predicted by the formula are unlikely to exactly match the final loss of the model.
This is because we borrow some of its parameters from the values put forth in Chinchilla, which were created using a different setup, some different hyperparameters (learning rate, schedule etc.) leading to different loss values (See Appendix B). However, the trend predicted by the formula is expected to be accurate, e.g. plugging in two model configurations to compare which one should have a better loss (as for Figure 1, right). Or if you e.g. modify U_d = D / 7 to U_d = D / 5 in your code, you will get a sense of how much your loss should improve relatively by having more unique data (e.g. relatively speaking U_d = D / 7 -> U_d = D / 5 gives a higher boost than U_d = D / 3 -> U_d = D / 1).
In Figure 5 left, the loss predictions from the formula are all shifted by a constant, such that they match with the actual loss at 100%. The point of this Figure is to show how well the trend matches not the actual predicted loss values. Hence the caption says Loss curves predicted by our data-constrained scaling laws are shifted to exactly match the loss at 100% unique data. , but maybe this isn't made clear enough. Let me know if you have an idea for making this clearer in the paper / the repo! 🧐

That's clear enough for me, thank you for your explanation!


Delete orphaned vali VPAs

How to categorize this PR?

/area logging
/kind bug
What this PR does / why we need it:
This PR deletes orphaned vali VPAs that used to be managed by the corresponding vali HVPA with label role: vali-vpa.
The vali deployment logic was refactored from helm chart into go components in https://github.com/gardener/gardener/pull/8061. This PR also incorrectly modified the selector and labels for the VPA managed by the vali HVPA from role: vali-vpa to role: valivpa (notice the missing dash). The change of the labels caused the hvpa controller to orphan the vpa with the role: vali-vpa label and create a new one with role: valivpa label. So until now there were two VPAs targeting the vali StatefulSets in garden namespace and each shoot control plane namespace.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Release note:

Added a cleanup function to `gardenlet` which is executed at startup and deletes orphaned VPAs with label `role: vali-vpa` that were previously managed by the HVPA deployed for `vali`.

/hold
I was testing this on an already existing cluster where I had the VPA crd deployed where gardenlet is installed. This doesn't work in all cases.

I was testing this on an already existing cluster where I had the VPA crd deployed where gardenlet is installed. This doesn't work in all cases.

I recall with @Kostov6 we had a similar case for https://github.com/gardener/gardener/pull/8912/files. We tackled it back then with https://github.com/gardener/gardener/pull/8912/files#diff-eb33ba906d976101dfe4f69a634d451fd48618d3bfdf57fe7401aca9e03b9bd8R474-R477

I recall with @Kostov6 we had a similar case for https://github.com/gardener/gardener/pull/8912/files. We tackled it back then with https://github.com/gardener/gardener/pull/8912/files#diff-eb33ba906d976101dfe4f69a634d451fd48618d3bfdf57fe7401aca9e03b9bd8R474-R477

I added a commit pretty quickly right before seeing your post. It now gets the CRD and checks if it exists or not. Would this also be ok?

Would this also be ok?

Sure, of course. This is anyways a cleanup code that will be removed in 3 releases. :)

/cc @nickytd

/lgtm


Broadcast input fields

Resolves
Does not resolve issues until it is merged into develop, but eventually (#1268). Currently merging into 'broadcast-messages' branch.
Proposed Changes
Broadcast blocks (namely 'broadcast' and 'broadcast and wait') now have pluggable inputs.
New messages can once again be created from the flyout (resolving the issue in #1270).
New messages created from a block in the flyout are created as variables in the flyout's target workspace, thus appearing in all broadcast block dropdown menus.
Default message1 is created when either:

the broadcast block dropdown menu is clicked for the first time OR
any broadcast block with 'message1' in its dropdown field is dragged out of the flyout and created on the workspace (this is not new functionality)

The assertion that shadows cannot have variables is no longer true, so the assertion statement has been removed. @rachel-fenichel, @paulkaplan, do either of you know off-hand why that assertion was there?
Reason for Changes
To maintain compatibility with Scratch 2.0 which allows blocks to be plugged into the broadcast block inputs.
Test Coverage
Existing tests pass.
Additional Notes
Currently proposing to merge these changes into a separate branch.
These changes should only be merged into develop after:

The functionality presented here has been discussed
Any requested changes have been made
Changes from upstream-blockly w.r.t. variables_by_id are merged in and the same desired functionality (end result of steps 1 and 2) works with those changes.
Corresponding PRs (mentioned below) also get merged in 'simultaneously'.

This PR depends on corresponding PRs in scratch-vm and scratch-gui:
LLK/scratch-gui#1033
LLK/scratch-vm#860

No variables in shadows: read this thread.

@rachel-fenichel, thanks for the pointer to the thread. That makes a lot of sense. I guess this should also factor into the discussion for #1290. If we explicitly disallow deletion/renaming for broadcast messages (not saying this is what will necessarily happen), would this then be a non-issue? e.g. Is deletion/renaming the only consideration we should make when deciding to have a field_variable in a shadow?

I think deletion/renaming is the only concern, but it includes implicit deletion/renaming.
Variable fields may now be better at creating variables at the right time, so maybe it's okay.  I would experiment with some of the workflows from that thread to see if anything ends up feeling too weird.

Right now I have no deletion of broadcast messages implemented at all (explicit or implicit), so testing that out will probably have to wait until we make a decision about what deletion behavior should be.

@paulkaplan Does it make sense to change this and corresponding PR's mentioned above to be against develop instead of these new separate branches ('broadcast-messages' branch)?
My original intuition for the separate branches was so that they would be a staging area for all of the new broadcast block changes (including merging in Rachel's changes from upstream blockly). I think this might not make sense anymore, since merging in Rachel's work will be a pretty substantial change/refactor anyways, and it's not planned for our current milestone.

Did you check for problems related to variables in shadows?


db: set a 30 second busy timeout

This uses a new feature exported by the go-sqlite3 binding to do
the timeout right in the database.
Signed-off-by: Serge Hallyn<EMAIL_ADDRESS>

Travis complains about go fmt


Add pages

Page

Blog(plain page)
About
Contact
404

Component
Layout

Page(for About page and Contact page)

+α

Add header nav testing with playwright

Not create 404 page now


first draft of HE 101

only a first draft but worried I won't have much time before late this weekend to continue -- don't want to block in case other's want to add in the meantime.
kept everything brief for now with the intend of adding more resources, especially papers, further down the line

only a first draft but worried I won't have much time before late this weekend to continue -- don't want to block in case other's want to add in the meantime.
kept everything brief for now with the intend of adding more resources, especially papers, further down the line

@mortendahl this is one of my absolute favorite pull requests of the day. Absolutely fantastic work!


How to protect wt-tracker from DDos attack?

I think in the same way as any other HTTP(S) service. Easy solution - get protection from your hosting provider. For example, I use OVH that offers free DDoS protection.

Cloudflare.

Cloudflare isn't good for WebSocket services. It has a rough limit on opened connections: https://support.cloudflare.com/hc/en-us/articles/200169466-Using-Cloudflare-with-WebSockets

No Cloudflare.

@mrlika I stand corrected, I didn't know they limited connections. Their docs are rather vague as to the 'actual' limits. Shame, I don't know why they'd do that.


Upgrade updater to newer node

To node ~14~ 18, or even node ~16~ 20.
There will probably be some bugs with sequelize and knex major version updates. See e.g. #2808

[ ] Scheduler
[ ] Worker

Related #3503


🐛 Changing camera device causes a crash if code scanner is being used

What's happening?
If the code scanner is being used via useCodeScanner(), then an insta-crash will happen on Android if you switch camera device (with useCameraDevice()).
At least this is the case on Android. I will take a look at iOS later today.
Logging output is from an Android 14 emulator. The error happens on a real device (Samsung S22 Ultra) too.
If it's of any help, the stack trace crash goes specifically to these lines of code (react-native-vision-camera@3.3.0):
com.mrousavy.camera.core.CameraSession.updateRepeatingRequest(CameraSession.kt:581)
com.mrousavy.camera.core.CameraSession.startRunning(CameraSession.kt:559)
com.mrousavy.camera.core.CameraSession.access$startRunning(CameraSession.kt:49) (just a trace to the class itself)
com.mrousavy.camera.core.CameraSession$configureFormat$1.invokeSuspend(CameraSession.kt:203)
Reproduceable Code
// Run this code to observe the error

import React, { useState, useEffect } from "react";
import { Button, StyleSheet, Text, View } from "react-native";
import { Camera, useCodeScanner, CameraPosition, useCameraDevice, useCameraPermission } from "react-native-vision-camera";

export default function SendCamera() {
  const [cameraType, setCameraType] = useState<CameraPosition>("back");
  const device = useCameraDevice(cameraType);
  const { hasPermission, requestPermission } = useCameraPermission();
  const codeScanner = useCodeScanner({
    codeTypes: ["qr"],
    onCodeScanned: (codes) => {}
  });

  useEffect(() => {
    if (hasPermission === false) {
      console.log("Does not have camera permission");
      requestPermission().catch(() => {});
    }
  }, [requestPermission, hasPermission]);

  const onCameraSwitchClick = () => {
    setCameraType(
      cameraType === "front"
        ? "back"
        : "front"
    );
  };

  if (!hasPermission) {
    return (<Text>Camera permission was denied</Text>);
  }

  if (!device) {
    return (<></>);
  }

  return (
    <>
      <Camera
        style={StyleSheet.absoluteFill}
        codeScanner={codeScanner}
        device={device}
        isActive={true}
      />
      <View style={{ marginTop: 100 }}>
        <Button title="flip" onPress={onCameraSwitchClick} />
      </View>
    </>
  );
};

Relevant log output
10-05 10:58:39.158  8996  8996 I CameraSession: Setting Format (fps: null | videoStabilization: null | hdr: null | lowLightBoost: null)...
10-05 10:58:39.160  8996  8996 I CameraOutputs: Preparing Outputs for Camera 10...
10-05 10:58:39.161  8996  8996 I CameraOutputs: Adding native preview view output.
10-05 10:58:39.180  8996  8996 I CameraOutputs: Adding 1280x720 code scanner output. (Code Types: [256])
10-05 10:58:39.181  8996  8996 I CameraOutputs: Prepared 2 Outputs for Camera 10!
10-05 10:58:39.182  8996  8996 I CameraSession: Setting isActive: true (isRunning: true)
10-05 10:58:39.183  8996  9160 I CameraSession: Starting Camera Session...
10-05 10:58:39.184  8996  9160 I CameraSession: Adding preview output surface PREVIEW..
10-05 10:58:39.184  8996  9160 I CameraSession: Adding code scanner output surface VIDEO
10-05 10:58:39.184  8996  9160 I CameraSession: Camera Session initialized! Starting repeating request..
10-05 10:58:39.189  8996 10177 D TransportRuntime.SQLiteEventStore: Storing event with priority=DEFAULT, name=FIREBASE_ML_SDK for destination cct
10-05 10:58:39.192  8996  9160 D CameraSession: Setting Repeating Request..
10-05 10:58:39.193  8996  8996 I PreviewView: Surface created! Surface(name=null)/@0xc9aeca7
10-05 10:58:39.193  8996  8996 I CameraView: Configuring Camera Device...
10-05 10:58:39.193  8996  8996 I CameraSession: Configuring Session for Camera 1...
10-05 10:58:39.194  8996  9160 E Camera-SurfaceUtils-JNI: SurfaceUtils_nativeGetSurfaceId: Could not retrieve native Surface from surface.
10-05 10:58:39.199  8996  8996 I CameraOutputs: Preparing Outputs for Camera 1...
10-05 10:58:39.199  8996  8996 I CameraOutputs: Adding native preview view output.
10-05 10:58:39.204  8996  8996 I CameraOutputs: Adding 1280x720 code scanner output. (Code Types: [256])
10-05 10:58:39.204  8996  8996 I CameraOutputs: Prepared 2 Outputs for Camera 1!
10-05 10:58:39.204  8996  8996 I SurfaceOutput: Closing BarcodeScanner..
10-05 10:58:39.204  8996  8996 I SurfaceOutput: Closing 1280x720 VIDEO ImageReader..
10-05 10:58:39.205  8996  8996 I PreviewView: Surface resized! Surface(name=null)/@0xc9aeca7 (1920 x 1080 in format #4)
10-05 10:58:39.226  8996  9184 E BufferQueueProducer: [SurfaceView[com.blixtwallet.debug/com.blixtwallet.MainActivity]#13(BLAST Consumer)13](id:23240000000d,api:4,p:416,c:8996) queueBuffer: BufferQueue has been abandoned
10-05 10:58:39.226   416  2268 E Surface : queueBuffer: error queuing buffer, -19
10-05 10:58:39.226   416  2268 E Camera3-OutputStream: returnBufferCheckedLocked: Stream 0: Error queueing buffer to native window: No such device (-19)
--------- beginning of crash
10-05 10:58:39.263  8996  9160 E AndroidRuntime: FATAL EXCEPTION: mrousavy/VisionCamera.main
10-05 10:58:39.263  8996  9160 E AndroidRuntime: Process: com.blixtwallet.debug, PID: 8996
10-05 10:58:39.263  8996  9160 E AndroidRuntime: java.lang.IllegalArgumentException: CaptureRequest contains unconfigured Input/Output Surface!
10-05 10:58:39.263  8996  9160 E AndroidRuntime: 	at android.hardware.camera2.CaptureRequest.convertSurfaceToStreamId(CaptureRequest.java:765)
10-05 10:58:39.263  8996  9160 E AndroidRuntime: 	at android.hardware.camera2.impl.CameraDeviceImpl.submitCaptureRequest(CameraDeviceImpl.java:1274)
10-05 10:58:39.263  8996  9160 E AndroidRuntime: 	at android.hardware.camera2.impl.CameraDeviceImpl.setRepeatingRequest(CameraDeviceImpl.java:1330)
10-05 10:58:39.263  8996  9160 E AndroidRuntime: 	at android.hardware.camera2.impl.CameraCaptureSessionImpl.setRepeatingRequest(CameraCaptureSessionImpl.java:313)
10-05 10:58:39.263  8996  9160 E AndroidRuntime: 	at com.mrousavy.camera.core.CameraSession.updateRepeatingRequest(CameraSession.kt:581)
10-05 10:58:39.263  8996  9160 E AndroidRuntime: 	at com.mrousavy.camera.core.CameraSession.startRunning(CameraSession.kt:559)
10-05 10:58:39.263  8996  9160 E AndroidRuntime: 	at com.mrousavy.camera.core.CameraSession.access$startRunning(CameraSession.kt:49)
10-05 10:58:39.263  8996  9160 E AndroidRuntime: 	at com.mrousavy.camera.core.CameraSession$configureFormat$1.invokeSuspend(CameraSession.kt:203)
10-05 10:58:39.263  8996  9160 E AndroidRuntime: 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
10-05 10:58:39.263  8996  9160 E AndroidRuntime: 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
10-05 10:58:39.263  8996  9160 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:958)
10-05 10:58:39.263  8996  9160 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:99)
10-05 10:58:39.263  8996  9160 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:205)
10-05 10:58:39.263  8996  9160 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:294)
10-05 10:58:39.263  8996  9160 E AndroidRuntime: 	at android.os.HandlerThread.run(HandlerThread.java:67)
10-05 10:58:39.263  8996  9160 E AndroidRuntime: 	Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@401273e, mrousavy/VisionCamera.main]
10-05 10:58:39.285   552  2215 W ActivityTaskManager:   Force finishing activity com.blixtwallet.debug/com.blixtwallet.MainActivity

Camera Device
N/A. Could provide if really needed. But the bug appears in Android emulators too

Device
Android 14 emulator
VisionCamera Version
3.3.0
Can you reproduce this issue in the VisionCamera Example app?
I didn't try (⚠ your issue might get ignored & closed if you don't try this)
Additional information

[ ] I am using Expo
[ ] I have enabled Frame Processors (react-native-worklets-core)
[X] I have read the Troubleshooting Guide
[X] I agree to follow this project's Code of Conduct
[X] I searched for similar issues in this repository and found none.

I wasn't sure if it's actually a dupe of #1773. The Javascript code here is different, though the stack trace seems to be the same.
Feel free to close.

Yea duplicate, but can you please post your reproduction steps (flipping Cam in code scanner) over in #1773? Thanks!


Low bandwidth for a data conversion program in HIP on an AMD GPU

Running a SYCL program on an NVIDIA GPU and an AMD GPU shows that the bandwidth is significantly low on an AMD GPU. Hence, the issue was initially posted (https://github.com/intel/llvm/issues/7195).
After converting the program from SYCL to HIP (https://github.com/zjin-lcf/HeCBench/tree/master/conversion-hip), I find that the bandwidth of the HIP program seems similar to that of the SYCL program. If the HIP program using hipMallocManaged() is not written properly, please let me know. Thanks.

@zjin-lcf  Hi, were you able to resolve this issue on the latest HIP? If so can we close this ticket?

No. Thanks.

@zjin-lcf An internal ticket has been opened to help resolve this issue. Could we have your OS, GPU, CPU versions?

Ubuntu 22.04, MI100, AMD EPYC 7272 processor

@zjin-lcf : The HIP reproducer mentioned in your initial post is no longer available. Can you please link to a simple HIP reproducer so that we can understand the issue.

Sorry. The link is updated.

@zjin-lcf : Thanks for the updated link. I see that you are using hipMallocManaged in your example. Can you share the output of rocminfo | grep amdgcn?
Also can you please set the environment variable AMD_LOG_LEVEL=4, rerun the reproducer and share the generated output trace?

amdgcn-amd-amdhsa--gfx908:sramecc+:xnack-
After the replacement, I observe significant BW increase.
I replaced MallocManaged with Malloc in the GPU programs in the repository. I think the programs are supposed to measure the conversion time only.
It seems that the impact of cudaMallocManaged on the execution time of the CUDA program is small. Thanks for your comments/suggestions.

amdgcn-amd-amdhsa--gfx908:sramecc+:xnack-
After the replacement, I observe significant BW increase.
I replaced MallocManaged with Malloc in the GPU programs in the repository. I think the programs are supposed to measure the conversion time only.
It seems that the impact of cudaMallocManaged on the execution time of the CUDA program is small. Thanks for your comments/suggestions.

@zjin-lcf : "amdgcn-amd-amdhsa--gfx908:sramecc+:xnack-" does not support managed memory. HIP runtime will fallback to allocating system memory that is made visible to all devices instead to keep the code functional. That is why you are seeing reduced performance and see better performance when using hipMalloc instead.

Ok. Is there a link that explains the difference between managed memory and system memory ?

system memory = host memory. It is the same as memory allocated using hipHostMalloc.


Show the username on the nav page

Pages need to be prettier, and not sure if I need all of that.
Copied and modified from harvest code


[BUG] ProgressChanged doesn't work

Describe the bug
I am not getting any errors. FileChanged works fine but ProgressChanged doesn't work
Environment (please complete the following information):

OS: Windows 10
CmlLib.Core Version: 3.3.5
.NET version: .NET Framework 4.7.2

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using CmlLib.Core;
using CmlLib.Core.Auth;
using CmlLib.Core.Downloader;

namespace Launcher_Test
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            Control.CheckForIllegalCrossThreadCalls = false;
        }

        private void Launcher_FileChanged(DownloadFileChangedEventArgs e)
        {
            listBox1.Items.Add(string.Format("[{0}] {1} - {2}/{3}", e.FileKind.ToString(), e.FileName, e.ProgressedFileCount, e.TotalFileCount));
            listBox1.TopIndex = listBox1.Items.Count - 1;
        }

        private void Launcher_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            Debug.WriteLine("test");
            progressBar1.Value = e.ProgressPercentage;
            loadingPercent.Text = e.ProgressPercentage + "%";
        }

        public static string version;

        private void path()
        {
            var path = new MinecraftPath();
            var launcher = new CMLauncher(path);
            foreach (var item in launcher.GetAllVersions())
            {
                versionComboBox.Items.Add(item.Name);
            }
        }

        private async Task launch()
        {
            System.Net.ServicePointManager.DefaultConnectionLimit = 256;

            var path = new MinecraftPath();
            var launcher = new CMLauncher(path);

            launcher.FileChanged += Launcher_FileChanged;
            launcher.ProgressChanged += Launcher_ProgressChanged;

            var launchOption = new MLaunchOption
            {
                MaximumRamMb = 1024,
                Session = MSession.GetOfflineSession(usernameTextBox.Text)
            };

            version = versionComboBox.Text;
            var process = await launcher.CreateProcessAsync(version, launchOption);

            process.Start();

        }

        private async void Form1_Load(object sender, EventArgs e)
        {
            path();
        }

        private async void button1_Click(object sender, EventArgs e)
        {
            await launch();
        }
    }
}

There are two types of progress: file checking progress and file download progress.
ProgressChanged indicates only 'download' progress. if launcher doesn't need to download any file, it does not fire ProgressChanged event.
On the other hand, FileChanged would always be fired since it indicates file checking progress and file download progress.
You can use Source property of DownloadFileChangedProgressArgs to distinguish between file checking progress and file download progress.
if (e.Source is IFileChecker)
{
  // file checking
}
else
{
  // file downloading
}


Azure Key Vault SKU - Pulumi uses "standard" whereas Azure is "Standard"

I've found myself in something of a catch 22! Pulumi allows you to specify "standard" for a key vault SKU (but not Standard") whereas Azure uses "Standard". I've worked around to make an import work by ignoring "sku" but would be great to manage properly with Pulumi. Any ideas?

I believe this is https://github.com/terraform-providers/terraform-provider-azurerm/issues/7254

Thanks @mikhailshilkov - is this a case of waiting for terraform to fix?

Yes... There is a PR open for several weeks but I'm not sure why it's not merged.

The upstream issue has been fixed a while ago, so closing this one too


Upgrading Electrs to 0.10.0-rc.1

Describe the issue
After command cargo clean there is error:
error: failed to parse manifest at /home/admin/rust/electrs/Cargo.toml
Caused by:
failed to parse the edition key
Caused by:
this version of Cargo is older than the 2021 edition, and only supports 2015 and 2018 editions.
Location in guide
Link to the corresponding page and section on https://raspibolt.org
Screenshots
If applicable, add screenshots to help explain your problem.
Environment

Hardware platform: Raspberry Pi 4
Operating system: Raspberry Pi OS 64bit, Debian 11
Version: Description:	Debian GNU/Linux 11 (bullseye)

Additional context
Cargo in Bullseye is 0.47.0-3+b1, in Bookworm is 0.66.0+ds1-1. Do we need wait for Raspberry Pi OS upgrade or can we do some manual intervention? For example: curl https://sh.rustup.rs -sSf | sh.

Ok today i will give a chance and I will change only sources for bookworm. Will see what will happen. I won't do dist-upgrade.

I need to move upgrading for tomorrow as for now I am copying entire blockchain to backup location as don't want to make initial blockchain download again.

i am givin up. i am even unable to make copy of blockchain as i can't stop effectively bitcoind. 'bitcoin-cli stop 'simply doesnt work and bitcoind is starting again automatically.

@luksocculta It's restarted automatically by systemd. Do sudo systemctl disable bitcoind and sudo systemctl stop bitcoind.

Thanks for detailed guide. Right now I am during making similar configuration of my Raspibolt on different machine and there I will test this. I wanted to simply change sources so thanks about that additional necessary steps.

On a test machine something went wrong with nginx.
sudo systemctl status nginx
× nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Fri 2023-06-30 23:06:45 CEST; 34s ago
Docs: man:nginx(8)
Process: 1378 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
CPU: 22ms
Jun 30 23:06:45 debian-acer systemd[1]: Starting nginx.service - A high performance web server and a reverse proxy server...
Jun 30 23:06:45 debian-acer nginx[1378]: 2023/06/30 23:06:45 [emerg] 1378#1378: unknown directive "stream" in /etc/nginx/nginx.conf:10
Jun 30 23:06:45 debian-acer nginx[1378]: nginx: configuration file /etc/nginx/nginx.conf test failed
Jun 30 23:06:45 debian-acer systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Jun 30 23:06:45 debian-acer systemd[1]: nginx.service: Failed with result 'exit-code'.
Jun 30 23:06:45 debian-acer systemd[1]: Failed to start nginx.service - A high performance web server and a reverse proxy server.
But I haven't mimic fully raspibolt configuration as I couldn't perform full blockchain download. But I think that doesn't matter for nginx so right now I dont know what went wrong.
After dist-upgrade I made apt autoremove and then if I good recall was removed something that depends for nginx.

so i made complete upgrade and everything seems to be ok. and there wasn't need for manual installation of libningx-mod-stream as it was installed during upgrade i think. seems like something went wrong on test machine.
only one moment was thrilling. during upgrading of dphys-swapfile terminal hangsout for more that 5 minutes. maybe more. and during all process of upgrading swap, which has 2GB,  was filled to the top . maybe should be doubled for upgrading.

i haven't overwritten any of my configuration files. for all of questions about new config files i answered 'N'. so still everything works normal. sure i still struggle with some things on my raspibolt but these are unrelated to upgrading to bookworm.

ots has broke after upgrading. so i did make 'sudo apt reinstall python3 python3-dev python3-pip python3-setuptools python3-wheel' and then 'sudo pip3 install opentimestamps-client --break-system-packages'.
now works fine.


Issue updating from libcxx 14.0.6 to libcxx 16.0.6 with micromamba

Comment:
I was trying to install a python stack today and it failed due to an issue with libcxx. To wit, I started with Miniconda3 23.5.2-0 for Intel Mac (Miniconda3-py311_23.5.2-0-MacOSX-x86_64.sh) and installed it. I then grabbed and installed micromamba as, for reasons I don't know, it's the only installer that works for me.
I also have a .condarc that looks like:
channels:
  - conda-forge
  - defaults
channel_priority: strict

to favor conda-forge.
After that, I first did a micromamba install libblas=*=*=mkl which worked, then micromamba install esmpy. One of the things this calls for I guess is an update to libcxx:
  Upgrade:
─────────────────────────────────────────────────────────────────────────────

  - libcxx           14.0.6  h9765a3e_0              pkgs/main        991kB
  + libcxx           16.0.6  hd57cbcb_0              conda-forge     Cached
  - openssl           3.0.9  hca72f7f_0              pkgs/main          5MB
  + openssl           3.1.1  h8a1eda9_1              conda-forge     Cached
  - libcurl           8.1.1  hf20ceda_1              pkgs/main        369kB
  + libcurl           8.1.2  hbee3ae8_0              conda-forge     Cached

but:
critical libmamba filesystem error: in copy_file: Not a directory ["/Users/mathomp4/installed/Core/GEOSpyD/23.5.2-0_py3.11/2023-07-14/include/c++/v1/__string/char_traits.h"] ["/Users/mathomp4/micromamba/pkgs/libcxx-16.0.6-hd57cbcb_0/include/c++/v1/__string/char_traits.h"]

And this is true, that is a file, not a directory:
❯ file /Users/mathomp4/installed/Core/GEOSpyD/23.5.2-0_py3.11/2023-07-14/include/c++/v1/__string
/Users/mathomp4/installed/Core/GEOSpyD/23.5.2-0_py3.11/2023-07-14/include/c++/v1/__string: c program text, ASCII text

And if I look at llvm, in 14.0.6 __string was a file, but in 16.0.6, it's a directory.
Is there perhaps some special command I need to pass to my package installer to allow this to work?
I can get it to work by using:
if [[ -f $INSTALLDIR/include/c++/v1/__string ]]
then
  rm $INSTALLDIR/include/c++/v1/__string
fi

before I know libcxx will be updated, but that seems ... not right to me.

Could you open this in mamba-org/mamba repo?

@isuruf You think it's a failure of mamba? If so, do you know how conda handles this? The fact that you'd replace a file with a directory?

Yeah, it's a failure of micromamba. I have no idea how conda handles this.

@isuruf Yeah. I just tried to do conda install esmpy on my machine and it just failed after about 10 minutes of trying to solve the dependency graph. At least micromamba can solve that in a few seconds. Okay. I'll close here and reopen there.


Problem with new parallel version

I am running the new code in Python 2.7.12 in Linux and I get the following error. In addition no image/description was downloaded:
$ python download_dataset.py
Collecting all images ids
Thread 0 started
Thread 1 started
downloading image (0/29)
downloading image (30/39)
url_image = https://isic-archive.com/api/v1/image/5436e3abbae478396759f0cf/download?contentDisposition=inline
...
downloading image (27/29)
url_image = https://isic-archive.com/api/v1/image/5436e3aebae478396759f105/download?contentDisposition=inline
downloading image (28/29)
url_image = https://isic-archive.com/api/v1/image/5436e3aebae478396759f107/download?contentDisposition=inline
Traceback (most recent call last):
File "download_dataset.py", line 95, in
download_dataset()
File "download_dataset.py", line 71, in download_dataset
print('Thread {0} finished'.format(thread._Thread__kwargs['thread_id']))
AttributeError: 'Thread' object has no attribute '_Thread__kwargs'

Thanks for bringing this up, i'm gonna check it soon :)

_Thread_kwargs is a protected class variable, and for some reason my program could access it but yours could'nt.
In any case instead of printing the "thread X finished" in the main program i moved it to be printed from inside the thread itself, which is also better from the code prospective because now it doesn't access protected variables :P
Could you give it a try and tell me if it works for you now? :)

Now is working even in Linux. I close the issue. Thanks.


Support for RTL languages

RTL languages, such as Persian, are rendered as though they are LTR text, and therefore appear disjointed as shown below.

Are there any plans to add support for RTL languages?
Many thanks.
Persian test text

Generally yes, RTL languages are something that I want to support eventually, but I'm not sure when I'll get around to it.
I will have to do more research on how they are implemented in TrueType first.
But, if they work the way I think they do, then there will be no changes to libschrift necessary -
It is likely just sftdemo (and any other application that uses libschrift) that has to be changed.
Things get complicated though if an application wishes to support mixed LTR and RTL text (which is very likely).
Then they will need an algorithm that swaps characters around until the entire text is completely LTR (or RTL).
For Unicode, this "BiDi" algorithm is standardized.
But just the reference implementation of that algorithm is two times as large as the entirety of libschrift...
By the way, thanks for the sample text.

Thank you for your reply and for your great work so far. I'm personally not bothered about LTR and RTL being mixed within the same text. But I wonder if that issue applies to numbers in Persian, which are written LTR within text that is RTL, as shown below.

بیش از ۹۰۰۰ است

The sample text is the poem Bani Adam written by Iranian poet Saadi in 1258. I sourced the text from https://en.wikipedia.org/wiki/Bani_Adam :slightly_smiling_face:

When you say disjoined, you mean that text shaping is missing right? Which instead really an RTL issue. RTL, without bidirectional text support, is simply solved by mirroring text without mirroring the glyphs, but text shaping is more involved.


Cleanup. Remove some deprecated type synonyms.

Description
This is just a cleanup PR. It takes care of a few things:

Remove deprecated type synonyms (node has already accounted for those): ValidatedTx, TxOut, TxBody, TxSeq, Script, Value, PParamDelta.
as Core  qualified import is not needed in most places due to removal of above deprcations
Stop importing Crypto qualified as CC. It no longer conflicts with recently renamed EraCrypto
Rename Cardano.Ledger.Shelley.Metadata module to Cardano.Ledger.Shelley.TxAuxData

There aren't really any semantic changes here. Just the cleanup
Checklist

[x] Commit sequence broadly makes sense
[x] Commits have useful messages
[x] New tests are added if needed and existing tests are updated
[x] Any changes are noted in the changelog
[x] Code is formatted with ormolu (which can be run with scripts/ormolise.sh
[x] Self-reviewed the diff

sorry for the force pushes, I accidentally pushed some changes onto your branch and then undid them :s

No worries.


Adding the specified count to the semaphore would cause it to exceed its maximum count

First off, I have to say, this wrapper is great, I've been using it with great success.
However at some point I had the need to fire off these Rest20 commands as async Tasks and I occasionally received an error in StreamSession.cs mentioning:

Adding the specified count to the semaphore would cause it to exceed its maximum count

I recognize these errors from when the database context of entity frame has not been properly disposed. However in this case there is no database context, so I am very curious as to what the reason could be and how I can fix it

Hi yAnn1ck,
First:
The OandaV20 code and repo is no longer supported.
Please migrate to OandaV20.2.
Second:
The Semaphore class is Not used within OkonkwoOandaV20 library.
Any issue(s) you may be experiencing may be due to your code or environment.
That said, the Semaphore class is used in the sample app, OkonkwoOandaV20App.
It is also used in the test project, OkonkwoOandaV20Test.
In both cases, the semaphore usage was inelegant and not intended for production.
Please refer to Microsoft docs at the link below on the Semaphore class for detailed information on the proper use of the Semaphore.
If you need further assistance, please provide a code snippet.
Thanks,
Chris

Good day mrchrisok,
Can you possibly indicate where OandaV20.2 can be found, I would like to migrate but I don't know where to find this repo....
Regards,
JvZ

OANDAV20.2 is available here: https://github.com/mrchrisok/OandaV20.2


Adding simplification for Sail instructions

I've found an easier way to add the correct privilege; I would add it here.

Oh; I've missed that one.
And merry Christmas for you too;)


Question: MaterialBox

Hello, this is just a question, not an issue :smile:
Does MaterialBox can have an array of images? To have a kind of slider inside of the lightbox?
Thank you for your help.

No I don't think so.
According to the media documentation, you can add a "lightbox" on each image of the slider, or make a fullscreen slider. But not directly use slider in the "lightbox".
Also, maybe there is some tricks to do it easily.

Thank you @rodriguez-loic :+1:

De rien :)


Add LeetCode 905. Sort Array By Parity

Link: https://leetcode.com/problems/sort-array-by-parity/

I would like to solve this problem .Please assign it to me.


Protocol error: expected '$', got '*' on large bulk SETs

Describe the bug
I have an application that very quickly inserts large number of SET commands with a large number of fields (22).
When i spin the application up i seem to be randomly receiving (quite frequently) the following error on the client
{
    "date": "2023-05-05T03:14:47.8818458Z",
    "level": "ERROR",
    "logger": "GpsWatcher.Handlers.GpsStreamMessageHandler",
    "message": "Server responded with failure to SET",
    "exception_type": "StackExchange.Redis.RedisConnectionException",
    "exception_message": "The message timed out in the backlog attempting to send because no connection became available (5000ms) - Last Connection Exception: SocketClosed (ReadEndOfStream, last-recv: 0) on tile38-leader.geofence.private:9851/Interactive, Flushed/MarkProcessed, last: UNKNOWN, origin: ReadFromPipe, outstanding: 4, last-read: 0s ago, last-write: 0s ago, unanswered-write: 0s ago, keep-alive: 60s, state: ConnectedEstablished, mgr: 9 of 10 available, in: 0, in-pipe: 0, out-pipe: 0, last-heartbeat: never, last-mbeat: 0s ago, global: 0s ago, v: <IP_ADDRESS>013, command=UNKNOWN, timeout: 5000, inst: 0, qu: 4942, qs: 1, aw: False, bw: CheckingForTimeout, rs: ReadAsync, ws: Idle, in: 0, in-pipe: 0, out-pipe: 0, last-in: 16, cur-in: 0, sync-ops: 0, async-ops: 3749559, serverEndpoint: tile38-leader.geofence.private:9851, conn-sec: 52.72, aoc: 0, mc: 1/1/0, mgr: 10 of 10 available, clientName: ip-10-134-72-142(SE.Redis-v<IP_ADDRESS>013), IOCP: (Busy=0,Free=1000,Min=1,Max=1000), WORKER: (Busy=31,Free=32736,Min=2,Max=32767), POOL: (Threads=31,QueuedItems=217,CompletedItems=7272029), v: <IP_ADDRESS>013 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)",
    "innerexception_type": "\nStackExchange.Redis.RedisConnectionException",
    "innerexception_message": "\n",
    "innerexception_method": "\n",
    "innerexception_stracktrace": "\n"
}

and the server is side spits out this error message.
Protocol error: expected '$', got '*'

It seems if i reduce the field count to 4, it has no problems processing it at all.
To Reproduce

Setup 1 Leader and 2 Followers
Create application to insert large number (24k per second) of SETs based on data like this.

SET devices 10315:SDSLJEN3:5100ffff-60b6-e4cd-ba9c-60a3e15b0000\\5100ffff-60b6-e4cd-baa0-60a3e15b0000\\5100ffff-60b6-e5cd-36f0-60a3e15b0000\\5100ffff-60b6-e5cd-0a69-60a3e15b0000\\5100ffff-60b6-e5cd-4a7a-60a3e15b00002 EX 85250 FIELD heading -1 FIELD speed 0 FIELD avgGpsSpeed 3 FIELD speedGpsMin 0 FIELD speedGpsMax 18 FIELD speedEcmAvg -1 FIELD speedEcmMin 0 FIELD speedEcmMax 0 FIELD group '5100ffff-60b6-e5cd-4a7a-60a3e15b0000' FIELD rootGroupId '5100ffff-60b6-e4cd-ba9c-60a3e15b0000' FIELD companyId 10315 FIELD vehicleId '9100ffff-48a9-e663-3e37-60a3e15b0000' FIELD deviceId '3500ffff-6b4a-aca7-76db-60a3e15b0000' FIELD assetId '00000000-0000-0000-0000-000000000000' FIELD stackId 5 FIELD modelNumber 'ER-SF300' FIELD eventRecorderTimezone 'EST' FIELD gpsTimeOfDay 81089 FIELD gpsDayOfWeek 4 FIELD gpsDayOfMonth 4 FIELD gpsMonth 5 FIELD serial 'SDSLJEN3' POINT 12.213 -82.234<PHONE_NUMBER>

Watch the server logs for errors to appear.

Expected behavior
I expect it not to error out.
Logs
Wish i had better ones.
Operating System (please complete the following information):

OS: Linux AWS ECS Fargate
CPU: AWS Fargate AMD64
Version: Latest
Container: Docker

Additional context
My client application is C# utilizing StackExchange.Redis Library.
Here is a sample of my set commands.
_redis.ExecuteAsync("SET", args).ContinueWith(x =>
                        {
                            if (x.IsFaulted)
                            {
                                _logger.LogError(x.Exception, "Server responded with failure to SET");
                            }
                        });

And this is how i'm connecting.
var opts = new ConfigurationOptions
            {
                AbortOnConnectFail = false,
                Ssl = false,
                Password = config.Password,
            };
            opts.EndPoints.Add(config.HostLeader, config.Port);

            _multiplexer = await ConnectionMultiplexer.ConnectAsync(opts);

I'm not entirely sure how Tile38 works under the covers but REDIS appears to define responses that start with * to indicate that the response is an array.
https://redis.io/docs/reference/protocol-spec/#:~:text=For Arrays%2C the first byte of the reply is "*"
Maybe something isn't expecting a response like that?

I think i've discovered the problem but i'm not sure what side the ultimate issue is on.
If i pass the FIELDS as anything other than a string to the ExecuteAsync() command in C# it will cause the error. If i convert the argument to a string before sending it, no error occurs.
ExecuteAsync("SET", "key", "id", "FIELD", 123, "POINT", 50.123, -123.241);

vs.
ExecuteAsync("SET", "key", "id", "FIELD", 123.ToString(), "POINT", 50.123.ToString(), -123.241.ToString());

Since the server side complains about protocol and the client side complains about timeouts, i'm guessing that StackExchange.Redis is encoding the payload in a way that Tile38 doesn't understand.

I'm going to go ahead and close this as there is a workaround for this.


Drop Namespace from manifests

This is required to pass OLM validations which require that namespaced resources do
not include explicit namespace settings. OLM automatically installs namespaced
resources in the same namespace that the operator is installed in, which is determined
at runtime, not bundle/packagemanifests creation time.
Signed-off-by: Dinar Valeev<EMAIL_ADDRESS>
Description of your changes

Fixes #
I have:

[ ] Read and followed Upbound's contribution process.
[ ] Run make reviewable to ensure this PR is ready for review.
[ ] Added backport release-x.y labels to auto-backport this PR, as appropriate.

How has this code been tested

 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.


(PDB-3384) Move package gc to a top-level cleanup step

Package GC was included in the 'other' cleanup step. As it could be somewhat
heavy, this moves it out to a separate "gc_packages" step that can be
explicitly triggered and monitored.

Test PASSed

CLA signed by all contributors.

Test PASSed

Test PASSed


Unexpected Webpack2 use merge

Given the following merge:
merge.smart({
  rules: [{
    test: /\.js$/,
    use: 'babel'
  }]
}, {
  rules: [{
    test: /\.js$/,
    use: 'coffee'
  }]
});

I would expect the following according to the what the Webpack1 examples seem to suggest in the README:
{
  rules: [{
    test: /\.js$/,
    use: 'coffee'
  }]
}

Instead I get:
{
  rules: [{
    test: /\.js$/,
    use: ['babel','coffee']
  }]
}

There doesn't seem to be a way to overwrite a string value in use as it always gets converted to an array and merged.

Yeah, good call. I'll add a test based on your excellent example and get this fixed. 👍

Even though the fix itself is simple, I realized this leads to more questions:

What should happen if the first use is a string and the latter is an array? Merging those as an array would seem sensible though replacing would feel valid too.
What should happen if both are arrays? Same idea here. This would behave like loaders.

It's that mixed case which is the tricky one. It's a little problematic use supports multiple types.

Here's an initial fix if you want to try it out btw:
diff --git a/src/join-arrays-smart.js b/src/join-arrays-smart.js
index 4934c50..5fd2eb8 100644
--- a/src/join-arrays-smart.js
+++ b/src/join-arrays-smart.js
@@ -39,6 +39,15 @@ function uniteRules(newRule, rule, strategy) {
     if (optionsKey) {
       rule[optionsKey] = newRule[optionsKey];
     }
+  } else if (newRule.use) { // newRule.use should override too
+    const optionsKey = newRule.options ? 'options' : newRule.query && 'query';
+
+    delete rule.loaders;
+    rule.use = newRule.use;
+
+    if (optionsKey) {
+      rule[optionsKey] = newRule[optionsKey];
+    }
   } else if ((rule.use || rule.loaders || rule.loader) && (newRule.use || newRule.loaders)) {
     const expandEntry = loader => (
       typeof loader === 'string' ? { loader } : loader
@@ -71,12 +80,16 @@ function uniteRules(newRule, rule, strategy) {
     switch (strategy) {
       case 'prepend':
         rule[loadersKey] = [
-          ...differenceWith(newEntries, entries, uniteEntries),
+          ...differenceWith(
+            newEntries, entries, uniteEntries
+          ),
           ...entries
         ].map(unwrapEntry);
         break;
       default:
-        rule[loadersKey] = unionWith(entries, newEntries, uniteEntries).map(unwrapEntry);
+        rule[loadersKey] = unionWith(
+          entries, newEntries, uniteEntries
+        ).map(unwrapEntry);
     }
   }

diff --git a/tests/merge-smart-tests.js b/tests/merge-smart-tests.js
index babb8bb..46fd7b4 100644
--- a/tests/merge-smart-tests.js
+++ b/tests/merge-smart-tests.js
@@ -138,6 +138,24 @@ function mergeSmartTest(merge, loadersKey) {
     assert.deepEqual(merge(a, result), result);
   });

+  it('should override use string values with ' + loadersKey, function () {
+    const a = {};
+    a[loadersKey] = [{
+      test: /\.js$/,
+      use: 'a'
+    }];
+    const result = {};
+    result[loadersKey] = [{
+      test: /\.js$/,
+      use: 'b'
+    }, {
+      test: /\.css$/,
+      use: 'b'
+    }];
+
+    assert.deepEqual(merge(a, result), result);
+  });
+
   it('should append loaders with ' + loadersKey, function () {
     const a = {};
     a[loadersKey] = [{

It overrides use no matter what and that should be fixed next if we can figure out good answers to the questions above.

There's one more case with use actually. It accepts an object. So mixed use with string/array/object should be thought about. It feels like that string/array case and probably goes through the same logic.

I would love to be able to configure this behavior via options to merge. In my use case, I am using a base config which is maintained by the community and I have some company-specific overrides/additions merged in via separate config files. Ideally, I never edit the community-maintained configs because I frequently pull in the latest updates to those. But there are cases here where I want the opposite of what the default merge strategy does.
Could merge accept a config such as:
{
    strategies: {
        use: 'replace' // | 'force-array' | 'default'
    }
}

Yeah. #64 feels related. At the very least I'll make it so that you can write something like module.rules.use to match and tweak the behavior.
Btw, I have API redesign going on at #61. It would make the implementation composable (easier to maintain, document, and use).

Thanks for the work on this! I'll hopefully be able to try out the above fix today.

I made a little fix. I think you should be able to use
const output = merge.smartStrategy(
  {
    'module.rules.use': 'replace'
  })(common, prod);

now to achieve the behavior you described.
Let's leave this issue open for now, though, as this needs careful thought. It would be tempting to drop smart merging in 3.0 as it's strategies that are valuable, not folding.

Just tested this with 2.5.0 using the approached shown in the previous comment. I am still seeing the previous behavior. Both use values are strings and they are getting merged into an array containing both.

@bmayen Ok, I'll check that tomorrow. There's something else biting. use is definitely complex to handle.

I pushed a fix for this. It's included in 2.6.0. Please open new issues if you run into troubles with the behavior.

Thank you! Will do.


Add shape kwarg to dask.array.arange.

This would be useful for examples since we often do:
arr = np.arange(100).reshape(10, 10)
darr = da.from_array(a, chunks=(5, 5)

but this is limited to arrays that fit in-memory since we have to create the numpy array first. I'd like something like:
darr = da.arange(100, shape=(10, 10), chunks=(5, 5))

I also do this a lot and find it kind of kludgy.  At the same time I'm concerned that adding a shape kwarg to arange makes a promise that we can not keep.

I think I'm -1 on this because it deviates from the NumPy API and doesn't satisfy the "works on out-of-core datasets" promise.  I'd like to close.

Closing in favor of a .reshape method.


HTTPException is unhandled in Flask-RESTful==0.3.6

Hi there! It seems to me like werkzeug.exceptions.HTTPException is not handled correctly in Flask-RESTful>0.3.3
Would love to know what I am doing wrong in the following application:
from flask import Flask
from flask_restful import Resource, Api
from werkzeug.exceptions import HTTPException

class ApiError(HTTPException):
    def __init__(self, message=None):
        self.message = message
        self.code = 400

ERRORS = {
    'ApiError': {
        'message': "A user with that username already exists.",
        'status': 409,
    }
}

class Fail(Resource):
    def get(self):
        raise ApiError("This will fail weirdly")

app = Flask(__name__)
api = Api(app, errors=ERRORS)
api.add_resource(Fail, '/fail')

Works as expected with Flask-RESTful==0.3.3
When run in the with Flask-RESTful 0.3.3 environment, it returns the expected response:
Working requirements file:
Flask==1.0.2
Flask-RESTful==0.3.3

I receive the expected response:
$ curl http://<IP_ADDRESS>:5000/fail
{"status": 409, "message": "A user with that username already exists."}

Fails with Flask-RESTful==0.3.6
Failing requirements file:
Flask==1.0.2
Flask-RESTful==0.3.6

Unexpected response:
$ curl http://<IP_ADDRESS>:5000/fail
{"message": "Internal Server Error"}

Trackback:
[2018-10-16 23:01:02,261] ERROR in app: Exception on /fail [GET]
Traceback (most recent call last):
  File ".../lib/python2.7/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File ".../lib/python2.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File ".../lib/python2.7/site-packages/flask_restful/__init__.py", line 273, in error_router
    return original_handler(e)
  File ".../lib/python2.7/site-packages/flask/app.py", line 1695, in handle_user_exception
    assert exc_value is e
AssertionError

Note that Flask-RESTful==0.3.6 works if I use the builtin Exception class instead of HTTPException above. Any ideas on how I could work around this to continue using HTTPException?
Thanks!
James

0.3.7 (via b47780a) has been released. Please verify that the bug has been fixed and update this issue.

I had same problem with 0.3.6 and after upgrade to 0.3.7 I get following HTML output instead of expected JSON response:
`
None Unknown Error
Unknown Error
`

I tried replicating the issue, couldnt replicate. Can we close the issue?

@viveksoundrapandi @labeneator I can still reproduce this error with Flask-RESTful==0.3.7. When running in python 2, I get the same traceback I noted above:
    response = self.full_dispatch_request()
  File ".../virtualenvs/flask-restful-test/lib/python2.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File ".../virtualenvs/flask-restful-test/lib/python2.7/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File ".../virtualenvs/flask-restful-test/lib/python2.7/site-packages/flask/app.py", line 1695, in handle_user_exception
    assert exc_value is e
AssertionError```

When running in python 3, I get a different error:

```  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
    return self.finalize_request(rv)
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1967, in finalize_request
    response = self.make_response(rv)
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2116, in make_response
    rv = self.response_class.force_type(rv, request.environ)
  File "/usr/local/lib/python3.7/site-packages/werkzeug/wrappers/base_response.py", line 269, in force_type
    response = BaseResponse(*_run_wsgi_app(response, environ))
  File "/usr/local/lib/python3.7/site-packages/werkzeug/wrappers/base_response.py", line 26, in _run_wsgi_app
    return _run_wsgi_app(*args)
  File "/usr/local/lib/python3.7/site-packages/werkzeug/test.py", line 1119, in run_wsgi_app
    app_rv = app(environ, start_response)
  File "/usr/local/lib/python3.7/site-packages/werkzeug/exceptions.py", line 193, in __call__
    response = self.get_response(environ)
  File "/usr/local/lib/python3.7/site-packages/werkzeug/exceptions.py", line 179, in get_response
    if self.response is not None:
AttributeError: 'ApiError' object has no attribute 'response'

Hello there,
I do reproduce the same issue using blueprints, flask-restful 0.3.6 or 0.3.7 combined with flask_jwt_extended and associated decorator.
The basic app looks like this:
App:
import os
from flask import Flask, jsonify, request
from flask_jwt_extended import JWTManager, create_access_token, jwt_required
from flask_restful import Resource, Api

def init_app():
  config_name = os.environ.get('FLASK_CONFIG', 'dev')

  app = Flask(__name__)

  app.config.from_object('config_' + config_name)

  jwt = JWTManager(app)

  @app.route('/login', methods=['POST'])
  def login():
    if not request.is_json:
      return jsonify({"msg": "Missing JSON in request"}), 400

    username = request.json.get('username', None)
    password = request.json.get('password', None)
    if not username:
      return jsonify({"msg": "Missing username parameter"}), 400
    if not password:
      return jsonify({"msg": "Missing password parameter"}), 400

    if username != 'test' or password != 'test':
      return jsonify({"msg": "Bad username or password"}), 401

    # Identity can be any data that is json serializable
    access_token = create_access_token(identity=username)
    return jsonify(access_token=access_token), 200

  # API object handler
  from .entities import entities_pb
  app.register_blueprint(entities_pb)

  return app

Blueprint:
from flask import Blueprint
from flask_jwt_extended import jwt_required, get_jwt_identity
from flask_restful import Api, Resource, url_for

entities_pb = Blueprint('entities', __name__)
entities = Api(entities_pb)

class EntitiesList(Resource):
  method_decorators = [jwt_required]

  def error_router(self, original_handler, e):
    return original_handler(e)

  def get(self):
    return {
      'entity1': 'entity1 name',
      'entity2': 'entity2 name',
      'entity3': 'entity3 name'
    }

  def post(self):
    args = parser.parse_args()
    return {'entity': 'entity name'}, 200

entities.add_resource(EntitiesList, '/entities')

This result in the following error as soon as the authentication token is not provided:
python manage.py runserver
 * Serving Flask app "app" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on http://<IP_ADDRESS>:5000/ (Press CTRL+C to quit)
[2019-12-30 15:03:59,313] ERROR in app: Exception on /entities [GET]
Traceback (most recent call last):
  File "/home/asavin/Repositories/mordekaiser/venv/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/asavin/Repositories/mordekaiser/venv/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/asavin/Repositories/mordekaiser/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 458, in wrapper
    resp = resource(*args, **kwargs)
  File "/home/asavin/Repositories/mordekaiser/venv/lib/python3.7/site-packages/flask/views.py", line 89, in view
    return self.dispatch_request(*args, **kwargs)
  File "/home/asavin/Repositories/mordekaiser/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 573, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/home/asavin/Repositories/mordekaiser/venv/lib/python3.7/site-packages/flask_jwt_extended/view_decorators.py", line 107, in wrapper
    verify_jwt_in_request()
  File "/home/asavin/Repositories/mordekaiser/venv/lib/python3.7/site-packages/flask_jwt_extended/view_decorators.py", line 32, in verify_jwt_in_request
    jwt_data, jwt_header = _decode_jwt_from_request(request_type='access')
  File "/home/asavin/Repositories/mordekaiser/venv/lib/python3.7/site-packages/flask_jwt_extended/view_decorators.py", line 314, in _decode_jwt_from_request
    raise NoAuthorizationError(errors[0])
flask_jwt_extended.exceptions.NoAuthorizationError: Missing Authorization Header
<IP_ADDRESS> - - [30/Dec/2019 15:03:59] "GET /entities HTTP/1.1" 500 -

Surprisingly, activating the debug in Flask configuration file trigger the proper behavior:
python manage.py runserver
 * Serving Flask app "app" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: on
 * Running on http://<IP_ADDRESS>:5000/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 255-986-277
<IP_ADDRESS> - - [30/Dec/2019 15:41:40] "GET /entities HTTP/1.1" 401 -

Hope this help in the resolution of this issue.
Kind regards

Hello,
Digging into this issue a little bit more, I believe that at least in my case the issue is within the flask-restful error_router method which is not handling correctly all raised errors.
I'm currently using a different work-around excluding JWT raised errors:
class FixedApi(Api):
  def error_router(self, original_handler, e):
    if not isinstance(e, PyJWTError) and not isinstance(e, JWTExtendedException) and self._has_fr_route():
      try:
        return self.handle_error(e)
      except Exception:
        pass  # Fall through to original handler
    return original_handler(e)

I hope this will help.
Kind regards

Can we know when will this be fixed?

Hello,
Digging into this issue a little bit more, I believe that at least in my case the issue is within the flask-restful error_router method which is not handling correctly all raised errors.
I'm currently using a different work-around excluding JWT raised errors:
class FixedApi(Api):
  def error_router(self, original_handler, e):
    if not isinstance(e, PyJWTError) and not isinstance(e, JWTExtendedException) and self._has_fr_route():
      try:
        return self.handle_error(e)
      except Exception:
        pass  # Fall through to original handler
    return original_handler(e)

I hope this will help.


Make heuristic score sorting robust in 1q optimization pass

Summary
In #8197 the Optimize1qGatesDecomposition was updated to be target aware and as part of that a new heuristic scoring was added to determine which decomposition was the best performing and should be used. However, in the case of an error rate of 0.0 the desired behavior was to pick the decomposition which was shortest. In #8197 this was accomplished by just doing -100 + len(decomposition) which worked in the general case as long as the gate counts are < 100 (which in practice will always be the case). For robustness this changes the return for the scoring function to be (error_rate, sequence_length) to give us the sorting without changing the measured error rate.
Details and comments

I baked this into a larger refactor of this pass in #9578 so we can close this PR as it's not needed anymore.


Fixed editor settings disappearing.

Some items that are no longer defined may disappear, but thats expected i guess.
closes #12463

It doesn't fix the bug, and the console is spammed with errors:
$ ERROR: set_initial_value: Condition ' !props.has(p_name) ' is true.
   At: editor/editor_settings.cpp:1216.
ERROR: set_initial_value: Condition ' !props.has(p_name) ' is true.
   At: editor/editor_settings.cpp:1216.

Well that's only for the first run without a pre-existing settings file. Subsequent runs don't show the errors, on the other hand the bug is still there for various settings:

(revertable editor language is fine, it's the only setting I changed)

(and also mono/builds/build_tool but I've reverted it already in this example so the setting disappeared, I can't show it).

@akien-mga most of the settings you mentioned are changed by the system, even if you dont notice, for example, the window bounds (thats the way it remembers them), and also the editor colors (thats caused by the adaptive theme, it has to be that way), the other settings im not sure, they might not be properly initialized, i will take a look, also i think i will make the unused settings hidden, so if you reactivate them, they still have their last value.

updated, the only missing one was mono/editor, the rest of the settings are changed during excecution, like the text editor colors or the subwindow size and position


test When Load ends, check memory tracker value returns is equal to 0

Check all memory is freed when Load is finished.

run buildall

run buildall

run buildall

run buildall

run buildall

run buildall

run buildall

run buildall

run buildall

run buildall

run buildall

run buildall


Revert "Propagate ClusterID to Cloud Map & Endpoints (#165)"

This reverts commit 0354a3d494219b297ae8d8624c2877b9b50237e4.
Issue #, if available:
Description of changes:
Breaking change of cluster ID / cluster set ID requirements causing integration test failure.
Also need documentation updates for new requirements.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Codecov Report

Merging #173 (aa46d36) into main (0354a3d) will increase coverage by 1.86%.
The diff coverage is 66.66%.

@@            Coverage Diff             @@
##             main     #173      +/-   ##
==========================================
+ Coverage   72.65%   74.52%   +1.86%
==========================================
  Files          15       15
  Lines        1558     1480      -78
==========================================
- Hits         1132     1103      -29
+ Misses        342      300      -42
+ Partials       84       77       -7

Impacted Files
Coverage Δ

...kg/controllers/multicluster/cloudmap_controller.go
45.68% <ø> (+0.44%)
:arrow_up:

...ntrollers/multicluster/serviceexport_controller.go
40.82% <ø> (+0.82%)
:arrow_up:

pkg/model/types.go
71.20% <ø> (+3.01%)
:arrow_up:

pkg/cloudmap/client.go
76.85% <50.00%> (+0.24%)
:arrow_up:

integration/janitor/api.go
78.57% <100.00%> (ø)

pkg/cloudmap/api.go
82.80% <100.00%> (+1.47%)
:arrow_up:

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 0354a3d...aa46d36. Read the comment docs.

Fixed Integration Tests in #178


Include an OAuth server

Is that a feature you'd be interested in including in this project? The lepture/authlib project looks like it would be a good place to start. A lot of apps are able to get user data from OAuth, and covering both LDAP and OAuth covers a large segment of potential downstream apps.
It would also be nice to support OpenID Connect once authlib's support for it is in stable.

Great Idea tho i have no experience with it yet.
I definitely want to clean up everything else first and integrate all glauth features.

Well that's why I was asking if it was a feature you'd be interested in. I'll take a crack at it.

please go ahead :) having some integrated upon my own code would be great.
Like i said in the readme, this is a bit of a learning project for me so if you can please add a lot of comments ;)

I've been working on converting https://github.com/authlib/example-oidc-server into a blueprint this app can use.
This work is taking place here: https://github.com/traverseda/glauth-ui/tree/OpenId
I'm think I've got the basic routing and stuff working, but I'm having a bit of trouble getting database migrations to work. I don't have a lot of experience with docker and I don't have a good workflow for running the migration generator in docker and getting the results back in to the git repo.
Sorry for the relative lack of comments, but at this point I am just bringing in the example app.

I'm think I've got the basic routing and stuff working, but I'm having a bit of trouble getting database migrations to work. I don't have a lot of experience with docker and I don't have a good workflow for running the migration generator in docker and getting the results back in to the git repo.

Why do you have to run the migration generator in docker (flask db migrate)? As far as i thought you can create those in your dev environment and then docker will migrate its db using the flask db upgrade command in boot.sh if its not the latest version.
But i had some problems with this before even without docker which were related to sqlite. Hope i have some time tomorrow to check out you work.

I'm pretty consistently getting sqlite3.OperationalError: unable to open database file when I try to run it outside of docker.
I set SQLALCHEMY_DATABASE_URI to sqlite:////tmp/test.db and it's still happening. Not sure what's up with that, but it does seem to need to be able to read the existing db in order to make migrations.

Hmm is this in absolute path?
My development db is in a db subfolder of my venv like in docker so im just using the default values..


Config info & updates

Fixes issue when new categories are saved to DB but their full display name doesn't display in dropdown
ATT&CK v12 changes to attack_dict.json
Provided info on where to submit config (list) changes
HTML tidy-up removing .btn-md class

Discussed and merged.


Add note for firewall when no ssdp/udp pakets are received

Perhaps Firewall related issue, like on my test system.
No ssdp message is received when firewall is enabled.
Even with socat:
socat UDP4-RECVFROM:1900,ip-add-membership=<IP_ADDRESS>:<IP_ADDRESS>,fork,reuseaddr -

After disabling the firewall, it works.
OS: CentOS 8 Stream
Something to read:
https://unix.stackexchange.com/questions/19060/fedora-firewall-with-upnp
https://unix.stackexchange.com/questions/625969/upnp-with-firewalld
TODO:

[ ] Test on local prod system (Rocky Linux 9.1, firewall disabled)
[ ] Document firewall rule to fix this

https://unix.stackexchange.com/questions/732565/ssdp-udp-multicast-on-fresh-installation-not-working