Comparing two Dask arrays for equality

Hello everyone !
I am trying to use the equality operation  (==) between dask arrays but I had an error. Now I am using Numpy arrays implementation instead.
I will post here (1) the code with Numpy arrays,  (2) the code with Dask arrays which is buggy, (3) the variables description from the Debugger and (4) the output error.
1.  This is the Numpy array-based implementation
masked_parts = np.copy(parts)
for sw_idx in range(0, n_sw):
    # extract only the voxels in the same cluster of the seed
     masked_parts[sw_idx, :] = masked_parts[sw_idx, : ] == masked_parts[sw_idx, :][mask_medoid]

2. This is the Dask array-based implementation
masked_parts = parts
for sw_idx in range(0, n_sw):
    # extract only the voxels in the same cluster of the seed
     masked_parts[sw_idx, :] = masked_parts[sw_idx, : ] == masked_parts[sw_idx, :][mask_medoid]

3. The variables
masked_parts: {Array} Dask Array, shape(9, 57k), dtype: int
mask_medoid: {Ndarray}[False, False, True, ... True], shape(57k), dtype: bool
4. The output error
../dynpar/dynamic_parcellation.py:74: in __mask_region_for_medoid
masked_parts[sw_idx, :] = masked_parts[sw_idx, :] == masked_parts[sw_idx, :][mask_medoid]

self = dask.array<array, shape=(9, 57790), dtype=int64, chunksize=(9, 7223)>
key = (0, slice(None, None, None))
value = dask.array<eq, shape=(57790,), dtype=bool, chunksize=(7223,)>
def __setitem__(self, key, value):
    from .routines import where
    if isinstance(key, Array):
        if isinstance(value, Array) and value.ndim > 1:
            raise ValueError('boolean index array should have 1 dimension')
        y = where(key, value, self)
        self.dtype = y.dtype
        self.dask = y.dask
        self.name = y.name
        self._chunks = y.chunks
        return self
    else:
        raise NotImplementedError("Item assignment with %s not supported)

E           NotImplementedError: Item assignment with <class 'tuple'> not supported
../../../.local/lib/python3.6/site-packages/dask/array/core.py:1221: NotImplementedError
So it seems that this is not supported yet by Dask arrays ...
If someone have thoughts related to how to implement my function differently using  dask arrays , I would appreciate any comments !
Thanks !

FWICT the existing example is pretty minimal, but this may highlight the issue more clearly. In other words, this doesn't appear to be an issue of equality, but one of assignment. @bamal, would you be ok with having this issue retitled to reflect this?
In [1]: import dask.array as da

In [2]: a = da.ones((10, 11), chunks=5)

In [3]: a[5, :] = 0
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
<ipython-input-3-0bcebd5d81b6> in <module>
----> 1 a[5, :] = 0

/zopt/conda3/envs/nanshenv3/lib/python3.6/site-packages/dask/array/core.py in __setitem__(self, key, value)
   1219         else:
   1220             raise NotImplementedError("Item assignment with %s not supported"
-> 1221                                       % type(key))
   1222
   1223     def __getitem__(self, index):

NotImplementedError: Item assignment with <class 'tuple'> not supported

would you be ok with having this issue retitled to reflect this?

@jakirkham I encourage you to just change things as you see fit.  You probably have more understanding and context here than most people who raise issues.  I encourage you to feel comfortable taking charge.
Is there something to be done for this issue?  If so, can I ask you to briefly summarize it?

I just started looking into dask as a way to scale some code beyond the limits of available ram and slammed headfirst into this problem. Both tuple and slice based item assignment are not a thing yet (I assume the focus is more on reading data than writing it?).
Is there a fundamental issue blocking the implementation of mutation?

Same here, the only workaround is to use dask.array.concatenate and that is what we had to do for fluidfft (unfinished API for dask FFT). I do hope there is a better way as this approach requires rewriting algorithms. If this is sorted out dask.array can truly be a drop-in replacement for numpy

Since #2000 is now closed, this issue can be closed as well?

Yep I think so. The example I showed above runs without issues. If there are other remaining issues, please feel free to raise them separately. Thanks! 😄


Dynamic debug enable fails in node packages

When using knex and another node library I was unable to change the status of the debugger in the global scope and have it change the debuging in a module.
Here is my test file
const debug = require('debug');
const config = require('./config.json');

var knex = require('knex')({
  client: 'mysql',
  connection: {
    host : config.sql.host,
    user : config.sql.user,
    password : config.sql.password,
    database : config.sql.database
  }
});

debug.enable('knex:*');

knex.raw('show databases').then(function(res){
	console.log('Done');
});

If I run this code with
node test.js

All I see in console is "Done"
$ node test.js
Done

However if I run the code with
DEBUG=knex:* node test.js

I get the debug response I'm expecting
$ DEBUG=knex:* node test.js
  knex:client acquired connection from pool: __knexUid1 +0ms
  knex:query show databases undefined +0ms
  knex:bindings [] undefined +0ms
  knex:client releasing connection to pool: __knexUid1 +6ms
Done

Also if you move
debug.enable('knex:*');

To be above the require for knex it will also log as expected.
It looks like the required node module will take on the debug state when the library is required and not when the debug log call is made.

Yes, .enable() is very much not intuitive (mostly because it's an anti-pattern, and thus makes things complex and even leaks memory). It's documented as such in the various issues here in the repository and is on the list to be fixed.
You should be using debug with environment variables, however. That is the proper way to use it.

Closing as a duplicate of the many other .enable()-related tickets already open in the tracker.


support / read the docs button label

The button label for read the docs is "ask questions", probably duplicated from the get support button label.

Fixed in Commit fcd32d5


Prevent scroll when dragging on mobile/tablet.

Is there any way to prevent the page from scrolling when using a drag n drop gesture on tablet/mobile?
I am implementing drag and drop similar to your dnd example (https://codesandbox.io/s/draggable-list-vp020), and the example also scrolls up and down when moving items on tablet.

That really depends on your use case, it’s not directly linked to the use of this library. As soon as I have some time I’ll check if there is a scrolling issue with the example, but I’m not experiencing any on my iPhone. In any case, if you don’t want the body to respond to scroll you should probably prevent default on all touch events (and please read the FAQ about passive events to understand how to do so (tldr: use { domTarget: yourRef, event: { passive: false }} config option, and make sure you don’t prevent default the last event as it’s debounced).

The easiest solution I have found is to use style={{ touchAction: 'none' }} on your animated.div.
Here is an example: https://tailwind-slidecards.netlify.com/

@impulse that actually looks like a way better option!

Thanks @impulse , I've tried that as well but it didn't work in my case.
So I've ended up doing this which works fine:
const bind = useGesture(     ({ down, delta, xy }) => {       if (down) {         // Prevent scroll on touch screens while dragging:         document.ontouchmove = function(e) {           e.preventDefault();         };       } else {         document.ontouchmove = function() {           return true;         };       }     }}   );
Don't love the solution but it works for now.

@adamhaeger Any solution that works is fine I guess! You might want to use addEventListener instead?
To expand a bit more on my previous explanation, you might want to h ave a look at this sandbox: https://codesandbox.io/s/react-use-gesture-simple-prevent-scroll-p7cjf
Unfortunately, using refs is incompatible with the idea of passing an argument to bind, which ruins the purpose of the draggable-list implementation, but I found @impulse implementation to be working perfectly.
Otherwise you may want to have a look at body-scroll-lock package.

Just adding my two cents for anyone looking for a solution.
touch-action changes won't be taken into account if the drag/touchmove gesture has already started. See the yellow box in the doc
It's probably why @adamhaeger could not use it. It seems you wanted to change your element's touch-action to none when the user had the finger down and back again when the user releases it.
It's unfortunately not possible as of the time of my writing. There is a discussion about this topic here: https://github.com/w3c/pointerevents/issues/178, although it does not seem very active.
Regarding the interception and prevention of default scrolling behavior, keep in mind that moderns browsers are defaulting to passive event listeners which can't be canceled (because performance)
So you may want to use this instead:
addEventListener('touchmove', e => e.preventDefault(), {passive: false})

Here is a simple hook I made if it can help:
function usePreventScroll(preventScrollRef) {
  useEffect(() => {
    const preventScrolling = e => {
      if (preventScrollRef.current) {
        e.preventDefault()
      }
    }

    document.addEventListener('touchmove', preventScrolling, {
      passive: false,
    })
    return () => document.removeEventListener('touchmove', preventScrolling)
  }, [])
}

Which you can then use like so:
const preventScrollRef = useRef(false)
usePreventScroll(preventScrollRef)
useGesture({
onDrag: ({down}) => {
  if(down) {
    preventScrollRef.current = true
  } else {
    preventScrollRef.current = false
  }
}});

Hey @dotlouis indeed. In regards to your hook, I think this is pretty much what body-scroll-lock does if I’m not mistaken!

Just for information, now there's also an extra documentation page on React UseGesture site which gives some tricks to handle this behavior:
https://use-gesture.netlify.app/docs/extras/

@dotlouis Nice one, that works well. Thanks.


Activity bar not visible after exiting zen-mode

Issue Type: Bug
Actions to reproduce the problem:

Open vscode in regular mode (i.e., not zen or full screen)
Ensure Activity Bar is checked in View>Appearance (activity bar should be visible)
Enter zen mode (the statur bar can no longer be seen, which is normal)
Exit zen mode: the Activity Bar cannot be seen, which is unexpected
Reload window: the Activity Bar pops back

VS Code version: Code 1.66.0 (e18005f0f1b33c29e81d732535d8c0e47cafb0b5, 2022-03-30T05:50:41.156Z)
OS version: Linux x64 5.13.0-39-generic snap
Restricted Mode: No
Extensions (50)

Extension
Author (truncated)
Version

better-comments
aar
3.0.0

cppincludeguard
aki
1.6.0

atlascode
atl
2.10.11

vscode-django
bat
1.10.0

Doxygen
bbe
1.0.0

doxdocgen
csc
1.4.0

c-cpp-compile-run
dan
1.0.15

python-environment-manager
don
1.0.3

python-extension-pack
don
1.7.0

gitlens
eam
12.0.5

prettier-vscode
esb
9.5.0

docker-explorer
for
0.1.7

c-cpp-runner
fra
3.2.4

vscode-drawio
hed
1.6.4

monkey-patch
ioc
0.1.16

vscode-ros2
Jae
0.0.8

latex-workshop
Jam
8.24.1

better-cpp-syntax
jef
1.15.13

julia-debug
Jud
0.0.32

language-julia
jul
1.6.15

auto-comment-blocks
kev
1.0.1

vsc-python-indent
Kev
1.15.0

vscode-clangd
llv
0.1.15

vscode-docker
ms-
1.21.0

python
ms-
2022.4.0

vscode-pylance
ms-
2022.3.4

jupyter
ms-
2022.3.1000901801

jupyter-keymap
ms-
1.0.0

jupyter-renderers
ms-
1.0.6

remote-containers
ms-
0.231.4

remote-ssh
ms-
0.78.0

remote-ssh-edit
ms-
0.80.0

remote-wsl
ms-
0.66.0

vscode-remote-extensionpack
ms-
0.21.0

cmake-tools
ms-
1.10.5

cpptools
ms-
1.9.7

latex-formatter
nic
1.0.5

autodocstring
njp
0.6.1

vscode-yaml
red
1.6.0

vscode-julia-formatter
sin
0.6.3

rewrap
stk
1.16.3

latex-utilities
tec
0.3.7

latex-support
tor
3.10.0

cmake
twx
0.0.17

vscode-lldb
vad
1.7.0

vscodeintellicode
Vis
1.2.18

vscode-icons
vsc
11.10.0

jinja
who
0.0.8

clang-format
xav
1.9.0

markdown-all-in-one
yzh
3.4.0

(4 theme extensions excluded)

A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392:30443607
pythontb:30283811
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscoreces:30445986
pythondataviewer:30285071
vscod805cf:30301675
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30449410
pythonvsnew555:30457759
vscscmwlcmt:30465135
cppdebug:30466689
pynewfile477:30463512

My bad, it was a typo. Just fixed the description.

I have a related issue. My activity bar is disabled with "workbench.activityBar.visible": false. When I enter and exit Zen mode, the activity bar appear, and I am not able to hide it until I restart the window.

I am unable to reproduce. Can you try with extensions disabled?

I have tried to disable extensions with --disable-extensions, and still can reproduce the problem. I realised that to reproduce it reliably, I need to first create a new window using "New Window" command, and the enter/exit zen mode in this new window. Here are additional details:
VS Code version: Code 1.66.2 (dfd34e8260c270da74b5c2d86d61aee4b6d56977, 2022-04-11T07:49:24.808Z)
OS version: Linux x64 5.16.18-100.fc34.x86_64
Restricted Mode: No

System Info

Item
Value

CPUs
Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz (8 x 2000)

GPU Status
2d_canvas: enabledcanvas_oop_rasterization: disabled_offdirect_rendering_display_compositor: disabled_off_okgpu_compositing: enabledmultiple_raster_threads: enabled_onoop_rasterization: disabled_offopengl: enabled_onrasterization: disabled_softwareraw_draw: disabled_off_okskia_renderer: enabled_onvideo_decode: disabled_softwarevideo_encode: disabled_softwarevulkan: disabled_offwebgl: enabledwebgl2: enabled

Load (avg)
2, 2, 2

Memory (System)
11.58GB (0.52GB free)

Process Argv
--disable-extensions test3 --crash-reporter-id 97e417ba-4f03-47cb-8130-cd3bd14caa32

Screen Reader
no

VM
0%

DESKTOP_SESSION
gnome-xorg

XDG_CURRENT_DESKTOP
GNOME

XDG_SESSION_DESKTOP
gnome-xorg

XDG_SESSION_TYPE
x11

Extensions disabled
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392:30443607
pythontb:30283811
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
pythondataviewer:30285071
vscod805:30301674
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30449410
pythonvsnew555:30457759
vscscmwlcmt:30465135
cppdebug:30475216

Here is a video where I reproduce the problem: https://youtu.be/5swyiF9homs

@mechtaev ah yes, I can reproduce your issue, since it is slightly different, can you please file a separate issue?

@sbatten great, done: #148862

I have the "opposite" issue: after hiding the activity bar and going into zen mode and exiting it again, the activity bar is visible and cannot be removed again. The checkmark in the menu is also missing. (MacOS and Linux)

@aalbaali can you still reproduce this issue with the latest 1.68?

No, I can no longer reproduce the issue with the latest update. I'll close the ticket, thanks.


Add Descriptions and Methods to API route documentation.

To enable this api domain to be whitelisted on sites like pythonanywhere.com the api documentation had to be improved. This PR adds some Descriptions and Method descriptions to the routes.

I have added a link to the official readme of this repo.
This links the api domain to the documentation.
This will allow it to be whitelisted on sites like pythonanywhere.com so that others can use it in their projects.

🎉 @123xylem  Thanks for your contribution! 😊
Your code looks great, and I appreciate the thoroughness of your work. The enhancement you added are well-implemented, and I've reviewed everything. I'm happy to approve it for merging. 🚀 Thanks again for your valuable contribution 😄

Thankyou 😁👍


Still hitting NoDataBeforeDate edge cases

@yankees714 From what we discussed yesterday. The failing contract was 'EL', which is on a quarterly cycle.

Coverage remained the same at 87.511% when pulling e9d02b4ec2e843e5b33bd5c5312d93c82ca99c6b on third-times-the-charm into ee42bd1354308f03811481fe0e03cd8692a75e00 on master.

Coverage remained the same at 87.511% when pulling e9d02b4ec2e843e5b33bd5c5312d93c82ca99c6b on third-times-the-charm into ee42bd1354308f03811481fe0e03cd8692a75e00 on master.

Coverage remained the same at 87.511% when pulling e9d02b4ec2e843e5b33bd5c5312d93c82ca99c6b on third-times-the-charm into ee42bd1354308f03811481fe0e03cd8692a75e00 on master.

Coverage remained the same at 87.511% when pulling 3427421c95b2c5e5f96ba989521aff64cc3d2fb4 on third-times-the-charm into ee42bd1354308f03811481fe0e03cd8692a75e00 on master.


Support matmul operator (@)

xref https://github.com/pandas-dev/pandas/issues/10259
Presumably deferring to the semantics of np.matmul - not sure if that API is stable yet?

For xarray, probably the right choice is for @ to be an alias for .dot():
http://xarray.pydata.org/en/stable/generated/xarray.DataArray.dot.html
The broadcasting semantics of np.matmul don't quite make sense because it broadcasts based on axis position, not name.

Would love support for PEP 465 @ notation.
Recently, @ came in handy when multiplying numpy.ndarray with scipy.sparse matrices. We're considering xarray for our project and compatibility with this unified operator would be a real plus!

More specifically, I'd like to be able to do matrix multiplication between numpy ndarrays / matrices, scipy sparse matrices, and xarray DataArrays. @ seems like the most natural operator to enable this cross-package compatibility.

More specifically, I'd like to be able to do matrix multiplication between numpy ndarrays / matrices, scipy sparse matrices, and xarray DataArrays.

I'm intrigued, but how would this work? data_array + numpy_array yields a result with well-defined labels as long as numpy_array broadcasts against data_array.data, but data_array @ numpy_array does not if numpy_array has 2 or more dimensions.
I guess we could prohibit @ with non-vector other arguments, but I still am concerned that the suggested meaning of @ per PEP 465 and numpy depends on the order of array dimensions. Basically, the last dimension of the left-hand-side argument should be matched against the second-to-last (or last, for 1D) dimension of the right-hand-side for the tensor contraction. In xarray terms, we could match the last dimension of the left-hand-side with any matching dimensions (by name) of the right-hand-side, but it's still messily inconsistent with other xarray operations, which are generally agnostic to to dimension order.
It also gets messy on Dataset objects, because the order of dimensions now becomes a bit more ambiguous: there's the order of dimensions on the Dataset itself, and the order on each DataArray in the dataset.
For these reasons, I'm leaning towards thinking that @ should be defined differently for xarray, and work like tensordot over all matching dimensions.

First let me say, I know python, but I don't know linear algebra (I rely on @kkloste for algebra). I'm also new to xarray and recently used it for the first time to represent a hetnet (network with multiple node and relationship types) as a xarray.DataSet where each DataArray is an adjacency matrix (0 or 1 for wether an edge exists) for a specific edge type. I was drawn to xarray because it allows us to:

assign row/column labels (representing node identity) to 2D arrays (adjacency matrixes in our case)
reason across multiple adjacency matrixes by assigning dimension identities (node types)

The operations that we're using for our project are dot-product multiplying 2D arrays by 2D arrays and 1D arrays by 2D arrays. Currently, our arrays are numpy.ndarrays, but we may switch some of our 2D arrays to scipy.sparse matrices.

I'm intrigued, but how would this work? data_array + numpy_array yields a result with well-defined labels as long as numpy_array broadcasts against data_array.data, but data_array @ numpy_array does not if numpy_array has 2 or more dimensions.

My intuition was that we use @ on a DataArray in cases where DataArray.values @ numpy.ndarray or numpy.ndarray @ DataArray.values would work. In these situations, the user would be responsible for ensuring DataArray.values had the correct dimensions. We're also interested in DataArray.values @ scipy.sparse.
However, it appears that xarray may do some inference based aligning dimensions/coordinates... and that I need to understand this process a bit more. Sorry if this reply doesn't help you move forward with this issue. I hopefully will be able to be more helpful as I become more familiar with xarray.

It also gets messy on Dataset objects

For clarity, I wasn't thinking of using @ on Datasets.

My intuition was that we use @ on a DataArray in cases where DataArray.values @ numpy.ndarray or numpy.ndarray @ DataArray.values would work.

Suppose data_array is a DataArray with dimensions ['x', 'y'] and numpy_array is a numpy.ndarray with a compatible shape. What should data_array @ numpy_array look like? The first dimension should be labeled x, but the second dimension doesn't have a name, so we'd need to come up with one somehow (every dimension in an DataArray must have a name).

However, it appears that xarray may do some inference based aligning dimensions/coordinates... and that I need to understand this process a bit more.

Indeed, see http://xarray.pydata.org/en/stable/computation.html#broadcasting-by-dimension-name

How about just keeping the current behavior?
Currently a @ b just returns a new numpy array if either a or b is no xr.DataArray.
This makes perfectly sense to me.
If both arrays are xr.DataArrays, I get an error which makes no sense.
Here, we could simply stick to xr.DataArray.dot().

Yes, we could definitely make @ between two xarray objects equivalent to xarray.dot().

Closed by #2987


@Injectable returning error while building

Short description of the problem:
I am using @Injectable for a service.
ionic build gives the following error:
bundle failed: Unexpected character '@' (11:0) in /Users/.../app/.tmp/.../file.service.ts
Steps to reproduce:

Define any @Injectable service
ionic build

Which @ionic/app-scripts version are you using?
Ionic 2 RC

Sorry, false alarm. Had some type in the import statement.


fix: React key props error in network drawer

Try out this version of the Stacks Wallet - download extension builds.

This fixes a react key prop error

I have this fix in https://github.com/blockstack/stacks-wallet-web/pull/1448, closing in favor of that (thanks for the PR though!!)

I have this fix in #1448, closing in favor of that (thanks for the PR though!!)

No problem, I missed your PR ! That was annoying to see at every console open 😄


fix: decrease bundle size when use monaco-vim

import { xxx } from 'monaco-editor' will end up importing all the editor languages and features.

This won't be required if you are using monaco webpack plugin.


Updated directory of bower for newest version

Hi all,
I've noticed after installing 0.1.8, all bower_components are installed in the parent directory, rather than within the /test directory (since the removal of the bower.json and bowerrc, etc) . This causes problems when trying to the run the tests, as the index.html file is referencing a bower_components folder that doesn't exist.

Hm, I thought I tested this. Oh, well. Thanks!


RFC: add API to return the list of currently supported dtypes

This RFC proposes to add an API to the standard for returning the list of currently supported dtypes. Currently, in order to query dtype support, one must do something like
hasattr(xp, "uint32")

and do so for each dtype specified in the array API standard. This is less than ideal, especially when testing. Additionally, this approach only works for known (i.e., specified) dtypes. One lacks a universal mechanism for dtype inspection (e.g., in a REPL). This RFC proposes to rectify this gap.
Prior art
To my knowledge, none of NumPy, JAX, PyTorch, TensorFlow, Dask, or MXNet support a common API for querying supported dtypes.
Proposal
dtypes() -> List[dtype]
dtypes(device: device) -> List[dtype]

If not provided an argument, the proposed API would return a list of currently supported dtype objects.
If provided a device, the proposed API would return a list of supported dtype objects applicable to the specified device.
Notes

When the proposed API is invoked without an argument, the list of currently supported dtypes would be based on the current device context. As discussed in the standard

...it is possible that a library supports multiple devices, with not all those device types supporting the same data types.

For libraries supporting a single device (e.g., currently NumPy and CPU), dtypes() would always return the same list. For libraries supporting multiple devices, the list of dtypes returned by dtypes() could vary.
For downstream users, they should be advised to not assume that dtypes() always returns the same list, especially when designing APIs intended to be array library agnostic.

Related

https://github.com/data-apis/array-api/issues/499

Update: updated the OP to include a device kwarg.

This RFC has been superseded by #640.


[Bug]<EMAIL_ADDRESS>could not be built.

Hi,
My code was working two days ago, and then I received this issue. I haven't been able to find any reference to it online, so I decided to report it just in case it's a bug from the newest update.

Just chiming in that the same behavior's occurring for my sites which use the same Skypack import scheme.

This is a bug with Skypack. Track in https://github.com/skypackjs/skypack-cdn/issues/332.
As an alternative, it appears that jsDelivr’s esm.run CDN works as expected:
import * as d3 from<EMAIL_ADDRESS>

I'm getting this same error when embedding an Observable notebook on this scrollytelling piece I made about the Colombian election


How to perform a task across all workers in a pool?

Hi
I'm using Pooler for resource management of my Riak connections. What I'm missing at the moment is being able to send a message to all workers in a pool.
What I want to achieve is telling each worker to call riakc_pb_socket:ping/1 or any other operation which is done on a interval basis.
I can't find any support for this through the existing APIs and the only reasonable approach I can think of is asking supervisor:which_children over the member_supervisor. The idea of this type of command invocation is not to actually perform any real work but to make sure work can be done.
Is there any better option than the one I mentioned?
Thanks,
Sam

Hello,
Implement your worker as gen_server, and in code send a message to self() with erlang:send_after, in handle_info catch the message to do the timed operation.
Regards.

yeah, that would work for the ping scenario.
But assume a situation where I would want to invoke a command for all workers to perform a given task in a broadcast manner. What options would I have then?

I find the need to have an additional process who owns riakc_pb_socket process a poor solution. Since it implies a lot of boiler plate to be written or introduce knowledge of 'this is not riakc_pb_socket process but a general wrapper' to whom ever checks out the worker, it's not a big issue to do this I just find it unnecessary and see it as a missing feature.
In the latest client code for Riak there is keep alive option for tcp but that's also a poor substitute if you're behind load balancers who sets up two tcp session on either side of itself.
I'm quite curious to know what paths people have taken here besides the mentioned one.

I've implemented similar health checks by putting that code into the client (the pooled member) itself.
What's the interface you'd like to have for communicating with all pool members? Do you want to apply the same function to each member? How do you want to handle members that are busy? Or do you only want to worry about free members?

Hi Seth
For now free members should be enough. I don't see an equally cheap way of getting out all members as free members. One way would be to take the keys from #pool.all_members dict. If you've got other suggestions I'm open to experiment with it.

call_free_members(PoolName, Fun, Timeout)

Where it applies Fun over all free members taken from #pool record and return the result.
handle_call({call_free_members, Fun}, _From, #pool{free_pids = Pids} = Pool) ->
  {reply, {ok, do_call_free_members(Fun, Pids)}, Pool};

do_call_free_members(Fun, Pids) ->
  [do_call_free_member(Fun, P) || P <- Pids].

do_call_free_member(Fun, Pid) ->
  try {ok, Fun(Pid)}
  catch
    exit:{Reason, _What} ->
      {error, Reason}
  end.

I'm just thinking what the consequence of this would be. One obvious consequence is a free member X could be performing Fun while a user takes the same member to perform a task.
Though this would be the same if I were to put such code in pooled member so I don't see this as a big problem.
I'm experimenting a bit now and I can make a PR later on if you're ok with this approach.

That seems like a fairly reasonable approach. On the try/catch you'll want to not match on the error type since things could crash with throw, exit, error. If an approach as above would help you, I'm up for merging it with some level of tests and docs. :)

Okay. Created PR #52.


An error occurred: jemalloc unsupported system page size

Hello. I am trying to use Ansor for auto-tuning, and I have installed py-xgboost-1.7.3-py311hd43f75c_0.conda. However, when I run my tuning program, I encounter the error mentioned in the title. I am using PyTorch 2.0.0, TVM 0.14.0, and Python 3.11. All these projects are compiled in an aarch64 environment.

XGBoost doesn't use jemalloc. I don't think the error is related to XGBoost

Feel free to reopen if there's further info.


chore(master): release filsnap 0.1.2

:robot: I have created a release beep boop
0.1.2 (2023-07-13)
Bug Fixes

add filecoin logo to npm (e48fdf0)

This PR was generated with Release Please. See documentation.

:robot: Release is at https://github.com/filecoin-project/filsnap/releases/tag/filsnap-v0.1.2 :sunflower:


Enable  running on premise

Enable an onpremise flag to disable any test which might try to access the internet.
I run K8S on premise on a fully disconnected network. Would like to use kube-hunter without needing to approve any access through proxy to the internet.

Hi @shayfisher !
We would like to make kube-hunter running in disconnected environments.
There is an ongoing work (#270 ) for declaration and management of external services integration.
Once this is completed, we can easily enable configuration for disconnected environment by disabling external services.
Thanks!


Uncaught TypeError: Cannot read property 'dispose' of undefined

After updating to beta-1 I got in Chrome
Uncaught TypeError: Cannot read property 'dispose' of undefined
unbind @ t.js:102
unbind @ aurelia-templating.js:2767
unbind @ aurelia-templating.js:883
unbind @ if.js:68
unbind @ aurelia-templating.js:2767
unbind @ aurelia-templating.js:883
unbind @ aurelia-templating.js:2763
unbind @ aurelia-templating.js:883
(anonymous function) @ if.js:40
flushMicroTaskQueue @ aurelia-task-queue.js:110
(anonymous function) @ aurelia-task-queue.js:60

In Firefox I have TypeError: this.subscription is undefined
The error occurs when changing merchantState.selector
// somewhere in app-subcomponent.html

     ${merchantState.merchant.user.companyname

I change merchantState.selector during navigation in auth step, and app-subcomponent is removed at that moment with if.bind="..." from the DOM.

@zewa666 Looks like from i18n?

yeah could be @valichek. May I ask you to create a fiddle so I can debug that code easier?

@zewa666 would be nice to have some configured plunkr/fiddle template with i18n, it is not easy just to extract code from my app because of complexity.

Just got some idea to override the problem. That html works with no  error.

     ${merchantState.merchant.user.companyname}
     <template show.bind="!merchantState.merchant">

     </template>

oh ok so its more a timing issue since it seems that show is removing the element before t can work with it. Could you try to change the order of the attributes, so t before show?

@zewa666 tried

but error is still there

ok thanks for checking, will take a look asap


Login via LDAPauth fails if givenName has unicode characters

If a user has a unicode character in his given name, the log in fails with the following error:
Error - <type 'exceptions.UnicodeDecodeError'>: 'ascii' codec can't decode byte 0xc3 in position 13: ordinal not in range(128)
I suspect that the error happens on authlib.py:396
395             res = search_conn.search_s(self._ldap_basedn, ldap.SCOPE_SUBTREE, self._ldap_search.format(ldap.dn.escape_dn_chars(self.username)), ['cn','memberOf'])
396             self.full_name = res[0][1]['cn'][0]

This sounds pretty similar to #922, can you please verify whether it's been fixed in v0.29.0 (which is in the testing repo)?

@Eising can you plxz test if this is still an issue with v0.29.0 from testing? :)

I've recently built nipapd from master, and the issue is solved there at least.

Ok, good. Closing.


Add n of m

Code-review checklist

Documentation

[ ] Interfaces describe how other programmers would use them.
[ ] Code that is not obvious has documentation describing why
that code is the way it is.

Looks good.


a suggestion to improve thunk documentation

I spent almost one hour in the sandwich and secret sauce example to find that

Thunks should not be present in any reducer, they can be dispatched by store itself!

I think it would be great if it was mentioned in the documentation.
thank you

@thg303 I'm not sure this is the place for that. Redux itself makes it clear that you shouldn't be doing side effects in reducers. Whether you are using thunks or just action creators that return objects neither should end up in your reducer.


verify_iss: true is raising JWT::DecodeError instead of JWT::InvalidIssuerError

When trying to encode/decode payloads, if I change the iss value with something else and setting verify_iss: true, I'm getting the wrong kind of error:
class JwtAuth

  def initialize app
    @app = app
  end

  def call env
    begin
      options = { algorithm: 'HS256', iss: 'test', verify_iss: true }
      bearer = env.fetch('HTTP_AUTHORIZATION', '').slice(7..-1)
      payload, header = JWT.decode bearer, 'secret', true, options

      env[:scopes] = payload['scopes']
      env[:user] = payload['user']

      @app.call env
    rescue JWT::DecodeError
      [401, { 'Content-Type' => 'text/plain' }, ['A token must be passed.']]
    rescue JWT::ExpiredSignature
      [403, { 'Content-Type' => 'text/plain' }, ['The token has expired.']]
    rescue JWT::InvalidIssuerError
      [403, { 'Content-Type' => 'text/plain' }, ['The token does not have a valid issuer.']]
    rescue JWT::InvalidIatError
      [403, { 'Content-Type' => 'text/plain' }, ['The token does not have a valid "issued at" time.']]
    end
  end

end

Now using jwt.io with the secret secret:
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NzQ0MzQ2MjAsImlhdCI6MTQ3NDQzMTAyMCwiaXNzIjoidGVzdCIsInNjb3BlcyI6WyJhZGRfbW9uZXkiLCJyZW1vdmVfbW9uZXkiLCJ2aWV3X21vbmV5Il0sInVzZXIiOnsidXNlcm5hbWUiOiJzY2FscCJ9fQ.1L-2GgdhziszR1UAo3G900CcI1MrqvmjlH5BQ0r8Pms

{
  "exp":<PHONE_NUMBER>,
  "iat":<PHONE_NUMBER>,
  "iss": "test",
  "scopes": [
    "add_money",
    "remove_money",
    "view_money"
  ],
  "user": {
    "username": "scalp"
  }
}

If I change iss in the payload to whatever for example, I would expect to see JWT::InvalidIssuerError happening but it doesn't appear to be the case in my code.
With iss being set to secret in the payload:

With iss being set to whatever in the payload:

With my code, I would have expected to see 'The token does not have a valid issuer.'.
Any idea ?
Thanks in advance!

Actually, changing the exp key to something expired or removing iss key for example are leading to JWT::DecodeError instead of the specific ones if it helps.

I wrote a spec for the issue:
require 'spec_helper'
require 'jwt'
require 'jwt/decode'

describe JWT do
    it 'should throw a JWT::InvalidIssuerError' do
        payload = {
            "exp": Time.now.to_i + 120,
            "iat": Time.now.to_i - 120,
            "iss": "wrong",
            "scopes": [
                "add_money",
                "remove_money",
                "view_money"
            ],
            "user": {
                "username": "scalp"
                }
            }

        token = JWT.encode payload, 'secret', 'HS256'

        expect do
            JWT.decode token, 'secret', true, { algorithm: 'HS256', iss: 'test', verify_iss: true }
        end.to raise_error JWT::InvalidIssuerError
    end
end

I get the correct error. Which version are you using?

Just change your rescue block to:
    rescue JWT::ExpiredSignature
      [403, { 'Content-Type' => 'text/plain' }, ['The token has expired.']]
    rescue JWT::InvalidIssuerError
      [403, { 'Content-Type' => 'text/plain' }, ['The token does not have a valid issuer.']]
    rescue JWT::InvalidIatError
      [403, { 'Content-Type' => 'text/plain' }, ['The token does not have a valid "issued at" time.']]
    rescue JWT::DecodeError
      [401, { 'Content-Type' => 'text/plain' }, ['A token must be passed.']]
    end

All JWT errors derive  from JWT::DecodeError that's why your code behaves in a "strange" way.

@excpt I see the issue now, thanks a lot for the help and sorry for opening this 🍶

Hi! i removed the slice on:
env.fetch('HTTP_AUTHORIZATION', '').slice(7..-1)
and works for me :)

allready defined

Allready Present

_###

[ ] - > Hello

_


Backing via [u8; N]

Using [u8; N] as the backing store instead of integers has the following benefits.

Support more unconventional bitfield sizes (like 24bit) without unnecessary padding
Support for larger bitfields beyond 128bit
No forced alignment to the underlying integer type

Changing the API to something like this, as suggested in https://github.com/wrenger/bitfield-struct-rs/issues/6.
#[bitfield] // no explicit backing type specified
struct Foo {
    foo: u64,
    bar: u64,
    #[bits(2)]
    extra: u8,
    #[bits(6)]
    _reserved: u8 // must include explicit "padding" bits
}

static_assert_eq!(std::mem::size_of::<Foo>(), 8 + 8 + 1);

// no `From`/`Into` for any specific backing integer, but instead have a From/Into `[u8; N]`

The main difficulty is the more complex (and perhaps less efficient) code generation for the accessor functions.
However, this might be abstracted into a single bit_copy function used by the accessors.
fn bit_copy(dst: &mut [u8], dst_off: usize, src: &[u8], src_off: usize, len: usize)

I'm not happy with this bit_copy implementation yet. It has three major problems:

It is very complex and fragile due to the number of edge cases.
The generated code is far less optimal than the previous implementation.
It cannot be made const as long as const_mut_refs is missing (https://github.com/rust-lang/rust/issues/57349)

The first two can be solved by refactoring and optimizations. The latter is not that easy.

Ok the generated and inlined code is better than expected: https://godbolt.org/z/4n3Mv6fK8

Yeah, I would've been very surprised if the generated code ended up any worse than that. The lack of any/all panics is especially good to see!

3. It cannot be made const as long as const_mut_refs is missing

Well that's certainly unfortunate.
Here's an idea though: see if you can const-ify it without relying on helper functions (i.e: just emit the required code on a per accessor basis). If that works, you can start streamlining + optimizing that code.
e.g: by pre-computing which if-statements apply to which field, and manually emitting only the case you care about.
e.g: by lifting out smaller chunks of shared utility into their own helper functions
Of course, having that feature be stable would be optimal... but I'm sure that with a bit of tasteful code contortions, it should be workable without it as well.

Ok here is the first workaround, moves instead of mut refs.
The generated code, however, is less optimal. Even with optimizations, it copies a lot more.
https://godbolt.org/z/ePG7Yzfve

I'll try to poke around this code a bit. Maybe I can spot some easy wins / optimizations.
In the meantime, here's a rewritten bit_print method that is nicer to use in godbolt, since it doesn't bring in any of the noisy Rust formatting machinery (making it easier to focus on the code we actually care about):
#[inline(never)]
fn bit_print(v: &[u8]) {
    fn putchar(c: u8) {
        extern "C" {
            fn putchar(c: u8);
        }
        unsafe { putchar(c) }
    }

    for b in v {
        let mut b = *b;
        for _ in 0..8 {
            putchar(if b & 0x80 == 0 { b'0' } else { b'1' });
            b <<= 1;
        }
        putchar(b' ');
    }
    putchar(b'\n');
}

I played around with it a bit, and it seems that you can get pretty dang close to identical by helping the Rust compiler reason about the moves. See https://godbolt.org/z/WTs8boW9f
In a nutshell: the following construct seems to iron out the codegen issues quite nicely:
// new "inner" function
fn set_flag_copy(x: [u8; 4], flag: bool) -> [u8; 4] {
    let src = [flag as u8];
    bit_copy(x, 3, &src, 0, 1)
}

// same API as what you had
fn set_flag(x: &mut [u8; 4], flag: bool) {
    *x = set_flag_copy(*x, flag)
}

Oh, and for posterity: here's a godbolt I was playing around with that compares (streamlined versions of) the non-cost and my new const versions against eachother: https://godbolt.org/z/oaWxT73Yz

This looks cool. Is the thinking that specifying the backing would become optional, or would it be prohibited?
I'd prefer optional, where bitfield(u32) continues to enforce an alignment of 4 and a backing size of 32 bits, for example, and implicitly a transmutability to u32 for FFI. In my use of this crate, I have a lot of types that should really be naturally aligned u32/u64 values, and the existing attribute makes it really easy to see the underlying type without explicit align or const asserts.

(Really I think I'd probably avoid the bare bitfield attribute altogether, since if I'm using bitfields, I almost always want to know, specify, and enforce the underlying backing type. Otherwise I imagine that I'll get the size or alignment wrong accidentally and pass an invalid *mut T across some FFI boundary.)

I agree with @jstarks  - when I proposed the bare #[bitfield] syntax, I didn't fully reason though the footgun implicit align(1) would have. Don't get me wrong - having align(1) bitfield structs would still be useful in certain scenarios, but I don't think it makes for the best default.
So, on that note: I would suggest disallowing the bare #[bitfield] syntax, and sticking to the existing syntax of specifying a backing type, while introducing a new bit of syntax for specifying arbitrary [u8; N]-backed bitfield structs (with implicit align(1))
(and of course: keeping the existing syntax would be a good move regardless, in terms of making it easy to upgrade between versions)

The only question becomes... what syntax to use for exotically-sized bitfields?
Maybe something like #[bitfield(N)]?  Though, #[bitfield(8)] is awfully close to #[bitfield(u8)], which could lead to some annoying typo errors...
Maybe something more explicit like #[bitfield(size = N)] might be better? Though, with syntax highlighting, 8 and u8 would look quite different, so maybe it's not too bad...
Anyways, this is an area ripe for bikeshedding, and ultimately, I'm not too concerned with the specific syntax - just that it is opt-in, rather than implicit (as initially suggested)

In general, I want to keep this library as simple as possible. Having two entirely different code generation methods, depending on whether the underlying type is an int or a byte array, is not ideal. I would instead fully commit to one of the two: either only integers or byte arrays.
The latter probably with a backward compatible way of defining the bitfield's size and alignment using integers (#[bitfield(u32)]).
The decision of which backing type to use is not easy. Integers are limited but very simple, which is important for efficient code generation and proc macros, which often come with compile-time overheads.
The byte array backing is more flexible but also quite complex, and const functions are currently so limited that code generation and readability suffer.

I'd prefer optional, where bitfield(u32) continues to enforce an alignment of 4 and a backing size of 32 bits, for example, and implicitly a transmutability to u32 for FFI. In my use of this crate, I have a lot of types that should really be naturally aligned u32/u64 values, and the existing attribute makes it really easy to see the underlying type without explicit align or const asserts.

This is also the case for me. I primarily use this bitfield crate for x86 register abstractions (which are usually aligned accordingly) and packing data into atomic data types (like AtomicU64 with from/into). So keeping this common case as the default makes sense.

Don't get me wrong - having align(1) bitfield structs would still be useful in certain scenarios, but I don't think it makes for the best default.

Maybe in these cases, #[repr(packed)] that enforces align=1, might be sufficient. Alternatively, a wrapper could be used that copies the bytes internally from a byte array into the bitfields integer.
Also, if sizes other than 1, 2, 4, 8, or 16 bytes are needed, one could fallback on two or more bitfield types stored in a packed struct.

A few thoughts:

I totally agree that you should pick one repr backend and stick with it - having two different codegen backends seems like a bad idea from a maintainability + feature parity standpoint
It would be interesting to see the codegen of this new array-backed approach vs. the old integer-backed approach in a non-godbolt context. Any chance you could use something like cargo asm to smoke test the end-to-end proc-macro generated code?
I would shy away from proclaiming #[repr(packed)] as the "blessed" way to do these sorts of things:

In my experience, #[repr(packed)] is a real ergonomic pain-point, as it makes working with references to packed fields incredibly annoying (in the sense that you can't just do stuff like packed.field.method_taking_ref_self(), due to alignment issues). Maybe it's not as bad here (since things are all Copy), but it's worth exploring.
Manually decomposing an non 2^n sized bitfield into a set of ad-hoc smaller bitfield structs that get smooshed together into a single #[repr(packed)] field doesn't seem fun (and would mean that field accesses look like packed.inner0.field(), unless there's some hand-rolled getter/setter delegates on the outer struct itself)

Of course, this is your lib, and you're totally free to make whatever complexity vs. featureset vs. codegen tradeoffs you think are best, so if you think this feature falls on the wrong side of those tradeoffs, that's totally reasonable - i'll just have consider some alternatives.
That being said, as someone who's been hacking on emulators and OS code for a while now, I've found that exotically sized bitfield structures - while rare - certainly do come up, and having a single ergonomic and featureful Rust crate to reach for when working with bitfield would be incredibly helpful 😉

Yes I agree that this general solution would be very cool.
I'm just a little bit unsure if I'm capable to make the bit copy function as efficient as the current implementation. It seems to me like a more complicated memcpy, which in itself is highly optimized for different architectures.
However, I'm willing to implement the code generation with the current bit copy and we can decide then if we are happy with it's performance.

After being quite occupied the last few days I was finally able to implement the code generation for the new bit_copy.
The bitfield attribute has changed a little:

Integer bitfields start with the ty argument followed by an integer type.
The size and alignment are copied from the integer type but can be overwritten.
The ty argument can be omitted if you want to specify the size and alignment of the bitfield manually.
For example: #[bitfield(ty = u64)].
The other arguments for this macro accepts are:

bytes: The byte size of the bitfield (default: 1)
align: The alignment of the bitfield (default: 1)
debug: Whether or not the fmt::Debug trait should be generated (default: true)

It seems functional so far, but I didn't benchmark it yet. What do you think?

In terms of feature-set, I think you've nailed it!
AFAICT, this implementation ticks all the boxes I wanted when initially filing this feature request 🎉
The only remaining questions to me are around the API itself, and how we might refine it:

I strongly prefer the existing bitfield(uX) syntax over the more explicit bitfield(ty = uX) syntax

As discussed earlier in the thread, it seems likely that most users of bitfield-struct (including yourself, and indeed, myself) will primarily be modelling integer-backed bitfields, so making that syntax more verbose feels like a step backwards in usability

What are the precise semantics of using the bytes argument vs. specifying a [u8; X] backing?
Just to double check (without looking too closely at the proc-macro impl itself): the default align should be alignof(ty), not 1... right?
I don't think we should allow the bare #[bitfield] syntax, for those aforementioned foot-gun issues

i.e: in true Rust fashion, the API should make sure users into the pit of success, which in this case, means specifying a backing type (and therefore getting proper alignment)
The fact that the type is backed by an array internally should be just that - an internal implementation detail, quietly serving its purpose

Those are some of my initial thoughts after perusing the code. I'll try to find some time to clone down and play with the code in a more hands-on fashion as well, and see if I can glean any more insights there.
Oh, and thanks again for taking a crack at this! It's starting to shape up really nicely, and I'm super excited to refactor some code using this new functionality 😄

I strongly prefer the existing bitfield(uX) syntax over the more explicit bitfield(ty = uX) syntax

As discussed earlier in the thread, it seems likely that most users of bitfield-struct (including yourself, and indeed, myself) will primarily be modelling integer-backed bitfields, so making that syntax more verbose feels like a step backwards in usability

It was easier to parse, but using bitfield(uX) and bitfield([u8; N]) should also be possible.
In any case, we need a nice semantic for defining byte size and alignment (preferably with backward compatibility).

Just to double check (without looking too closely at the proc-macro impl itself): the default align should be alignof(ty), not 1... right?

Specifying ty copies alignment (and size) from it.
If ty and align are both not specified, it defaults to 1.

I don't think we should allow the bare #[bitfield] syntax, for those aforementioned foot-gun issues

i.e: in true Rust fashion, the API should make sure users into the pit of success, which in this case, means specifying a backing type (and therefore getting proper alignment)

Using #[bitfield] is equivalent to #[bitfield(bytes = 1, align = 1)]. The macro still checks that the members occupy exactly 8 bits.
But yes, enforcing an explicit size (via bytes, ty, or the other syntax) might be a good idea.

The fact that the type is backed by an array internally should be just that - an internal implementation detail, quietly serving its purpose

Yes, that was part of the idea for trying a different semantic other than bitfield([u8; N]).
Maybe we should support specifying either bitfield(uX) or bitfield(bytes = N) with the latter having an optional align parameter (defaulting to 1). The former just uses the alignment from the integer.

But yes, enforcing an explicit size (via bytes, ty, or the other syntax) might be a good idea.

Indeed. Allowing bare #[bitfield] with align=1, bytes=1 semantics seem like the wrong default to promote, so I think it's best to deny it entirely.

Maybe we should support specifying either bitfield(uX) or bitfield(bytes = N) with the latter having an optional align parameter (defaulting to 1). The former just uses the alignment from the integer.

Well... I think there's still merit in allowing both ty and align = 1, since getting the From<ty> and Into<ty> impls seems useful.
Maybe you could consider something like the following?
// scenario 1 (most common, same as today)
#[bitfield(u32)] // with no support for additional attrs
// scenario 2 (advanced)
#[bitfield(ty = u32, align = 1)] // all key = value pairs
// ...or
#[bitfield(bytes = 5, align = 2)]

Well... I think there's still merit in allowing both ty and align = 1, since getting the From and Into impls seems useful.

Yes, indeed.

Maybe you could consider something like the following?
// scenario 1 (most common, same as today)
#[bitfield(u32)] // with no support for additional attrs
// scenario 2 (advanced)
#[bitfield(ty = u32, align = 1)] // all key = value pairs
// ...or
#[bitfield(bytes = 5, align = 2)]

We also have the debug argument, which is already supported (#[bitfield(u32, debug=false)]).
Scenario 1 would also have to support this optional argument, to keep the current functionality.
This means that both 1 and 2 have optional arguments, but 1 does not accept all of them...
So, in that case, only two versions seem a lot easier.
#[bitfield(u32, align = 1, debug = false)]
#[bitfield(bytes = 3, align = 2, debug = false)]

PS: Sorry for the late answer.

Ahh, that's right, you already support debug...
Okay, yeah, fair enough! In that case, those two versions you proposed look great to me!
i.e: require either ty or bytes = N, and then zero or more additional optional attrs.

And no need to apologize!
I'm just happy to see this PR continue to chug along at a reasonably steady pace.
It'll land when it lands :)

Thanks for working on [u8; N] support - this will really help with embedded development projects. I've been testing this branch and it's working well in a std environment, but when I move it to no_std environment on ESP32 it won't build.
I believe it's due to the removal of the this from Cargo.toml
[lib]
proc-macro = true

Are there plans to make it no_std compatible again?

no_std is definitely a priority for this crate. However, this branch still tests implementations and might contain bugs/oversights in addition to this one.

Do you have an intention to merge this at some point? Really need this one as my struct is 48 bytes. Aside from that this crate looks perfect for my case :(

@heroin-moose, I would love to, but I'm currently not happy with the design and the (in certain cases) non-optimal code generation. There are also certain nightly features like const mut refs that would make this a lot cleaner. Unfortunately, they are not ready yet.
Also, I currently don't have much time for further experimentation, which is why this PR didn't got much attention lately.

Any updates?

Not really, I'm afraid.

I'm probably a bit late to this discussion, but we should probably use an integer type wherever possible and otherwise fallback to an array. Apart from that, we could check if the field we're accessing is byte aligned and the size a power of two and generate code depending on that. I'm afraid, we won't be able to generate more optimal code.

Would love to see this.  I'm writing some code to parse fixed-length 80-byte chunks of data from a legacy binary data file format that will involve use of:

Individual fields require use of bit fields (thus the interest in this package)
Unions
Nested structures / fixed-length arrays of nested structures
Nested structures with bit fields, where the nested structure is not of integer size (i.e. 3 bytes)

On and on.
This package is almost perfect for me, except the constraint restricting me to only built-in integer types makes it almost totally useless, I think...  (I still have to get into it in more depth, but scoping this out in advance is not looking promising at first glance.)


Import error with pip package

pip3 install sixdrepnet   #Works!

import sixdrepnet

I get the following error (I am currently running it on colab)
[/usr/local/lib/python3.8/dist-packages/sixdrepnet/regressor.py](https://localhost:8080/#) in <module>
      8 import numpy as np
      9
---> 10 from model import SixDRepNet
     11 import utils
     12

ModuleNotFoundError: No module named 'model'

Have you tested this?
# Import SixDRepNet
from SixDRepNet import SixDRepNet
import cv2

# Create model
# Weights are automatically downloaded
model = SixDRepNet()

img = cv2.imread('/path/to/image.jpg')

pitch, yaw, roll = model.predict(img)

model.draw_axis(img, yaw, pitch, roll)

cv2.imshow("test_window", img)
cv2.waitKey(0)```

Yeap still not working
ModuleNotFoundError: No module named 'model'
But I have already dowl. SixDRepNet

I uploaded a new package that should solve this error:
pip install sixdrepnet==0.1.5
thorsten@thorsten:~/Projects/6DRepNet$ python
Python 3.9.16 (main, Dec  7 2022, 01:12:08)
[GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sixdrepnet
>>> from sixdrepnet import SixDRepNet
>>> model = SixDRepNet()

Pull the newest changes from github. You are currently executing the code from your local repo, not the pip package.

To much Error

The project is not a working project, it does not work with new versions as far as I understand, so I pass this project.
Thanks for help

Fix: https://github.com/thohemp/6DRepNet/commit/6dd8cf297c258dc80795756f3f38e38f19770b69

Thanks! It works now.


2.0 Typeahead would be really usefull for select to replace select lists

Right now typeahead is implemented in a way to grab the its data of an (un-handy) inline attribute: data-data="["comma-separated", "values"]"
It is desirable to use typeahead for a drop-down select replacement. Ideally in a way that it would use the text for selection and the possibly available 'value' as selection form data.

Athens / Greece
Berlin / Germany
Canberra /  Australia

Same thing could be applied to multi-selects  if twitter-bootstrap starts supporting this.
Something similar to this (http://scaffolding.cloudfoundry.com/book/edit/1 <<< see author field) would be very useful.

Take a look at Chosen, probably the best option to do what your asking: http://harvesthq.github.com/chosen/
The amount of work to do that makes the likelihood of implementation low at this time, I expect.  Might be easier to get Chosen to be appropriately styled by Bootstrap.

Thnx hcwebdev, looks pretty nice, I like the progressive enhancement it offers. It looks little bit overloaded esp. compared to the example I linked to before. Still I guess I'll go with it for the moment.
Bad part of this solution is that it is searching only from the begin of words for the requested string (not possible to find charsequences in the middle of a word) + the slightly overloaded design.
Nevertheless I still think bootstrap should have its own component to solve this use case.

I don't think we're going to offer this functionality at this time. Thanks!

I understand, but why would you close the issue instead of postponing it to a later version?


Firefox qLtempOverlay Fix

Fix to remove qLtempOverlay in Firefox when loading has finished. Test on Firefox 67.0.4 for MacOS returns the expected result of removing qLtempOverlay when loading has finished, tests on Chrome, Opera and Safari do not exhibit any blocking

@eddieflexrs Thanks! Looks like there is something wrong with Travis though. I'll fix it first before merging.

@Gaya I updated the source as well. I am looking at the Travis errors and I can run all those commands in my local environment without getting an error. I'm new to working with Travis so any insight would be appreciated. Thanks again!

@eddieflexrs looks like a really old version of gulp is having trouble. Haven't touched this package in years, so that might be the problem. I'll dig into it.
Thanks for helping out with this repo!


Self-contained Single File

Since .NET 5 and .NET 6 still doesn't have a fully self-contained single file yet (while .NET Core 3.0/3.1 does) would you consider making Photino work with .NET Core 3.0/3.1 also so people has the option to get a fully self-contained single file application?
Or is there other plans for this?

There are no plans to migrate Photino back to Core 3, and while we haven't actually tried and/or tested single file deployment in .NET 5 ourselves yet, it appears -according to MS documentation- that the single file application features from 3.0 have been enhanced in .NET 5 and should still be available:
https://docs.microsoft.com/en-us/dotnet/core/deploying/single-file

@ottodobretsberger While .NET 5/6 does have Single File deployment, they're not a true Single File as it still requires a few other files which are built together with it, to run.
While .NET Core 3.0/3.1 is a single file only.

We do not consider backward compatibility to 3.0 or 3.1 at this point. The overhead in changes would be too much to efficiently keep up with.
There are planned changes for .NET5/6 in that regard though, so we're hopeful to see true single file deployment again.


Cannot read property 'getIdFromUrl' of undefined

I really commend the great effort put into this package.
I'm currently using version 1.3.4
I have a method as below
getId() {       return this.$youtube.getIdFromUrl(this.videoUrl);     }
The out output of console.log(this.$youtube); is shown in the attached screenshot

Please how can i resolve this?

There is no any problems - https://codesandbox.io/s/vue-template-474dz
Show your code, for example using codesandbox.

Thank you so much @TitanFighter .
I'm using this inside a nuxt app.
I created a plugin with the following code.
import Vue from 'vue'
import VueYoutube from 'vue-youtube'

Vue.use(VueYoutube)

Then  i have a method inside my page that looks like below
 getId() {
      return this.$youtube.getIdFromUrl(this.videoUrl);
    }

I do not use nuxt :(

Here is shown how to use vue-youtube with nuxt.


Fix syntax warning about "is not" vs "!="

I am using Python 3.8 and got a warning:
/usr/local/lib/python3.8/dist-packages/mpldatacursor-0.7.dev0-py3.8.egg/mpldatacursor/datacursor.py:202: SyntaxWarning: "is not" with a literal. Did you mean "!="?
This was easy to fix so here is a pull request!

Thanks for the PR!


Add Rishit-dagli to website-maintainers team for 1.28 release

Temporarily adding myself to the website-maintainers team for write access to the k/website repo for the release preparation/release day.
/assign @divya-mohan0209 @natalisucks @reylejano (SIG Docs Chairs)

/hold until 14 August 2023 (a day before the 1.28 release)


add app ViP Abfahrten

This app shows departures of public transportation service in Potsdam, Germany (https://www.swp-potsdam.de/de/verkehr/).

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


Add sync trigger on peer connection

Currently sync is triggered only on announcement. It is entirely possible to start the sync right after the initial handshake. In some situations, it can have the benefit of avoiding micro-forks on startup.

Currently merged to dev, closing.


Can I take snapshot of 3D face after rotating different angle in Python

Hey Hi,
Thanks for the great help to make 2d images into 3d objects, i works good. We have favour, that we want to process 3d object rotate every angle and take snapshot. That would be done in python iteself not in meshlab or anyother tools because mannually it won't possible. Can you give me some suggestion or sample coding, How i would remodify/reuse the vertices based on rotated angles and getting 3D object into 2d images like reverse way in python. Please help me im stuck on this.!!

It seems that you can refer to face3d to do offline render.

can you please tell me how to pass 3D object and take snapshot or image? where i can modify those code on this. I'm stuck on this how to pass and run this program. Please help me!!

@varun-tangoit  if you want to transform a 3 obj (vertices, colors, triangle) into 2d image check the function transform_test from here:
https://github.com/YadiraF/face3d/blob/master/examples/3_transform.py
Specially the following code:
        image_vertices = mesh.transform.to_image(projected_vertices, h, w, True)
	rendering = mesh.render.render_colors(image_vertices, triangles, colors, h, w)
	rendering = np.minimum((np.maximum(rendering, 0)), 1)

Thanks for the response @ileniTudor . I can able to use this. i got inverted face of every angles, i dont know but example itself it works good;

Hey Hi:
Do you finish the work  that is calling snapshot function of meshlab by using python


LUN-125: fixing the misplaced articles style on bigger screens

This pull request belongs to an issue on our bugtracker.
You can find it there by looking for an issue with the key which is mentioned in the title of this pull request.
It starts with the keyword LUN.

This is the LUN-125 task done for the main branch instead of being a branch from LUN13 branch, I will delete the previous one once you approve it.


Move ToResponse/ToService under io.finch

Fixes #799.

Codecov Report

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

@@           Coverage Diff           @@
##           master     #801   +/-   ##
=======================================
  Coverage   80.34%   80.34%
=======================================
  Files          46       46
  Lines         697      697
  Branches       30       25    -5
=======================================
  Hits          560      560
  Misses        137      137

Impacted Files
Coverage Δ

core/src/main/scala/io/finch/Output.scala
100% <ø> (ø)
:arrow_up:

.../src/main/scala/io/finch/sse/ServerSentEvent.scala
90% <ø> (ø)
:arrow_up:

core/src/main/scala/io/finch/Bootstrap.scala
100% <ø> (ø)
:arrow_up:

core/src/main/scala/io/finch/ToService.scala
100% <ø> (ø)

core/src/main/scala/io/finch/ToResponse.scala
86.95% <ø> (ø)

Continue to review full report at Codecov.

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


Cryptography package missing

Looks like the cryptography package is not marked as a dependency.

Here is a PR that fixes this issue: https://github.com/ni/NI-SystemLink-Migration/pull/130
Apologies for not including that package in the non development dependencies. I'll create another release when this PR goes in. Meanwhile you can run pip install cryptography as a work around.

Should be fixed in: https://github.com/ni/NI-SystemLink-Migration/releases/tag/0.0.32


Removed pause animation on hoverEnded

Had to revert this commit because it is needed for the playOnHover prop. I think what you wanted was a way to trigger the animation play state with a prop but this was not the intended use case. I would suggest using a reactive prop and handling the play state manually with a mouse-over event. Let me know if you need an example.


Internal Error - upgrade wiped settings - instability/TLS timing out

Describe the bug
container seemingly had a full collapse, after discovering the site simply returned SSL errors
"You cannot visit [domain] right now because the website uses HSTS. Network errors and attacks are usually temporary, so this page will probably work later."
i checked the certs, the cert was aparently missing, but there was a ton from 2021, i tried deleting one.... internal error. nice. helpful.
so i shut down the container, and followed the UPGRADE instructions on the website, as provided by the developer ... and what do you know it boots up and all my settings are wiped, clean install, everything gone. - well what the hell is the point in that?
at least if it all works then it'll be fine for another 6 months before i gotta go wipe all my settings again right.... nope. upon trying to turn on SSL;  internal error... nice. helpful.
frustrated, i rolled the container back to my last snapshot taken somewhere in 2020, booted up, ofcourse the certs will be very out of date, so i tried requesting new cert - internal error.... nice. helpful.
so i then think perhaps there was a db error that muddied up the upgrade process, i mean i'm literally guessing at this point, "internal error" tells me absolutely nothing. why show it at all, so i updated to latest yet again and what do you know... all settings wiped once again...
at least if it all works then it'll be fine for another 6 months before i gotta go wipe all my settings again right.... nope. upon trying to turn on SSL;  internal error... nice. helpful.
(seriously, an error code or SOMETHING would go astronomical lengths, going through and digging out 20,000 line log files to find the one line that displays some context is a waste of my time, i've better things to be doing.)
i checked letsencrypt to see if they're having issues.... no....
i checked if i could resolve letsencrypt.... yup
so, annoyed, i simply left it. the site is down, there's nothing i can do tonight, so i'll either find a solution here, the issue fix itself, or i'll move platforms to something else tomorrow.
Nginx Proxy Manager Version
latest.
To Reproduce
use anything ssl
Expected behavior
it use ssl
Screenshots
i would but my screenshot program is linked to my site and npm is down, but you get the idea, "internal error" .... nice. helpful.
Operating System
debian container within proxmox
Additional context
latest docker, latest everything.

 i tried adding SSL cert via the ssl certificates panel on the main page which thankfully shows a more verbose error (why can't this be in the 'internal error' popup?)  - and it appears npm went ahead and hit a rate limit so now i must wait a week for it to time out.... fun

further update i tried creating a cert for another domain i have and it shows a different error - probably what caused the rate limit in the first place.
`Error: Command failed: certbot certonly --config "/etc/letsencrypt.ini" --cert-name "npm-12" --agree-tos --authenticator webroot --email "xxxxxxx" --preferred-challenges "dns,http" --domains "xxxxxxxx"
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Some challenges have failed.
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.
at ChildProcess.exithandler (node:child_process:399:12)
at ChildProcess.emit (node:events:526:28)
at maybeClose (node:internal/child_process:1092:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)`


Zts cmc stable

@mahesh-zetta Our stable folder has 2 readme files to update.  The one you updated and a second one in the stable folder (the parent directory).  Can you add some extra details so consumers of this policy will have a link to your product and will know how it's special compared to the other pod policy?  Thanks!

@mahesh-zetta Our stable folder has 2 readme files to update. The one you updated and a second one in the stable folder (the parent directory). Can you add some extra details so consumers of this policy will have a link to your product and will know how it's special compared to the other pod policy? Thanks!

@gparvin ,   I just added a README entry to the repository.  Should I open a new PR?  Thanks.

@mahesh-zetta Thanks for adding the readme.    There you added: "See the Zettaset README to learn more about Zettaset CMC Deployment."
Also, the commit sign off needs to be done.  There's some more details here: https://github.com/stolostron/policy-collection/blob/main/CONTRIBUTING.md#dco-sign-off.  Take a look at that info to help get your commits signed.

@mahesh-zetta Thanks for adding the readme.  There you added: "See the Zettaset README to learn more about Zettaset CMC Deployment." Also, the commit sign off needs to be done. There's some more details here: https://github.com/stolostron/policy-collection/blob/main/CONTRIBUTING.md#dco-sign-off. Take a look at that info to help get your commits signed.

@gparvin ,  The signoff's in this PR, require some intermediate files to be signed off.  These files have somehow been deleted.  Is it fine if I open a new PR with the changes, with just the 2 file changes ?  Thanks, Mahesh

THat would be great.  Thanks!

https://github.com/stolostron/policy-collection/pull/322
Replaced 320 with 322.


Request for Guidance on Integrating Custom Data into OG-MARL

Hello!
Thank you for your valuable work on OG-MARL; it has been instrumental for my research. I noticed that the data used in OG-MARL is preprocessed, and I am wondering if it is possible to integrate my own collected data (including action.pth and observation.pth) into the framework.
Could you kindly provide guidance or share code for converting custom data into the required format for OG-MARL? Any assistance would be greatly appreciated.
Thank you for your time and help!

Hi there, I am very happy you have found OG-MARL useful. I am happy to help you integrate your custom data. However, I am on Holiday until the 6th of January.
Until then, please check out this notebook to see if it can help you get started.
https://colab.research.google.com/drive/1snnjANof199aZMjvizmsRxrWk7P9rcem?usp=sharing


Handle progress line length properly for formatting

Two issues with a prior PR for handling line-spanning progress bars are
fixed in this PR:

corner case where output line length is exactly == term width: extra line was being
added
line length calculation was including escape characters causing
calculations to span lines when output was still only on one line

Signed-off-by: Phil Estes<EMAIL_ADDRESS>

Codecov Report

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

@@           Coverage Diff           @@
##           master    #1737   +/-   ##
=======================================
  Coverage   48.58%   48.58%
=======================================
  Files          28       28
  Lines        4250     4250
=======================================
  Hits         2065     2065
  Misses       1750     1750
  Partials      435      435

Continue to review full report at Codecov.

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

I can add a test if it would help clarify what's being solved here.

I still think we should get rid of the progress bars...


Fix Shell Side Arm's category

Based on the best science I can find, Shell Side Arm's damage category is dependant on the relative predicted damage and not just the defense stats of the target pokemon.
This change matches that behaviour.  I left some notes in my implementation in case this needs following up on, once there is better info.

The first research post @scheibo linked already proves it can't just be a simple comparison of (attack stat / defense stat). I make reference to those tests again in the last post he linked because this kind of thing didn't make any sense.
170 Atk / 59 Def = 2.881356
141 SpA / 49 SpD = 2.877551

Your implementation would have this always return Physical, but in reality it can be either Physical or Special at random.

The first research post @scheibo linked already proves it can't just be a simple comparison of (attack stat / defense stat). I make reference to those tests again in the last post he linked because this kind of thing didn't make any sense.
170 Atk / 59 Def = 2.881356
141 SpA / 49 SpD = 2.877551

Your implementation would have this always return Physical, but in reality it can be either Physical or Special at random.

Yeah, the PS implementation needs to preserve this coin flip behaviour, so I don't think it makes sense to optimize there.
However, as I mention above, for calculator purposes, it's desirable to always return a deterministic result, so I think this is fine.  As @urkerab mentions, there's already a UI in Showdown calc to override the category if you really need to.

Thanks all! What a wack move this is :P

(I haven't actually looked to see how that UI override works, so I can't be sure that you're not actually overriding it rather than the other way around.)

The UI overrides move.category, so currently does not serve as a way for overriding the SSA in the calc.pokemonshowdown.com UI. That being said, it probably is the correct way to allow for overriding this (as opposed to adding yet another freaking toggle), so some rewiring is probably necessary here. That being said, allowing for users to break ties here seems like really low priority concern at the minute


Image prompts

A duplicate of https://github.com/gpt-engineer-org/gpt-engineer/pull/1054 on the main repository

Mainly at @TheoMcCabe
I may realize I may not have done a great job with relative/absolute paths in the load_prompts function. This may be tinkered on a little

Replaced by https://github.com/gpt-engineer-org/gpt-engineer/pull/1077


Update PropertyFieldToggleWithCallout.md

Typo in documentation for PropertyFieldToggleWithCallout control

Good catch, thanks @Tomatokun13, I merged this to the DEV branch.


Changes to new sdk module paths

Included are the changes necessary to get dotjs to compile with Firefox (41.0b5)

Awesome. Looks good.
Were you able to build and test with jpm?
Thanks!

Yes,  I am able to build with jpm.

Nice. It works for me too. I tested on on release too (v40.0.3) and it works. So I think it's good to ship.


Fails to auto-detect the vehicle ID

I'm trying to test the API, and as recommended I made a seperate account for API use, this account has no keys, has never used the app, has never made an order, etc.
When using a command that needs a vehicle ID, like --state, currently the code runs the command for vehicle_orders to find a vehicle. This doesn't work in this case, as I have no order, instead the user info provides the correct info.

Hi there, can you provide the output and what you're expecting to see?

Sorry, here is the output when I run --state
$ ./bin/rivian_cli --state
Didn't find vehicle ID None

But when I provide the vehicle ID, it works
$ ./bin/rivian_cli --state --vehicle_id 01-23456789
Vehicle State:
Power State: sleep
Drive Mode: everyday
Gear Status: park
Odometer: 511.1 mi
Location: 40.0000, -70.0000
Speed: 0.0 mi/h
Battery:
   Battery Level: 65.9%
   Range: 206.3 mi
   Battery Limit: 71.0%
   Battery Capacity: 130.654999 kW
   Charging state: charging_complete
   Charger status: chrgr_sts_connected_no_chrg
   Time to end of charge: 0
OTA:
   Current Version: 2023.42.01
   Available version: 0.0.0
   Status: Idle
   Install type: Convenience
   Duration: 0
   Download progress: 0
   Install ready: ota_available
   Install progress: 0
   Install time: 0
   Current Status: Install_Success
Climate:
   Climate Interior Temp: 51.8ºF
   Climate Driver Temp: 68.0ºF
   Cabin Preconditioning Status: undefined
   Cabin Preconditioning Type: NONE
   Defrost: Off
   Steering Wheel Heat: Off
   Pet Mode: Disabled
Security:
   Alarm active: false
   Gear Guard Video: Enabled
   Gear Guard Mode: Away_From_Home
   Last Alarm: 11/21/2023, 14:38PM EST
   Gear Guard Locked: False
Doors:
   Front left locked: True
   Front left closed: True
   Front right locked: True
   Front right closed: True
   Rear left locked: True
   Rear left closed: True
   Rear right locked: True
   Rear right closed: True
Windows:
   Front left closed: True
   Front right closed: True
   Rear left closed: True
   Rear right closed: True
Seats:
   Front left Heat: False
   Front right Heat: False
   Rear left Heat: False
   Rear right Heat: False
Storage:
   Frunk:
      Frunk locked: True
      Frunk closed: True
   Lift Gate:
      Lift Gate Locked: True
      Lift Gate Closed: signal_not_available
   Tonneau:
      Tonneau Locked: signal_not_available
      Tonneau Closed: signal_not_available
Maintenance:
   Wiper Fluid: normal
   Tire pressures:
      Front Left: OK
      Front Right: OK
      Rear Left: OK
      Rear Right: OK

Doing some debug stuff, I see that the vehicle id is provided only via user info:
$ ./bin/rivian_cli --user

{'data': {'user': {'email': {'email': 'edman007}, 'phone': None, 'firstName': 'API', 'lastName': 'Man', 'addresses': [], 'newsletterSubscription': False, 'smsSubscription': True, 'registrationChannels2FA': {'TEXT': False}, 'userId': '02-23456789-blah, 'vehicles': [{'id': '01-23456789', 'highestPriorityRole': 'DRIVER', '__typename': 'RivianIdVehicle'}], 'invites': [], 'orderSnapshots': []}}}

User details:
userId: 02-23456789-blah
email: edman007
firstName: API
lastName: Man
newsletterSubscription: False
smsSubscription: True
registrationChannels2FA TEXT: False

Also, the pretty print for the phone doesn't work, I had to comment out this line 'phone': response_json['data']['user']['phone']['formatted'], in get_user() of rivian_cli.py
The code says it can't find the vehicle id because it does a query for vehicle orders and doesn't find anything because I never had an order, but I do have a vehicle assigned on the user profile. It should probably use the user info command to query their vehicles, not the orders which they might not have.

If you don't provide a vehicleId it tries to figure it out (basically taking first one) from the vehicle_orders. It seems something in there isn't right, can you show what that looks like by running ./bin/rivian_cli --vehicles ?
Should look something like this:
vehicleId: 01-2764xxxx
vin: 7FCTGAAA8PN0xxxxx
modelYear: 2023
make: RIVIAN
model: R1T
Battery: Large battery pack
Paint: Limestone exterior color
Interior: Black Mountain + Dark Ash Wood interior
Drive system: Quad-Motor AWD
Accessories: Tow Hooks
Package: Adventure Package
Region: United States of America
Wheels and tires: 20" All-Terrain wheel and tire

The --vehicles option gets info from --vehicle_orders which may also provide some hints as to whats going wrong.
For me at least the user ID doesn't look anything like the vehicle ID:
userId: 02-652ecef0-e2a5-4d93-97e8-2dfez1344c27-9829703b
What was the error you got for the phone? It works for me. I added some protection around it.

Sorry, the user ID and vehicle ID, lat, lon i censored (and didn't feel like typing that much stuff), so those might not be in the exact format I actually see.
Anyways, when I run that --vehicles I get:
$ ./bin/rivian_cli --vehicles
Didn't find vehicle ID None

Also, I didn't login on that account via the app yet, doesn't seem like the API requires it...
And the error for the phone was:
Traceback (most recent call last):
  File "/home/edman007/docs/projects/rivian-api-tool/rivian-python-api/src/rivian_python_api/rivian_cli.py", line 1232, in <module>
    main()
  File "/home/edman007/docs/projects/rivian-api-tool/rivian-python-api/src/rivian_python_api/rivian_cli.py", line 885, in main
    user = get_user(args.verbose)
  File "/home/edman007/docs/projects/rivian-api-tool/rivian-python-api/src/rivian_python_api/rivian_cli.py", line 398, in get_user
    'phone': response_json['data']['user']['phone']['formatted'],
TypeError: 'NoneType' object is not subscriptable

With that update I still get:
Traceback (most recent call last):
  File "/home/edman007/docs/projects/rivian-api-tool/rivian-python-api/src/rivian_python_api/rivian_cli.py", line 1234, in <module>
    main()
  File "/home/edman007/docs/projects/rivian-api-tool/rivian-python-api/src/rivian_python_api/rivian_cli.py", line 887, in main
    user = get_user(args.verbose)
  File "/home/edman007/docs/projects/rivian-api-tool/rivian-python-api/src/rivian_python_api/rivian_cli.py", line 400, in get_user
    and 'formatted' in response_json['data']['user']['phone'] else None,
TypeError: argument of type 'NoneType' is not iterable

Ok I added more protection for the phone thing.
I'd try that --vehicle_orders option next

Now the phone and --user stuff works, as for --vehicle_orders:
$ ./bin/rivian_cli --vehicle_orders
No Vehicle Orders found

Like I said, the vehicle ID seems to only be returned with the --user (see the json debug stuff I inserted into it on the original post)

Ah can you run it with the --verbose option, like: ./bin/rivian_cli --vehicle_orders --verbose

sorry, should have known that:
$ ./bin/rivian_cli --vehicle_orders --verbose
orders:
{'data': {'orders': {'__typename': 'OrderSearch', 'data': []}}}
No Vehicle Orders found

Hmm, that's interesting so they're showing no vehicle order. I think we can make it fall back to checking the user record for a vehicle ID if it doesnt find it in vehicle orders. I made that change so give that a shot

Yup, tested, that works fine! Fixed!


Release notes for 3.14.3 and 3.14.4

Can you please add the release notes for 3.14.3 and 3.14.4 in the Changelog 3x?

Here you go!
https://square.github.io/okhttp/changelog_3x/#version-3124
https://square.github.io/okhttp/changelog_3x/#version-3123

Thank you. OMG :see_no_evil:


[FEATURE]: Default select for custom types

Describe what you want
When creating a custom type that doesn't have a straightforward select like a postgis geometry, for example.
export type Point = {
  lat: number;
  lng: number;
};

export const pointType = customType<{ data: Point; driverData: string }>({
  dataType() {
    return 'geometry(Point,4326)';
  },
  toDriver(value: Point): string {
    return `SRID=4326;POINT(${value.lng} ${value.lat})`;
  },
  fromDriver(value: string) {
    const matches = value.match(/POINT\((?<lng>[\d.-]+) (?<lat>[\d.-]+)\)/);
    const { lat, lng } = matches?.groups ?? {};

    return { lat: parseFloat(String(lat)), lng: parseFloat(String(lng)) };
  },
});

We need to create a select function wrapper to properly select the field with this custom type.
export const selectPoint = (column: string, decoder: DriverValueMapper<any, any>) => {
  return sql<Point>`st_astext(${sql.identifier(column)})`.mapWith(decoder).as(column);
};

// then select it like this:
db.select({
   ...allOtherFields
  coords: selectPoint('coords', location.coords),
}).from(location);

That means we always need to specify this custom select when working with this table, also we are not able to use the relational query syntax because the there is no way to provide a custom sql fragment in the columns object (only true/false boolean specifying the field inclusion)
Proposal:
Add a selectFromDb option to customType factory function like so:
export const pointType = customType<{ data: Point; driverData: string }>({
  dataType() {
    return 'geometry(Point,4326)';
  },
  toDriver(value: Point): string {
    return `SRID=4326;POINT(${value.lng} ${value.lat})`;
  },
  fromDriver(value: string) {
    const matches = value.match(/POINT\((?<lng>[\d.-]+) (?<lat>[\d.-]+)\)/);
    const { lat, lng } = matches?.groups ?? {};

    return { lat: parseFloat(String(lat)), lng: parseFloat(String(lng)) };
  },

 /** this is new */
  selectFromDb(column, decoder) {
    return sql<Point>`st_astext(${sql.identifier(column)})`.mapWith(decoder).as(column);
  },
});

Now we when the field is being selected from db the selectFromDb function will be automatically called if specified for given field.

@drepkovsky this would be super useful, especially for postgis or any other data types you might want to cast server-side. I've been experimenting with temporary workarounds, there's two ways to potentially do this now without this 'selector'.

Manually parse PostGIS hex / wkx coming from / to the database driver
Wrap the customType and SQL inject the public".ST_AsGeoJSON("${dbName}") as "${dbName} as a name columnName (this hardcodes the public schema into here though so this wouldn't work if you do work on any other schemas.

This feature request would improve this a lot, since the compute / parsing of the hex to json etc would in almost all of the cases be much faster on the native' database side.

Related issue by one of the maintainers: https://github.com/drizzle-team/drizzle-orm/issues/554

need this asap!

💎 $30 bounty created by @john-griffin
👉 To claim this bounty, submit your pull request on Algora
📝 Before proceeding, please make sure you can receive payouts in your country
💵 Payment arrives in your account 2-5 days after the bounty is rewarded
💯 You keep 100% of the bounty award
🙏 Thank you for contributing to drizzle-team/drizzle-orm!

/attempt #1423


chore(packaging): X📦 Enable support for versioning Git archives

It's a follow-up to #735 that lacks this property. It's also an internal change.
It essentially allows one to
$ pip install https://github.com/antonbabenko/pre-commit-terraform/archive/339c31a.tar.gz

and get a correctly computed version in the installed metadata.

Put an x into the box if that apply:

[ ] This PR introduces breaking change.
[ ] This PR fixes a bug.
[ ] This PR adds new functionality.
[ ] This PR enhances existing functionality.
[x] This PR is an internal change that the end-users won't notice.

Description of your changes

See above.

How can we test changes

$ pip install https://github.com/antonbabenko/pre-commit-terraform/archive/339c31a.tar.gz

I suppose that's why you marked it as draft?
via pre-commit-terraform
➜ pip install https://github.com/antonbabenko/pre-commit-terraform/archive/339c31a.tar.gz
Collecting https://github.com/antonbabenko/pre-commit-terraform/archive/339c31a.tar.gz
  Downloading https://github.com/antonbabenko/pre-commit-terraform/archive/339c31a.tar.gz
     - 102.1 kB 2.2 MB/s 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [39 lines of output]
      fatal: not a git repository (or any of the parent directories): .git
      Traceback (most recent call last):
        File "/home/vm/code/0-other/open-source/pre-commit-terraform/venv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/vm/code/0-other/open-source/pre-commit-terraform/venv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/vm/code/0-other/open-source/pre-commit-terraform/venv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 152, in prepare_metadata_for_build_wheel
          whl_basename = backend.build_wheel(metadata_directory, config_settings)
        File "/tmp/pip-build-env-f_b8t2yj/overlay/lib/python3.10/site-packages/hatchling/build.py", line 58, in build_wheel
          return os.path.basename(next(builder.build(directory=wheel_directory, versions=['standard'])))
        File "/tmp/pip-build-env-f_b8t2yj/overlay/lib/python3.10/site-packages/hatchling/builders/plugin/interface.py", line 90, in build
          self.metadata.validate_fields()
        File "/tmp/pip-build-env-f_b8t2yj/overlay/lib/python3.10/site-packages/hatchling/metadata/core.py", line 265, in validate_fields
          _ = self.version
        File "/tmp/pip-build-env-f_b8t2yj/overlay/lib/python3.10/site-packages/hatchling/metadata/core.py", line 149, in version
          self._version = self._get_version()
        File "/tmp/pip-build-env-f_b8t2yj/overlay/lib/python3.10/site-packages/hatchling/metadata/core.py", line 244, in _get_version
          core_metadata = self.core
        File "/tmp/pip-build-env-f_b8t2yj/overlay/lib/python3.10/site-packages/hatchling/metadata/core.py", line 196, in core
          metadata_hook.update(self.core_raw_metadata)
        File "/tmp/pip-build-env-f_b8t2yj/overlay/lib/python3.10/site-packages/hatch_vcs/metadata_hook.py", line 45, in update
          urls[key] = formatter.format(url)
        File "/usr/lib/python3.10/string.py", line 161, in format
          return self.vformat(format_string, args, kwargs)
        File "/tmp/pip-build-env-f_b8t2yj/overlay/lib/python3.10/site-packages/hatchling/utils/context.py", line 143, in vformat
          result, _ = self._vformat(format_string, args, kwargs, used_args, 10)
        File "/usr/lib/python3.10/string.py", line 218, in _vformat
          result.append(self.format_field(obj, format_spec))
        File "/tmp/pip-build-env-f_b8t2yj/overlay/lib/python3.10/site-packages/hatchling/utils/context.py", line 161, in format_field
          return self.__formatters[formatter](value, data)
        File "/tmp/pip-build-env-f_b8t2yj/overlay/lib/python3.10/site-packages/hatch_vcs/metadata_hook.py", line 39, in <lambda>
          'commit_hash': lambda *args: vcs_utils.get_commit_hash(self.root),
        File "/tmp/pip-build-env-f_b8t2yj/overlay/lib/python3.10/site-packages/hatch_vcs/vcs_utils.py", line 10, in get_commit_hash
          return subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=root).decode('utf-8').strip()
        File "/usr/lib/python3.10/subprocess.py", line 421, in check_output
          return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
        File "/usr/lib/python3.10/subprocess.py", line 526, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command '['git', 'rev-parse', 'HEAD']' returned non-zero exit status 128.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

Yep: https://github.com/ofek/hatch-vcs/issues/80. I'm withdrawing the effort until I hear from the upstream.


How can  I get   dataset  ?

I didn't find the data set of CJO  or PKU and CAIL  mentioned in the paper.  can you  provide me the  dtasets?

The first two are private, the third one you can get from the website of CAIL.


feat(orderUpdated): Add support for delivery methods

Summary
This PR resolves #14
Description
It adds a support for actions addDelivery and addParcelToDelivery
Reviewers

[ ] Reviewer 1 has approved the PR
[ ] Reviewer 2 has approved the PR

TODO

Tests

[x] Unit
[x] Integration
[ ] Acceptance

[ ] Documentation

Codecov Report

Merging #15 into master will not change coverage.
The diff coverage is 100%.

@@          Coverage Diff          @@
##           master    #15   +/-   ##
=====================================
  Coverage     100%   100%
=====================================
  Files           4      4
  Lines          94    102    +8
=====================================
+ Hits           94    102    +8

Impacted Files
Coverage Δ

src/order-schema.js
100% <ø> (ø)
:arrow_up:

src/build-order-actions.js
100% <100%> (ø)
:arrow_up:

Continue to review full report at Codecov.

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

Let's keep this on hold till when it's implemented in the csv-parser-order module...

There was added this PR https://github.com/commercetools/csv-parser-orders/pull/18 which adds a possibility to parse deliveries CSV into JSON object. This JSON object can be then taken by this module and imported into API.

This PR is currently blocked by this issue on the SDK https://github.com/sphereio/sphere-node-sdk/issues/229


Add vSphere IaaS overview

We've been adding overview pages to describe some of the bigger picture, IaaS-specific feature and support information. This adds a vSphere-specific one, similar to the the AWS and OpenStack ones we have recently added.

@yeshwantbabar, can you or your team help review this starter for accuracy and fill in some of the TODOs whenever you get a chance? The OpenStack one also includes a Requirements section where they list supported versions; that might be helpful here too if you think it's relevant and want to add it.

@nehagjain15  - Can you look into this?

sure

@dpb587 created PR with updates to the page


Overly permissive policy in batch_execution_role

The batch_execution_role is allowed to do autoscaling:DeleteLaunchConfiguration on all resources (see here). This is a concern, since it could seriously mess with production systems running in EKS.
Is there a strong reason for allowing this, or is it possible to restrict the resources which are covered by the policy?

Good point, it can be narrowed down a bit to launch configurations that are named AWSBatch*.
This wasn't a huge concern since this role is supposed to be used only by AWS Batch itself (the service that is), not by user code running inside a Batch job. I believe these permissions are a simplified version of what AWS tells you to use. But those are indeed a little narrower.

I took a very naive shot at addressing this in https://github.com/outerbounds/terraform-aws-metaflow/pull/12. I could be missing stuff though, and I cannot test the change. @oavdeev could you maybe take a look?


Is development still going for this repo?

Yes, though for the last several months and the next our main efforts are focused on related capabilities that are not necessarily in this repo.

Ah okay thanks for the response. Anything that would be helpful for body scanning?
Sent from my phone

On Nov 28, 2016, at 4:24 PM, Joshua Blake<EMAIL_ADDRESS>wrote:
Closed #10.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Can't comment on anything in development yet. (To be clear when we fix/add stuff on the Astra SDK we'll usually push to github pretty immediately though.)


Use properly variable scope declaration

Maybe using a constant is a better idea? What you think?

Browser support is about 97.61% globally, according to https://caniuse.com/#feat=const (looks like IE-only issue for me)

Thanks, but this is very intentional. 🙂 Vue supports down to IE9 and const will not work in IE9 or IE10. Since our core docs don't assume a compilation step (e.g. with Babel), I feel it'd be irresponsible to demonstrate code that won't work in all the browsers we support.
Eventually though, we do plan to have a toggle for people who want to see examples that assume a build system.