Hack some way to dispatch on number of dimensions of numpy/jax arrays

It would be nice (even though admittedly hacky) if we could dispatch on the number of dimensions of a jax/numpy array, which can be probed with .ndim on an instance.
This is admittedly not part of the type information in python, but maybe we can hack it in?
I was thinking of creating a custom parametric type for signatures, but then the problem is resolving the call signature and bringing this information from the value domain to the type domain.
This happens in parametric.py if I am not mistaken, and would require changing this function to allow hacking in some custom types...
Do you have any idea on what would be the best way to implement this?
def type_of(obj):
    """Get the Plum type of an object.

    Args:
        obj (object): Object to get type of.

    Returns
        ptype: Plum type of `obj`.
    """
    if isinstance(obj, list):
        return List(_types_of_iterable(obj))

    if isinstance(obj, tuple):
        return Tuple(*(type_of(x) for x in obj))

    return ptype(type(obj))

Hey @PhilipVinc,
Sorry for not getting back to this earlier. I'm a bit busy at the moment.
I fully agree that being able to dispatch on the dimensionality of an array would be an amazing feature to have. Your proposed solution seems like something that could be made to work.
Here's one way of doing this. First, we make type_of extendable by using dispatch.
@_dispatch
def type_of(obj):
    """Get the Plum type of an object.

    Args:
        obj (object): Object to get type of.

    Returns
        ptype: Plum type of `obj`.
    """
    if isinstance(obj, list):
        return List(_types_of_iterable(obj))

    if isinstance(obj, tuple):
        return Tuple(*(type_of(x) for x in obj))

    return ptype(type(obj))

Then this is possible:
import numpy as np
from plum import dispatch, parametric, type_of

@parametric
class NPArray(np.ndarray):
    pass

@type_of.dispatch
def type_of(x: np.ndarray):
    return NPArray[x.ndims]

@dispatch
def f(x: NPArray[1]):
    print("Vector!")

@dispatch
def f(x: NPArray[2]):
    print("Matrix!")

# Plum currently avoids unnecessary `type_of` calls. We would enable the use
# of `type_of` by default. Here's a hack that works for now:
f._parametric = True

This would be the outcome:
>>> f(np.random.randn(5))
Vector!

>>> f(np.random.randn(5, 5))
Matrix!

>>> f(np.random.randn(5, 5, 5))
NotFoundLookupError: For function "f", signature Signature(plum.parametric.NPArray[3]) could not be resolved.

These extensions might be best off in LAB. For example, you would then import lab.jax as B and def f(x: B.JAXArray[2]) or def f(x: B.Array[2]).
How does this sound?

I've made the above change in the most recent release, 1.1.1., and added an entry to the README. I'll leave this issue open and close it once good implementations of backend-specific array types (like JAXArray[1]) are available.

Somewhat related to the above; do you consider it feasible/possible/desirable to be able to dispatch on the basis of (a computable subset of) the value of arguments? Im trying to do something akin (though not literally identical) to dispatch based on array shape. In practice, a finite amount of concrete shapes would be in play; but I cant enumerate them upfront, since it depends on the use of the library. That is, id like to match my method dispatch on a computable function of such a hashable type (such as a shape).
@dispatch(property=lambda x: x.shape, condition=lambda s: s < (3, 4, 5))
def f(x: np.ndarray):
    print("This array has shape smaller than (3, 4, 5)")

Yeah... im not seeing any other libraries that dispatch in any way on object value; just purely on type (this example of dispatching based on array dimension is the first example im seeing to the contrary).
So either this is a great idea; or one thats going to blow up in your face once you think about it more / work with it more?
For the use case I have in mind, the hashable attribute is defacto a dynamic extension of the typing system though; and while my use case isnt precisely identical to dispatching based on array shape; I can infact think of plenty of legitimate uses for that as well (say, specializing a 2d/3d cross product or small matrix determinants).
Certainly in many array based languages, the shape of the array is effectively regarded as part of the type description. But some syntax to more flexibly match ranges of values (or general computable functions thereof), rather than just single types, or collections thereof, would be a requirement for me; and I suppose something that isnt currently covered by plum yet from what I can tell.

Hey @PhilipVinc and @EelcoHoogendoorn,
Ah @PhilipVinc says, I think this might be challenging, but it could conceivably be done.
I've hacked something very quick together. Would something like the below be what you're after?
import numpy as np

from plum import dispatch, parametric, type_of
from plum.parametric import CovariantMeta

class DynamicTypeParameter:
    """A type parameter which contains a function `check` which can check whether
    another type parameter is a type subparameter."""

    def __init__(self, parameter, check):
        self.parameter = parameter
        self.check = check

    def __str__(self):
        return str(self.parameter)

    def __repr__(self):
        return repr(self.parameter)

_original_is_sub_type_parameter = CovariantMeta._is_sub_type_parameter

def _new_is_sub_type_parameter(cls, par_cls, subclass, par_subclass):
    # Resolve dynamic type parameter for the parent class.
    if len(par_cls) == 1 and isinstance(par_cls[0], DynamicTypeParameter):
        par_check = par_cls[0].check
        par_parameter = (par_cls[0].parameter,)
    else:
        par_check = None

    # Resolve dynamic type parameter for the subclass.
    if len(par_subclass) == 1 and isinstance(par_subclass[0], DynamicTypeParameter):
        par_subclass = (par_subclass[0].parameter,)

    if par_check:
        # Use the dynamic check.
        return par_check(*par_subclass)
    else:
        return _original_is_sub_type_parameter(cls, par_cls, subclass, par_subclass)

CovariantMeta._is_sub_type_parameter = _new_is_sub_type_parameter

@parametric(runtime_type_of=True)
class _NPArray(np.ndarray):
    """A type for NumPy arrays where the type parameter specifies the number of
    dimensions."""

class _NPArrayClass:
    """Just some sugar to make indexing with square bracket work."""

    def __getitem__(self, shape):
        def check_subshape(other_shape):
            try:
                other_shape = tuple(other_shape)
            except TypeError:
                return False
            return len(other_shape) == len(shape) and all(
                s1 <= s2 for s1, s2 in zip(other_shape, shape)
            )

        return _NPArray[DynamicTypeParameter(shape, check_subshape)]

NPArray = _NPArrayClass()

@type_of.dispatch
def type_of(x: np.ndarray):
    # Hook into Plum's type inference system to produce an appropriate instance of
    # `NPArray` for NumPy arrays.
    return NPArray[x.shape]

@dispatch
def f(x: NPArray[(10,)]):
    return "vector of (10,)"

@dispatch
def f(x: NPArray[(10, 20)]):
    return "matrix of (10, 20)"

print(f(np.random.randn(8)))
# vector of (10,)

print(f(np.random.randn(11)))
# For function "f", signature Signature(__main__._NPArray[(11,)]) could not be resolved.

print(f(np.random.randn(8, 18)))
# matrix of (10, 10)

print(f(np.random.randn(8, 22)))
# NotFoundLookupError: For function "f", signature Signature(__main__._NPArray[(8, 22)]) could not be resolved.

Hey @wesselb ; thats looking pretty neat. The ability to specify some kind of computable matching function is quite critical for my actual application though. Though I suppose that would be a significant departure from the current syntax, as parsed from the type annotations of the signature itself.
Still; one could imagine parsing the signature as the default; which would correspond to a more flexible syntax as illustrated by the below (where attribute maps from the input to a hashable attribute of the input, and condition from said attribute to a bool):
@dispatch(attribute=lambda x: type(x), condition=lambda a == int)
def f(x):
    print("This is an int")
# the above could be seen as a verbose form of the below
@dispatch
def f(x: int):
    print("This is an int")

I was wondering if this is considered bad style; but according to wikipedia: https://en.wikipedia.org/wiki/Multiple_dispatch

Multiple dispatch or multimethods is a feature of some programming languages in which a function or method can be dynamically dispatched based on the run-time (dynamic) type or, in the more general case, some other attribute of more than one of its [arguments](https://en.wikipedia.org/wiki/Parameter_(computer_programming)).

So its not unheard of... even if it havnt seen it in the python ecosystem before.

The ability to specify some kind of computable matching function is quite critical for my actual application though.

Would something like how the example works suffice, or would you need something more flexible? To clarify, in the example, the second argument to DynamicTypeParameter is a function which checks if a given type parameter is a type subparameter. This is the relevant bit of the example:
...
        def check_subshape(other_shape):
            try:
                other_shape = tuple(other_shape)
            except TypeError:
                return False
            return len(other_shape) == len(shape) and all(
                s1 <= s2 for s1, s2 in zip(other_shape, shape)
            )

        return _NPArray[DynamicTypeParameter(shape, check_subshape)]
...

It is true that all information would have to be contained in the type parameter of the object, which is more limited than the general case which you outline where the function could take in the object itself.

I was wondering if this is considered bad style, to dispatch based on the object value; but according to wikipedia: (...)

This is really interesting. I think one could conceivably hack this together, but it might be challenging to make it really work well. For example, at the moment, types are hashable, which enables caching, and caching is crucial to obtain reasonable performance. If you use an arbitrary function to check whether an object belongs to the type family, then caching in this way wouldn't be possible anymore, because the object might not be hashable. If the object were hashable, then you could make it part of the type parameter and use the approach from the example; perhaps such a halfway house might be reasonable solution?

Would something like how the example works suffice, or would you need something more flexible?

Yeah; id need something more flexible.

types are hashable

Yeah; in my example I also meant for the 'attribute' lambda to return some hashable, 'type-like' information attribute of the object. A shape or dimension of an array would qualify, as being immutable type-like descriptors of the underlying raw array. The dtype of the array itself would qualify as well, obviously, even if not part of the 'type' on the level of the python type system.
But there are other use-cases for imbuing array elements with various type-like annotations beyond just their dtype; perhaps physical units, or in the case I have in mind, blades/grades of a geometric-algebra. Those hashable blade-descriptor objects would be quite involved objects themselves, with a variety of computable properties, on the basis of which we would want to specialize our function dispatch.

Hmm, perhaps I'm misunderstanding, but I think what you're after is possible in the setup of the example. E.g., what about something like the following?
from plum import dispatch, parametric, type_of
from plum.parametric import CovariantMeta

class DynamicTypeParameter:
    """A type parameter which contains a function `check` which can check whether
    another type parameter is a type subparameter."""

    def __init__(self, check, parameter=None):
        self.check = check
        self.parameter = parameter

    def __str__(self):
        return str(self.parameter)

    def __repr__(self):
        return repr(self.parameter)

_original_is_sub_type_parameter = CovariantMeta._is_sub_type_parameter

def _new_is_sub_type_parameter(cls, par_cls, subclass, par_subclass):
    # Resolve dynamic type parameter for the parent class.
    if len(par_cls) == 1 and isinstance(par_cls[0], DynamicTypeParameter):
        par_check = par_cls[0].check
        par_parameter = (par_cls[0].parameter,)
    else:
        par_check = None

    # Resolve dynamic type parameter for the subclass.
    if len(par_subclass) == 1 and isinstance(par_subclass[0], DynamicTypeParameter):
        par_subclass = (par_subclass[0].parameter,)

    if par_check:
        # Use the dynamic check.
        return par_check(*par_subclass)
    else:
        return _original_is_sub_type_parameter(cls, par_cls, subclass, par_subclass)

CovariantMeta._is_sub_type_parameter = _new_is_sub_type_parameter

@parametric
class DynamicallyTypedObject:
    def __init__(self, obj):
        self.obj = obj

    @classmethod
    def __infer_type_parameter__(cls, obj):
        # Use the object itself as the type parameter.
        return obj

@dispatch
def f(x: DynamicallyTypedObject[
        DynamicTypeParameter(check=lambda p: hasattr(type(p), "__len__") and len(p) <= 10)
    ]):
    print("Method for `len(x) <= 10`!")

import torch  # Use PyTorch, because NumPy arrays cannot be hashed.

f(DynamicallyTypedObject(torch.ones(5)))
# Method for `len(x) <= 10`!

f(DynamicallyTypedObject(torch.ones(15)))
# NotFoundLookupError

We can add some sugar on top of this to make sure that it behaves like your proposal of @dispatch:
import numpy as np
from functools import wraps

from plum import dispatch, parametric, type_of
from plum.parametric import CovariantMeta

class DynamicTypeParameter:
    """A type parameter which contains a function `check` which can check whether
    another type parameter is a type subparameter."""

    def __init__(self, check, parameter=None):
        self.check = check
        self.parameter = parameter

    def __str__(self):
        return str(self.parameter)

    def __repr__(self):
        return repr(self.parameter)

_original_is_sub_type_parameter = CovariantMeta._is_sub_type_parameter

def _new_is_sub_type_parameter(cls, par_cls, subclass, par_subclass):
    # Resolve dynamic type parameter for the parent class.
    if len(par_cls) == 1 and isinstance(par_cls[0], DynamicTypeParameter):
        par_check = par_cls[0].check
        par_parameter = (par_cls[0].parameter,)
    else:
        par_check = None

    # Resolve dynamic type parameter for the subclass.
    if len(par_subclass) == 1 and isinstance(par_subclass[0], DynamicTypeParameter):
        par_subclass = (par_subclass[0].parameter,)

    if par_check:
        # Use the dynamic check.
        return par_check(*par_subclass)
    else:
        return _original_is_sub_type_parameter(cls, par_cls, subclass, par_subclass)

CovariantMeta._is_sub_type_parameter = _new_is_sub_type_parameter

def attribute_dispatch(attribute, check):
    def decorator(f):
        @parametric
        class _DynamicallyTypedObject:
            def __init__(self, obj):
                self.obj = obj

            @classmethod
            def __infer_type_parameter__(cls, obj):
                return attribute(obj)

        def wrapped_f(x: _DynamicallyTypedObject[DynamicTypeParameter(check)]):
            return f(x)

        wrapped_f.__name__ = f.__name__
        wrapped_f = dispatch(wrapped_f)

        @wraps(f)
        def second_wrapped_f(x):
            return wrapped_f(_DynamicallyTypedObject(x))

        return second_wrapped_f

    return decorator

def _safe_le(x, y):
    try:
        return x <= y
    except Exception:
        return False

@attribute_dispatch(attribute=lambda x: len(x), check=lambda x: _safe_le(x, 10))
def f(x):
    print("Method for `len(x) <= 10`!")

f(np.ones(5))
# Method for `len(x) <= 10`!

f(np.ones(15))
# NotFoundLookupError

I dont fully appreciate the internal mechanisms; but yeah the external API indeed looks the part!
With the minor detail that I think usually itd be nice to seperately bind the attribute to create a len/whatever_dispatcher since that part tends to be constant over a bunch of annotations usually I suppose.

With the minor detail that I think usually itd be nice to seperately bind the attribute to create a len/whatever_dispatcher since that part tends to be constant over a bunch of annotations usually I suppose.

That should certainly be possible!
I think I really like this idea and that it would be a valuable addition. However, you're indeed right that some precarious manoeuvring is required to fit it into the current internal mechanisms. There are still a few things unclear to me.
Firstly, to make this really work, the current mechanisms would require the ability to ask whether one check function is more specific than another. E.g., lambda x: len(x) <= 5 is more specific than lambda x: len(x) <= 10. One way to make this work is to not use lambdas, but to use objects which can be compared. For example, make a Shape object which is hashable such that any two shapes can be compared. This comes at the cost of boilerplate, but perhaps it's not too bad.
Secondly, in the prototype, the information about the shape is preserved by wrapping the object in another object with a type parameter. I think I still like the fundamental principle that all information necessary for dispatch should be retained when you take type(object).
What I would propose is an interface like the below. (Note that this is pseudo-code and doesn't actually run.)
from numpy import ndarray

from plum import dispatch, parametric
from plum.util import Comparable

class Shape(Comparable):
    def __init__(self, *dims)
        self.dims = dims

    @dispatch
    def __le__(self, other: "Shape"):
        return ...

@parametric
class ShapedArray(ndarray):
    def __infer_type_parameter__(cls, *args, **kw_args):
        return Shape(*self.shape)

@dispatch
def f(x: ShapedArray[Shape(10, 10)]):
    # Do something for objects with `shape <= Shape(10, 10)`.

@dispatch
def f(x: np.ndarray):
    # Ensure that the shape information is always included.
    return f(ShapedArray(x))

f(np.random.randn(15, 15))

What would you think about this proposal? Would that suffice for your use case?

I suppose it would suffice; but considering the number of different kinds of matching functions that I need, and the fact that they dont really have a ton of reuse; many are one-off, the need to wrap every condition into a type isnt very attractive.
While I like using nice libraries over reinventing the wheel, getting exactly the syntax I want takes me 40 lines of code added to my project.

That's totally fair enough.

getting exactly the syntax I want takes me 40 lines of code added to my project.

How would you deal with the below ambiguity?
@dispatch(condition=lambda x: len(x) <= 10)
def f(x):
    print("This is an int of length at most 10")

@dispatch(condition=lambda x: len(x) <= 20)
def f(x):
    print("This is an int of length at most 20")

If you then call it with an x such that len(x) = 5, then both conditions would evaluate to True. The key idea of multiple dispatch is that the most specific method should be chosen. However, unless you inspect these lambdas, there is no way to know which of the conditions is most specific.

What I currently do is to let the order in which the annotations are registered be defining for the order in which they are matched. With an optional kwarg to overload the insertion order; which might be useful when extending base library functionality.
Instead of maintaining an ordered list and letting that be defining... it might be better to define an explicit priority number. That way itd be easier to manage the situation where there could be multiple extension modules, and you dont want to end up with the risk of an import-order dependent result. You could just insert with fractional priority; and maybe raise an error in case of ambiguity?

I see! If that approach or assigning a priority number suffices, then perhaps it is not necessary to go through a lot of technical hoops for a fully general implementation of the idea. My sense is that determining which condition function is more specific is the key difficulty (and also what lies at the heart of multiple dispatch), and a general implementation will necessarily involve at least a bit of extra boilerplate which specifies how any two condition functions can be compared.

yeah... I dont know that there is a general answer to the question of how to implement such comparisons... the other option would be for the matching function to return a number, rather than a bool... that might work in some situations where you want this to be some complex estimate of the input (like maybe an estimate of runtime for a given implementation), but otherwise its just messy.
On a related note: if one is to use generic object attributes to decide multiple dispatch, its nice to encourage people to implement a flyweight pattern for those objects; to guarantee trivial equality comparisons between them:
class FlyweightMixin:
	def __hash__(self):
		return id(self)
	def __eq__(self, other):
		return self is other

class FlyweightFactory:
	def __init__(self):
		self.flyweight_pool = {}
	def construct(self, key, value) -> FlyweightMixin:
		"""All constructor calls of flyweights supposed to be made via this factory method."""
		if key in self.flyweight_pool:
			return self.flyweight_pool[key]
		else:
			value = value()
			self.flyweight_pool[key] = value
			return value

I guess its not a hard requirement that the attributes you dispatch on have a certain cost of value equality comparison... but if you care about performance it sure is nice. In my case these attributes contain potentially humongous numpy arrays that do not natively compare cheaply; and I do care about performance. If you end up going through with implementing something like this, might be useful to include something like this in the example. Id already hacked in similar functionality; but its nicer to factor out such a known pattern with an existing name; and it took me a while to realize it could be quite simple indeed.
(this is the same thing python does under the hood to trivialize string comparisons and some other primitive types)

yeah... I dont know that there is a general answer to the question of how to implement such comparisons... the other option would be for the matching function to return a number, rather than a bool... that might work in some situations where you want this to be some complex estimate of the input (like maybe an estimate of runtime for a given implementation), but otherwise its just messy.

Hmm, yeah. It's a hard problem!

On a related note: if one is to use generic object attributes to decide multiple dispatch, its nice to encourage people to implement a flyweight pattern for those objects; to guarantee trivial equality comparisons between them:

This is a nice suggestion! Certainly a cheap performance boost in certain scenarios. If we were to go down the path of implementing dispatch based on object attributes, it would be worth thinking about how to make this as efficient as possible and also how to reduce boilerplate as much as possible.

@wesselb Am I right in thinking that support for this would be automatically included in the case that beartype dispatch is supported re: #53 ? See e.g. relevant beartype features. I'm pretty sure any of these types of situations could be checked with the new door api and the beartype validators.

@tbsexton, combined with your proposal to perform dispatch solely using isinstance checks, I think you might be right! This is exciting!


Allow running Cassandra in a separate JVM

Running Cassandra in the same JVM as the test brings a few problems (most notably #2) as Cassandra has some problems cleaning up after itself. Running Cassandra in a separate process would lead to more stable tests.

I found that this is not a windows specific problem rather a difference between openJDK and the Oracle JDK. The latter is not working.


[Tooltip] 1st draft

Tooltips are highly requested across apps.
Alternatively, a more accessible & scalable UX would be to use popup tips.
As described here, if used cautiously, both tips can be used.
personally I believe having both features is bound to unintentional abuse as design & WCAG guidelines tend to fade.
recent design discussion showed popup tips as a favored candidate
Let's break down the elements structure to
Tips

focusable / tab-able icon reflecting it haspopup state
inner tooltips to anchor to icon

https://github.com/popperjs/popper-core
https://shoelace.style/components/tooltip?id=examples

Design
https://www.figma.com/file/r8OYLPmRmDqfLKt6KHdJDB/Vivid-UI-Kit---2.0?node-id=1968%3A549

https://www.carbondesignsystem.com/components/tooltip/accessibility
Carbon has a good explanation about a11y consideration and a good example for implementation - using the variant 'Icon tooltip'

add dismissible property for the X button
component structure:
-- basic  - can have title or link and can have X button
--extended - can have - title + text + link or button & X button (have extra padding)

another ref to toggletips
https://inclusive-components.design/tooltips-toggletips/

creating basic tooltip based on popup component.:
https://tmp.dev.vivid.vonage.com/1223/index.html?path=/story/alpha-components-tooltip--introduction


[docs] Fix Reference and Example blocks in docs

It annoyed me..
Need to add lot of new things in the docs..

The docs build doesn't work because of git's deps problems, do you know this problem? Have a solution? @jonashaag


refactor: Validate or add @defer directive in schema

Closes https://github.com/apollographql/apollo-ios/issues/3287.
The change here is to:

Validate any @defer directive that is in the schema document. The validation is to ensure that any schema definition matches the experimental definition of the directive in graphql-js. We do this because some server implementations allow @defer to be used in other locations, such as FIELD, and Apollo iOS codegen does not support those definitions.
Automatically add a @defer directive if it is not found in the schema. This mimics the eventual state of the defer proposal where the directive is available to be used without explicit definition.

@AnthonyMDev this is ready for another review, should be all done.


Support minimum php 5.3 version as Give does.

@tw2113 Give support minimum PHP 5.3  and it will be good if this addon does same. I was planning to use this but can not use this with PHP version limitation.
For ref: https://github.com/tw2113/QueryMonitor-GiveWP/blob/master/query-monitor-givewp.php#L40

While I was looking forward to short array syntax, I understand the idea here for compatible minimum versions, and have pushed up changes to make it PHP5.3 ready. thanks @ravinderk


Supporting Grammarly and Google Translate

DraftJS doesn't work with either because of many reasons that either: conflict with React's rendering, or just don't support Draft's internal model. I feel that we should do better here.
These browser plugins are not only heavily used by a large majority of the Internet, they also provide a much better experience for users that depend on these for accessibility reasons (which includes plugins other than these two).
I feel like we should spent some effort on investigating and possibly implementing support for these browser plugins. We can obviously disable them (you can use DOM attributes and classes to do so) but I feel like we should at least explore this space.

Grammarly support added in #54.

How about google translate?

@li-yechao Does Google Translate not work at all with your Lexical content? Last time I checked, it worked fine for me.

@li-yechao Does Google Translate not work at all with your Lexical content? Last time I checked, it worked fine for me.

It not worked for me, example page: https://www.robertmao.com/blog/post/yvstwPLWHCsNz-XN
What am I doing wrong here?

Ah, it's because of Lexical's DOM mutation observers reverting the content back. I wonder if we should relax the DOM mutation listeners in non-editable mode.

@li-yechao Can you open a separate issue for this please? We can track it and maybe come up with a solution.

@li-yechao Can you open a separate issue for this please? We can track it and maybe come up with a solution.

#3496


Scala Stream Collector: add support for PutRecords API

/cc @fblundun

Blocked by https://github.com/cloudify/scalazon/pull/14


[2.4] Fix CVEs & CI

Signed-off-by: Tyler Ohlsen<EMAIL_ADDRESS>Description
Fix CVEs and CI for 2.4 branch
Issues Resolved
[List any issues this PR will resolve]
Check List

[x] Commits are signed per the DCO using --signoff

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

Codecov Report

Merging #348 (a810aae) into 2.4 (7ec7b41) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##              2.4     #348   +/-   ##
=======================================
  Coverage   52.04%   52.04%
=======================================
  Files         147      147
  Lines        5015     5015
  Branches      965      983   +18
=======================================
  Hits         2610     2610
  Misses       2148     2148
  Partials      257      257

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


Moving a currently playing song causes it to be stuck playing, even when esc is pressed

If I am moving songs around and move a song that is currently playing, the audio is stuck playing.
Steps to replicate:

Play a song with a keyboard bind.
While its playing, CTRL + X to cut the song
(Optional) CTRL + V the song to somewhere else.
Press the esc or the original keyboard bind. The song wont stop. Pressing the key where it now is just overlaps the song.

Only way to stop it is to restart Flask.
What I expect to occur: When song is removed as a bind for it to automatically stop if currently playing.

Didn't think about anyone wanting to do that haha. It's an easy fix to "stop sound when cut or deleted". Added to v1.0 to do list.

Hahaha, Never intentional just accidental but if I had a buck for every time it occurred for me, I would have more dollars than I would like to admit.

Resolved in v1.0.0


Create qubit-reuse

recycled qubits

 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.

See https://github.com/qiskit-community/qiskit-algorithms/pull/199#issuecomment-2291078766


Cache issue when multiple targets are used

Problem
When different targets are used, cargo marks the external crate as a dirty package and re compiles them again. This seem to happen only in CI systems and I couldn't reproduce it locally.
Steps
I have reproduced it in this repository: https://github.com/psibi/cross-cache-issue
These are the steps to reproduce it in a CI action:

Make sure you cache ~/.cargo and the target directory in the CI system.
Create a small binary which has some external dependency
Compile it for some platform:

cargo test --workspace --release --no-run --locked --target x86_64-unknown-linux-musl --verbose

Compile it for some other platform:

cargo test --workspace --release --no-run --locked --target x86_64-unknown-linux-gnu --verbose

Make sure to do initial run so that it builds and stores cache.
In the subsequent run, I can see output like this:

       Dirty proc-macro2 v1.0.92: the path to the source changed
   Compiling proc-macro2 v1.0.92

And as you can see it compiles the dependency again. The above bug disappears if I use only one target (i.e. remove one of the cargo command so that only one target is exercised)
Possible Solution(s)
There are some workarounds to avoid the above issue:

Have separate target directories. You can use the option target-dir to specify a different directory and then cache it. No recompilation happens in that case.
Crate a new job for each target compilation i.e. Do not mix different targets in the same github action job.

Notes
No response
Version
cargo 1.81.0 (2dbb1af80 2024-08-20)
release: 1.81.0
commit-hash: 2dbb1af80a2914475ba76827a312e29cedfa6b2f
commit-date: 2024-08-20
host: x86_64-unknown-linux-gnu
libgit2: 1.8.1 (sys:0.19.0 vendored)
libcurl: 8.8.0-DEV (sys:0.4.73+curl-8.8.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w  11 Sep 2023
os: Ubuntu 22.4.0 (jammy) [64-bit]

Could you update the workflow with CARGO_LOG=cargo::core::compiler::fingerprint=trace set?

https://github.com/psibi/cross-cache-issue/actions/runs/12280621981/job/34267493466 — after adding CARGO_LOG it
https://github.com/psibi/cross-cache-issue/actions/runs/12289755018/job/34295769930

Looks like cache works fine now. I assume the previous cache was corrupted, or Swatinem/rust-cache isn't compatible with cross or other tools, or you have both action/cache and Swatinem/rust-cache and I don't know if they are compatible.
From Swatinem/rust-cache:

The ~/.cargo/registry/src directory is not cached since it is quicker for Cargo to recreate it from the compressed crate archives in ~/.cargo/registry/cache.

This might be an issue when build script instruction cargo::rerun-if-changed points to a directory, as directory mtime is set at the .crate file unpacking time. Though this is not your situation.
Going to close this as resolved. If you find more odd things Cargo did, let us know.


Adding CADI AYYAD UNIVERSITY

URL of Cadi Ayyad University: https://www.uca.ma
domain: uca.ac.ma

@Lamrisseloubna1 I am sorry, the domain uca.ac.ma is removed from our trusted domains list because it was abused in the past. If you are the student of this school, please enroll to GitHub Student Developer Program. Then apply for JetBrains educational subscription with your GitHub account (GitHub tab at https://www.jetbrains.com/shop/eform/students).


Carousel with responsive

When using the carousel-plugin, the div for the  bigger than the Picture, if you resize your Browser to more than 1195px in width. In this case it occures, if the pictures are exactly 640x480.
Example: http://wetter.ccblog.de/issue.html

Same issue without -responsive.
Perhaps my code is wrong. Anybdoy ?

try asking on the mailing list - that's a better place for general support and not specific bugs with the lib. thanks!


Add a "Best Practices" section to the docs, to nudge users in the correct direction

E.g. when writing a Network interface implementation, having a single setup method that does all the test-generic setup so that Test.setup is a simple call down to MyNetwork.setup

Going to close this for now - I'd rather have the example testsuites show this by example


Mess with formats

MomentJS does some dirty tricks with empty function Moment.ISO_8601.
I wonder why not just provide ISO string constants instead?
There is a buggy behavior here:
import Moment from "moment";

// this can be used for parsing
Moment("2015-01-02", Moment.ISO_8601); // ok

// but not formatting
Moment("2015-01-02", Moment.ISO_8601).format(Moment.ISO_8601); // exception

.../node_modules/moment/moment.js:455
        var array = format.match(formattingTokens), i, length;
                           ^
TypeError: undefined is not a function

ISO_8601 was never meant to be passed as an argument to format. Possibly we should have a formatting token for it and retire the constant from use altogether, but AFAIK, we do not. But do not despair! Simply use toISOString()

Simply use toISOString()

This is not acceptable for library code where you will have to deal with multiple formats as a constants and should be agnostic to them. I can workaround of course, just hope this will be cleaned in the future.

It's fair to ask for a format string for ISO-8601. @ichernev - do you agree? If so, what string?


Modal window to choose user preference

In home page, on page load, open a modal window with title "What is your preference?" and options, "Articles, Audio/Video" as shown in the below image.
On selecting any one of the options, store that value in browser localStorage for later use.

Task Completed by @rajakvk


thumbnail templatetag fails silently when using contrib.staticfiles.

thumbnail returns the image_url because the templatetag doesn't know about STATIC_ROOT.
Working on a patch.

Fix for https://github.com/stephenmcd/mezzanine/issues/97.
Also, added support for PNG thumbnailing.
https://github.com/kenbolton/mezzanine/commit/14627ebdfb4cc108832239239bab3f73b1b4e69f

This issues wasn't at all related to staticfiles. Turns out, its a problem that only occurs when using filebrowser's FileBrowseField, which prepends the settings.MEDIA_URL to the image path and stores it as such in the database. The mezzanine_tags.py thumbnail method can be made to work with FileBrowseField if settings.MEDIA_URL is lstrip'ed from the image_url when setting the value for image_path.


Using trained models to make predictions is very poor 用训练好的模型进行预测，效果很差·

Hi! I cannot help you without more details on which model you are using, weights, dataset, etc...


Emoji-mart-vue crashes Chrome on Android

Hi, so as title says, when you open emoji picker using open dialog button on demo page it freezes for 5-25 seconds and then you are able to scroll and select emoji. But after a while or if you open emoji picker again Chrome freezes, is not responding and there's a popup that says "Chrome is unresponsive" and I need to force close it.  I have this issue on demo page and my project as well. I tried using Picker and StaticPicker but it didn't help. I can reproduce it every time.
Samsung Note 10+ Android 10
Chrome 85.0.4183.127 (latest version)
I tried it with old LG V30 with same results.
Vue 2.6.11
emoji-mart-vue-fast version 7.0.2 and also tested on my project older versions: 6.0.0 and 5.4.15

I see this issue on the demo app, few observations:

it is only a problem in a popup, inline components seem to work fine
it works in Firefox, but lags In Chrome
it works on codias.com where I used this component at work, we have 5.4.15 version there with custom design and custom popup

In general, it looks like a combination of emoji component and a specific popup implementation cause this problem.
@radKoz in your application, are you also using the quasar dialog as in demo app?

@radKoz in your application, are you also using the quasar dialog as in demo app?

In my app I'm not using quasar dialog or any other library, I just use v-show on picker element and styled it so it looks like its in a popup

@radKoz I've just added a custom CSS dialog example to the demo page and it works good for me in Android Chrome, while QDialog example still produces a problem.
So this is either a combination of emoji picker and popup implementation that causes this or just a specific popup implementation. In either case this looks like the issue is out of scope for this library.
Please let me know if you have other considerations or additional information.


how to set the text values when the form is first loaded?

Do you have an example that shows us how to set the text value when the form is loaded?  I tried with something like this <Text field="name" id="name" value={this.state.value} /> but it's not working.

It appears that I found there is a way to set the value before loading the form. Basically I just use getApi props in the Form component level to set the value with the text field and id called 'hello-field' in the FormContent component.
const FormContent = ({ formApi }) => {
	return (<form onSubmit={formApi.submitForm} id="form1" className="mb-4">
          <label htmlFor="hello">Hello World</label>
          <Text field="hello" id="hello" />
          <button type="submit" className="btn btn-primary">Submit</button>
    </form>)
  };

<Form getApi={(formApi) => { formApi.setValue('hello','default value') }}>
		    <FormContent />
	     </Form>

Would like to see if there is any other better ways on doing this.

Look at the docs and see the default values prop. Or u can also use the set value like you have done above

I see. Well, I was thinking if default values is the appropriate way to do this. What I was trying to do is to make an API call and set the value in text field when successful response is returned. Default values seems to be used in a situation where the values are already known when rendering the component.
Anyway, thanks for the suggestion!

So there are two options for what u need. Option 1: if you can make your API call before you render your form, then use default values. Option 2: if your api call needs to happen after the form has been rendered, use setValue. This is actually perfect example of when to use set value.


Error while executing the command [python3.7 -m pip install -r requirements.txt]

I'm want to install QRLJacker and when I executing a command [python3.7 -m pip install -r requirements.txt] at the end of installation an error appears {Command "/usr/local/bin/python3.7 -u -c "import setuptools, tokenize;file='/tmp/pip-install-oz8je1zf/terminaltables/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-record-nghyobzd/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-oz8je1zf/terminaltables/}. How can I fix it?

Ok, I solved the problem. sudo python3.7 -m pip install --upgrade pip and after that command the problem disappeared


Client reports incorrect server version 6.2.0

Summary
Mobile client reports server version as being 6.2.0, when currently the latest release available is 6.1.0.
Environment Information

Device Name: Xiaomi Mi 9T
OS Version: Android 11
Mattermost App Version: 1.48.0
Mattermost Server Version: Build Hash: fd8fea804bba2a9ffa0127e40e4d7cacb6698a5b

Steps to reproduce
Open settings in the mobile app and click the about menu entry.
Expected behavior
Correct server version should be reported.
Observed behavior

It seems you are running the master branch, but regardless of that the mobile app just displays the server verdion that is sent by the server in the config, mobile app has nothing to do with the determine the server version.

The same version is shown even after a server update.
The web client shows 6.2.0 as a database schema version.
Afaik there is no 6.2.0 server version, that's why I suspect that the version might be taken from the wrong "source".

@daniel-jirca What steps did you take to download / upgrade to 6.1?

I run the mattermost/mattermost-team-edition:master docker image so I just did a docker pull and restart.


Error: While trying to resolve module redux-dynamic-reducer

Hi
I'm experiencing problems bundling my react-native app after I installed redux-dynamic-reducer and react-redux-dynamic-reducer.
I ran npm install redux-dynamic-reducerand npm install react-redux-dynamic-reducer, replaced
the use of import { createStore } from 'redux' with import { createStore } from 'redux-dynamic-reducer' and restarted the bundler. And then the bundler throws up:
"error: bundling failed: Error: While trying to resolve module redux-dynamic-reducer from file /mobile/app/redux/store.js, the package /mobile/node_modules/redux-dynamic-reducer/package.json was successfully found. However, this package itself specifies a main module field that could not be resolved (/mobile/node_modules/redux-dynamic-reducer/lib/index.js. Indeed, none of these files exist:

/mobile/node_modules/redux-dynamic-reducer/lib/index.js(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)
/mobile/node_modules/redux-dynamic-reducer/lib/index.js/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)"

Notes:
"react-native": "0.55.4",
"redux-dynamic-reducer": "git+https://github.com/Journlas/redux-dynamic-reducer.git#1.0.0", (I created a pull request to fix this)
"react-redux-dynamic-reducer": "2.0.2",
I hope someone can help as this library looks really interesting!
Let me know if you need any additional information.

Something looks wrong with how your bundler is trying to resolve the main file.  If I'm reading it correctly, it's looking for /mobile/node_modules/redux-dynamic-reducer/lib/index.js or /mobile/node_modules/redux-dynamic-reducer/lib/index.js/index with one of the extensions (.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json).
The file /mobile/node_modules/redux-dynamic-reducer/lib/index.js should exist, but there is no additional extension.
Which bundler are you using?  Is there somehow in it's configuration to allow it to change the resolution to be /mobile/node_modules/redux-dynamic-reducer/lib/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)?
As a side note, this library is not being actively developed at the moment (just bug fixes), as we have a new library that is more extendible and supports more of the redux ecosystem.  It's called redux-dynostore.


Use tokio::task::spawn_blocking instead of thread::spawn

Hello @programatik29,
While creating the async implementation for rusqlite_migration we noticed that this project is using thread::spawn instead of the recommended tokio::task::spawn_blocking .
Can I create a PR to change that or is there some underlying reason for this approach?

Hello,
This library uses thread::spawn intentionally. The reason for not using tokio::task::spawn_blocking is background thread being possibly long running possibly. Using spawn_blocking would possibly take a thread from the pool for too long without returning and this can cause problems in theory.
For more information about this topic, you can take a look at this article.
That said, one case for spawn_blocking can be rapidly opening and closing rusqlite connections in that case it can offer performance benefits but I think that is extremely unusual and out of scope for this crate. For long running tasks, thread::spawn is the way to go.

Thanks @programatik29, that confirms my suspicions :D.

You are talking about tokio::spawn there, if you block those it is really bad. spawn_blocking has a different much larger thread pool. But it is still a thread pool and limited.

Yes I realized after @matze gave me their input, that's why I decided to ask you directly :). Thank you for the article, it made everything clear.

Ah, read that article a while ago but surely forgot about that nice table at the end.


remove json as a runtime dependency

Since JSON is packaged with Ruby 1.9.3, we don't need to add it as a runtime dependency.

Thanks!


[REQUEST] Localization

It would be nice if we could choose the tool's localization, detected automatically from the OS default language.
Example : I'm french, my OS is in french, the application should switch automatically to French, but I could still go to a setting menu to change it back to english if I wanted to.
Note : I can provide French translation if needed.

Appreciate your comment but to be honest I doubt will spend any time on localising PySpy.

Appreciate your comment but to be honest I doubt will spend any time on localising PySpy.


Arm images for rootless docker

docker/20.10/dind-rootless/Dockerfile
Is currently available for amd64 only while the installation supports arm64 too. Can we distribute those images too?

Good catch!  https://github.com/docker-library/docker/pull/315


Consistency improvements, unification of comments & typo fixes

This PR attempts to make the code examples more understandable and consistent by unifying the styles of their comments.
It also fixes a bunch of typos, and makes readability improvements in different places.

Some nice clicks made

So here's our comment style, if I'm not wrong:

Starts with uppercase letter if the comment is a sentence.
Ends with a period if the comment is the sentence.
The above 2 styles aren't applied to inline comments.
Won't start with an uppercase letter or end with a period if the comment is not a sentence.

When a comment is a sentence in this case? When it includes a verb.

Good job, you two!
@rojserbest please consider adding suggestions to a batch and then committing once. This will save us from having a bunch of similar commits, which makes it easier to review.
Will review more thoroughly when out of draft state.

Adding suggestions to my own changes?

When going through another person's review, instead of clicking "commit suggestion" 22 times, go to the files tab, then click "add suggestion to batch" 22 times, and perform a single commit that collects all changes.

Thanks, got you!

@linbuxiao @WingLim it's sufficient if you review the few changes to the Chinese translations.

@linbuxiao @WingLim it's sufficient if you review the few changes to the Chinese translations.

LGTM, but do I need to change the corresponding translation in this PR, or I can do it in #98 which I still working on.

@linbuxiao @WingLim it's sufficient if you review the few changes to the Chinese translations.

LGTM, but do I need to change the corresponding translation in this PR, or I can do it in #98 which I still working on.

Either way is fine. It's important that the translations are in sync eventually (once all PRs are merged so to say), but other than that you can do it however it works best for you.

Great, I will sync the document in #98 , you can merge this PR first if it is done, this will not take too much time.

I'd still like to wait for @CalsiBotDev to review the changes before merging them.

Same.

Thanks for another thorough review! @rojserbest I'd apply every suggestion I didn't comment on, unless you have objections. They make sense to me.

There are a lot of nit-picks in here, so just be sure that you're enjoying micro-optimising language as much as I do. It should not feel like a waste of time to anyone :)
I'll let you two decide on the exact conventions we use, and where to apply them. Just be sure to ping me once you agreed on stuff, so that I can

adapt to the new rules when writing future articles, and
make sure that both languages have the same code examples.

Comment rules:

Start with an uppercase letter and include a period at the end if the comment included a sentence, this doesn't apply for inline comments.
Inline comments start with a lowercase and won't have periods in their end in any way.

List rules:

List items have nothing in common between them, No need for ",".

@KnorpelSenf, the above is everything so far.

And we're not forced to follow those instructions everytime, we should follow them in regular times only. For example, if we needed to have more clarity somewhere, we can break them,

Understood. Regarding lists, I tend to write sentences with an enumeration that is simply formatted as a list. Example:
grammY is

simple,
fast, and
powerful

and therefore a good choice for your bot.
Would you advise to rather break the rule, or to avoid such sentences?

I don't know where you took that style from, but I haven't seen splitting a sentence with a list like you do throughout my life.
I'd just write:
grammY is:

grammY
Simple
Fast
Powerful
Stunning

Thanks!


Fix severity check box not filter items correctly & severity not counted properly

Notes for Reviewers
This PR fixes #11458

Signed commits

[x] Yes, I signed my commits.

I also add fix for the severity checkbox not counted, which there a problem in the database

Yay, @jerensl! 🎈

@jerensl
Let's discuss this on the Meshery dev meeting starting 9 AM Central time today. Adding it as an agenda item to the meeting minutes

@jerensl Let's discuss this on the Meshery dev meeting starting 9 AM Central time today. Adding it as an agenda item to the meeting minutes

Hi @vishalvivekm I think I'm missing out on explaining my PR at the last meeting and also attending the meeting, can I do it here or do I need to wait for the next meeting?

@jerensl, let's discuss this PR during the Meshery dev meeting call, if you would. Please add it as an agenda item to the meeting minutes


Allow skipping initrd option in iPXE scripts

Previously, when we generated the MAC-specific iPXE script, we unconditionally added the initrd command into it. Calling initrd command without a parameter is not fatal, but it does pollute the
boot logs unnecessarily.
In this commit, we added simple if clause to the code, responsible for generating the iPXE scripts, that leaves out the initrd command if the PxeImage has initrd field set to nil.
Note that the code for generating the PXELINUX menus already had this condition in place.

@bdunne please review.


fix(scroll): wrong payload on next batch

Dear maintainer(s),
it seems "scroll API" client does not meet elasticsearch expectations.
As described in https://www.elastic.co/guide/en/elasticsearch/reference/current/scroll-api.html, "scroll_api" shall be a JSON param to provide in the payload.
However, the scroll lib "<elasticlient/scroll.h>" posts next scoll request using "scroll_id" directly in request body without encapsulating it in {"scroll_id": "VALUE"}.
Same case for clear function.
scroll.cc (changes):
diff --git a/src/scroll.cc b/src/scroll.cc
index c939c8d..685dcf0 100644
--- a/src/scroll.cc
+++ b/src/scroll.cc
@@ -183,7 +183,7 @@ bool Scroll::next(Json::Value &parsedResult) {
         std::ostringstream urlPart;
         urlPart << "_search/scroll?scroll=" << impl->scrollTimeout;
         LOG(LogLevel::INFO, "Scroll (next) on %s.", urlPart.str().c_str());
-        if (impl->run(urlPart.str(), scrollParameters.scrollId, parsedResult)) {
+        if (impl->run(urlPart.str(), "{\"scroll_id\": \"" + scrollParameters.scrollId + "\"}", parsedResult)) {
             return true;
         }
     }
@@ -202,7 +202,7 @@ void Scroll::clear() {
     } else {
         try {
             const cpr::Response r = impl->client->performRequest(
-                Client::HTTPMethod::DELETE, "_search/scroll/", scrollParameters.scrollId);
+                Client::HTTPMethod::DELETE, "_search/scroll", "{\"scroll_id\": \"" + scrollParameters.scrollId + "\"}");
             if (r.status_code / 100 != 2) {
                 LOG(LogLevel::WARNING, "Scroll delete failed response text: %s", r.text.c_str());
             }

This modification works fine for me.
Do not hesitate if you need more inputs / discuss's
Regards,
Laurent.

Hello  Laurent,
thank you for reporting the issue. The Elasticsearch in current version did not support used Scroll syntax. We are gonna figure it out soon.
Martin

Hello Martin,
which ES version is compliant with elasticlient scroll API ?
Thx & regards,
Laurent.

Hello lyague,
at first sorry for really late response. Used syntax was supported until ES version 5.0. Now the issue should be fixed as I merged https://github.com/seznam/elasticlient/pull/17 to the master yesterday.
Martin


scipy.stats.normaltest sometimes gives incorrect returns b/c of bug in scipy.stats.kurtosis.test

<<Please describe the issue in detail here, and for bug reports fill in the fields below.>>
The function scipy.stats.normaltest is intended to compute the D'Agostino K^2 ombinus test of normality.  However, it occasionally gives incorrect results due handling of a cube-root of negative numbers in scipy.stats.kurtosis.test
This issue originally came from: https://stats.stackexchange.com/questions/353756/normality-test-giving-confusing-results
Reproducing code example:

#A detailed example is here: https://stats.stackexchange.com/questions/353756/normality-test-giving-confusing-results

#A possible fix for scipy.stats.kurtosistest
#(Please forgive the messiness - I'm a long-time R user but 1st-time Python user)
#Several lines of code in the function, then...
term1 = 1 - 2/(9 * A)

#New code begins here to address cube-roots of possibly negative numbers
def cubroot(y):
    from math import copysign
    return copysign(abs(y)**(1/3),y)
term2 = cubroot((1 - 2/A)/(1 + x * np.sqrt(2/(A - 4))))
Z= (term1 - term2)/ np.sqrt(2/(9.0*A)) # [1]_ Eq. 5
if Z.ndim == 0:
    Z = Z[()]
return KurtosistestResult(Z, 2 * distributions.norm.sf(np.abs(Z)))
<<A short code example that reproduces the problem. It should be self-contained, i.e., possible to run as-is via 'python myproblem.py'>>

Error message:
#No error message, just inaccurate results
<<Full error message, if any (starting from line Traceback: ...)>>

Scipy/Numpy/Python version information:
1.1.0 1.14.3 sys.version_info(major=3, minor=6, micro=5, releaselevel='final', serial=0)
<<Output from 'import sys, scipy, numpy; print(scipy.__version__, numpy.__version__, sys.version_info)'>>

Thanks for pointing it out. So you have an example where the test returns a wrong result. It would be good to have it as a test case once fixed ans to understand the issue better (i did not check it yet, i understand that the sign of the cubic root is wrong).
I did not loo

Just to add for clarity, the relevant equation is (19) on pg. 318 of D'Agostino et al. (1990) https://www.jstor.org/stable/pdf/2684359.pdf
When fixed, the results for the example (the "a" object in https://stats.stackexchange.com/questions/353756/normality-test-giving-confusing-results) should be something along the lines z.skew=-0.2300619, z.kurt=46.98108, chisq= 2207.275, and p of approximately 0.

yes, i agree that the implementation does not look correct. I could not Access the reference you gave but the following one worked:

F. J. Anscombe, W. J. Glynn, “Distribution of the kurtosis statistic b2 for normal samples”, Biometrika, vol. 70, pp. 227-234, 1983.

In the end, the term (1 - 2/A)/(1 + x * np.sqrt(2/(A - 4))) can become negative and then (...)**(1/3) should simply be the cube root of it (again negative), right? Currently, the code sets the value to 0 and there is  comment on this in the documenttion:

The Z-score is set to 0 for bad entries.

(https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.kurtosistest.html)
The current code is
denom = 1 + x*np.sqrt(2/(A-4.0))
denom = np.where(denom < 0, 99, denom)
term2 = np.where(denom < 0, term1, np.power((1-2.0/A)/denom, 1/3.0))
Z = (term1 - term2) / np.sqrt(2/(9.0*A))  # [1]_ Eq. 5
Z = np.where(denom == 99, 0, Z)

I think it should be (same as in your answer):
denom = 1 + x*np.sqrt(2/(A-4.0))
term2 = np.where(denom < 0, -np.power(-(1-2.0/A)/denom, 1/3.0), np.power((1-2.0/A)/denom, 1/3.0))
Z = (term1 - term2) / np.sqrt(2/(9.0*A))  # [1]_ Eq. 5

Using git blame, the last time this code line with term2 was edited in cd4e901d6a6f38b9a843acc7dac6077bd568cc6b. If I have more time, I can check the history in more detail.

I like it.  It looks cleaner than my copysign solution, and  I think it will work so long as the numerator is always positive (so only the sign of denom matters).  It looks like the numerator will always be positive because "As n ranges from 4 upwards, A is smallest when n = 24, and then it is just over 18".  So that suggests 1-2/A is at lowest when 1-2/18 > 0, so the numerator is always positive.  Let me know if you'd like me to run some simulations to verify the accuracy, but just glancing at it, your suggested change looks right.

thanks, i tested the case x = np.hstack([np.full(c, i) for i, c in enumerate([128, 0, 58, 7, 0, 41, 16, 0, 0, 167])]) from the stackexchange thread and the p-value is 0.0 with the above implementation.
Probably one needs to take care of the case denom == 0. And the test needs to be fixed in mstats as well.


Could you please make the trained model available?

Could you please make the trained model available?

Sorry for the delay. I don't know if you're still interested. I just made the WMT14 and IWSLT14 models available (see README).
Alexandre

Thank you for the models. I forgot to close the thread; sorry about that.
I will refer to the README.


Add config example for class_serializers

It takes some time for me to guess exactly how to configure class_serializers, errors shown by the compiler aren't beautiful in this case.
Maybe can be useful to add this simple doc for that powerful option.
What do you think?

I like this change 👍 I would also add a code example with a class serializer excerpt, so that the explanation is clearer.

Sure! I just added it @Jean85


--state-values-set for array or key with dot

@mumoshu is this possible to pass a key containing a dot in its name to --state-values-set ?
also, does it support array access ?
i'm trying to do something like this :
    --state-values-set stacks.monitoring.prometheus.alertmanagerFiles.alertmanager\.yml.receivers[0].email_configs[0].auth_password=${MONITORING_SES_SECRET_KEY} \
    --state-values-set stacks.monitoring.prometheus.alertmanagerFiles.alertmanager\.yml.receivers[0].email_configs[0].auth_username=${MONITORING_SES_ACCESS_KEY} \
    --state-values-set stacks.monitoring.prometheus.alertmanagerFiles.alertmanager\.yml.receivers[0].email_configs[0].smarthost=${MONITORING_SES_ENDPOINT} \

@eddycharly Hey!
I believe that it isn't implemented. It would be a great feature request though!

@mumoshu I'm looking at implementing it.
From what is saw, helmfile is using urfave to parse the command line arguments.
Such a parsing does not seem to be natively supported by urfave, then i guess i could write a new flag parser for urfave.
Do you think it is the correct approach ?
Any hints on how to implement the feature welcome ;)

@eddycharly Hey! Yes, that sounds like a correct approach.
Regarding the implementation, you'd need to implement something to handle index access to arrays in https://github.com/roboll/helmfile/blob/4294a5de0604226e3434b19c850df3db95a8dacf/main.go#L486-L489
We currently support only paths that are composed of dot-separated nested keys there. The enhancement should include a recursive loop to descend into the keys one by one, and a if-else to handle it according to that it's a regular scalar access (e.g. .afield) or array index access(e.g. ary[0])

--state-values-set stacks.monitoring.prometheus.alertmanagerFiles.alertmanager.yml.receivers[0].email_configs[0].auth_password=${MONITORING_SES_SECRET_KEY}
--state-values-set stacks.monitoring.prometheus.alertmanagerFiles.alertmanager.yml.receivers[0].email_configs[0].auth_username=${MONITORING_SES_ACCESS_KEY}
--state-values-set stacks.monitoring.prometheus.alertmanagerFiles.alertmanager.yml.receivers[0].email_configs[0].smarthost=${MONITORING_SES_ENDPOINT} \

Write a program where a number is given. At first find the alternate digit of a
given number from first digit, then from second digit, and multiply the digits, then you can get
two different number.
(needs to be solved in emu 8086) someone please help

uncvar

it souds diffult

It is .... i have no idea how to do this
On Fri, Dec 13, 2019, 3:04 PM zhengboyan<EMAIL_ADDRESS>wrote:

it souds diffult
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/roboll/helmfile/issues/899?email_source=notifications&email_token=AOA5KFSIM3EUPMXPCVG2NDTQYNF2ZA5CNFSM4JCP3VQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGZLNDA#issuecomment-565360268,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AOA5KFSMTQLHYUXG77KKMSLQYNF2ZANCNFSM4JCP3VQQ
.

?
@mumoshu too much things to do lately but i didn't forget it, i will have a look to it this afternoon hopefully ;)

!


[3.8.0] PMC-equipped Helmets Missing Integrated Armor

General information:
Project issue is for:
Server
Expected result:
Helmet generates on a bot at least with integrated armor.
Actual result:
Helmet contains no armor, including integrated.
How to reproduce:

Generate a bot that has equipped one of the helmets listed in the notes

Log files:
Attached below.
Screenshots:
Attached below.
Notes
Helmets known to experience this issue. I'll update as I find them:

Nord HJELM (haven't found a bot yet with functioning version) "61bca7cda0eae612383adf57"
ZSh-1-2M "5aa7e454e5b5b0214e506fa2"

Attachments

LogOutput.log (56 KiB)
log_2024.01.09_1-08-40_<IP_ADDRESS>.28375.zip (154 KiB)
image_2024-01-08_194252931.png (687 KiB)
server-2024-01-08.log (1120 KiB)

Originally written by PhantomInTime

After some testing in code i can see the hjelm is getting its soft inserts added, is this still occuring with the commits made in the last hour?

Originally written by chomp

I will pull the most recent commits and try again tomorrow.

Originally written by PhantomInTime

Well, new bug I had helped me stress test this and yes, issue does appear to be resolved.

Originally written by PhantomInTime

Right as I say this...

Attachments

image_2024-01-10_032551974.png (845 KiB)

Originally written by PhantomInTime


Tasks remains QUEUED in CSC Cluster

https://tesk.c01.k8s-popup.csc.fi/v1/tasks/task-107ccecb?view=MINIMAL

Was related to ftp secret not being populated. Now fixed.

Also just discovered optional  flag for env var from secrets and introduced that for ftp-secret.


Configured settings to add tooltips to underlined terms in documentation

Describe the change
I've added tooltips to underlined terms by adding a couple of settings to the conf.py file and adding the hoverxref package to requirements.txt:

Check out this link to see all the changes built.
PR checklist

[ ] I have added description of the change I'm proposing in the OpenMS Documentation.
[ ] I have read and followed OpenMS Documentation Contributing guidelines.
[ ] I have attached a screenshot of the relevant area after this change.
[ ] CHANGELOG.md is updated.
[ ] I have added my name in CONTRIBUTING.md.

Question: do we want them underlined or can we add a little superscript question mark?
Currently they look like hyperlinks. I would probably at least change the color.

Ok. Open the ticket, link it and merge.

The new issue is here

What is the status here? Ready to merge?

I was checking recently and tooltips still look exactly like links. I don't like it.

Maybe it is on a different branch or so but I am confused with all the forks and branches.

Nobody has worked on this issue for a while. If I have time, I will look into it.


Add Remember The Milk support

This PR add support for Remember The Milk

I made some changes to improve styles and the project name selector.
Thank you for your contribution.


AzureStorage-Enrichment

Required items, please complete
Change(s):

Added analytical rule and workbook to Azure storage solution

Reason for Change(s):

Azure Storage Solution Enrichment

Version Updated:

NA

Testing Completed:

Tested in local subscription

Checked that the validations are passing and have addressed any issues that are present:

Yes

Hello @rushriva One of the check is failing for the pr,
Can you please resolve the following

Looking into this validation failures.

Hello @shainw any updates

Hello @vakohl any feedback on this

Hello @vakohl please provide your update on this

Hello @vakohl waiting for your feedback

Hello @vakohl waiting for your feddback

Hello @vakohl waiting for your feedback

Hello @vakohl waiting for your feedback

Hello @vakohl shain has made some changes


Could not establish trust relationship for the SSL/TLS secure channel

When attempting to hit a rest service with RestSharp.Portable I get an error related to the SSL certificate. I have been able to successfully hit other web services in the past using this library.
It looks like the common answer has been to use ServicePointManager to validate the certificates yourself but that API doesn't appear to be available in a profile 78 PCL. Is there anything that RestSharp.Portable exposes to allow filtering/validating certificates?
System.AggregateException: One or more errors occurred. ---> System.Net.Http.HttpRequestException: A
n error occurred while sending the request. ---> System.Net.WebException: The underlying connection
was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Secur
ity.Authentication.AuthenticationException: The remote certificate is invalid according to the valid
ation procedure.
   at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
   at System.Net.PooledStream.EndWrite(IAsyncResult asyncResult)
   at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at RestSharp.Portable.RestClient.<ExecuteRequest>d__33.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at RestSharp.Portable.RestClient.<Execute>d__8`1.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at EulaWebServiceTest.Program.Main(String[] args) in c:\Users\afishe\Desktop\EulaWebServiceTest\P
rogram.cs:line 26
---> (Inner Exception #0) System.Net.Http.HttpRequestException: An error occurred while sending the
request. ---> System.Net.WebException: The underlying connection was closed: Could not establish tru
st relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationEx
ception: The remote certificate is invalid according to the validation procedure.
   at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
   at System.Net.PooledStream.EndWrite(IAsyncResult asyncResult)
   at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at RestSharp.Portable.RestClient.<ExecuteRequest>d__33.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at RestSharp.Portable.RestClient.<Execute>d__8`1.MoveNext()<---

It looks like ServicePointManager can be used in both Xamarin.iOS and Xamarin.Android but not the PCL. I'll create some initialization code on each platform  and see if that fixes the issue.
http://stackoverflow.com/questions/28629989/ignore-ssl-certificate-errors-in-xamarin-forms-pcl

You're right regarding the certificates. However, you have two choices:

Override the SSL handling globally using the ServicePointManager
Use a custom IHttpClientFactory which is then assigned to RestClient.HttpClientFactory

When you use option 2, then it's easier when you just override DefaultHttpClientFactory.CreateMessageHandler instead of implementing IHttpClientFactory yourself. You can use something like WinRtHttpClientHandler for WinRT platforms and other solutions for the other platforms.
TBH: I'd go for option 1, because it's the easiest way to handle this kind of problem. You should only use option 2 when you require certificate pinning.
Please close this ticket if you was able to solve your certificate problem.

Thanks for the response. I ended up going with option 1. I added the code below to each platform specific project and was back in business...
ServicePointManager.ServerCertificateValidationCallback +=
(sender, certificate, chain, errors) => true;


Show dependent submodule fails to import into Mixed Framework.

Building with  bazel build -c opt //examples/ios/Mixed:MixedFramework and importing the resulting Mixed.framework into a vanilla ios project results in a Missing required module 'submodule/ error.

 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.

This is currently impossible due to the generated module map can't be customized. Though there's a workaround that you can try: adding @_exported import submodule to a Swift file in the Mixed target.

I couldn't get that to work.

I missunderstood the static-ness of the mixed_static_framework to mean that its deps would be entirely contained within the resulting framework.  I am trying to split up the project into many submodules and yet deliver one single framework to thirdparty developers to include into their projects.  Is this possible with this rule or should I be looking elsewhere?

I think it's possible. Let me fix your example.


mopidy-iris: 3.28.1 -> 3.29.2

Semi-automatic update generated by https://github.com/ryantm/nixpkgs-update tools. This update was made based on information from https://repology.org/metapackage/mopidy-iris/versions.
meta.description for mopidy-iris is: '"A fully-functional Mopidy web client encompassing Spotify and many other backends"'.

Checks done (click to expand)

built on NixOS

0 of 0 passed binary check by having a zero exit code.

0 of 0 passed binary check by having the new version present in output.

found 3.29.2 with grep in /nix/store/mnwn12c2a39ay78phb8h2b8z4frz4hdd-Mopidy-Iris-3.29.2

directory tree listing: https://gist.github.com/ae025a07b2e2347d1b40368ef7e2e3cc

du listing: https://gist.github.com/9de5c6f6e1cddfa73dad80eb2c1ebf66

Outpath report (click to expand)

Outpath difference report
4 total rebuild paths
1 package rebuilds
1 x86_64-linux rebuilds
1 i686-linux rebuilds
1 x86_64-darwin rebuilds
1 aarch64-linux rebuilds
First ten rebuilds by attrpath
mopidy-iris

Instructions to test this update (click to expand)

Either download from Cachix:
nix-store -r /nix/store/mnwn12c2a39ay78phb8h2b8z4frz4hdd-Mopidy-Iris-3.29.2 \
  --option binary-caches 'https://cache.nixos.org/ https://r-ryantm.cachix.org/' \
  --option trusted-public-keys '
  r-ryantm.cachix.org-1:gkUbLkouDAyvBdpBX0JOdIiD2/DP1ldF3Z3Y6Gqcc4c=
  cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
  '

(r-ryantm's Cachix cache is only trusted for this store-path realization.)
Or, build yourself:
nix-build -A mopidy-iris https://github.com/r-ryantm/nixpkgs/archive/cff164fb3e3aebf90be5f1f502566ab5570e7f10.tar.gz

After you've downloaded or built it, look at the files and if there are any, run the binaries:
ls -la /nix/store/mnwn12c2a39ay78phb8h2b8z4frz4hdd-Mopidy-Iris-3.29.2
ls -la /nix/store/mnwn12c2a39ay78phb8h2b8z4frz4hdd-Mopidy-Iris-3.29.2/bin

cc @rvolosatovs for testing.

No attempt on x86_64-darwin (full log)
The following builds were skipped because they don't evaluate on x86_64-darwin: mopidy-iris
Partial log (click to expand)

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.

Success on x86_64-linux (full log)
Attempted: mopidy-iris
Partial log (click to expand)
/build/Mopidy-Iris-3.29.2
glibPreFixupPhase
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/mnwn12c2a39ay78phb8h2b8z4frz4hdd-Mopidy-Iris-3.29.2
strip is /nix/store/vcc4svb8gy29g4pam2zja6llkbcwsyiq-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/mnwn12c2a39ay78phb8h2b8z4frz4hdd-Mopidy-Iris-3.29.2/lib
patching script interpreter paths in /nix/store/mnwn12c2a39ay78phb8h2b8z4frz4hdd-Mopidy-Iris-3.29.2
/nix/store/mnwn12c2a39ay78phb8h2b8z4frz4hdd-Mopidy-Iris-3.29.2/lib/python2.7/site-packages/mopidy_iris/system.sh: interpreter directive changed from "/bin/bash" to "/nix/store/r47p5pzx52m3n34vdgqpk5rvqgm0m24m-bash-4.4-p23/bin/bash"
checking for references to /build in /nix/store/mnwn12c2a39ay78phb8h2b8z4frz4hdd-Mopidy-Iris-3.29.2...
/nix/store/mnwn12c2a39ay78phb8h2b8z4frz4hdd-Mopidy-Iris-3.29.2

Success on aarch64-linux (full log)
Attempted: mopidy-iris
Partial log (click to expand)
/build/Mopidy-Iris-3.29.2
glibPreFixupPhase
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/2cbflxyig0j6p6lky9mg35wmzv1mf5gi-Mopidy-Iris-3.29.2
strip is /nix/store/p9akxn2sfy4wkhqdqa3li97pc6jaz3r1-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/2cbflxyig0j6p6lky9mg35wmzv1mf5gi-Mopidy-Iris-3.29.2/lib
patching script interpreter paths in /nix/store/2cbflxyig0j6p6lky9mg35wmzv1mf5gi-Mopidy-Iris-3.29.2
/nix/store/2cbflxyig0j6p6lky9mg35wmzv1mf5gi-Mopidy-Iris-3.29.2/lib/python2.7/site-packages/mopidy_iris/system.sh: interpreter directive changed from "/bin/bash" to "/nix/store/dsyc1z7ck08ga7l0b1jcxx35wj69qcii-bash-4.4-p23/bin/bash"
checking for references to /build in /nix/store/2cbflxyig0j6p6lky9mg35wmzv1mf5gi-Mopidy-Iris-3.29.2...
/nix/store/2cbflxyig0j6p6lky9mg35wmzv1mf5gi-Mopidy-Iris-3.29.2

duplicate: https://github.com/NixOS/nixpkgs/pull/50149


[From VSTS] Semantic highlighting is off for precision formatting

Note that the first line loses the teal coloring for %..  This seems to be caused when . is encountered.

This seems to be caused when . is encountered.

True, but at any level, i.e., %1.5f also colors incorrectly.


Use left ctrl + up/down to decrease/increase the selected wire's order in its source port

Current behaviour:
The only way to reorder a wire's position from its source is to delete wires and re-add them in the desired order, or promote the desired wires in the correct order.
Desired behaviour:
Be able to use the left ctrl + up/down arrow keys to change the order of a wire in its source port.

Added in v1.8.0.

Added in v1.8.0.


VBScript added

It should print "Hello World" but it just pops up a window with Hello World
I apologize if I wasn't clear that it needs to print


Add RestrictChatMember request

Based on #96
Related with #169

Can this be merged?

I tested this patch on a local branch and I can confirm that it works

I would also like to see this merged!


Mythril not reporting MUL overflows

Description
Mythril fails to MUL overflows in the Tokensale sample.
pragma solidity ^0.4.21;

contract TokenSale {
    mapping(address => uint256) public balanceOf;
    uint256 constant PRICE_PER_TOKEN = 1 ether;

    function TokenSale(address _player) public payable {
        require(msg.value == 1 ether);
    }

    function isComplete() public view returns (bool) {
        return address(this).balance < 1 ether;
    }

    function buy(uint256 numTokens) public payable {
        require(msg.value == numTokens * PRICE_PER_TOKEN);

        balanceOf[msg.sender] += numTokens;
    }

    function sell(uint256 numTokens) public {
        require(balanceOf[msg.sender] >= numTokens);

        balanceOf[msg.sender] -= numTokens;
        msg.sender.transfer(numTokens * PRICE_PER_TOKEN);
    }
}

At least one overflow exists in line 16:
        require(msg.value == numTokens * PRICE_PER_TOKEN);

Output from Mythril master:
$ $MYTH -x exercise1/contracts/Tokensale.sol
==== Integer Overflow ====
SWC ID: 101
Type: Warning
Contract: TokenSale
Function name: buy(uint256)
PC address: 472
The arithmetic operation can result in integer overflow.

--------------------
In file: exercise1/contracts/Tokensale.sol:18

balanceOf[msg.sender] += numTokens

--------------------

==== Ether send ====
SWC ID: 105
Type: Warning
Contract: TokenSale
Function name: sell(uint256)
PC address: 693
A non-zero amount of Ether is sent to a user-supplied address. The target address is msg.sender.
It seems that this function can be called without restrictions.
--------------------
In file: exercise1/contracts/Tokensale.sol:25

msg.sender.transfer(numTokens * PRICE_PER_TOKEN)

--------------------

Output from Mythril 0.8.13:
 myth -x exercise1/contracts/Tokensale.sol
==== Integer Overflow ====
SWC ID: 101
Type: Warning
Contract: TokenSale
Function name: buy(uint256)
PC address: 472
A possible integer overflow exists in the function `buy(uint256)`.
The addition or multiplication may result in a value higher than the maximum representable integer.
--------------------
In file: exercise1/contracts/Tokensale.sol:18

balanceOf[msg.sender] += numTokens

--------------------

==== Ether send ====
SWC ID: 105
Type: Warning
Contract: TokenSale
Function name: sell(uint256)
PC address: 693
In the function `sell(uint256)` a non-zero amount of Ether is sent to msg.sender.
It seems that this function can be called without restrictions.
--------------------
In file: exercise1/contracts/Tokensale.sol:25

msg.sender.transfer(numTokens * PRICE_PER_TOKEN)

--------------------

Environment

Mythril version: Master and 0.18.13
Solidity compiler and version: 0.4.24+commit.e67f0147.Darwin.appleclang
Python version: 3.6.3
OS and Version: Mac OS Mojave

Uhm, this is intended behaviour I think, there are no significant usages of the overflowed value (except the requires JUMPI, which we intentionally ignore)
Take the following contract:
pragma solidity ^0.4.21;

contract TokenSale {
    mapping(address => uint256) public balanceOf;
    uint256 constant PRICE_PER_TOKEN = 1 ether;
    uint nbc;

    function TokenSale(address _player) public payable {
        require(msg.value == 1 ether);
    }

    function isComplete() public view returns (bool) {
        return address(this).balance < 1 ether;
    }

    function buy(uint256 numTokens) public payable {
        require(msg.value == numTokens * PRICE_PER_TOKEN);

        nbc = numTokens * PRICE_PER_TOKEN;
        balanceOf[msg.sender] += numTokens;
    }

    function sell(uint256 numTokens) public {
        require(balanceOf[msg.sender] >= numTokens);

        balanceOf[msg.sender] -= numTokens;
        msg.sender.transfer(numTokens * PRICE_PER_TOKEN);
    }
}

Where the overflow is reported (bc its being used to SSTORE)


[tool]: neon-build clean needs to remove image related [.version] files

The neon-build clean command should clear any generated files with in container build folders like .version.
This will ensure that GitHub runner workflows start off with a clean slate.

I also noticed that this tool is hard-coded to remove these files only from the neonKUBE repo:
$/Build-cache
$/Lib/Neon.Cadence/Resources
$/Lib/**/bin
$Lib/**/obj

I'm going to modify the command to remove these from the target repo folder as well instead of hard-coding to neonKUBE.  This is a bit of a hack because it assumes that all repos either use these directories for the same thing or don't have them at all.  This is likely to be reasonable for the lifetime of these repos and we can always tweak the tool again in the future if necessary.

DONE


"Movements" a VSCode extension to cursor movements like word jumps and relative line goto

What is the project?
It is a VSCode extension that enables users to improve their keyboard usage by adding cursor movements that do not exist on VSCode by default.
Where did the idea come from?
The https://github.com/Enkel-Digital/relativity extension allows making relative line goto actions in VSCode. I use it every day but there were some limitations that I wanted to fix. After checking the GitHub repository I noticed that it had some of the fixes that I needed but those changes were never released. It has been 2 years since the last time it was updated so it is fair to consider it abandoned. My idea is to reuse what they had and continue working over that base.
How long will it take to build? What milestones exist (if applicable)?
Since most of the base features are already there, the next milestone would be to add tests to the existing code (it has none), fix some little issues that I observed, and create the word jump functionality.
I would estimate:

8 hours to migrate the code and get used to VSCode extensions development, I have no previous experience.
8 hours to add the unit tests for the previous functionality
6 hours to build and test the jump words feature (at this point I would have more knowledge on the topic)

Discussed in slack but we are not going to pursue this idea.


The section does not have a large border radius.

The section does not have a large border radius as mentioned in the texts.

@aashimgarg we are not working on the stylistic aspects on components at the moment pending redesign by our designer. Closing.


[SECURITY] Option to enforce STARTTLS

https://github.com/go-mail/mail/blob/1e5036aa1b916b6fe5f942b569f101afa195d86d/smtp.go#L98-L105
This code only tries to upgrade to a TLS connection if the server reports that it supports the STARTTLS extension. If an attacker intercepts the SMTP connection and responds that the extension is unknown, then they can prevent TLS from being turned on.
It would be backwards incompatible to expect STARTTLS by default, but we can make an option that would enforce a STARTTLS connection.
Of course, if the connection is already protected by SSL, then STARTTLS is unnecessary.

we can make an option that would enforce a STARTTLS connection.

+1 - would like to see this as well.

@ivy Dialer.SSL is only for supporting the deprecated SMTPS protocol, right? STARTTLS is equivalently as secure, as long as the library doesn't fallback to unencrypted SMTP. (Both SMTPS and STARTTLS are vulnerable to a DNS attack.)
I have run into cases where the remote server doesn't support SMTPS, because the legacy 465 port is not open.
I recommend we create a new Dialer.RequireTLS enum that defaults to Opportunistic TLS. The reason why we want an enum is that we want to support DANE in the future.

@sfllaw Thanks for clarifying. I wasn't aware that SMTPS was a deprecated protocol, that changes everything. 😅
I'll review your PR shortly.

A fix has been merged in b93a540f71a7c7d14b8ca01077c7bb70c13f4f74.


Incompatible shapes for model with multiple inputs and custom loss.

Hi @avolkov1
I encountered the following error when training a model with multiple inputs and custom loss:
InvalidArgumentError: Incompatible shapes: [8] vs. [16] 	 [[Node: tower_1/model_4/lambda_3/add_6 = Add[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/gpu:1"](tower_1/model_4/lambda_3/add_5, tower_1/model_4/lambda_3/mul_12)]] 	 [[Node: loss/mul/_1069 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/cpu:0", send_device="/job:localhost/replica:0/task:0/gpu:0", send_device_incarnation=1, tensor_name="edge_9575_loss/mul", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"]()]]
The BATCH SIZE is 16. The sliced batch size is 8 for each of the 2 GPUs. The code of the model is:
true_image = Input(shape=(FRAME_H, FRAME_W, 3))  # adapt this if using channels_first image data format
jitt_image = Input(shape=(FRAME_H, FRAME_W, 3))

# encoder part
x = make_vgg16('encoder', trainable=True, return_all_layers=False)(true_image)

x = Flatten()(x)

z_mean = Dense(latent_dim)(x)
z_logv = Dense(latent_dim)(x)

# variational part
def sampling(args):
    z_mean, z_logv = args
    epsilon = K.random_normal(shape=(K.shape(z_mean)[0], latent_dim), mean=0., stddev=epsilon_std)

    return z_mean + K.exp(z_logv) * epsilon

z = Lambda(sampling)([z_mean, z_logv])

# decoder part
y = Dense(14 * 14 * 256, activation='relu')(z)
y = Reshape((14, 14, 256))(y)

y = Deconv2D(filters=256, kernel_size=(5, 5), strides=(2,2), padding='same')(y)
y = BatchNormalization()(y)
y = LeakyReLU(alpha=0.1)(y)

y = Deconv2D(filters=128, kernel_size=(5, 5), strides=(2,2), padding='same')(y)
y = BatchNormalization()(y)
y = LeakyReLU(alpha=0.1)(y)

y = Deconv2D(filters= 64, kernel_size=(5, 5), strides=(2,2), padding='same')(y)
y = BatchNormalization()(y)
y = LeakyReLU(alpha=0.1)(y)

y = Deconv2D(filters=  3, kernel_size=(5, 5), strides=(2,2), padding='same')(y)
y = BatchNormalization()(y)
fake_image = Activation('tanh')(y)

mean = tf.concat([tf.ones((FRAME_H,FRAME_W,1)) * 103.939,
                  tf.ones((FRAME_H,FRAME_W,1)) * 116.779,
                  tf.ones((FRAME_H,FRAME_W,1)) * 123.68 ], axis=2)

def model_loss_no_vgg_head(args):
    true_image, fake_image  = args

    # perception loss
    perception_loss = 0.5 * K.mean(K.square(true_image - fake_image), axis=[-3, -2, -1])

    # kullback divergence
    kl_loss = -0.5 * K.mean(1 + z_logv - K.square(z_mean) - K.exp(z_logv), axis=-1)

    # print message for debugging
    #kl_loss = tf.Print(kl_loss, [tf.shape(lv1_loss)[0]], message='DEBUG', summarize=100)

    return perception_loss * per_w + kl_loss  * kbd_w

total_loss_no_vgg_head = Lambda(model_loss_no_vgg_head, output_shape=(1,))([true_image, fake_image])

def model_loss_vgg_head(args):
    jitt, fake  = args

    # join jitt and fake image batches
    jitt_fake  = tf.concat([jitt, fake], axis=0)
    batch_size = tf.shape(jitt_fake)[0] / 2

    # preprocessing before vgg16
    jitt_fake = (jitt_fake + 1.) / 2. * 255.
    jitt_fake = jitt_fake - mean

    # extract features using vgg16
    jitt_fake = make_vgg16('vgg16')(jitt_fake)

    # perception loss
    lv1_loss, lv2_loss, lv3_loss, lv4_loss, lv5_loss = jitt_fake

    lv1_loss = tf.sigmoid(lv1_loss)
    lv2_loss = tf.sigmoid(lv2_loss)
    lv3_loss = tf.sigmoid(lv3_loss)
    lv4_loss = tf.sigmoid(lv4_loss)
    lv5_loss = tf.sigmoid(lv5_loss)

    lv1_loss = 0.5 * K.mean(K.square(lv1_loss[:batch_size] - lv1_loss[batch_size:]), axis=[-3, -2, -1])
    lv2_loss = 0.5 * K.mean(K.square(lv2_loss[:batch_size] - lv2_loss[batch_size:]), axis=[-3, -2, -1])
    lv3_loss = 0.5 * K.mean(K.square(lv3_loss[:batch_size] - lv3_loss[batch_size:]), axis=[-3, -2, -1])
    lv4_loss = 0.5 * K.mean(K.square(lv4_loss[:batch_size] - lv4_loss[batch_size:]), axis=[-3, -2, -1])
    lv5_loss = 0.5 * K.mean(K.square(lv5_loss[:batch_size] - lv5_loss[batch_size:]), axis=[-3, -2, -1])

    # kullback divergence
    kl_loss = -0.5 * K.mean(1 + z_logv - K.square(z_mean) - K.exp(z_logv), axis=-1)

    # print message for debugging
    #kl_loss = tf.Print(kl_loss, [tf.shape(lv1_loss)[0]], message='DEBUG', summarize=100)

    return lv1_loss * lv1_w + lv2_loss * lv2_w + lv3_loss * lv3_w + \
           lv4_loss * lv4_w + lv5_loss * lv5_w + kl_loss  * kbd_w

total_loss_vgg_head = Lambda(model_loss_vgg_head, output_shape=(1,))([jitt_image, fake_image])

# models and encoder
model_vgg_head      = Model([true_image, jitt_image], total_loss_vgg_head)

This is the code to make the multi-GPU mode:
gdev_list = get_available_gpus()
mgpu_model = make_parallel(model_vgg_head, gdev_list)

I encountered this error when I run mgpu_model.fit_generator. Can you give me some pointers on how to fix this problem? Thanks in advance.

@experiencor Did you run .compile? Could you post the print out of the model? Run this:
from keras_exp.multigpu import print_mgpu_modelsummary

# your code above
print_mgpu_modelsummary(mgpu_model)

I wasn't able to build the model just off the code you posted. There's a missing function and parameters that I'm not sure where they come from.
Parameters Unspecified:
FRAME_H, FRAME_W, latent_dim, epsilon_std, per_w, kbd_w, lv1_w, lv2_w, lv3_w, lv4_w, lv5_w

Function Not Defined:
make_vgg16

The other parameters/layers I figured out:
from keras.models import Model
from keras.layers import (
    Input, Lambda, Dense, Reshape, Deconv2D, BatchNormalization, LeakyReLU,
    Activation, Flatten)
import keras.backend as K
import tensorflow as tf

Ideally if you can share a working single GPU slimmed down example I'll debug it and try to run it with multiple GPUs. If there's proprietary code you don't want to share then at least please post the output of print_mgpu_modelsummary(mgpu_model) so I can see the layers and dimensions.
Maybe there's a bug in how I'm slicing and concatenating with multi-inputs, but I need more info.

This is due to a bug in my model construction code.


Update contents of make_env.yml to match requirements.txt

The contents of the file make_env.yml seem to be outdated and out of synch with requiremens.txt:
make_env.yml
https://github.com/catalystneuro/buzsaki-lab-to-nwb/blob/7e7c9c2f7469c652b3de3f1d6bc2ffe06b24d426/make_env.yml#L1-L21
requirements.txt
https://github.com/catalystneuro/buzsaki-lab-to-nwb/blob/7e7c9c2f7469c652b3de3f1d6bc2ffe06b24d426/requirements.txt#L1-L19
Is there a reason for this mismatch?
I am intending to update the make_env.yml file to make it match as I have been using it in dandi to run our conversion.
Can I move forward with this @CodyCBakerPhD ?

Never used the make_env.yml myself - go right ahead if you want to synchronize the two.

as I have been using it in dandi to run our conversion.
Not sure what you mean by this, though - you should just be able to clone the repo, pip install -e buzsaki-lab-to-nwb in a fresh environment, and run it from there. Full environment specification is more for communicating python versions and/or conda vs. pip install sources

pip install -e buzsaki-lab-to-nwb is failing on dandy for me and producing the following error:
ERROR: No matching distribution found for scipy==1.4.1

The following just worked fine for me on the Hub
# log in
bash
conda create -n test_buz_install python=3.7
git clone https://github.com/catalystneuro/buzsaki-lab-to-nwb
pip install -e buzsaki-lab-to-nwb

Do make sure you always have the intended python version and a fresh environment.
In debugging matching distribution errors, it's also helpful to check PyPI itself for published versioning: https://pypi.org/project/scipy/#history

Also, if all else fails in these situations, you can always precisely match the installation structure of the continuous integration test that routinely verifies the package is installable in this fashion - https://github.com/catalystneuro/buzsaki-lab-to-nwb/blob/master/.github/workflows/install.yml

@CodyCBakerPhD can we bump up the scipy dep version? I don't think it is compatible with the latest versions of Python

@bendichter Sure, I can just update everything to 3.9 and include looser versioning on the central tools as well. I'll try to get that out tomorrow

@CodyCBakerPhD See my PR here

The following just worked fine for me on the Hub
# log in
bash
conda create -n test_buz_install python=3.7
git clone https://github.com/catalystneuro/buzsaki-lab-to-nwb
pip install -e buzsaki-lab-to-nwb

Do make sure you always have the intended python version and a fresh environment.
In debugging matching distribution errors, it's also helpful to check PyPI itself for published versioning: https://pypi.org/project/scipy/#history

Indeed, as per Ben's comment, it was the version of Python causing the problem.
Question, the latest version of nwb-conversio-tools is one patch ahead of our requirements here (requirements here are nwb-conversion-tools==0.9.3 whereas the latest version is nwb-conversion-tools==0.9.4. How do we handle these issues? when do we align the requirements? with minor releases?

Question, the latest version of nwb-conversio-tools is one patch ahead of our requirements here (requirements here are nwb-conversion-tools==0.9.3 whereas the latest version is nwb-conversion-tools==0.9.4. How do we handle these issues? when do we align the requirements? with minor releases?

There shouldn't be any major breaks to back compatibility until major version increments like v0.10.0, so in that case we keep versions in a repo like this pinned to whatever. I guess we really should just make different requirements for each conversion though unless we do want to go back and update previous conversions with new API changes. For all intents and purposes, you can always just use master branch of nwbct and you'll be fine.

@h-mayorquin Can you make a PR for this? Should be really easy, I know you were kind of already doing this locally on your end.


Place Order doesn't work

Hello. Great work on this plugin.
I installed the plugin and noticed that it errors out at the last step (clicking the place order button). The problem is that the script doesn't wait for the button to be enabled. I was able to fix it by adding await page!.waitForSelector(place_order_btn);. After that it almost worked. I added another await page!.click(place_order_btn); to the bottom and now it works.

Thanks for letting me know! I will push an update soon using your proposed solution!


Config option

Hi,
could you explain in detail how these 3 parameters influence the connection? Are these per client or per room or per server? Especially the maxIncomingBitrate.
                        initialAvailableOutgoingBitrate : 1000000,
                        minimumAvailableOutgoingBitrate : 600000,
                        // Additional options that are not part of WebRtcTransportOptions.
                        maxIncomingBitrate              : 2000000

initialAvailableOutgoingBitrate is the initial bandwidth estimation for a receiver that the server assumes. This means that the server will start sending at this bandwidth (assuming the transport to the client has a bandwidth at least this high because of video-streams) to the client.
minimumAvailableOutgoingBitrate is actually deprecated, and will be removed.
maxIncomingBitrate is the maximum bandwidth a client is allowed to send to the server in total. This means for example that if this value is lower, you will never be able to send high resolution from the client.

It's worth noting that if you have simulcast enabled you will not be able to have as high resolution sent from the client because all layers of the simulcast video must fit inside maxIncomingBitrate.

Thank you very much. How do I set simulcast to be enabled or disabled?

I have just committed d64247d12dfd458e79046631e94a89b979b496ea that exposes this setting to the client config.

I have tested it. Works great! Thank you very much. My users reported that when using simulcast the overall QoE is much worse, as very often the video gets reduced to lowest resolution and stays like this for a longer time. The prefer to have not so smooth picture and some jumps when the network is bad, but higher resolution.