Error while doing inference on binarized model.

Hi authors,
I have trained a weight binarized model successfully and I can do inference on it before doing model binarizing. But while I convert the model to binarized format which has a much smaller size, an error occurs. Can you help me? The log shows below(in gpu mode):
Traceback (most recent call last):
  File "benchmark.py", line 55, in <module>
    model.forward(db, is_train=False)
  File "/root/codebase/BMXNet/python/mxnet/module/module.py", line 609, in forward
    self._exec_group.forward(data_batch, is_train)
  File "/root/codebase/BMXNet/python/mxnet/module/executor_group.py", line 416, in forward
    exec_.forward(is_train=is_train)
  File "/root/codebase/BMXNet/python/mxnet/executor.py", line 150, in forward
    ctypes.c_int(int(is_train))))
  File "/root/codebase/BMXNet/python/mxnet/base.py", line 146, in check_call
    raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: [21:14:12] /root/codebase/BMXNet/include/mxnet/./tensor_blob.h:217: Check failed: mshadow::DataType<DType>::kFlag == type_flag_ TBlob.get_with_shape: data type do not match specified type.Expected: 1 v.s. given 0

And in CPU mode:
Traceback (most recent call last):
  File "benchmark.py", line 55, in <module>
    model.forward(db, is_train=False)
  File "/root/codebase/BMXNet/python/mxnet/module/module.py", line 609, in forward
    self._exec_group.forward(data_batch, is_train)
  File "/root/codebase/BMXNet/python/mxnet/module/executor_group.py", line 416, in forward
    exec_.forward(is_train=is_train)
  File "/root/codebase/BMXNet/python/mxnet/executor.py", line 150, in forward
    ctypes.c_int(int(is_train))))
  File "/root/codebase/BMXNet/python/mxnet/base.py", line 146, in check_call
    raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: [21:15:01] /root/codebase/BMXNet/mshadow/mshadow/./././dot_engine-inl.h:763: Check failed: dst.size(0) == sleft[0] && dst.size(1) == sright[1] && sleft[1] == sright[0] dot-gemm: matrix shape mismatch

enum TypeFlag {
  kFloat32 = 0,
  kFloat64 = 1,
  kFloat16 = 2,
  kUint8 = 3,
  kInt32 = 4,
  kInt8  = 5,
  kInt64 = 6,
};

It seems that I give the kFloat32 data type whie the model wants kFloat64, why?

After use uint32 as binary word type, error msg of GPU mode become the same with the one under CPU mode, still can not work:
Traceback (most recent call last):
  File "benchmark.py", line 55, in <module>
    model.forward(db, is_train=False)
  File "/root/codebase/BMXNet/python/mxnet/module/module.py", line 609, in forward
    self._exec_group.forward(data_batch, is_train)
  File "/root/codebase/BMXNet/python/mxnet/module/executor_group.py", line 416, in forward
    exec_.forward(is_train=is_train)
  File "/root/codebase/BMXNet/python/mxnet/executor.py", line 150, in forward
    ctypes.c_int(int(is_train))))
  File "/root/codebase/BMXNet/python/mxnet/base.py", line 146, in check_call
    raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: [21:44:46] /root/codebase/BMXNet/mshadow/mshadow/./././dot_engine-inl.h:763: Check failed: dst.size(0) == sleft[0] && dst.size(1) == sright[1] && sleft[1] == sright[0] dot-gemm: matrix shape mismatch

Hi,
the binarized model (after conversion) is only appropriate for CPU mode so that one can take advantages of XNOR and popcount CPU-instructions for inference.
BMXNet supports using CUDA or cuDNN for training a binary model. but doesn't support binary operations in GPU-mode. So one should not run binarized model in GPU mode.
From your error log under CPU-mode, the issue was from "dot_engine-inl.h" which indicates that you are not going to call the xnor-based gemm kernel, but the standard dot engine, this is already wrong.
There are two points you might want to concern:

only run converted model in CPU-mode. After conversion check the model size, if you are using the q_conv or q_fc layer, the converted model size should be much smaller than its full precision version.
pls make sure that you are using the converted model and also the generated definition .json file (both start with "binarized_" ).  If not there will be a mismatch problem. The conversion process is actually the concatenation of weights in q_* layers, so the layer definition is changed accordingly.

I found the problem:  QConvolution works well while QConvolution_v1 can not.
By the way: is it possible to accelerate QConvolution on nvidia GPU?

something more:
QConvolution_v1 can make my network converging(an hourglass architecture) while QConvolution can not. Is there any difference?
But QConvolution_v1 is much slower than QConvolution, even slower than fp32 implementation.
(both with act_bit=1, weight_bit=1 setting)

Hi,
We have tested the XNOR+popcnt in CUDA on NVidia GPU at the beginning of
this project.
Unfortunately, without specific optimization, it is not able to outperform
cublas in terms of processing speed, and much slower than cuDNN.
We could try to optimize the cuda implementation but since it still remains
a software level optimization, will be hard to compare to cuDNN which is
directly optimized somehow on hardware.
I think it will definitely make sense to have a hardware level optimized
binary-gemm operator on GPU, but since this is not our strength, so will be
much better and more efficient to encourage some GPU experts to do this.
First of all, both QConv_V1 and QConv layers are based on the corresponding
MXNet layers.
According to QConv_v1, this is the old version of Conv layer in MXNet, the
MXNet authors re-implemented some important functions such as "im2col"
intended to get some speedup in the new version (in fact they use the
implementation from Caffe :-)).
But there also produces some strange effects, especially in training a
binary model. (We are working on those problems and will present in the new
tech report.)
After this upgrade, we also adapted it in BMXNet, and now Q_Convolution
layer can take advantages of cuDNN, but not the _V1 version.
If you have the problem with Q_Convolution layer during training, I would
suggest:

use Nadam optimizer (adam works badly after this upgrade, sgd always
works but have to manually design your lr schedule)
use lower initial learning rate e.g. 0.0001
fine-tuning from your _V1 model. This is possible since the weights are
stored in the same manner.

hope this could help you a little bit.
Best
HJ
2018-03-28 9:38 GMT+02:00 Jia Guo<EMAIL_ADDRESS>
something more:
QConvolution_v1 can make my network converging(an hourglass architecture)
while QConvolution can not. Is there any difference?
But QConvolution_v1 is much slower than QConvolution, even slower than
fp32 implementation.
(both with act_bit=1, weight_bit=1 setting)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/hpi-xnor/BMXNet/issues/40#issuecomment-376791367, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AHsYmBNBpCg5Zy0uBhWrKUGoylkh3ILWks5tiz35gaJpZM4S6InQ
.

@yanghaojin Sorry I deleted my reply as I found there're something wrong. I will report my experiments result in following days.

Hi, @yanghaojin . Sorry to disturb you again.  Here’s some preliminary test results.

QConvolution is very hard to converge but QConvolution_v1 has no problem. (watching on the loss value from initial hundreds of iterations). I use RMSProp with a small learning rate.
QConvolution_v1 is very slow while doing inference compare to QConvolution on CPU.
I can not do inference(on CPU) while act_bit=32, the above error occur. I think this is a very critical bug.

ACT_BIT=32
bit = 1
act1 = mx.sym.QActivation(data=bn1, act_bit=ACT_BIT, name=name + '_relu1', backward_only=True)
conv1 = mx.sym.QConvolution(data=act1, num_filter=int(num_filter*0.5), kernel=(1,1), stride=(1,1), pad=(0,0), no_bias=True, workspace=workspace, name=name + '_conv1', act_bit=ACT_BIT, weight_bit=bit)

No problem if ACT_BIT=1.
Now I use QConvolution_v1 to train the model but modify its name to QConvolution via model-converter tool to do inference. It's working without any error but I haven't checked the results.

hi,
one tip for the inference, if you have a 64bits CPU, could also try to use uint64 as bits container which will give about 2x speedup on Conv_V1, and I would also suggest to enable OpenMP if available. So you don't need to retrain the model, just compile your BMXNet with "Binary_word_type=uint64", and convert the model again.
To the point 3, I think it is a "not implemented" issue, if the activation is full precision and perform dot production with binary weights, then we need to convert the concatenated binary weights back to the float points version, this is not implemented, could be done in the future work.

I see, so now the memory efficient weight-binarized model is not supported. Thanks for your reply!
I also confirmed that Nadam optimizer is better.

the binarized (converted) model is only supported by using act_bit = 1 and weight_bit=1, this case, the allocated memory for weights is much smaller than the full precision one, and the forward pass in cpu-mode, the cpu instruction xnor and popcount will be applied for GEMM computation. Unfortunately, for your case act_bit = 32 and weight_bit=1, there is still no appropriate implementation.

Yes I understood. Thank you again!

Hi, what's your plan to release the next version of BMXNet?

Hi,
so there are still so many research questions in the BNN without a clear answer, e.g., the issue raised by Christopher Barber: why you use the binary weights for the update, the XNOR-net and DeReFaNet all use its full precision weights for the update. That way should be more reasonable. Well, from the first feeling probably yes, but we still need do more experiments to figure out it.  Should we use full precision or binary weights for the backpropagation? why is a certain choice better? The meaning of the scaling factor for BMXNet? The meaning of skip connections for BNN?
Well, the next step or what we are doing is not only trying to achieve more accurate result using BNN but also trying to understand its behavior in training, e.g., get some insights from the visualization.
We plan to release more configuration possibilities that let you decide which one to use, e.g. using binary weight or full precision one for the update process.
We will add the new features helping us to understand the BNN model, by which we are able to visualize the neurons learned from a certain layer and visualize the gradient intensity map from the backpropagation. We believe that getting more insights is especially necessary for BNN.
Moreover, we will release more trained model and probably also new network architecture for BNN.


deleteRope argument

https://nativedb.dotindustries.dev/natives/0x52B4829281364649
https://alloc8or.re/gta5/nativedb/?n=0x52B4829281364649

Thx for your contribution!


Checkpoint file gpu4pysct

Dear developers,
Is there a way to generate checkpoint file in a gpu4pyscf run? The usual command in pyscf mf.chkfile="file.chk" does not give an output.
Thanks.

The checkpoint file is supported with PR https://github.com/pyscf/gpu4pyscf/pull/203
The feature is available since v1.0.2


How to log values converted by ImmutableType?

It seems the way ImmutableType#nullSafeSet  is implemented breaks the logic of enabling logs to see the value of columns in BasicBinder. Currently if one wants to see them she needs to enable trace logs for org.hibernate.type.descriptor.sql.BasicBinder (and org.hibernate.type.descriptor.sql.BasicExtractor for extracted data). But with ImmutableTypes it won't work since it doesn't go through BasicBinder.

Is this by design or just something missing feature?
What's the best way to implemented this (as a PR to this library)?
If not, is there any workaround to see the values in logs somewhere somehow?

Not all Hibernate Core types use the Binder. For instance, EnumType is implemented as a UserType, just like the ImmutableType in this project.
The ImmutableType cannot use the Binder contract since it lacks the javaDescriptor and sqlDescriptor contract.
So, one workaround would be to make the ImmutableType class use an org.hibernate.type.descriptor.sql.ImmutableType logger, but that's a hacky solution.
A much better approach is to use a better logging framework, like datasource-proxy, which works even if you combine multiple frameworks. Check out this article for more details.


Fix file extension typo in .gitattributes

Description
".tff" which never appears in the repo is surely a typo for ".ttf" which is used multiple times in the repo.

Periodic rebase on master. No changes made.


Split LocalProvider functionality

The LocalProvider was originally designed for launching Parsl workers on your local machine. However the fact that it follows the provider interface, taking any channel (added in #673), led to it being used for running on remote nodes using SSHChannels. The LocalProvider doesn't work very well in this configuration. To handle both use cases (local, ad-hoc remote) we need two separate solutions :

LocalProvider for doing local launches which will not allow remote channels
A new provider that will handle multiple remote nodes with no scheduler (#941)

Related to #941

Addressed by the new AdHocProvider


Refactor util and helper classes to their own packages

Remove the generic AsyncSample and SyncSample.
Move the request options classes to /util package -> right now we have classes being used as input/output response types inside /models or /implementation. All other helper classes are under util. Let me know if this folder structure should be modified.
Move the helper classes to their respective packages for samples.

/check-enforcer evaluate


[5.0][Sema] Add defensive guard for implicit use of self in closure check

(Cherry-pick of #22908 for swift-5.0-brach)
(more info to come)
rdar://problem/47895109

@swift-ci Please test

@swift-ci Please nominate


VSCode freezes when opening   7.4MB file.

There is something specifically in this file that is causing the freeze as it doesn't seem to happen with similar sized files or without extensions. I'm guessing that it's the Lua linting.
File listed below.

Reproduces without extensions: No

Does it occur when you disable the Lua linting extension and keeping all other extensions enabled?

It's kind of confusing at this point. Here's what I mean...

Run
Config
Result

A
All Extensions On
Freeze

B
No Extensions On
Stable

C
Only Lua Off
Stable

C
Only Lua Off
Freeze

D
All Extensions On
Stable

At first I thought disabling the Lua extension fixed it but then it froze once with it off still. Also, it wasn't working at all with all of the extensions on but then it just did. I will keep trying with all extensions off and see if it ever freezes.

Does it occur just by opening the file or do you always, e.g., type something before it does?


"Re-using the main() function as the main HPX entry point" doesn't work

Expected Behavior
It is expected to work (as per documentation)
Actual Behavior
Runtime is not available, reporting error locally.
...

assertion 'get_runtime_ptr() != nullptr' failed: HPX(assertion_failure)

Steps to Reproduce the Problem
Build the attached example source.
The macro NOT_WORKING_VARIANT controls which source code variant to use:

with -DNOT_WORKING_VARIANT the non-working variant of the code is used, with main as HPX entry point
without the macro, the working one is used, with manually defined hpx_main entry point.

Specifications

HPX Version: 1.3.0
Mac OS X 10.14.6
Apple LLVM version 10.0.1 (clang-1<IP_ADDRESS>) Target: x86_64-apple-darwin18.7.0

main.txt

@albestro how are you building the test executable?

With a basic CMakeLists.txt in a bigger project, with something like
find_package(HPX)
...
add_executable(hpx_not_working main.cpp)
target_include_directories(hpx_not_working PRIVATE ${HPX_INCLUDE_DIRS})
target_link_libraries(hpx_not_working PRIVATE ${HPX_LIBRARIES})

Here the full HPX stacktrace
Runtime is not available, reporting error locally.
{stack-trace}: 5 frames:
0x1050bead1     : hpx::util::stack_trace::trace(void**, unsigned long) + 0x21 in /Users/ialberto/workspace/libraries/all/hpx-1.3.0+debug/lib/libhpxd.1.dylib
0x104412894     : hpx::util::backtrace::backtrace(unsigned long) + 0x94 in /Users/ialberto/workspace/libraries/all/hpx-1.3.0+debug/lib/libhpxd.1.dylib
0x1044127cd     : hpx::util::backtrace::backtrace(unsigned long) + 0x1d in /Users/ialberto/workspace/libraries/all/hpx-1.3.0+debug/lib/libhpxd.1.dylib
0x10440a55b     : hpx::util::trace_on_new_stack(unsigned long) + 0x2b in /Users/ialberto/workspace/libraries/all/hpx-1.3.0+debug/lib/libhpxd.1.dylib
0x104401a5c     : hpx::detail::backtrace(unsigned long) + 0x1c in /Users/ialberto/workspace/libraries/all/hpx-1.3.0+debug/lib/libhpxd.1.dylib
{env}: 72 entries:
  Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.7i8PDMNxuH/Render
  BASH_ENV=/usr/local/Cellar/lmod/8.2.3/init/bash
  CMAKE_PREFIX_PATH=/Users/ialberto/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/mpich-3.3.1-obcjhvhbzojx2y7joisnskq7vjeinaiq
  COLORFGBG=15;0
  COLORTERM=truecolor
  CPATH=/opt/intel/compilers_and_libraries_2019.1.144/mac/mkl/include:/Users/ialberto/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/mpich-3.3.1-obcjhvhbzojx2y7joisnskq7vjeinaiq/include
  CUSTOM_LIBS=/usr/local/custom_libs
  DISPLAY=/private/tmp/com.apple.launchd.uDffDx2yw0/org.macosforge.xquartz:0
  DK_NODE=/Users/ialberto/spack/share/spack/dotkit/darwin-mojave-x86_64
  DYLD_FALLBACK_LIBRARY_PATH=/Users/ialberto/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/mpich-3.3.1-obcjhvhbzojx2y7joisnskq7vjeinaiq/lib
  DYLD_LIBRARY_PATH=/opt/intel/compilers_and_libraries_2019.1.144/mac/compiler/lib:/opt/intel/compilers_and_libraries_2019.1.144/mac/compiler/lib/intel64:/opt/intel/compilers_and_libraries_2019.1.144/mac/tbb/lib:/opt/intel/compilers_and_libraries_2019.1.144/mac/compiler/lib:/opt/intel/compilers_and_libraries_2019.1.144/mac/mkl/lib:/Users/ialberto/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/mpich-3.3.1-obcjhvhbzojx2y7joisnskq7vjeinaiq/lib
  HOME=/Users/ialberto
  INTEL_LICENSE_FILE=/opt/intel/compilers_and_libraries_2019.1.144/mac/licenses:/opt/intel/licenses:/Users/ialberto/intel/licenses:/Users/Shared/Library/Application Support/Intel/Licenses
  ITERM_PROFILE=Default
  ITERM_SESSION_ID=w2t0p0:199CB2C0-918B-45D1-89C4-121996540924
  LC_CTYPE=UTF-8
  LC_TERMINAL=iTerm2
  LC_TERMINAL_VERSION=3.3.7
  LESS=-R
  LIBRARY_PATH=/opt/intel/compilers_and_libraries_2019.1.144/mac/tbb/lib:/opt/intel/compilers_and_libraries_2019.1.144/mac/compiler/lib:/opt/intel/compilers_and_libraries_2019.1.144/mac/mkl/lib:/Users/ialberto/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/mpich-3.3.1-obcjhvhbzojx2y7joisnskq7vjeinaiq/lib
  LMOD_CMD=/usr/local/Cellar/lmod/8.2.3/libexec/lmod
  LMOD_DIR=/usr/local/Cellar/lmod/8.2.3/libexec
  LMOD_PKG=/usr/local/Cellar/lmod/8.2.3
  LMOD_ROOT=/usr/local/Cellar/lmod/8.2.3/..
  LMOD_SETTARG_FULL_SUPPORT=no
  LMOD_VERSION=8.2.3
  LMOD_sys=Darwin
  LOADEDMODULES=mpich-3.3.1-clang-10.0.1-apple-obcjhvh
  LOGNAME=ialberto
  LSCOLORS=Gxfxcxdxbxegedabagacad
  MANPATH=/Users/ialberto/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/mpich-3.3.1-obcjhvhbzojx2y7joisnskq7vjeinaiq/share/man:/usr/local/Cellar/lmod/8.2.3/share/man::
  MKLROOT=/opt/intel/compilers_and_libraries_2019.1.144/mac/mkl
  MODULEPATH=/Users/ialberto/spack/share/spack/modules/darwin-mojave-x86_64:/usr/local/Cellar/lmod/8.2.3/modulefiles/Darwin:/usr/local/Cellar/lmod/8.2.3/modulefiles/Core
  MODULEPATH_ROOT=/usr/local/Cellar/lmod/8.2.3/modulefiles
  MODULESHOME=/usr/local/Cellar/lmod/8.2.3
  NLSPATH=/opt/intel/compilers_and_libraries_2019.1.144/mac/compiler/lib/locale/en_US/%N:/opt/intel/compilers_and_libraries_2019.1.144/mac/mkl/lib/locale/%l_%t/%N
  OLDPWD=/Users/ialberto/workspace/repos/hpx_linalg/build/test
  PAGER=less
  PATH=/opt/intel/compilers_and_libraries_2019.1.144/mac/bin/intel64:/Users/ialberto/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/mpich-3.3.1-obcjhvhbzojx2y7joisnskq7vjeinaiq/bin:/Users/ialberto/spack/bin:/Users/ialberto/workspace/scripts:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/ialberto/workspace/checker-279/bin
  PKG_CONFIG_PATH=/opt/intel/compilers_and_libraries_2019.1.144/mac/mkl/bin/pkgconfig:/Users/ialberto/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/mpich-3.3.1-obcjhvhbzojx2y7joisnskq7vjeinaiq/lib/pkgconfig
  PWD=/Users/ialberto/workspace/repos/hpx_linalg/build/test
  SHELL=/usr/local/bin/zsh
  SHLVL=1
  SPACK_ROOT=/Users/ialberto/spack
  SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.ZD1roKlX2N/Listeners
  TERM=xterm-256color
  TERM_PROGRAM=iTerm.app
  TERM_PROGRAM_VERSION=3.3.7
  TERM_SESSION_ID=w2t0p0:199CB2C0-918B-45D1-89C4-121996540924
  TMPDIR=/var/folders/c9/v21gts9n7rs9cycnxcdzr__80000gn/T/
  USER=ialberto
  XPC_FLAGS=0x0
  XPC_SERVICE_NAME=0
  ZSH=/Users/ialberto/.oh-my-zsh
  _=/Users/ialberto/workspace/repos/hpx_linalg/build/test/./hpx_not_working
  _LMFILES_=/Users/ialberto/spack/share/spack/modules/darwin-mojave-x86_64/mpich-3.3.1-clang-10.0.1-apple-obcjhvh
  _ModuleTable001_=X01vZHVsZVRhYmxlXz17WyJNVHZlcnNpb24iXT0zLFsiY19yZWJ1aWxkVGltZSJdPWZhbHNlLFsiY19zaG9ydFRpbWUiXT1mYWxzZSxkZXB0aFQ9e30sZmFtaWx5PXt9LG1UPXtbIm1waWNoLTMuMy4xLWNsYW5nLTEwLjAuMS1hcHBsZS1vYmNqaHZoIl09e1siZm4iXT0iL1VzZXJzL2lhbGJlcnRvL3NwYWNrL3NoYXJlL3NwYWNrL21vZHVsZXMvZGFyd2luLW1vamF2ZS14ODZfNjQvbXBpY2gtMy4zLjEtY2xhbmctMTAuMC4xLWFwcGxlLW9iY2podmgiLFsiZnVsbE5hbWUiXT0ibXBpY2gtMy4zLjEtY2xhbmctMTAuMC4xLWFwcGxlLW9iY2podmgiLFsibG9hZE9yZGVyIl09MSxwcm9wVD17fSxbInN0YWNrRGVwdGgiXT0wLFsic3RhdHVzIl09ImFjdGl2ZSIsWyJ1c2VyTmFtZSJd
  _ModuleTable002_=PSJtcGljaC0zLjMuMS1jbGFuZy0xMC4wLjEtYXBwbGUtb2Jjamh2aCIsfSx9LG1wYXRoQT17Ii9Vc2Vycy9pYWxiZXJ0by9zcGFjay9zaGFyZS9zcGFjay9tb2R1bGVzL2Rhcndpbi1tb2phdmUteDg2XzY0IiwiL3Vzci9sb2NhbC9DZWxsYXIvbG1vZC84LjIuMy9tb2R1bGVmaWxlcy9EYXJ3aW4iLCIvdXNyL2xvY2FsL0NlbGxhci9sbW9kLzguMi4zL21vZHVsZWZpbGVzL0NvcmUiLH0sWyJzeXN0ZW1CYXNlTVBBVEgiXT0iL1VzZXJzL2lhbGJlcnRvL3NwYWNrL3NoYXJlL3NwYWNrL21vZHVsZXMvZGFyd2luLW1vamF2ZS14ODZfNjQ6L3Vzci9sb2NhbC9DZWxsYXIvbG1vZC84LjIuMy9tb2R1bGVmaWxlcy9EYXJ3aW46L3Vzci9sb2NhbC9DZWxsYXIvbG1vZC84LjIuMy9tb2R1
  _ModuleTable003_=bGVmaWxlcy9Db3JlIix9
  _ModuleTable_Sz_=3
  __CF_USER_TEXT_ENCODING=0x0:0:0
  __LMOD_REF_COUNT_CMAKE_PREFIX_PATH=/Users/ialberto/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/mpich-3.3.1-obcjhvhbzojx2y7joisnskq7vjeinaiq:1
  __LMOD_REF_COUNT_CPATH=/Users/ialberto/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/mpich-3.3.1-obcjhvhbzojx2y7joisnskq7vjeinaiq/include:1
  __LMOD_REF_COUNT_DYLD_FALLBACK_LIBRARY_PATH=/Users/ialberto/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/mpich-3.3.1-obcjhvhbzojx2y7joisnskq7vjeinaiq/lib:1
  __LMOD_REF_COUNT_DYLD_LIBRARY_PATH=/Users/ialberto/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/mpich-3.3.1-obcjhvhbzojx2y7joisnskq7vjeinaiq/lib:1
  __LMOD_REF_COUNT_LIBRARY_PATH=/Users/ialberto/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/mpich-3.3.1-obcjhvhbzojx2y7joisnskq7vjeinaiq/lib:1
  __LMOD_REF_COUNT_LOADEDMODULES=mpich-3.3.1-clang-10.0.1-apple-obcjhvh:1
  __LMOD_REF_COUNT_MANPATH=/Users/ialberto/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/mpich-3.3.1-obcjhvhbzojx2y7joisnskq7vjeinaiq/share/man:1;/usr/local/Cellar/lmod/8.2.3/share/man:1
  __LMOD_REF_COUNT_MODULEPATH=/Users/ialberto/spack/share/spack/modules/darwin-mojave-x86_64:2;/usr/local/Cellar/lmod/8.2.3/modulefiles/Darwin:1;/usr/local/Cellar/lmod/8.2.3/modulefiles/Core:1
  __LMOD_REF_COUNT_PATH=/Users/ialberto/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/mpich-3.3.1-obcjhvhbzojx2y7joisnskq7vjeinaiq/bin:1;/Users/ialberto/spack/bin:1;/Users/ialberto/workspace/scripts:1;/usr/local/bin:1;/usr/bin:1;/bin:1;/usr/sbin:1;/sbin:1;/opt/X11/bin:1;/Library/Frameworks/Mono.framework/Versions/Current/Commands:1;/Users/ialberto/workspace/checker-279/bin:1
  __LMOD_REF_COUNT_PKG_CONFIG_PATH=/Users/ialberto/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/mpich-3.3.1-obcjhvhbzojx2y7joisnskq7vjeinaiq/lib/pkgconfig:1
  __LMOD_REF_COUNT__LMFILES_=/Users/ialberto/spack/share/spack/modules/darwin-mojave-x86_64/mpich-3.3.1-clang-10.0.1-apple-obcjhvh:1
{locality-id}:<PHONE_NUMBER>
{process-id}: 73355
{function}: hpx::runtime &hpx::get_runtime()
{file}: /Users/ialberto/workspace/libraries/hpx-1.3.0/src/runtime.cpp
{line}: 851
{os-thread}: <unkown>
{thread-description}: <unknown>
{state}: not running
{auxinfo}:
{config}:
  HPX_WITH_AGAS_DUMP_REFCNT_ENTRIES=OFF
  HPX_WITH_APEX=OFF
  HPX_WITH_ATTACH_DEBUGGER_ON_TEST_FAILURE=OFF
  HPX_WITH_AUTOMATIC_SERIALIZATION_REGISTRATION=ON
  HPX_WITH_CXX14_RETURN_TYPE_DEDUCTION=TRUE
  HPX_WITH_DEPRECATION_WARNINGS=ON
  HPX_WITH_GENERIC_CONTEXT_COROUTINES=ON
  HPX_WITH_GOOGLE_PERFTOOLS=OFF
  HPX_WITH_HPXMP=OFF
  HPX_WITH_IO_POOL=ON
  HPX_WITH_ITTNOTIFY=OFF
  HPX_WITH_LOGGING=ON
  HPX_WITH_MORE_THAN_64_THREADS=OFF
  HPX_WITH_NETWORKING=OFF
  HPX_WITH_PAPI=OFF
  HPX_WITH_PARCELPORT_ACTION_COUNTERS=OFF
  HPX_WITH_PARCELPORT_LIBFABRIC=OFF
  HPX_WITH_PARCELPORT_MPI=OFF
  HPX_WITH_PARCELPORT_MPI_MULTITHREADED=OFF
  HPX_WITH_PARCELPORT_TCP=OFF
  HPX_WITH_PARCELPORT_VERBS=OFF
  HPX_WITH_PARCEL_PROFILING=OFF
  HPX_WITH_SANITIZERS=OFF
  HPX_WITH_SCHEDULER_LOCAL_STORAGE=OFF
  HPX_WITH_SPINLOCK_DEADLOCK_DETECTION=OFF
  HPX_WITH_STACKTRACES=ON
  HPX_WITH_SWAP_CONTEXT_EMULATION=OFF
  HPX_WITH_TESTS_DEBUG_LOG=OFF
  HPX_WITH_THREAD_BACKTRACE_ON_SUSPENSION=OFF
  HPX_WITH_THREAD_CREATION_AND_CLEANUP_RATES=OFF
  HPX_WITH_THREAD_CUMULATIVE_COUNTS=ON
  HPX_WITH_THREAD_DEBUG_INFO=OFF
  HPX_WITH_THREAD_DESCRIPTION_FULL=OFF
  HPX_WITH_THREAD_GUARD_PAGE=ON
  HPX_WITH_THREAD_IDLE_RATES=OFF
  HPX_WITH_THREAD_LOCAL_STORAGE=OFF
  HPX_WITH_THREAD_MANAGER_IDLE_BACKOFF=ON
  HPX_WITH_THREAD_QUEUE_WAITTIME=OFF
  HPX_WITH_THREAD_STACK_MMAP=ON
  HPX_WITH_THREAD_STEALING_COUNTS=OFF
  HPX_WITH_THREAD_TARGET_ADDRESS=OFF
  HPX_WITH_TIMER_POOL=ON
  HPX_WITH_TUPLE_RVALUE_SWAP=ON
  HPX_WITH_VALGRIND=OFF
  HPX_WITH_VERIFY_LOCKS=OFF
  HPX_WITH_VERIFY_LOCKS_BACKTRACE=OFF
  HPX_WITH_VERIFY_LOCKS_GLOBALLY=OFF

  HPX_PARCEL_MAX_CONNECTIONS=512
  HPX_PARCEL_MAX_CONNECTIONS_PER_LOCALITY=4
  HPX_AGAS_LOCAL_CACHE_SIZE=4096
  HPX_HAVE_MALLOC=system
  HPX_PREFIX (configured)=unknown
  HPX_PREFIX=unknown
{version}: V1.3.0 (AGAS: V3.0), Git: a943fd2c5d
{boost}: V1.70.0
{build-type}: debug
{date}: Oct 31 2019 16:07:09
{platform}: Mac OS
{compiler}: Clang version 10.0.1 (clang-1<IP_ADDRESS>)
{stdlib}: libc++ version 7000
{what}: assertion 'get_runtime_ptr() != nullptr' failed: HPX(assertion_failure)
[1]    73355 abort      ./hpx_not_working

And here an extract of what I get from the preprocessor
# 758 "/Users/ialberto/workspace/libraries/all/hpx-1.3.0+debug/include/hpx/hpx_init.hpp" 2
# 12 "/Users/ialberto/workspace/libraries/all/hpx-1.3.0+debug/include/hpx/hpx_main.hpp" 2

namespace hpx_start
{

                      extern bool include_libhpx_wrap;
                      bool include_libhpx_wrap = true;
}
# 18 "/Users/ialberto/workspace/repos/hpx_linalg/test/hpx_not_working/main.cpp" 2

int main(int argc, char* argv[])
{
  do_something_in_hpx();
  return 0;
}

I gave a quick look and I arrived at https://github.com/STEllAR-GROUP/hpx/blob/master/hpx/hpx_main.hpp so maybe it’s a build problem on my side about HPX_HAVE_STATIC_LINKING
I’ve just switched to the other method, but I think it can be helpful for others that may incur in the same problem.

@albestro so this is caused by -DHPX_WITH_STATIC_LINKING=On? Interesting! @NK-Nikunj: are you aware of this.

@msimberg and I chatted offline about this and we did a few tests. I give a quick report here.
In HPX 1.3.0 the required -Wl,-e,_initialize_main seems to be used just by hpx_setup_target and for pkg-config related stuff.
For this reason, if you use add_hpx_executable, that internally uses hpx_setup_target, everything works correctly.
The problem arise if you try setting up CMake by not using the helper functions, like I did, since the required flag seems to not be set neither by HPX_LIBRARIES nor HPX_LINK_LIBRARIES.

Additional note: I tested it on newest master (fd67ac0f86cb6a8b6c7692fed3e7498db28a1ba8) and everything works correctly both using add_hpx_executable or using target_link_libraries(... ${HPX_LIBRARIES} ${HPX_LINK_LIBRARIES}).

Just for the record, I think HPX_WITH_STATIC_LINKING was a red herring (especially because last time I tried it was more broken than this: #3970).

This looks interesting. I remember building with HPX_WITH_STATIC_LINKING=On and it worked just fine with it as well.

It seems like it has something to do with recent CMake changes. I'm pretty sure my method works for statics as well.

@NK-Nikunj don't worry :) static linking is broken in different ways but I think it's unrelated to this. I'm closing this now since it works on latest master. If someone really badly needs a patch release to fix this on macOS, let us know.

@NK-Nikunj
Any idea why I'm getting this error
ninja explain: test/unit/parallel/stdthread/stdthread_test is dirty
[1/1] : && /usr/bin/g++  -fPIC -march=native -mtune=native -ffast-math -std=c++17 -g  -rdynamic  -Wl,-e,_initialize_main test/unit/parallel/stdthread/CMakeFiles/stdthread_test.dir/stdthread_test.cpp.o  -o test/unit/parallel/stdthread/stdthread_test  -Wl,-rpath,/home/biddisco/apps/mpich/3.3.1/lib:/home/biddisco/build/dca/libs/googletest-1.8.0:/home/biddisco/build/hpx-debug/lib:/home/biddisco/apps/jemalloc/5.2.1/lib:/home/biddisco/apps/hwloc/2.1.0/lib:/home/biddisco/apps/cxx17/boost/1.69.0/lib /home/biddisco/apps/mpich/3.3.1/lib/libmpicxx.so /home/biddisco/apps/mpich/3.3.1/lib/libmpi.so libs/googletest-1.8.0/libgtest_main.so src/parallel/hpx/libparallel_hpx.a libs/googletest-1.8.0/libgtest.so -lpthread /home/biddisco/apps/mpich/3.3.1/lib/libmpicxx.so /home/biddisco/apps/mpich/3.3.1/lib/libmpi.so /home/biddisco/build/hpx-debug/lib/libhpx_wrapd.a /home/biddisco/build/hpx-debug/lib/libhpx_initd.a /home/biddisco/build/hpx-debug/lib/libhpxd.so.1.4.0 -latomic -ldl -lrt /usr/lib/x86_64-linux-gnu/libpthread.so /home/biddisco/apps/jemalloc/5.2.1/lib/libjemalloc.so /home/biddisco/apps/hwloc/2.1.0/lib/libhwloc.so /home/biddisco/apps/cxx17/boost/1.69.0/lib/libboost_program_options.so && :
/usr/bin/ld: warning: cannot find entry symbol _initialize_main; defaulting to<PHONE_NUMBER>03d100

@biddisco
Interesting! It is linking with hpx_wrapd.a and yet complaining that it can't find the symbol.

Let me have a look at it tomorrow. Maybe I'm getting something wrong somewhere.

I solved my problem so please ignore this question

it turned out to be the order of linking that was causing trouble. All fixed now.

Aah, I see! Glad it worked out.


Streamlit 1.23.1 breaking rerun on changes for pages

After upgrading to 1.23.1 of Streamlit, all of a sudden any pages do not capture changes when rerunning after saving.
In some cases it notifies that the file has changed, but rerunning the page does not reflect the updated report.
Simple replication:

install st_pages 0.4.1 and streamlit 1.22.0 for an app with 1 subpage
confirm that changing subpage (e.g. st.write) updates when changed
update to streamlit 1.23.1
the subpage now no longer will update

Not sure where this bug actually lies. But given a "normal" streamlit multipage app seems OK, is it something how st_pages registers the pages?

Could it have something to do with: https://github.com/streamlit/streamlit/commit/26f97dfb26e6eea557bb953d4fcf5e298e1a20d7

I've been digging around in some spare time and think it is because the Script cache has its own "local file watcher" which only registers the entry file, and then things in the pages directory.
When st_pages then adjusts the list of pages, this doesnt then update the script cache?
(not 100% sure this is it, but its my current hunch)
i.e. in runtime.py
       self._sources_watcher = LocalSourcesWatcher(self._main_script_path)
        self._sources_watcher.register_file_change_callback(
            lambda _: self._script_cache.clear()
        )

I'm trying to understand it all, but not sure if this needs to be a fix to streamlit to update the script cache when something changes, or if st_pages needs to fire some other event to get the update

I'm not sure it is the same root cause, but just in case: https://github.com/blackary/st_pages/issues/52


Issue with file opening in new version

Impossible to open files with dot '.' in their name, (ex. 'filename1.1 .blo')

To be precise, the opening dialog refuses to switch the file type from RAW to, for example, BLO, which makes opening the file impossible. The bug wasn't present in previous versions and only occurred after updating to the master branch today.

This should now be fixed as of 7dda088f9a5635c24a119f69af3f14767d1d8279 (ts rebuilt in dfbfcb23fd28346d886acacab79b89b0c560293d), can you re-test please?

Verified as fixed.


企业号摇一摇 API

http://qydev.weixin.qq.com/wiki/index.php?title=获取设备及用户信息

There were the following issues with your Pull Request

Commit: 197d834b6d35b2264e15a2cf414719a2e851c05a
Commits must be in the following format: %{type}(%{scope}): %{description}

Guidelines are available at https://github.com/jxtech/wechatpy/blob/master/CONTRIBUTING.md

This message was auto-generated by https://gitcop.com

Thanks.

@messense
%{type}(%{scope}): %{description} 其中的 type 和 scope 分别指什么？

@cloverstd https://gitcop.com/

the variables %{type}, %{scope} and %{description} can be used
any other characters will be interpreted literally. The subject
fix(user): ensure email is required
%{type}(%{scope}): %{description}
would match type: fix, scope: user, description: ensure email is required

@messense 👌，Thanks


Saving/email PDF to WordPress, it keeps saving/emailing a blank corrupt PDF (jsPDF & html2pdf)

I have based from my code from https://github.com/eKoopmans/html2pdf.js/issues/181 (odedta) comment and also tried the second users comment below theirs.
I have a script using html2pdf bundle. Which works well. It create a multi page PDF with images. The content of the PDF is data which is pulled from a WordPress category (using a wp Query) and results in 3-6 Posts being put into a PDF.
HTML for example:

 PDF tile

 Page 2 title

Some text

 Page 3 title

Some text

I have my Jquery at the bottom of the page
jQuery(function($) {
            window.onload = function() {
                let el = document.getElementById('PDFcontent');
                var title = $('.exhibitied-title').text();
                let opt = {
                    margin: 0.2,
                    filename: title + '.pdf',
                    image: {
                        type: 'jpeg',
                        quality: 0.99
                    },
                    html2canvas: {
                        scale: 2,
                        logging: true,
                        dpi: 192,
                        letterRendering: true,
                        /* useCORS: true*/
                    },
                    jsPDF: {
                        unit: 'mm',
                        format: 'a4',
                        orientation: 'portrait'
                    }
                };
                html2pdf().set(opt).from(el).toPdf().output('datauristring').save().then(function(pdfAsString) {
                    title = $('.exhibitied-title').text();
                    filetitle = title + '.pdf';
                    let data = {
                        'action': 'send_email_with_pdf',
                        'fileDataURI': pdfAsString,
                        'filetitle': filetitle,
                    }
                    $.post(myAjax.ajaxurl, data, function(response) {
                        console.log(response);
                    });
                });
            }
        });

.save works perfectly, the PDF is formatted exactly how I want it.
But when it comes to saving or emailing the PDF I am having problems. The email is does send and a PDF is created. However the pdf in the email is 115bytes and just says "Failed to load PDF document." when you try opening it, and the pdf which is saved in my WP uploads folder is 0 bytes and also "Failed to load PDF document." shows.
Inside my functions.php I have (for those who do not use Wordpress, this would be the equivalent to a upload.php page)
function send_email_with_pdf() {
    $pdfdoc     = $_POST['fileDataURI'];
    $b64file        = trim( str_replace( 'data:application/pdf;base64,', '', $pdfdoc ) );
    $b64file        = str_replace( ' ', '+', $b64file );
    $decoded_pdf    = base64_decode( $b64file );
    //file_put_contents( $attachment, $decodPdf );

     $upload_dir = wp_upload_dir();
     $image_data = file_get_contents( $decoded_pdf );
    $filename = $_POST['filetitle'];
    if ( wp_mkdir_p( $upload_dir['path'] ) ) {
                  $file = $upload_dir['path'] . '/' . $filename;
                }
                else {
                  $file = $upload_dir['basedir'] . '/' . $filename;
                }
    file_put_contents( $file, $image_data );
    $mail = new PHPMailer;
    $mail->setFrom<EMAIL_ADDRESS>'My name' );
    $mail->addAddress<EMAIL_ADDRESS>'your name' );
    $mail->Subject  = 'Subject';

    $mail->Body     = $filename;

    $mail->addStringAttachment($decoded_pdf, $filename);
    $mail->isHTML( false );
    if( !$mail->send() ) {
        $response = 'Message was not sent.';
        $response .= 'Mailer error: ' . $mail->ErrorInfo;
    }
    else {
        $response = 'Message has been sent.';
    }

    wp_send_json( $response );
}
add_action( 'wp_ajax_send_email_with_pdf', 'send_email_with_pdf' );
add_action( 'wp_ajax_nopriv_send_email_with_pdf', 'send_email_with_pdf' );

Is anyone able to point me in the right direction please, or has anyone come across this issue before?
I have posted as much information as I can, but please let me know if you need more information.
I also put html2pdf().output().length; above html2pdf().set(opt).from(el).save().toPdf().output('datauristring').then(function(pdfAsString) { and then console had a look to see if it had a length, but came back as 0.

I got this working, for anyone else needing it.
I have added notes in the code for explanation
First add this to the top of your page

HTML / Wordpress content loop part

 PDF tile

 Page 2 title

Some text

 Page 3 title

Some text

JQuery - goes at the bottom on the page above the footer
jQuery(function($) {
	window.onload = function() {
		let el = document.getElementById('PDFcontent');
		var title = $('.exhibitied-title').text();
		let opt = { //Create/design the pdf
			margin: 0.2,
			filename: title + '.pdf',
			image: {
				type: 'jpeg',
				quality: 0.99
			},
			html2canvas: {
				scale: 2,
				logging: true,
				dpi: 192,
				letterRendering: true,
			},
			jsPDF: {
				unit: 'mm',
				format: 'a4',
				orientation: 'portrait'
			}
		};
		html2pdf().from(el).set(opt).toPdf() /*add .save(); if you need it to download locally too*/.output('datauristring').then(function(res) {
			this.blobString = res;
			title = $('mypdftitle').text(); //Get the title from h1 html
			filetitle = title; //set the title to be send in the ajax
			let data = {
				'action': 'send_email_with_pdf', //Name of function in functions.php
				'fileDataURI': this.blobString,
				'filetitle': filetitle, //name of pdf - you set this above
			}
			$.post(myAjax.ajaxurl, data, function(response) { //myAjax.ajaxurl see the bottom code comment
				console.log(response);
				console.log(filetitle);
			});
			console.log(this.blobString);
		});
	}
});

Now in functions.php
function send_email_with_pdf() {
	if (isset($_POST['fileDataURI'])) {
		/*** Prepare and decode the uri string ***/
		$pdfdoc = $_POST['fileDataURI']; // This looks like data:application/pdf;filename=generated.pdf;base64,JVBERi0xLjMKJbrfrOAKMyAwIG9iago8PC9UeXB....
		$b64file = str_replace('data:application/pdf;filename=generated.pdf;base64,', '', $pdfdoc); //remove data:application/pdf;filename=generated.pdf;base64,
		$decoded_pdf = base64_decode($b64file); //decode it
		/**** Unique naming ****/
		$date = date("d-m-y"); // Today date day month year
		$time = date("h:i"); // The time
		//Adding date and time to the pdf, will make sure each pdf generated is unique
		$ext = ".pdf"; //file extension
		$thename = $_POST['filetitle']; //The title sent by ajax from the extension page
		$name = str_replace(' ', '-', $thename); //remove spaces - makes urls better
		$filename = $name.
		'-'.$date.
		'-'.$time.$ext; // combine the file name
		//If you dont want date and time, then do the following $filename = $thename . $ext;
		/**** Upload directory *****/
		$upload_dir = wp_upload_dir();
		if (wp_mkdir_p($upload_dir['path'])) { // Puts the file in wp-content/uploads/year/month
			$file = $upload_dir['path'].
			'/'.$filename;
		} else {
			$file = $upload_dir['basedir'].
			'/'.$filename;
		}
		/*** Upload it ****/
		file_put_contents($file, $decoded_pdf);
		/*** Send the email ****/
		$mail = new PHPMailer;
		$mail - ><EMAIL_ADDRESS>'Chantelle');
		$mail - ><EMAIL_ADDRESS>'Chaz');
		$mail - > Subject = $filename;
		$mail - > Body = $b64file;
		$mail - > addStringAttachment($decoded_pdf, $filename);
		$mail - > isHTML(false);
		if (!$mail - > send()) {
			$response = 'Message was not sent.';
			$response. = 'Mailer error: '.$mail - > ErrorInfo;
		} else {
			$response = 'Message has been sent.';
			$response = $image_data;
		}
		wp_send_json($response);
	}
}
add_action('wp_ajax_send_email_with_pdf', 'send_email_with_pdf');
add_action('wp_ajax_nopriv_send_email_with_pdf', 'send_email_with_pdf');

For those who are unsure about the myAjax.ajaxurl in the JQuery part, Add this to the top of your functions.php in your WordPress theme, and then when ever you want to call Ajax on your site you can use the myAjax.ajaxurl
`add_action( 'init', 'script_enqueuer' );
function script_enqueuer() {
wp_register_script( "liker_script", get_stylesheet_directory_uri().'/js/functionality.js', array('jquery') );
wp_localize_script( 'liker_script', 'myAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' )));
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'liker_script' );
}`

Dude, you saved my life. This was perfect!
Thank you very much.

[Chantellelander] you are one of the good ones


Is this project dead?

project seems dead. If yes, any forks that support chatgpt v4 turbo?

What do you mean "chatgpt v4 turbo"?

What do you mean "chatgpt v4 turbo"?

GPT-4 Turbo
https://openai.com/pricing

It was added more than a month ago? 😕 https://github.com/ztjhz/BetterChatGPT/commit/ecad41fd729cb36968aa4866391692d02a51af89

I guess we have to wait for a new release then. thanks.

It's working for me...

which version are you running? the latest for MacOS from the releases page seems to be 1.0.4 from june last year.

Yeah, we should probably delete that.
The web version that is hosted on GitHub from this repo is up to date.

there are at least 2 other docker based solutions for this.
https://librechat.ai/
https://chatbotui.com/
probably more out there.
but none other that offer a simple local installation on Mac and windows like betterchatgpt
I hope you dont delete it, but instead update the installable builds.
thanks.


Flausfsu

fo

Bad commit?

Yeah, sorry about that. First time poking around with github/smartthings to import to IDE. Figured it out eventually, apparently not before messing something up lol.

No worries :) Happy hacking!
On Fri, Feb 12, 2016 at 8:16 PM, flausfsu<EMAIL_ADDRESS>wrote:

Yeah, sorry about that. First time poking around with github/smartthings
to import to IDE. Figured it out eventually, apparently not before messing
something up lol.
—
Reply to this email directly or view it on GitHub
https://github.com/KristopherKubicki/smartapp-circadian-daylight/pull/7#issuecomment-183561073
.


How can I Shell a -> IO [a]?

Hi,
I'm in the process of learning to use the Turtle library by writing a program that does ls on a directory and filters the result to items older than a specified date.
The easiest way I can think of to achieve this would be to convert a Shell a into [a], after which I could use my good old, trusted map, filter functions and the like.
But I can't seem to find a function such as toList :: Shell a -> IO [a].
What could I do to achieve such a conversion?

So there are two answers: the direct answer to your question and the idiomatic answer.
The direct answer is to implement toList, like this:
import qualified Control.Foldl as Fold

toList :: Shell a -> IO [a]
toList s = fold s Fold.list

... actually the inferred type of that is slightly more general:
toList :: MonadIO io => Shell a -> io [a]

That solution is probably good enough for your purposes, but I want to point out that there is another approach which lets you map and filter the stream without materializing the entire list into memory.
If you want to map over a Shell stream, just use fmap from the Functor type class:
fmap :: Functor f => (a -> b) -> f a -> f b

... which has this type when specialized to Shell:
fmap :: (a -> b) -> Shell a -> Shell b

If you want to filter a stream, just use this generalized filter function that works for any type that implements MonadPlus (including lists, just like the original filter function you know and love):
filter :: MonadPlus m => (a -> Bool) -> m a -> m a
filter predicate as = do
    a <- as
    guard (predicate a)
    return a

If you specialize that filter function to Shell, you get this type:
filter :: (a -> Bool) -> Shell a -> Shell a

To make this example concrete, suppose that I want to list the contents of a directory, filter out children that are directories, and then add a .exe suffix to each one.  I would just write this:
example :: Shell FilePath
example = do
    file        <- ls "someDirectory"
    isDirectory <- testdir file
    guard (not isDirectory)
    return (file <.> "exe")

You could even shorten that to:
example :: Shell FilePath
example = do
    file  <- ls "someDirectory"
    False <- testdir file
    return (file <.> "exe")

That solution will run in constant space, never materializing more than a single FilePath into memory at a time, no matter how many children the directory has.

I LOVE HASKELL (and Turtle). :grin:

Thanks for the quick response!
I've tried the direct answer, and it seems to work like a charm!
About space-efficiency: Wouldn't the conversion to Data.List still keep the program's space complexity constant? I mean, AFAIK both Data.List and Turtle.Shell can have the same laziness characteristics when it comes to forcing element thunks. Or is there some seqing going on during conversion? And even if there is seq in there, couldn't there be an implementation without seq to achieve constant space usage?

The list version doesn't run in constant space for the same reason that replicateM / sequence / mapM don't run in constant space: they have to read all the elements of the list before they assemble the list.  The act of reading in all the elements of the list ahead of time is what causes the problem.  There are no seqs involved in any of this code.

Some comments: Lists are not inherently lazy. The list constructor (:) is lazy. Often inside of monadic code (like IO), the each element of the list must be constructed before the monadic code can move on to the next action in the sequence; thus you end up with an entire list by the end of your action. It may be that the elements in the list are still thunks, but the list itself is evaluated.
@Gabriel439 There is probably room for correction in this description.


drbd-reactor fails with error when listening on <IP_ADDRESS>

config:
[[prometheus]]
address = "<IP_ADDRESS>:9942"
enums = true

logs:
INFO [drbd_reactor::plugin::prometheus] tcp_handler: error in stream, most likely harmless shutdown

Strange, I just ran a quick test with the config provided, and it seemed to start without issues.
Is there anything special on the setup? Running in containers? Running with ipv4 disabled?

I just ran a quick test with the config provided, and it seemed to start without issues.

This pod is running with the host networking. IPv6 is not disabled on the node.
The error is happening only on 30th second of running pod. Please check your RESTARTS counter.
I just added an error output:
https://github.com/LINBIT/drbd-reactor/blob/7173a16ac5ca246d40182db49ed6db53523f9463/src/plugin/prometheus.rs#L91-L94
-            Err(_) => {
+            Err(e) => {
+                println!("Error: {}", e);
                 info!("tcp_handler: error in stream, most likely harmless shutdown");
                 break;
             }

Now I see the following error:
Error: Invalid argument (os error 22)
INFO [drbd_reactor::plugin::prometheus] tcp_handler: error in stream, most likely harmless shutdown

Got it! It seems the pod was killed by livenessprobe as kubernetes can't perform the HTTP checks if service listening on <IP_ADDRESS>

Just FYI from https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#http-probes

Suppose the container listens on <IP_ADDRESS> and the Pod's hostNetwork field is true. Then host, under httpGet, should be set to <IP_ADDRESS>

Yeah. Thanks for referring :)


AKAudioFile AVAsset metadata is not accessible

On the master and develop branches, when I try to access metadata of a file using the AKAudioFile, I do not get any results. If I load the same file using the AVAsset class, I can see it.
In a Playground, this code produces an empty array:
if let akAudioFile = try? AKAudioFile(readFileName: "02 Default.m4a",
                                      baseDir: .Resources) {
    let metadata = akAudioFile.avAsset.metadata
    print(metadata)
}

This code will produce an array of AVMetadataItems:
if let assetURL = NSBundle.mainBundle().URLForResource("02 Default", withExtension: "m4a") {
    let avAsset = AVURLAsset(URL: assetURL)
    let metadata = avAsset.metadata
    print(metadata)
}

The same thing happens if you use AVAsset's .commonMetadata, .availableMetadataFormats, etc.
It's not too different from the internalAVAsset method in the AKAudioFile class. Does anyone know why accessing the .avAsset on the AKAudioFile would make the metadata inaccessible?

Just want to state that I've been on vacation without much time to check into this.  Perhaps @laurentVeliscek will get a chance the AKAudioFile is his baby!  If not, I should be back at it next week.

I just had a look at this and I'm really surprised it doesn't work.  Will keep investigating, good catch!

I think this is fixed in develop now.  Reopen if not.  Thanks!


TypeError: Cannot read property '0' of undefined (bluebird/js/main/async.js:43)

Hello,
I'm having some trouble starting the portal mode, I have a Ralink RT5370 (http://www.amazon.fr/gp/product/B00BXWU7X4), but the portal mode never start due to this error :
04.03.16 10:39:43 [+0100] /usr/src/app/node_modules/bluebird/js/main/async.js:43
04.03.16 10:39:43 [+0100] fn = function () { throw arg; };
04.03.16 10:39:43 [+0100] ^
04.03.16 10:39:43 [+0100] TypeError: Cannot read property '0' of undefined
04.03.16 10:39:43 [+0100] at /usr/src/app/src/app.js:63:45
04.03.16 10:39:43 [+0100] at tryCatcher (/usr/src/app/node_modules/bluebird/js/main/util.js:26:23)
04.03.16 10:39:43 [+0100] at Function.Promise.attempt.Promise.try (/usr/src/app/node_modules/bluebird/js/main/method.js:31:24)
04.03.16 10:39:43 [+0100] at async.retry.callback.table (/usr/src/app/src/app.js:60:28)
04.03.16 10:39:43 [+0100] at /usr/src/app/node_modules/async/lib/async.js:651:21
04.03.16 10:39:43 [+0100] at /usr/src/app/node_modules/async/lib/async.js:718:13
04.03.16 10:39:43 [+0100] at iterate (/usr/src/app/node_modules/async/lib/async.js:262:13)
04.03.16 10:39:43 [+0100] at /usr/src/app/node_modules/async/lib/async.js:274:29
04.03.16 10:39:43 [+0100] at /usr/src/app/node_modules/async/lib/async.js:44:16
04.03.16 10:39:43 [+0100] at /usr/src/app/node_modules/async/lib/async.js:723:17
04.03.16 10:39:43 [+0100] at /usr/src/app/node_modules/async/lib/async.js:167:37
04.03.16 10:39:43 [+0100] at null._onTimeout (/usr/src/app/node_modules/async/lib/async.js:660:25)
04.03.16 10:39:43 [+0100] at Timer.listOnTimeout [as ontimeout] (timers.js:121:15)

When I check the os.networkInterfaces() I get only the eth0 :
{ lo:
04.03.16 10:39:43 [+0100] [ { address: '<IP_ADDRESS>', family: 'IPv4', internal: true },
04.03.16 10:39:43 [+0100] { address: '::1', family: 'IPv6', internal: true } ],
04.03.16 10:39:43 [+0100] eth0:
04.03.16 10:39:43 [+0100] [ { address: '<IP_ADDRESS>', family: 'IPv4', internal: false },
04.03.16 10:39:43 [+0100] { address: 'fe80::ba27:ebff:fe5b:a761',
04.03.16 10:39:43 [+0100] family: 'IPv6',
04.03.16 10:39:43 [+0100] internal: false } ] }

Any idea ? It's the first time I launch the app and the dongle has never been connected to the wifi. Plus, I downloanded and installed the resin.io basic image with ethernet in the RPi 2 without the wifi.

Hi there @samouds.
It looks like the dongle is somehow not working properly. Can you check what driver is loaded using lsmod? Also lsusb might help confirm whether the dongle actually has the Ralink chipset.
Could you also post the full logs please? There might be something happening before the error to give us more insight.

@pcarranzav Thanks.
I see the results of lsmod and lsusb :
root@raspberrypi2-e9b6b8:~# lsmod
Module                  Size  Used by
bnep                   10740  2
fuse                   83006  1
xt_connmark             1667  2
iptable_mangle          1334  1
snd_bcm2835            20764  0
snd_pcm                73405  1 snd_bcm2835
bluetooth             318087  7 bnep
snd_timer              17657  1 snd_pcm
snd                    50545  3 snd_bcm2835,snd_timer,snd_pcm
arc4                    1718  2
rt2800usb              17560  0
rt2800lib              71782  1 rt2800usb
rt2x00usb               8588  1 rt2800usb
rt2x00lib              36856  3 rt2x00usb,rt2800lib,rt2800usb
mac80211              539719  3 rt2x00lib,rt2x00usb,rt2800lib
cfg80211              424265  2 mac80211,rt2x00lib
crc_ccitt               1142  1 rt2800lib
rfkill                 17289  7 cfg80211,bluetooth
spi_bcm2835             7102  0
i2c_bcm2708             4948  0
bcm2835_gpiomem         2860  0
uio_pdrv_genirq         2924  0
uio                     7760  1 uio_pdrv_genirq
sch_fq_codel            7809  7

root@raspberrypi2-e9b6b8:~# lsusb
Bus 001 Device 004: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Okay, that's weird, as everything seems to be okay with the driver.
Could you try changing the retry interval to a higher value? Maybe it's just taking too long to set up the tether interface.
(btw, do you see the hotspot?)

@pcarranzav yes it's weird. I purged all data and restart from the beginning and all is working now.
I have a question, how can I reboot the device from the container in app.coffee or at least restart the app ?

@samouds - weird, possibly the module just took too long to switch to AP mode... do let us know if it happens again.
Regarding your question, you can use the Supervisor API for that.

@samouds the project a major update that makes it much more stable. Could you try the latest version?


Add gradient accumulation

With larger sequences and batches, we quickly go out of memory when the batch size is greater than 1.

We could probably make use of the accelerate context manager for gradient accumulation!


Use snake case for release stage

I noticed releaseStage isn't snake cased here:
https://github.com/jarednorman/bugsnag-elixir/blob/master/lib/bugsnag/payload.ex#L25
Not a bug, but should be updated according to Elixir conventions.

Yep. Pull requests accepted!

@jarednorman here you go! https://github.com/jarednorman/bugsnag-elixir/pull/13


Export model in python

Up to version 7.0 to export a model in lp or mps format the following could be used
slv = pywraplp.Solver('name', type )
# create model
slv.ExportModelAsMpsFormat(True, False)
slv.ExportModelAsLpFormat(False)

Version 7.1 no longer exports these two functions.
I've tried using the new pywraplp.ExportModelAsLpFormat or pywraplp.ExportModelAsMpsFormat using the following:
pywraplp.ExportModelAsLpFormat(slv)
pywraplp.ExportModelAsMpsFormat(slv)

But I get a not implemented error. Both function seem to require an MPModelProto
What is the recommended way to use these new export functions or to export the model in version 7.1?
Thanks

options = pywraplp.ModelExportOptions()
model_as_string = solver.ExportModelAsLpFormat(options)
Laurent Perron | Operations Research |<EMAIL_ADDRESS>| (33) 1 42 68 53
00
*De : *Federico Caselli<EMAIL_ADDRESS>*Date : *ven. 10 mai 2019 à 12:32
*À : *google/or-tools
*Cc : *Subscribed
Up to version 7.0 to export a model in lp or mps format the following could

be used
slv = pywraplp.Solver('name', type )# create model
slv.ExportModelAsMpsFormat(True, False)
slv.ExportModelAsLpFormat(False)
Version 7.1 no longer exports these two functions.
I've tried using the new pywraplp.ExportModelAsLpFormat or
pywraplp.ExportModelAsMpsFormat using the following:
pywraplp.ExportModelAsLpFormat(slv)
pywraplp.ExportModelAsMpsFormat(slv)
But I get a not implemented error. Both function seem to require an
MPModelProto
What is the recommended way to use these new export functions?
Thanks
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/google/or-tools/issues/1264, or mute the thread
https://github.com/notifications/unsubscribe-auth/ACUPL3PRHA2QHEBF23G6MVLPUVFMNANCNFSM4HMB4LTQ
.

I get
AttributeError: 'Solver' object has no attribute 'ExportModelAsLpFormat'

Sorry we messed up. We forgot to add the compatibility layer for Python.
It is available in Java and C#.
I just pushed the fix to master.
Can you build from source while waiting for 7.2 (could take some time).
Thanks
Laurent Perron | Operations Research |<EMAIL_ADDRESS>| (33) 1 42 68 53
00
*De : *Federico Caselli<EMAIL_ADDRESS>*Date : *ven. 10 mai 2019 à 12:51
*À : *google/or-tools
*Cc : *Laurent Perron, Comment
I get

AttributeError: 'Solver' object has no attribute 'ExportModelAsLpFormat'
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/google/or-tools/issues/1264#issuecomment-491247081,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACUPL3L3CBJ6QVNMWTSWLFDPUVHSBANCNFSM4HMB4LTQ
.

Thanks for fixing this

you haven't fixed it still, have you?

It's working fine for me with 9.3.10497

the tone is not nice. Please be careful.
do not revive 3 years old thread, especially when they are marked as
closed
Laurent Perron | Operations Research | @.*** | (33) 1 42 68 53
00

Le ven. 5 août 2022 à 13:44, JanaPerednia @.***> a
écrit :

you haven't fixed it still, have you?
—
Reply to this email directly, view it on GitHub
https://github.com/google/or-tools/issues/1264#issuecomment-1206355023,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ACUPL3JDSWAKFOKKCPQIYTDVXT5DRANCNFSM4HMB4LTQ
.
You are receiving this because you were assigned.Message ID:
@.***>


Improve code based on mutation testing results

This issue to handle all low-hanging fruit based on starting to use mutation testing. Problems that remain after this first improvement cycle can then be reported as separate issues.
Starting results are 93% line coverage and 94% mutation coverage.

The commit above is a hack -- it duplicates some tests that appear in a parameterized test in a simple test because PITest has trouble handling those. For example, some of the tests of ValueExpression implementations are not included when mutating those. Which results in some living mutations that would have been killed by some existing tests.

Another issue with the toString() implementation of reference.TokenRef, the correct test is identified, which cannot succeed with the proposed mutation (verified in debugger), but PITest still claims that it lived.


VisItDataCollection broken for L2 fields as of visit 3.4.0

I opened an issue on the Visit team's GitHub due to problems rendering zeroth-order L2 fields saved as an mfem::VisItDataCollection seen in visit 3.4.1 but not noticed in visit 3.3.3. The Visit team concluded the problem was with the saved data file, noting that they had changed expectations for the field association as of visit 3.4.0.
If my understanding of the root cause is correct, MFEM should update the VisItDataCollection::RegisterDataCollection method (circa line 415 of fem/datacollection.cpp) to consider whether the field being registered is an L2 field, and if so, switch the association, which is now hard coded as "nodes" to "elements".
I can contribute a PR making this change, if that is of interest. I'm not sure whether other types of fields require similar changes.

@cyrush -- is @sethwatts's suggestion to change association of L2 fields from "nodes" to "elements" correct?
I thought in the high-order case everything is considered "nodes"?

Yes, this is correct.
In this case "nodes" refers to the association of the field on the mesh via the vertices -- not the high order nodes.
If we want L2 fields to be constant with in an element, we need to change the metadata.
Nodes was an bag/ambiguous choice for this name many years ago.
Default versions of VisIt at LLNL are now using the new mfem-lor, so that is why we noticed this case.

@cyrush, to clarify, is this association with "elements" only correct for constant L2 fields? If we have, say, a piecewise quadratic DG representation, should that association remain with "nodes"?

I think that is correct.
The info is used to tell VisIt the type of output post LOR:  element or vertex associated.
Element associated will always be piecewise constant, where vertex will be interpolated between vertices.

@cyrush and @sethwatts -- we are about to freeze the mfem-4.7 release, is this something that is critical to add to it? If so, can you propose a fix today?

I can't propose a fix today. However, I don't think it's essential to get out for mfem-4.7 since using visit-3.3 is a viable (if temporary) solution. I also think topology optimization folks are more likely to be rendering piecewise constant fields than the typical MFEM user who wants to look at solution fields in H1 or similar spaces.

Is this sufficient: https://github.com/mfem/mfem/pull/4282

I'm not sure why "... they had changed expectations for the field association as of visit 3.4.0" -- the MFEM output has not changed, why change the expectations in the MFEM reader in VisIt?

Now that we are leveraging better MFEM LOR algorithm -- we need proper metadata.
MFEM output metadata isn't correct b/c it is limited to what was implemented many many years ago. (this was effectively   only one answer). We designed it to have a way to provide this info, now we just need to update logic in mfem for the pw-constant output cases.
Solution in #4282 looks good to me.

See the discussion in #4282 and in particular this comment.


[Core] BlobClient.DownloadToAsync() fails to retry if server sends partial body

When using<EMAIL_ADDRESS>and<EMAIL_ADDRESS>BlobClient.DownloadToAsync() fails to retry if the server sends a partial body, but it does retry if the server:

Sends no response
Sends headers only
Aborts the connection

Repro Steps

Start a server which can inject HTTP faults, like https://github.com/mikeharder/HttpFaultInjector.

Create a BlobClient with the following options:

var httpClient = new HttpClient(httpClientHandler)
{
    Timeout = TimeSpan.FromSeconds(5)
};

var blobClientOptions = new BlobClientOptions()
{
    Transport = new ChangeUriTransport(new HttpClientTransport(httpClient), "localhost", 7778),
    Retry = {
        MaxRetries = 1,
        NetworkTimeout = TimeSpan.FromSeconds(10)
    },
};

var blobClient = new BlobClient(connectionString, "testcontainer", "testblob", blobClientOptions);
var response = await blobClient.DownloadToAsync(new MemoryStream());

private class ChangeUriTransport : HttpPipelineTransport
{
    private readonly HttpPipelineTransport _transport;
    private readonly string _host;
    private readonly int? _port;

    public ChangeUriTransport(HttpPipelineTransport transport, string host, int? port)
    {
        _transport = transport;
        _host = host;
        _port = port;
    }

    public override Request CreateRequest()
    {
        return _transport.CreateRequest();
    }

    public override void Process(HttpMessage message)
    {
        ChangeUri(message);
        _transport.Process(message);
    }

    public override ValueTask ProcessAsync(HttpMessage message)
    {
        ChangeUri(message);
        return _transport.ProcessAsync(message);
    }

    private void ChangeUri(HttpMessage message)
    {
        // Ensure Host header is only set once, since the same HttpMessage will be reused on retries
        if (!message.Request.Headers.Contains("Host"))
        {
            message.Request.Headers.Add("Host", message.Request.Uri.Host);
        }

        message.Request.Uri.Host = _host;
        if (_port.HasValue)
        {
            message.Request.Uri.Port = _port.Value;
        }
    }
}

Run the client app, and instruct the server to send a partial response (say 50% of the body).

The client will only send one HTTP request (doesn't retry) and throws the following exception:

Unhandled exception. System.Threading.Tasks.TaskCanceledException: The operation was canceled.
 ---> System.IO.IOException: Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request..
 ---> System.Net.Sockets.SocketException (995): The I/O operation has been aborted because of either a thread exit or an application request.
   --- End of inner exception stack trace ---
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.GetResult(Int16 token)
   at System.Net.Security.SslStream.<FillBufferAsync>g__InternalFillBufferAsync|215_0[TReadAdapter](TReadAdapter adap, ValueTask`1 task, Int32 min, Int32 initial)
   at System.Net.Security.SslStream.ReadAsyncInternal[TReadAdapter](TReadAdapter adapter, Memory`1 buffer)
   at System.Net.Http.HttpConnection.ReadAsync(Memory`1 destination)
   at System.Net.Http.HttpConnection.ContentLengthReadStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnection.ContentLengthReadStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken)
   at Azure.Core.Pipeline.ReadTimeoutStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
   at Azure.Core.Pipeline.RetriableStream.RetriableStreamImpl.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
   at Azure.Core.Pipeline.RetriableStream.RetriableStreamImpl.RetryAsync(Exception exception, Boolean async)
   at Azure.Core.Pipeline.RetriableStream.RetriableStreamImpl.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
   at System.IO.Stream.CopyToAsyncInternal(Stream destination, Int32 bufferSize, CancellationToken cancellationToken)
   at Azure.Storage.Blobs.PartitionedDownloader.CopyToAsync(BlobDownloadInfo result, Stream destination, CancellationToken cancellationToken)
   at Azure.Storage.Blobs.PartitionedDownloader.DownloadToAsync(Stream destination, BlobRequestConditions conditions, CancellationToken cancellationToken)
   at Azure.Storage.Blobs.Specialized.BlobBaseClient.StagedDownloadAsync(Stream destination, BlobRequestConditions conditions, Int64 initialTransferLength, StorageTransferOptions transferOptions, Boolean async, CancellationToken cancellationToken)
   at Azure.Storage.Blobs.Specialized.BlobBaseClient.DownloadToAsync(Stream destination, BlobRequestConditions conditions, StorageTransferOptions transferOptions, CancellationToken cancellationToken)
   at Azure.Storage.Blobs.Specialized.BlobBaseClient.DownloadToAsync(Stream destination, CancellationToken cancellationToken)
   at Azure.Storage.Blobs.Specialized.BlobBaseClient.DownloadToAsync(Stream destination)

Verified fixed in<EMAIL_ADDRESS>


Update link to cartocss doc

@javisantana , I updated a link that referenced the old carto site with our own internal CartoCSS doc.  Please merge this branch if you approve.

nice thanks


add deprecation notice to README

Codecov Report

Merging #11 (a33b11c) into master (c0d156f) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##            master       #11   +/-   ##
=========================================
  Coverage   100.00%   100.00%
=========================================
  Files            1         1
  Lines           84        84
  Branches        11        11
=========================================
  Hits            84        84

Continue to review full report at Codecov.

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

Codecov Report

Merging #11 (a33b11c) into master (c0d156f) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##            master       #11   +/-   ##
=========================================
  Coverage   100.00%   100.00%
=========================================
  Files            1         1
  Lines           84        84
  Branches        11        11
=========================================
  Hits            84        84

Continue to review full report at Codecov.

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


Revert Badger version from v4 to v3

#1363  👈
feature/proof-of-stake

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

Join @tholonious and the rest of your teammates on  Graphite


Is it possible to access the UI from another PC?

Hello,
Is the UI exposed to LAN or is it local PC only?

It's listening to local IP (<IP_ADDRESS>), see this line, like any normal web server, so it's safe, but you can allow a specific port in your firewall for example 8080, then force getport() to return 8080 as a workaround.
In the next version a new option will be added to select a specific port number.


Strange behavior of the linter

👓 What did you see?
the linter return When something as en error when it shouldn't be
✅ What did you expect to see?
i shouldn't considair as an error
📦 Which tool/library version are you using?
you can do the test on the live demo
🔬 How could we reproduce it?
go on the live demo
and you will see And this is an undefined step, i f you want you can replace it with anything else everytime this line will appear in error

📚 Any additional context?
No response

Oh ok i understood how is work,  so you first check if the function is written or not,
there is anyway to implement a simple linter with getGherkinDiagnostics ?

Hi @papipsycho, welcome 👋

Oh ok i understood how is work, so you first check if the function is written or not,
there is anyway to implement a simple linter with getGherkinDiagnostics ?

The functionality is perhaps clearer when used through the VSCode extension - as we can see the step definitions being matched against; but effectively with this Monaco demo, it demonstrates the functionality of being able to mark steps as undefined or not; though one could replace the diagnostics with a call to another linter for example - providing it adhered to the same API. The diagnostics implementation for Cucumber Monaco is implemented in the Cucumber Language Service.
So in summary, you could replace getGherkinDiagnostics with a call to another linter. Could you advise what functionalities or linting rules you would desire?
https://github.com/cucumber/monaco/blob/77c220da9271804a44e6196a7d6c8fcfb22bcd98/src/configureMonaco.ts#L79-L93

Thanks for your answer.
i want to check if the gherkin written by the user is correct or not, which is not necessarily linked with the step definition
For instance, I want to show an error in case of :
Scenario Outline: login with user and password
When i on login page
Then i set the user and password
Then i click on the button sign in

this should give an error cause is Scenario Outline without example
and I checked deeply in the function getGherkinDiagnostics which unfortunately doesn't have an option to disable the check into the step definition

Gotcha. Configuration for disabling diagnostics is presently unsupported - though could be turned off by overriding that API to not return any diagnostics.
Likewise on listing whether a Scenario Outline does not contain an examples table. There are gherkin linters that support this functionality which could be integrated through some effort; but functionality is not integrated in the Language Service.
You raise valid requests - if something you'd like see, would welcome a PR if you have a direction to resolve. Thanks for your interest in the project! 👍

Closing as behaviour was clarified. Feel free to raise an issue for any feature requests - thanks for your interest in the project @papipsycho!


feat: Lando support and drush for Drupal

Types of changes

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

Description

Expand support for other local build tool, Lando and include Drush by default in composer.json

Hi @brandonratz,
Sorry I didn't get back to you on this sooner. I've just updated the local development instructions for DDev (which was already supported), and I now want to look at this closer.
I will need to merge the readme together to make the instructions consistent, which I'm happy to do, but you're also welcome to do if you have the capacity.


Beautiful Towers I

Description
Greedy
DSA Problem
You are given a 0-indexed array maxHeights of n integers.
You are tasked with building n towers in the coordinate line. The ith tower is built at coordinate i and has a height of heights[i].
A configuration of towers is beautiful if the following conditions hold:
1 <= heights[i] <= maxHeights[i]
heights is a mountain array.
Array heights is a mountain if there exists an index i such that:
For all 0 < j <= i, heights[j - 1] <= heights[j]
For all i <= k < n - 1, heights[k + 1] <= heights[k]
Return the maximum possible sum of heights of a beautiful configuration of towers.

Please assign this issue to me.

Hello!
Please Assign it to me.
I would like to contribute.


Updated UK regions to reflect GA announcements

Hi @bhummerstone, I'm your friendly neighborhood Azure Pull Request Bot (You can call me AZPRBOT). Thanks for your contribution!

It looks like you're working at Microsoft (benhu). If you're full-time, we DON'T require a contribution license agreement.

If you are a vendor, DO please sign the electronic contribution license agreement. It will take 2 minutes and there's no faxing! https://cla.azure.com.

TTYL, AZPRBOT;

@bhummerstone : Thanks for your contribution to the Azure documentation! The author, @tamram, has been notified to review your proposed change.

#sign-off


Cache notice and solution added.

[x] I have read freeCodeCamp's contribution guidelines.
[x] My pull request has a descriptive title (not a vague title like Update index.md)
[x] My pull request targets the master branch of freeCodeCamp.
[x] None of my changes are plagiarized from another source without proper attribution.
[x] My article does not contain shortened URLs or affiliate links.

If your pull request closes a GitHub issue, replace the XXXXX below with the issue number.
Closes #XXXXX

Thank you for opening this pull request.
This is a standard message notifying you that we’ve reviewed your pull request and have decided not to merge it. We would welcome future pull requests from you.
Thank you and happy coding. ✈
Since you deleted the file, we cannot merge this


Overriding config through nested aliases does not work

Problem
Passing --config ... inside of a cargo alias, and using that with another cargo alias does not work.
Steps

cargo new test; cd test
.cargo/config.toml

[alias]
my_alias = '--config build.rustflags=["--invalid"]'

cargo my_alias c passes, but cargo my_alias check fails, indicating that the --config is not propagated through the c = check alias

Possible Solution(s)
No response
Notes
No response
Version
cargo 1.79.0-nightly (c93926759 2024-04-23)
release: 1.79.0-nightly
commit-hash: c9392675917adc2edab269eea27c222b5359c637
commit-date: 2024-04-23
host: x86_64-unknown-linux-gnu
libgit2: 1.7.2 (sys:0.18.3 vendored)
libcurl: 8.6.0-DEV (sys:0.4.72+curl-8.6.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w  11 Sep 2023
os: Manjaro 23.1.4 (Vulcan) [64-bit]

@rustbot label +A-aliases

Currently, the context is loaded in two phases

GlobalContext::new at app start
GlobalContext::configure once the whole command-line has been parsed.

This would require us to add a third phase and correctly merge it in.  The most likely to get wrong part is related to verbosity

This seems to be an unsupported behavior that is accidentally supported. From the [alias] doc:

The value may be an array of strings, where the first element is the command and the following are arguments. It may also be a string

We may need to figure out since when it started working, and consider either banning or officially supportting it.


What cause this error in training?

multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 3805, in get_loc
return self._engine.get_loc(casted_key)
File "index.pyx", line 167, in pandas._libs.index.IndexEngine.get_loc
File "index.pyx", line 196, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 7081, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 7089, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'height'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/root/miniconda3/envs/opensora/lib/python3.10/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/root/miniconda3/envs/opensora/lib/python3.10/multiprocessing/pool.py", line 51, in starmapstar
return list(itertools.starmap(args[0], args[1]))
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/pandarallel/core.py", line 95, in call
result = self.work_function(
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/pandarallel/data_types/dataframe.py", line 32, in work
return data.apply(
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/pandas/core/frame.py", line 10374, in apply
return op.apply().finalize(self, method="apply")
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/pandas/core/apply.py", line 916, in apply
return self.apply_standard()
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/pandas/core/apply.py", line 1063, in apply_standard
results, res_index = self.apply_series_generator()
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/pandas/core/apply.py", line 1081, in apply_series_generator
results[i] = self.func(v, *self.args, **self.kwargs)
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/opensora/datasets/sampler.py", line 20, in apply
data["height"],
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/pandas/core/series.py", line 1121, in getitem
return self._get_value(key)
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/pandas/core/series.py", line 1237, in _get_value
loc = self.index.get_loc(label)
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 3812, in get_loc
raise KeyError(key) from err
KeyError: 'height'
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/root/Opensora-1.1/scripts/train.py", line 322, in
main()
File "/root/Opensora-1.1/scripts/train.py", line 186, in main
num_steps_per_epoch = dataloader.batch_sampler.get_num_batch() // dist.get_world_size()
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/opensora/datasets/sampler.py", line 77, in get_num_batch
bucket_sample_dict = self.group_by_bucket()
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/opensora/datasets/sampler.py", line 56, in group_by_bucket
bucket_ids = self.dataset.data.parallel_apply(
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/pandarallel/core.py", line 333, in closure
results_promise.get()
File "/root/miniconda3/envs/opensora/lib/python3.10/multiprocessing/pool.py", line 774, in get
raise self._value
KeyError: 'height'
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 3805, in get_loc
return self._engine.get_loc(casted_key)
File "index.pyx", line 167, in pandas._libs.index.IndexEngine.get_loc
File "index.pyx", line 196, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 7081, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 7089, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'height'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/root/miniconda3/envs/opensora/lib/python3.10/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/root/miniconda3/envs/opensora/lib/python3.10/multiprocessing/pool.py", line 51, in starmapstar
return list(itertools.starmap(args[0], args[1]))
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/pandarallel/core.py", line 95, in call
result = self.work_function(
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/pandarallel/data_types/dataframe.py", line 32, in work
return data.apply(
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/pandas/core/frame.py", line 10374, in apply
return op.apply().finalize(self, method="apply")
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/pandas/core/apply.py", line 916, in apply
return self.apply_standard()
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/pandas/core/apply.py", line 1063, in apply_standard
results, res_index = self.apply_series_generator()
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/pandas/core/apply.py", line 1081, in apply_series_generator
results[i] = self.func(v, *self.args, **self.kwargs)
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/opensora/datasets/sampler.py", line 20, in apply
data["height"],
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/pandas/core/series.py", line 1121, in getitem
return self._get_value(key)
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/pandas/core/series.py", line 1237, in _get_value
loc = self.index.get_loc(label)
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 3812, in get_loc
raise KeyError(key) from err
KeyError: 'height'
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/root/Opensora-1.1/scripts/train.py", line 322, in
main()
File "/root/Opensora-1.1/scripts/train.py", line 186, in main
num_steps_per_epoch = dataloader.batch_sampler.get_num_batch() // dist.get_world_size()
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/opensora/datasets/sampler.py", line 77, in get_num_batch
bucket_sample_dict = self.group_by_bucket()
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/opensora/datasets/sampler.py", line 56, in group_by_bucket
bucket_ids = self.dataset.data.parallel_apply(
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/pandarallel/core.py", line 333, in closure
results_promise.get()
File "/root/miniconda3/envs/opensora/lib/python3.10/multiprocessing/pool.py", line 774, in get
raise self._value
KeyError: 'height'
[2024-05-26 19:58:25,587] torch.distributed.elastic.multiprocessing.api: [ERROR] failed (exitcode: 1) local_rank: 0 (pid: 3060525) of binary: /root/miniconda3/envs/opensora/bin/python
Traceback (most recent call last):
File "/root/miniconda3/envs/opensora/bin/torchrun", line 8, in
sys.exit(main())
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/torch/distributed/elastic/multiprocessing/errors/init.py", line 347, in wrapper
return f(*args, **kwargs)
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/torch/distributed/run.py", line 812, in main
run(args)
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/torch/distributed/run.py", line 803, in run
elastic_launch(
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/torch/distributed/launcher/api.py", line 135, in call
return launch_agent(self._config, self._entrypoint, list(args))
File "/root/miniconda3/envs/opensora/lib/python3.10/site-packages/torch/distributed/launcher/api.py", line 268, in launch_agent
raise ChildFailedError(
torch.distributed.elastic.multiprocessing.errors.ChildFailedError:
scripts/train.py FAILED
Failures:
[1]:
time      : 2024-05-26_19:58:25
host      : LUCAS-DEV-fffd8d
rank      : 1 (local_rank: 1)
exitcode  : 1 (pid: 3060526)
error_file: <N/A>
traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
Root Cause (first observed failure):
[0]:
time      : 2024-05-26_19:58:25
host      : LUCAS-DEV-fffd8d
rank      : 0 (local_rank: 0)
exitcode  : 1 (pid: 3060525)
error_file: <N/A>
traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html

请问您解决了吗 我遇到了相同的错误

I had the same problem
[2024-07-29 10:30:40] Building dataset...
[2024-07-29 10:30:40] Dataset contains 3 samples.
[2024-07-29 10:30:40] Number of buckets: 1025
INFO: Pandarallel will run on 16 workers.
INFO: Pandarallel will use Memory file system to transfer data between the main process and workers.
[2024-07-29 10:30:40] Building buckets...
[rank0]: multiprocessing.pool.RemoteTraceback:
[rank0]: """
[rank0]: Traceback (most recent call last):
[rank0]:   File "/opt/conda/envs/opens/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 3805, in get_loc
[rank0]:     return self._engine.get_loc(casted_key)
[rank0]:   File "index.pyx", line 167, in pandas._libs.index.IndexEngine.get_loc
[rank0]:   File "index.pyx", line 196, in pandas._libs.index.IndexEngine.get_loc
[rank0]:   File "pandas/_libs/hashtable_class_helper.pxi", line 7081, in pandas._libs.hashtable.PyObjectHashTable.get_item
[rank0]:   File "pandas/_libs/hashtable_class_helper.pxi", line 7089, in pandas._libs.hashtable.PyObjectHashTable.get_item
[rank0]: KeyError: 'height'

Still the same issue. Anyone has a solution now?

me too


Fix wrong breaking change sections

There're two conflicts when merging release to master:

Kotlin build scripts compilation enforces non-null APIs
Classpath file generated by the eclipse plugin has changed

The first one was reverted in
https://github.com/gradle/gradle/commit/9d5a32ca55d7129c45808ffae416f89dbe4cc224
and the second one was added after branching, so it should go into 7.5
section.

@bot-gradle test and merge

OK, I've already triggered a build for you.


Molecule v2

This PR makes the necessary changes to test this role with Ansible 2.4 and above and Molecule 2.

e25f8bc  creates the Molecule 2 initial setup using molecule init scenario -r $(basename $PWD) -s default -d docker
f74e932  fixes the yamllint warnings and errors reported by molecule test and u
5f26f55  upgrades tests to be compliant with Molecule 2/testinfra 1.14

With openmicroscopy/ome-ansible-molecule-dependencies#10, this PR should be tested by Travis against Ansible 2.4 in the daily https://travis-ci.org/snoopycrimecop/ansible-roles build.
Proposed tag: 2.1.2

Now deployed to https://galaxy.ansible.com/openmicroscopy/ice


How to add a function when warpping a react component? Or is there any way to add some code in js file?

Hi Pynecone Team,
I am trying to warp a download offer component, found that react-download-link is rather promising. https://github.com/petermoresi/react-download-link
But there is last mile to go: I need to wrap additional function to this component. It is similar to #605 somehow, which have great impacts to Pynecone's extensibility to rich resources of React.
Finally, is there any back tricks to inject codes into js files? Or is there any better way to offer download? For temp fix my problems, Thanks inadvance.
The original React usage example:
import React from "react";
import DownloadLink from "react-download-link";

function MyComponent() {
  function downloadCsv() {
    const csvContent = "Name, Age\nJohn, 30\nJane, 25";
    return new Blob([csvContent], { type: "text/csv" });
  }

  return (
    <DownloadLink
      label="Download CSV"
      filename="xxxx.csv"
      exportFile={downloadCsv}
    />
  );
}

To Reproduce
pcconfig.py:
import pynecone as pc
config = pc.Config(
    app_name="TestState",
    db_url="sqlite:///pynecone.db",
    env=pc.Env.DEV,
    frontend_packages=["react-download-link", ]
)

TestState.py:
from pcconfig import config

import pynecone as pc

docs_url = "https://pynecone.io/docs/getting-started/introduction"
filename = f"{config.app_name}/{config.app_name}.py"

class DownloadLink(pc.Component):
    library = "react-download-link"
    tag = "DownloadLink"
    label: pc.Var[str]
    filename: pc.Var[str]
    exportFile: pc.Var[str] = "This is exportFile..."

    def _get_imports(self):
        return {}
    def _get_custom_code(self) -> str:
        return '''
import DownloadLink from 'react-download-link';
'''

downloadlink = DownloadLink.create

class State(pc.State):
    """The app state."""
    pass

def index() -> pc.Component:
    return pc.center(
        pc.vstack(
            pc.box(
                downloadlink(
                    label='download-label',
                    filename='xxxx.txt',
                    exportFile='{() => "This is exportFile"}',#Need a function here
                )
            ),
        ),
    )

# Add state and page to the app.
app = pc.App(state=State)
app.add_page(index)
app.compile()

** Specifics (please complete the following information):**

Python Version: 3.10
Pynecone Version: 0.1.20
OS: Windows (npm install slow is Never Mind!)
Browser (Optional): Edge

For this particular issue, the problem can be solved by moving the function definition outside of the component via _get_custom_code:
from pcconfig import config

import pynecone as pc

class DownloadLink(pc.Component):
    library = "react-download-link"
    tag = "DownloadLink"
    label: pc.Var[str]
    filename: pc.Var[str]
    exportFile: pc.Var[str] = "This is exportFile..."

    def _get_imports(self):
        return {}
    def _get_custom_code(self) -> str:
        return r'''
import DownloadLink from 'react-download-link';
function downloadCsv() {
  const csvContent = "Name, Age\nJohn, 30\nJane, 25";
  return new Blob([csvContent], { type: "text/csv" });
}
'''

downloadlink = DownloadLink.create

class State(pc.State):
    """The app state."""
    pass

def index() -> pc.Component:
    return pc.center(
        pc.vstack(
            pc.box(
                downloadlink(
                    label='download-label',
                    filename='xxxx.txt',
                    exportFile=pc.Var.create('downloadCsv', is_local=False),
                )
            ),
        ),
    )

# Add state and page to the app.
app = pc.App(state=State)
app.add_page(index)
app.compile()

This part is important too exportFile=pc.Var.create('downloadCsv', is_local=False),

@masenf  Great insights! Thank you for your help. I haven't known pc.Var.create('downloadCsv', is_local=False) would create {downloadCsv}, which is really important.
Some more to this particular issue, do you have any idea of dynamic file download offer? Thanks inadvance.

Hi @picklelo @Alek99 @masenf ,
Do we have an injection point between {effects} and the return { in the newest version?
Really need a def custom_js_code of Component!
Thanks inadvance!

@forhonourlx should be Component._get_hooks as your injection point: https://github.com/pynecone-io/pynecone/blob/01aac494dd052b147f53857b471788b178aa8188/pynecone/components/component.py#L461-L470

Hey all, I seem to have run into this same issue and have been trying for hours to get this working...
I'm trying to wrap a react component which also consumes another named import as a prop.
Here's how it is supposed to be implemented in JS:
import { StandaloneStructServiceProvider } from "ketcher-standalone";
import { Editor } from "ketcher-react";
import "ketcher-react/dist/index.css";

const structServiceProvider = new StandaloneStructServiceProvider();

export default function App() {
  return (
      <Editor
        staticResourcesUrl={""}
        structServiceProvider={structServiceProvider}
      />

What I have so far is:
import reflex as rx

class Editor(rx.Component):
    library = "ketcher-react"
    tag = "Editor"
    is_default = False

    staticResourcesUrl: rx.Var[str]
    structServiceProvider: rx.Var[str]

    def _get_imports(self):
        return {}
    def _get_custom_code(self) -> str:
        return r'''
import dynamic from "next/dynamic";

const Editor = dynamic(
    () => import('ketcher-react').then((mod) => mod.Editor),
    { ssr: false }
);

const StandaloneStructServiceProvider = dynamic(
    () => import('ketcher-standalone').then((mod) => mod.StandaloneStructServiceProvider),
    { ssr: false }
);

function structServiceProvider() {
  return new StandaloneStructServiceProvider();
}
'''

editor = Editor.create

class State(rx.State):
    """The app state."""
    pass

def index() -> rx.Component:
    return rx.center(
        rx.vstack(
            rx.box(
                editor(
                    # staticResourcesUrl='localhost',
                    structServiceProvider=rx.Var.create('structServiceProvider', is_local=False),
                )
            ),
        ),
    )

# Add state and page to the app.
app = rx.App()
app.add_page(index)
app.compile()

What I get back is Unhandled Runtime Error TypeError: structServiceProvider.createStructService is not a function.
Does anyone have any or ways to hack this component into existence?

Thanks, I really appreciate it.


Post release automated changes for storage releases

Post release automated changes for azure-storage-blob

API change check
API changes are not detected in this pull request.


Test UI: Sort/Filter by Duration

It would be ideal if the Testing user interface would allow to sort/filter based on duration.
Use case: I have a large number of tests in my project and they're slow, I want to sort by duration to identify long running tests.

I want to work on this @connor4312 shall I give it a try ?

Can I get a little help here ? I think I am not able to find the UI in the app. Is this screen capture same as above ? (Left panel)

I made two tests locally, but I am not seeing the time it took to run the tests ?

The 40th Fibonacci number is  63245986
either change the toEqual to match that or
check for fib 12

You'll need to use testing.useNativeTesting: true to make the Test Explorer use the native experience.

Hey admin, i have just started my open source contribution journey. Can you assign this task to me? so that i can start working on it.

Feel free to submit a PR

Hey Conor, can I work on this issue

@connor4312 , I  found that following changes will be needed

adding a class TestingSortByDurationAction to src/vs/workbench/contrib/testing/browser/testExplorerActions.ts
adding byDuration='duration' to
export const enum TestExplorerViewSorting { ByLocation = 'location', ByStatus = 'status', }
inside the file src/vs/workbench/contrib/testing/common/constants.ts

What other files need to be changed and what all changes need to be made, please guide/help me , I am new to open source

The TestExplorerView is where it happens. You can do a "find all references" on TestExplorerViewSorting and that'll give you a good indication of places to update

There is such a line for sort ByLocation , but not there for ByStatus , why is it so
https://github.com/microsoft/vscode/blob/0040f1577d0918b001ccbf6562d864abb4d6976b/src/vs/workbench/contrib/testing/common/testingContextKeys.ts#L29


extensions/extension-editing/src/extensionLinter.ts does not respect repository shorthand in package.json

VS Code warns about non-https relative image links in markdown files, with this message:

Relative image URLs require a repository with HTTPS protocol to be specified in the package.json.

If I update package.json to include a repository with an HTTPS URL, this warning goes away:
"repository": {
    "type": "git",
    "url": "https://github.com/user/repo"
}

However, there are other ways to specify a repository url. For example:
"repository": "github:user/repo"

In this case, the "repository" link will point to https://github.com/user/repo. But the extension-linter does not detect this case, and still shows the warning.

VSCode Version: 1.28.0 (user setup)
OS Version: Windows 10

Steps to Reproduce:

Create a new GitHub project, and add a new VS Code extension to the repository.
In package.json, specify the repository as "repository": "github:user/repo".
In README.md, reference an image by its relative path.
Open out the "problems" tab in VS Code.

Expected: No problems are reported.
Actual: extension-linter reports the warning Relative image URLs require a repository with HTTPS protocol to be specified in the package.json.

Change the repository property's value to:

"repository": {
    "type": "git",
    "url": "https://github.com/user/repo"
}

Expected: No problems are reported.
Actual: Behaves as expected (no problems are reported).

Does this issue occur when all extensions are disabled?: Yes/No

Related (similar issue coming from vscode-vsce instead of extension-linter): https://github.com/Microsoft/vscode-vsce/issues/285