How to enable C++ API usage from AAR builds (and integrate into gradle project)?

System information

OS Platform and Distribution: Linux Ubuntu 16.04
Mobile device: Samsung Galaxy S10
TensorFlow installed from: pip
TensorFlow version: 2.1.0
Python version: 3.5.2
Installed using: virtualenv / pip
Bazel version (if compiling from source): 3.0.0
GCC/Compiler version (if compiling from source): 5.4.0

Describe the problem
How to enable C++ API usage from AAR builds (and integrate into gradle project)?
I'm trying to run a simple inference from the C++ API... what am I missing? I've tried following the guides at the TF website, and the Github repositories (minimal / image classification) but I'm missing the part where the TFLite library joins the Android Studio NDK.
Is there a way to use C++ API the same way I've been using the Java API via gradle? (kindly see attached comment by @jdduke)
Provide the exact sequence of commands / steps that you executed before running into the problem
https://www.tensorflow.org/lite/guide/android
https://www.tensorflow.org/lite/guide/inference
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/examples/minimal/minimal.cc
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/examples/label_image/label_image.cc
https://www.tensorflow.org/lite/guide/build_arm64
Any other info / logs
Originally posted by @jdduke in https://github.com/tensorflow/tensorflow/issues/34489#issuecomment-558261882

@orangesomethingorange
Please refer to these issues and let us know if it helps:
#39120
link
link2
link3

@orangesomethingorange
Please check this also
link

Hi @orangesomethingorange, we currently don't have any plans to expose the C++ API directly from the .aar. Generally speaking, using C++ across shared library boundaries is a tricky affair.
That said, we do expose the C API for TFLite in the prebuilt .aars. We're working on a sample which downloads the aar from Maven and extracts them via Gradle. The .aar also include the C API headers. See also https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/c.

@orangesomethingorange
Please refer to these issues and let us know if it helps:
#39120
link
link2
link3

Hi @Saduf2019,
Thanks for the links ;)
Trying to add the flatbuffers libs:
To use tfilte I need to also add the flatbuffers libraries, if I understand correctly.
I tried following flatbuffers build guide and compile the libs using Android Studio's CMake.
Indirect path resulted in an error, so I set the directory's full path:
CMakeLists.txt:
cmake_minimum_required(VERSION 3.4.1)
set( FLATBUFFERS_SRC_DIR /full/path/to/flatbuffers )
add_subdirectory(${FLATBUFFERS_SRC_DIR}
                 ${CMAKE_CURRENT_BINARY_DIR}/flatbuffers-build
                 EXCLUDE_FROM_ALL)
add_library(
             native-lib
             SHARED
             native-lib.cpp )
find_library(
              log-lib
              log )
target_link_libraries(
        native-lib
        PRIVATE flatbuffers
        ${log-lib} )

but trying to build this with Android Studio results in the following:
FAILED: flatbuffers-build/tests/union_vector/union_vector_generated.h
g���d�C��: not found
FAILED: flatbuffers-build/tests/namespace_test/namespace_test2_generated.h
g���d�C��: not found
FAILED: flatbuffers-build/tests/arrays_test_generated.h
g���d�C��: not found
FAILED: flatbuffers-build/tests/native_type_test_generated.h
g���d�C��: not found
...
FAILED: flatbuffers-build/tests/monster_test_bfbs_generated.h
g���d�C��: not found
ninja: build stopped: subcommand failed.

Trying to add the tflite libs:
I tried following TF world's pdf and this question to use a .so library.
Also I tried using Bazel to build .a files or .aar files - and include them in Android Studio.
I've used Bazel on my server and also within TensorFlow's Docker container.
So after all these trials I'm left with the .so, .a and .aar files.
They're all currently located inside my Android app folder, under /app/libs directory, and I've tried to include them in my CMakeLists.txt file in several ways (not all at once, of course):
CMakeLists.txt:
# set(tflite_DIR ../../../libs)
# set(tflite_DIR /full/path/to/app/libs )
# set(TENSORFLOW_DIR /full/path/to/tensorflow/ )

#add_library(lib_tflite SHARED IMPORTED)
#set_target_properties(lib_tflite PROPERTIES IMPORTED_LOCATION
#        ${tflite_DIR}/tflite/lib/${ANDROID_ABI}/libtensorflowlite_c.so)
#
#add_library(lib_tflite_gpu SHARED IMPORTED)
#set_target_properties(lib_tflite_gpu PROPERTIES IMPORTED_LOCATION
#        ${tflite_DIR}/tflite/lib/${ANDROID_ABI}/libtensorflowlite_gpu_delegate.so)
#
#add_library(lib_nnapi SHARED IMPORTED)
#set_target_properties(lib_nnapi PROPERTIES IMPORTED_LOCATION
#        ${tflite_DIR}/tflite/lib/${ANDROID_ABI}/libnnapi_delegate.so)
#
#target_include_directories(hello-libs PRIVATE
#        ${tflite_DIR}/tflite/include
#        ${tflite_DIR}/tflite/include/tensorflow/lite/tools/make/downloads
#        ${tflite_DIR}/tflite/include/tensorflow/lite/tools/make/downloads/flatbuffers/include
#        )

#add_library(libtflite SHARED IMPORTED)
#
#set_target_properties(libtflite PROPERTIES IMPORTED_LOCATION
#        ${TENSORFLOW_DIR}bazel-out/arm64-v8a-opt/bin/tensorflow/lite/libtensorflowLite.so)

#add_library(
#        libtflite
#        SHARED
#        IMPORTED )
#
#set_target_properties(libtflite
#        PROPERTIES IMPORTED_LOCATION
#        ${tflite_DIR}/tensorflow-lite.aar)

#add_library(libtensorflowLite
#        SHARED
#        IMPORTED)
#
#set_target_properties(
#        libtensorflowLite PROPERTIES IMPORTED_LOCATION
#        ${tflite_DIR}/libtensorflowLite.so)

so for example here is something that builds and compiles without any errors:
set(tflite_DIR /full/path/to/app/libs )
add_library(libtensorflowLite
        SHARED
        IMPORTED)
set_target_properties(
        libtensorflowLite PROPERTIES IMPORTED_LOCATION
        ${tflite_DIR}/libtensorflowLite.so)
target_link_libraries(
        native-lib
        libtensorflowLite
        ${log-lib} )

but when I try to use it in my cpp code - it doesn't seem to recognize any tensorflow library.
I can't #include anything or use any functions, ops or headers.
Is there an extra step I'm missing here?

@orangesomethingorange
Please check this also
link

thanks @pranv12,
I checked that link too - see my previous reply.

Hi @orangesomethingorange, we currently don't have any plans to expose the C++ API directly from the .aar. Generally speaking, using C++ across shared library boundaries is a tricky affair.
That said, we do expose the C API for TFLite in the prebuilt .aars. We're working on a sample which downloads the aar from Maven and extracts them via Gradle. The .aar also include the C API headers. See also https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/c.

@jdduke that's great news - I'll check that out now :)
Generally speaking I'm currently trying to run a simple inference from a .tflite model file. When using the Java API I ran the inference and used the NNAPI and GPU delegates.
From the README description I can tell that "This includes C APIs for common types, like kernels and delegates, as well as an explicit C API for inference" so I guess that it can work.
Later on I'll want to do some pre- or post- processing to the inputs / outputs of the image - I assume that's where the C API differs from the C++ one - correct?
Perhaps including an external library - such as OpenCV - may solve this.
Any thoughts?

@orangesomethingorange
Reply for steps you did in comment
Whichever IDE you are using search there for the option to include additional dependencies. And then try adding path to TFlite folder. This will add your TFlite Libraries.
For flatbuffers please read below.
I had same problem.
Here's what I did.

In my workspace, I created a folder include (for External dependencies eg. TFlite, flatbuffers, etc)
Dowloaded only tensorflow folder from source. (You can do it using svn)
Similarly downloaded TFLite dependency flatbuffers folder from the source.
Also, TFlite needs absl header files so I downloaded absl header files from the source.
I'm working in Microsoft VS. I added the path/to/dir/include in additional dependencies. Whichever IDE you are using search there for the option to include additional dependencies.

Only the above folders are necessary no need to clone the complete repo.
After this include folder contains:
include:
--tensorflow
---- Some Folders (Including lite)
---- Some Files
--flatbuffers
---- Some Folders
---- Some Files
--absl
---- Some Folders
---- Some Files
Extra note:
To download only specific folder from GitHub repository.
A tool called svn is helpful.
Installation
On Ubuntu/Linux:
sudo apt install subversion
On Windows:
Download the latest installer and install.
Usage:
E.g. to download tensorflow folder from tensorflow repository
Navigate to folder:
https://github.com/tensorflow/tensorflow/tree/master/tensorflow
replace tree/master by trunk
and run following command in Terminal/CMD:
svn checkout https://github.com/tensorflow/tensorflow/trunk/tensorflow
This will download tensorflow folder in pwd.
I hope this help. :)

Later on I'll want to do some pre- or post- processing to the inputs / outputs of the image - I assume that's where the C API differs from the C++ one - correct?

No, the C and C++ APIs are largely equivalent in terms of functionality. Note that you can still use C++ in your own library when using the C API. Also, the C API is self-contained, and has no absl/flatbuffer dependencies in the public API.

Hi @orangesomethingorange, we currently don't have any plans to expose the C++ API directly from the .aar. Generally speaking, using C++ across shared library boundaries is a tricky affair.
That said, we do expose the C API for TFLite in the prebuilt .aars. We're working on a sample which downloads the aar from Maven and extracts them via Gradle. The .aar also include the C API headers. See also https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/c.

@jdduke I tried to build the C API library for Android like so:
On my x86 Linux Ubuntu 16.04 (following this):
user@ub-16 $ bazel --version
bazel 3.1.0
user@ub-16 $ cat tensorflow/.tf_configure.bazelrc | grep -ie android
build --action_env ANDROID_NDK_HOME="/home/user/Android/Sdk/ndk/20.0.5594570/"
build --action_env ANDROID_NDK_API_LEVEL="28"
build --action_env ANDROID_BUILD_TOOLS_VERSION="29.0.3"
build --action_env ANDROID_SDK_API_LEVEL="29"
build --action_env ANDROID_SDK_HOME="/home/user/Android/Sdk"
user@ub-16 $ bazel build -c opt --cxxopt=--std=c++11 --config=android_arm64 //tensorflow/lite/c:tensorflowlite_c
...
ERROR: /home/user/.cache/bazel/_bazel_user/22c116ddaf0b061cb1d24c68b7eae373/external/local_config_cc/BUILD:47:1: in cc_toolchain_suite rule @local_config_cc//:toolchain: cc_toolchain_suite '@local_config_cc//:toolchain' does not contain a toolchain for cpu 'arm64-v8a'
ERROR: Analysis of target '//tensorflow/lite/c:tensorflowlite_c' failed; build aborted: Analysis of target '@local_config_cc//:toolchain' failed
INFO: Elapsed time: 0.209s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (9 packages loaded, 131 targets configured)

On TensorFlow's Docker container (following this):
user@ub-16 $ sudo docker run -it --name tflite tensorflow/tensorflow:nightly-devel
root@148806b57557:~# apt-get update
...
Reading package lists... Done
root@148806b57557:~# apt-get install crossbuild-essential-arm64
...
root@148806b57557:/home# git clone https://github.com/tensorflow/tensorflow
root@148806b57557:/home/tensorflow# ./tensorflow/lite/tools/make/download_dependencies.sh
...
download_dependencies.sh completed successfully.
root@148806b57557:/home/tensorflow# bazel build -c opt --cxxopt=--std=c++11 --config=android_arm64 //tensorflow/lite/c:tensorflowlite_c
Extracting Bazel installation...
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=101
INFO: Reading rc options for 'build' from /home/tensorflow/.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec
WARNING: while reading option defaults file '/home/tensorflow/.bazelrc':
  invalid command name 'try-import'.
WARNING: while reading option defaults file '/home/tensorflow/.bazelrc':
  invalid command name 'try-import'.
ERROR: Unrecognized option: --experimental_repo_remote_exec
WARNING: --batch mode is deprecated. Please instead explicitly shut down your Bazel server using the command "bazel shutdown".

but it seems I do not have the proper toolchain for that.
Building with bazel build -c opt //tensorflow/lite/c:tensorflowlite_c build ok on x86 Ubuntu 16.04.
But when I try to include that in Android Studio like so:
CMakeLists.txt:
cmake_minimum_required(VERSION 3.4.1)
set(tflite_DIR /home/user/AndroidStudioProjects/tflite/app/libs )
add_library(
             native-lib
             SHARED
             native-lib.cpp )
add_library(libTensorflowLiteC
        SHARED
        IMPORTED)
set_target_properties(
        libTensorflowLiteC PROPERTIES IMPORTED_LOCATION
        ${tflite_DIR}/libTensorflowLiteC.so)
find_library(
              log-lib
              log )
target_link_libraries(
        native-lib
        libTensorflowLiteC
        ${log-lib} )

I get the following build error:
Build command failed.
Error while executing process /home/user/Android/Sdk/cmake/<IP_ADDRESS>88404/bin/ninja with arguments {-C /home/user/AndroidStudioProjects/tflite/app/.cxx/cmake/debug/arm64-v8a native-lib}
ninja: Entering directory `/home/user/AndroidStudioProjects/tflite/app/.cxx/cmake/debug/arm64-v8a'
[1/2] Building CXX object CMakeFiles/native-lib.dir/native-lib.cpp.o
[2/2] Linking CXX shared library /home/user/AndroidStudioProjects/tflite/app/build/intermediates/cmake/debug/obj/arm64-v8a/libnative-lib.so
FAILED: /home/user/AndroidStudioProjects/tflite/app/build/intermediates/cmake/debug/obj/arm64-v8a/libnative-lib.so
: && /home/user/Android/Sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=aarch64-none-linux-android28 --gcc-toolchain=/home/user/Android/Sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/home/user/Android/Sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security   -O0 -fno-limit-debug-info  -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,-z,noexecstack -shared -Wl,-soname,libnative-lib.so -o /home/user/AndroidStudioProjects/tflite/app/build/intermediates/cmake/debug/obj/arm64-v8a/libnative-lib.so CMakeFiles/native-lib.dir/native-lib.cpp.o  /home/user/AndroidStudioProjects/tflite/app/libs/libTensorflowLiteC.so /home/user/Android/Sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/28/liblog.so -latomic -lm && :
**/home/user/AndroidStudioProjects/tflite/app/libs/libTensorflowLiteC.so: error adding symbols: File in wrong format**
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

How should I build the C API to be used in Android Studio?

@orangesomethingorange
Reply for steps you did in comment
Whichever IDE you are using search there for the option to include additional dependencies. And then try adding path to TFlite folder. This will add your TFlite Libraries.
For flatbuffers please read below.
I had same problem.
Here's what I did.
1. In my workspace, I created a folder `include` (for External dependencies eg. TFlite, flatbuffers, etc)

2. Dowloaded only `tensorflow` folder from [source](https://github.com/tensorflow/tensorflow/tree/master/tensorflow). (You can do it using [svn](https://tortoisesvn.net/docs/release/TortoiseSVN_en/index.html))

3. Similarly downloaded TFLite dependency [flatbuffers](https://github.com/google/flatbuffers/tree/master/include/flatbuffers) folder from the source.

4. Also, TFlite needs absl header files so I downloaded [absl header files](https://github.com/abseil/abseil-cpp/tree/master/absl) from the source.

5. I'm working in Microsoft VS. I added the `path/to/dir/include` in additional dependencies. Whichever IDE you are using search there for the option to include additional dependencies.

Only the above folders are necessary no need to clone the complete repo.
After this include folder contains:
include:
--tensorflow
---- Some Folders (Including lite)
---- Some Files
--flatbuffers
---- Some Folders
---- Some Files
--absl
---- Some Folders
---- Some Files
Extra note:
How to use svn. stackoverflow post.
I hope this help. :)

@pranv12,
My IDE is Android Studio 3.6.3.
To include flatbuffers and abseil I use their CMakeLists.txt files, trying to build them with Gradle, which fails with the following error:
ninja: error: '../jniLibs/abseilLib/arm64-v8a/lib_abseil.a', needed by '/home/user/AndroidStudioProjects/tflite/app/build/intermediates/cmake/debug/obj/arm64-v8a/libnative-lib.so', missing and no known rule to make it

(Not for Android) on Ubuntu 16.04:

@jdduke - continuing ### (Not for Android) on Ubuntu 16.04:
I created a fresh Android Studio C++ empty project and used the following CMakeLists.txt:
cmake_minimum_required(VERSION 3.4.1)
set( lib_tflite_DIR ../jniLibs )
file(MAKE_DIRECTORY ${lib_tflite_DIR})
file(MAKE_DIRECTORY ${lib_tflite_DIR}/${ANDROID_ABI})
add_library( tflite-lib
        SHARED
        IMPORTED )
set_target_properties(
        tflite-lib
        PROPERTIES IMPORTED_LOCATION
        app/src/main/jniLibs/x86_64/libtensorflowlite_c.so )
add_library(
             native-lib
             SHARED
             native-lib.cpp )
find_library(
              log-lib
              log )
target_link_libraries(
        native-lib
        tflite-lib
        ${log-lib} )

and got the following error trying to build:
Build command failed.
Error while executing process /home/user/Android/Sdk/cmake/<IP_ADDRESS>88404/bin/ninja with arguments {-C /home/user/AndroidStudioProjects/tflite/app/.cxx/cmake/debug/arm64-v8a native-lib}
ninja: Entering directory `/home/user/AndroidStudioProjects/tflite/app/.cxx/cmake/debug/arm64-v8a'

**ninja: error:** 'app/src/main/jniLibs/x86_64/libtensorflowlite_c.so', **needed by** '/home/user/AndroidStudioProjects/tflite/app/build/intermediates/cmake/debug/obj/arm64-v8a/libnative-lib.so', **missing and no known rule to make it**

Trying to change BUILD target in bazel or create a new target did not prove successful either.
Is buildting the C API libs from Gradle's CMakeLists.txt an option?

In your CMakeLists.txt it looks like you've specified the x86_64 binary, whereas  the build error is looking in the arm64 directory?
ninja: Entering directory /home/user/AndroidStudioProjects/tflite/app/.cxx/cmake/debug/arm64-v8a

I have the same .so library file placed in both directories, with architecture-names accordingly, just in case Gradle (or ninja) wants to look for them there (i.e. app/src/main/jniLibs/arm64-v8a/[LIB].so and app/src/main/jniLibs/x86_64/[LIB].so).
In my CMakeLists.txt file I have:
set_target_properties(
        tflite-lib
        PROPERTIES IMPORTED_LOCATION
        **app/src/main/jniLibs/x86_64/libtensorflowlite_c.so** )

so I guess that's why the build error looks there.
I specified both architectures at build.
Changing the line to app/src/main/jniLibs/arm64-v8a/libtensorflowlite_c.so results in the same error, just with this path:
ninja: error: 'app/src/main/jniLibs/arm64-v8a/libtensorflowlite_c.so', needed by '/home/user/AndroidStudioProjects/tflite/app/build/intermediates/cmake/debug/obj/arm64-v8a/libnative-lib.so', missing and no known rule to make it
Also, taking the following line as an example:
bazel build -c opt --fat_apk_cpu=x86_64,arm64-v8a --cpu=x86_64,arm64-v8a --host_crosstool_top=@bazel_tools//tools/cpp:toolchain //tensorflow/lite/java:tensorflow-lite
I tried various architecture combinations:
--fat_apk_cpu=x86_64,arm64-v8a --cpu=x86_64,arm64-v8a

--fat_apk_cpu=x86_64 --cpu=x86_64

--fat_apk_cpu=aarch64 --cpu=aarch64

--cpu=x86_64,arm64-v8a

--fat_apk_cpu=x86_64,arm64-v8a

--fat_apk_cpu=arm64-v8a --cpu=x86_64

but build fails.
This line use the CPP toolchain on the tensorflow/lite/java library, following this example, but I fail to find the toolchain code in the bazel BUILD files.
Could this be the issue? I'm only just getting to know bazel now...

Later on I'll want to do some pre- or post- processing to the inputs / outputs of the image - I assume that's where the C API differs from the C++ one - correct?

No, the C and C++ APIs are largely equivalent in terms of functionality. Note that you can still use C++ in your own library when using the C API. Also, the C API is self-contained, and has no absl/flatbuffer dependencies in the public API.

@jdduke I think I misunderstood your answer. I thought that having the C API being self-contained and free from absl/flatbuffer dependencies means I can just use the files.
After failing to build the library as a shared / static library to include in my project, I tried to build and compile the source and header files directly in the IDE. I started from the example in the c_api.h file, and added headers one by one, until I got to here:
$ tree
.
|-- absl
|   |-- base
|   |   |-- attributes.h
|   |   |-- config.h
|   |   |-- internal
|   |   |   |-- identity.h
|   |   |   |-- inline_variable.h
|   |   |   `-- invoke.h
|   |   |-- macros.h
|   |   |-- optimization.h
|   |   |-- options.h
|   |   |-- policy_checks.h
|   |   `-- port.h
|   |-- memory
|   |   `-- memory.h
|   |-- meta
|   |   `-- type_traits.h
|   |-- types
|   |   |-- bad_optional_access.h
|   |   |-- internal
|   |   |   `-- optional.h
|   |   `-- optional.h
|   `-- utility
|       `-- utility.h
|-- flatbuffers
|   |-- base.h
|   |-- flatbuffers.h
|   `-- stl_emulation.h
`-- tensorflow
    |-- core
    |   `-- public
    |       `-- version.h
    `-- lite
        |-- allocation.h
        |-- c
        |   |-- c_api.h
        |   |-- c_api_internal.h
        |   `-- common.h
        |-- core
        |   |-- api
        |   |   |-- error_reporter.h
        |   |   |-- op_resolver.h
        |   |   `-- profiler.h
        |   |-- macros.h
        |   `-- subgraph.h
        |-- delegates
        |   `-- nnapi
        |       `-- nnapi_delegate.h
        |-- error_reporter.h
        |-- experimental
        |   `-- resource
        |       `-- resource_base.h
        |-- external_cpu_backend_context.h
        |-- interpreter.h
        |-- interpreter_builder.h
        |-- kernels
        |   `-- register.h
        |-- memory_planner.h
        |-- model.h
        |-- model_builder.h
        |-- mutable_op_resolver.h
        |-- nnapi
        |   |-- NeuralNetworksTypes.h
        |   `-- nnapi_implementation.h
        |-- schema
        |   `-- schema_generated.h
        |-- stderr_reporter.h
        |-- string_type.h
        |-- type_to_tflitetype.h
        |-- util.h
        `-- version.h

this was the minimal structure I got to by following header files.
As you can see - absl/flatbuffer dependencies do exist.
Issue 1
Trying to build from this structure results in build errors of the form:
error: undefined reference to '[FUNCTION]' which all relate to functions found in c_api.cc.
Issue 2
Trying to add and build with c_api.cc included,
results in the following error from <memory>:
.../toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:2339: error: undefined reference to 'tflite::impl::Interpreter::~Interpreter()'
when building for x86_64
and the following errors:
c_api.cc:62: undefined reference to `tflite::DefaultErrorReporter()'
c_api.cc:62: undefined reference to `tflite::FlatBufferModel::VerifyAndBuildFromBuffer(char const*, unsigned long, tflite::TfLiteVerifier*, tflite::ErrorReporter*)'
[[ many more "undefined reference to" from c_api.cc ]]
...
mutable_op_resolver.h:59: undefined reference to `vtable for tflite::MutableOpResolver'
[[ likewise ]]
...
memory:2339: undefined reference to `tflite::FlatBufferModel::~FlatBufferModel()'
c_api.cc.o: In function `std::__ndk1::default_delete<tflite::impl::Interpreter>::operator()(tflite::impl::Interpreter*) const':

when trying to build for arm64-v8a.
This was done using clang++ in the toolchain.
How can I use the C API independently?

I thought that having the C API being self-contained and free from absl/flatbuffer dependencies means I can just use the files.

Sorry if it wasn't clear, what I meant is that the C API headers are free from external dependencies. So you can easily drop the shared library + 2-3 lite/c/*.h headers into your project and use them directly, as opposed to also needing flatbuffer headers. The actual C API implementation requires all the same libraries as the C++ API.

I thought that having the C API being self-contained and free from absl/flatbuffer dependencies means I can just use the files.

Sorry if it wasn't clear, what I meant is that the C API headers are free from external dependencies. So you can easily drop the shared library + 2-3 lite/c/*.h headers into your project and use them directly, as opposed to also needing flatbuffer headers. The actual C API implementation requires all the same libraries as the C++ API.

OK, that's great news but how do I use them?
The only example of running inference with the C-API is the one in the c_api.h (this), right?
Do you have an example code for using only the C headers and still running an inference?

You're right that there's no good end-to-end example using the C API. This is something we're working on, however, the high-level usage and flow should be quite similar to the C++ API.

Well that's good to hear :) I hope to see them soon.
Currently I'm having trouble with just using the C/C++ APIs.
The main approaches I've been trying so far are:

using the TFLite as an external library and load into Android Studio: I used this, and this and combinations of the two, to get a static (.a) or a shared (.so) library (from either my x86-toolchain or the Docker container), and try to include them in Android Studio using cmake.
building the source code from files + headers with Gradle (Android Studio's build system): I used the C source code from lite's directory (see here) and tried to build it in Android Studio.

Any comments / ideas are more than welcome.

@orangesomethingorange
Is this still an issue, please confirm if we may move this to closed status

@orangesomethingorange
Is this still an issue, please confirm if we may move this to closed status

Hey @Saduf2019, I can't say that I got an answer for this issue.
Also, I'm still working on investigating this, and I understand from @jdduke that this might be solved in the near future, since work is currently (or very soon will be) in progress.
I would like to keep the status as open for now, if that's OK with you :)

I recreated the shared libraries, and compiled with cmake normally and now it works OK.
In my case the issue was the shared libraries build, which wasn't updated in container versions.
Generally speaking the Docker Containers simplify the build of shared libraries, but it really depends on the container.
For example - using the latest, devel, latest-devel or nightly containers made a big difference, and I'm still not sure which one contains what exactly and how configurable each one is.
Also note the Docker Container from the Dockerfile.
Once I found proper containers for each shared library I could build them with customization (for example ops or custom ops).
After that the process it's pretty much the same as I described at the beginning of this issue, and it's a great replacement to the use of AARs in the Gradle project.


Em or REM?

Hi, awesome tool, thank you!
Question: isn't it time to switch to rem units instead of em ? I find it so much easier to predict when all elements share the same reference value.
Or make it an option?

It's hard to say if any one single unit (px, em, rem, percent) is better than the others. I think they all have their place depending on the use case, project, and of course personal preference.
That said, the scale is based on percents, just like em and rem units, so the rem value is the same as the displayed em value.
Here's an example:
If the HTML element is set to 1em (16px), then:
17px = 106.3% = 1.063 em = 1.063 rem
Here's an example where I could argue using em units is the better approach. If I want to scale an entire sidebar or widget to a smaller size, then by using em units I can just change the font-size instead of changing all the values for fonts, margins, padding, etc.
http://codepen.io/jeremychurch/pen/egxxvx
Here's that same example using rem units. You'll notice that the h2 doesn't inherit the font-size, nor does it affect the padding or margins, so I would have to declare all of that again for my small widget, vs just changing the font-size.
http://codepen.io/jeremychurch/pen/KaJJae
Anyways. I do appreciate the feedback, and it's been a while since I've looked at this project. The text at the bottom might be due for a refresh, and maybe I can incorporate some of this into it; information explaining units, how it can be used for rems, etc.

Ah, thanks for the use case where em are indeed useful. An option to set the unit would indeed be more relevant than my initial suggestion.
I did something quite nice (but unorthodox) thanks to your tool: a typographic scale for mobile, and one for 1024px and above.  I'm still fidgeting with it, but in case you want examples: http://plancomptablebelge.be
(it's a free tool for accountants in Belgium).
i plan to write a case study where i'll credit Type Scale.
Thank you!
A.

This looks really nice. I'll have to look at it closer sometime. Keep me posted on the case study; sounds interesting.


[BUG]getCanonicalPath have bug on Windows

Information

Apktool Version (apktool -version) -2.7.0
Operating System (Mac, Linux, Windows) -Windows
APK From? (Playstore, ROM, Other) -other
Java Version (java --version) -11

BrutIO.sanitizeUnknownFile(directory,entry)
->
entry = "ln.xml"
->
String canonicalEntryPath = new File(directory, entry).getCanonicalPath()
->
String fileName2 = canonicalEntryPath.substring(canonicalDirPath.length())
->
the fileName2 = "LN.xml" why??
fileName2 = "ln.xml" the true?
Stacktrace/Logcat
sanitizeUnknownFile:90, BrutIO (brut.util)
copyToDir:91, DirUtil (brut.directory)
copyToDir:71, DirUtil (brut.directory)
copyToDir:198, AbstractDirectory (brut.directory)
copyToDir:87, DirUtil (brut.directory)
copyToDir:78, DirUtil (brut.directory)
copyToDir:203, AbstractDirectory (brut.directory)
decodeResourcesRaw:134, Androlib (brut.androlib)
decode:99, ApkDecoder (brut.androlib)
cmdDecode:175, Main (brut.apktool)
main:79, Main (brut.apktool)
Steps to Reproduce

apktool  d -r

Frameworks
If this APK is from an OEM ROM (Samsung, HTC, LG). Please attach framework files
(.apks that live in /system/framework or /system/priv-app)
APK
If this APK can be freely shared, please upload/attach a link to it.
Questions to ask before submission

Have you tried apktool d, apktool b without changing anything?Y
If you are trying to install a modified apk, did you resign it?Y
Are you using the latest apktool version?Y

@helengray - I'm trying to follow this. Are you saying on Windows getCanonicalPath changes the casing of the parameter to be lowercase?

@helengray - I'm trying to follow this. Are you saying on Windows getCanonicalPath changes the casing of the parameter to be lowercase?

to be uppercase

I see, because Windows is case insensitive, resulting in resource name conflicts

I see - this is a long standing issue related to handling of assets on case-insensitive filesystems.
Since I only work on mac/linux. I don't see myself personally working on this, so just setting your expectations fairly.
https://github.com/iBotPeaches/Apktool/issues/1460


Fail to undelete a deleted blob in one SAS attached blob container

Storage Explorer Version: 1.12.0
Build: 20200305.6
Branch: dev/chuye/beta-blob-extension
Platform/OS: Windows 10/ Linux Ubuntu 16.04
Architecture: ia32/x64
Regression From: Previous release(1.12.0)
Steps to reproduce:

Expand one Non-ADLS Gen2 storage account -> Blob Containers (Make sure soft delete is enabled).
Select one blob container -> Attach it using SAS (with full permissions).
Open the SAS attached blob container -> Upload one  blob to it.
Delete the blob -> Try to undelete the deleted blob.
Check the result.

Expect Experience:
The deleted blob is undeleted successfully.
Actual Experience:
Fail to undelete the deleted blob.

More Info:

This issue also reproduces for blobs under one SAS attached account.
Show the below log after clicking 'Retry all'

Error details:
{
"name": "RestError",
"message": "ResourceNotFoundThe specified resource does not exist.\nRequestId:e89a6dbb-201e-0111-3588-f3e4fa000000\nTime:2020-03-06T07:28:29.9792079Z"
}

This issue has been fixed on build 20200308.1. So close it.


How to call one action in queue

Hi, how can I call one action in the queue? I'm using moleculer for nodejs

this.broker.call


RHEL for SAP BYOS and RHEL 9 BYOS for arm64

Goes with
https://github.com/GoogleCloudPlatform/compute-image-tools/pull/2236

/hold

/lgtm

/unhold


Option to specify colors

This allows users to set colors themselves, rather than relying on random colors. Unfortunately it appears the iteration order is different with and without the by_group option.

Looks nice. Needs rebase onto the develop branch before merge plz.

Fixed... I think

Awesome! Thanks @elliottbiondo!


Add default settings

What area needs improvement?
Add some additional settings

On hold waiting for a list to update


⚠ Samsung has degraded performance

In 3407480, Samsung (https://samsung.com) experienced degraded performance:

HTTP code: 200
Response time: 3329 ms

Resolved: Samsung performance has improved in 438a3bd.


Discrepencies in the readme.

Hi.
Your readme says this:
Step-2: Clone , update the Submodule, unzip the content
   git clone https://github.com/dineshannayya/riscduino.git
   cd riscduino
   git submodule init
   git submodule update
   make unzip

but the commands don't do what is expected. has there been an update which has not been reflected in this readme ?
make unzip complains about lef/*.gz files being missing. Is there something im missing?
Thanks in advance!

Normally I remove lef/* gds/* folder from the repo to keep git repo smaller; As these folder are need only silicon tapeout only (You can mask these unzip function inside Makefile).
Any how, I have check-in these folder back, you can resync the repo.

thanks ,for the reply sir,
but in verilog gl file is also broken while unziping.
as u said ,,whether i can  remove  gzip verliog from make file?
! image

You can skip/bypass the zip/unzip step, there are only required for tapeout package release.


DBeaver: Add SQL Editor functionality of Duplicate Line(s)

DBeaver - Version 5.3.1 CE
DBeaver driver: MS SQL Server  / Microsoft Driver
Operating System: Windows 7 / Windows 8.1 / Windows 10
Database Server: Microsoft SQL Express 2014, 2016, 2017
It would be benificial if DBeaver could duplicate the line(s):
o That the cursor are in.
o The lines that are selected.
This is a really a quick way to make a copy of the current line when just wanting to test someting.
Also it is really a quick way to make a copy of a whole SQL command when wanting to make a similar SQL command.

It is already there (hint: CTRL+ALT+UP).
Note: you can find most of existing editor commands in the "Quick Access" tool.

You can also customize this feature by...
Clicking on Menu: Window -> Preference -> User Interface -> Keys -> Search: 'Duplicate Lines'
Update/Enter Your choice hot key in Binding field. -> Click on 'Apply and Close'


Add comments to stepper-indicator class

I added some comments, let me know if there's something you don't understand.
I admit that the cases are maybe a bit tricky, probably had a better way to do it, couldn't think of it though :smile:

That’s great, thank you !

Le 25 juin 2016 à 11:59, Yann Badoual<EMAIL_ADDRESS>a écrit :
I added some comments, let me know if there's something you don't understand.
I admit that the cases are maybe a bit tricky, probably had a better way to do it, couldn't think of it though 😄
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/badoualy/stepper-indicator/issues/5#issuecomment-228528085, or mute the thread https://github.com/notifications/unsubscribe/ARh5ztF8snRJ1mNKw_YTpFyRrQYKJ1Mlks5qPPwFgaJpZM4I3vVV.


Create .NET Core Template for Razor Pages Website

DESCRIPTION
It would be good to have .NET Core Template which can be used to generate UI Website using microservice framework.
ADDITIONAL CONTEXT
Template pack should contain the following templates:

REST API microservice which exposes REST API and Swagger, EF Core data layer
UI application which uses Razor Pages, EF Core data layer

Each template should have at least the following parameters:

Project name (e.g. -n parameter which is referred by template via sourceName variable)
Port number used by microservice.

The following links contain detailed information regarding template creation:

(!) https://devblogs.microsoft.com/dotnet/how-to-create-your-own-templates-for-dotnet-new/
(!) https://github.com/dotnet/templating/wiki/Available-Parameter-Generators
https://docs.microsoft.com/en-us/dotnet/core/tutorials/cli-templates-create-item-template
https://docs.microsoft.com/en-us/dotnet/core/tutorials/cli-templates-create-project-template
https://docs.microsoft.com/en-us/dotnet/core/tutorials/cli-templates-create-template-pack
https://www.patridgedev.com/2018/10/22/add-variables-to-your-custom-dotnet-new-template/

Hi @DiamondDragon
Can you please check if this point is still valid?
We already updated README file and added demo part.
https://github.com/GodelTech/GodelTech.Microservices.Core/blob/main/README.md
https://github.com/GodelTech/GodelTech.Microservices.Core/tree/main/demo
Thank you


Add native Compose Navigator

PR adds a version of the Navigator, written entirely in Compose (instead of using fragment-based Navigator). It uses its own ViewModel to store backstack and services.
This has two benefits:

It makes initialization of the stack much easier, since there is no need to deal with Navigator fragment. All initialization is done in 100% compose
Since everything is done in Compose, this makes nesting backstacks trivial. You can just call  ComposeNavigator composable inside a screen and you create a nested backstack (I've included an example of this in the second commit).

Main drawback here is, that in order to support nested navigation, this Navigator must also handle back button events natively. Unfortuantely, current design of simple-stack does not allow full functionality for this (as discussed in https://github.com/Zhuinden/simple-stack/issues/259). Current implementation works for basic navigation, but it omits support for ScopedServices.HandlesBack. If desired, I can mark this PR as Draft and we can wait until you figure out how to tackle that.
This fixes #13

It might be a good idea to do a bit more extensive testing on this or maybe mark it as experimental until we are sure it works reliably. I've already found two issues and fixed them.

I want to make better BackHandler integration before merging this, but this initiative is amazing nonetheless. 👀

Taking another look at the code, do we still need to detach and re-attach state changer on resume/pause? This defers first navigation to after activity reaches the resumed state.
I can't think of specific issues with that off the top of my head, but knowing Android's lifecycle, I'm sure there are some.

Okay, but is there any reason to detach state changer whenever a dialog pops up over our app?
How should we proceed with this PR, now that we have new back handling model? Should we just add an assertion to ensure this composable is only used when back handling model is set to AHEAD_OF_TIME?

Okay, but is there any reason to detach state changer whenever a dialog pops up over our app?
How should we proceed with this PR, now that we have new back handling model? Should we just add an assertion to ensure this composable is only used when back handling model is set to AHEAD_OF_TIME?

I was thinking about this, and I eventually didn't expose backstack.getBackHandlingModel() because it messes with the api surface.
While I'm not 100% happy with the idea (I probably should have exposed it anyway), we can still detect the set model by catching the exception coming from willHandleAheadOfTimeBack() when the model isn't set.

Detaching the state changer ensures some kind of behavior regarding the system permission dialog and commitNow(). And it's also there so that the app is resumed before trying to navigate. Honestly, I ran into the issue quite long ago, unless I'm imagining things and this came directly from square/Flow InternalLifecycleIntegration.

Updated PR to use new back handling system.
This leaves Backstack.historyAsState() composable function unused, but I have decided to not delete it as it might be useful to the end user. What do you think?

I see no bug. 👍

@matejdro This is a super powerful addition, however during testing, I found https://github.com/Zhuinden/simple-stack-compose-integration/issues/26 .
I will hopefully look at it later, however maybe you can see the cause sooner than I do?

(nvm I figured it out)


Fix search hint, added aria-label to icon

Fix search hint, added aria-label to icon
The documentation updated for ...
Link checker
The links will be checked by the build agent automatically once you create or update your PR.
You can use the following command to check the broken links locally.
docker run --rm -it --network=host --name=linkchecker ghcr.io/linkchecker/linkchecker --check-extern --no-warnings http://<IP_ADDRESS>:4000/

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.


Reaching the ETH API call limit should not reset the list of ERC-20 tokens

LGTM, tested on testnet.


[FEATURE] Rebrand: name, colours, logo

Description
PRE launch

[x] Update app with new name, logo and colours - @azhechkova
[x] Create new Vercel app with new domain (use existing db) decided to reuse existing app
[ ] Create Vercel envars with new names
[ ] Uptime for new name (monitoring repo)

POST launch

[ ] Merge PR
[ ] GitHub OAuth update url, name and logo
[ ] linkfree.io to redirect to new domain
[ ] Rename the repo + update repo description and url

Screenshots
No response
Additional information
No response

Hey @eddiejaoude! :)  Congrats on getting the rebrand name! :) Biodrop is catchy and bit more catchy! :) If possible, I’d love to do a PR that updates the documentation with the new name. It’ll keep things moving fast.

Hey @eddiejaoude! :) Congrats on getting the rebrand name! :) Biodrop is catchy and something I’ve never heard before! :) If possible, I’d love to do a PR that updates the documentation with the new name. It’ll keep things moving fast.

Thank you Chrissy! Everything should already be updated in the PR  https://github.com/EddieHubCommunity/LinkFree/pull/8757


feat(EntityPicker): use EntityPresentationApi to display entities in the picker

Hey, I just made a Pull Request!
Following issue #20955, I added EntityPresentationApi to the EntityPicker to have more "friendly" display of entities in the picker and a common way to display them across backstage.

For the rendering of the picker options I used <EntityDisplayName /> component and for access "outside" React JSX I used const entityPresentationApi = useApi(entityPresentationApiRef); and entityPresentationApi.forEntity(entity, {...}).snapshot.entityRef.
I'm not quite sure to fully understand how entityPresentationApi works, especially with the .snapshot and .update$ and it feels like duplicated a bit of code with multiple usage of .forEntity. I'm open to a bit of explanation and suggestions if there is a better way to do it 🙂
I also found what I think is a bug in the DefaultEntityPresentationApi. When calling this.#getEntityForInitialRender the default context is not used and can throw an error for an entityOrRef without an explicit kind/namespace. I fixed it by passing the context through the function but I'm not sure if the initial behavior was intended or not.
:heavy_check_mark: Checklist

[x] A changeset describing the change and affected packages. (more info)
[ ] Added or updated documentation
[x] Tests for new functionality and regression tests for bug fixes
[x] Screenshots attached (for UI changes)
[x] All your commits have a Signed-off-by line in the message. (more info)

I realized that I have a bug with the allowArbitraryValues.
If you select an entity in the list and then click outside the input it will trigger a blur event and parse the value of the input (which is now primaryTitle) and result as a non valid entity (without namespace and kind)

Hi again! I'm very sorry that this has taken so long,  but I've now added https://github.com/backstage/backstage/pull/24595 that provides a promise-based API for presentations. This lets you fetch all presentations immediately inside the useAsync block so that you don't have to touch the presentation api anywhere else in the code. For example, build an entity-ref-to-presentation map as part of the results of the useAsync. Then they are "synchronously" available in all code.
I started rewriting this myself on top of that PR, but it turns out that the free solo mode really makes things annoying to get right (since it sometimes ends up having a state string of the presentation value, and sometimes an entity), so ... had to put it off a while and focus on other things.
If you get the time to start your work on top of that branch (if the PR isn't merged yet when you read this), then awesome. 🙏

@benjidotsh your PR is pretty closely related to this, does it overlap?

@benjdlambert I'm not too familiar with EntityPresentationApi, but we definitely touch the same code. 😅
I'll see if I can look into this a little more next week.

Hi @Julien-Hery @freben, what's needed to move this forward? Best I can tell there are some un-resolved comments. I'm just following up as this is something that the Community really would like to see in place and there is already what looks like a duplicate PR #24852 submitted for this.

Hello @freben 🙂
I'm also sorry to not have answered quicker, I was off for 3 weeks 😅 I will take a look at what you did 👍
To summarize what I did and where I was blocked : freeSolo

If you select an entity in the list and then click outside the input it will trigger a blur event and parse the value of the input (which is now primaryTitle) and result as a non valid entity (without namespace and kind)
I'm not sure on how to solve this, blur event is needed for the freeSolo 🙁

I don't have any idea on how to solve that except adding a specific behavior for it but it makes things very complex for a component that should not be
If anyone has an idea maybe I can find time to work on it 🙂

Hi @Julien-Hery, welcome back and sorry for stealing your issue 😄
I suggest you to take a look at my PR (#24852), which is based on the changes made by @ahhhndre and the implementation of MultiEntityPicker. I think the implementation should be similar. It also makes the freeSolo thing a non-issue since it directly uses the entity ref as its value.

@benjidotsh no problem 😄
I will take a look today to see if I can merge our work and have something good 💪

I transfered your work to my branch @benjidotsh 🙂
As I was saying here and following what you did, using the full ref as a value is the only solution to work with freeSolo.
For the last usage of humanizeEntityRef, I updated the getLabel function. The function is only used if the value from formData was not found in the catalog and if freeSolo is enabled. So the function should never received something that needs to be used with presentation api but may receive something that needs to have default namespace and kind added. I think using parseEntityRef and then stringifyEntityRef is enough in this case.
@benjidotsh you should be the one getting credit for most of this PR 😅
@freben @ahhhndre let us know what you think of this 🙂

Thanks @Julien-Hery, teamworks makes the dream work 😄

@acierto feel free to merge if this looks ok to you

@freben @acierto @awanlin any updates on this ? 🙂

Thanks everyone for getting this contributed, reviewed and merged!!! 🚀

This destroys the EntityPicker when having a large number of entities in the catalog. See #25340


Add Vuesion theme

Discord username
scumethy#3063
Name of theme
Vuesion
How Has This Been Tested?
Have your run the python script?
Yes

Thanks @steigerung!


Fix running Windows on Travis CI

Checklist

[x] npm install && npm test passes
[x] commit message follows commit guidelines

Description of change

test-addon.js includes compiling code, making the default 30 second timeout not suitable. This increases the timeout for all platforms, which is a potential problem everywhere, fixing the timeout that happens on Windows. Currently, the test takes 53 seconds on Windows and 17 on OSX.
This also adds Node 6 on Windows to the matrix. There is a lot of platform-specific code, so running the oldest supported version seems reasonable.
Fixes: https://github.com/nodejs/node-gyp/issues/1801
cc @cclauss

CI: https://ci.nodejs.org/view/All/job/nodegyp-test-pull-request/140/

I was playing with this in the test itself https://github.com/nodejs/node-gyp/compare/rvagg/fix-windows-unicode-test?expand=1 but couldn't get it to work with the time i had available, my timeout wasn't being applied
anyway, this is reasonable I think, +1

travis_wait might be worth considering.

Landed in https://github.com/nodejs/node-gyp/compare/656117c...bb92c76, thanks.
@richardlau the first two tests seem to use about half the time each, so it would be too tight. I've seen a run of 34 seconds just for the first test.


Adds empty line at bottom of code blocks

Repro:

@mxstbr pretty sure  I resolved this - can't repro it anymore - can you double check?


Disable the flatten option from OpenAPI parser for client , service code generation

Description:
In some scenarios, you should have all schemas defined inline (e.g. a response schema) moved to the components/schemas section and replaced with a reference to the newly added schema within components/schemas.
With this fix,
We do not flatten any inline schema within this fix and generate code with an inline record.
ref: https://github.com/swagger-api/swagger-parser?tab=readme-ov-file#3-flatten

Introduce the flattern enable with the flag option and default behaviour will be disable flattern

This the current implementation we will be unable to disable the flatten option since we have a dependency with naming for return status code in in client/service generation.


Listen for signal Device.OnActivePortUpdated

Hi.
In following patch I've added listening for signal "OnActivePortUpdated" it allows to detect when headphones injected.
Thanks for the great lib.

Thanks for the contribution.
I tried to keep the lib simple and close to the DBus API rather than trying to abstract everything.
I hope you wasn't too surprised with the split registration interface and it's was easy to understand and implement.


Exposure in FermiGBMLikeTTE

Need to implement the proper computation of exposure for Fermi/GBM.
Fermi/GBM has a deadtime for each recorded event. Look at the code in GtBurst, close to where you got the other code, for the function which computes that exposure.

Ah, ok, this is something I've been curious about. I will implement ASAP.

So GBM has 2E-6 s of dead time per event. =>
exposure =  (tmax - tmin)  -    N_evt * 2E-6
where N_evt is the number of events in the interval between tmin and tmax
This is the closet that I can find in any documentation.

Kind of, except that there is a larger deadtime for counts detected in the overflow channel.
This is a snippet of code which compute the deadtime for the GBM for one event, given its reconstructed channel PHA:
def get_deadtime(pha):

    #This return the deadtime associated with a given event
    #It is 2.6 microseconds if PHA!=127 and 10 microseconds if PHA==127 (overflow channel)
    #(see Meegan et al. 2009)

   assert 1 <= pha <= 128, "Use channel numbers between 1 and 128"

    if pha==128:

      return 10E-6

    else:

      return 2E-6

Ok implemented in pull request of branch iss26


T265: Level detection support

Hi,
for my PoC application I'm using for an effective way to support level detection (I mean floor level). Right now I don't see support for something like this in the SDK. My initial idea was to place different static_nodes at different levels, but this fails, since the SDK - once a scene is detected as "known" - automatically delivers the position of all nodes set on query. Initially I thought, they would only be delivered, if they come "in sight",  but the current behaviour makes totally sense.
In case I would use this, I could imagine to use the delivered Z distance as a level separator, but this seems a bit error prone to me.
Other ideas? Some way to mark a complete view as belonging to an outer context?

By floor level do you mean the floor height or like first floor second floor etc ?

I meant the latter. Thinking twice I think a more general request would have to be the ability to label a scene. It is not only "level 1" or "level 2", it could also be "office room", "printer room" etc. Something which is implanted into a map at training time and returned at run time on recognition.  A "scene tag" so to say. But it might be too obscure, I suppose I will have to find a way outside the camera :) Don't bother with this...

I've tried to keep up aiming towards support for loading multiple maps with the idea being that you could connect to any or all of them.  This would allow a VR headset to detect which room it was in, for example.  Sadly, this not ready nor on the roadmap at this point in time.

@radfordi That would be an awesome improvement, indeed... BTW: Have you ever seen my little PoC solution published these days? The results are that encouraging, that it literally cries for "Drive me forward" https://neilyoung.serveblog.net

Thank you again for highlighting these features. We have moved our focus to our next generation of products and consequently, we will not be addressing this in the T265.

Thank you again for highlighting these features. We have moved our focus to our next generation of products and consequently, we will not be addressing this in the T265.


Const generic type expression

This change is

Current dependencies on/for this PR:

main

PR #2825   👈

This comment was auto-generated by Graphite.


Fixes #57

Prevents possible out of memory error by changing map of candidates for whom we are voted to a single candidate value.

Thanks for the PR, will review tonight!

Refs #57

Looks good, thanks for the PR @dmitraver and the hint @colin-scott!
You're right that only one value for the currently voted for term is enough and does not sacrifice safety, thanks!
Failure I'd say was unrelated to this PR, sadly it's still fleaky.


hibernation: support hibernating spot instance for AWS clusters

OpenShift supports running spot instances for compute. Therefore when
cluster is hibernated these instances must also be stopped and started
like the on-demand instances.
But due to the nature of the spot instances, these instances are not
guaranteed. So if these instances are started, these might not start if
the spot instance constraints are not met. Therefore aws supports
stopping and starting spot instances only when the spot instance request
are persistent (compared to one-time). see 1 for more info.
machine-api add support for spot instances in AWS detailed in 2.
Some of the things to note are,

machine-api has decided that one spot instance in aws is tied to one
Machine object in api.
which means, the spot instances are created as "one-time" type. Once
the backing instance is gone (either terminated by aws or user) the
Machine object goes into Failed state and stays there as-is.
For new Machine to take the place of the previous Machine, the
machine-api deploys MachineHealthCheck object that deletes Machines
that were "deleted by AWS" only. If user deletes/terminated the
instance, the user must also remove the object from API.

To shut down a "one-time" spot instance, the only option is to terminate
the instance. So for running -> hibernation, aws actuator terminated
these instances instead of stopping them like it does for on-demand
instances.
Since the spot instances were terminated, for hibernation -> running
state change the aws actuator must somehow replace the previous
instances with new ones.
The only way is to delete the Machine objects for the previously
terminated spot instance, and letting the MachineSet replace those to
match the expected replica count.
The aws actuator now looks for these Machines that need to be replaced
by

finding machines with "machine.openshift.io/interruptible-instance"
label
filtering out machines that are "not failed" given that their status
was updated after hibernation was started
The actuator then deletes those machines by
updating the machine objects to skip draining. since the instances are
already known to be gone, skipping draining prevents machine-api
getting stuck for pods to scheduled.
deleting those machine objects.

xref: https://issues.redhat.com/browse/HIVE-1195
/cc @dgoodwin @2uasimojo
/assign @joelddiaz

/test e2e

If, prior to cluster hibernation, the cluster has some spot instances in a failed state (b/c someone was manually messing with the spot instances), does a running -> hibernating -> running set of state transitions leave us in a place where the previously failed spot instances are now noticed and restored by the aws actuator codepath?

@joelddiaz I think you are correct. the hive aws actuator will terminate the previously failed spot instances when we transition from running->hibernation and cluster aws actuator will try re creating them when we delete the old objects and they get replaced with new ones during the hibernating -> running transition.
did you have any specific concerns with this behavior in mind? it seems okay to me..

@joelddiaz I think you are correct. the hive aws actuator will terminate the previously failed spot instances when we transition from running->hibernation and cluster aws actuator will try re creating them when we delete the old objects and they get replaced with new ones during the hibernating -> running transition.
did you have any specific concerns with this behavior in mind? it seems okay to me..

No concerns. Just making sure I'm reading understanding the behavior correctly. :+1:

I think i answered all the comments. 👍🏽

Good for me. Leaving to assignee to stamp.

/lgtm

/lgtm


Some identifiers conflict with Python keywords

Some identifiers, like attribute names and parameter names can conflict with Python keywords. For example, HttpContentRangeHeaderValue currently has several syntax errors in the generated type hints due to the use of the name from.

Need to create a write_python_identifier function that replaces these keywords with a substitute (i.e. add an underscore to the end) and use it anywhere we use write_lower_snake_case to write a Python identifier like here and here.


[BUG] - Status bar icon missing

Status bar notification missing.
Smartphone (please complete the following information):

Device: Pixel 7 Pro
Android Version: Android 14
App Version: 3.5.0 (ffeb089)

To Reproduce
Steps to reproduce the behavior:

Install app.
Connect to server.

Expected behavior
After connecting to a server an WGTunnel icon should be visible in status bar.

Hello! This is actually expected as I removed the need for having a persistent notification for the tunnel. The only icon added to the bar should now just be the key icon (if you're using userspace).
If you have any further questions, feel free to drop them here, but I'll mark this as closed for now.


Consider using PROSIC2

PROSIC is a caller for somatic variants in tumor-normal sample pairs, sequenced with any next-generation sequencing technology. It provides a novel latent variable model that integrates various levels of uncertainty, and thereby allows to properly asses the probability of having a somatic variant while controlling the false discovery rate.

See #666


Allow other account than root to bootstrap server

When doing a regular Ubuntu installation, you get a sudo user by default and not an enabled root account. This is currently not possible in IC Next because it expects the root account to be enabled when bootstrapping with an SSH key. I would like to be able to provide a sudo-user so IC Next can bootstrap and configure my server.

Working on this now.


Can't verify hashes

Hi, trying to install the requirements following the instructions I get the following error:
(astroglial_analysis) C:...\silver-dollop>pip install -r requirements.txt
Ignoring appnope: markers 'python_version >= "3.9" and python_version < "3.13" and platform_system == "Darwin"' don't match your environment
Collecting astroglial-segmentation@ git+https://github.com/yaksilab/Astrolglial-cell-segmentation.git@43481a039ce72fe43b041ef5c2d241e3b1bb748f (from -r requirements.txt (line 35))
ERROR: Can't verify hashes for these requirements because we don't have a way to hash version control repositories:
astroglial-segmentation@ git+https://github.com/yaksilab/Astrolglial-cell-segmentation.git@43481a039ce72fe43b041ef5c2d241e3b1bb748f from git+https://github.com/yaksilab/Astrolglial-cell-segmentation.git@43481a039ce72fe43b041ef5c2d241e3b1bb748f (from -r requirements.txt (line 35))

This is fixed by d22790c7fb514e7632062dbe746c79f7f335d548


Update Chromium

The current version of chromium is severely outdated. I've spent a day trying to upgrade it but it was a huge mess and I failed to do so.
Is there a clear guide anyone could provide to do so?
Would anyone else be able to update the chromium version?
Thanks!

I'm followingf this git for a long time now because I thought web capabilities within unreal was a must to be. Is EPIC out of this completly?

@SrGeneroso epic has their own chromium browser embedded inside the engine as a Web Browser widget: https://docs.unrealengine.com/en-us/Engine/UMG/UserGuide/WidgetTypeReference/WebBrowser
You can find the source for this here: https://github.com/EpicGames/UnrealEngine/tree/release/Engine/Source/Runtime/WebBrowser
and the dependent CEF here: https://github.com/EpicGames/UnrealEngine/tree/release/Engine/Source/ThirdParty/CEF3
Regarding the BLUI update process you generally need to update the blubrowser component here: https://github.com/AaronShea/BluBrowser with sources from http://opensource.spotify.com/cefbuilds/index.html. It's an involved process, last time I did it for 3.2556 you can find some notes about it here: https://github.com/getnamo/BLUI/issues/9

Hi my problem is to the same.. How to update ? It say not recommend.


Specify custom paper size / media size for printing

How do you specify a custom paper size for printing in UWP.
In WinForms this was achieved by setting the PaperSize property in the PageSettings class.
Given the following code, it seems like I can only choose printTask.Options.MediaSize from the PrintMediaSize enumeration.
private void PrintMan_PrintTaskRequested(PrintManager sender, PrintTaskRequestedEventArgs e)
{
    PrintTask printTask = null;
    printTask = e.Request.CreatePrintTask("C# Printing SDK Sample", sourceRequested =>
    {

        PrintTaskOptions printTaskOptions = printTask.Options;

        // There is no way to specify a custom page size??
        printTask.Options.MediaSize = PrintMediaSize.NorthAmericaTabloidExtra;
        printTask.Options.Orientation = PrintOrientation.Portrait;

        sourceRequested.SetSource(printDocumentSource);
    });
}

We would like to create PDF files in variety of page sizes.

This appears to be a question about the platform, not the sample. You can open a support case with our Developer Support team:

Visit http://aka.ms/storesupport and sign-in with your Microsoft account
Under the “App Development” section choose "Windows 10 universal app development", then choose the appropriate problem type and category to get engaged through a formal support channel.


mechanism of include guard change on #pragma once.

Pull requrest just created #29

https://github.com/smart-cloud/actor-zeta/pull/29


[BUG]: where property not available for with

What version of drizzle-orm are you using?
0.29.3
What version of drizzle-kit are you using?
0.20.8
Describe the Bug
According to this page it's possible to do a sub filtering on a table included with with, using a where property. However, in my D1 / SQLite Drizzle DB, that property doesn't seem to be available in the types. If I try it however, it works at runtime.

Expected behavior
The property should be available in the types.
Environment & setup
No response

This is expected behavior if the relation is to-one, which seems to be your case. You don't need to filter the results if you know there's only one related card. Please confirm so we can close the issue

For now there's no first class support for filters on nested relations. But you can work around that by using a subquery in the outside where condition.

Ah interesting! For now I used a standard select with inner joins but I appreciate the tip.

I think there is a use case here for where: filters on one-to-one relationships: Verifying that the joined record matches the parent record's tenant id or test/live mode status.
An example would be if multiple customers' data were stored in a single database. It might be helpful to have that additional level of assurance that an incorrect ID would not send the wrong customer's data in the response.


Publish a playground for simple fiddling with “x-element”.

We should host static page (perhaps within the GitHub ecosystem) to allow fiddling with “x-element”. It'd be interesting to see how light-weight a solution we could come up with which would still essentially give folks a light-weight text editor and rendered output.
Not sure on exactly the where / how yet, but I think this would be valuable to lower the barrier-to-entry.

@klebba — Not sure if you've thought about this one too much, but it might be a fun little project to knock out.

If we make x-element play nice with build tools then we rely on existing playgrounds like codepen, jsfiddle, stackblitz, glitch etc.

If we merge #116, that should become a lot easier.


Allow table alias definition  [V0.2]

It should be possible to define a table with an alias using an array.
Now we use variadics for multiple table, we can use ['table' => 'alias'] to define alais's.

This should be extended to tables added to join definitons


Use react-hooks-testing-library

Use react-hooks-testing-library to test hooks business logic.

Will do

Closed via this commit


setSelectedWorksetItem is not triggering the event worksetItemSelected

Hello All,
First of all thanks to a wonderful SHELL component in the framework :+1:
I had one requirement to change the current set work set item.
The setSelectedWorksetItem method works fine and I can see that after calling it with the desired workset id , the navigation cursor points to the worksetitem.
But my main problem is changing the selected work set item via this method is not invoking event "worksetItemSelected".
Due to this, it never comes to our logic of changing the content of the shell :(
I feel this might be a bug where even after changing the selected work set item , the relevant event is not triggered,
Can anyone please check on this . I tried to fix this problem by looking into SHELL js class but since I am new to JS, I am stuck :(

Hi,
this behavior is intentional,following the guideline that state changes triggered by the user does result in events, but state changes triggered by the application code does not. The rationale is that the application does not need to be informed when it triggers the change and hence already knows about the change.
So the recommendation is that when your own code sets the selected item (which is not the main use-case, as normally the user triggers the change), it also calls the same function that is normally triggered by the event.
Regards
Andreas


Not working with Corsair Void Pro Wireless

Hello.
I'm using Ubuntu 18.04 and a Corsair Void Pro Wireless.
headsetcontrol is working just fine, but 'headset-charge-indicator' is failing because this headset doesn't support chat-mix.
sudo python3 headset-charge-indicator.py /usr/local/bin/headsetcontrol Bat: 54 Error: This headset doesn't support chat-mix level Command '['/usr/local/bin/headsetcontrol', '-m', '-c']' returned non-zero exit status 1. Bat: 54 Error: This headset doesn't support chat-mix level Command '['/usr/local/bin/headsetcontrol', '-m', '-c']' returned non-zero exit status 1.
Is there a why to bypass this and make it work?
thanks

So, I commented out any reference to chatmix in the python file, but then after running The program with:
sudo python3 headset-charge-indicator.py /usr/local/bin/headsetcontrol
Im getting the battery percentage in screen but no icon in top bar:
`sudo python3 headset-charge-indicator.py /usr/local/bin/headsetcontrol
Bat: 52
Bat: 52
`
If I run headset-charge-indicator.py without specifying the headsetcontrol binary, of course it shows no options but the icon and menu appears in top bar.

I don't think the chatmix function should be related as the "unavailable"-exception is properly contained and logged there. If I make it fail locally for me, the icon/app-indicator still works fine.
Which exact desktop-environment are you using? I tried a few and some were not working well for some reason, see also the section in the README of this repository.

I just went through this, though I'm still not 100% as I just have ellipses on my system tray but I got past where you are stuck.  Removing the sudo should get you the system tray icon, but it still won't work as is because the udev file doesnt have all devices in it.
Run lsusb
Get the corsair product ID
Edit /etc/udev/rules.d/70-headsets.rules
Look for the corsair entries, they all have the vendor ID 1b1c.  In my case I had to add another line for the product 0a16, it has 14 and 17 but not 16.
Run sudo udevadm control --reload-rules && sudo udevadm trigger
Now you should be able to run headsetcontrol without sudo, which will allow this python script to work.
The chat-mix error is OK, it just disables chat-mix in the system tray menu.

I think this is either solved by the previous comment or actually a problem of installing HeadsetControl properly for non-root usage via correct udev rules.
If this is still a problem for you then please discuss this via an Issue at https://github.com/Sapd/HeadsetControl/


fix: Add missing name to ESLint v9 autoImports config

This PR adds a name field in ESLint v9 autoImports config.
The name is used in error messages and the config inspector to help identify which configuration object is being used.
Refs:

Configuration Naming Conventions

Released in v0.18.12


TableBlock content missing from admin when not on first tab

Found a bug? Please fill out the sections below. 👍
Issue Summary
The content of a TableBlock is missing from admin when the StreamField it belongs to is not the initially selected tab when the page is loaded. The table metadata fields (row header checkbox, table caption etc) are there, but not the actual table.

If the streamfield the tableblock belongs to is on tab 2 and you open the page editor, the table content will be missing as described above. If you select tab 2 and then reload the page editor the content will appear. So the problem isn't that the tableblock must be on the Content tab, but rather that the streamfield must be visible when the page editor is loaded.
Steps to Reproduce

Start a new project with wagtail start myproject
Install wagtail.contrib.table_block in base.py
Add a StreamField to the HomePage that contains a TableBlock
Add the accompanying StreamFieldPanel to promote_panels (not content_panels)

from wagtail.core.models import Page
from wagtail.core.fields import StreamField
from wagtail.core import blocks
from wagtail.admin.edit_handlers import StreamFieldPanel

from wagtail.contrib.table_block.blocks import TableBlock

class HomePage(Page):
    sidebar = StreamField(
        [("paragraph", blocks.RichTextBlock()), ("table", TableBlock(label="Tabell"))],
        blank=True,
    )

    promote_panels = Page.promote_panels + [StreamFieldPanel("sidebar")]

migrate, createsuperuser and open the home page editor in admin.
Add some content to the StreamField, including aTableBlock with some cell data
Save the page.
Reopen the home page editor
Open the Promote tab. The TableBlock is there but not the table widget with the cell data
Whilst still on the Promote tab, refresh the page. The table content should not appear.

Any other relevant information. For example, why do you consider this a bug and what did you expect to happen instead?

I have confirmed that this issue can be reproduced as described on a fresh Wagtail project: yes
The table data is saved to the db and the front end works fine. It's just the table editing widget doesn't get initialised properly when its block is not visible on page load.

Technical details

Python version: 3.8.2
Django version: Checked with 2.2 and 3.0.
Wagtail version: Bug present in 2.10 and back at least as far as 2.8.1.
Browser version: You can use Chrome 84.

Thanks for the report @alexalligator! I believe this is covered by the existing issue at #2687.

Sorry, did a search of issues but somehow didn't spot that one. Thanks! 👍


Performance degradation because of NavButtonBehavior and possible memory leaks

https://github.com/Windows-XAML/Template10/blob/master/Template10 (Library)/Behaviors/NavButtonBehavior.cs
After investigation with JetBrains DotTrace profiler it is revealed that NavButtonBehavior too often executes
private void Calculate(bool allow = false) method. And, this method adds a significant performance penalty. Issue show itself in a most terrible manner when Page contains ListView and user is scrolling.
Profiler trace show that it is caused by private void LayoutUpdated(object sender, object e) { Calculate(true); } line of code, which call Calculate method.
When user scrolls in a ListView, layout is updated too often (ListView is virtualizing items and so items are often recreated and repopulated). It cause major performance penalty to an application that use ListView in its layout.
Also, NavButtonBehavior attach events to a global singleton Frame, which cause a certain memory leak and further performance degradation after user navigate between pages some time. Frame.SizeChanged -= SizeChanged; in a Detach method does not work because it is not called automatically on page unload.
NavButtonBehavior is used in a PageHeader control tempate
https://github.com/Windows-XAML/Template10/blob/master/Template10 (Library)/Themes/PageHeader.xaml
so it attach itself into every page and worse, it buried deep inside a control template and can not be detached by hand without a fragile tricks with visual tree
In practice it cause a progressive performance degradation after navigations between pages. Scrolling in a ListView suffer a progressively violent lags and this lags get worse after each new page navigation, because already performance inefficient NavButtonBehavior does not detach from a global Frame LayoutChanged event and this performance cost is multiplied with each new page navigation.
Also it is need to be investigated with memory profiler if NavButtonBehavior can cause a global memory leak, preventing pages (which often contain view models and lots of other data inside) from be garbage collected.
Again, it do not much harm to an applications running x86 Desktop (because desktop environment have much more powerful CPU and do not constrained in free memory), but on a resource constrained ARM device it seems to be a disaster.

I suggest use of some event throttling technique (or cease use Frame LayoutUpdate event) to reduce performance penalty. For global events I suggest use of WeakEvent pattern. It is generally  not wise to attach events to a global singleton objects and it is a most common cause of memory leaks in a .NET applications. To counter this risks WeakEvent pattern is strongly suggested when attaching to global singleton object events.

One thing at a time. You need to verify that Detach() is not called. I believe it is.

Okay, throttled Calculate(), but I am going to ask you to test for me. I don't have the tool you are using. Do you mind? If you don't want to, I can find a way.

@JerryNixon

Okay, throttled Calculate(), but I am going to ask you to test for me. I don't have the tool you are using. Do you mind? If you don't want to, I can find a way.

What kind of tests? I can do some test sometime after 12 hours. I can download latest source code, compile it, refrence in my app and use ReSharper to estimate performance penalty. For now i measured that after performance testing as in ListView created ~6000 templated items, Calculate was called at same ~6000 and performance report show that Calculate was one of a major sources of CPU load.

One thing at a time. You need to verify that Detach() is not called. I believe it is.
I think there is no need to "believe". Attaching event handlers to a global singleton objects is generally a bad idea and this practice must be avoided at all costs, because it effectively eliminate automatic memory management (garbage collector can not collect objects, referenced by singleton global objects) and manual memory management is required in this case. To avoid this situation and to avoid high risk of memory leaks (because of manual memory management such as relying on explicit call of Detach or Dispose or so on) using of WeakEvent coding pattern is strongly recommended to remove manual memory management requirement from program written in language with automatic memory management once and for all.

@JerryNixon and for performance penalties. I investigated this (not in a context of NavButtonBehavior, but it apply here anyway). Fundamental cause of performance degradation is a high cost of marshalling between .NET and Windows Runtime APIs (which are plain old COM in disguise). So, I already complained about exceptionally bad performance of .NET/COM Interop to a CoreCLR team. .NET Native compilation do not help much.  This performance issue forced me to rewrite some time critical parts of my code in C++ language and this yields dramatic performance gain. So, this should be noted before CoreCLR team address this fundamental performance problem.

@JerryNixon CoreRT team answered that .NET/COM interop improvements are coming soon in the next release of .NET Core.

Hello! Thanks for your interest in .NET Native. We've received similar feedback regarding the overhead due to interop calls and have made significant progress in the upcoming release. In particular, the amount of allocations that happen on any given interop call has been dramatically reduced. One partner application (a medium sized XAML application) sees a 90% reduction in allocations for their key scenarios. Less garbage, fewer collects.

But before they officially deploy .NET Core tools performance issues of .NET/COM interop should be noted.

Thanks @Opiumtm for your help with this error. After throttling this event, it makes sense that we might find other opportunities to throttle events throughout the framework. Thanks again for reporting this. I am closing this issue. If you discover another instance or a recurrence of this one, open a new one.


Support for SHIFT + Scroll

Description
Many people use Shift + scroll but it doesn't work with this custom scrolling bar. These changes will allow to listen for keys (keydown and keyup events) and scroll horizontally while the shift button is held down.
This however comes with a downside: If a use is holding shift and click on another window, the browser will still think shift is held down (because keyup is never triggered), and it will horizontally scroll even when shift is not held down. I don't think this will often happen, and all the user will have to do is hold shift again and release it, to reset it.
Types of changes

[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)

Does shift + wheel always invert the scrolling direction? I don't have a mouse to test this, but the direction doesn't seem to change when scrolling with the trackpad.

This however comes with a downside: If a use is holding shift and click on another window, the browser will still think shift is held down (because keyup is never triggered), and it will horizontally scroll even when shift is not held down.

This can be fixed by attaching blur event listener to the window object:
addEvent(window, 'blur keyup', () => {
  // do something...
})

It appears we already had some discussion here: #63
If shift + wheel does not always trigger horizontal scrolling, I think this feature should not be added to the core codebase which tries to follow the native behaviors. Instead, I'd suggest implementing this feature as a third-party plugin.

I see! I personally did it for a personal project so I decided to share, since I saw some people asking for it. It's not perfect by any means, but might do for some people. The blur event is indeed a good idea, but I suspect if a user starts holding shift before clicking somewhere in the page, it won't get picked up, so it's kinda one way or another, but it does sound better with the blur event. Well I guess you can think about it, if not just close it, no worries at all , thank you for your work by the way 😊

Actually, I'm thinking about maintaining a list of widely-used plugins like the ModalPlugin, AnchorPlugin, HorizontalScrollPlugin, etc. It would be great if you could create a plugin for this feature and share it in the discussion 🤗 !

Actually, I'm thinking about maintaining a list of widely-used plugins like the ModalPlugin, AnchorPlugin, HorizontalScrollPlugin, etc. It would be great if you could create a plugin for this feature and share it in the discussion 🤗 !

I'd love to but I never made plugins in TypeScript/Node. Do you happen to have a tutorial/guide? I am relatively new to Typescript and Node libraries etc 😇

You can find the documentation here. TypeScript/Node is not required, you can use the vanilla JavaScript and — if I'm right — implement something like the following:
class YourPlugin extends ScrollbarPlugin {
  static pluginName = 'yourPlugin'; // <= don't actually like this but you have to do it now 😞

  transformDelta(delta, fromEvent) {
    // we can use the `evt.shiftKey` property to tell if the shift key is pressed
    if (/wheel/.test(fromEvent.type) && fromEvent.shiftKey) {
        return {
          x: delta.y,
          y: delta.x,
        };
    }

    return delta;
  }
}

Hello my friend, sorry for the delay, just finished it up! If you want take look at Discussion and see if it needs any editing or something 😊

I think we can close this PR now. Many thanks!


ExternalBotHandler: Support adding reactions to message.

Sometimes, it makes sense to have a bot that reacts to a particular message instead of sending a complete message that clutters the thread. To support such bots, we should add a simple interface like bot_handler.send_reply that people can call: bot_handler.react('thumbs_up').
This change also needs to be made to EmbeddedBotHandler in https://github.com/zulip/zulip/blob/master/zerver/lib/bot_lib.py#L61 .

Hi can I have a go at this issue?

Yes, you can!
On Tue, Mar 31, 2020, 8:06 PM Micky C<EMAIL_ADDRESS>wrote:

Hi can I have a go at this issue?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/zulip/python-zulip-api/issues/566#issuecomment-606667729,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AB5JHVVJ7RH6NSOVKX7KZGLRKH5YTANCNFSM4LXB5FNQ
.

@zulipbot claim

PR #593

@zulipbot claim

@BhaskarJoshi-01 I'm sorry but it looks like we have a PR that fixed this issue. If you want to work on an issue but cannot decide on another, just leave a message on chat.zulip.org on the stream #integrations. :)


Is vespa useful in a autocomplete scenario ?

Hi,
I am not sure github issues is the right place to ask so you might want to tag "question" or something but very curious.
Anyway, before starting testing i would like some insights on a autocomplete scenario.
Due to the disk index data structure, instead of memory (only attribute) is it worth even trying to use vespa for a autocomplete solution ? Or does some results gets into the page cache or something so it is still useful ?
As far as i understand exact and ngram/prefix index mappings are available right now. Can you please show how ngram is applied to a field as i think this is not by default with the index statement in the .sd file ?
The docs talks about the indexing script and the mapping of the fields but not sure how this applies.
A "good" suggestions will require more than just the contents of the term dictionary, would it be possible to either configure the rank or the GROUP BY to only return n results of each attribute (for example category when searching for "clothes" i get n results under man/women/children category attribute)
Edit-i read about the streaming search
http://docs.vespa.ai/documentation/streaming-search.html
Which might be useful. But how does one add the groupname/number value to i can query it ?
I always get "Streaming search needs one and only one of these query parameters to be set: streaming.userid, streaming.groupname, streaming.selection"
http://docs.vespa.ai/documentation/documents.html
tried just add it to the .sd file
id:::<key/value-pairs>:i.e
id:music:music:g=mysongs
but it get parsed wrong.
Thanks!
I really enjoyed reading the docs though and looking to try vespa.

Hi, there's also https://stackoverflow.com/tags/vespa which mat be better for general questions.
Disk index caching: Yes, disk indexes get cached in memory - all available memory will be used for that. It's not unusual to get average response times of about 10 ms.
N-gram: Add "match: gram" to the field - that's all (see http://docs.vespa.ai/documentation/reference/search-definitions-reference.html#match).
Prefix: Add * to the end of the term in the query ("foo*"), or turn it on for all queries by adding "match: prefix" to the field.
Diversity/grouping: Yes, you can use grouping to get n result of each unique attribute value (e.g each category):
/search/?yql=select (…) | all(group(category) each(max(n) each(output(summary()))));
See http://docs.vespa.ai/documentation/reference/grouping-syntax.html#examples
Querying groups with streaming search:
Either add to the query http request &streaming.groupname=yourgroup or (to query multiple groups) &streaming.selection=id.group=="yourgroup1" AND id.group=="yourgroup2"
(where of course the parameter value (the string after "streaming.selection=") must be HTTP-encoded).
Note that streaming search is only useful if your data is statically divided into small groups (e.g users), and in any query you only want to search one or a few of these groups. One use case for this is actually suggest/autocomplete with personal data - there is one very large application using Vespa for that.

Cool! Tried various, works great!
Will use SO for questions in the future.
Many thanks for the answer and the cool project!


chrome.permissions is not available in content scripts

Hi it seems the chrome.permissions.onAdded is added lately in the api. However the chrome.permissions variable is not supported in the content script and it prevents us from using chrome.permissions in content script.
We should add a check there before we add that api

Fixed!


Problematic version of setuptools.

Certain circumstances cause to fail with following error:
ImportError: The 'packaging' package is required; normally this is bundled with this package so if you get this warning, consult the packager of your distribution.
In openslides/utils/plugins.py the statement 'from pkg_resources import iter_entry_points' caused this error with more recent versions of setuptools. It is the same with the latest version 20.6.7
At the moment we are using setuptools < 20 which brings up a version 19.7.
It seems to be that all versions later than 19.2 are broken.
The only solution at the moment would be to pin the version to 19.2 in requirements.txt

@frauenknecht Please prepare a pull request for requirements_production.txt and test that is works for your mac os portable.

The setuptools guys wrote that only https://github.com/pypa/setuptools/issues/229 was done between 19.2 and 19.3. They are discussing about the same error message and seem to have a solution. Can you check this please?

OK, the setuptools guys got similar weird experiences. I have a python 3.5 virtual env. No py2 libs. Setuptools ist installed as a wheel; no eggs! I can do a  'python -c "from pkg_resources import iter_entry_points"' with any version of setuptools. No errors at all. But in the portable app the ImportError occurs with all versions 19.3 onward.
I still not get the point what my problem really is. But it is clear that the code line
'from pkg_resources.extern import packaging' in pkg_resources.init.py caused the ImportError. This line was introduced in version 19.3. And it is also clear that the enviroment py2app builds is for some reason not suitable for setuptools versions greater than 19.2
I'm still investigating...

According to my previous post, there is an obvious solution. Just make the packaging package an explicit dependency in py2app and everything works like a charme.
Lessons learned: In Versions 19.3 and later setuptools expects libs such packaging as a extern not a vendor lib. (The setuptools guys were talking about that in thier thread). I have no idea what is it good for, but this is exactly the change in the code.
This means: Bug fixed!

Great. So I close this issue...


pure golang based db

I think that integration of a pure golang DB and Indexer would be very nice.
Bleve allows ALL content to be indexed fully and then easily found in the DB when needed.
Its very nice for a CMS, because you can find everything.
It could also be linked to Modules too.
Bleve:
https://github.com/blevesearch/bleve/tree/master/index/store/boltdb
http://www.blevesearch.com/
BoltDB:
https://github.com/boltdb/bolt
Video tour of all this:
https://www.youtube.com/watch?v=OynPw4aOlV0
Jump to 6 minutes to  get into the stuff fast... :)
Bolt DB isa KV store that is 100% golang and runs on Windows too.
Bleve is built on top of BoltDB.
So the idea is to put your data into BoltDB, and also put all the query meta data 7 indexing in Bleve.
When doing any type of search (in the web ui) your hitting the Bleve system, which returns documentID's. A bit liek google returns web page Urls.
Then the documents can be called for fro the BoltDB KV store.
BoltDB is not of course like a SQL DB, and its takes soem getting used to, but once you have a full query engine like Bleve, you tend to not need a full SQL DB.
Its more like how a CQRS Architecture works.
Anyway, please consider this. It would be a great marry up with your CMS.
thanks in advance, and happy to discuss this further if needed. I am gmt +1 Berlin

I agree boltdb would be a great addition, and would get rid of lots of issues with bootstrapping (the main issues people seem to have getting started are related to database setup). I'll definitely be looking into this and thanks for the pointers.
The only issues would be around relations and use of sql, but this would also be an interesting exercise - to either support boltdb in query, or have an example which doesn't use query but uses a simpler storage model instead. For a basic CMS the relations could be stored in a different way no doubt.
In principle though I think this would be really interesting to add and would welcome contributions on it.

there is an ORM for boltDB called Storm.
Its still a bit rough, but they are working on the query engine now. i am also working on it.
also with boltDB if you use atoms, then you can sync data Master to Master, by iintegrating Raft.
Consul, as i guess you know is built this way.
food for thought as they say. This is part of my attraction to a KV store. You can do some things with it that are hard with a sql db

I think what I'm going to look at for this is the ql library, because it is pure go, and supports the sql driver interface, so it could be more easily switched out for a more performant relational database later on with (hopefully) no code changes, and an easy migration of data.
It now looks mature enough for production use.


Remove upload and cleanup

As a solution to #14, and inline with the Unix philosophy of "do one thing well", I propose that we remove both the upload and cleanup functionality.

This is adding other changes, as well, so I'm not sure what specifically this PR is actually targeting. I'm doing a partial rewrite of this (probably today), so I'll consider some of this at that time.


Meet MDC Frameworks Integration criteria

Hey, great adapter for mdc, does it meet the MDC criteria?
If so, please make a pull request to their repo.

@MishUshakov
Thanks!
Yes I believe it meets the MDC criteria.
I have followed the advanced aproach while implementing the adapters.
I'm not sure what you want me to do a pull request for ? can you elaborate ?

Since the repository is very good and it looks like it meets criteria, you can make pull request to MDC and they will publish link to repo on their website and GitHub, so more people can discover the repo and collaborate!

ok, I'll do that. I still have some quality issue I want to get resolve first.

https://github.com/material-components/material-components-web/pull/1552

Not in the subject: Please add a link to your repository in Awesome Vue.js. I found your repository absolutely randomly. While I was starting to write my adapter for mdc.

@Bobarev
Ok I'll do that


NavBar vs CommandBar

Are there guidelines for when to use NavBar vs CommandBar?

I've flagged this as "needs-design" so that we can ask the designers for guidance. The two components are very similar, so we should be more clear in our documentation when to use each, and maybe change the example content to make this more clear.

Thanks for looking into this. I think I understand the current difference between them - in Navigation Bar the item that is clicked on is selected (by being underlined) - thus it is useful for navigation, but in Command Bar, the selection does not happen.
The samples are misleading: Navigation Bar sample has an "Upload" button, which get's selected when clicked upon, which does not seem to make sense, and Command Bar has a Categories drop-down, which looks like a navigational button.
It seems to me that these two components should be combined into one and there should be an option to create a navigation element, which would be selected or un-selected when clicked on, or a command element, which would not be selected.
In additions, the design guidelines (https://msdn.microsoft.com/EN-US/library/office/mt484319.aspx) only mention a Nav Bar.

They way I interpret the controls -- the command bar is used to invoke actions on the "current" or "selected" item. As such, I assume I need to provide an href or client script to be invoked when the command is clicked.
I used an href in a project. Doing so added an underline on the link text, so I added text-decoration:none to the ms-CommandBarItem--link class.

Confirmed with design: these are two distinct components but we need to improve our documentation so that the reasons for each are clear. We'll update the samples so that CommandBar clearly just has commands in it, and NavBar is for navigation.

Apologies for the lack of updates here. In Fabric 3.0 we've decided to remove the NavBar entirely, and have the CommandBar support both typical command buttons and navigation-styled buttons. See these examples:

That's a great idea. Thanks!


Weaponsmiths defending blade despawns on location change

Whenever we change location, my defending blade despawns.

I need way more context than that. Mod version? single or multiplayer? save file?

Multiplayer, <IP_ADDRESS>

BUG_SAVE.zip