argtopk for dask arrays

I am trying to implement an argtopk function, but can't quite isolate the topk function of dask.
It would give the indices to the top k elements in additional to the values of the top k elements.
Can we have a function like that?

What collection are you refering to? dask.array? dask.bag? dask.dataframe?

We don't have argtopk but we do have topk. This should be fairly straightforward to implement though. You'd want to keep track of the absolute indices of each value you keep when doing the map step. Then at the end you'd add the appropriate chunk-wise offsets to the indices before doing the final reduction. A similar approach is taken in other da.arg* functions. This would be a welcome addition if you feel up for submitting a PR 😄.

The following repository has an argtopk function...

You are correct in your analysis here. That code is also very old, and I wouldn't use it as a reference.

I also responded to your stackoverflow question. Copying my response here:

Your example above fails  because you're using code you copied from the master branch with an  older dask install. Some of the non-public methods were renamed in the  last few weeks. Your code above works if you install dask from master.

I installed master branch. but the following code still fails.
import numpy as np
import dask.array as da
from dask.base import tokenize
from operator import getitem
import dask.sharedict as sharedict
from dask.array.core import Array

def topk(k, x):
    if x.ndim != 1:
        raise ValueError("Topk only works on arrays of one dimension")

    token = tokenize(k, x)
    name = 'chunk.topk-' + token
    dsk = {(name, i): (topk, k, key)
           for i, key in enumerate(x.__dask_keys__())}
    name2 = 'topk-' + token
    dsk[(name2, 0)] = (getitem, (np.sort, (np.concatenate, list(dsk))),
                       slice(-1, -k - 1, -1))
    chunks = ((k,),)

    return Array(sharedict.merge((name2, dsk), x.dask), name2, chunks, dtype=x.dtype)

def main():
    x = np.arange(12)*8
    y = da.from_array(x, 7)
    print(y.topk(2).compute())
    print(topk(2, y).compute())

main()

You didn't accurately extract the topk routine. This runs fine:
from operator import getitem

import numpy as np
import dask.array as da
from dask import sharedict
from dask.base import tokenize

def topk(k, x):
    if x.ndim != 1:
        raise ValueError("Topk only works on arrays of one dimension")

    token = tokenize(k, x)
    name = 'chunk.topk-' + token
    dsk = {(name, i): (da.chunk.topk, k, key)
           for i, key in enumerate(x.__dask_keys__())}
    name2 = 'topk-' + token
    dsk[(name2, 0)] = (getitem, (np.sort, (np.concatenate, list(dsk))),
                       slice(-1, -k - 1, -1))
    chunks = ((k,),)

    return da.Array(sharedict.merge((name2, dsk), x.dask), name2, chunks, dtype=x.dtype)

x = np.arange(10)
y = da.from_array(x, chunks=5)
print(topk(2, y).compute())

But that uses "da.chunk.topk" in this line, instead of the topk function within the code.
dsk = {(name, i): (da.chunk.topk, k, key)

Yes, it needs to. There are two topk functions:

da.routines.topk (and the da.Array.topk method that calls it). This takes a dask array and returns a dask array representing the topk elements
da.chunk.topk, which operates on the individual numpy array chunks that compose the larger input array to the above.

If you use the same one for both you'll get errors.

I tried to implement axis keyword for topk:
https://stackoverflow.com/questions/47106057/dask-implementing-axis-keyword-for-topk

I tried to use dask's reduction to make argtopk.
Somehow, it doesn't work. I don't know why.
I am trying to isolate argmin of dask.array now.
Program:
import numpy as np
import dask.array as da
import dask
from functools import partial
import dask.array.reductions
from dask.array.chunk import keepdims_wrapper

# -- Utility -------------------------------------------------------------------
def tuple_replace(tuple_in, ind, new_element):
    """Make new tuple with the ind^{th} element replaced
    Parameters
    ----------
        tuple_in : tuple
            the input tuple, which is not modified.
        ind : int
            We want to replace the element at tuple_in[ind] by the new element.
        new_element : object
            The new element.
    Returns
    -------
        new_tuple : tuple
            The new tuple.
    """
    t_as_list = list(tuple_in)
    t_as_list[ind] = new_element
    return tuple(t_as_list)

def index_along_axis(ind, axis, shape=None):
    """Convert indexing along an axis to proper multi-index or flat index
    Parameters
    ----------
        ind : np.ndarray
            Indexing of an array along an axis.
            For a 2D array arr and axis=1, this means: from each column of
            arr, select elements along the column by the indices at the
            corresponding column of ind. In other words, the ith column of
            the result is arr[ind[:, i], i].
        axis : int
        shape : tuple
            Shape of the array that is indexed by ind. If this is None,
            the function returns a multi-index. Otherwise, the function
            returns a flat index.
    Returns
    -------
        proper_index : tuple or np.ndarray
            if shape is None, return the multi-indexing equivalent to ind.
            if arr is provided, return the flat indexing equivalent to ind.
    Example
    -------
        >>> import numpy as np
        >>> arr = np.flip(np.arange(8).reshape(2, 4), axis=1)  # test array
        >>> ind = np.argsort(arr, axis=1)  # indexing along axis 1
        >>> multi_ind = index_along_axis(ind, axis=1)  # convert to multi-index
        >>> multi_ind
        (array([[0],
               [1]]), array([[3, 2, 1, 0],
               [3, 2, 1, 0]]))
        >>> flat_ind = index_along_axis(ind, axis=1, shape=arr.shape)
        >>> flat_ind  # show the flat indexing
        array([[3, 2, 1, 0],
               [7, 6, 5, 4]])
        >>> a = np.sort(arr, axis=1)  # the indexing give the expected result.
        >>> a
        array([[0, 1, 2, 3],
               [4, 5, 6, 7]])
        >>> np.all(a == arr[multi_ind]) and np.all(a == arr.flatten()[flat_ind])
        True
    """
    # https://stackoverflow.com/questions/47044792 by Divakar
    # Does not check if axis is legal
    idx = np.ogrid[tuple(map(slice, ind.shape))]
    idx[axis] = ind
    idx = tuple(idx)
    if shape is None:
        return idx
    else:
        return np.ravel_multi_index(idx, dims=shape)

# -- Chunk ---------------------------------------------------------------------
def topk_over_chunk(k, x, axis=-1):
    """Get the top k elements in a numpy array along an axis
    The k elements are also sorted along the axis from large to small.
    Parameters
    ----------
        k : int
            number of elements to selected along the axis
        x : np.ndarray
            the array
        axis : int
            the axis
    Returns
    -------
        topk_array : np.ndarray
            k largest elements along the axis
    """
    k = min(k, x.shape[axis])
    p = np.partition(x, -k, axis=axis)
    # get last k elements, which are not sorted
    s = -1 - np.arange(k, dtype=int)
    topk_arr = p.take(s, axis=axis)
    # Sort from large to small along the axis.
    topk_sorted = np.flip(np.sort(topk_arr, axis=axis), axis=axis)
    return topk_sorted

def argtopk_over_chunk(k, x, axis=-1):
    """Get the indices to the top-k elements in a numpy array along an axis
    The k elements are sorted along the axis from large to small.
    Parameters
    ----------
        k : int
            number of elements to selected along the axis
        x : np.ndarray
            the array
        axis : int
            the axis
    Returns
    -------
        argtopk_array : np.ndarray
            indices to the k largest elements along the axis
    """
    k = min(k, x.shape[axis])
    s = -1 - np.arange(k, dtype=int)

    # get indices to the top-k elements, which are not sorted
    arg_p = np.argpartition(x, -k, axis=axis)
    argtopk_arr = arg_p.take(s, axis=axis)

    # get the top-k elements, which are not sorted
    p = np.partition(x, -k, axis=axis)
    topk_arr = p.take(s, axis=axis)

    # Argsort the top-k elements from large to small along the axis.
    argtopk_sorted = np.flip(np.argsort(topk_arr, axis=axis), axis=axis)

    # Apply indices from argsort of top-k elements to the overall indices to
    # the top-k elements
    return argtopk_arr.reshape(-1)[argtopk_sorted]

def topk_chunks(k, x, axis):
    """Calculate new chunk shape for mapping argtopk or topk over a dask array.
    Parameters
    ----------
        k : int
            number of elements to selected along the axis
        x : dask.core.Array
            the dask array
        axis : int
            the axis
    Returns
    -------
        chunks : tuple
            chunk shape.
    """
    return tuple_replace(
        x.chunks, axis,
        tuple([min(k, c) for c in x.chunks[axis]])
    )

# -- Overall -------------------------------------------------------------------
def argtopk(k, x, axis):
    topk_chunk_f = keepdims_wrapper(partial(topk_over_chunk, k))
    argtopk_chunk_f = keepdims_wrapper(partial(argtopk_over_chunk, k))
    callable = dask.array.reductions.make_arg_reduction(
        topk_chunk_f, argtopk_chunk_f)
    return callable(x, axis)

# -- Main ----------------------------------------------------------------------
def main():
    dask.set_options(get=dask.get)
    x = np.arange(8).reshape(2, 4)
    y = da.from_array(x, 2)
    k = 2

    print("original:")
    print(y.compute())
    for axis in range(x.ndim):
        print("---- axis: %d, k: %d ----" % (-axis, k))
        r = argtopk(k, y, -axis)
        r.visualize('test.png')
        print(r.compute())

main()

Result:
original:
[[0 1 2 3]
 [4 5 6 7]]
---- axis: 0, k: 2 ----
Traceback (most recent call last):
  File "<dir>/dask_extend/argtopk/argtopk1.py", line 190, in <module>
    main()
  File "<dir>/dask_extend/argtopk/argtopk1.py", line 187, in main
    print(r.compute())
  File "<python3.5>/site-packages/dask/base.py", line 99, in compute
    (result,) = compute(self, traverse=False, **kwargs)
  File "<python3.5>/site-packages/dask/base.py", line 206, in compute
    results = get(dsk, keys, **kwargs)
  File "<python3.5>/site-packages/dask/local.py", line 562, in get_sync
    return get_async(apply_sync, 1, dsk, keys, **kwargs)
  File "<python3.5>/site-packages/dask/local.py", line 529, in get_async
    fire_task()
  File "<python3.5>/site-packages/dask/local.py", line 504, in fire_task
    callback=queue.put)
  File "<python3.5>/site-packages/dask/local.py", line 551, in apply_sync
    res = func(*args, **kwds)
  File "<python3.5>/site-packages/dask/local.py", line 295, in execute_task
    result = pack_exception(e, dumps)
  File "<python3.5>/site-packages/dask/local.py", line 290, in execute_task
    result = _execute_task(task, data)
  File "<python3.5>/site-packages/dask/local.py", line 271, in _execute_task
    return func(*args2)
  File "<python3.5>/site-packages/toolz/functoolz.py", line 468, in __call__
    ret = f(ret)
  File "<python3.5>/site-packages/dask/array/reductions.py", line 516, in arg_agg
    return _arg_combine(data, axis, argfunc, keepdims=False)[0]
  File "<python3.5>/site-packages/dask/array/reductions.py", line 472, in _arg_combine
    vals = vals[inds]
IndexError: too many indices for array

dask's _arg_combine get a 3D array from the code for argtopk
dask's _arg_combine get a 2D array from the following isolation of argmin.
Partially isolated argmin:
import numpy as np
import dask.array as da
import dask
import dask.array.reductions
from dask.array.chunk import keepdims_wrapper

# -- Overall -------------------------------------------------------------------
def argmin(x, axis):

    min_chunk_f = keepdims_wrapper(np.min)
    argmin_chunk_f = keepdims_wrapper(np.argmin)
    callable = dask.array.reductions.make_arg_reduction(
        min_chunk_f, argmin_chunk_f)
    return callable(x, axis)

# -- Main ----------------------------------------------------------------------
def main():
    dask.set_options(get=dask.get)
    x = np.arange(12).reshape(3, 4)
    y = da.from_array(x, 2)

    print("original:")
    print(y.compute())
    axis = 0
    print("---- axis: %d ----" % (-axis))
    r = argmin(y, -axis)
    r.visualize('test.png')
    fin = r.compute()
    print("final result", fin)

main()

Result:
original:
[[ 0  1  2  3]
 [ 4  5  6  7]
 [ 8  9 10 11]]
---- axis: 0 ----
DEBUG
arg:
[[0 0]
 [2 2]]
---- debug ----
vals:
[[0 1]
 [8 9]]
inds:
[array([0, 0]), array([0, 1])]
---- end debug ----
vals[inds]:
[0 1]
arg[inds]:
[0 0]
DEBUG
arg:
[[0 0]
 [2 2]]
---- debug ----
vals:
[[ 2  3]
 [10 11]]
inds:
[array([0, 0]), array([0, 1])]
---- end debug ----
vals[inds]:
[2 3]
arg[inds]:
[0 0]
final result [0 0 0 0]

Probably I can't use the arg_reduction function in dask.array.reductions to implement argtopk.
I guess arg_reduction expected that each chunk is reduced to a dimension of 1 along the target axis.
This is because of the new chunk shape that arg_reduction calculates.
The comments I added starts with {{ and ends with }}.
def arg_reduction(x, chunk, combine, agg, axis=None, split_every=None,
                  out=None):
    """Generic function for argreduction.

    Parameters
    ----------
    x : Array
    chunk : callable
        Partialed ``arg_chunk``.
    combine : callable
        Partialed ``arg_combine``.
    agg : callable
        Partialed ``arg_agg``.
    axis : int, optional
    split_every : int or dict, optional
    """
    if axis is None:
        # {{ Does axis == None mean to perform reduction over all axes? }}
        axis = tuple(range(x.ndim))  # {{ axis can be a tuple of integers }}
        ravel = True
    elif isinstance(axis, int):
        # {{
        # Normalize the axis.
        #     Might be simpler to use:
        #         axis = np.core.multiarray.normalize_axis_index(axis, x.ndim)
        #         axis = (axis,)
        # }}
        if axis < 0:
            axis += x.ndim
        if axis < 0 or axis >= x.ndim:
            raise ValueError("axis entry is out of bounds")
        axis = (axis,)
        ravel = x.ndim == 1  # {{ Check if we need to ravel }}
    else:
        raise TypeError("axis must be either `None` or int, "
                        "got '{0}'".format(axis))

    # Map chunk across all blocks
    name = 'arg-reduce-chunk-{0}'.format(tokenize(chunk, axis))
    old = x.name
    # {{
    # keys is the list of multi-indices for each element of the array.
    # For example, an 2 x 3 array would have keys:
    #     (0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2)
    # }}
    keys = list(product(*map(range, x.numblocks)))
    # {{
    # offsets is the list of offsets of each chunk within the overall array
    # For example,
    #     a chunk shape of ((2,), (2, 2)) mean the overall array is:
    #         *a------*b------+
    #         | 2 x 2 | 2 x 2 |
    #         +-------+-------+
    #         chunk0  chunk1
    #
    #     The offset of chunk0 is (0, 0), which is the coordinate of the *a
    #     corner within the overal array.
    #     The offset of chunk1 is (0, 2), which is the coordinate of the *b
    #     corner within the overall array.
    # }}
    offsets = list(product(*(accumulate(operator.add, bd[:-1], 0)
                             for bd in x.chunks)))
    if ravel:
        # {{ offset_info is a generator that yields (offset, shape of overall
        # array) for each chunk in the overall array. }}
        offset_info = zip(offsets, repeat(x.shape))
    else:
        # {{
        # Get the offset of all chunks over the 0th target axis as a map
        # Example:
        #     axis:              (0,)
        #     offset:            [(0, 0), (0, 2)]
        #     0th target axis:   axis[0], which is 0
        #     list(offset_info): [0, 0]
        # }}
        offset_info = pluck(axis[0], offsets)

    # {{ Calculate new chunks }}
    chunks = tuple((1,) * len(c) if i in axis else c for (i, c)
                   in enumerate(x.chunks))

    dsk = dict(((name,) + k, (chunk, (old,) + k, axis, off)) for (k, off)
               in zip(keys, offset_info))
    # The dtype of `tmp` doesn't actually matter, just need to provide something
    tmp = Array(sharedict.merge(x.dask, (name, dsk)), name, chunks,
                dtype=x.dtype)
    dtype = np.argmin([1]).dtype
    result = _tree_reduce(tmp, agg, axis, False, dtype, split_every, combine)
    return handle_out(out, result)


Don't let the header overlap with each other

fixes https://github.com/microsoft/pxt-arcade/issues/3322
This is the best way I could think of to fix this :\ -> After we render the menu bar, check all the UI elements under the parent and add up the widths. If it's bigger than the screen width, add a class to the menu bar, "shrink", which will hide all elements with the landscape class (like tutorial name, text on the exit button)
One weird thing that's happening that I don't know if it's a result of me not understanding React or this change, is when the MainMenu element rerenders, it keeps the "shrink" class, which makes going from not shrunk -> shrunk a one way street until you refresh the page.
This is a window at (1200x649), which is the dimension of the Pixelbook I have:

And with these changes:

And this shows the one-way street ness of it :\

one possible alternative is you could add a CSS class if there are many steps in a tutorial (eg > 10 steps), then in the CSS you could set a media breakpoint to shrink the button if the "many tutorial steps" CSS class is present--if that makes sense?

oh yeah makes sense! I'll bring to office hours today and we can decide which way we prefer?

@shakao okay I think I actually understood what you meant this time -- instead of calculating the rendered width of all the elements, I made an estimate by the number of tutorial steps, and added a class in the mainmenu div.
(I wasn't 100% sure about the media breakpoint though and took a stab 😓 let me know if that was off base lol)


Use react-router NavLink component instead of insane logic for handling selected menu options

https://reactrouter.com/web/api/NavLink

See docs for example https://reactrouter.com/web/api/NavLink
This will greatly improve the readability of the current code by removing the ugly management of selected menu item in:
https://github.com/AutoPacker-OSS/autopacker/blob/bb207c29c0da19e836ff3f24a461f4020287427c/web-application/src/store/reducers/generalReducer.js#L43 (function selectMenuOption & toggleSubMenu).
These and there corresponding actions can be deleted, and we can use the  component inside react-router-dom instead

This has been done for profileDashboard routes


VariableGroup doesn't work with key_vault parameter (2)

What happened?
Same as in #52, which was fixed in v2.5.0 but reappeared again since version 2.6.0 of the provider.
Expected Behavior
Same as in #52
Steps to reproduce
Same as in #52
Output of pulumi about
Same as in #52, but with v2.6.0 or v2.8.0 of the provider.
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

Thank you for reporting this! Recent versions of the bridge moved validation to the CheckConfig method and I suspect validations were disabled for a while because Configure method does not report errors; hence this issue resurfaced.
I was having a quick look @ringods but hitting a few snags. The creds in Pulumi Bot - Azure DevOps  1Password seem to complain
       * According to Azure Active Directory, your Identity 27d5a3ac-ce94-4bbb-a257-f1a28704a292 is currently Deleted within the following Azure Active Directory: pulumi.com. Please contact your AAD administrator to resolve this.  For more information please read https://go.microsoft.com/fwlink/?linkid=2007012

I'm asking around. Do you have a working set of test credentials to repro?
The second issue is that the program is very fragmentary. Do you have a bit of a more fleshed out example? If not I can try to manufacture something but it is always a time-saver to have a complete repro.

This was fixed with https://github.com/pulumi/pulumi-terraform-bridge/pull/1583 and released in 2.14.2


Add temperature map

Implement a noise map that modifies the temperature at each point on Torys' surface. This temperature map could be combined with the altitude of the terrain at each point to create more natural-looking terrain features like snow, deserts, and low tundras.

A simple temperature map has been implemented. The effect isn't very noticeable, but it does create sandy beaches in places.


Boolean sometimes not imported correctly (all 'false')

Need to check the implementation for writing booleans to Neo4j admin import files; happened that regular Python bool values were all imported as 'false' (Neo4j seems to write bools lower case).

First step would probably be to write some more specific tests


JSON Event ID Lost When Published to Bus

Fix #1339
It's not feasible to set the bytes for a JSON event when the event is
read into core-data. This is because those bytes won't contain the new
event ID obtained during persistence. Marshal the event at the time of
publication if the Content-Type is application/json.
Signed-off-by: Trevor Conn<EMAIL_ADDRESS>

recheck


Pressing enter/return on request call page is calling onPress function - reported by @Tushu17

If you haven’t already, check out our contributing guidelines for onboarding and email<EMAIL_ADDRESS>to request to join our Slack channel!

Action Performed:

Open Workspace then general settings
Go to Get assitance page
Click on Request a setup Call
Select any field and press Enter/Return

Expected Result:
Pressing Enter/return should press the Call me button
Actual Result:
Workspace general settings Save button is getting pressed on enter.
Workaround:
unknown
Platform:

Where is this issue occurring?

Web
Desktop App
Mobile Web

Version Number: 1.1.37-0
Reproducible in staging?: Y
Reproducible in production?: Y
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL:
Issue reported by: @Tushu17
Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1643573796542919
View all open jobs on GitHub

Triggered auto assignment to @timszot (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

Proposal
We need to pass pressOnEnter in Button
https://github.com/Expensify/App/blob/78d6e68705ba5b986650cc93187f56f553d1bc23/src/pages/RequestCallPage.js#L352-L356

post here

Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane (Exported)

Triggered auto assignment to @thienlnam (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

🎀👀🎀 C+ reviewed
@Tushu17's proposal fixes the issue.
cc: @thienlnam

This creates an interesting case here. Pressing enter run an action on the backgrounded Page.  This could be a problem in many places.
So with regard to the change that @Tushu17 has suggested. I think it would be great if pressOnEnter only acts when the page is action/focused. Thoughts @rushatgabhane ?

@parasharrajat I had the same thinking but the background action isn't run for this issue.
https://user-images.githubusercontent.com/29673073/153073935-f7cfad56-9ab0-4862-8234-83b151866f0e.mp4

This could be a problem in many places.
pressOnEnter should only act when the page is active/focused

Thanks for bringing this up. I agree that we should fix this
https://user-images.githubusercontent.com/29673073/153075748-a9b47566-3c22-442c-9250-60dfa207cd6b.mp4

Agreed, a fix should encapsulate the problem here which is that

Pressing enter run an action on the backgrounded Page

Okay, that works too.
@Tushu17 feel free to post an updated proposal which prevents pressOnEnter for backgrounded pages. Thanks!

waiting for proposals

Proposal
I would suggest a method which uses React SyntheticEvent onKeyPress={this.handeKeyPress} and pass it as a prop to the <TextInput/> and <FullNameInputRow/> components. The function will not do anything if a key, other than Enter/Return is pressed and it will trigger the onSubmit() function which is used for Call Me button.
RequestCallPage.js file
In the RequestCallPage.js file add onKeyPress={this.handeKeyPress} to both <TextInput/>  components used for Phone number and Extension(Optional) and also to the <FullNameInputRow/> like bellow
<FullNameInputRow
                                firstName={this.state.firstName}
                                firstNameError={PersonalDetails.getMaxCharacterError(this.state.hasFirstNameError)}
                                lastName={this.state.lastName}
                                lastNameError={PersonalDetails.getMaxCharacterError(this.state.hasLastNameError)}
                                onChangeFirstName={firstName => this.setState({firstName})}
                                onChangeLastName={lastName => this.setState({lastName})}
                                style={[styles.mv4]}
+                               onKeyPress={this.handleKeyPress}
                            />

<TextInput
                                        label={this.props.translate('common.phoneNumber')}
                                        autoCompleteType="off"
                                        autoCorrect={false}
                                        value={this.state.phoneNumber}
                                        placeholder="2109400803"
                                        errorText={this.state.phoneNumberError}
                                        onBlur={this.validatePhoneInput}
+                                       onKeyPress={this.handleKeyPress}
                                        onChangeText={phoneNumber => this.setState({phoneNumber})}
                                    />

The handleKeyPress needs to be binded in the constructor
this.onSubmit = this.onSubmit.bind(this);
+ this.handleKeyPress = this.handleKeyPress.bind(this);
this.getPhoneNumber = this.getPhoneNumber.bind(this);

In the handleKeyPress(e) function the e.preventDefault() will make the input remain in focus when an error is returned, for example, and then calls the this.onSubmit() to process the submit request. Also it will check if a key, other than Enter is pressed and return nothing.
handleKeyPress(e) {
        if (e.key !== 'Enter') {
            return;
        }
        e.preventDefault();
        this.onSubmit();
    }

FullNameInputRow.js file
Lastly, in the FullNameInputRow.js file, the function onKeyPress received as a prop will be added to both <TextInput/> components used for First Name and Last Name
 /** Called when a key is pressed */
    onKeyPress: PropTypes.func,

<TextInput
                    label={props.translate('common.lastName')}
                    value={props.lastName}
                    errorText={props.lastNameError}
                    onChangeText={props.onChangeLastName}
                    placeholder={props.translate('profilePage.doe')}
+                   onKeyPress={props.onKeyPress}
                />

Because this component is also used in the ProfilePage.js the onKeyPress will have the default value null.
const defaultProps = {
+   onKeyPress: null,
    firstName: '',

Thank you for reading! :)

Hi @Varanu, thanks for your proposal. We're looking for proposals which prevent pressOnEnter for backgrounded pages.

Still waiting on proposals for a fix that will encapsulate all backgrounded pages

Same as above, @jboniface could we get this bounty doubled please?

@thienlnam oh, sorry, yeah, I usually only do it when it goes overdue so didn't see this.

I got a notification and I saw there are no proposals based on the required changes so I would like to propose one.
Proposal.
Based on requirements, we have to prevent the back buttons from firing the callback when those screens are not active and Pressing enter on the Request call page should request it.
To achieve this,

use withNavigationFocus on the Button component. It will give a prop isFocused which will allow us to determine if the button is on active screen.

Then we use this prop on https://github.com/Expensify/App/blob/f916215d27943ff3115d10cf9330d64e744b97e5/src/components/Button.js#L127 to prevent the callback from firing.

    if (!this.props.isFocused || this.props.isDisabled ......

Now, we add pressOnEnter on the  Button on RequestCallPage https://github.com/Expensify/App/blob/f916215d27943ff3115d10cf9330d64e744b97e5/src/pages/RequestCallPage.js#L351

All set.

@thienlnam all yours, unassigning myself because Rajat doesn't need a C+ review

@thienlnam can we proceed?

My bad, missed this - for next time @rushatgabhane you can still review C+ proposals, the process would just be the same as reviewing any other proposal

Yup, @parasharrajat's proposal looks good 🟢

📣 @parasharrajat You have been assigned to this job by @jboniface!
Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻
Keep in mind: Code of Conduct | Contributing 📖

If C+ team member is hired to fix an issue, no other C+ should be assigned and no one should be compensated for C+. https://expensify.slack.com/archives/C01GTK53T8Q/p1642634857222800

@thienlnam sure but, I guess I'll need to explicilty ask for that.

Haven't forgotten it. I will update the screenshots today and mark the PR ready.

Heads up, I am reverting the changes in both of the submitted PRs related to this issue.

Got It. I will find another approach to the issue.

Since this (WorkspaceSettingsPage) is a screen component it receives relevant navigation context
You can just change this
https://github.com/Expensify/App/blob/50496a0a0d7dd283f9936988cda95abf69741342/src/pages/workspace/WorkspaceSettingsPage.js#L127-L135
to:
<Button
    success
    pressOnEnter
    isLoading={this.props.policy.isPolicyUpdating}
    isDisabled={!this.props.navigation.isFocused()} // add this
    text={this.props.translate('workspace.editor.save')}
    onPress={this.submit}
/>

Or:
<Button
    success
    isLoading={this.props.policy.isPolicyUpdating}
    text={this.props.translate('workspace.editor.save')}
    onPress={this.submit}
    pressOnEnter={!this.props.navigation.isFocused()}
/>

If the handling of the pressOnEnter prop is modified a bit

Or maybe it would be best to add the check here:
https://github.com/Expensify/App/blob/50496a0a0d7dd283f9936988cda95abf69741342/src/pages/workspace/WorkspaceSettingsPage.js#L92-L95
 submit() {
     if (this.props.policy.isPolicyUpdating || !this.props.navigation.isFocused() || !this.validate()) {
         return;
     }

This way isFocused() is evaluated just in time
(Otherwise it depends the component re-rendering, so that isFocused() is called and re-evaluated)

Good points overall. But the motive behind doing that change was to cover all pages. This is a generic issue so I thought of handling it everywhere I have another idea.
As we changed the keyboard shortcut implementation now, we can just stop the even propagation at the Button handler. Then it will not propagate to other elements.
We are running the handler in the capture phase, it won't block other immediate targets from receiving it. All the local event handlers are attached in the bubble phase.

Good points overall. But the motive behind doing that change was to cover all pages. This is a generic issue so I thought of handling it everywhere I have another idea.

Ok so it seems it's never desired to have 2 or more buttons with the pressOnEnter prop
Or if there are more than one, only the last button that appeared should be triggered on enter
Is that correct?

As we changed the keyboard shortcut implementation now, we can just stop the even propagation at the Button handler. Then it will not propagate to other elements.

I don't understand how that would happen
The bug here is happening because the event handler of the "Save" button from the previous page is triggered first
And it's the one stopping propagation - the "Enter" event is not triggered at all on the "Request a setup Call"
Events are triggered in order of subscription, for this to work they have to be iterated in reverse order
Is that what you're proposing?

Is that correct?

I think yes. pressOnEnter is meant for CTA. I guess there would be only one per page.

Events are triggered in order of subscription, for this to work they have to be iterated in reverse order
Is that what you're proposing?

Oh yeah, didn't think of this. I was just seen at an alternative. I guess this will not work. Let me see what else is possible without refactoring too much code.

I will soon update you here on the status.

Ok, I tried to think of a solution that works with all the buttons.

If we want to apply the logic without touching those pages, then we will have to go with my old PR. To remove the regression, I will create a HOC then will catch the error and return true for isFocused when NavigationContext is not available.
Other solution would be use

<Button
    success
    isLoading={this.props.policy.isPolicyUpdating}
    text={this.props.translate('workspace.editor.save')}
    onPress={this.submit}
    pressOnEnter={this.props.navigation.isFocused()}
/>

approach to applying the solution to all pages.

Lastly, I can just add the pressOnEnter on the RequestCallPage and wrap up.

cc: @thienlnam

@parasharrajat Do you think it is a good approach?
We might not need to explicitly register a global event listener for Enter key. TextInput already has onSubmitEditing prop which will be called when user presses Enter.
We have some more custom form component eg. Checkbox. We can pass a props like onSubmitEditing say onEnterPress. The component will internally listen for Enter and calls onEnterPress. We have to do the same thing to other form element if we have.
TextInput does the same thing when calling onSubmitEditing. However, it stops the event propagation and prevents its default behaviour or else we can do this instead on web.
<View accessibilityRole="form" onSubmit={SubmitFunc}>
    // here goes form element
</View>

https://github.com/necolas/react-native-web/blob/dc9ecfbc84c7e6cbf0c36c537ac1b0a86b7e43c1/packages/react-native-web/src/exports/TextInput/index.js#L260-L292

This pressOnEnter seems to be an entirely web/desktop thing as KeyboardShortcut.subscribe does nothing on native
If it's intended to work on mobile then yes onSubmitEditing should be used. Then if you press "Enter/Return" on the onscreen keyboard the form would be submitted  (though this is usually enabled only on the last field of the form, and "Return" moves the focus to the next field
So if this is indeed a web/desktop only behavior the suggestion above would submit only the form that is currently focused:
<View accessibilityRole="form" onSubmit={SubmitFunc}>
    // here goes form element
</View>

the <Button> component would need to have type="submit"

On other apps that I've worked I have a <Form> component with an onSubmit prop that intercepts submit events and triggers the callback

<Form> accepts the name of the field that triggers submit on enter (or fallbacks to the last field if not provided)
<Form> triggers the submit handler if the submit button is pressed
it also takes care of tabbing to the next field from the software keyboard

One thing to note, this is not working on native and it might be intended or not, but it's not clear that pressOnEnter works only on web/desktop
    /** Call the onPress function when Enter key is pressed */
    pressOnEnter: PropTypes.bool,

I would not expect that pressing enter/return would submit a form unless I have currently focused a field inside it

Good points, It could be a extension to our Form component and soon we will refactor all of our forms to use that.

If we want to apply the logic without touching those pages, then we will have to go with my old PR. To remove the regression, I will create a HOC then will catch the error and return true for isFocused when NavigationContext is not available.

This will likely work. I like the idea of checking if the current screen is focused before triggering the pressOnEnter.  But when/why is the NavigationContext not available?

Only if there are stacked pages and when the topmost page does not have pressOnEnter, will show this issue.

I also agree we should solve this main issue instead of updating each page so this will be solved

But when/why is the NavigationContext not available?

when we use the button in the components that are out of React navigator. 99% of the pages are used in navigator except the Error Page. It has two buttons which crashes the app.

Gotcha, let's go ahead with that solution then @parasharrajat

Tried one implementation and it has few problems which I am trying to solve.

Working it now.

@Tushu17 and @parasharrajat  the old job post died, let's use this one https://www.upwork.com/jobs/~01b7767e126c5ee6ae

paid


chore: fix hanging build

Resolves this problem: https://github.com/tinyhttp/tinyhttp/issues/311#issuecomment-914381040
because of this problem: https://github.com/rollup/plugins/issues/983
and I still don't get why you didn't commit the lock file for the main repo. I think that caused Github Actions to hangs because typescript will search for its' newest version instead of the one that pointed on the package.json. See this and this
let me know if you think of something else.

@all-contributors add @aldy505 for fix


Multiple instances of multilingual shortcode not working correctly

Bug Report
Environment
Zola version: 0.17.2
tabi commit: https://github.com/welpo/tabi/commit/761a18da752f29d42e7b75465ce53601bc2b75cf
Expected Behavior
When multiple instances of the multilingual_quote shortcode are used on a page, each instance should function independently. That is, clicking on the "Show original quote/Show translation" link in each quote should only toggle the display of that specific quote.
Current Behavior
When more than one instance of the multilingual_quote shortcode is present on a page, clicking the "Show original quote/Show translation" link on any quote only toggles the display of the first quote on the page, regardless of which quote's link was clicked.
Step to reproduce

Add two instances of the multilingual_quote shortcode to the page, like so:

{{ multilingual_quote(original="Original 1.", translated="Translated 1.", author="Author 1") }}
{{ multilingual_quote(original="Original 2.", translated="Translated 2.", author="Author 2") }}

View the page in a web browser.

Click the "Show original quote" link under the second quote.

Observe that the first quote toggles between the translated and original versions, but the second quote does not change.

This issue arises from the use of the static id toggle for the checkbox input in the multilingual_quote shortcode. In HTML, id attributes are meant to be unique within a document. If there are multiple elements with the same id, only the first one is usually recognized by JavaScript, CSS, and other browser functions, which is why clicking the toggle for any quote only affects the first one.
To address this issue, we can replace the static id toggle with a unique id for each instance of the shortcode. In Tera, we can sort of accomplish this by using the get_random function to generate a random number for each id. Here's a brief example:
{%- set random_id = get_random(end=1000000) -%}
<input type="checkbox" id="toggle{{ random_id }}" class="quote-toggle">
<label for="toggle{{ random_id }}" class="quote-label quote-label-original">

By replacing toggle with toggle{{ random_id }}, we almost ensure that each checkbox has a unique id, which will allow each quote to be toggled independently.
The risk associated with this solution is the slight chance of get_random generating the same number twice, leading to non-unique ids. However, with a large range (e.g., up to 1,000,000), this is very unlikely to happen.


chore(avm): remove avm prefix from pil and executor

Overview
Removes the avm_ prefix from the pil files and from all generated code, its noisy

#7099  👈
master

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @Maddiaa0 and the rest of your teammates on  Graphite

Benchmark results
Metrics with a significant change:

avm_simulation_time_ms (Token:transfer_public): 28.7 (-44%)
protocol_circuit_witness_generation_time_in_ms (private-kernel-init): 461 (-23%)
protocol_circuit_witness_generation_time_in_ms (private-kernel-tail-to-public): 8,085 (+17%)

Detailed results
All benchmarks are run on txs on the Benchmarking contract on the repository. Each tx consists of a batch call  to create_note and increment_balance, which guarantees that each tx has a private call, a nested private call, a public call, and a nested public call, as well as an emitted private note, an unencrypted log, and public storage read and write.
This benchmark source data is available in JSON format on S3 here.
Proof generation
Each column represents the number of threads used in proof generation.

Metric
1 threads
4 threads
16 threads
32 threads
64 threads

proof_construction_time_sha256_30_ms
11,419 (-1%)
3,100 (-2%)
1,704 (-3%)
1,419 (-1%)
1,464 (-1%)

proof_construction_time_sha256_100_ms
44,620 (-2%)
12,038 (-2%)
5,660 (-4%)
5,648 (-1%)
5,529

proof_construction_time_poseidon_hash_ms
78.0 (-1%)
34.0
34.0
58.0
88.0 (+1%)

proof_construction_time_poseidon_hash_30_ms
1,517 (-1%)
418 (-1%)
202
222 (-6%)
263 (-1%)

proof_construction_time_poseidon_hash_100_ms
5,735 (-1%)
1,575 (-1%)
725 (-2%)
782 (-4%)
800 (-1%)

L2 block published to L1
Each column represents the number of txs on an L2 block published to L1.

Metric
4 txs
8 txs
16 txs

l1_rollup_calldata_size_in_bytes
1,412
1,412
1,412

l1_rollup_calldata_gas
9,476
9,466
9,476

l1_rollup_execution_gas
610,297
610,287
610,297

l2_block_processing_time_in_ms
736 (-2%)
1,402 (-1%)
2,671 (-1%)

l2_block_building_time_in_ms
24,710 (-3%)
51,069
98,096 (-2%)

l2_block_rollup_simulation_time_in_ms
24,613 (-3%)
50,768
97,750 (-2%)

l2_block_public_tx_process_time_in_ms
21,132 (-3%)
46,991
94,064 (-2%)

L2 chain processing
Each column represents the number of blocks on the L2 chain where each block has 8 txs.

Metric
3 blocks
5 blocks

node_history_sync_time_in_ms
6,967
9,777 (-1%)

node_database_size_in_bytes
12,157,008
16,105,552

pxe_database_size_in_bytes
16,254
26,813

Circuits stats
Stats on running time and I/O sizes collected for every kernel circuit run across all benchmarks.

Function
time_ms
bytecode_size_in_bytes

GasToken:_increase_public_balance
65.8 (-3%)
13,873

GasToken:set_portal
17.2 (+3%)
3,495

Token:constructor
90.2 (-3%)
24,207

FPC:constructor
61.6 (-1%)
13,893

GasToken:mint_public
51.5 (-3%)
10,241

Token:mint_public
604 (+3%)
19,216

Token:assert_minter_and_mint
58.0 (-22%)
13,034

AuthRegistry:set_authorized
30.6 (-7%)
7,869

FPC:prepare_fee
145 (-4%)
15,187

Token:transfer_public
:warning: 28.7 (-44%)
31,425

FPC:pay_refund
145 (+9%)
20,080

Benchmarking:increment_balance
2,673 (-1%)
15,465

Token:_increase_public_balance
56.8
15,089

FPC:pay_refund_with_shielded_rebate
146 (-3%)
21,167

Public DB Access
Time to access various public DBs.

Function
time_ms

get-nullifier-index
0.179 (-3%)

Tree insertion stats
The duration to insert a fixed batch of leaves into each tree type.

Metric
1 leaves
16 leaves
64 leaves
128 leaves
256 leaves
512 leaves
1024 leaves

batch_insert_into_append_only_tree_16_depth_ms
10.2 (-1%)
16.5 (-1%)
N/A
N/A
N/A
N/A
N/A

batch_insert_into_append_only_tree_16_depth_hash_count
16.8
31.7
N/A
N/A
N/A
N/A
N/A

batch_insert_into_append_only_tree_16_depth_hash_ms
0.590 (-1%)
0.507 (-1%)
N/A
N/A
N/A
N/A
N/A

batch_insert_into_append_only_tree_32_depth_ms
N/A
N/A
47.6 (-1%)
75.2 (-1%)
128 (-2%)
244 (-1%)
466 (-1%)

batch_insert_into_append_only_tree_32_depth_hash_count
N/A
N/A
95.9
159
287
543
1,055

batch_insert_into_append_only_tree_32_depth_hash_ms
N/A
N/A
0.486 (-1%)
0.463 (-1%)
0.441 (-2%)
0.442 (-1%)
0.437 (-1%)

batch_insert_into_indexed_tree_20_depth_ms
N/A
N/A
58.4 (-1%)
110 (-1%)
177 (-2%)
349 (-1%)
688 (-1%)

batch_insert_into_indexed_tree_20_depth_hash_count
N/A
N/A
109
207
355
691
1,363

batch_insert_into_indexed_tree_20_depth_hash_ms
N/A
N/A
0.496 (-1%)
0.493 (-1%)
0.470 (-2%)
0.474 (-1%)
0.472 (-1%)

batch_insert_into_indexed_tree_40_depth_ms
N/A
N/A
71.8 (-1%)
N/A
N/A
N/A
N/A

batch_insert_into_indexed_tree_40_depth_hash_count
N/A
N/A
133
N/A
N/A
N/A
N/A

batch_insert_into_indexed_tree_40_depth_hash_ms
N/A
N/A
0.512 (-1%)
N/A
N/A
N/A
N/A

Miscellaneous
Transaction sizes based on how many contract classes are registered in the tx.

Metric
0 registered classes
1 registered classes

tx_size_in_bytes
85,672
670,983

Transaction size based on fee payment method
| Metric |  |
| - |  |


[DIR-938] notification bell e2e test

Description
Test 1: „Notification Bell has an inactive state by default“

Checks if the Notification Bell is rendered
Checks if it shows the correct text for ‚No Notifications’

Test 2: „Notification Bell updates depending on the count of Notification Messages“

Creates a new workflow with 2 secrets
Checks if the Notification Bell is rendered
Checks it the red Indicator is visible
Checks if it shows the correct text for ‚Two Notifications’
Initializes the first secret
Checks it the red Indicator is visible
Checks if it shows the correct text for ‚One Notification’
Initializes the second secret
Checks it the red Indicator is NOT visible
Checks if it shows the correct text for ‚No Notifications’

FYI: The develop branch is being discontinued, and we're transitioning to use the main branch. I've recently merged the latest changes from develop into main and adjusted the target of this pull request from develop to main. Since both branches share the same head, this shouldn't have any impact.
Before I did that, I merged the latest develop branch back into this and fixed a merge conflict. I expect that everything works the same way as before, but if not please let me know.


Running missions in ArduPilot

Hello, question about nature of missions in MAVSDK (Ardupilot). I am using the raw mission to create and upload missions. I have a set of waypoints and a takeoff command (command 22). I upload mission fine, no problem. But when I want to start a mission (arm, then start mission):
await vehicle.action.arm()
await vehicle.mission_raw.start_mission()

I get an error in my SITL console:
AP: Auto: Missing Takeoff Cmd
AP: Mode change to AUTO failed: init failed

Even though my very first mission item is:
RawMissionItem(
                seq=0,
                frame=3,
                command=22,
                current=1,
                autocontinue=1,
                param1=10,
                param2=0,
                param3=0,
                param4=float('nan'),
                x=0,
                y=0,
                z=float(10.0),
                mission_type=0
)

I am not sure what I am missing here. Any help please?

AP: Auto: Missing Takeoff Cmd

Doesn't it mean that you need to add a takeoff item in the mission?

AP: Auto: Missing Takeoff Cmd

Doesn't it mean that you need to add a takeoff item in the mission?

Yeah. That's the first mission item I added. MAV_CMD_NAV_TAKEOFF translates to command 22 but for some reason, it still says it's missing

You should check what Ardupilot receives, I think. Because that message is coming from Ardupilot, right? Apparently Ardupilot is not happy with the MAVLink mission item you constructed (presumably it does not recognize the takeoff item).

Okay. Would debug and get back to you. Thanks

You should check what Ardupilot receives, I think. Because that message is coming from Ardupilot, right? Apparently Ardupilot is not happy with the MAVLink mission item you constructed (presumably it does not recognize the takeoff item).

Did some digging, and I think the problem is from Ardupilot. Or a protocol mismatch between ardupilot and mavsdk. Mission sequence starts at 1 within ardupilot: https://discuss.ardupilot.org/t/planning-missions-via-mavlink/16489/8 (Full thread). My mission planning always started from 0.
To debug, I appended the takeoff command twice. With sequence 0 and sequence 1, then the RTL command as number 2. It worked. So apparently, the sequence 0 is meant to be home command? Still looking into that but thanks. I might just extend mavsdk python on my end and create an AP plugin. Like a wrapper around the core, existing ones. Thanks again ❤

Closing this as solved. Would still add any extra info tidbit I encounter to this thread to assist others

That's correct. Home, or just a 0 entry is required for ArduPilot.

That's correct. Home, or just a 0 entry is required for ArduPilot.

What is a 0 entry? I think that sounds like a better option. Because the vehicle sets its home to its location everytime an arm occurs. Might cause issues if I upload a mission in point A (using the location of A) and the drone is moved to B before mission execution

And when you say home, do you mean HOME_POSITION (242) or a set home position command?

I'm not sure to be honest. I think safest is to just put a NAV item with everything 0 in there. Or just try out in SITL whether you can figure out what happens.

I'm not sure to be honest. I think safest is to just put a NAV item with everything 0 in there. Or just try out in SITL whether you can figure out what happens.

Would do just that. Probably set two takeoff commands but set the one at sequence 1 to current. So it starts from there automatically 👍. Thanks a lot

Looking at Ardupilot mission planner, seems they just did that 😆
QGC WPL 110
0	1	0	16	0	                0	                0	                0	                6.4253317	3.4094982	0.070000	      1
1	0	3	22	0.00000000	0.00000000	0.00000000	0.00000000	0.00000000	0.00000000	10.000000      1
2	0	3	16	10.00000000	0.00000000	0.00000000	0.00000000	6.42555240	3.40962140	30.000000      1
3	0	3	20	0.00000000	0.00000000	0.00000000	0.00000000	0.00000000	0.00000000	0.000000	       1

Although, it's waypoint at sequence 0, not takeoff. And I am more concerned about why their MISSION_TYPE parameter is set to geofence for each item instead of a mission item 🤔, or maybe I am reading that last parameter wrong. Looking at it again, it might be the autocontinue param


render trusted udp ports in response

I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

👍


added contrast in buttons

changed buttons colours , for light mode button color is now #d0cfcf and its hover color is rgb(170, 170, 170) and for dark mode the button color is now #0c151c and its hover color is #2f5372.
Closes #228

Hey @HimanshuPandey2002, thanks for taking the time to contribute!
You'll need to include a changeset describing the change you've made. See our contributing guide:
https://github.com/kognise/water.css/blob/master/.github/CONTRIBUTING.md
I think this really highlights how some of our other components are failing for accessibility when it comes to distinguishing ui components. I'm going to get @kognise to review before I merge - we might want to open up new issues for other components if we're happy how the buttons look.

@kylejrp Thanks for telling me about the changeset, I didn't know about that but now I've created the changeset and commit the changes.

Thanks for the pull request, and apologies for being so slow! Would you mind changing the hover color to be closer to the base color?

No problem, I can do that


"Internal error: unable to find the outer accessor symbol of ..." when deriving instance for a nested type

Version: 1.12
Reproducer: https://scastie.scala-lang.org/lZwX8BQSThWjL8sEAnSPnw

Seems to be a problem with a combination of classes defined in traits + default field values

Yes, but it works if you put derivation inside the companion.
trait X {
  case class F(i: Int = 5)
  object F {
    implicit def tc: TC[F] = TC.derive[F]
  }
}

Yes, but it works if you put derivation inside the companion.
trait X {
  case class F(i: Int = 5)
  object F {
    implicit def tc: TC[F] = TC.derive[F]
  }
}

Lifesaver! Thanks for the workaround.


Fixed base64 in OpenCL kernel and added several useful features

When trying to use the app, I have discovered that it has an issue and is missing some useful features.
Fixes:

OpenCL kernel had invalid characters (+, /) in base64 encoding, changed them to correct (-, _) ones - it was impossible to look for vanity address with - or _ characters because of that bug.

Features:

It is now possible to search for only one address, especially if difficulty is high, so that as not to waste power on continuing search after the first address is first.
Ability to check the prefix starting from 3rd character (UQxxx...) was added (opposing to default 4th UQ?xxxx...), that will allow to more finely tune your address if you know and understand restrictions on these first characters.

Thank you for your contribution!


Mystery exception thrown in CommunityServiceImpl.findByIdOrLegacyId

Describe the bug
findByIdOrLegacyId uses StringUtils.isNumeric to test for a String representation of an integer value.  This test is wrong:  "-1" is an integer but contains a non-numeric character, which is what the method actually tests.  This causes "-1" to be fed instead to a UUID conversion, which throws IllegalArgumentException, leading to much puzzlement when it ends in returning 400 to the front-end.
To Reproduce
Steps to reproduce the behavior:

At this time I do not know where the "-1" is coming from.  It is likely data-dependent:  I cannot make my development system produce it, but it is consistent on production.

Expected behavior
I think that findByIdOrLegacyId should return null, as the string is a valid integer but cannot be the legacy ID of any DSO.
Notes
All of the DSO subclasses which can have legacy IDs have the same problem.
The problem was found while searching for the cause of a Community statistics page failing with perpetual marching dots when a request for "total visits per month" fails with status 400.  The search continues.  (Grumble, the page should not fail; it should post a warning in the notice area and continue, showing nothing for the unavailable statistic.)

@mwoodiupui I believe this is the same problem I had coming from DSpace 6. From my notes, I was getting this error in dspace.log:

2023-08-16 14:30:31,873 WARN  dace8f96-f034-488e-b38c-9f2eb5d0e002 6cbd0b18-6852-4294-99a5-02dfcab0a469 org.dspace.app.rest.exception.DSpaceApiExceptionControllerAdvice @ Request is invalid or incorrect (status:400 exception: Invalid UUID string: -1 at: java.base/java.util.UUID.fromString1(UUID.java:280))

I looked in the Solr statistics core and found ~1,000,000 documents with the ID -1. In my case they were all type 5, which is “Site” aka the home page, according to dspace-api/src/main/java/org/dspace/core/Constants.java.
To fix this I found the site's UUID using the /server/api/core/sites endpoint and then exported the matching documents using solr-import-export-json and replaced the offending value, then re-imported:
$ ./run.sh -s http://localhost:8081/solr/statistics -a export -o /tmp/statistics-fix-uuid.json -f 'id:\-1 AND type:5' -k uid
$ sed -i 's/"id":"-1"/"id":"3945ec23-2426-4fce-a2ea-48b38b91547f"/' /tmp/statistics-fix-uuid.json
$ ./run.sh -s http://localhost:8081/solr/statistics -a import -o /tmp/statistics-fix-uuid.json -k uid

Hope that helps.

Thank you, @alanorth! We had over 5 million documents with invalid -1 UUIDs in our statistics core, all of which were type 5. Most of them were from 2017 and earlier, before we upgraded to DSpace 6. I ran the commands you mentioned with the correct site UUID, and now if I re-run the export with a search of 'id:-1' it comes back empty. But I'm still seeing the Invalid UUID string: -1 warning in our DSpace 7 logs whenever I go to a statistics page. Did you have to do anything like a Solr reindex after you fixed the invalid UUIDs?

@nwoodward I think you will need to poke around in the Solr statistics core via the admin interface. Start by querying for statistics that don't have and id matching the expected pattern for UUIDs (36 characters): -id:/.{36}/
Not to derail the conversation here, but I just found 800,000 documents in our Solr statistics core that have no id at all! Some even come from today. :thinking: Now I need to go figure out WTF is going on.
So yeah, DSpace should filter for DSOs with UUIDs.

There are separate but related issues higher on the call stack.  DSpace should also properly handle unchecked exceptions bubbling up from findByIdOrLegacyId.  Probably there should not be any.  Right now it does something that apparently leaves the front-end waiting forever for a response that will never come.  (1) The back-end should always return a sensible response from the method best placed to understand a failure.  (2) The front-end should always recover from missing or nonsensical responses and return control to the user with an appropriate message.

It looks like all (or nearly all) of our statistics that don't conform to the expected pattern id:/.{36}/ are missing the id field completely and also have the field statistics_type:search and an array of search terms in the query field. So I'm guessing they're not the reason why the usage statistics pages are still returning 400.

@nwoodward a Solr query for -id:[* TO *] will show records that are entirely missing an id field. In our case I see 10,000 of them of various statistics_type:

search: 8650
view: 1295
workflow: 138
search_result: 6

When checking for invalid id using the -id:/.{36}/ query, I have 800,000 (which includes the ones above):

search: 803370
view: 1295
workflow: 138
search_result: 6

All the ones with invalid IDs are "-1" surprisingly, and they are all statistics_type:search. (I guess I can just purge these).

@alanorth My results that have an id:-1 and statistics_type:search also have type:5, which makes me think the fix with solr-import-export-json you referenced earlier may not be necessary? It also makes even less sense that I would see Invalid UUID string: -1 when looking at a community/collection/item's stats since those pages are not looking at search statistics. And I removed those -1 stats already, so the persistent error remains a mystery.


chore(ci): test with the ORT nightly build

https://github.com/microsoft/onnxruntime/issues/15206

https://github.com/onnx/onnx/issues/5067


Use Self type in _BaseKafkaQueueConsumerFactory.new()

Closes #797
💸 TL;DR
Correct a typing annotation
🧪 Testing Steps / Validation
Lint pass in ci
✅ Checks

[x] CI tests (if present) are passing
[x] Adheres to code style for repo
[x] Contributor License Agreement (CLA) completed if not a Reddit employee

Before:

After:

I thought about that. I wound up here given the dependency still exists in
3.12, and that mypy deprecates typing_extensions when appropriate.
I think theyre both fine, this looked nicer to me. Easier to clean up.
On Mon, Apr 29, 2024 at 16:04 Chris Kuehl @.***> wrote:

@.**** commented on this pull request.
In baseplate/frameworks/queue_consumer/kafka.py
https://protect.checkpoint.com/v2/___https://github.com/reddit/baseplate.py/pull/894%23discussion_r1583768044___.YzJ1OnJlZGRpdDpjOmc6OTBlNTViOWI1MmZlN2E3NDA0NWNiOTE0NDE1NDY0MDM6NjpmNWYzOjIzM2ZmNTAyYmZjNzBlZGZhM2U3M2IxZDM2NjcwZGQxMDc5OTczZDgzZjVkNTFlYThiNzg0MWIxNTIyNjJkYjI6aDpU
:

@@ -19,6 +19,7 @@
from prometheus_client import Counter
from prometheus_client import Gauge
from prometheus_client import Histogram
+from typing_extensions import Self

Do you think it's worth doing
try:
from typing import Self  # Python >= 3.11except ImportError:
from typing_extensions import Self
and then doing this in pyproject.toml:
typing-extensions = {version = "^4.11.0", python = "<3.11"}
?
—
Reply to this email directly, view it on GitHub
https://protect.checkpoint.com/v2/___https://github.com/reddit/baseplate.py/pull/894%23pullrequestreview-2029637551___.YzJ1OnJlZGRpdDpjOmc6OTBlNTViOWI1MmZlN2E3NDA0NWNiOTE0NDE1NDY0MDM6NjphODZmOjU5N2M4ODI3YmM0NjE2YWZjOTJjZDlmMjYwMWFmNmMwZDczNDRiNzJkY2QyZjU1MmNlMTE1NGU3OTlkNzU4Y2M6aDpU,
or unsubscribe
https://protect.checkpoint.com/v2/___https://github.com/notifications/unsubscribe-auth/BAA37MISXR4OGOUDANLVGNDY72YWZAVCNFSM6AAAAABG63ZYCSVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDAMRZGYZTONJVGE___.YzJ1OnJlZGRpdDpjOmc6OTBlNTViOWI1MmZlN2E3NDA0NWNiOTE0NDE1NDY0MDM6Njo5OTVhOjBhZTRkZjRhYzk1MTVlN2E2ZmNjODk1YWY0OGZhODc2ZWFkZGRhYWJiMmQ3N2IyOWY1ZTE0ZDllNzViYTQzYzE6aDpU
.
You are receiving this because you authored the thread.Message ID:
@.***>


code-server and openvscode-server both broken

Steps To Reproduce
Steps to reproduce the behavior:

build code-server or openvscode-server

Build log
see:
https://hydra.nixos.org/build/207062651
https://hydra.nixos.org/build/207038352
Additional context
Can someone nail the problem down to a specific pr or commit?
Notify maintainers

@offlinehacker @henkery @dguenther @ghuntley @emilytrau

Broken because of PR https://github.com/NixOS/nixpkgs/pull/211330

[12:20:02] 'vscode-reh-web-linux-x64-min' errored after 6.95 min
[12:20:02] Error: Command failed: /nix/store/b860q13vl4y1rx4zp16xc22cnlrxgdyn-nodejs-16.19.0/bin/node /build/source/lib/vscode/extensions/notebook-renderers/esbuild.js --outputRoot /build/source/lib/vscode/.build/extensions/notebook-renderers
panic: interface conversion: interface {} is nil, not bool

goroutine 21 [running]:
main.(*serviceType).handleBuildRequest(0xc00011bda0, 0x0?, 0xc00011be30?)
        github.com/evanw/esbuild/cmd/esbuild/service.go:576 +0x1066
main.(*serviceType).handleIncomingPacket.func2()
        github.com/evanw/esbuild/cmd/esbuild/service.go:235 +0x68
created by main.(*serviceType).handleIncomingPacket
        github.com/evanw/esbuild/cmd/esbuild/service.go:233 +0xfda

    at ChildProcess.exithandler (node:child_process:402:12)
    at ChildProcess.emit (node:events:513:28)
    at ChildProcess.emit (node:domain:552:15)
    at maybeClose (node:internal/child_process:1100:16)
    at Socket.<anonymous> (node:internal/child_process:458:11)
    at Socket.emit (node:events:513:28)
    at Socket.emit (node:domain:552:15)
    at Pipe.<anonymous> (node:net:301:12)
    at Pipe.callbackTrampoline (node:internal/async_hooks:130:17)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error: builder for '/nix/store/qsv37r10hgdmgadpjl43953g7j0c0iqm-code-server-4.8.3.drv' failed with exit code 1

Now broken because nodejs-16.20.1 is insecure.

Now broken because nodejs-16.20.1 is insecure.

waiting for https://github.com/coder/code-server/issues/6230
as nodejs 18 migration is blocked


fabric.mod.json version number is incorrect

Hello, first off, thanks for creating this!!!!
I am creating a datapack (packaged as a mod) that depends on MoreDensityFunctions and the version number reported by the mod is still 1.0.0 instead of 1.0.4 as it should be. This makes so I cannot to force users to install the correct version of MoreDensityFunctions, which I really want to do because the different versions are not compatible with each other!

That's a pretty big issue, thanks for bringing it up. I'll fix it whenever I get home from work today. Thanks.

I ended up forgetting about this (job moment)
Fixed in the latest version, will be updating other versions as well.


psmove offset z doesn't work

Hi,
When I use PSMoveSteamVRBridge 1.6, psmove_offset_z doesn't work, anywhere is set. I tried to set  it on psmove in steamvr.vrsettings, on psmove_settings in steamvr.vrsettings, or even on psmove configuration in PsMoveSteamVrBridge(on %appdata%).
Anyone know how to fix this, or can help me with this problem?

same problem with my ticket https://github.com/HipsterSloth/PSMoveSteamVRBridge/issues/72
and no response


Array elements only contain properties that exist on first item

Hello,
I encountered a problem while trying run validation for Array. It seems, that RuleEngine converts all array elements to the format of first elements. If following elements have more properties, then those are not available in rule expression.
Example input:
dynamic exp1 = new ExpandoObject();
exp1.Name = "EXP1";
dynamic exp2 = new ExpandoObject();
exp2.Name = "EXP2";
exp2.Date = DateTime.Now;

dynamic expando = new ExpandoObject();
expando.list = new List<ExpandoObject>
{
    exp1,
    exp2
};

Actual result:
After debugging, I get these values as inputs of rule:

Expected result:
Second element will contain Date property.
Notes:
If I change array items to JObject, then this problem does not appear.

Package version: 3.0.2. Same with 3.4.0.
I would like to know if I can make it work with ExpandoObjects or I should switch to other types.

After looking around the code, it seems that the issue is caused by this line:
https://github.com/microsoft/RulesEngine/blob/65d2abbd8b28d631a7a886b2ad3760641423eb80/src/RulesEngine/HelperFunctions/Utils.cs#L51

I tried to solve problem myself, unfortunately, there are few problems. This is the draft PT
https://github.com/microsoft/RulesEngine/pull/286

Hi Maruis, There are some limitations when converting nested dynamic items. One workaround is to use a typed object as it gives you more control over which properties are surfaced.
We could run through the list to get all available properties but that would result in a performance impact. It is better to use a typed object in this scenario.

Understandable. It would be good to provide information about such limitation in documentation.
Closing ticket, understandable that it is not worth doing it.


Arclight charges widget

Just something like the ammo plugin but instead it shows how many charges you have left on the arclight

Duplicate #3144


cannot use babel-core function in main process (production mode)

I am using a babel-core function in the main process, (for the purpose of turning external  .jsx files into .js files), this works fine in development mode, but with the packaged app I get the following error:
Uncaught Exception:
ReferenceError: Unknown plugin "transform-react-jsx" specified in "base" at 0, attempted to resolve relative to "/"
    at
...

how can i make sure that babel-core module dependency is also fulfilled in the packaged app ?
My current code (simplified):
import { transform } from 'babel-core';
...
const outJS = transform(inJSX, {
  plugins: ['transform-react-jsx']
}).code;
...

You can move all the babel-* devDeps to deps in ./package.json.
If that doesn't work, try changing this line to be:
entry: ['babel-core', 'babel-polyfill', './app/main.dev'],

OK, thanks, well, it looks like my problem is somewhere else, the build process throws some exceptions FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory (but then still continues to package the app).

That means that the node heap doesn't have enough memory. Run node with the flag --max_old_space_size=4096 to allocate 4GB to the heap

oh yeah, now things look better, thanks a lot again


Request for Cognito API authorizer

Is there any example template.yaml file that shows how to authorize an API/function using Cognito?  Thanks!

Here's an example: https://github.com/awslabs/serverless-application-model/tree/master/examples/2016-10-31/api_cognito_auth

Thanks!


This https://github.com/openforge/OPENFORGE.IO/pull/166 fix this.


Backport PR #1555: update versions of pytorch lightning, jinja, sphinx

Closed as 0.16.x is forced between 1.5 and <1.6 lightning


Don't replace content if undefine data-disable-with

Situation:
A button with data-disable:
<button data-disable>Submit</button>

When click this button, I want to insert a animation element to button, the animation element is dynamic defined, so it's not suitable for data-disabled-with or css hidden.
<button data-disable>Submit

</button>

The animation element will be removed after animation end, but current ujs cache button content to ujs:enable-with, even though data-disabled-with is undefined. Then it will replace cached content after ajax end, that break my animation effect.
So I change it not to store ujs:enable-with if data-disabled-with is undefined, then it will not execute a replacement after ajax.
I also use attribute disabled to flag disabled state for links instead of data ujs:enable-with. So a disabled link can be selected by a[disabled] for css style.

I'm :-1: on setting the disabled attribute as it isn't a valid attribute for a elements. But the change on how to replace the element contents looks good - would be nice to have a simple test for it.

It need a flag to check if it should call enableElement https://github.com/rails/jquery-ujs/blob/2aed62cdeec229914869bb0aa85eb5419f79d253/src/rails.js#L371-L387
And I found a[disabled=disabled] have been discussed https://github.com/rails/jquery-ujs/issues/317 , so I use disabled attribute.
Other options:

Set data ujs:disabled, only use for ujs flag, can not select by css.
Add class .disabled, fit bootstrap.css style.

Or any other options?
I will add test case soon.

@chloerei I would go with option 1) and maybe trigger an event like ujs:disabled and ujs:enabled so developers can hook into this part and deal with styling by themselves, like the following.
$(document).on('ujs:disabled ujs:enabled', '[data-disable]', function() {
  this.classList.toggle('disabled') // or $(this).toggleClass('disabled');
});

How does that sounds?

I think it' good. I will add a new commit.

Previous commits add data 'ujs:enabled and event ujs:disabled, ujs:enabled.
I have a question, actually I will use button instead of link when I need disabled function. I'm not sure whether this event is need by other people.

I think it's better not to add events, and recommend button instead of link when disable function or style is need, until there is a reason this event must be implemented.

@chloerei ok then :+1: Also, feel free to squash the existing commits into a single one through an interactive rebase so we don't pollute the git history with the intermediate changes here.

Done.

@chloerei thanks!

Great! 👍


Check styling

Check if the deleted styling
style="height: 100vh;
is needed in nz-sider
https://github.com/Semantic-Society/Neologism/blob/5c228a75a3969ee61ec3d2033d017c487cf43a16/app/src/app/mxgraph/mxgraph.component.html#L2
see commit:
https://github.com/Semantic-Society/Neologism/commit/543bbda86079770b88eae9974f35052bbc0c62d6

Solved


Idea: RecentProjectsPanel opens FileBrowser on dbl-click

Sometime one has multiple .mastodon projects nearby in otherwise deeply nested common folder, one clicks all the way to open the first project.. later one wants to open the second project... and must click through again (or Cut&Paste the path, edit aside, open dialog, Paste-in the edited path, choose .mastodon file)
Or, one opens a file browser (by dbl clicking), then navigates to the wanted nearby project, then Open another project in Launcher which opens Dialog into which the path to the wanted nearby project can often be dnd'ed from the Browser...
This is only a proposal.

This is what i can look like:

Does it work well when you have mastodon projects that are actually folders?

...and I have also tested that (only on my Linux)


New notebook tutorial

Tutorial on how to use the transit function and limb-darkening functions independent of the marginalisation framework.
This tutorial walks through the dependencies of the following functions and how to use them from the ExoTiC-ISM package

limb_dark_fit
phase_calc
impact_param
occultnl

I will be closing this pull request and removing this branch.
I will add back in this branch and the tutorials in a different way moving forward including additional instruction and transparency.


⚠ Bofrost.de has degraded performance

In 4e2a931, Bofrost.de (https://www.bofrost.de) experienced degraded performance:

HTTP code: 200
Response time: 1131 ms

Resolved: Bofrost.de performance has improved in f27bfd3.


Don't override native Element#toggleAttribute()

As of Chrome 69, toggleAttribute() is now a thing in Chrome, see https://www.chromestatus.com/feature/5676852374929408.
It is currently overriden by the non-native toggleAttribute() defiinition at https://github.com/Polymer/polymer/blob/8f6a96254c3a1177c1407ee3591df92217c93b19/lib/legacy/legacy-element-mixin.js#L822.
It would be nice to not override the native method, if it already exists.

@freshp86 Is there a difference in implementation between the two? If there is, we can not make this change as it would be backwards incompatible.

The signature of the native method accepts two parameters only, see https://dom.spec.whatwg.org/#dom-element-toggleattribute.
I did not think about backwards compatibility. Perhaps you could at least have the Polymer method delegate to the native one if available, instead of re-implementing it.

Perhaps you could at least have the Polymer method delegate to the native one if available, instead of re-implementing it.

That would still mean we have to have the old code around. I do not think that is worthwhile, especially as this on the legacy mixin and thus does not exist on Polymer.Element. I am therefore inclined to keep it as-is, since future users will not be using legacy and thus can use the native method as they desire.

After more thought, I am closing this issue. Since we ship the method on the legacy mixin, this should go away over time. Since we can not make backwards incompatible changes, delegation still requires the current implementation to exist. Delegation therefore has no explicit benefit.


Always bugcheck with PAGE_FAULT_IN_NONPAGED_AREA on Lenovo y700 (7601, x64)

Hi, tandasat
HyperPlatform always causes PAGE_FAULT_IN_NONPAGED_AREA bugcheck on my laptop Lenovo Y700. This issue only occurs in 7601 x64, while HyperPlatform runs normally in 14393 x64 on the same laptop. I put HyperPlatform in VMWare Workstation running a 7601 x64 and no bugcheck occurs.
I have no idea what causes the problem. :(
My laptop configuration:
i7-6700HQ, 16G DDR4, pagefile enabled, without any anti-virus software.
Build with Visual Studio 2015 Update3 & WDK 14393

Hi, thanks for reporting the issue.
Can you provide MEMORY.DMP created after recovering from bug check, along with HyperPlatform.sys, HyperPlatform.pdb and HyperPlatform.log?

I have sent the files to your gmail. ;)

Thank you for sending files! Does it reproduce with a debug build? It is harder to analyze release build. If it does, can you please send me the same set of files?

The project was compiled with Debug build, but with full optimization on. Does it matter?

I see. Yeah, it optimization is enabled, it will be pretty much same as Release build, and Windbg cannot map some info in the DMP with source code.

The same set of files have sent to your gmail.
Debug build & all optimization off ;)

I received and stored them here. I will find time to see details soon.
https://1drv.ms/f/s!AsA0J31QobPNhqo6z5CVkrkvvO-1yw
Thanks,

Hi, can you try out  b0cfef6 in a branch issue34? I have not been able to reproduce the issue yet, but believe that I understand the cause.
Thanks!

Nice! Branch b0cfef6 is tested and no bugcheck occurs. I'm wondering why this issue only occurs in my laptop running 7601 x64

Beautiful. Thanks for testing it. I will merge it later.
The fix code path is executed when VMM needs to create a new EPT entry. It occurs when a physical address which is not backed by RAM, ie PA for MMIO by devices, is accessed, as we are unable to know such addresses prior to an access and build EPT entries for them beforehand.
The reasons why it happened only on the specific environment was that the machine had a device accessing such a MMIO PA and that the address hit the fixed condition (the condition is completely depending on a layout of RAM and MMIO addresses). So, the issue could happen on other systems, but unlikely on VMware as VM's memory layout (including MMIO addresses) was pretty much the same always.

Thanks!!
Learned a lot. :P

You are welcome. Re-opening it just until it is merged into master.
Thank you for reporting issue and helping me!

Fixed with 8ded1972214fc624047b56cd8976a81e0fc21514


Initialized SystemVerilog Project Structure

Project is ready. Please try to only commit source code files and project configurations.

Hey Barret. These files are the initial Vivado project. Source files will be added to this project through our commits on our branches. This way we can manage the source code without introducing regressions or losing our code from overwriting.


Parallelize parts of agent image build that can be parallelized

With #158, we can run part of the agent image build in parallel with the task image build. However, they aren't parallelized by default. Vivaria runs docker build twice in series, once to build a task image and a second time to build an agent image.
To achieve this, we could use docker buildx bake and depot bake. Both commands allow building multiple Docker images in parallel using a single command.
I think our Bake config for agent image builds would look like:

Config for building a task image
Config for building the first part of an agent image (copying in the agent code, installing dependencies)
Config for building the final agent image (using the two previous images as build contexts, FROM #1 and COPY --from=#2 ... https://docs.docker.com/build/bake/contexts/#using-a-target-as-a-build-context)

My recommendation: Just do this. One build command. Maybe it could be orchestrated better/more clearly using bake, but seems pretty simple to me: when prepping build dir put task stuff in task/, agent stuff in agent/ (so files don't clobber each other) and then modify the COPY directives to use the new sources

Maksym has a PR to stop syncing the Task Standard from the Vivaria repo: https://github.com/METR/vivaria/pull/565
So we'll probably stop sharing the Task Standard Dockerfile between the two repos. That means we can combine the Task Standard and agent Dockerfiles into a single file in the Vivaria codebase, which would also let us solve this!.


Delegate error handling to a policy object, allow for arbitrary options to be passed to cassandra driver gem

After refactoring some of the keyspace object, I can't really figure out why you would want to call clear_active_connections! after each error. This may have worked around some shortcomings in the cassandra driver gem historically, but I don't think it is a very good idea. The cassandra driver gem supports an infinite amount of configuration in the form of policy objects, which can be used to implement whatever handling logic you would like. It also tracks what hosts are up and down, so there is little reason to clear the connections on an error. I also can't see why you would to do retries in this gem, given that the cassandra driver gem can do that for you.
What I've seen in production systems is that once our application encounters a single timeout, all application threads immediately start hammering all the nodes. I think this is because clearing the connections makes the driver gem "forget" which hosts are up and down.
All that taken into consideration, I don't want to change the default behavior because that would make the version '3.0.0' basically. So instead I have added two options to the configuration hash passed to this gem

cassandra_error_policy
cassandra_options

Using these two options, you can disable the default behavior and pass whatever options you would like to the underlying driver gem. Specifically, specifying a behavior of Cequel::Metal::Keyspace::Policy::CassandraError::Raise results in errors from the cassandra driver gem simply propagating up the call stack.
Let me know if you need anything else to accept this merge.

For reference, here is the full list of options you can pass to the cassandra driver gem
http://docs.datastax.com/en/developer/ruby-driver/3.0/api/cassandra/#cluster-class_method

Fwiw, I have no problem with a version 3.0.0. Version are free, we can have as many as we need. That being said I do like not breaking the API unless it brings real benefits.

I like the idea of moving the error handling into policy objects. How do you feel about having them be real objects, rather than mixins? We could have an abstract class for the interface and a ResetAndRetryPolicy to implement the current behavior.

They would need to have access to all the methods and instance variables of the Keyspace class, which is why I did not make them their own class.

Why all the instance variables? I agree that keyspace would need to expose enough behavior to support error handling but that seems like a Good Thing to me.

The code does things like sleep(retry_delay)

Keyspace already has too much responsibility. I am not comfortable adding the error handling policy, even via inheritance. A separate configuration object is one way we can handle this but for the short term i'm ok with Keyspace gaining simple accessors for configuration information. Once we have those methods as part of the public interface we can extract them into an object of their very own.

So the delgation will wind up looking something like ?
begin
  # stuff that can explode
rescue CassandraError => e
  error_policy.handle(self, e, retries_remaining)
  retry

The instance variable error_policy on Keyspace is always going to be defined, but will be a sane default if the user doesn't configure it.

I updated it with your requested refactor.
As a plus, some of the tests are a bit less weird.

Refactor is done.

Looks good except for the minor issues in my review. Thanks for the hard work.

I believe I have now addressed all your comments.

Yay! Thanks for finishing that off @hydrogen18. I really appreciate the work you did on this PR.

Released in 2.0.3. Thanks, again, for the improvement.


process_replay: fix radard replays when radarUnavailable

Most (all?) radar interfaces, fake the desired radar frequency with time.sleep if carParams.radarUnavailable is true. Since process_replay sets NO_RADAR_SLEEP, it needs to control the frequency by buffering can msgs.

Is this the only process like this? Maybe we can just have radard follow modeld? I think that probably makes more sense?

Is this the only process like this? Maybe we can just have radard follow modeld? I think that probably makes more sense?

That would be nice to have regardless of process replay if we're ok with the extra latency.

If we change that, @fredyshox this will be a new pattern for process replay: poll on modelV2 and drain on can.

Gonna look into that, but I believe the current ReplayContext should be able to accommodate that, if it would set up events for modelV2 and leave can be.

Refactor of radard #29063 will make this unnecessary


Update how the "help" section opens/closes

*Issue:*https://github.com/bcgov/entity/issues/21069
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the namex license (Apache 2.0).

/gcbrun

Temporary Url for review: https://bcregistry-btr-dev--pr-158-6ybinukn.web.app

/gcbrun

Temporary Url for review: https://bcregistry-btr-dev--pr-158-6ybinukn.web.app


Sql fails with iteration on list of records

c("select id from users")() | [] (int &uid) { std::cout << uid << std::endl; };
fails with
usr/include/silicon/middlewares/sqlite_connection.hh:115:9: error: no matching member function for call to 'row_to_sio'
        row_to_sio(o);
        ^~~~~~~~~~
test.cc:36:39: note: in instantiation of function template specialization 'sl::sqlite_statement::operator|<(lambda at test.cc:36:41)>' requested here
  c("select id from users")() | [] (int &uid)
                                      ^
/usr/include/silicon/middlewares/sqlite_connection.hh:37:10: note: candidate template ignored: could not match 'sio<type-parameter-0-0...>' against 'int'
    void row_to_sio(iod::sio<A...>& o)

seems like only sio objects work with |?

Which compiler do you use ? This should works. See this test here: https://github.com/matt-42/silicon/blob/master/tests/mysql.cc#L96

clang version 8.0.0 (tags/RELEASE_800/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

mysql_connection works as expected, but sqlite_connection fails


Update docs for keepOriginalNextHop in bgppeer resource

Description
Adjusts are made to describe the new feature keepOriginalNextHop in bgppeers resource.
Related issues/PRs
https://github.com/projectcalico/libcalico-go/pull/1266
https://github.com/projectcalico/confd/pull/339
Todos

[x] Tests
[x] Documentation
[x] Release note

Release Note
None required

Deploy preview for calico ready!
Built with commit 800844b7a819e79ecabd5236ee4689033f2fa5f8
https://deploy-preview-3867--calico.netlify.app

https://deploy-preview-3867--calico.netlify.app

@caseydavenport  I have visited that link but changes in 800844b are not displayed. Is there something wrong or did i do something stupid?
And the Milestone here is different to the PR https://github.com/projectcalico/confd/pull/339, I think it would be 3.16.0, didn't you?

@gunboe See https://deploy-preview-3867--calico.netlify.app/master/reference/resources/bgppeer.  (You have to add "master/" into those deploy preview URLs.)
I or @caseydavenport will fix up the milestone, but the most important thing is to rebase and merge the confd PR.

@gunboe confd is merged and milestone updated now.
I added Release Note text in the top comment above.  Please could you review, and feel free to improve!


Fix report2 outputs

These changes fix attempting to use getReport2() with the save parameter.
On 0.4.0.post3, doing so results in the following error:
Traceback (most recent call last):
  File "report-to-csv.py", line 42, in <module>
    print(analytics.getReport2(args.filename, save=True))
  File ".venv/lib/python3.10/site-packages/aanalytics2/aanalytics2.py", line 3204, in getReport2
    data.to_csv()
  File ".venv/lib/python3.10/site-packages/aanalytics2/workspace.py", line 169, in to_csv
    self.df_init.to_csv(filename, delimiter=delimiter, index=index)
AttributeError: 'Workspace' object has no attribute 'df_init'

This appears to be because the Workspace.to_csv() and Workspace.to_json() methods incorrectly reference a df_init attribute, when the dataframe is saved as self.dataframe.
Whilst fixing this issue, I also noticed that DataFrame.to_csv() is called with non-existant keyword argument delimiter, which I have updated to sep.

Hey @pitchmuc
Sorry for the ping, did you need anything else on this to consider this PR?

Hey @zsturgess
So sorry for taking almost 6months to get back to you!
I just merged the fix and works like a charm.
I hope it was not a blocker on your side and you were able to apply that locally.
Thanks a lot for that!


doc: Add Milesight EM300 TH

Summary

This document outlines onboarding Milesight EM300-TH onto The Things Stack.
Closes #1247
Screenshots

Changes

...
...

Notes for Reviewers

@nejraselimovic / @KrishnaIyer
Checklist

[X] Scope: The referenced issue is addressed, there are no unrelated changes.
[X] Run Locally: Verified that the docs build using make server, posted screenshots, verified external links. Test with HUGO_PARAMS_SEARCH_ENABLED=true if style changes will affect the search bar.
[ ] New Features Marked: Documentation for new features is marked using the new-in-version shortcode, according to the guidelines in CONTRIBUTING.
[X] Style Guidelines: Documentation obeys style guidelines in CONTRIBUTING.
[X] Commits: Commit messages follow guidelines in CONTRIBUTING, there are no fixup commits left.

@LDannijs Can we use all zeros for the JoinEUI instead of 24E124C0002A0001?

@LDannijs Can we use all zeros for the JoinEUI instead of 24E124C0002A0001?

The EM300 series uses a default JoinEUI which is 24E124C0002A0001, per the manual:


Flexible issue count

This fixes #38.
It's not quite what my comment showed - I used a different icon and re-ordered slightly after consulting my resident UI expert, but it's the same principle.
I had initially started with this as an additional option to the existing issue count you could set in the settings.  However, based on your comment that "this should replace the option in the settings dialog" (which I agreed with when I thought about it a bit) I have removed the old settings and it now just uses the add/remove buttons.  This was done in the final commit.

Thank you for the PR. However, you've built it on top of PR #37, which makes it difficult for me to test and merge it seperately. Can you change it, so that it is based on Master branch instead?

I think I've re-done the branch as you wanted.  To be honest, I've only ever really used git for my personal projects (we are still using svn at work for the moment) but I think it is now branched from the correct place.

Sorry for the late reply - I've had some tough days... I am going to do some changes to the UI - I don't fully agree with your UI expert. For example I'd like the + sign to be placed at the top. Right now, if you want to add multiple rows at a time, the + sign will move down on every click - which means you need to move the mouse pointer as well. And I'll probably also make the "remove" icon a little less prominent.

Fair enough.  Re the add button: I suppose it depends on the use case: if you are adding one then having it at the bottom makes more sense to me (since you are adding one at the bottom).  If you are adding several, then as you say it keeps moving which is annoying.  Would it be worth considering having it in both places?

I'm trying out a tweak to the whole layout to make it less cluttered:

What do you think?

Looks good!
Adam
Sent from my Samsung Galaxy smartphone.
-------- Original message --------
From: Carsten Gehling<EMAIL_ADDRESS>Date: 27/10/2016 19:07 (GMT+02:00)
To: carstengehling/jirastopwatch<EMAIL_ADDRESS>Cc: Adam Conway<EMAIL_ADDRESS>Author<EMAIL_ADDRESS>Subject: Re: [carstengehling/jirastopwatch] Flexible issue count (#39)
I'm trying out a tweak to the whole layout to make it less cluttered:
[image]https://cloud.githubusercontent.com/assets/54675/19775259/28ac40dc-9c70-11e6-8737-de7e7e2b1e7a.png
What do you think?

You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com/carstengehling/jirastopwatch/pull/39#issuecomment-256690964, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMXy-pwm8-3yFtBXtO2fOIVa_vVP50FUks5q4Mw8gaJpZM4KVUvA.

Hey Adam, finally done here. There was a strange bug regarding the scrollbar and the IssueControls not being positioned correctly when adding many of them (there was a huge blank area in the top of pMain. I fixed that too - and also added a little color to the icons.
Try to build this and let me know what you think.

Hi,
Have updated to your master and noticed one issue.  in the settings form the "Allow control over remaining estimate" is now wrongly positioned:

(The blue line is actually the top of the OK button).
I can send a PR, but it's probably as easier to just move it than merge :)
Also, when I first open it I get the status as expected in the bottom bar:

But if I then click the plus to add a new row this changes to a number, which changes as I change the number of issues:

Is this some debugging left in?
I'll use this version and let you know if I find anything else.

Haha - yeah the latter was some debugging - I'll fix it :-) I noticed the former as well just now when dealing with tab order in the Settings form. So it's already fixed.

Try to pull the latest commits and build again. Both things should be fixed now.


Mention and link fixes

Makes mentions actually work properly, and improves the confirmLink logic to not do hacky replacing. Not tested all that much.

Why is this not merged?

I wanted to wait for approvals, but I guess I'll just merge now.


aggregate sqllogictest fails

Describe the bug
I run the sqllogictest at latest commit of the main branch but it failed.

cargo test --test sqllogictests

the result is

External error: query result mismatch:
[SQL] select trace_id, MIN(timestamp) from traces group by trace_id order by MIN(timestamp) asc limit 4;
[Diff] (-expected|+actual)
NULL 0
b 0
-   c 1
-   a 1
+   a 1
+   c 1
at test_files/aggregate.slt:2357

To Reproduce
run the command

cargo test --test sqllogictests

my laptop is macbook pro m1, and the commit is c0409a7b
Expected behavior
pass the test
Additional context
No response

Thanks @doki23  -- it looks to me like the problem is that the output of the query is not deterministic -- namely that min(timestamp) is not distinct so ORDER BY MIN(timestamp) can return either order
I recommend we update the data used so that the min timestamp is distinct (aka add a row like ('a', 0) or something


Fix setting current org with debugging on

Small bug I just bumped in to..

I spotted it too and fix it with same patch


Update contracts digest to 40d6eaa

This PR contains the following updates:

Package
Update
Change

contracts
digest
7e5420c -> 40d6eaa

Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.

[ ] If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

Can one of the admins verify this patch?

@resin-jenkins add to whitelist

@resin-jenkins test this please

@balena-ci I self-certify!

@resin-jenkins add to whitelist

@resin-jenkins ok to test

@resin-jenkins test this please

lgtm

Closing stale automated PR. Reopen if this was done in error


Create react app typscript does not load d.ts file

Is this a bug report?
No
Did you try recovering your dependencies?
YES

(Write your answer here.)
npm --version
6.8.0
Which terms did you search for in User Guide?

(Write your answer here if relevant.)
Environment
Ubuntu

System:
OS: Linux 4.4 Ubuntu 16.04.5 LTS (Xenial Xerus)
CPU: x64 Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz
Binaries:
Node: 10.0.0 - /usr/local/bin/node
npm: 6.8.0 - /usr/local/bin/npm
Browsers:
Chrome: 72.0.3626.109
Firefox: 65.0
npmPackages:
react: ^16.8.3 => 16.8.3
react-dom: ^16.8.3 => 16.8.3
react-scripts: 2.1.5 => 2.1.5
npmGlobalPackages:
create-react-app: Not Found
Steps to Reproduce
(Write your steps here:)
I have moved my project into create react app typeascript from a webpack based build structure. It contains all the d.ts files in one folder. When i start my script server . it shows all the declaration in d.ts as 'X' interface  not found'.
Following in my tsconfig file. I am not sure what i am i missing here.
{
"compilerOptions": {
"target": "es6",
"lib": [
"dom",
"es2017"
],
"allowJs": true,
"skipLibCheck": false,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": false,
"sourceMap": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve",
"pretty": true,
"preserveConstEnums": true,
"typeRoots": [
"./node_modules/@types",
"src/types/"
]
},
"include": [
"src/"
]
}
Expected Behavior

d.ts file should be auto detected by typescript and the definations be aviable to use globally
Actual Behavior

All the declaration in the d.ts files are missing
Reproducible Demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

Are your d.ts files inside your src directory? They won't be automatically recognized otherwise. Hope that's all it is!

I can confirm that my .d.ts files are in the source directory but they are not recogiised, probably because '.d.ts' is not included in the list of file extensions.  If I add "d.ts" to the list, I get:
./my_special_types.d.ts 12:7
Module parse failed: Unexpected token (12:7)
You may need an appropriate loader to handle this file type.

which is a good sign that it's a webpack config issue, but sadly my fussing around with the various webpack config files was in vein and the issue still persists.

Hi ,
I had to include  "src/types/**/*", specially in my source folder and then it was able to detect the d.ts file on its own.


Document backend APIs

At least add a section in the toplevel README.md which explains how to compile Swagger and the URL where to fetch the generated documentation.

So far I have discovered endpoints:

URL
Example result
Notes

http://localhost:3000/api/status
{"status":"online"}


Live reload IP selection

This is a feature request.
Please provide a CLI way to specify live reload IP address. Maybe something like
taco run android --device --livereload --host=<IP_ADDRESS>

for example.
This may help people working with multiple networks.

Can anyone please support this if you think this is a nice feature to have ?

Hi sushruth,
I'm also looking forward to such feature. I managed to do the same manually:

go to (on windows) (if you have taco installed in default folder)
C:\Users\David\AppData\Roaming\npm\node_modules\taco-cli\node_modules\taco-livereload\lib\livereload.js

within
var bs = new BrowserSyncServer(projectRoot, {
beneath
ghostMode: options.ghostMode || true
add (don't forget to add a "," to the one above)
host: "[your ip]"

I hope this works for you!
David


golang part not works with $columns, $perSecond and $perSecondColumns macros

@bmanth60
could you help us solve
https://github.com/grafana/grafana-plugin-repository/pull/656#issuecomment-645432626
ASAP?

Thanks for resolving this, sorry I was tied up with work.

@bmanth60 also, I think we need refactoring and rewrite from https://github.com/grafana/grafana-plugin-model to https://github.com/grafana/grafana-plugin-sdk-go/