TF lite implementation for RandomStandardNormal

System information

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 18.04
TensorFlow installed from (source or binary): Docker image tf-nightly-gpu-py3
TensorFlow version (or github SHA if from source): 3.6.8

Provide the text output from tflite_convert
Some of the operators in the model are not supported by the standard TensorFlow Lite runtime. If those are native TensorFlow operators, you might be able to use the extended runtime by passing --enable_select_tf_ops, or by setting target_ops=TFLITE_BUILTINS,SELECT_TF_OPS when calling tf.lite.TFLiteConverter(). Otherwise, if you have a custom implementation for them you can disable this error with --allow_custom_ops, or by setting allow_custom_ops=True when calling tf.lite.TFLiteConverter(). Here is a list of builtin operators you are using: ADD, EXP, FULLY_CONNECTED, LEAKY_RELU, LOG, MUL. Here is a list of operators for which you will need custom implementations: RandomStandardNormal.

VAE model was taken from your custom layers and models site (here). The line of code producing this exception is
epsilon = tf.keras.backend.random_normal(shape=(batch, dim)).
It might be a good idea to add a tflite implementation for this function so that people can try a conversion with your existing examples.

@jaeyoo Do you have any updates regarding the implementation? There seems to be some work in progress for the related issue #34277 here, but not for the actual implementation.
If you have any experimental implementation for testing, please let me know.

Hi, @DocDriven,
I could convert the model in tf 2.2.0 with the select_ops
converter = tf.lite.TFLiteConverter.from_keras_model(vae)
converter.target_spec.supported_ops = [tf.lite.OpsSet.TFLITE_BUILTINS,
                                       tf.lite.OpsSet.SELECT_TF_OPS]
tflite_model = converter.convert()

Could you try it?

Hey @jaeyoo I am able to convert my model using SELECT_TF_OPS, but that greatly increases the size of the libtensorflowlite library.
I am trying to get my model running on Android and this is the one operator in my way from >100 megabytes decrease in app download size.
Not only that, but I am trying to use the tensorflowlite c api and it doesn't seem like android arm compilation is supported when using flex delegate:
ERROR: /Users/corey/Workspace/omnivor-io/gst-sync-android/app/src/main/jni/tensorflow/tensorflow/lite/delegates/flex/BUILD:76:1: C++ compilation of rule '//tensorflow/lite/delegates/flex:delegate_only_runtime' failed (Exit 1): clang failed: error executing command
  (cd /private/var/tmp/_bazel_corey/9e892e94b2950203c06bbbfc8119bc78/execroot/org_tensorflow && \
  exec env - \
    ANDROID_BUILD_TOOLS_VERSION=29.0.3 \
    ANDROID_NDK_API_LEVEL=26 \
    ANDROID_NDK_HOME=/Users/corey/library/Android/Sdk/ndk-bundle \
    ANDROID_SDK_API_LEVEL=29 \
    ANDROID_SDK_HOME=/Users/corey/library/Android/Sdk \
    PATH=/Users/corey/.pub-cache/bin:/Users/corey/Workspace/depot_tools:/usr/local/opt/llvm/bin:/Users/corey/Downloads/google-cloud-sdk/bin:/Users/corey/.rbenv/shims:/Users/corey/Library/Android/sdk/platform-tools:/Users/corey/Library/Android/sdk/tools:/Users/corey/.fastlane/bin:/Users/corey/.local/bin:/Library/Frameworks/GStreamer.framework/Versions/Current/bin/:/Users/corey/.poetry/bin:/Users/corey/Library/Android/sdk/tools/bin/:/Applications/Postgres.app/Contents/Versions/10/bin:/Users/corey/.pyenv/shims:/usr/local/bin:/Users/corey/local/bin:/Users/corey/.npm-global/node/bin:/Users/corey/.npm-global/bin:/Users/corey/.poetry/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/corey/.ebcli-virtual-env/executables:/Users/corey/.pub-cache/bin:/Users/corey/Workspace/depot_tools:/usr/local/opt/llvm/bin:/Users/corey/Downloads/google-cloud-sdk/bin:/Users/corey/.rbenv/shims:/Users/corey/Library/Android/sdk/platform-tools:/Users/corey/Library/Android/sdk/tools:/Users/corey/.fastlane/bin:/Users/corey/.local/bin:/Library/Frameworks/GStreamer.framework/Versions/Current/bin/:/Users/corey/.poetry/bin:/Users/corey/Library/Android/sdk/tools/bin/:/Applications/Postgres.app/Contents/Versions/10/bin:/Users/corey/.pyenv/shims:/Users/corey/local/bin:/Users/corey/.npm-global/node/bin:/Users/corey/.npm-global/bin:/Users/corey/flutter/bin:/Users/corey/bin:/Users/corey/flutter/bin:/Users/corey/bin \
    PWD=/proc/self/cwd \
    PYTHON_BIN_PATH=/Users/corey/.pyenv/versions/3.7.3/bin/python3 \
    PYTHON_LIB_PATH=/Users/corey/.pyenv/versions/3.7.3/lib/python3.7/site-packages \
    TF2_BEHAVIOR=1 \
    TF_CONFIGURE_IOS=0 \
    TF_ENABLE_XLA=1 \
  external/androidndk/ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang -gcc-toolchain external/androidndk/ndk/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64 -target aarch64-none-linux-android -fpic -isystemexternal/androidndk/ndk/sysroot/usr/include/aarch64-linux-android '-D__ANDROID_API__=26' -no-canonical-prefixes -Wno-invalid-command-line-argument -Wno-unused-command-line-argument -funwind-tables -fstack-protector-strong -fno-addrsig '-Werror=return-type' '-Werror=int-to-pointer-cast' '-Werror=pointer-to-int-cast' '-Werror=implicit-function-declaration' -O2 -g -DNDEBUG -MD -MF bazel-out/arm64-v8a-opt/bin/tensorflow/lite/delegates/flex/_objs/delegate_only_runtime/delegate.pic.d '-frandom-seed=bazel-out/arm64-v8a-opt/bin/tensorflow/lite/delegates/flex/_objs/delegate_only_runtime/delegate.pic.o' -fPIC -DEIGEN_MPL2_ONLY '-DEIGEN_MAX_ALIGN_BYTES=64' '-DEIGEN_HAS_TYPE_TRAITS=0' -DSUPPORT_SELECTIVE_REGISTRATION -D__CLANG_SUPPORT_DYN_ANNOTATION__ -iquote . -iquote bazel-out/arm64-v8a-opt/bin -iquote external/com_google_absl -iquote bazel-out/arm64-v8a-opt/bin/external/com_google_absl -iquote external/nsync -iquote bazel-out/arm64-v8a-opt/bin/external/nsync -iquote external/eigen_archive -iquote bazel-out/arm64-v8a-opt/bin/external/eigen_archive -iquote external/local_config_sycl -iquote bazel-out/arm64-v8a-opt/bin/external/local_config_sycl -iquote external/com_google_protobuf -iquote bazel-out/arm64-v8a-opt/bin/external/com_google_protobuf -iquote external/zlib -iquote bazel-out/arm64-v8a-opt/bin/external/zlib -iquote external/double_conversion -iquote bazel-out/arm64-v8a-opt/bin/external/double_conversion -iquote external/com_googlesource_code_re2 -iquote bazel-out/arm64-v8a-opt/bin/external/com_googlesource_code_re2 -iquote external/farmhash_archive -iquote bazel-out/arm64-v8a-opt/bin/external/farmhash_archive -iquote external/flatbuffers -iquote bazel-out/arm64-v8a-opt/bin/external/flatbuffers -Ibazel-out/arm64-v8a-opt/bin/external/flatbuffers/_virtual_includes/flatbuffers -Ibazel-out/arm64-v8a-opt/bin/external/flatbuffers/src/_virtual_includes/flatbuffers -Ibazel-out/arm64-v8a-opt/bin/external/flatbuffers/_virtual_includes/runtime_cc -isystem external/nsync/public -isystem bazel-out/arm64-v8a-opt/bin/external/nsync/public -isystem external/eigen_archive -isystem bazel-out/arm64-v8a-opt/bin/external/eigen_archive -isystem external/com_google_protobuf/src -isystem bazel-out/arm64-v8a-opt/bin/external/com_google_protobuf/src -isystem external/zlib -isystem bazel-out/arm64-v8a-opt/bin/external/zlib -isystem external/double_conversion -isystem bazel-out/arm64-v8a-opt/bin/external/double_conversion -isystem external/farmhash_archive/src -isystem bazel-out/arm64-v8a-opt/bin/external/farmhash_archive/src -isystem tensorflow/lite/schema -isystem bazel-out/arm64-v8a-opt/bin/tensorflow/lite/schema -w '-std=c++14' '--sysroot=external/androidndk/ndk/platforms/android-26/arch-arm64' -isystem external/androidndk/ndk/sources/cxx-stl/llvm-libc++/include -isystem external/androidndk/ndk/sources/cxx-stl/llvm-libc++abi/include -isystem external/androidndk/ndk/sources/android/support/include -isystemexternal/androidndk/ndk/sysroot/usr/include -c tensorflow/lite/delegates/flex/delegate.cc -o bazel-out/arm64-v8a-opt/bin/tensorflow/lite/delegates/flex/_objs/delegate_only_runtime/delegate.pic.o)
Execution platform: @local_execution_config_platform//:platform
tensorflow/lite/delegates/flex/delegate.cc:143:44: error: 'TF_AcquireFlexDelegate' has C-linkage specified, but returns user-defined type 'tflite::TfLiteDelegateUniquePtr' (aka 'unique_ptr<TfLiteDelegate, void (*)(TfLiteDelegate *)>') which is incompatible with C [-Werror,-Wreturn-type-c-linkage]
extern "C" tflite::TfLiteDelegateUniquePtr TF_AcquireFlexDelegate() {
                                           ^
1 error generated.
Target //tensorflow/lite/c:libtensorflowlite_c.so failed to build

So for my use case, I believe I need RandomStandardNormal without flex delegate / SELECT_TF_OPS.

I noticed a commit in v2.4.0-rc0 that has create a custom prototype for random standard normal:
https://github.com/tensorflow/tensorflow/commit/11823c6179a5e2ca6ac4f8480aa00c42c772885e
I've compiled this library but I'm getting the error:
2020-11-04 17:52:41.409 25623-25623/io.kernellabs.sync E/tflite: Encountered unresolved custom op: RandomStandardNormal.
2020-11-04 17:52:41.409 25623-25623/io.kernellabs.sync E/tflite: Node number 1 (RandomStandardNormal) failed to prepare.

Any guidance on how I can register the op using the c api?

@CoreyCole Hello, Did you manage to find a solution?

@henry8th yes, hope this helps: https://github.com/tensorflow/tensorflow/issues/44664#issuecomment-723310060

Thank you
On Fri, 19 Feb 2021, 19:12 Corey Cole<EMAIL_ADDRESS>wrote:

@henry8th https://github.com/henry8th yes, hope this helps: #44664
(comment)
https://github.com/tensorflow/tensorflow/issues/44664#issuecomment-723310060
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/tensorflow/tensorflow/issues/33341#issuecomment-782283099,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AP52P6ZVPA7JDAQZXJIA7OTS72ZYTANCNFSM4JAQ3SCA
.

@DocDriven  Is this still an issue for you? If not, Please go ahead and close the issue.Thanks!


Callback-free-itx does not perform a rollback if rollback method is called

Hello,
i tried out the callback-free-itx client extension example. The rollback seems not to work. Code for reproducing this issue is here:
https://github.com/prisma/prisma/discussions/17769#discussioncomment-4952111
Would be thankful for a fix.
Best regards
Andreas

Apologies for the late response. The example has been updated with the suggestion in this issue comment: https://github.com/prisma/prisma-client-extensions/issues/12#issuecomment-1499748837


Wrong TPDO initialization sequence in case of dynamic OD

In CO_PDO.c in function CO_TPDO_init() PDO object extension initialization functions:
OD_extension_init(OD_18xx_TPDOCommPar, &PDO->OD_communicationParam_ext);
OD_extension_init(OD_1Axx_TPDOMapPar, &PDO->OD_mappingParam_extension);

are called after
PDO_initMapping(PDO, OD, OD_1Axx_TPDOMapPar, false, errInfo, &erroneousMap);
which has checking inside of PDOconfigMap() call inside of it:
if (subIndex < (OD_FLAGS_PDO_SIZE * 8) && entry->extension != NULL) {
    PDO->flagPDObyte[mapIndex] =
            &entry->extension->flagsPDO[subIndex >> 3];
    PDO->flagPDObitmask[mapIndex] = 1 << (subIndex & 0x07);
}
else {
    PDO->flagPDObyte[mapIndex] = NULL;
}

which is always skipped.
The PDO_initMapping() must be called after OD_extension_init() calls, not before.
This prevents TPDO message sending to start

Actually this is not really a problem.

OD_extension_init() initializes OD entries 0x18xx and 0x1Axx.
But entry from PDOconfigMap() points to any OD entry, which is mappable and is actually mapped to specific PDO.

OD entries 0x18xx and 0x1Axx are never mappable, so they are never subject to checking entry->extension != NULL.
CO_TPDO_init() is called from CO_CANopenInitPDO(), which is called after all other CANopen objects are configured.
However, I didn't test flagPDO functionality very widely, so there may still be problems.

Ah, I see. I can close the issue, thank you for clarifying


Close  tags in _cards source

Tiny cleanup.
HTMLBars was giving me angry errors for unsemantic html when I tried to use the demo code. :(

@ksin thanks!


kube-spawn doesn't work if kube-spawn-dir is in an eCryptfs

Testing kube-spawn on a system where $HOME is an eCryptfs we discovered that docker fails to start on the nodes.
The reason is that we the overlay driver can't be used on top of ecryptfs (although docker's error message was saying "unknown", PR with a fix here: https://github.com/moby/moby/pull/34721).
It seems eCryptfs passes our PathSupportsOverlay() test, so we should probably do one of these:

add an explicit check there
change the logic to a whitelist of known-to-be-working filesystems

I'd prefer to add an explicit check for eCryptfs. Relying on a whitelist doesn't look like a long-term solution..


Inconsistent coercion

The spec indicates that the conversion of objects and arrays to number are not supported:
array => string
object => string
array => number
object => number
object => array
number => object
string => object
boolean => object
There are two inconsistencies:

array => object should also not be supported.
The implementation is inconsistent in handling implicit coercion:

{w:2} * 2 => 0 (with a warning)
abs({w:2}) fails with: "TypeError: abs expected argument to be type number but received type object instead."
These should either both coerce to zero, or both fail.  Recommend they both fail.

Implemented


New stateful operator supporting live scaling

I am writing to propose a new operator, called ElasticStatefulOperator. The operator organizes user state as key-value pairs. Operator scaling, e.g., increasing/decreasing the number of tasks, can be achieved by re-partitioning the keys among the tasks and updating the routing in StreamManager accordingly. With this feature, the parallelism of ElasticStatefulOperators can be adjusted either by the user via heron update command or by the auto-scaling algorithm, without deactivating current topology. We have implemented this operator based on Apache storm (Source code). Our experiments show that operator scaling can be achieved by this operator in milliseconds with state consistency.
The assumption under this operator is that (1) each input tuple is associated with a key; and (2) an input tuple reads/updates the state on a key basis. This assumption hold for a large variety of stateful operators, including equal join, count. To manager the operator state in user code, the ElasticStatefulOperator models operator state as key-value pairs, where keys and values can be of any data types. The operator exposes getStateByKey() and setStateByKey() interfaces for state read/update in the user code. The implmentation of ElasticStatefulOperator looks like:
public abstract class ElasticStatefulOperator implements Serializable {

    private KeyValueState state = new KeyValueState();

    public abstract void prepare(Map stormConf, TopologyContext context);

    public abstract void execute(Tuple input);

    public Serializable getValueByKey(Serializable key) {
        return state.getValueByKey(key);
    }

    public void setValueByKey(Serializable key, Serializable value) {
        state.setValueByKey(key, value);
    }

}

A WordCount implementation based on this new operator would be like this:
class ElasticWordCount extends ElasticStatefulOperator {

    void prepare(...) {...};

    void execute(Tuple tuple)
        String word = tuple.getStringByField("word");
        Long count = getStateByKey(word);
        if(count == null) {
            count = new Long(0);
        }
        setStateByKey(word, count + 1);
    }
}

Modifications to existing code:

New functions will be added toStreamManager to support routing updates;
ElasticStatefulOperator will be added;
Scaling delegate will be added to coordinate the state migration and the routing updates.

Any feedback is highly appreciated.

@billonahill @maosongfu @avflor - when you get some time, can you provide feedback on the proposal?

@wangli1426 I think there are two things to consider:

Re-routing of keys in case we add/remove instances and
State migration of Bolts to newly started bolts.

I think your proposal refers to the 2nd one, right? I believe the 1st one we can be implemented in the grouping methods with a smart hash function and not in user code. If your proposal refers to the 2nd method, then do you assume that the state migration will be done by the stream manager? I see that you mention this component but I'm not sure If I understood correctly.

Hi @avflor ,
Thanks for your response.
Actually, my proposal refers to both 1) and 2). The second one makes it possible for the system to migrate a subset of state among Bolt Instances. And the first makes sure the tuples are sent to the right Bolt Instances after state migration.
For 1), you are right. Re-routing can be done in the StreamManager by modifying the key to tasks mapping.
For 2), as data flows among HeronInstances are via stream mananger, it is reasonable to migrate the state by stream manager.

@wangli1426 I think it is not that simple to do state migration through the stream manager. I believe we need a central external unit to do the state migration as we will avoid many coordination problems between stream managers. There are multiple things that need to be synchronized: we need to make sure tuples are not routed to the original bolts while migrating the state of the bolts, we need to know when all state migrations have been completed so that processing is resumed, we need to handle failures (e.g, a new bolt failed while receiving state). I think a central external component that performs the coordination, failure handling etc might be a better solution that introducing this functionality to the stream manager. Moreover, I'm not sure how we will make the heron instance understand that it is not receiving regular data tuples through the stream manager but some other bolt's state.  But apart from that I think a central state migration is a more robust solution. @billonahill @kramasamy @maosongfu may have more input on this.

@avflor
Thank for your prompt response.

I think it is not that simple to do state migration through the stream manager. I believe we need a central external unit to do the state migration as we will avoid many coordination problems between stream managers.

You are right. Stream manager alone is not sufficient. As stated in my proposal, we need a centralized scaling delegate to coordinate the state migration and the rerouting. For instance, before a key is migrated from a HeronInstance to another, we need to make sure all the tuples sent to the HeronInstance has been completed processed.

There are multiple things that need to be synchronized: we need to make sure tuples are not routed to the original bolts while migrating the state of the bolts, we need to know when all state migrations have been completed so that processing is resumed, we need to handle failures (e.g, a new bolt failed while receiving state).

Yes, to migrate a set of key, say k from HeronInstance A to HeronInstance B, we need the following steps.

stop sending tuples with keys in k to A;
make sure all tuples with keys in k sent to A has been processed;
migrate  the involved state from A to B;
resume sending tuples with keys in key to B.

Moreover, I'm not sure how we will make the heron instance understand that it is not receiving regular data tuples through the stream manager but some other bolt's state.

We can add additional fields to HeronTuples.HeronDataTuple to indicate whether a tuple is a regular tuple or control tuple, and process the tuples properly at BoltInstance.java:216 like this:
      for (HeronTuples.HeronDataTuple dataTuple : tuples.getData().getTuplesList()) {
        if(dataTuple.type == ControlTuple) {
             //do the control work such as state migration, state merging.
        } else
            handleDataTuple(dataTuple, topologyContext, stream);
      }

Agreed, we should assume some external state management. Stream manager should just be used to control routing logic.
Q1.) Regarding moving existing state when increasing parallelism, in the above flow how exactly do you determine which keys k need to move? Would we have to run all current keys in A through the updated hashing algorithm or is there a better way?
Q2.) Related to Q1 but your example shows how to migrate state from A -> B, but when adding new instances we'd be going from Set_n -> Set_n + Set_m. Would we need to inspect keys on all Set_n to see what needs to move to Set_m?
Q3.) Re implementation, could this be done with composition instead of inheritance? This would provide more flexibility to the topology author. So instead of extending the operator the bolt could implement StatefulComponent which could cause a configured implementation of a StateStore to be injected by the framework, or something like that.
Also we might want to avoid terminology specific to scaling (i.e., elastic) since this functionality wouldn't be limited to just scaling. It might be used when a faulty node gets restarted for example.

@billonahill
Thanks for the comments.

Q1.) Regarding moving existing state when increasing parallelism, in the above flow how exactly do you determine which keys k need to move? Would we have to run all current keys in A through the updated hashing algorithm or is there a better way?
Q2.) Related to Q1 but your example shows how to migrate state from A -> B, but when adding new instances we'd be going from Set_n -> Set_n + Set_m. Would we need to inspect keys on all Set_n to see what needs to move to Set_m?

A naive method is to change the hash function when new task is created. This results in a large number of state migration. For instance, if we increase the number of tasks from n to n+m, then for each task approximately (n+m-1)/(n+m) of the keys will be migrated to other tasks, which results in expensive state migration overhead and significant scaling delay. Another method is to maintain a key-to-task mapping in the routing table. This allows us to reassign a few keys to the new tasks when scaling. However, the maintaining overhead could be large and the lookup to the mapping will cause a large number of cache misses when there are many distinct keys. My idea is to use a two-tire routing table. We logically partition the key space of an operator into many, e.g., 512, mini-partitions, called shards. This can be done by a global hash function. And we maintain shard-to-task mapping and monitor the workload on each shard. When a new task is created, we can reassign some shards from existing tasks to the new one based on the workload of the shards. This problem is similar to Multi-way partition problem which divides a set of n integers into a given number k of subsets, minimizing the difference between the smallest and the largest subset sums. The difference is that we also want to minimize the shard reassignments. This problem can be solved by using a heuristic algorithm similar to First-Fit-Decreasing. The benefit of the two-tire routing is that it gives us great flexibility to minimize the shard reassignments while does not need bring much additional overhead. This method not only supports operator scaling, but can also be used for inter-task load balancing.

Q3.) Re implementation, could this be done with composition instead of inheritance? This would provide more flexibility to the topology author. So instead of extending the operator the bolt could implement StatefulComponent which could cause a configured implementation of a StateStore to be injected by the framework, or something like that.

The ElasticStatefulOperator also exposes some methods to the system for state management, like this:
public abstract class ElasticStatefulOperator implements Serializable {

    private KeyValueState state = new KeyValueState();
    ...

   // to extract a subset of state for migration
   KeyValueState getState(StateFilter filter){...};

   // to merge the new state migrated to the current instance
   void MergeState(KeyValueState newState){...};

}

If this is done with composition instead of inheritance, I am afraid the system cannot get access to the StatefulComponent member in their class.

Also we might want to avoid terminology specific to scaling (i.e., elastic) since this functionality wouldn't be limited to just scaling. It might be used when a faulty node gets restarted for example.

I agree. A better name might to be StatefulOperator, StatefulBolt or StatefulKeyValueOperator. We can choose a proper name after we have reached an agreement on the design.
Thanks.

@billonahill @maosongfu @avflor
Any further feedback on this proposal?

@wangli1426 We are also working on a stateful processing proposal internally and will discuss it this Friday. Will sync with u after that.

@maosongfu Got it. Thank you!

@billonahill @maosongfu @avflor
Any further comment?

@wangli1426 The dicussion on Friday was productive and we got a lot of action items.  For instance, we would come up with the proposal of stateful interfaces exposed to topology developers, which includes and not limits what you mentioned in this issue. Will public the doc once we finish the first proposal draft.

@maosongfu Thanks for the update. I look forward to the doc.

@maosongfu @billonahill @avflor @kramasamy Any update? I am more than eager to make contribution to new features regarding to operator state management and operator scaling.

@wangli1426, @maosongfu is working on preparing a doc to share by the end of the week.

@billonahill @maosongfu glad to know that. Look forward to the doc.

@maosongfu May I ask if the doc is ready to share? :)

@wangli1426 - @maosongfu has gone on a urgent trip to China. He will be back soon. Meanwhile, I am looking at your source code and proposal.

@wangli1426 - I was looking at the source code. Why have you not defined a elastic spout?

First, thanks for your interest to my code. As a spout is typically used to receive input stream from external system / source for the topology, it is usually not computational intensive. Of cause, we can also implement elastic spout in a similar way.

On Dec 5, 2016, at 2:16 PM, Karthik Ramasamy<EMAIL_ADDRESS><EMAIL_ADDRESS>wrote:
@wangli1426 https://github.com/wangli1426 - I was looking at the source code. Why have you not defined a elastic spout?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/twitter/heron/issues/1499#issuecomment-264776000, or mute the thread https://github.com/notifications/unsubscribe-auth/AFBD9Ct3sMzMS7jXtZ15o7W-3KxGwOFqks5rE6w8gaJpZM4KZV6m.

@kramasamy any comments?


Add new "linux-pkg-build" action

I tried to test this with the ZFS repository, by adding this to my personal fork of delphix/zfs:
+on:
+  push:
+  pull_request:
+
+jobs:
+  build:
+    runs-on: ubuntu-18.04
+    steps:
+      - uses: actions/checkout@v2
+      - uses: prakashsurya/actions/linux-pkg-build@master
+        with:
+          package: zfs

The build appears to start up and execute properly, but it eventually failed.. Here's the build log (link).. I'm not yet sure if the build failed due to a bug in this PR, or something in the build/packaging of ZFS..

Here's another example of how I expect this to be used: https://github.com/delphix/drgn/pull/16

@prakashsurya So there's a few things that I could think of:

We are missing some packages installed by ./setup.sh, although that's unlikely given you are installing most of them manually.
you are running linux-pkg/buildpkg.sh instead of cd linux-pkg && ./buildpkg.sh which may or may not work as I've never tested running buildpkg.sh outside of the linux-pkg directory. If that's the case we would want to fix that.
Something is different with the package dependencies fetched as setup.sh has apt pointing to the Delphix linux-package-mirror (although theoretically that should be following the default Ubuntu archive pretty closely on master).
Some packages were installed by default on bootstrap-18-04 that the zfs build relied on and we somehow missed.

Also I'm curious about what are you planning to use this linux-pkg action for.

Here's another example of how I expect this to be used: delphix/drgn#16

Ah okay, that makes sense.
Note that after the linux-pkg rework, some packages will require access to Delphix S3 buckets to build. Packages that have build dependencies on other linux-pkg packages, such as all kernel modules (zfs, connstat, delphix-kernel) are among those.

Note that after the linux-pkg rework, some packages will require access to Delphix S3 buckets to build.

Sure; either we'll not be able to build those via actions, or I'll look into if we could allow read access to those artifacts from these actions. I think it'd be reasonable to enable a read-only S3 token, but I haven't investigated that yet.

you are running linux-pkg/buildpkg.sh instead of cd linux-pkg && ./buildpkg.sh which may or may not work as I've never tested running buildpkg.sh outside of the linux-pkg directory. If that's the case we would want to fix that.

Ah, ok.. well, in that case, let me update this to change the working directory prior to calling the build script.

We are missing some packages installed by ./setup.sh, although that's unlikely given you are installing most of them manually.

I think it'd be ideal to call the setup script, but I didn't do that since it modifies the APT sources.. If we have a way to opt-out of the APT sources changes, I could probably call the setup script directly.

Something is different with the package dependencies fetched as setup.sh has apt pointing to the Delphix linux-package-mirror (although theoretically that should be following the default Ubuntu archive pretty closely on master).

Yea, I'm definitely a little concerned about using linux-pkg like this, while not having access to our APT mirrors... This might pose to be a blocking architecture issue, that we can't really overcome without running the action within our VPN.. but I figured I'd at least try this out and see how close to a working solution I could get.

Cool, yeah I think it would be nice if we could stop having hard dependencies on the bootstrap-18-04 VM. I think we should be able to build most packages from a docker container, although I do recall there was some quirks with some packages (bpftrace is one that comes to mind).
Regarding building the packages outside the VPN, here are the dependencies we currently use for the build of packages:

Delphix S3 buckets
Artifactory
Linux package mirror
Some secrets passed via Jenkins


DataviewJS errors on "On This Day" view

Is there a way to hide dataview errors that are there on the "On This Day" page? The same errors are not there on the full note. Perhaps codeblocks need to be striped out when constructing the "On This Day" view

Close, as it will be addressed in #163 and #166


Create K8S Tutorial Blog

I was intrigued by this Kubernetes walkthrough guide, so I decided to follow the instructions in my lab. Surprisingly, I got stuck when trying to follow the directions and ended up with the problem.   I eventually manage to solve it after much effort and investigation, which gives me the notion to share what I've learned in the form of a blog post.

@ranjnagemini Please refer to other existing blog posts for how to format a blog article. Please also use markdown to format your page.

@ranjnagemini, you can look at guide to submit blog posts.

Also, you can view other blog posts to.

@ranjnagemini please follow the style guide  and here's the blog content guide for reference.
There are multiple style guide issues like the following:

code samples without triple backticks
headings

Since this blog is an Azure specific tutorial, a Microsoft Azure blog may be more appropriate

Since this blog has already been published, I'm closing this PR
If anyone feels otherwise, feel free to reopen this PR with /reopen in a comment
/close


fix fix not hit mv when table has float type

CREATE DATABASE test_db;
use test_db;
CREATE TABLE test_db.table_1 (
  k0 BOOLEAN NOT NULL,
  k1 TINYINT NOT NULL,
  k2 SMALLINT NOT NULL,
  k3 INT NOT NULL,
  k4 BIGINT NOT NULL,
  k5 LARGEINT NOT NULL,
  k6 DECIMALV3(9, 3) NOT NULL,
  k7 CHAR(5) NOT NULL,
  k8 DATE NOT NULL,
  k9 DATETIME NOT NULL,
  k10 VARCHAR(20) NOT NULL,
  k11 DOUBLE NOT NULL,
  k12 FLOAT NOT NULL
) PARTITION BY RANGE(k1) (
  PARTITION p1
  VALUES
    LESS THAN ("-10"),
    PARTITION p2
  VALUES
    LESS THAN ("0"),
    PARTITION p3
  VALUES
    LESS THAN ("10"),
    PARTITION p4
  VALUES
    LESS THAN ("20")
) DISTRIBUTED BY HASH(k4, k5) BUCKETS 1;

CREATE MATERIALIZED VIEW table_1_mv AS SELECT k0, max(k8), min(k11), sum(k12), count(k10), hll_union(hll_hash(k7)), bitmap_union(to_bitmap(k2)) from test_db.table_1 group by k0

set experimental_enable_nereids_planner=true;
insert into table_1 values(1,2,3,4,5,6,7,"8","2020-10-01","2020-10-10","10",12,13);

EXPLAIN SELECT k0, max(k8), min(k11), sum(k12), count(k10), hll_union(hll_hash(k7)), bitmap_union(to_bitmap(k2)) from test_db.table_1 group by k0

wrong result
 0:VOlapScanNode(141)                                                                                |
|      TABLE: test_db.table_1(table_1), PREAGGREGATION: ON

expected result
 0:VOlapScanNode(141)                                                                                |
|      TABLE: test_db.table_1(table_1_mv), PREAGGREGATION: ON

run buildall


CSS highlighting doesn't work with just lang="postcss"

I came here to post an issue which might be related -- CSS highlighting doesn't work with just lang="postcss"

But it does work if you add the style attribute as well:

Despite it being specified as a default in svelte.config.cjs:
preprocess: [
		sveltePreprocess({
			defaults: {
				style: "postcss",
			},
			postcss: true
		}),
		]

Originally posted by @droher in https://github.com/svelte-add/tailwindcss/issues/12#issuecomment-798958459

Syntax highlighting for PostCSS is turned off in the Svelte for VS Code extension because there are so many PostCSS flavors and we didn't have the capacity to add syntax highlighting for that as well. If there is some kind of "works for 80%" syntax highlighting that is easily integrateable, let me know. I'm also curious why the additional style tag would work in this case.

Syntax highlighting for PostCSS is turned off in the Svelte for VS Code extension because there are so many PostCSS flavors and we didn't have the capacity to add syntax highlighting for that as well. If there is some kind of "works for 80%" syntax highlighting that is easily integrateable, let me know. I'm also curious why the additional style tag would work in this case and bring back highlighting.

I don't know. This just restores regular CSS highlighting.

Mhm might be the regex that then thinks "oh this is css" again

Closed by https://github.com/sveltejs/language-tools/issues/996#issuecomment-853780072


Investigate browser closing while processing

Related to https://github.com/cityssm/wsib-clearance-check-csv-cli/issues/8
There may be a scenario where the global browser object is closed while in use.  Look into it.

More refinements in commit.
https://github.com/cityssm/wsib-clearance-check/commit/998fac9f461b3a373608e4b5b2acdda1095f19dd


[sustainability] add most charts for sustainability pages

added most charts
added support for placeholders in category / block descriptions and titles
updated filtering logic to account for:

charts that plot child places
bar charts with comparison place overrides. these can include "self" which will be interpreted as the main place dcid.
maps - check that child places have geojson's

added cache for the html responses for this and events

pending: tests for geojson existence for maps, and a main disaster chart

thanks for the review! ptal.


⚠ Processors has degraded performance

In 20399a6, Processors ($STATUS_URL) experienced degraded performance:

HTTP code: 200
Response time: 46 ms

Resolved: Processors performance has improved in a888bac.


Added Diabetes test under Healthcare Programs and resolved the greetings bug on login

Closes: Issue #34

Title :  Adding a diabetes test feature using DL models and  resolved the greetings bug on login
Name: : Chirag Gupta
Idenitfy yourself: : Participant in  SSoC

Describe the add-ons or changes you've made 📃
Firstly I inserted a new  option under Service dropdown named "Healthcare Programs".
Then I inserted a option named "Diabetes Test" under it.
For implementing it, I trained a model which I saved in ".keras" format and uploaded it in a new folder "dlModels" under models folder.
The main code lies in the "source\features\healthcarePrograms\diabetes_test.py" where I created functions containing the form to be filled by the user, loading the model and returning the test result.
I imported these functions in "main.py" and implemented it in a short & neat manner using "if statements".
During testing, I found a bug which greeted me every time when I change options, so I fixed the issue by adding a few statements it in "mains.py". Added a comment line before the new greetings code.
Before making the modifications, I gone through whole code and contributed in the same style of the project maintaining the project layout and all new created variables in "main.py" are named after diabetes test to avoid conflicts in future. Also the number of new  variables are kept to minimum.
Type of change ☑

What sort of change have you made:

[x] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Code style update (formatting, local variables)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update

How Has This Been Tested? ⚙

I logged in using SuperAdmin, Admin, user and also a created a new ID to test out the features.
After login, the greetings were given only once.
On selecting the "Diabetes Test" from dropdown, a form appears in which I submitted the validation data of the model.
The correct results were shown in the desired manner.
Checklist: ☑

[x] My code follows the Contributing Guidelines & Code of Conduct of this project.
[x] This PR does not contain plagiarized content.
[x] I have performed a self-review of my own code.
[x] I have commented my code, particularly wherever it was hard to understand.
[x] My changes generate no new warnings.

Screenshots 📷

The userName, service type and Program

Diabetes Test Form

Example Result
Note to reviewers 📄

I created a new Service for Healthcare because I did not find Diabetes Test fit among Basic Programs. Moreover, I intend to contribute more in Healthcare section.

@ChiragGupta16 But always raise the pr by creating your own seprate branch never commit in main branch


Fix ConnectionTests unit tests

This fixes the unit tests in ConnectionTests.cs and the issues found by them afterwards.
I have replaced TcpListener.Server.Shutdown and TcpListener.Server.Close with TcpListener.Stop, as TcpListener.Server.Shutdown seemed to block indefinitely. After doing this I had to catch some additional exceptions that could be thrown after TcpListener.Stop was called.
The connection tests were modified to block using an AutoResetEvent to ensure the function did not exit before the test was completed. The Asserts would not influence the test results otherwise.

Thanks! This is awesome, thanks for fixing those pesky unit-tests


Additional malformed input check in HintBitUnpack()

This is in Algorithm 21, line 9.

I think we already do this check here: https://github.com/cryspen/libcrux/blob/6a8770c9d9d51b553169e0f2cc8cfd808fc7caa6/libcrux-ml-dsa/src/encoding/signature.rs#L102

Yes, looks like it.

Closing this since we are already conformant here.


Support for mqtt publisher in network scripts

Support the non-TLS version of mqtt_publisher in the network testing script. The latest version of net-tools is required in west.yaml, as that one contains the mosquitto MQTT server. The README has also been updated with instructions on how to create the net-tools Docker image.

fyi @rlubos

exit (r);

Ah, that one too.

ping @nashif as a codeowner of files under scripts/, are you ok with these changes?


Make Workbook templates available as JSON to deploy via Azure DevOps

This page does not include information for those who want to deploy workbooks as code.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 52fb32ef-0801-1b21-d279-5223f813f9de
Version Independent ID: f10bf47e-13e5-861e-021a-03d3aa0e36cb
Content: Monitor the health of your data connectors with this Azure Sentinel workbook
Content Source: articles/sentinel/monitor-data-connector-health.md
Service: azure-sentinel
Sub-service: azure-sentinel
GitHub Login: @yelevin
Microsoft Alias: yelevin

@yelevin
Thanks for your feedback! We will investigate and update as appropriate.


Get all reviews of a selected book?

Would it be possible to get the reviews of a selected book? Say, by isbn of the book or book id? Thank you!

Hi Sagun, I just discovered your package and I have the same question.


feat(events): switch {data,state} arg order

switch data and state argument order
semver major

Coverage remained the same at 98.606% when pulling 03c823b831c1a237988acc497a66ce3e0ad48525 on arg-order into e04effe0c12d8f8161135a688f36082e8a5c0812 on master.


PowerShell/Graph API support?

 Is it possible to perform the "Wipe Company Data" action from devices which are registered in Basic Security and Mobility using other methods?

Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

ID: 90e5b93e-9372-b489-55f4-ac6dd72fa2e3
Version Independent ID: b3f1e27e-655b-63d2-b42d-94994fec2370
Content: Wipe a mobile device in Basic Mobility and Security - Microsoft 365 admin
Content Source: microsoft-365/admin/basic-mobility-security/wipe-mobile-device.md
Service: microsoft-365-business
GitHub Login: @kwekuako
Microsoft Alias: kwekua

@viperthunder Thank you for your feedback. Currently, the steps mentioned in the document are the only way to  Wipe a mobile which are registered in Basic Security and Mobility.
We will update the document once other methods are made available.
Hope this helps!
Thanks
Sri

@msbemba Thank you very much for the contribution and sharing this explanation. @viperthunder Hope this comment is helpful for you. If you see a documentation update is required, please feel free to open an issue for the same. We proceed here to close it. Thanks for taking out some time to open the issue. Appreciate and encourage you to do the same in future also.


project contributors from contribution events and remove contributor cache

:sparkles: initiate contributor projection
:sparkles: initiate contributor projection repository
:sparkles: create contributor service
✨ create contributor projector
:sparkles: implement GithubService::find_user_by_id
:sparkles: implement contributor projection repository by the Database
:sparkles: implement contributor service by starknet client
:recycle: refactor contributor data
♻ fetch data from contributor projection instead of github in GET
⚰ remove unused contributor cache
➖ remove stretto
:sparkles: create contributors refresh usecase and publish a route for it
:rotating_light: fix clippy warnings
:recycle: move tests in same file as per new standard
:recycle: react to contribution applied instead of assigned to update contributor

Codecov Report

Merging #209 (d43d4ac) into main (67e781f) will increase coverage by 0.82%.
The diff coverage is 75.60%.

@@            Coverage Diff             @@
##             main     #209      +/-   ##
==========================================
+ Coverage   74.44%   75.27%   +0.82%
==========================================
  Files         148      151       +3
  Lines        4536     4672     +136
==========================================
+ Hits         3377     3517     +140
+ Misses       1159     1155       -4

Impacted Files
Coverage Δ

marketplace-core/src/main.rs
0.00% <0.00%> (ø)

...arketplace-core/src/routes/contributors/refresh.rs
0.00% <0.00%> (ø)

marketplace-core/src/routes/mod.rs
0.00% <ø> (ø)

marketplace-core/src/routes/projects/list.rs
0.00% <0.00%> (ø)

...ibution/contribution_with_github_data_projector.rs
88.57% <ø> (-0.62%)
:arrow_down:

...lace-domain/src/repositories/project_projection.rs
100.00% <ø> (ø)

marketplace-domain/src/services/github_client.rs
100.00% <ø> (ø)

marketplace-domain/src/value_objects/github.rs
100.00% <ø> (ø)

...nfrastructure/src/database/repositories/project.rs
78.48% <ø> (ø)

marketplace-infrastructure/src/database/schema.rs
0.00% <ø> (ø)

... and 13 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more


Rename and segment avro_client functionality

To service DE-101 (Python rewrite of Firehose Avro decoding), I have made the following changes:

Split Avro decoding and encoding capabilities into separate classes (AvroDecoder and AvroEncoder)
Made retrieving JSON schemas a publicly accessible functionality
Added ability to decode base64 records to AvroDecoder (+ additional tests to make sure this works)
Reformatted code with black

Are we still using flake8 as the linter here? Or should I switch it to black in the Makefile?

Fixed it! @aaronfriedman6

I think you accidentally switched back to using the black formatter


Implement read_csv method.

In order to make the function efficient enough, we'd better use Rust's library to read the csv file rather than Python. The 1st version read_csv function looks like this:
>>> import ulist as ul

>>> data = ul.read_csv(path="/some_path/example.csv", schema={"foo": "int64", "bar": "bool"})
{
    "foo" : UltraFastList([1, 2, 3]),
    "bar" : UltraFastList([True, False, True]),
}

In the next version, the parameter schema is optional, when it's set to None, then the read_csv function will auto detect the name and dtype of each column in the .csv file.

Hello, I am interested at this issue and would you like to share your designs about this method read_csv? Thanks~

@tushushu
I think the main difficulty of reading CSV is that the strings are placed row by row, but CSV is organized according to columns, that means if I read the csv file row by row, I would/may inevitably need to call append many time, which may result in performance waste ( I don't konw whether this waste is acceptable)(or I can organize it by column in python in advance, but again, I don't know how efficient it is).
python has a csv library that can extract only one column ( I don't know much about python, so I have no idea about the efficient of csv library) (But it may have greater advantages in scalability and other sides).
I think one feasible way is to try to implement read_csv with csv library and without csv library at the same time and find the best scheme through benchmarks ^_^

And I will be glad to know what you think , I'm still a beginner and don't understand design and so on.Thank you for your patience : )

@yingmanwumen My idea is to use Rust csv crate to read the .csv file row by row and append to the Rust vectors, and then create a Rust Vec[List] object, at last wrapped by a Python object. And I think you can try different ways to compare the benchmarks.
The .csv file is not as efficient as .parquet file for it's organized by row, but as it is widely used by machine learning industry, implementing read_csv method is required.

@yingmanwumen My idea is to use Rust csv crate to read the .csv file row by row and append to the Rust vectors, and then create a Rust Vec[List] object, at last wrapped by a Python object. And I think you can definitely try different ways to compare the benchmarks. The .csv file is not as efficient as .parquet file for it's organized by row, but as it is widely used by machine learning industry, implementing read_csv method is required. And the overhead caused by reading .csv is acceptable.

Hello, I have read the source code and found several issues here:

List in Rust is an abstract trait. It is not Object Safe, therefore, Vec[List] or Vec<Box<dyn List>> is not available:

/// Abstract List with generic type elements.
pub trait List<T>
where
    T: PartialEq + Clone,
    Self: Sized,
{
...
}

I have tried to fix (1) by creating Vec<PyObject> instead, but I couldn'd call append method directly in Rust:

// ... Some other codes
// a simple proof of my idea
fn do_read_csv(py: Python, mut reader: Reader<File>) -> PyResult<Vec<PyObject>> {
    // Try to create a `Vec<PyObject>`
    // Maybe complex to map a schema with unlimited length into Rust types,
    // such as "{ "foo": "int", "bar": "string" }" maps into `Integer64` and `StringList`
    let ulist = PyModule::import(py, "ulist.core")?
        .call_method1("UltraFastList", (StringList::new(vec![]),))?;
    let mut vec_list: Vec<PyObject> = Vec::new();
    vec_list.push(ulist.into());

    for iter in reader.records() {
        match iter {
            Err(err) => return Err(PyIOError::new_err(err.to_string())),
            Ok(records) => {
                for record in records.into_iter() {
                    // Just a simple proof to test how to call `append` method in rust
                    // I didn't found another way to directly call `append` in rust
                    // So if all in rust, things will be much more complicated
                    vec_list[0].call_method1(py, "append", (record,))?;
                }
            }
        }
    }
    Ok(vec_list)
}

So, after thinking for a long time(may be long), I think it's better to leave the IO aspect to python to reduce complexity.
Maybe there are some other simple ways that I haven't found to do this in Rust. If there is another better way, please let me know. Also, I hope to obtain your opinion.
Have a nice day!

Another issue is that not all fields in .csv will be filled, for example:
id, name, age
1001, , 20
1002, bob, 21
1003, jordan,

name field in row 1 is not filled, and age field in row 2 is not filled. And ulist doesn't seem to have a data type which represent None or NULL.
I don't know what should I do here T_T

Another issue is that not all fields in .csv will be filled, for example:
id, name, age
1001, , 20
1002, bob, 21
1003, jordan,

name field in row 1 is not filled, and age field in row 2 is not filled. And ulist doesn't seem to have a data type which represent None or NULL. I don't know what should I do here T_T

I am working on (another branch)[https://github.com/tushushu/ulist/tree/wip-missing-values] which allow ulist to hold and handle missing values. You may need to wait for this for 1 week.

@yingmanwumen Thanks very much for the effort and hard work. Could you look at this issue first to see if it can solve our issue?
If not, then let's try function like this:
struct AnotherStruct{
    a: Vec<StringList>,
    b: Vec<IntList>,
    c: Vec<BoolList>,
}
fn read_csv(...) -> AnotherStruct

And let Python to merge these lists(vectors) together, which will be very fast.
If this still not work, then let's just use pure Python codes to implement read_csv method.
Thanks again and have a nice day~

Wow, thanks a lot, I will try this again!
I have already finished a pure python version yesterday, and was blocked by the test part, for the function check_test_result was not designed for a Dict type result before, and I am trying to modify it.

I am working on another branch which allow ulist to hold and handle missing values. You may need to wait for this for 1 week.

OK, I saw that ^_^

The branch to handle missing values has been merged into the main branch. You may need to merge the main branch into your branch first, and then fix some branch conflicts. @yingmanwumen

@yingmanwumen I wrote a half done read_csv function which can convert different Rust objects into PyObjects. The PR is https://github.com/tushushu/ulist/pull/170
You may merge the main branch to your working branch and continue your work on read_csv function.


contains: Returns true if the string/list/map contains the given value.

This will be completed together with #62


Repeated "no primary server available" error

Does this occur consistently? Yes
Repro steps:

Our CosmosDB has a firewall to only allow access from a VPN but when I disconnect it keeps giving me this error saying it's not available and only goes away when I uninstall this plugin. I'm cool with getting the error (obviously it makes sense to have it) but really only want it when I'm trying to connect or make a query, not get it over and over after dismissing the error notification.

disconnect from VPN
get this error
dismiss the error notification
repeat steps 2 and 3 until you turn VPN back on

Action: stat
Error type: MongoError
Error Message: no primary server available
Version: 0.15.0
OS: darwin
OS Release: 19.6.0
Product: Visual Studio Code
Product Version: 1.50.1
Language: en

Call Stack
ReplSetState.pickServer mongodb/replset_state.js:780:12
Timeout._selectServer mongodb/replset.js:1142:43
Timeout._onTimeout async-listener/glue.js:188:31
listOnTimeout timers.js:531:17
processTimers timers.js:475:7

This should be fixed with the upcoming 0.16.0 release.

Thanks for looking into this!


Bug in Travel.java. List needs to be cloned.

This issue regards this class:
https://github.com/eugenp/tutorials/blob/master/algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/annealing/Travel.java
that is related to this article (article contains code snippets that include the bug!):
https://www.baeldung.com/java-simulated-annealing-for-traveling-salesman
I'm pretty sure that the assignments of "previousTravel" and "travel" are not doing what you are intending them to do:
private ArrayList<City> travel = new ArrayList<>();
private ArrayList<City> previousTravel = new ArrayList<>();

public void swapCities() {
  int a = generateRandomIndex();
  int b = generateRandomIndex();
  previousTravel = travel;
  City x = travel.get(a);
  City y = travel.get(b);
  travel.set(a, y);
  travel.set(b, x);
}

public void revertSwap() {
  travel = previousTravel;
}

Since they aren't primitive types, the assignment of "previousTravel = travel" does not "save" an independent  copy of travel (to later restore in revertSwap(). All you have is two "pointers" pointing to the same list in memory. So whenever you modify travel you also modify the "saved" copy in previousTravel.
What you wanna do is something like "previousTravel = new ArrayList<>(travel)" which will make an independent clone. Then you can modify travel without affecting the "saved" copy in previousTravel.
You could also go without the previousTravel List alltogether, by saving instead the two indices "a" and "b" that you swapped and then simply reverse the swap in revertSwap() by swapping the same two indices again. This will be a lot faster than cloning potentially large lists and easier on the garbage collector.

Thanks @mariokoehler ,
We fixed the article.


Transmit sysex dumps from/to sdcard.

[x] Pattern dumps
[x] Sample dumps (MIDI SDS)
[x] Interfacing with sample name query facility
Automated macros for entering dump receive mode

tracking: #35

Regarding Sample Dumps.
The idea was to have a Sample Manager page, with basic WAV editing features. A lot of that code is already implemented in the WavDesigner.
Also, to receive samples from the MD you need to use the undocumented SYSEX (macro) commands to navigate the menus and transmit sample from the SampleManager menu.

Rather than storing all snapshot data in a single .snp binary. I'm wondering if it would be better to organise snapshots via directories. Each directory would be a single snapshot and hold 128 patterns 64 kits + 8 globals etc.
Then the Snapshot page can be a generalised MD Sysex dump page.  You could choose to restore an entire directory, or just single files.

The .snp binary is a direct representation of MC data structures and could be more convenient than serializing/deserializing syx files.
That said, having the flexibility of choosing individual elements is very useful. Luckily because the data structures are fixed-size, we can simply seek and access.
I'm thinking of this as, separating .snp and .syx as two features -- .syx involves additional parsing, checking the header (pattern dumps have different header than SDS dumps), entering the MD sysex menu etc, while .snp page simply stop playback and "hack" the content in/out.

Tracking: #104


Jesse: Watch irelandlanyards.com

Jesse requests the watch of the watch_keyword irelandlanyards\.com. See the MS search here and the Stack Exchange search in text, in URLs, and in code.

irelandlanyards\.com has been seen in 1 true positive, 0 false positives, and 0 NAAs.

Approved by Jeff Schaller in Charcoal HQ


Setuptools fails to work for NLTK under Cygwin 1.7

Under Cygwin 1.7 (the current version, which uses Python 2.6.5), the Python setuptools fail to install NLTK, where they succeed with other packages.
To reproduce: Install a default Cygwin 1.7, though for convenience add "wget" from the "Web" section, then try:
$ wget http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
$ sh setuptools-0.6c11-py2.7.egg
$ easy_install nltk
Searching for nltk
Reading http://pypi.python.org/simple/nltk/
Reading http://nltk.org/
Reading http://www.nltk.org/download
Reading http://nltk.sf.net/
Best match: nltk 2.0.1rc1.macosx-10.6-x86-64
Downloading http://pypi.python.org/packages/any/n/nltk/nltk-2.0.1rc1.macosx-10.6-x86_64.tar.gz#md5=f3c8c67ac388cda567d669880192d6f0
Processing nltk-2.0.1rc1.macosx-10.6-x86_64.tar.gz
error: Couldn't find a setup script in /tmp/easy_install-0hW3C4/nltk-2.0.1rc1.macosx-10.6-x86_64.tar.gz
This is under 64-bit Windows 7 as the host OS. Perhaps setuptools is using the wrong information in selecting a source package to download? The 2.0b8 source archive works perfectly when built using setup.py as described in the "install from source" instructions.Migrated from http://code.google.com/p/nltk/issues/detail?id=706earlier comments
bobobo1618 said, at 2011-08-08T01:39:36.000Z:
Sounds like a problem with the Cygwin python more than anything. I'll have a look next time I boot into Windows.

I expect this issue is stale.


Release a new version

Hi @DanielRuf, per #1117, at your leisure, would you be able to make a new patch release? :)

I think this is more than just a simple patch release, looks at least like a minor release.
See https://github.com/amsul/pickadate.js/compare/3.5.6...master
But we are currently working on v5 so it probably makes not much sense to create a new v3 release.
What do you think @amsul?

Lol, sorry, I didn't realise it'd been so long since the last release :D I guess if v5 has the same base feature set (popup calendar), then it's all good to wait for it to be released. Otherwise, if it's quite a departure from the current codebase then perhaps a 3.6.0 release would be appropriate.

Maybe we can prioritize the things or check the things that you are currently missing (if they are already in v5).
What do you currently miss in v3 (which exact patches, fixes, features)?

Thanks @DanielRuf, I'm currently just using the popup date picker as per: https://amsul.ca/pickadate.js/date/
plus the fix you merged for the modal overflow: https://github.com/amsul/pickadate.js/pull/1117

Okay, I will check in the next days if this is also needed in v5 and I will provide this fix if this is the case.
If you need this now you can try patch-package. https://www.npmjs.com/package/patch-package
https://github.com/amsul/pickadate.js/pull/1117.patch or https://github.com/amsul/pickadate.js/pull/1117.diff provide can be also used with the native patch binary.
Let us know which solution you choose and if you need any help.

Thanks @DanielRuf, I never knew about patch-package! I think I'll stick with using yarn to bring in from the GitHub repo directly in the meantime:
"pickadate": "https://github.com/brendon/pickadate.js.git#e528acc02f1d9e638a99aa13c51b1fee35b012e2"
That's the commit where you merged my PR.
The upside of this approach is that I also get all the other improvements since the last release in 2015 (such as better Webpack support).

@DanielRuf I would imagine v5 is a while away from a stable release. Plus, it's got a different API and UI.
I can slice a new release for v3 so people don't have to point to specific commits. Do we feel master is stable at the current commit?

master should be pretty stable. It contains only changes in translations and a few fixes and new unit tests.
I guess we have to update the changelog: https://github.com/amsul/pickadate.js/compare/3.5.6...master#files_bucket

@DanielRuf sounds good!
Tbh, I think we should stop using the Changelog markdown file in favor of notes on releases: https://github.com/amsul/pickadate.js/releases
So I'll ship a new version now and we can update the Release notes accordingly

And we're live! https://github.com/amsul/pickadate.js/releases/tag/3.6.0

Thanks @amsul and @DanielRuf :) Much appreciated.
For what it's worth, someone brought this to my attention the other day for an open source repo that I manage: https://keepachangelog.com/en/1.0.0/ Apparently it's still a good idea to keep a CHANGELOG.md changelog since Releases is locked away in Github and not readily discoverable by all (not everyone knows about the Releases section and it's not very obvious on the page). Just a thought :)

For what it's worth, someone brought this to my attention the other day for an open source repo that I manage: keepachangelog.com/en/1.0.0 Apparently it's still a good idea to keep a CHANGELOG.md changelog since Releases is locked away in Github and not readily discoverable by all (not everyone knows about the Releases section and it's not very obvious on the page). Just a thought :)

Thanks for the input. This can be tedious sometimes. See https://github.com/DanielRuf/secure-shred/issues/9
But I understand how important changelogs are for users.

https://github.com/amsul/pickadate.js/blob/master/CHANGELOG.md

Ha! Yes super tedious! We were using a generator: https://github.com/swanandp/acts_as_list/blob/master/CHANGELOG.md but the Added, Changed etc... headers are a big improvement and unfortunately it's not so easy to (though probably possible) to automate the categorisation of changes. I've just started the new style. The challenge will probably be remembering to update it! :)

We would have to introduce commitlint then to reduce the overhead for us ;-)
We'll check what we can do to improve this for v5.

In my experience, given the dynamic nature of an open source project with commits coming in from anybody, it becomes an additional burden in merging PRs by tying commit messages to Release Notes.
If people still find it valuable to have a reference to finding a changelog within the repo code, I like the approach that Vue or Redux have taken of simply pointing to the Releases.

Good point @amsul :)


"File to import not found or unreadable" When @import scss file from node_modules

Not sure if it is an actual bug or my curly hands, but i tried to provide as more details as possible to help solve this problem.

Is this a bug report?
Yes

Can you also reproduce the problem with npm 4.x?

Yes
Environment

node -v: 6.9.5
npm -v:4.6.1
npm ls react-scripts (if you haven’t ejected<EMAIL_ADDRESS>
Then, specify:

Operating system: Windows 10

Steps to Reproduce

(Write your steps here:)

create-react-app test && cd test
Make changes according to scss section
npm install react-select (actually any module with scss files should reproduce)
add  @import "~react-select\scss\default.scss && npm start
see build error: { "status": 1, "file": "{my local path here}/test/src/App.scss", "line": 1, "column": 1, "message": "File to import not found or unreadable: ~react-select/scss/default.\nParent style sheet: {my local path here}//test/src/App.scss", "formatted": "Error: File to import not found or unreadable: ~react-select/scss/default.\n       Parent style sheet: {my local path here}/test/src/App.scss\n        on line 1 of src/App.scss\n>> @import \"~react-select/scss/default\";\ n   ^\n" }

Expected Behavior

Just normal scss compile, coz it OK works for files not from node modules. BTW importing css works fine from node_modules
Actual Behavior

{   "status": 1,   "file": "{my local path here}/test/src/App.scss",   "line": 1,   "column": 1,   "message": "File to import not found or unreadable: ~react-select/scss/default.\nParent style sheet: {my local path here}//test/src/App.scss",   "formatted": "Error: File to import not found or unreadable: ~react-select/scss/default.\n       Parent style sheet: {my local path here}/test/src/App.scss\n        on line 1 of src/App.scss\n>> @import \"~react-select/scss/default\";\ n   ^\n" }
Reproducible Demo

https://github.com/vynogradskyi/cra_bug

Is it a bug though? The ~ notation is webpack-specific. If I understand correctly, when Sass is precompiled by its own CLI, it processes @imports by itself, and thus doesn’t understand ~ notation. I think if you replaced this with node_modules/ instead it might work.

@gaearon Thank you a lot! this is definitely a bug, but in my head!

use 'gulp-wait' to avoid this error
gulp.task('processSass', function() {   gulp     .src(sassSource + 'main.scss')     .pipe(wait(1500))     .pipe(sass().on('error', sass.logError))     .pipe(gulp.dest(outputDir + 'css')); });

Worth noting that this node_modules prefix trick also works with Next.js.

I have this issue but its with my variables.scss from the root of my project rather than node modules

Similar to @The-Code-Monkey I have issues loading my own variables.scss in a yarn workspace.
I'm trying to migrate an ejected cra1 app to cra2.
In my custom setup with cra1, I used postcss with a couple extensions to cover my scss use cases without actually using scss/sass under the hood (variables, mixins etc).
There, I kept an .env file with NODE_PATH=src/ in the cra project - and that worked perfectly.
I was able to just import diretly and in any stylesheet like @import '@client/styles/variables';. (@client/styles being a package in the workspace that contained my postcss stylesheets)
Seems that libsass or the sass-loader don't support the NODE_PATH trick out of the box - but I hope it will be added/fixed soon.

I have this issue but its with my variables.scss from the root of my project rather than node modules

How did you resolve it??

@The-Code-Monkey did you resolve it?


Skip dateparser tests when the package is not installed

Pull Request Checklist
Thank you for taking the time to improve Arrow! Before submitting your pull request, please check all appropriate boxes:

[ ] 🧪 Added tests for changed code.
[x] 🛠 All tests pass when run locally (run tox or make test to find out!).
[ ] 📚 Updated documentation for changed code.
[x] ⏩ Code is up-to-date with the master branch.

If you have any questions about your code changes or any of the points above, please submit your questions along with the pull request and we will try our best to help!
Description of Changes
This PR makes the dateparser tests skipped if dateparser is not installed. This would help us since we don't have it packaged and don't want yet another package to maintain for one test.

Codecov Report

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

@@            Coverage Diff            @@
##            master      #773   +/-   ##
=========================================
  Coverage   100.00%   100.00%
=========================================
  Files           10        10
  Lines         1694      1679   -15
  Branches       289       289
=========================================
- Hits          1694      1679   -15

Impacted Files
Coverage Δ

arrow/arrow.py
100.00% <0.00%> (ø)

arrow/parser.py
100.00% <0.00%> (ø)

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 d675335...69c5e07. Read the comment docs.


test: test contract type caching

Overview
Test feature on this PR: https://github.com/ApeWorX/ape/pull/712/files
to show that we can cache contract type when retrieving them from an explorer
Specification
Describe the syntax and semantics of how you would like to see this feature implemented. The more detailed the better!
Remember, your feature is much more likely to be included if it does not involve any breaking changes.
Dependencies
Include links to any open issues that must be resolved before this feature can be implemented.

we have tests


Cacadia Code PL font - Download link...

"To set the Cascadia Code PL font for use with PowerLine (after downloading, unzipping, and installing on your system)"
... Huh?
From where?
Link?

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: d3cbeb9a-9e7c-f8f4-5c03-5d6262d2b440
Version Independent ID: eb575c79-5b2a-45f6-646f-9d41d5d223e8
Content: Windows Terminal Powerline Setup
Content Source: TerminalDocs/tutorials/powerline-setup.md
Product: dev-environment
Technology: windows-terminal
GitHub Login: @cinnamon-msft
Microsoft Alias: cinnamon

There's a link to the Cascadia Code font further up the page, but agree that it should be linked again here... so just added a link to the section that you highlight. https://github.com/MicrosoftDocs/terminal/commit/026ba139335ca34f2b4deee03d8c7e18d0542d67#diff-9818a4f9188df163139575510303c1eb475db19f88dce83b64c7153ecaaf4ed0
Thanks @flatline-studios!


Additional text is being trimmed or omitted

Hey there,
Version: 2.1.3
I'm getting an issue where strings like {symbol}:{exchange} are resulting in just the symbol value, but the colon ( : ) and exchange are being left off.
Even in the demo file where you have {company?Freelance} · {job?–}, the only string coming in from the contacts demo JSON is the company.

Hey @docmars,
could you verify the name of the text layer. I believe the issue is that your layer name contains {company?Freelance} and hence only the company is populated.
If the layer name contains placeholders, only the first one is considered and takes precedence over any placeholders in the text content of the layer.
You may wish to rename the text layer to not contain placeholders.
Hope that helps.

Ahh got it. Thanks for the tip, I'll give it a try.
Awesome plugin, btw—I really wish this existed for Adobe Illustrator!


Few suggestion

[ ] Show lured pokestop on the map
[ ] Click to walk somewhere (Good if you find a place with many lured)
[ ] Make a walking path by drawing/clicking

[ ] A way to loop the path,
[ ] Go reverse (back and forth)

[ ] Mark spined pokestop (make them purple) (maybe show a time left inside info bubble)
[ ] Show the name of the pokestop in the info box (or at least show where you are heading) the path you have walked is red so the path from your point to the next place could be yellow or blue
[ ] Able to recycle items from the inventory
[ ] Turn on Lucky egg from the inventory
[ ] Turn on Incense from the inventory (once the bot can catch those pokemon as well)
[ ] Click on revive or potion to give it to a pokemon who needs it
[ ] Evolve from the pokemon tab
[ ] able to configure the recycle config, I'm getting this:

Not moving to any forts as there aren't enough space. You might want to change your config to recycle more items if this message appears consistently.

[ ] able to configure catch/release config
[ ] Give Pokémon nickname
[ ] Able to toggle Pokémon as favorite
[ ] Show max possible cp under the pokemon tab

Many of this feature are not yet implemented in the bot iirc, so we'll have to wait.
Altough, showing the lured forts should be already doable.

Mark spined pokestop should be doable also?

I was wondering the same, but it's not the case in the webapp of the bot so I don't really know.

https://github.com/PokemonGoF/PokemonGo-Bot-Desktop/issues/138

[*] Show lured pokestop on the map
[ ] Click to walk somewhere (Good if you find a place with many lured)
[*] Make a walking path by drawing/clicking

[*] A way to loop the path,
[ ] Go reverse (back and forth)

[ ] Mark spined pokestop (make them purple) (maybe show a time left inside info bubble)
[*] Show the name of the pokestop in the info box (or at least show where you are heading) the path you have walked is red so the path from your point to the next place could be yellow or blue
[*] Able to recycle items from the inventory
[ ] Turn on Lucky egg from the inventory
[ ] Turn on Incense from the inventory (once the bot can catch those pokemon as well)
[ ] Click on revive or potion to give it to a pokemon who needs it
[*] Evolve from the pokemon tab
[*] able to configure the recycle config, I'm getting this:

Not moving to any forts as there aren't enough space. You might want to change your config to recycle more items if this message appears consistently.

[*] able to configure catch/release config
[*] Give Pokémon nickname
[ ] Able to toggle Pokémon as favorite
[*] Show max possible cp under the pokemon tab

As it is in 0.0.2 Alpha, it would be nice to give people explicit instructions as to where the config files are located. If they've been using the other releases, I would hope they would be able to edit the config.json without screwing the whole thing up. Took me a few minutes to figure out where the file was and I'd like to save people the time searching. :-) Thanks for all your hard work so far.
For anyone wondering, the config.json file (on OSX atleast) is editable by showing the package contents of Pikabot.app, then navigating to Contents/Resources/app/gofbot/configs/config.json

Is it me or the build version lacks some of the features I had when installing from the terminal ? I can't see the candies anymore, nor the A/D/S stats :/
Thanks for this amazing work anyway ;)

Yep the builds lacks some commits which added those interesting features.
Le ven. 12 août 2016 à 18:43, jcctr<EMAIL_ADDRESS>a écrit :

Is it me or the build version lacks some of the features I had when
installing from the terminal ? I can't see the candies anymore, nor the
A/D/S stats :/
Thanks for this amazing work anyway ;)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/PokemonGoF/PokemonGo-Bot-Desktop/issues/104#issuecomment-239497058,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADR6jocphPI838ArpowTWyZOiuC0wfVvks5qfKKigaJpZM4JhWpE
.

I'm looking (and learning) at the code to see how they were done in the terminal version to see if I can add them back to my version. I'm sure the folks working on this have better things to do. :-)

git checkout #98226a9 will get you to the oldest working version with the most features.


new Quaternion(Up, Down) * Up == Up, but it should be Down

Godot version
4.1
System information
Linux 5.15
Issue description
When using the arc-based quaternion constructor very specifically with the arguments Vector3.Up & Vector3.Down, the resulting quaternion is wrong.
Steps to reproduce
Sorry that it's in C# instead of GDScript, but I don't have much experience with GDScript.
// These assertions are fine:
assert (new Quaternion(Vector3.Left, Vector3.Right) * Vector3.Left == Vector3.Right);
assert (new Quaternion(Vector3.Right, Vector3.Left) * Vector3.Right == Vector3.Left);
assert (new Quaternion(Vector3.Forward, Vector3.Back) * Vector3.Forward == Vector3.Back);
assert (new Quaternion(Vector3.Back, Vector3.Forward) * Vector3.Back == Vector3.Forward);

 // These assertions will fail:
assert (new Quaternion(Vector3.Down, Vector3.Up) * Vector3.Down == Vector3.Up);  // Result is actually Vector3.Down
assert (new Quaternion(Vector3.Up, Vector3.Down) * Vector3.Up == Vector3.Down);  // Result is actually Vector3.Up

What are you basing what it should be on? The other results flipping the vector?

Based on the description in the documentation, I assumed when an arc on a sphere goes from one side to the other, it should be a 180° rotation.
Moreover new Quaternion(new Vector3(0.01f, 0.99f, 0).Normalized(), Vector3.Down).Normalized() * Vector3.Up, gives (0.010114331, -0.99994874, 0) (so almost Down), which seems consistent with what I'd expect it to do. I will admit, however, I'm not very knowledgeable about the workings of quaternions and I might simply be misunderstanding what the function is supposed to do.

For any case where the two vectors are opposite it gives the quaternion (0, 1, 0, 0), which flips through the Y-axis, the case with the vectors being up/down it might break down, but unsure how to handle that seemingly degenerate case

Again I don't know much about quaternions, but I'd guess flipping either the x-axis or the z-axis would work fine, as long as it's a 180° rotation.

Yes but how do you pick that? I'm not sure this particular use of this constructor is reliable, but I'm not fully familiar with the system

As far as I can tell there's infinitely many possibilities for the shortest arc between the top and the bottom, so any arbitrary result is fine as long as it's one of the valid results.

But again, how to decide when this is the case? I think this should be documented as I suspect it's quite complex to try to add tests for this specific case

I believe if the exterior product (a.X * b.Y - a.Y * b.X) of two vectors is 0, they are collinear (by which I mean: facing the same direction or the opposite directions — but I'm not a mathematician so I might be using the wrong word here). I'm not sure how to decide on a result in the general case though.

We check it by seeing if the two vectors are parallel and opposite, tested with the scalar product
My question is: Is this case degenerate? I'd suspect it is and it's not well defined, and the question is if it is worth it to ensure it gives one of the "valid" cases or just return a degenerate case (being clarified in the documentation of course)

Asking for a 180° rotation seems fairly common for me, so regardless of whether or not it's technically degenerate (which I can't answer), it would seem desirable to me to produce some result that meets the programmer's expectations. Although I can understand that anything to do with quaternions is very difficult and I don't mind this going unresolved for some time. I've already implemented a work-around for my own project.
Just to give a use case, for me it was the following code that triggered this edge case:
void update_transform() {
    var rotation = new Quaternion(Vector3.Up, _normal);
    tf = Rotation(rotation) * Translation(new(0, distance, 0));
}

Which worked quite well except when _normal was (0,-1,0).
(With Rotation and Translation producing transformation matrices)

180 degree rotation around what axis though?

It seems to me that any axis that is orthogonal to the two given parallel vectors would be okay, so you could use a cross product to find it.

I thought you said the engine already checks for the case in which the vectors are parallel, in which case it seems to me this isn't really adding any further overhead except in the edge case where the vectors are indeed parallel — and that's the specific case that (in my opinion) currently isn't being handled particularly well. I don't really see any significant performance downside.

Well you'll have two, possibly three, cross products, and an normalization, which is quite a lot more

But it seems to me the added operations would specifically only be in the code branch of the parallel edge case (which doesn't work all that well), and wouldn't affect the normal cases. I might be misunderstanding, though.

It won't, but that doesn't remove the performance increase here

Check if input vectors a, b are antiparallel, which is trivial if you check for parallel already.
If true create a vector which is guaranteed not to be parallel:
c = (abs(a.z)+1, a.x, a.y) would work for example.
Compute rotation axis:
r = normalize(cross(a, c))
Create 180 deg quaternion:
q = (0, r.x, r.y, r.z)

For me this is clearly a bug. The from, to arguments being the opposite vectors case is already being properly detected[^1], but the always returned 180 rotation around the Y-axis for such cases is correct only for cases when from.y is zero (to.y is also zero then).
If this constructor wouldn't be supposed to handle the opposite vectors then it shouldn't handle them in any way whatsoever. In such case documenting such unsupported behavior and erroring in every such case could be a solution. But as mentioned, this constructor already handles such cases, just most of them incorrectly.
Hence I think for the opposite vectors the proper thing to do is to make this constructor return a rotation by 180 around any arbitrarily choosen axis orthogonal to the input vectors. And document it clearly; users can always manually handle such case if some specific behavior is desired.
Likely makes sense to prefer returning rotation around Y axis (when it's correct), this would not change the behavior for the cases already working correctly.
Also looking at the code it seems like it assumes the input vectors are normalized (then dot product is equivalent to the cosine of the angle between the vectors), but it's not ensured/checked anyhow. This should be changed too.
https://github.com/godotengine/godot/blob/16a93563bfd3b02ca0a8f6df2026f3a3217f5571/core/math/quaternion.h#L146-L148
[^1]: Given the input vectors are indeed normalized.

Documentation does not say anything about the case of opposite vectors returning unexpected results, and since a valid 180-degree rotation is still possible around an arbitrarily chosen axis, why don't just return that? With a note, that slerp-ing such rotation might yield unexpected results, since the axis is chosen at random.

That was more or less the consensus so far (minus the note kleonc made about preferring rotation around the Y axis). It's really just that no one has implemented a fix yet.

Check if input vectors a, b are antiparallel, which is trivial if you check for parallel already.
If true create a vector which is guaranteed not to be parallel: c = (abs(a.z)+1, a.x, a.y) would work for example.
Compute rotation axis: r = normalize(cross(a, c))
Create 180 deg quaternion: q = (0, r.x, r.y, r.z)

Crazy, it can be that simple right? Just use an abs().
When I discovered this issue, I only could come up with a general mathematical formula for perpendicular vectors (hint, it's an anti-symmetric matrix with zero trail) but I tried for many hours to find a simple function which would always produce a perpendicular non-zero vector from any non-zero vector. I think, it's impossible with linear or multilinear maps and a kind of case distinction (such as abs()) is necessary.
The next night before sleep, suddenly the idea plopped up, that the minimum absolute value obtains the maximum absolute value in a perpendicular vector. My own idea therefore is to cross-produce with an approximate perpendicular vector that is 1 at the minimum absolute value and zero elsewhere, and then normalize. Technically, the 1 doesn't need to correspond to the minimum component, just to one component that is small enough. This allows for short-circuit evaluation.
This idea results in replacement which implements the previous paragraph (sorry, I am too busy to deal with forks and pull requests right now). The arguments are
	bool set_perpendicular_to(const real_t& in_x, const real_t& in_y, const real_t& in_z, real_t& out_x, real_t& out_y, real_t& out_z) noexcept {
			constexpr real_t threshold = 1f / Math::sqrt(3f);
			real_t abs_x = Math::abs(in_x);
			if (abs_x > threshold + (real_t)CMP_EPSILON) return false;

			real_t length = Math::sqrt(1f - abs_x*abs_x);
			out_x = 0;
			out_y = -in_z / length;
			out_z = in_y / length;
			return true;
	}

	// v0 and v1 must be unit vectors
	Quaternion(const Vector3 &v0, const Vector3 &v1) { // Shortest arc.
		Vector3 c = v0.cross(v1);
		real_t d = v0.dot(v1);

		if (d < -1.0f + (real_t)CMP_EPSILON) {
			set_perpendicular_to(v0.x, v0.y, v0.z, x, y, z)
					|| set_perpendicular_to(v0.y, v0.z, v0.x, y, z, x)
					|| set_perpendicular_to(v0.z, v0.x, v0.y, z, x, y);
                        w = 0;
		} else {
			real_t s = Math::sqrt((1.0f + d) * 2.0f);
			real_t rs = 1.0f / s;

			x = c.x * rs;
			y = c.y * rs;
			z = c.z * rs;
			w = s * 0.5f;
		}
	}

The helper function better be private. Even better would be throwing a warning, if the arguments are not unit vectors. It might require up to 3 additional comparisons and 3 additional calls to Math::abs() when compared to the standard case but therefore, it uses two multiplications less. I did not compile it but theoretically, it should work.

@krisutofu I took some time this afternoon to implement your code. I should note that my understanding of the inner workings of quaternions is pretty limited but it doesn't seem like anyone else was going to do it. In general it went well except for one assertion I added to the test cases:
Vector3 left(-1, 0, 0);
Vector3 right(1, 0, 0);
Quaternion left_to_right(left, right);

// When the two vectors lie on the XZ plane, the rotation axis should be the
// Y-axis for backwards compatibility.
Vector3 left_to_right_axis = left_to_right.get_axis();
CHECK(left_to_right_axis.abs().is_equal_approx(up));

As kleonc mentioned, when the parameter vectors are on the XZ plane, the resulting quaternion should rotate on the XZ plane because that's consistent with what the old code does. I briefly tried messing around with the code but I figured it's probably better to just ask. Could you let me know how I could adjust the code so that it stays backward compatible?

No offence taken, thank you for taking the time to clarify!

@krisutofu I took some time this afternoon to implement your code. I should note that my understanding of the inner workings of quaternions is pretty limited but it doesn't seem like anyone else was going to do it. In general it went well except for one assertion I added to the test cases:
Vector3 left(-1, 0, 0);
Vector3 right(1, 0, 0);
Quaternion left_to_right(left, right);

// When the two vectors lie on the XZ plane, the rotation axis should be the
// Y-axis for backwards compatibility.
Vector3 left_to_right_axis = left_to_right.get_axis();
CHECK(left_to_right_axis.abs().is_equal_approx(up));

As kleonc mentioned, when the parameter vectors are on the XZ plane, the resulting quaternion should rotate on the XZ plane because that's consistent with what the old code does. I briefly tried messing around with the code but I figured it's probably better to just ask. Could you let me know how I could adjust the code so that it stays backward compatible?
Currently left_to_right rotates on the XY plane (so around the Z-axis).
@AThousandShips It's very late but I was reading through the thread this morning and I'd like to apologize for the phrasing "since it's a volunteer position and all" because it sounded pretty dismissive when I read it back. I'm not great at social things and my intuition for which tone a text I'm writing has is occasionally pretty bad, but I had always meant this in the sense of "especially since it's a volunteer position." I really didn't mean to be ungrateful. Sorry for that!

Great 😊 . Sorry for my response latency. It went into email Spam. The change you need is quite simple, it only needs to swap two things. I assumed X -> Y -> Z order but you'd like to have X -> Z -> Y order.
Therefore the change is to swap these two lines:
		|| set_perpendicular_to(v0.y, v0.z, v0.x, y, z, x)
		|| set_perpendicular_to(v0.z, v0.x, v0.y, z, x, y);

to
		|| set_perpendicular_to(v0.z, v0.x, v0.y, y, z, x)
		|| set_perpendicular_to(v0.y, v0.z, v0.x, z, x, y);

XZ has a positive normal that faces downwards (-Y), given that X precedes Z (as it is implemented in the vector comparison). Therefore it gives a -Y as rotation axis. If you still need that to be Y instead of -Y, you can swap the minus sign in the helper function which then gives the negated cross product.
With negated normal, it looks like this:
		out_y = in_z / length;
		out_z = -in_y / length;

Thank you for taking the time for the implementation. We will be grateful.

@krisutofu I thought your reply was plenty fast, there's really no need to apologize. I'm not sure if flipping the axis makes a significant difference, both directions seem to work equally well, but based on the old code I guessed that it used to always give a +Y rotation axis, so I've nevertheless added the change for flipping the axis. Thank you for the code and the kind words!


Closed because you didn't provide C# code to reproduce the problem.

Closed because you didn't provide C# code to reproduce the problem.
Originally posted by @Jinjinov in https://github.com/Jinjinov/IndexedDB.Blazor/issues/5#issuecomment-924330051

test_indexeddb.zip
1 -> start application, click on button add2, look db dd, you found 3 records, all ok.
2 -> press another time button add2, the records already exists also if before on code is executed the .clear()
3 -> delete records enable '2nd test' section, you see that now there are 6 records (not 3 as must be) and the change are applied to 2 records, the original and record added by the library
4 -> disable 2nd test, enable test 3, remove all the records from db, press button 'add2', the record removed is replaced with the prior record
5 -> disable test 3, enable test 4, remove all records on db, press button 'add2', the original record is updated, but also another record is added with the same data
we can't open db, execute operation on db & close db, we need to use 'large' db with indexeddb, and we can't think to use strategy like this, becouse everytime the db is opened read all the records and in out case this means minimum 30secs everytime

I did not write this library. I only made a few small changes.
The original library is at: https://github.com/Reshiru/Blazor.IndexedDB.Framework
This problem is already in the original library. I don't know how to fix it.
If you don't want to load all records every time, then you have to use this library: https://github.com/wtulloch/Blazor.IndexedDB


jsTree Hangs in Chrome and Firefox

When u stay on the page for little long and when u drill down many nodes after some time it stop expand / collapse. I am using lazy loading with Ajax call. Even i upgraded latest version of jsTree but still that problem is there. And In firefox it happened very quickly it show one alert window also after some time on Firefox.
Kindly look into this issue its very urgent.

Sorry, I cannot reproduce this - I use this tree in quite a few projects with large nodesets and I have not noticed such an issue. I will need a demo to help you. I will reopen on more information.
Best regards,
Ivan