text1
stringlengths
0
536k
text2
stringlengths
0
536k
label
int64
0
1
<p dir="auto">Duplicate <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="627730088" data-permission-text="Title is private" data-url="https://github.com/opencv/opencv/issues/17432" data-hovercard-type="pull_request" data-hovercard-url="/opencv/opencv/pull/17432/hovercard" href="https://github.com/opencv/opencv/pull/17432">#17432</a></p> <p dir="auto">Windows 10, CMake 3.18, CUDA 10.2. OpenCV rev. <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/opencv/opencv/commit/0cbaaba4b189e8c45bb03bb59bc3ff8a5bf52e28/hovercard" href="https://github.com/opencv/opencv/commit/0cbaaba4b189e8c45bb03bb59bc3ff8a5bf52e28"><tt>0cbaaba</tt></a>, contrib rev. 39ced2af67b5f76d5d2f3a9c1f9cebfc0ddd8c65.</p> <p dir="auto">During configuration CMake issues an error:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="CMake Error at cmake/OpenCVDetectCUDA.cmake:111 (string): string sub-command STRIP requires two arguments. Call Stack (most recent call first): cmake/OpenCVDetectCUDA.cmake:164 (ocv_filter_available_architecture) cmake/OpenCVFindLibsPerf.cmake:43 (include) CMakeLists.txt:688 (include) CMake Error at cmake/OpenCVDetectCUDA.cmake:125 (string): string sub-command REPLACE requires at least four arguments. Call Stack (most recent call first): cmake/OpenCVDetectCUDA.cmake:174 (ocv_wipeout_deprecated) cmake/OpenCVFindLibsPerf.cmake:43 (include) CMakeLists.txt:688 (include)"><pre class="notranslate"><code class="notranslate">CMake Error at cmake/OpenCVDetectCUDA.cmake:111 (string): string sub-command STRIP requires two arguments. Call Stack (most recent call first): cmake/OpenCVDetectCUDA.cmake:164 (ocv_filter_available_architecture) cmake/OpenCVFindLibsPerf.cmake:43 (include) CMakeLists.txt:688 (include) CMake Error at cmake/OpenCVDetectCUDA.cmake:125 (string): string sub-command REPLACE requires at least four arguments. Call Stack (most recent call first): cmake/OpenCVDetectCUDA.cmake:174 (ocv_wipeout_deprecated) cmake/OpenCVFindLibsPerf.cmake:43 (include) CMakeLists.txt:688 (include) </code></pre></div> <p dir="auto">I investigated the latest changes and found that the error occurs after commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/opencv/opencv/commit/476aa443c6e1c92c8f8da3ee73622a9b18159958/hovercard" href="https://github.com/opencv/opencv/commit/476aa443c6e1c92c8f8da3ee73622a9b18159958"><tt>476aa44</tt></a>.</p> <p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/tomoaki0705/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/tomoaki0705">@tomoaki0705</a>, Could you please look.</p> <p dir="auto">Full log:</p> <details> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Detected processor: AMD64 Found PythonInterp: C:/Program Files/Python37/python.exe (found suitable version &quot;3.7.7&quot;, minimum required is &quot;2.7&quot;) libjpeg-turbo: VERSION = 2.0.4, BUILD = opencv-4.4.0-pre-libjpeg-turbo Could NOT find OpenJPEG (minimal suitable version: 2.0, recommended version &gt;= 2.3.1) IPPICV: Download: ippicv_2020_win_intel64_20191018_general.zip found Intel IPP (ICV version): 2020.0.0 [2020.0.0 Gold] at: E:/Lib_prebuild/opencv/prebuild_x64/3rdparty/ippicv/ippicv_win/icv found Intel IPP Integration Wrappers sources: 2020.0.0 at: E:/Lib_prebuild/opencv/prebuild_x64/3rdparty/ippicv/ippicv_win/iw Found CUDNN: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/lib/x64/cudnn.lib (found suitable version &quot;7.6.5&quot;, minimum required is &quot;7.5&quot;) CUDA detected: 10.2 CMake Error at cmake/OpenCVDetectCUDA.cmake:111 (string): string sub-command STRIP requires two arguments. Call Stack (most recent call first): cmake/OpenCVDetectCUDA.cmake:164 (ocv_filter_available_architecture) cmake/OpenCVFindLibsPerf.cmake:43 (include) CMakeLists.txt:688 (include) CMake Error at cmake/OpenCVDetectCUDA.cmake:125 (string): string sub-command REPLACE requires at least four arguments. Call Stack (most recent call first): cmake/OpenCVDetectCUDA.cmake:174 (ocv_wipeout_deprecated) cmake/OpenCVFindLibsPerf.cmake:43 (include) CMakeLists.txt:688 (include) CUDA NVCC target flags: -D_FORCE_INLINES Check size of int Check size of int - done Found MKL 2019.0.3 at: E:/Lib_prebuild/MKL LAPACK(MKL): LAPACK_LIBRARIES: E:/Lib_prebuild/MKL/lib/mkl_intel_lp64.lib;E:/Lib_prebuild/MKL/lib/mkl_sequential.lib;E:/Lib_prebuild/MKL/lib/mkl_core.lib LAPACK(MKL): Support is enabled. Found JNI: C:/Program Files/Java/jdk-14.0.1/lib/jawt.lib The following CMake options are exported from the Inference Engine build THREADING: TBB Detected InferenceEngine: cmake package (2.1.0) CMake Warning at cmake/OpenCVDetectInferenceEngine.cmake:132 (message): InferenceEngine version has not been set, 2020.3 will be used by default. Set INF_ENGINE_RELEASE variable if you experience build errors. Call Stack (most recent call first): CMakeLists.txt:750 (include) Found VTK 8.2.0 (C:/Lib/VTK/build_x64/lib/cmake/vtk-8.2/UseVTK.cmake) ADE: Download: v0.1.1f.zip OpenCV Python: during development append to PYTHONPATH: E:/Lib_prebuild/opencv/prebuild_x64/python_loader FFMPEG: Download: opencv_videoio_ffmpeg.dll FFMPEG: Download: opencv_videoio_ffmpeg_64.dll FFMPEG: Download: ffmpeg_version.cmake Looking for mfapi.h Looking for mfapi.h - found Looking for d3d11_4.h Looking for d3d11_4.h - found Caffe: NO Protobuf: NO Glog: NO freetype2: NO harfbuzz: NO No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available. Found installed version of gflags: C:/Lib/gflags/build_x64/lib/cmake/gflags Detected gflags version: 2.2.2 Found installed version of Eigen: E:/Lib_prebuild/eigen/build_x64/share/eigen3/cmake Found required Ceres dependency: Eigen version 3.3.7 in E:/Lib_prebuild/eigen/build_x64/include/eigen3 Found installed version of glog: E:/Lib_prebuild/glog/prebuild_x64 Detected glog version: 0.4.0 Found required Ceres dependency: glog Found installed version of gflags: C:/Lib/gflags/build_x64/lib/cmake/gflags Detected gflags version: 2.2.2 Found required Ceres dependency: gflags Ceres version 1.14.0 detected here: E:/Lib_prebuild/ceres-solver/build_x64 was built with C++11. Ceres target will add C++11 flags to compile options for targets using it. Found Ceres version: 1.14.0 installed in: E:/Lib_prebuild/ceres-solver/build_x64 with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, SchurSpecializations, C++11, OpenMP, Multithreading] Checking SFM deps... TRUE Tesseract: NO Allocator metrics storage type: 'long long' Registering hook 'INIT_MODULE_SOURCES_opencv_dnn': E:/Lib_prebuild/opencv/source/opencv/modules/dnn/cmake/hooks/INIT_MODULE_SOURCES_opencv_dnn.cmake DNN: Enabling Inference Engine NN Builder API support xfeatures2d/boostdesc: Download: boostdesc_bgm.i xfeatures2d/boostdesc: Download: boostdesc_bgm_bi.i xfeatures2d/boostdesc: Download: boostdesc_bgm_hd.i xfeatures2d/boostdesc: Download: boostdesc_binboost_064.i xfeatures2d/boostdesc: Download: boostdesc_binboost_128.i xfeatures2d/boostdesc: Download: boostdesc_binboost_256.i xfeatures2d/boostdesc: Download: boostdesc_lbgm.i xfeatures2d/vgg: Download: vgg_generated_48.i xfeatures2d/vgg: Download: vgg_generated_64.i xfeatures2d/vgg: Download: vgg_generated_80.i xfeatures2d/vgg: Download: vgg_generated_120.i data: Download: face_landmark_model.dat No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available. Found installed version of gflags: C:/Lib/gflags/build_x64/lib/cmake/gflags Detected gflags version: 2.2.2 Found installed version of Eigen: E:/Lib_prebuild/eigen/build_x64/share/eigen3/cmake Found required Ceres dependency: Eigen version 3.3.7 in E:/Lib_prebuild/eigen/build_x64/include/eigen3 Found installed version of glog: E:/Lib_prebuild/glog/prebuild_x64 Detected glog version: 0.4.0 Found required Ceres dependency: glog Found installed version of gflags: C:/Lib/gflags/build_x64/lib/cmake/gflags Detected gflags version: 2.2.2 Found required Ceres dependency: gflags Ceres version 1.14.0 detected here: E:/Lib_prebuild/ceres-solver/build_x64 was built with C++11. Ceres target will add C++11 flags to compile options for targets using it. Found Ceres version: 1.14.0 installed in: E:/Lib_prebuild/ceres-solver/build_x64 with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, SchurSpecializations, C++11, OpenMP, Multithreading] Checking SFM deps... TRUE NVIDIA_OPTICAL_FLOW: Download: 79c6cee80a2df9a196f20afd6b598a9810964c32.zip CMake Warning at cmake/OpenCVGenSetupVars.cmake:54 (message): CONFIGURATION IS NOT SUPPORTED: validate setupvars script in install directory Call Stack (most recent call first): CMakeLists.txt:968 (include) General configuration for OpenCV 4.4.0-pre ===================================== Version control: 4.3.0-421-g0cbaaba4b1 Extra modules: Location (extra): E:/Lib_prebuild/opencv/source/opencv_contrib/modules Version control (extra): 4.3.0-62-g39ced2af Platform: Timestamp: 2020-06-14T07:00:26Z Host: Windows 10.0.17763 AMD64 CMake: 3.18.0-rc1 CMake generator: Visual Studio 15 2017 CMake build tool: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/MSBuild/15.0/Bin/MSBuild.exe MSVC: 1916 CPU/HW features: Baseline: SSE SSE2 SSE3 requested: SSE3 Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX requested: SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX SSE4_1 (15 files): + SSSE3 SSE4_1 SSE4_2 (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 (0 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX AVX (4 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX AVX2 (29 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX512_SKX (4 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_COMMON AVX512_SKX C/C++: Built as dynamic libs?: YES C++ standard: 11 C++ Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe (ver 19.16.27039.0) C++ flags (Release): /DWIN32 /D_WINDOWS /W4 /GR /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:precise /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /MP /MD /O2 /Ob2 /DNDEBUG C++ flags (Debug): /DWIN32 /D_WINDOWS /W4 /GR /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:precise /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /MP /MDd /Zi /Ob0 /Od /RTC1 C Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe C flags (Release): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:precise /MP /MD /O2 /Ob2 /DNDEBUG C flags (Debug): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:precise /MP /MDd /Zi /Ob0 /Od /RTC1 Linker flags (Release): /machine:x64 /INCREMENTAL:NO Linker flags (Debug): /machine:x64 /debug /INCREMENTAL ccache: NO Precompiled headers: YES Extra dependencies: cudart_static.lib nppc.lib nppial.lib nppicc.lib nppicom.lib nppidei.lib nppif.lib nppig.lib nppim.lib nppist.lib nppisu.lib nppitc.lib npps.lib cublas.lib cudnn.lib cufft.lib -LIBPATH:C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/lib/x64 3rdparty dependencies: OpenCV modules: To be built: alphamat aruco bgsegm bioinspired calib3d ccalib core cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev datasets dnn dnn_objdetect dnn_superres dpm face features2d flann fuzzy gapi hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor ml objdetect optflow ovis phase_unwrapping photo plot python3 quality rapid reg rgbd saliency sfm shape stereo stitching structured_light superres surface_matching text tracking video videoio videostab viz xfeatures2d ximgproc xobjdetect xphoto Disabled: world Disabled by dependency: - Unavailable: cnn_3dobj cvv freetype hdf java js matlab python2 ts Applications: examples apps Documentation: NO Non-free algorithms: NO Windows RT support: NO GUI: Win32 UI: YES VTK support: YES (ver 8.2.0) Media I/O: ZLib: build (ver 1.2.11) JPEG: build-libjpeg-turbo (ver 2.0.4-62) WEBP: build (ver encoder: 0x020f) PNG: build (ver 1.6.37) TIFF: build (ver 42 - 4.0.10) JPEG 2000: build Jasper (ver 1.900.1) OpenEXR: build (ver 2.3.0) HDR: YES SUNRASTER: YES PXM: YES PFM: YES Video I/O: DC1394: NO FFMPEG: YES (prebuilt binaries) avcodec: YES (58.54.100) avformat: YES (58.29.100) avutil: YES (56.31.100) swscale: YES (5.5.100) avresample: YES (4.0.0) GStreamer: NO DirectShow: YES Media Foundation: YES DXVA: YES Parallel framework: Concurrency Trace: YES (with Intel ITT) Other third-party libraries: Intel IPP: 2020.0.0 Gold [2020.0.0] at: E:/Lib_prebuild/opencv/prebuild_x64/3rdparty/ippicv/ippicv_win/icv Intel IPP IW: sources (2020.0.0) at: E:/Lib_prebuild/opencv/prebuild_x64/3rdparty/ippicv/ippicv_win/iw Lapack: YES (E:/Lib_prebuild/MKL/lib/mkl_intel_lp64.lib E:/Lib_prebuild/MKL/lib/mkl_sequential.lib E:/Lib_prebuild/MKL/lib/mkl_core.lib) Inference Engine: YES (2020030000 / 2.1.0) * libs: E:/Lib_prebuild/DLDT/dldt/bin/intel64/Release/inference_engine_c_api.lib / E:/Lib_prebuild/DLDT/dldt/bin/intel64/Debug/inference_engine_c_apid.lib E:/Lib_prebuild/DLDT/dldt/bin/intel64/Release/inference_engine_c_api.dll / E:/Lib_prebuild/DLDT/dldt/bin/intel64/Debug/inference_engine_c_apid.dll E:/Lib_prebuild/DLDT/dldt/bin/intel64/Release/inference_engine_c_api.dll E:/Lib_prebuild/DLDT/dldt/bin/intel64/Debug/inference_engine_c_apid.dll * includes: E:/Lib_prebuild/DLDT/dldt/inference-engine/ie_bridges/c/include Eigen: YES (ver 3.3.7) Custom HAL: NO Protobuf: build (3.5.1) NVIDIA CUDA: YES (ver 10.2, CUFFT CUBLAS) NVIDIA GPU arch: NVIDIA PTX archs: cuDNN: YES (ver 7.6.5) OpenCL: YES (NVD3D11) Include path: E:/Lib_prebuild/opencv/source/opencv/3rdparty/include/opencl/1.2 Link libraries: Dynamic load Python 3: Interpreter: C:/Program Files/Python37/python.exe (ver 3.7.7) Libraries: optimized C:/Program Files/Python37/libs/python37.lib debug C:/Program Files/Python37/libs/python37_d.lib (ver 3.7.7) numpy: C:/Program Files/Python37/lib/site-packages/numpy/core/include (ver 1.18.2) install path: C:/Program Files/Python37/Lib/site-packages/cv2/python-3.7 Python (for build): C:/Program Files/Python37/python.exe Java: ant: NO JNI: C:/Program Files/Java/jdk-14.0.1/include C:/Program Files/Java/jdk-14.0.1/include/win32 C:/Program Files/Java/jdk-14.0.1/include Java wrappers: NO Java tests: NO Install to: E:/Lib_prebuild/opencv/prebuild_x64/install ----------------------------------------------------------------- Configuring incomplete, errors occurred! See also &quot;E:/Lib_prebuild/opencv/prebuild_x64/CMakeFiles/CMakeOutput.log&quot;. See also &quot;E:/Lib_prebuild/opencv/prebuild_x64/CMakeFiles/CMakeError.log&quot;."><pre class="notranslate"><code class="notranslate">Detected processor: AMD64 Found PythonInterp: C:/Program Files/Python37/python.exe (found suitable version "3.7.7", minimum required is "2.7") libjpeg-turbo: VERSION = 2.0.4, BUILD = opencv-4.4.0-pre-libjpeg-turbo Could NOT find OpenJPEG (minimal suitable version: 2.0, recommended version &gt;= 2.3.1) IPPICV: Download: ippicv_2020_win_intel64_20191018_general.zip found Intel IPP (ICV version): 2020.0.0 [2020.0.0 Gold] at: E:/Lib_prebuild/opencv/prebuild_x64/3rdparty/ippicv/ippicv_win/icv found Intel IPP Integration Wrappers sources: 2020.0.0 at: E:/Lib_prebuild/opencv/prebuild_x64/3rdparty/ippicv/ippicv_win/iw Found CUDNN: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/lib/x64/cudnn.lib (found suitable version "7.6.5", minimum required is "7.5") CUDA detected: 10.2 CMake Error at cmake/OpenCVDetectCUDA.cmake:111 (string): string sub-command STRIP requires two arguments. Call Stack (most recent call first): cmake/OpenCVDetectCUDA.cmake:164 (ocv_filter_available_architecture) cmake/OpenCVFindLibsPerf.cmake:43 (include) CMakeLists.txt:688 (include) CMake Error at cmake/OpenCVDetectCUDA.cmake:125 (string): string sub-command REPLACE requires at least four arguments. Call Stack (most recent call first): cmake/OpenCVDetectCUDA.cmake:174 (ocv_wipeout_deprecated) cmake/OpenCVFindLibsPerf.cmake:43 (include) CMakeLists.txt:688 (include) CUDA NVCC target flags: -D_FORCE_INLINES Check size of int Check size of int - done Found MKL 2019.0.3 at: E:/Lib_prebuild/MKL LAPACK(MKL): LAPACK_LIBRARIES: E:/Lib_prebuild/MKL/lib/mkl_intel_lp64.lib;E:/Lib_prebuild/MKL/lib/mkl_sequential.lib;E:/Lib_prebuild/MKL/lib/mkl_core.lib LAPACK(MKL): Support is enabled. Found JNI: C:/Program Files/Java/jdk-14.0.1/lib/jawt.lib The following CMake options are exported from the Inference Engine build THREADING: TBB Detected InferenceEngine: cmake package (2.1.0) CMake Warning at cmake/OpenCVDetectInferenceEngine.cmake:132 (message): InferenceEngine version has not been set, 2020.3 will be used by default. Set INF_ENGINE_RELEASE variable if you experience build errors. Call Stack (most recent call first): CMakeLists.txt:750 (include) Found VTK 8.2.0 (C:/Lib/VTK/build_x64/lib/cmake/vtk-8.2/UseVTK.cmake) ADE: Download: v0.1.1f.zip OpenCV Python: during development append to PYTHONPATH: E:/Lib_prebuild/opencv/prebuild_x64/python_loader FFMPEG: Download: opencv_videoio_ffmpeg.dll FFMPEG: Download: opencv_videoio_ffmpeg_64.dll FFMPEG: Download: ffmpeg_version.cmake Looking for mfapi.h Looking for mfapi.h - found Looking for d3d11_4.h Looking for d3d11_4.h - found Caffe: NO Protobuf: NO Glog: NO freetype2: NO harfbuzz: NO No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available. Found installed version of gflags: C:/Lib/gflags/build_x64/lib/cmake/gflags Detected gflags version: 2.2.2 Found installed version of Eigen: E:/Lib_prebuild/eigen/build_x64/share/eigen3/cmake Found required Ceres dependency: Eigen version 3.3.7 in E:/Lib_prebuild/eigen/build_x64/include/eigen3 Found installed version of glog: E:/Lib_prebuild/glog/prebuild_x64 Detected glog version: 0.4.0 Found required Ceres dependency: glog Found installed version of gflags: C:/Lib/gflags/build_x64/lib/cmake/gflags Detected gflags version: 2.2.2 Found required Ceres dependency: gflags Ceres version 1.14.0 detected here: E:/Lib_prebuild/ceres-solver/build_x64 was built with C++11. Ceres target will add C++11 flags to compile options for targets using it. Found Ceres version: 1.14.0 installed in: E:/Lib_prebuild/ceres-solver/build_x64 with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, SchurSpecializations, C++11, OpenMP, Multithreading] Checking SFM deps... TRUE Tesseract: NO Allocator metrics storage type: 'long long' Registering hook 'INIT_MODULE_SOURCES_opencv_dnn': E:/Lib_prebuild/opencv/source/opencv/modules/dnn/cmake/hooks/INIT_MODULE_SOURCES_opencv_dnn.cmake DNN: Enabling Inference Engine NN Builder API support xfeatures2d/boostdesc: Download: boostdesc_bgm.i xfeatures2d/boostdesc: Download: boostdesc_bgm_bi.i xfeatures2d/boostdesc: Download: boostdesc_bgm_hd.i xfeatures2d/boostdesc: Download: boostdesc_binboost_064.i xfeatures2d/boostdesc: Download: boostdesc_binboost_128.i xfeatures2d/boostdesc: Download: boostdesc_binboost_256.i xfeatures2d/boostdesc: Download: boostdesc_lbgm.i xfeatures2d/vgg: Download: vgg_generated_48.i xfeatures2d/vgg: Download: vgg_generated_64.i xfeatures2d/vgg: Download: vgg_generated_80.i xfeatures2d/vgg: Download: vgg_generated_120.i data: Download: face_landmark_model.dat No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available. Found installed version of gflags: C:/Lib/gflags/build_x64/lib/cmake/gflags Detected gflags version: 2.2.2 Found installed version of Eigen: E:/Lib_prebuild/eigen/build_x64/share/eigen3/cmake Found required Ceres dependency: Eigen version 3.3.7 in E:/Lib_prebuild/eigen/build_x64/include/eigen3 Found installed version of glog: E:/Lib_prebuild/glog/prebuild_x64 Detected glog version: 0.4.0 Found required Ceres dependency: glog Found installed version of gflags: C:/Lib/gflags/build_x64/lib/cmake/gflags Detected gflags version: 2.2.2 Found required Ceres dependency: gflags Ceres version 1.14.0 detected here: E:/Lib_prebuild/ceres-solver/build_x64 was built with C++11. Ceres target will add C++11 flags to compile options for targets using it. Found Ceres version: 1.14.0 installed in: E:/Lib_prebuild/ceres-solver/build_x64 with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, SchurSpecializations, C++11, OpenMP, Multithreading] Checking SFM deps... TRUE NVIDIA_OPTICAL_FLOW: Download: 79c6cee80a2df9a196f20afd6b598a9810964c32.zip CMake Warning at cmake/OpenCVGenSetupVars.cmake:54 (message): CONFIGURATION IS NOT SUPPORTED: validate setupvars script in install directory Call Stack (most recent call first): CMakeLists.txt:968 (include) General configuration for OpenCV 4.4.0-pre ===================================== Version control: 4.3.0-421-g0cbaaba4b1 Extra modules: Location (extra): E:/Lib_prebuild/opencv/source/opencv_contrib/modules Version control (extra): 4.3.0-62-g39ced2af Platform: Timestamp: 2020-06-14T07:00:26Z Host: Windows 10.0.17763 AMD64 CMake: 3.18.0-rc1 CMake generator: Visual Studio 15 2017 CMake build tool: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/MSBuild/15.0/Bin/MSBuild.exe MSVC: 1916 CPU/HW features: Baseline: SSE SSE2 SSE3 requested: SSE3 Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX requested: SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX SSE4_1 (15 files): + SSSE3 SSE4_1 SSE4_2 (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 (0 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX AVX (4 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX AVX2 (29 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX512_SKX (4 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_COMMON AVX512_SKX C/C++: Built as dynamic libs?: YES C++ standard: 11 C++ Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe (ver 19.16.27039.0) C++ flags (Release): /DWIN32 /D_WINDOWS /W4 /GR /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:precise /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /MP /MD /O2 /Ob2 /DNDEBUG C++ flags (Debug): /DWIN32 /D_WINDOWS /W4 /GR /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:precise /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /MP /MDd /Zi /Ob0 /Od /RTC1 C Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe C flags (Release): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:precise /MP /MD /O2 /Ob2 /DNDEBUG C flags (Debug): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:precise /MP /MDd /Zi /Ob0 /Od /RTC1 Linker flags (Release): /machine:x64 /INCREMENTAL:NO Linker flags (Debug): /machine:x64 /debug /INCREMENTAL ccache: NO Precompiled headers: YES Extra dependencies: cudart_static.lib nppc.lib nppial.lib nppicc.lib nppicom.lib nppidei.lib nppif.lib nppig.lib nppim.lib nppist.lib nppisu.lib nppitc.lib npps.lib cublas.lib cudnn.lib cufft.lib -LIBPATH:C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/lib/x64 3rdparty dependencies: OpenCV modules: To be built: alphamat aruco bgsegm bioinspired calib3d ccalib core cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev datasets dnn dnn_objdetect dnn_superres dpm face features2d flann fuzzy gapi hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor ml objdetect optflow ovis phase_unwrapping photo plot python3 quality rapid reg rgbd saliency sfm shape stereo stitching structured_light superres surface_matching text tracking video videoio videostab viz xfeatures2d ximgproc xobjdetect xphoto Disabled: world Disabled by dependency: - Unavailable: cnn_3dobj cvv freetype hdf java js matlab python2 ts Applications: examples apps Documentation: NO Non-free algorithms: NO Windows RT support: NO GUI: Win32 UI: YES VTK support: YES (ver 8.2.0) Media I/O: ZLib: build (ver 1.2.11) JPEG: build-libjpeg-turbo (ver 2.0.4-62) WEBP: build (ver encoder: 0x020f) PNG: build (ver 1.6.37) TIFF: build (ver 42 - 4.0.10) JPEG 2000: build Jasper (ver 1.900.1) OpenEXR: build (ver 2.3.0) HDR: YES SUNRASTER: YES PXM: YES PFM: YES Video I/O: DC1394: NO FFMPEG: YES (prebuilt binaries) avcodec: YES (58.54.100) avformat: YES (58.29.100) avutil: YES (56.31.100) swscale: YES (5.5.100) avresample: YES (4.0.0) GStreamer: NO DirectShow: YES Media Foundation: YES DXVA: YES Parallel framework: Concurrency Trace: YES (with Intel ITT) Other third-party libraries: Intel IPP: 2020.0.0 Gold [2020.0.0] at: E:/Lib_prebuild/opencv/prebuild_x64/3rdparty/ippicv/ippicv_win/icv Intel IPP IW: sources (2020.0.0) at: E:/Lib_prebuild/opencv/prebuild_x64/3rdparty/ippicv/ippicv_win/iw Lapack: YES (E:/Lib_prebuild/MKL/lib/mkl_intel_lp64.lib E:/Lib_prebuild/MKL/lib/mkl_sequential.lib E:/Lib_prebuild/MKL/lib/mkl_core.lib) Inference Engine: YES (2020030000 / 2.1.0) * libs: E:/Lib_prebuild/DLDT/dldt/bin/intel64/Release/inference_engine_c_api.lib / E:/Lib_prebuild/DLDT/dldt/bin/intel64/Debug/inference_engine_c_apid.lib E:/Lib_prebuild/DLDT/dldt/bin/intel64/Release/inference_engine_c_api.dll / E:/Lib_prebuild/DLDT/dldt/bin/intel64/Debug/inference_engine_c_apid.dll E:/Lib_prebuild/DLDT/dldt/bin/intel64/Release/inference_engine_c_api.dll E:/Lib_prebuild/DLDT/dldt/bin/intel64/Debug/inference_engine_c_apid.dll * includes: E:/Lib_prebuild/DLDT/dldt/inference-engine/ie_bridges/c/include Eigen: YES (ver 3.3.7) Custom HAL: NO Protobuf: build (3.5.1) NVIDIA CUDA: YES (ver 10.2, CUFFT CUBLAS) NVIDIA GPU arch: NVIDIA PTX archs: cuDNN: YES (ver 7.6.5) OpenCL: YES (NVD3D11) Include path: E:/Lib_prebuild/opencv/source/opencv/3rdparty/include/opencl/1.2 Link libraries: Dynamic load Python 3: Interpreter: C:/Program Files/Python37/python.exe (ver 3.7.7) Libraries: optimized C:/Program Files/Python37/libs/python37.lib debug C:/Program Files/Python37/libs/python37_d.lib (ver 3.7.7) numpy: C:/Program Files/Python37/lib/site-packages/numpy/core/include (ver 1.18.2) install path: C:/Program Files/Python37/Lib/site-packages/cv2/python-3.7 Python (for build): C:/Program Files/Python37/python.exe Java: ant: NO JNI: C:/Program Files/Java/jdk-14.0.1/include C:/Program Files/Java/jdk-14.0.1/include/win32 C:/Program Files/Java/jdk-14.0.1/include Java wrappers: NO Java tests: NO Install to: E:/Lib_prebuild/opencv/prebuild_x64/install ----------------------------------------------------------------- Configuring incomplete, errors occurred! See also "E:/Lib_prebuild/opencv/prebuild_x64/CMakeFiles/CMakeOutput.log". See also "E:/Lib_prebuild/opencv/prebuild_x64/CMakeFiles/CMakeError.log". </code></pre></div> </details> <p dir="auto">CMakeError and CMakeOutput log:<br> <a href="https://github.com/opencv/opencv/files/4776020/CMakeFiles.zip">CMakeFiles.zip</a></p>
<p dir="auto">OpenCV =&gt; 3.4.5<br> Operating System / Platform =&gt; Windows 10, 64 bit<br> Compiler =&gt; Visual Studio 2017</p> <p dir="auto">Alexander Alekhin closed my last bug with "duplicate", and "won't fix". I would love to know why it's a won't fix...</p> <p dir="auto">If you use the dynamically imported OpenCV core DLL, and you link against MFC, when the dll unloads, there are a ton of leaked memory complaints. I do believe these are real. If I repeatedly dynamically load and unload a DLL which itself links to OpenCV's core, this causes some serious termination bugs when attempting to call FreeLibrary( ) on my dll, which has loaded OpenCV. It makes my DLL nearly unusable.</p> <p dir="auto">somebody present a solution, workaround, doc, whatever, but the way it exists now is near intolerable.</p>
0
<p dir="auto">Currently, any container runtime has to be linked into the kubelet. This makes experimentation difficult, and prevents users from landing an alternate container runtime without landing code in core kubernetes.</p> <p dir="auto">To facilitate experimentation and to enable user choice, we should add a client/server implementation of the container runtime interface.</p> <p dir="auto">This implementation will simply encode the requests, send them to a server where they will be decoded and sent into an instance of the container runtime interface.</p> <p dir="auto">However, this enables container runtime implementations to be built and maintained outside of the core kubernetes tree.</p> <p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/dchen1107/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/dchen1107">@dchen1107</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/smarterclayton/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/smarterclayton">@smarterclayton</a><br> @kubernetes/goog-node</p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/smarterclayton/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/smarterclayton">@smarterclayton</a> raised this issue in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="36230582" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/199" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/199/hovercard" href="https://github.com/kubernetes/kubernetes/issues/199">#199</a>: how should Kubernetes support non-load-balanced and/or stateful services? Specifically, Zookeeper was the example.</p> <p dir="auto">Zookeeper (or etcd) exhibits 3 common problems:</p> <ol dir="auto"> <li>Identification of the instance(s) clients should contact</li> <li>Identification of peers</li> <li>Stateful instances</li> </ol> <p dir="auto">And it enables master election for other replicated services, which typically share the same problems, and probably need to advertise the elected master to clients.</p>
0
<ol dir="auto"> <li>Open project</li> <li>Right click for context menu on any project folder/file</li> </ol> <p dir="auto"><strong>Atom Version</strong>: 1.0.0<br> <strong>System</strong>: Microsoft Windows 8.1 Pro N<br> <strong>Thrown From</strong>: Atom Core</p> <h3 dir="auto">Stack Trace</h3> <p dir="auto">Uncaught Error: Cannot find module './context-menu'<br> Error: Cannot find module './context-menu'<br> at Function.Module._resolveFilename (module.js:328:15)<br> at Function.Module._load (module.js:270:25)<br> at Module.require (module.js:357:17)<br> at require (module.js:376:17)<br> at BrowserWindow. (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\app.asar\src\browser\atom-window.js:149:27)<br> at emitOne (events.js:77:13)<br> at BrowserWindow.emit (events.js:166:7)<br> at callFunction (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\atom.asar\browser\lib\rpc-server.js:116:18)<br> at EventEmitter. (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\atom.asar\browser\lib\rpc-server.js:208:14)<br> at emitMany (events.js:108:13)</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="At C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\atom.asar\renderer\api\lib\remote.js:77 Error: Cannot find module './context-menu' Error: Cannot find module './context-menu' at Function.Module._resolveFilename (module.js:328:15) at Function.Module._load (module.js:270:25) at Module.require (module.js:357:17) at require (module.js:376:17) at BrowserWindow.&lt;anonymous&gt; (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\app.asar\src\browser\atom-window.js:149:27) at emitOne (events.js:77:13) at BrowserWindow.emit (events.js:166:7) at callFunction (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\atom.asar\browser\lib\rpc-server.js:116:18) at EventEmitter.&lt;anonymous&gt; (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\atom.asar\browser\lib\rpc-server.js:208:14) at emitMany (events.js:108:13) at metaToValue (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\atom.asar\renderer\api\lib\remote.js:77:15) at BrowserWindow.RemoteMemberFunction [as emit] (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\atom.asar\renderer\api\lib\remote.js:111:26) at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\app.asar\src\context-menu-manager.js:170:31) at HTMLDocument.&lt;anonymous&gt; (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\app.asar\src\window-event-handler.js:150:33) at HTMLDocument.handler (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\app.asar\src\space-pen-extensions.js:112:34) at HTMLDocument.jQuery.event.dispatch (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\app.asar\node_modules\space-pen\vendor\jquery.js:4681:9) at HTMLDocument.elemData.handle (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\app.asar\node_modules\space-pen\vendor\jquery.js:4359:46) "><pre class="notranslate"><code class="notranslate">At C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\atom.asar\renderer\api\lib\remote.js:77 Error: Cannot find module './context-menu' Error: Cannot find module './context-menu' at Function.Module._resolveFilename (module.js:328:15) at Function.Module._load (module.js:270:25) at Module.require (module.js:357:17) at require (module.js:376:17) at BrowserWindow.&lt;anonymous&gt; (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\app.asar\src\browser\atom-window.js:149:27) at emitOne (events.js:77:13) at BrowserWindow.emit (events.js:166:7) at callFunction (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\atom.asar\browser\lib\rpc-server.js:116:18) at EventEmitter.&lt;anonymous&gt; (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\atom.asar\browser\lib\rpc-server.js:208:14) at emitMany (events.js:108:13) at metaToValue (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\atom.asar\renderer\api\lib\remote.js:77:15) at BrowserWindow.RemoteMemberFunction [as emit] (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\atom.asar\renderer\api\lib\remote.js:111:26) at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\app.asar\src\context-menu-manager.js:170:31) at HTMLDocument.&lt;anonymous&gt; (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\app.asar\src\window-event-handler.js:150:33) at HTMLDocument.handler (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\app.asar\src\space-pen-extensions.js:112:34) at HTMLDocument.jQuery.event.dispatch (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\app.asar\node_modules\space-pen\vendor\jquery.js:4681:9) at HTMLDocument.elemData.handle (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\app.asar\node_modules\space-pen\vendor\jquery.js:4359:46) </code></pre></div> <h3 dir="auto">Commands</h3> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" -4:13.2.0 core:backspace (atom-text-editor#editor.fontSize.editor.mini.is-focused) -1:37.4.0 core:confirm (atom-text-editor.editor.mini.is-focused)"><pre class="notranslate"><code class="notranslate"> -4:13.2.0 core:backspace (atom-text-editor#editor.fontSize.editor.mini.is-focused) -1:37.4.0 core:confirm (atom-text-editor.editor.mini.is-focused) </code></pre></div> <h3 dir="auto">Config</h3> <div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{ &quot;core&quot;: { &quot;themes&quot;: [ &quot;seti-ui&quot;, &quot;seti-syntax&quot; ], &quot;disabledPackages&quot;: [ &quot;atom-terminal&quot; ] }, &quot;editor&quot;: { &quot;invisibles&quot;: {}, &quot;fontFamily&quot;: &quot;Ubuntu Mono&quot;, &quot;confirmCheckoutHeadRevision&quot;: false, &quot;lineHeight&quot;: 1.3 } }"><pre class="notranslate">{ <span class="pl-ent">"core"</span>: { <span class="pl-ent">"themes"</span>: [ <span class="pl-s"><span class="pl-pds">"</span>seti-ui<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>seti-syntax<span class="pl-pds">"</span></span> ], <span class="pl-ent">"disabledPackages"</span>: [ <span class="pl-s"><span class="pl-pds">"</span>atom-terminal<span class="pl-pds">"</span></span> ] }, <span class="pl-ent">"editor"</span>: { <span class="pl-ent">"invisibles"</span>: {}, <span class="pl-ent">"fontFamily"</span>: <span class="pl-s"><span class="pl-pds">"</span>Ubuntu Mono<span class="pl-pds">"</span></span>, <span class="pl-ent">"confirmCheckoutHeadRevision"</span>: <span class="pl-c1">false</span>, <span class="pl-ent">"lineHeight"</span>: <span class="pl-c1">1.3</span> } }</pre></div> <h3 dir="auto">Installed Packages</h3> <div class="highlight highlight-source-coffee notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# User angularjs, v0.3.0 color-picker, v2.0.7 language-coffee-script-angular, v2.2.0 language-scala, v1.1.3 minimap, v4.10.0 pigments, v0.8.0 seti-syntax, v0.4.0 seti-ui, v0.7.1 # Dev No dev packages"><pre class="notranslate"><span class="pl-c"><span class="pl-c">#</span> User</span> angularjs, v0.<span class="pl-ii">3</span>.<span class="pl-ii">0</span> color<span class="pl-k">-</span>picker, v2.<span class="pl-ii">0</span>.<span class="pl-ii">7</span> language<span class="pl-k">-</span>coffee<span class="pl-k">-</span>script<span class="pl-k">-</span>angular, v2.<span class="pl-ii">2</span>.<span class="pl-ii">0</span> language<span class="pl-k">-</span>scala, v1.<span class="pl-ii">1</span>.<span class="pl-ii">3</span> minimap, v4.<span class="pl-ii">10</span>.<span class="pl-ii">0</span> pigments, v0.<span class="pl-ii">8</span>.<span class="pl-ii">0</span> seti<span class="pl-k">-</span>syntax, v0.<span class="pl-ii">4</span>.<span class="pl-ii">0</span> seti<span class="pl-k">-</span>ui, v0.<span class="pl-ii">7</span>.<span class="pl-ii">1</span> <span class="pl-c"><span class="pl-c">#</span> Dev</span> <span class="pl-en">No</span> <span class="pl-en">dev</span> packages</pre></div>
<ol dir="auto"> <li>Open project</li> <li>Right click for context menu on any project folder/file</li> </ol> <p dir="auto"><strong>Atom Version</strong>: 1.0.0<br> <strong>System</strong>: Microsoft Windows 8.1 Pro N<br> <strong>Thrown From</strong>: Atom Core</p> <h3 dir="auto">Stack Trace</h3> <p dir="auto">Uncaught Error: Cannot find module './context-menu'<br> Error: Cannot find module './context-menu'<br> at Function.Module._resolveFilename (module.js:328:15)<br> at Function.Module._load (module.js:270:25)<br> at Module.require (module.js:357:17)<br> at require (module.js:376:17)<br> at BrowserWindow. (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\app.asar\src\browser\atom-window.js:149:27)<br> at emitOne (events.js:77:13)<br> at BrowserWindow.emit (events.js:166:7)<br> at callFunction (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\atom.asar\browser\lib\rpc-server.js:116:18)<br> at EventEmitter. (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\atom.asar\browser\lib\rpc-server.js:208:14)<br> at emitMany (events.js:108:13)</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="At C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\atom.asar\renderer\api\lib\remote.js:77 Error: Cannot find module './context-menu' Error: Cannot find module './context-menu' at Function.Module._resolveFilename (module.js:328:15) at Function.Module._load (module.js:270:25) at Module.require (module.js:357:17) at require (module.js:376:17) at BrowserWindow.&lt;anonymous&gt; (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\app.asar\src\browser\atom-window.js:149:27) at emitOne (events.js:77:13) at BrowserWindow.emit (events.js:166:7) at callFunction (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\atom.asar\browser\lib\rpc-server.js:116:18) at EventEmitter.&lt;anonymous&gt; (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\atom.asar\browser\lib\rpc-server.js:208:14) at emitMany (events.js:108:13) at metaToValue (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\atom.asar\renderer\api\lib\remote.js:77:15) at BrowserWindow.RemoteMemberFunction [as emit] (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\atom.asar\renderer\api\lib\remote.js:111:26) at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\app.asar\src\context-menu-manager.js:170:31) at HTMLDocument.&lt;anonymous&gt; (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\app.asar\src\window-event-handler.js:150:33) at HTMLDocument.handler (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\app.asar\src\space-pen-extensions.js:112:34) at HTMLDocument.jQuery.event.dispatch (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\app.asar\node_modules\space-pen\vendor\jquery.js:4681:9) at HTMLDocument.elemData.handle (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\app.asar\node_modules\space-pen\vendor\jquery.js:4359:46) "><pre class="notranslate"><code class="notranslate">At C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\atom.asar\renderer\api\lib\remote.js:77 Error: Cannot find module './context-menu' Error: Cannot find module './context-menu' at Function.Module._resolveFilename (module.js:328:15) at Function.Module._load (module.js:270:25) at Module.require (module.js:357:17) at require (module.js:376:17) at BrowserWindow.&lt;anonymous&gt; (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\app.asar\src\browser\atom-window.js:149:27) at emitOne (events.js:77:13) at BrowserWindow.emit (events.js:166:7) at callFunction (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\atom.asar\browser\lib\rpc-server.js:116:18) at EventEmitter.&lt;anonymous&gt; (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\atom.asar\browser\lib\rpc-server.js:208:14) at emitMany (events.js:108:13) at metaToValue (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\atom.asar\renderer\api\lib\remote.js:77:15) at BrowserWindow.RemoteMemberFunction [as emit] (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\atom.asar\renderer\api\lib\remote.js:111:26) at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\app.asar\src\context-menu-manager.js:170:31) at HTMLDocument.&lt;anonymous&gt; (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\app.asar\src\window-event-handler.js:150:33) at HTMLDocument.handler (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\app.asar\src\space-pen-extensions.js:112:34) at HTMLDocument.jQuery.event.dispatch (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\app.asar\node_modules\space-pen\vendor\jquery.js:4681:9) at HTMLDocument.elemData.handle (C:\Users\filip_000\AppData\Local\atom\app-1.0.0\resources\app.asar\node_modules\space-pen\vendor\jquery.js:4359:46) </code></pre></div> <h3 dir="auto">Commands</h3> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" -4:13.2.0 core:backspace (atom-text-editor#editor.fontSize.editor.mini.is-focused) -1:37.4.0 core:confirm (atom-text-editor.editor.mini.is-focused)"><pre class="notranslate"><code class="notranslate"> -4:13.2.0 core:backspace (atom-text-editor#editor.fontSize.editor.mini.is-focused) -1:37.4.0 core:confirm (atom-text-editor.editor.mini.is-focused) </code></pre></div> <h3 dir="auto">Config</h3> <div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{ &quot;core&quot;: { &quot;themes&quot;: [ &quot;seti-ui&quot;, &quot;seti-syntax&quot; ], &quot;disabledPackages&quot;: [ &quot;atom-terminal&quot; ] }, &quot;editor&quot;: { &quot;invisibles&quot;: {}, &quot;fontFamily&quot;: &quot;Ubuntu Mono&quot;, &quot;confirmCheckoutHeadRevision&quot;: false, &quot;lineHeight&quot;: 1.3 } }"><pre class="notranslate">{ <span class="pl-ent">"core"</span>: { <span class="pl-ent">"themes"</span>: [ <span class="pl-s"><span class="pl-pds">"</span>seti-ui<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>seti-syntax<span class="pl-pds">"</span></span> ], <span class="pl-ent">"disabledPackages"</span>: [ <span class="pl-s"><span class="pl-pds">"</span>atom-terminal<span class="pl-pds">"</span></span> ] }, <span class="pl-ent">"editor"</span>: { <span class="pl-ent">"invisibles"</span>: {}, <span class="pl-ent">"fontFamily"</span>: <span class="pl-s"><span class="pl-pds">"</span>Ubuntu Mono<span class="pl-pds">"</span></span>, <span class="pl-ent">"confirmCheckoutHeadRevision"</span>: <span class="pl-c1">false</span>, <span class="pl-ent">"lineHeight"</span>: <span class="pl-c1">1.3</span> } }</pre></div> <h3 dir="auto">Installed Packages</h3> <div class="highlight highlight-source-coffee notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# User angularjs, v0.3.0 color-picker, v2.0.7 language-coffee-script-angular, v2.2.0 language-scala, v1.1.3 minimap, v4.10.0 pigments, v0.8.0 seti-syntax, v0.4.0 seti-ui, v0.7.1 # Dev No dev packages"><pre class="notranslate"><span class="pl-c"><span class="pl-c">#</span> User</span> angularjs, v0.<span class="pl-ii">3</span>.<span class="pl-ii">0</span> color<span class="pl-k">-</span>picker, v2.<span class="pl-ii">0</span>.<span class="pl-ii">7</span> language<span class="pl-k">-</span>coffee<span class="pl-k">-</span>script<span class="pl-k">-</span>angular, v2.<span class="pl-ii">2</span>.<span class="pl-ii">0</span> language<span class="pl-k">-</span>scala, v1.<span class="pl-ii">1</span>.<span class="pl-ii">3</span> minimap, v4.<span class="pl-ii">10</span>.<span class="pl-ii">0</span> pigments, v0.<span class="pl-ii">8</span>.<span class="pl-ii">0</span> seti<span class="pl-k">-</span>syntax, v0.<span class="pl-ii">4</span>.<span class="pl-ii">0</span> seti<span class="pl-k">-</span>ui, v0.<span class="pl-ii">7</span>.<span class="pl-ii">1</span> <span class="pl-c"><span class="pl-c">#</span> Dev</span> <span class="pl-en">No</span> <span class="pl-en">dev</span> packages</pre></div>
1
<pre class="notranslate">package main type X *[10]Y type Y X func main() { } //-------------------------------------------------------------- Compiler says: test.go:3: invalid recursive type Y Compiler version: cd89452cfea3 weekly/weekly.2011-04-04 I think these recursive types are perfectly valid, because X's size doesn't depend on Y's size.</pre>
<p dir="auto">by <strong>jonas.p</strong>:</p> <pre class="notranslate">What steps will reproduce the problem? try to get Subject Alternative Name URIs in the same way you can access DNSNames, EmailAddresses and IPAddresses <a href="http://play.golang.org/p/by0PoVfPyd" rel="nofollow">http://play.golang.org/p/by0PoVfPyd</a> What is the expected output? URIs returns the subject alternative name URIs of a certificate What do you see instead? URIs is not available Which version are you using? (run 'go version') go version devel +eec7eca4b11a Mon Jun 17 14:56:45 2013 -0700 linux/amd64 Please provide any additional information below. possible implementation: <a href="https://golang.org/cl/7501043/" rel="nofollow">https://golang.org/cl/7501043/</a></pre>
0
<h1 dir="auto">Checklist</h1> <h1 dir="auto">Checklist</h1> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/issues?utf8=%E2%9C%93&amp;q=is%3Aissue+label%3A%22Issue+Type%3A+Feature+Request%22+">issues list</a> for similar or identical feature requests.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/pulls?utf8=%E2%9C%93&amp;q=is%3Apr+label%3A%22PR+Type%3A+Feature%22+">pull requests list</a> for existing proposed implementations of this feature.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/commits/master">commit log</a> to find out if the if the same feature was already implemented in the master branch.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all related issues and possible duplicate issues in this issue (If there are none, check this box anyway).</li> </ul> <h1 dir="auto">Brief Summary</h1> <p dir="auto">In debugging another problem I noticed that the default connection timeout for the Redis result backend is unconfigurable, and the timeout is hardcoded at 20s (20 x 1s retries)</p> <p dir="auto">This appears to be only actually an issue for the Redis backend (RPC is the only other backend that appears to do anything in <code class="notranslate">on_task_call</code>)</p> <p dir="auto"><code class="notranslate">task.apply_async()</code> calls these functions</p> <p dir="auto"></p><div class="Box Box--condensed my-2"> <div class="Box-header f6"> <p class="mb-0 text-bold"> <a href="https://github.com/celery/celery/blob/d3863d909759f1fd618f2a1af1766ce54c16d39b/celery/app/base.py#L776-L780">celery/celery/app/base.py</a> </p> <p class="mb-0 color-fg-muted"> Lines 776 to 780 in <a data-pjax="true" class="commit-tease-sha" href="/celery/celery/commit/d3863d909759f1fd618f2a1af1766ce54c16d39b">d3863d9</a> </p> </div> <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data"> <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip=""> <tbody><tr class="border-0"> <td id="L776" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="776"></td> <td id="LC776" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">with</span> <span class="pl-s1">self</span>.<span class="pl-en">producer_or_acquire</span>(<span class="pl-s1">producer</span>) <span class="pl-k">as</span> <span class="pl-v">P</span>: </td> </tr> <tr class="border-0"> <td id="L777" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="777"></td> <td id="LC777" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">with</span> <span class="pl-v">P</span>.<span class="pl-s1">connection</span>.<span class="pl-en">_reraise_as_library_errors</span>(): </td> </tr> <tr class="border-0"> <td id="L778" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="778"></td> <td id="LC778" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-c1">not</span> <span class="pl-s1">ignored_result</span>: </td> </tr> <tr class="border-0"> <td id="L779" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="779"></td> <td id="LC779" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">self</span>.<span class="pl-s1">backend</span>.<span class="pl-en">on_task_call</span>(<span class="pl-v">P</span>, <span class="pl-s1">task_id</span>) </td> </tr> <tr class="border-0"> <td id="L780" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="780"></td> <td id="LC780" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">amqp</span>.<span class="pl-en">send_task_message</span>(<span class="pl-v">P</span>, <span class="pl-s1">name</span>, <span class="pl-s1">message</span>, <span class="pl-c1">**</span><span class="pl-s1">options</span>) </td> </tr> </tbody></table> </div> </div> <p></p> <p dir="auto"></p><div class="Box Box--condensed my-2"> <div class="Box-header f6"> <p class="mb-0 text-bold"> <a href="https://github.com/celery/celery/blob/bf6139bf651b20bc04b895a5f6eb8d50320bc252/celery/backends/redis.py#L342-L344">celery/celery/backends/redis.py</a> </p> <p class="mb-0 color-fg-muted"> Lines 342 to 344 in <a data-pjax="true" class="commit-tease-sha" href="/celery/celery/commit/bf6139bf651b20bc04b895a5f6eb8d50320bc252">bf6139b</a> </p> </div> <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data"> <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip=""> <tbody><tr class="border-0"> <td id="L342" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="342"></td> <td id="LC342" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">on_task_call</span>(<span class="pl-s1">self</span>, <span class="pl-s1">producer</span>, <span class="pl-s1">task_id</span>): </td> </tr> <tr class="border-0"> <td id="L343" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="343"></td> <td id="LC343" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-c1">not</span> <span class="pl-en">task_join_will_block</span>(): </td> </tr> <tr class="border-0"> <td id="L344" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="344"></td> <td id="LC344" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">self</span>.<span class="pl-s1">result_consumer</span>.<span class="pl-en">consume_from</span>(<span class="pl-s1">task_id</span>) </td> </tr> </tbody></table> </div> </div> <p></p> <p dir="auto"></p><div class="Box Box--condensed my-2"> <div class="Box-header f6"> <p class="mb-0 text-bold"> <a href="https://github.com/celery/celery/blob/bf6139bf651b20bc04b895a5f6eb8d50320bc252/celery/backends/redis.py#L167-L177">celery/celery/backends/redis.py</a> </p> <p class="mb-0 color-fg-muted"> Lines 167 to 177 in <a data-pjax="true" class="commit-tease-sha" href="/celery/celery/commit/bf6139bf651b20bc04b895a5f6eb8d50320bc252">bf6139b</a> </p> </div> <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data"> <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip=""> <tbody><tr class="border-0"> <td id="L167" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="167"></td> <td id="LC167" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">consume_from</span>(<span class="pl-s1">self</span>, <span class="pl-s1">task_id</span>): </td> </tr> <tr class="border-0"> <td id="L168" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="168"></td> <td id="LC168" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-s1">self</span>.<span class="pl-s1">_pubsub</span> <span class="pl-c1">is</span> <span class="pl-c1">None</span>: </td> </tr> <tr class="border-0"> <td id="L169" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="169"></td> <td id="LC169" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-s1">self</span>.<span class="pl-en">start</span>(<span class="pl-s1">task_id</span>) </td> </tr> <tr class="border-0"> <td id="L170" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="170"></td> <td id="LC170" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">self</span>.<span class="pl-en">_consume_from</span>(<span class="pl-s1">task_id</span>) </td> </tr> <tr class="border-0"> <td id="L171" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="171"></td> <td id="LC171" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> </td> </tr> <tr class="border-0"> <td id="L172" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="172"></td> <td id="LC172" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">_consume_from</span>(<span class="pl-s1">self</span>, <span class="pl-s1">task_id</span>): </td> </tr> <tr class="border-0"> <td id="L173" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="173"></td> <td id="LC173" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">key</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-en">_get_key_for_task</span>(<span class="pl-s1">task_id</span>) </td> </tr> <tr class="border-0"> <td id="L174" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="174"></td> <td id="LC174" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-s1">key</span> <span class="pl-c1">not</span> <span class="pl-c1">in</span> <span class="pl-s1">self</span>.<span class="pl-s1">subscribed_to</span>: </td> </tr> <tr class="border-0"> <td id="L175" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="175"></td> <td id="LC175" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">self</span>.<span class="pl-s1">subscribed_to</span>.<span class="pl-en">add</span>(<span class="pl-s1">key</span>) </td> </tr> <tr class="border-0"> <td id="L176" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="176"></td> <td id="LC176" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">with</span> <span class="pl-s1">self</span>.<span class="pl-en">reconnect_on_error</span>(): </td> </tr> <tr class="border-0"> <td id="L177" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="177"></td> <td id="LC177" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">self</span>.<span class="pl-s1">_pubsub</span>.<span class="pl-en">subscribe</span>(<span class="pl-s1">key</span>) </td> </tr> </tbody></table> </div> </div> <p></p> <p dir="auto"></p><div class="Box Box--condensed my-2"> <div class="Box-header f6"> <p class="mb-0 text-bold"> <a href="https://github.com/celery/celery/blob/bf6139bf651b20bc04b895a5f6eb8d50320bc252/celery/backends/redis.py#L124-L133">celery/celery/backends/redis.py</a> </p> <p class="mb-0 color-fg-muted"> Lines 124 to 133 in <a data-pjax="true" class="commit-tease-sha" href="/celery/celery/commit/bf6139bf651b20bc04b895a5f6eb8d50320bc252">bf6139b</a> </p> </div> <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data"> <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip=""> <tbody><tr class="border-0"> <td id="L124" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="124"></td> <td id="LC124" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-en">@<span class="pl-s1">contextmanager</span></span> </td> </tr> <tr class="border-0"> <td id="L125" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="125"></td> <td id="LC125" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">reconnect_on_error</span>(<span class="pl-s1">self</span>): </td> </tr> <tr class="border-0"> <td id="L126" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="126"></td> <td id="LC126" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">try</span>: </td> </tr> <tr class="border-0"> <td id="L127" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="127"></td> <td id="LC127" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">yield</span> </td> </tr> <tr class="border-0"> <td id="L128" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="128"></td> <td id="LC128" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">except</span> <span class="pl-s1">self</span>.<span class="pl-s1">_connection_errors</span>: </td> </tr> <tr class="border-0"> <td id="L129" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="129"></td> <td id="LC129" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">try</span>: </td> </tr> <tr class="border-0"> <td id="L130" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="130"></td> <td id="LC130" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">self</span>.<span class="pl-en">_ensure</span>(<span class="pl-s1">self</span>.<span class="pl-s1">_reconnect_pubsub</span>, ()) </td> </tr> <tr class="border-0"> <td id="L131" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="131"></td> <td id="LC131" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">except</span> <span class="pl-s1">self</span>.<span class="pl-s1">_connection_errors</span>: </td> </tr> <tr class="border-0"> <td id="L132" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="132"></td> <td id="LC132" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">logger</span>.<span class="pl-en">critical</span>(<span class="pl-v">E_RETRY_LIMIT_EXCEEDED</span>) </td> </tr> <tr class="border-0"> <td id="L133" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="133"></td> <td id="LC133" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">raise</span> </td> </tr> </tbody></table> </div> </div> <p></p> <p dir="auto"><code class="notranslate">_ensure</code> is set via </p><div class="Box Box--condensed my-2"> <div class="Box-header f6"> <p class="mb-0 text-bold"> <a href="https://github.com/celery/celery/blob/bf6139bf651b20bc04b895a5f6eb8d50320bc252/celery/backends/redis.py#L97">celery/celery/backends/redis.py</a> </p> <p class="mb-0 color-fg-muted"> Line 97 in <a data-pjax="true" class="commit-tease-sha" href="/celery/celery/commit/bf6139bf651b20bc04b895a5f6eb8d50320bc252">bf6139b</a> </p> </div> <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data"> <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip=""> <tbody><tr class="border-0"> <td id="L97" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="97"></td> <td id="LC97" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">self</span>.<span class="pl-s1">_ensure</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-s1">backend</span>.<span class="pl-s1">ensure</span> </td> </tr> </tbody></table> </div> </div> <p></p> <p dir="auto">to be </p><div class="Box Box--condensed my-2"> <div class="Box-header f6"> <p class="mb-0 text-bold"> <a href="https://github.com/celery/celery/blob/bf6139bf651b20bc04b895a5f6eb8d50320bc252/celery/backends/redis.py#L352-L358">celery/celery/backends/redis.py</a> </p> <p class="mb-0 color-fg-muted"> Lines 352 to 358 in <a data-pjax="true" class="commit-tease-sha" href="/celery/celery/commit/bf6139bf651b20bc04b895a5f6eb8d50320bc252">bf6139b</a> </p> </div> <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data"> <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip=""> <tbody><tr class="border-0"> <td id="L352" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="352"></td> <td id="LC352" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">ensure</span>(<span class="pl-s1">self</span>, <span class="pl-s1">fun</span>, <span class="pl-s1">args</span>, <span class="pl-c1">**</span><span class="pl-s1">policy</span>): </td> </tr> <tr class="border-0"> <td id="L353" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="353"></td> <td id="LC353" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">retry_policy</span> <span class="pl-c1">=</span> <span class="pl-en">dict</span>(<span class="pl-s1">self</span>.<span class="pl-s1">retry_policy</span>, <span class="pl-c1">**</span><span class="pl-s1">policy</span>) </td> </tr> <tr class="border-0"> <td id="L354" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="354"></td> <td id="LC354" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">max_retries</span> <span class="pl-c1">=</span> <span class="pl-s1">retry_policy</span>.<span class="pl-en">get</span>(<span class="pl-s">'max_retries'</span>) </td> </tr> <tr class="border-0"> <td id="L355" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="355"></td> <td id="LC355" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-en">retry_over_time</span>( </td> </tr> <tr class="border-0"> <td id="L356" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="356"></td> <td id="LC356" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">fun</span>, <span class="pl-s1">self</span>.<span class="pl-s1">connection_errors</span>, <span class="pl-s1">args</span>, {}, </td> </tr> <tr class="border-0"> <td id="L357" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="357"></td> <td id="LC357" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-en">partial</span>(<span class="pl-s1">self</span>.<span class="pl-s1">on_connection_error</span>, <span class="pl-s1">max_retries</span>), </td> </tr> <tr class="border-0"> <td id="L358" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="358"></td> <td id="LC358" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-c1">**</span><span class="pl-s1">retry_policy</span>) </td> </tr> </tbody></table> </div> </div> <p></p> <p dir="auto">But ensure is never passed any kwargs, nor is it set anywhere other than in the Backend supclass </p><div class="Box Box--condensed my-2"> <div class="Box-header f6"> <p class="mb-0 text-bold"> <a href="https://github.com/celery/celery/blob/bf6139bf651b20bc04b895a5f6eb8d50320bc252/celery/backends/base.py#L106-L111">celery/celery/backends/base.py</a> </p> <p class="mb-0 color-fg-muted"> Lines 106 to 111 in <a data-pjax="true" class="commit-tease-sha" href="/celery/celery/commit/bf6139bf651b20bc04b895a5f6eb8d50320bc252">bf6139b</a> </p> </div> <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data"> <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip=""> <tbody><tr class="border-0"> <td id="L106" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="106"></td> <td id="LC106" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">retry_policy</span> <span class="pl-c1">=</span> { </td> </tr> <tr class="border-0"> <td id="L107" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="107"></td> <td id="LC107" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s">'max_retries'</span>: <span class="pl-c1">20</span>, </td> </tr> <tr class="border-0"> <td id="L108" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="108"></td> <td id="LC108" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s">'interval_start'</span>: <span class="pl-c1">0</span>, </td> </tr> <tr class="border-0"> <td id="L109" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="109"></td> <td id="LC109" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s">'interval_step'</span>: <span class="pl-c1">1</span>, </td> </tr> <tr class="border-0"> <td id="L110" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="110"></td> <td id="LC110" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s">'interval_max'</span>: <span class="pl-c1">1</span>, </td> </tr> <tr class="border-0"> <td id="L111" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="111"></td> <td id="LC111" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> } </td> </tr> </tbody></table> </div> </div> <p></p> <h1 dir="auto">Design</h1> <p dir="auto">The "most obvious" way of doing this would be to add a new top-level <code class="notranslate">result_backend_options</code> config key that feeds in to the constructor.</p>
<p dir="auto">celery: 3.1.23 (Cipater)<br> rabbitmq-server:3.2.4-1</p> <p dir="auto">i found some task send to rabbitmq and then celery worker get duplicate task .</p> <p dir="auto">function:<br> def do_backup(name):<br> ....</p> <p dir="auto">for example:<br> server: do_backup.delay("/tmp/__36")</p> <p dir="auto">worker02:<br> [2016-06-23 20:38:27,182: INFO/MainProcess] Received task: tasks.do_backup[40159186-1b88-4d98-aabf-839bb4b7a852]<br> [2016-06-23 20:38:27,183: INFO/MainProcess] tasks.do_backup[40159186-1b88-4d98-aabf-839bb4b7a852]: get file name: /tmp/__36<br> worker12:<br> [2016-06-23 20:36:21,647: INFO/MainProcess] Received task: tasks.do_backup[d265ffba-fa21-48b6-baad-2c0185a3168f]<br> ........<br> [2016-06-23 20:37:01,492: INFO/MainProcess] tasks.do_backup[d265ffba-fa21-48b6-baad-2c0185a3168f]: get file name: /tmp/__36<br> [2016-06-23 20:37:01,554: INFO/MainProcess] tasks.do_backup[d265ffba-fa21-48b6-baad-2c0185a3168f]: do task</p> <p dir="auto">i make sure the server only send a "/tmp/__36"</p>
0
<h1 dir="auto">Checklist</h1> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/issues?utf8=%E2%9C%93&amp;q=is%3Aissue+label%3A%22Category%3A+Documentation%22+">issues list</a><br> for similar or identical bug reports.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/celery/celery/pulls?q=is%3Apr+label%3A%22Category%3A+Documentation%22">pull requests list</a><br> for existing proposed fixes.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/celery/celery/commits/master">commit log</a><br> to find out if the bug was already fixed in the master branch.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included all related issues and possible duplicate issues in this issue<br> (If there are none, check this box anyway).</li> </ul> <h2 dir="auto">Related Issues and Possible Duplicates</h2> <h4 dir="auto">Related Issues</h4> <ul dir="auto"> <li>None</li> </ul> <h4 dir="auto">Possible Duplicates</h4> <ul dir="auto"> <li>None</li> </ul> <h1 dir="auto">Description</h1> <p dir="auto">The documentation page (<a href="https://pypi.org/project/celery/" rel="nofollow">https://pypi.org/project/celery/</a>) has four broken links to webpages/documents. All links are to pages/documents that are no longer there. 404 errors are returned:</p> <ul dir="auto"> <li><a href="https://docs.celeryproject.org/en/stable/index.html" rel="nofollow">Web link at the top of the page</a><br> Get Started section:</li> <li><a href="http://docs.celeryproject.org/en/latest/getting-started/first-steps-with-celery.html" rel="nofollow">First Steps with Celery</a></li> <li><a href="http://docs.celeryproject.org/en/latest/getting-started/next-steps.html" rel="nofollow">Next Steps</a><br> Documentation Section:</li> <li><a href="https://docs.celeryproject.org/en/latest/" rel="nofollow">Latest Documentation</a></li> </ul> <h1 dir="auto">Suggestions</h1> <p dir="auto">Please fix those links so that both documents render as expected. As a developer completely new to Celery these missing documents leave quite a gap. Thanks in advance for your support and maintaining this library. I look forward to learning what Celery can do and making the most of it.</p>
<p dir="auto">This doesn't happen on 4.4.3, only on 4.4.4.</p> <p dir="auto">Here is a traceback:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last): File &quot;/usr/local/lib/python3.7/site-packages/kombu/utils/objects.py&quot;, line 42, in __get__ return obj.__dict__[self.__name__] KeyError: 'backend' During handling of the above exception, another exception occurred: Traceback (most recent call last): File &quot;&lt;stdin&gt;&quot;, line 2, in &lt;module&gt; File &quot;/usr/local/lib/python3.7/site-packages/celery/app/task.py&quot;, line 569, in apply_async **options File &quot;/usr/local/lib/python3.7/site-packages/celery/app/base.py&quot;, line 779, in send_task self.backend.on_task_call(P, task_id) File &quot;/usr/local/lib/python3.7/site-packages/kombu/utils/objects.py&quot;, line 44, in __get__ value = obj.__dict__[self.__name__] = self.__get(obj) File &quot;/usr/local/lib/python3.7/site-packages/celery/app/base.py&quot;, line 1232, in backend return self._get_backend() File &quot;/usr/local/lib/python3.7/site-packages/celery/app/base.py&quot;, line 949, in _get_backend self.loader) File &quot;/usr/local/lib/python3.7/site-packages/celery/app/backends.py&quot;, line 74, in by_url return by_name(backend, loader), url File &quot;/usr/local/lib/python3.7/site-packages/celery/app/backends.py&quot;, line 54, in by_name cls = symbol_by_name(backend, aliases) File &quot;/usr/local/lib/python3.7/site-packages/kombu/utils/imports.py&quot;, line 57, in symbol_by_name module = imp(module_name, package=package, **kwargs) File &quot;/usr/local/lib/python3.7/importlib/__init__.py&quot;, line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1006, in _gcd_import File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 983, in _find_and_load File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 967, in _find_and_load_unlocked File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 677, in _load_unlocked File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 728, in exec_module File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 219, in _call_with_frames_removed File &quot;/usr/local/lib/python3.7/site-packages/celery/backends/base.py&quot;, line 10, in &lt;module&gt; from future.utils import raise_with_traceback ModuleNotFoundError: No module named 'future'"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/kombu/utils/objects.py", line 42, in __get__ return obj.__dict__[self.__name__] KeyError: 'backend' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "&lt;stdin&gt;", line 2, in &lt;module&gt; File "/usr/local/lib/python3.7/site-packages/celery/app/task.py", line 569, in apply_async **options File "/usr/local/lib/python3.7/site-packages/celery/app/base.py", line 779, in send_task self.backend.on_task_call(P, task_id) File "/usr/local/lib/python3.7/site-packages/kombu/utils/objects.py", line 44, in __get__ value = obj.__dict__[self.__name__] = self.__get(obj) File "/usr/local/lib/python3.7/site-packages/celery/app/base.py", line 1232, in backend return self._get_backend() File "/usr/local/lib/python3.7/site-packages/celery/app/base.py", line 949, in _get_backend self.loader) File "/usr/local/lib/python3.7/site-packages/celery/app/backends.py", line 74, in by_url return by_name(backend, loader), url File "/usr/local/lib/python3.7/site-packages/celery/app/backends.py", line 54, in by_name cls = symbol_by_name(backend, aliases) File "/usr/local/lib/python3.7/site-packages/kombu/utils/imports.py", line 57, in symbol_by_name module = imp(module_name, package=package, **kwargs) File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "&lt;frozen importlib._bootstrap&gt;", line 1006, in _gcd_import File "&lt;frozen importlib._bootstrap&gt;", line 983, in _find_and_load File "&lt;frozen importlib._bootstrap&gt;", line 967, in _find_and_load_unlocked File "&lt;frozen importlib._bootstrap&gt;", line 677, in _load_unlocked File "&lt;frozen importlib._bootstrap_external&gt;", line 728, in exec_module File "&lt;frozen importlib._bootstrap&gt;", line 219, in _call_with_frames_removed File "/usr/local/lib/python3.7/site-packages/celery/backends/base.py", line 10, in &lt;module&gt; from future.utils import raise_with_traceback ModuleNotFoundError: No module named 'future' </code></pre></div> <p dir="auto">I'm running Python 3.7.4 on Debian v9.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="root@6b09806573e5:/app# cat /etc/*release* PRETTY_NAME=&quot;Debian GNU/Linux 9 (stretch)&quot; NAME=&quot;Debian GNU/Linux&quot; VERSION_ID=&quot;9&quot; VERSION=&quot;9 (stretch)&quot; VERSION_CODENAME=stretch ID=debian HOME_URL=&quot;https://www.debian.org/&quot; SUPPORT_URL=&quot;https://www.debian.org/support&quot; BUG_REPORT_URL=&quot;https://bugs.debian.org/&quot; root@6b09806573e5:/app# python --version Python 3.7.4 "><pre class="notranslate"><code class="notranslate">root@6b09806573e5:/app# cat /etc/*release* PRETTY_NAME="Debian GNU/Linux 9 (stretch)" NAME="Debian GNU/Linux" VERSION_ID="9" VERSION="9 (stretch)" VERSION_CODENAME=stretch ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/" root@6b09806573e5:/app# python --version Python 3.7.4 </code></pre></div> <h1 dir="auto">Checklist</h1> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> This has already been asked to the <a href="https://groups.google.com/forum/#!forum/celery-users" rel="nofollow">discussion group</a> first.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the relevant section in the<br> <a href="http://docs.celeryproject.org/en/latest/contributing.html#other-bugs" rel="nofollow">contribution guide</a><br> on reporting bugs.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/issues?q=is%3Aissue+label%3A%22Issue+Type%3A+Bug+Report%22+-label%3A%22Category%3A+Documentation%22">issues list</a><br> for similar or identical bug reports.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/pulls?q=is%3Apr+label%3A%22PR+Type%3A+Bugfix%22+-label%3A%22Category%3A+Documentation%22">pull requests list</a><br> for existing proposed fixes.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/commits/master">commit log</a><br> to find out if the bug was already fixed in the master branch.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all related issues and possible duplicate issues<br> in this issue (If there are none, check this box anyway).</li> </ul> <h2 dir="auto">Mandatory Debugging Information</h2> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included the output of <code class="notranslate">celery -A proj report</code> in the issue.<br> (if you are not able to do this, then at least specify the Celery<br> version affected).</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included the contents of <code class="notranslate">pip freeze</code> in the issue.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included all the versions of all the external dependencies required<br> to reproduce this bug.</li> </ul> <h2 dir="auto">Optional Debugging Information</h2> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one Python version<br> and/or implementation.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one message broker and/or<br> result backend.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one version of the message<br> broker and/or result backend.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one operating system.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one workers pool.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue with autoscaling, retries,<br> ETA/Countdown &amp; rate limits disabled.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue after downgrading<br> and/or upgrading Celery and its dependencies.</li> </ul> <h2 dir="auto">Related Issues and Possible Duplicates</h2> <h4 dir="auto">Related Issues</h4> <ul dir="auto"> <li>None</li> </ul> <h4 dir="auto">Possible Duplicates</h4> <ul dir="auto"> <li>None</li> </ul> <h2 dir="auto">Environment &amp; Settings</h2> <p dir="auto"><strong>Celery version</strong>:</p> <details> <summary><b><code class="notranslate">celery report</code> Output:</b></summary> <p dir="auto"> </p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate"></code></pre></div> <p dir="auto"></p> </details> <h1 dir="auto">Steps to Reproduce</h1> <h2 dir="auto">Required Dependencies</h2> <ul dir="auto"> <li><strong>Minimal Python Version</strong>: N/A or Unknown</li> <li><strong>Minimal Celery Version</strong>: N/A or Unknown</li> <li><strong>Minimal Kombu Version</strong>: N/A or Unknown</li> <li><strong>Minimal Broker Version</strong>: N/A or Unknown</li> <li><strong>Minimal Result Backend Version</strong>: N/A or Unknown</li> <li><strong>Minimal OS and/or Kernel Version</strong>: N/A or Unknown</li> <li><strong>Minimal Broker Client Version</strong>: N/A or Unknown</li> <li><strong>Minimal Result Backend Client Version</strong>: N/A or Unknown</li> </ul> <h3 dir="auto">Python Packages</h3> <details> <summary><b><code class="notranslate">pip freeze</code> Output:</b></summary> <p dir="auto"> </p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="root@6b09806573e5:/app# pip freeze amqp==2.6.0 bcrypt==3.1.7 beautifulsoup4==4.7.1 billiard==3.6.3.0 bleach==3.1.0 blinker==1.4 celery==4.4.4 certifi==2020.4.5.1 cffi==1.14.0 chardet==3.0.4 Click==7.0 cryptography==2.9.2 CvLib==3.3.7 decorator==4.4.2 docker==4.1.0 Flask==1.1.1 Flask-APIBlueprint==1.0.0 Flask-Limiter==1.0.1 Flask-SQLAlchemy==2.3.2 flask-swagger==0.2.13 html5lib==1.0.1 idna==2.8 importlib-metadata==1.6.0 itsdangerous==1.1.0 Jinja2==2.10.1 kombu==4.6.10 limits==1.5.1 MarkupSafe==1.1.1 marshmallow==3.0.0b2 mysqlclient==1.4.6 paramiko==2.4.1 pbr==5.4.5 py==1.8.1 pyasn1==0.4.8 pycparser==2.20 pymssql==2.1.4 PyNaCl==1.4.0 python-dateutil==2.8.0 pytz==2017.2 PyYAML==5.3.1 requests==2.21.0 retry==0.9.2 six==1.15.0 soupsieve==2.0.1 SQLAlchemy==1.2.18 sshtunnel==0.1.5 urllib3==1.24.3 uWSGI==2.0.18 vine==1.3.0 webencodings==0.5.1 websocket-client==0.57.0 Werkzeug==0.16.0 zipp==3.1.0"><pre class="notranslate"><code class="notranslate">root@6b09806573e5:/app# pip freeze amqp==2.6.0 bcrypt==3.1.7 beautifulsoup4==4.7.1 billiard==3.6.3.0 bleach==3.1.0 blinker==1.4 celery==4.4.4 certifi==2020.4.5.1 cffi==1.14.0 chardet==3.0.4 Click==7.0 cryptography==2.9.2 CvLib==3.3.7 decorator==4.4.2 docker==4.1.0 Flask==1.1.1 Flask-APIBlueprint==1.0.0 Flask-Limiter==1.0.1 Flask-SQLAlchemy==2.3.2 flask-swagger==0.2.13 html5lib==1.0.1 idna==2.8 importlib-metadata==1.6.0 itsdangerous==1.1.0 Jinja2==2.10.1 kombu==4.6.10 limits==1.5.1 MarkupSafe==1.1.1 marshmallow==3.0.0b2 mysqlclient==1.4.6 paramiko==2.4.1 pbr==5.4.5 py==1.8.1 pyasn1==0.4.8 pycparser==2.20 pymssql==2.1.4 PyNaCl==1.4.0 python-dateutil==2.8.0 pytz==2017.2 PyYAML==5.3.1 requests==2.21.0 retry==0.9.2 six==1.15.0 soupsieve==2.0.1 SQLAlchemy==1.2.18 sshtunnel==0.1.5 urllib3==1.24.3 uWSGI==2.0.18 vine==1.3.0 webencodings==0.5.1 websocket-client==0.57.0 Werkzeug==0.16.0 zipp==3.1.0 </code></pre></div> <p dir="auto"></p> </details> <h3 dir="auto">Other Dependencies</h3> <details> <p dir="auto"> N/A </p> </details> <h2 dir="auto">Minimally Reproducible Test Case</h2> <details> <p dir="auto"> </p><div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"></pre></div> <p dir="auto"></p> </details> <h1 dir="auto">Expected Behavior</h1> <h1 dir="auto">Actual Behavior</h1>
0
<p dir="auto">If an async op is not listed in the <code class="notranslate">OP_DETAILS</code> map in <code class="notranslate">40_testing.js</code>, you can get the following exception:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator)) at asyncOpSanitizer (deno:runtime/js/40_testing.js:177:32) at async resourceSanitizer (deno:runtime/js/40_testing.js:369:7) at async Object.exitSanitizer [as fn] (deno:runtime/js/40_testing.js:426:9) at async runTest (deno:runtime/js/40_testing.js:786:7) at async Object.runTests (deno:runtime/js/40_testing.js:984:22)"><pre class="notranslate"><code class="notranslate">TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator)) at asyncOpSanitizer (deno:runtime/js/40_testing.js:177:32) at async resourceSanitizer (deno:runtime/js/40_testing.js:369:7) at async Object.exitSanitizer [as fn] (deno:runtime/js/40_testing.js:426:9) at async runTest (deno:runtime/js/40_testing.js:786:7) at async Object.runTests (deno:runtime/js/40_testing.js:984:22) </code></pre></div> <p dir="auto">Presumably some fallback message should show up in these cases, in case a new op is mistakenly left out, and for ease of development.</p> <p dir="auto">Additionally, some async ops related to resources (<code class="notranslate">op_read</code>, <code class="notranslate">op_write</code>, <code class="notranslate">op_shutdown</code>) and workers (<code class="notranslate">op_host_recv_ctrl</code>, <code class="notranslate">op_host_recv_message</code>) are currently missing.</p>
<p dir="auto">I don't have a clear reproduction path for this issue but I dug into the 40_testing.js code and I believe I found the cause of the issue. A user of my test_suite module opened <a href="https://github.com/udibo/test_suite/issues/16#issuecomment-1046193210" data-hovercard-type="issue" data-hovercard-url="/udibo/test_suite/issues/16/hovercard">an issue</a> saying they were getting an error when upgrading to the newest version that uses the test step API. The user reported they are using Deno 1.19. Looking at the error message, it appeared to actually be an issue with Deno's test runner.</p> <p dir="auto">The Deno.metrics().ops object has 281 keys. The OP_DETAILS object in <a href="https://github.com/denoland/deno/blob/v1.19.0/runtime/js/40_testing.js#L64">40_testing.js</a> only has 67 of those keys.</p> <p dir="auto">In the asyncOpSanitizer, if there is a difference in ops dispatched and completed, it will try getting hint information from the OP_DETAILS <a href="https://github.com/denoland/deno/blob/v1.19.0/runtime/js/40_testing.js#L176">here</a> using destructuring assignment (shown below). If there isn't a hint in OP_DETAILS for the key, then the value returned from <code class="notranslate">OP_DETAILS[key]</code> is going to return undefined and you can't destructure undefined.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const [name, hint] = OP_DETAILS[key];"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-kos">[</span><span class="pl-s1">name</span><span class="pl-kos">,</span> <span class="pl-s1">hint</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-c1">OP_DETAILS</span><span class="pl-kos">[</span><span class="pl-s1">key</span><span class="pl-kos">]</span><span class="pl-kos">;</span></pre></div> <p dir="auto">If the key happens to be one that is undefined, this will throw the following error.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator)) at asyncOpSanitizer (deno:runtime/js/40_testing.js:176:32)"><pre class="notranslate">TypeError: <span class="pl-c1">undefined</span> <span class="pl-s1">is</span> <span class="pl-s1">not</span> <span class="pl-s1">iterable</span> <span class="pl-kos">(</span><span class="pl-s1">cannot</span> <span class="pl-s1">read</span> <span class="pl-s1">property</span> <span class="pl-v">Symbol</span><span class="pl-kos">(</span><span class="pl-v">Symbol</span><span class="pl-kos">.</span><span class="pl-c1">iterator</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-s1">at</span><span class="pl-kos"></span> <span class="pl-en">asyncOpSanitizer</span> <span class="pl-kos">(</span><span class="pl-s1">deno</span>:<span class="pl-s1">runtime</span><span class="pl-c1">/</span><span class="pl-s1">js</span><span class="pl-c1">/</span><span class="pl-c1">40</span><span class="pl-s1">_testing</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">176</span>:<span class="pl-c1">32</span><span class="pl-kos">)</span></pre></div>
1
<p dir="auto">Logs and details after the comment here <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="9093319" data-permission-text="Title is private" data-url="https://github.com/celery/celery/issues/1118" data-hovercard-type="issue" data-hovercard-url="/celery/celery/issues/1118/hovercard?comment_id=16307366&amp;comment_type=issue_comment" href="https://github.com/celery/celery/issues/1118#issuecomment-16307366">#1118 (comment)</a></p> <p dir="auto">Test code: <a href="https://gist.github.com/ionelmc/4259997">https://gist.github.com/ionelmc/4259997</a></p>
<p dir="auto">I am using Celery version 3.0.19 from pypi (upgraded and tested today). Here are my steps to reproduce:</p> <p dir="auto">app.py:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from time import sleep from celery import Celery celery = Celery(broker=&quot;amqp://&quot;) celery.conf.update( CELERYD_CONCURRENCY=1, CELERYD_MAX_TASKS_PER_CHILD=1, ) @celery.task def accept_argument(argument): sleep(5)"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">time</span> <span class="pl-k">import</span> <span class="pl-s1">sleep</span> <span class="pl-k">from</span> <span class="pl-s1">celery</span> <span class="pl-k">import</span> <span class="pl-v">Celery</span> <span class="pl-s1">celery</span> <span class="pl-c1">=</span> <span class="pl-v">Celery</span>(<span class="pl-s1">broker</span><span class="pl-c1">=</span><span class="pl-s">"amqp://"</span>) <span class="pl-s1">celery</span>.<span class="pl-s1">conf</span>.<span class="pl-en">update</span>( <span class="pl-v">CELERYD_CONCURRENCY</span><span class="pl-c1">=</span><span class="pl-c1">1</span>, <span class="pl-v">CELERYD_MAX_TASKS_PER_CHILD</span><span class="pl-c1">=</span><span class="pl-c1">1</span>, ) <span class="pl-en">@<span class="pl-s1">celery</span>.<span class="pl-s1">task</span></span> <span class="pl-k">def</span> <span class="pl-en">accept_argument</span>(<span class="pl-s1">argument</span>): <span class="pl-en">sleep</span>(<span class="pl-c1">5</span>)</pre></div> <p dir="auto">script.py:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from app import accept_argument big_data = &quot;A&quot; * 1024 * 1024 * 8 accept_argument.delay(big_data) accept_argument.delay(big_data)"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">app</span> <span class="pl-k">import</span> <span class="pl-s1">accept_argument</span> <span class="pl-s1">big_data</span> <span class="pl-c1">=</span> <span class="pl-s">"A"</span> <span class="pl-c1">*</span> <span class="pl-c1">1024</span> <span class="pl-c1">*</span> <span class="pl-c1">1024</span> <span class="pl-c1">*</span> <span class="pl-c1">8</span> <span class="pl-s1">accept_argument</span>.<span class="pl-en">delay</span>(<span class="pl-s1">big_data</span>) <span class="pl-s1">accept_argument</span>.<span class="pl-en">delay</span>(<span class="pl-s1">big_data</span>)</pre></div> <p dir="auto">Run the worker:</p> <div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ celery worker --app=app -l info"><pre class="notranslate">$ celery worker --app=app -l info</pre></div> <p dir="auto">Crash the worker:</p> <div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ python script.py"><pre class="notranslate">$ python script.py</pre></div> <p dir="auto">Expected result:</p> <ul dir="auto"> <li>Both tasks are run, in sequence.</li> <li>The worker (sub)process restarts at the 5 second mark after the first task completes (MAX_TASKS_PER_CHILD=1 reached)</li> <li>The worker process restarts at the 10 second mark after the second task.</li> </ul> <p dir="auto">Actual result:</p> <ul dir="auto"> <li>The first task runs.</li> <li>The first worker process goes into a zombie state.</li> <li>The worker main process hangs in Modules/_billiard/socket_connection.c <ul dir="auto"> <li>Observe by attaching gdb to the running process.</li> <li>Presumably the main process is writing the second task to the zombie original worker, but should be writing it to a new worker process.</li> </ul> </li> </ul> <p dir="auto">I strongly suspect that this is the same problem as issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="6579399" data-permission-text="Title is private" data-url="https://github.com/celery/celery/issues/957" data-hovercard-type="issue" data-hovercard-url="/celery/celery/issues/957/hovercard" href="https://github.com/celery/celery/issues/957">#957</a>, but that was closed-presumed-fixed as of version 3.0.13 and I am using a later version of Celery.</p> <p dir="auto">EDIT: tweaking reproduction code.</p>
1
<p dir="auto"><strong>Migrated issue, originally created by Fayaz Khan (<a href="https://github.com/fayaz">@fayaz</a>)</strong></p> <p dir="auto">In this specific scenario, <code class="notranslate">query.count()</code> &amp; <code class="notranslate">len(query.all())</code> do not match:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from sqlalchemy import create_engine, Column, ForeignKey, Integer, Table from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship, sessionmaker Base = declarative_base() promo_like_association = Table( 'promo_like_association', Base.metadata, Column('promo_id', ForeignKey('promo.id'), primary_key=True), Column('like_id', ForeignKey('like.id'), primary_key=True)) user_like_association = Table( 'user_like_association', Base.metadata, Column('user_id', ForeignKey('user.id'), primary_key=True), Column('like_id', ForeignKey('like.id'), primary_key=True)) class Like(Base): __tablename__ = 'like' id = Column(Integer, primary_key=True) users = relationship( 'User', secondary=user_like_association, backref='likes') class Promo(Base): __tablename__ = 'promo' id = Column(Integer, primary_key=True) likes = relationship(Like, secondary=promo_like_association) class User(Base): __tablename__ = 'user' id = Column(Integer, primary_key=True) def main(): database_uri = 'sqlite:///' engine = create_engine(database_uri) Session = sessionmaker(bind=engine) session = Session() Base.metadata.create_all(engine) user = User(likes=[Like()]) session.add(user) session.add(Promo()) check(session, Like.users.any(id=user.id)) check(session, Like.users.contains(user)) user.likes.append(Like()) check(session, Like.users.any(id=user.id)) check(session, Like.users.contains(user)) # Fails def check(session, condition): # query tries to fetch promos for user with common likes # or promos that have no specific likes at all. query = (session.query(Promo).outerjoin(Promo.likes) .filter(condition | ~Promo.likes.any())) assert query.count() == len(query.all()) == 1 if __name__ == '__main__': main() "><pre class="notranslate"><code class="notranslate">from sqlalchemy import create_engine, Column, ForeignKey, Integer, Table from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship, sessionmaker Base = declarative_base() promo_like_association = Table( 'promo_like_association', Base.metadata, Column('promo_id', ForeignKey('promo.id'), primary_key=True), Column('like_id', ForeignKey('like.id'), primary_key=True)) user_like_association = Table( 'user_like_association', Base.metadata, Column('user_id', ForeignKey('user.id'), primary_key=True), Column('like_id', ForeignKey('like.id'), primary_key=True)) class Like(Base): __tablename__ = 'like' id = Column(Integer, primary_key=True) users = relationship( 'User', secondary=user_like_association, backref='likes') class Promo(Base): __tablename__ = 'promo' id = Column(Integer, primary_key=True) likes = relationship(Like, secondary=promo_like_association) class User(Base): __tablename__ = 'user' id = Column(Integer, primary_key=True) def main(): database_uri = 'sqlite:///' engine = create_engine(database_uri) Session = sessionmaker(bind=engine) session = Session() Base.metadata.create_all(engine) user = User(likes=[Like()]) session.add(user) session.add(Promo()) check(session, Like.users.any(id=user.id)) check(session, Like.users.contains(user)) user.likes.append(Like()) check(session, Like.users.any(id=user.id)) check(session, Like.users.contains(user)) # Fails def check(session, condition): # query tries to fetch promos for user with common likes # or promos that have no specific likes at all. query = (session.query(Promo).outerjoin(Promo.likes) .filter(condition | ~Promo.likes.any())) assert query.count() == len(query.all()) == 1 if __name__ == '__main__': main() </code></pre></div> <p dir="auto">This will fail with:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last): File &quot;test_sqla_contains.py&quot;, line 60, in &lt;module&gt; main() File &quot;test_sqla_contains.py&quot;, line 48, in main check(session, Like.users.contains(user)) # Fails File &quot;test_sqla_contains.py&quot;, line 56, in check assert query.count() == len(query.all()) == 1 AssertionError "><pre class="notranslate"><code class="notranslate">Traceback (most recent call last): File "test_sqla_contains.py", line 60, in &lt;module&gt; main() File "test_sqla_contains.py", line 48, in main check(session, Like.users.contains(user)) # Fails File "test_sqla_contains.py", line 56, in check assert query.count() == len(query.all()) == 1 AssertionError </code></pre></div> <p dir="auto">I'm working around the issue using <code class="notranslate">any(id=...)</code> instead of <code class="notranslate">contains()</code>.</p>
<p dir="auto"><strong>Migrated issue, originally created by Anonymous</strong></p> <p dir="auto">Currently it throws error at</p> <p dir="auto">File "C:\Python26\lib\site-packages\sqlalchemy-0.7.6-py2.6-win32.egg\sqlalchemy\sql\compiler.py", line 927, in visit_table<br> hinttext = self.get_from_hint_text(table, fromhints<a href="table">table</a>)<br> TypeError: get_from_hint_text() takes exactly 2 arguments (3 given)</p> <p dir="auto">the problem is that signature in mssql dialect is</p> <p dir="auto">def get_from_hint_text(self, text):<br> return text</p> <p dir="auto">Hence we should change the either the signature by adding table as argument or remove table parameter from sqlalchemy\sql\compiler.py", line 927</p>
0
<p dir="auto">Greetings,</p> <p dir="auto">continuation from this problem <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="98657385" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/12134" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/12134/hovercard" href="https://github.com/kubernetes/kubernetes/issues/12134">#12134</a><br> thanks brendan, after the update, nodes were restarted and all containers started without problems, but there is one thing I am really afraid of my <code class="notranslate">mongodb</code> instances.</p> <p dir="auto">I'm using this yaml file, just cut the container list.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="apiVersion: v1 kind: ReplicationController metadata: name: mongodb-shard1-controller spec: replicas: 2 selector: name: mongodb-shard1-controller version: v0 template: metadata: labels: name: mongodb-shard1-controller version: v0 spec: containers: - name: mongodb-node1 image: gcr.io/app/mongodb3.0.4 ports: - containerPort: 27017 hostPort: 27031 env: - name: REPL_SET value: kube_shard1 volumeMounts: - mountPath: /data/db name: db-path volumes: - name: db-path source: emptyDir: {}"><pre class="notranslate"><code class="notranslate">apiVersion: v1 kind: ReplicationController metadata: name: mongodb-shard1-controller spec: replicas: 2 selector: name: mongodb-shard1-controller version: v0 template: metadata: labels: name: mongodb-shard1-controller version: v0 spec: containers: - name: mongodb-node1 image: gcr.io/app/mongodb3.0.4 ports: - containerPort: 27017 hostPort: 27031 env: - name: REPL_SET value: kube_shard1 volumeMounts: - mountPath: /data/db name: db-path volumes: - name: db-path source: emptyDir: {} </code></pre></div> <p dir="auto">it may not be the best, but I am using it in production. after the nodes restarted, all replica sets of mongodb instances, could not connect on to each other, and other than that, databases are gone. and I could not get it back up w/databases. i don't know where is <code class="notranslate">/data/db</code> gone?</p> <p dir="auto">I'm using <code class="notranslate">GCP</code>, what is the best practice for database storages?</p>
<p dir="auto">There are currently two different ways of determining request information: <a href="https://github.com/GoogleCloudPlatform/kubernetes/blob/master/pkg/apiserver/handlers.go#L264">https://github.com/GoogleCloudPlatform/kubernetes/blob/master/pkg/apiserver/handlers.go#L264</a> and the system of record: <a href="https://github.com/GoogleCloudPlatform/kubernetes/blob/master/pkg/apiserver/api_installer.go#L97">https://github.com/GoogleCloudPlatform/kubernetes/blob/master/pkg/apiserver/api_installer.go#L97</a> that actually dispatches the calls.</p> <p dir="auto">Having two mechanisms for determining what verb/namespace/resource/subresource/etc information on the request means that the authorizer can end up out of sync with reality. Collapsing the determination of request information to a single spot with a separate authorize call is one way to eliminate the duplication and avoid false authorization matches due to out of sync request information parsing.</p> <p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/smarterclayton/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/smarterclayton">@smarterclayton</a> I think this would address the problem we're having with subresource policy determinations.</p>
0
<p dir="auto"><strong>I'm submitting a ...</strong> (check one with "x")</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[X] bug report [ ] feature request [ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question"><pre class="notranslate"><code class="notranslate">[X] bug report [ ] feature request [ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question </code></pre></div> <p dir="auto"><strong>Current behavior</strong><br> In Hybrid mode (when bootstrapped using upgradeAdatper.bootstrap()), the <strong><code class="notranslate">&lt;ng-content select ='' &gt;</code></strong> attribute on the downgraded ng2 component is not honored. it seems that select='' expression is ignored completely and all the light DOM child elements are included.</p> <p dir="auto"><strong>Expected/desired behavior</strong><br> In Hybrid mode, the <code class="notranslate">&lt;ng-content select=''&gt;</code> attribute should be honored and should include only those DOM element matching the 'select' criteria.</p> <p dir="auto"><strong>Reproduction of the problem</strong><br> Here is the plunker <a href="https://plnkr.co/edit/L7Flah?p=preview" rel="nofollow">https://plnkr.co/edit/L7Flah?p=preview</a></p> <p dir="auto"><strong>What is the expected behavior?</strong></p> <p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong></p> <p dir="auto">It breaks the desired ng2 component behavior in hybrid mode.</p> <p dir="auto"><strong>Please tell us about your environment:</strong></p> <ul dir="auto"> <li><strong>Angular version:</strong> 2.0.0-rc.1</li> <li><strong>Browser:</strong> [Chrome XX ]<br> Tested in Chrome Version 51.0.2704.103 m</li> <li><strong>Language:</strong> [all | TypeScript X.X | ES6/7 | ES5 | Dart]<br> <a href="https://code.angularjs.org/tools/typescript.js" rel="nofollow">https://code.angularjs.org/tools/typescript.js</a></li> </ul>
<h3 dir="auto">Bug Report</h3> <p dir="auto">Angular version: 2.0.0-beta.11<br> Browser: [all]<br> Language: [Typescript]</p> <h3 dir="auto">Description</h3> <p dir="auto">When downgrading an Angular 2 component to use in an Angular 1 application, the downgraded directive crashes if the original component uses multi-projection with more than 1 slot, for instance:</p> <div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;ng-content select=&quot;.foo&quot;&gt;&lt;/ng-content&gt; &lt;ng-content select=&quot;.bar&quot;&gt;&lt;/ng-content&gt;"><pre class="notranslate"><span class="pl-kos">&lt;</span><span class="pl-ent">ng-content</span> <span class="pl-c1">select</span>="<span class="pl-s">.foo</span>"<span class="pl-kos">&gt;</span><span class="pl-kos">&lt;/</span><span class="pl-ent">ng-content</span><span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">ng-content</span> <span class="pl-c1">select</span>="<span class="pl-s">.bar</span>"<span class="pl-kos">&gt;</span><span class="pl-kos">&lt;/</span><span class="pl-ent">ng-content</span><span class="pl-kos">&gt;</span></pre></div> <p dir="auto">The error thrown is <code class="notranslate">Error: The component {XXX} has {N} &lt;ng-content&gt; elements, but only 1 slots were provided.</code></p> <h3 dir="auto">Reproduce</h3> <p dir="auto">See <a href="http://plnkr.co/edit/JvjE9fodGnauwQNO7j5v?p=preview" rel="nofollow">this plunker</a> for a minimal example that reproduces the bug.</p> <p dir="auto">Thanks.</p>
1
<p dir="auto">Hi,</p> <p dir="auto"><a href="https://babeljs.io/repl/#?experimental=true&amp;evaluate=false&amp;loose=false&amp;spec=false&amp;code=async%20function%20test%28%20%7B%20a%20%7D%20%3D%20%7B%20%7D%20%29%20%7B%0A%20%20alert%28%20a%20%29%3B%0A%20%20alert%28%20arguments%20%29%3B%0A%7D%0A%0Atest%28%20%7B%20a%20%3A%2010%20%7D%20%29%3B%0A" rel="nofollow">(demo)</a></p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="async function test( { a } = { } ) { alert( a ); alert( arguments ); } test( { a : 10 } );"><pre class="notranslate"><span class="pl-k">async</span> <span class="pl-k">function</span> <span class="pl-en">test</span><span class="pl-kos">(</span> <span class="pl-kos">{</span> a <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span> <span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-en">alert</span><span class="pl-kos">(</span> <span class="pl-s1">a</span> <span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">alert</span><span class="pl-kos">(</span> <span class="pl-smi">arguments</span> <span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-en">test</span><span class="pl-kos">(</span> <span class="pl-kos">{</span> <span class="pl-c1">a</span> : <span class="pl-c1">10</span> <span class="pl-kos">}</span> <span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p dir="auto">Babel will alert undefined, because the destructuring parameters are evaluated inside the regenerator wrapper, which doesn't preserve the <code class="notranslate">arguments</code> variable. Actually, any use of <code class="notranslate">arguments</code> inside the body of an async function will fail.</p>
<p dir="auto">Here's the code snippet:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const x = ({ a = 1 } = {}) =&gt; a console.log(x()) // 1 console.log(x({})) // 1 console.log(x({ a: 5 })) // 5 const y = async ({ a = 1 } = {}) =&gt; a async () =&gt; { console.log(await y()) // 1 console.log(await y({})) // 1 console.log(await y({ a: 5 })) // 1 (expected 5) }()"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-en">x</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> a <span class="pl-c1">=</span> <span class="pl-c1">1</span> <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-s1">a</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-en">x</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-c">// 1</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-en">x</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-c">// 1</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-en">x</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">a</span>: <span class="pl-c1">5</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-c">// 5</span> <span class="pl-k">const</span> <span class="pl-en">y</span> <span class="pl-c1">=</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> a <span class="pl-c1">=</span> <span class="pl-c1">1</span> <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-s1">a</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-k">await</span> <span class="pl-en">y</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-c">// 1</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-k">await</span> <span class="pl-en">y</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-c">// 1</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-k">await</span> <span class="pl-en">y</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">a</span>: <span class="pl-c1">5</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-c">// 1 (expected 5)</span> <span class="pl-kos">}</span><span class="pl-kos">(</span><span class="pl-kos">)</span></pre></div> <p dir="auto">Using Babel 4.7.12 (experimental mode).</p> <p dir="auto">Works without the <code class="notranslate">= {}</code>, but then it don't allow passing no argument to the function.</p> <p dir="auto">The above snippet was compiled as (for just the <code class="notranslate">y</code> function):</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" var y = function callee$0$0() { var _ref, _ref$a, a; return _regeneratorRuntime.async(function callee$0$0$(context$1$0) { while (1) switch (context$1$0.prev = context$1$0.next) { case 0: _ref = arguments[0] === undefined ? {} : arguments[0]; _ref$a = _ref.a; a = _ref$a === undefined ? 1 : _ref$a; return context$1$0.abrupt(&quot;return&quot;, a); case 4: case &quot;end&quot;: return context$1$0.stop(); } }, null, _this); };"><pre class="notranslate"> <span class="pl-k">var</span> <span class="pl-en">y</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-en">callee$0$0</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">var</span> <span class="pl-s1">_ref</span><span class="pl-kos">,</span> <span class="pl-s1">_ref$a</span><span class="pl-kos">,</span> <span class="pl-s1">a</span><span class="pl-kos">;</span> <span class="pl-k">return</span> <span class="pl-s1">_regeneratorRuntime</span><span class="pl-kos">.</span><span class="pl-en">async</span><span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-en">callee$0$0$</span><span class="pl-kos">(</span><span class="pl-s1">context$1$0</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">while</span> <span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span> <span class="pl-k">switch</span> <span class="pl-kos">(</span><span class="pl-s1">context$1$0</span><span class="pl-kos">.</span><span class="pl-c1">prev</span> <span class="pl-c1">=</span> <span class="pl-s1">context$1$0</span><span class="pl-kos">.</span><span class="pl-c1">next</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">case</span> <span class="pl-c1">0</span>: <span class="pl-s1">_ref</span> <span class="pl-c1">=</span> <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span> <span class="pl-c1">===</span> <span class="pl-c1">undefined</span> ? <span class="pl-kos">{</span><span class="pl-kos">}</span> : <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-s1">_ref$a</span> <span class="pl-c1">=</span> <span class="pl-s1">_ref</span><span class="pl-kos">.</span><span class="pl-c1">a</span><span class="pl-kos">;</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-s1">_ref$a</span> <span class="pl-c1">===</span> <span class="pl-c1">undefined</span> ? <span class="pl-c1">1</span> : <span class="pl-s1">_ref$a</span><span class="pl-kos">;</span> <span class="pl-k">return</span> <span class="pl-s1">context$1$0</span><span class="pl-kos">.</span><span class="pl-en">abrupt</span><span class="pl-kos">(</span><span class="pl-s">"return"</span><span class="pl-kos">,</span> <span class="pl-s1">a</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">case</span> <span class="pl-c1">4</span>: <span class="pl-k">case</span> <span class="pl-s">"end"</span>: <span class="pl-k">return</span> <span class="pl-s1">context$1$0</span><span class="pl-kos">.</span><span class="pl-en">stop</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">null</span><span class="pl-kos">,</span> <span class="pl-s1">_this</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div> <p dir="auto">Looks like there's a problem using <code class="notranslate">arguments</code> in a generator function; here <code class="notranslate">arguments[0] === context$1$0</code>. I think the arguments destructuring should be just after <code class="notranslate">var _ref, _ref$a, a;</code>. I achieved this by moving <code class="notranslate">regenerator</code> around in <code class="notranslate">babel/transformation/transformers/index.js</code> (just before default parameters):</p> <div class="highlight highlight-source-diff notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="diff --git a/index.old.js b/index.new.js index 70cd878..f304e6f 100644 --- a/index.old.js +++ b/index.new.js @@ -61,6 +61,8 @@ module.exports = { // needs to be after `es6.parameters.rest` as we use `toArray` and avoid turning an already known arr ay into one &quot;es6.spread&quot;: require(&quot;./es6/spread&quot;), + regenerator: require(&quot;./other/regenerator&quot;), + // needs to be before `es6.blockScoping` as default parameters have a TDZ &quot;es6.parameters.default&quot;: require(&quot;./es6/parameters.default&quot;), @@ -78,8 +80,6 @@ module.exports = { // identifiers in parameters and variable declarators &quot;es6.tailCall&quot;: require(&quot;./es6/tail-call&quot;), - regenerator: require(&quot;./other/regenerator&quot;), - // needs to be after `regenerator` due to needing `regeneratorRuntime` references // needs to be after `es6.forOf` due to needing `Symbol.iterator` references // needs to be before `es6.modules` due to dynamic imports"><pre class="notranslate"><span class="pl-c1">diff --git a/index.old.js b/index.new.js</span> index 70cd878..f304e6f 100644 <span class="pl-md">--- a/index.old.js</span> <span class="pl-mi1">+++ b/index.new.js</span> <span class="pl-mdr">@@ -61,6 +61,8 @@</span> module.exports = { // needs to be after `es6.parameters.rest` as we use `toArray` and avoid turning an already known arr ay into one "es6.spread": require("./es6/spread"), <span class="pl-mi1"><span class="pl-mi1">+</span> regenerator: require("./other/regenerator"),</span> <span class="pl-mi1"><span class="pl-mi1">+</span></span> // needs to be before `es6.blockScoping` as default parameters have a TDZ "es6.parameters.default": require("./es6/parameters.default"), <span class="pl-mdr">@@ -78,8 +80,6 @@</span> module.exports = { // identifiers in parameters and variable declarators "es6.tailCall": require("./es6/tail-call"), <span class="pl-md"><span class="pl-md">-</span> regenerator: require("./other/regenerator"),</span> <span class="pl-md"><span class="pl-md">-</span></span> // needs to be after `regenerator` due to needing `regeneratorRuntime` references // needs to be after `es6.forOf` due to needing `Symbol.iterator` references // needs to be before `es6.modules` due to dynamic imports</pre></div>
1
<h1 dir="auto">Feature request</h1> <p dir="auto">Currently, only the following meta tags can be duplicate as per the next/head logic</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var ALLOWED_DUPLICATES = ['article:tag', 'og:image', 'og:image:alt', 'og:image:width', 'og:image:height', 'og:image:type', 'og:image:secure_url', 'og:image:url'];"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-c1">ALLOWED_DUPLICATES</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-s">'article:tag'</span><span class="pl-kos">,</span> <span class="pl-s">'og:image'</span><span class="pl-kos">,</span> <span class="pl-s">'og:image:alt'</span><span class="pl-kos">,</span> <span class="pl-s">'og:image:width'</span><span class="pl-kos">,</span> <span class="pl-s">'og:image:height'</span><span class="pl-kos">,</span> <span class="pl-s">'og:image:type'</span><span class="pl-kos">,</span> <span class="pl-s">'og:image:secure_url'</span><span class="pl-kos">,</span> <span class="pl-s">'og:image:url'</span><span class="pl-kos">]</span><span class="pl-kos">;</span></pre></div> <p dir="auto">So, it is not allowing me to render multiple og:see_also tag in meta using next/head.</p> <p dir="auto">It would be great if these ALLOWED_DUPLICATES can be configured/override using <a class="issue-link js-issue-link notranslate" rel="noopener noreferrer nofollow" href="https://linear.app/vercel/issue/WEB-pack">web-pack</a> config/environment variable/nextconfig.</p> <p dir="auto">Please suggest.</p>
<ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/zeit/next.js/issues?q=is%3Aissue">issues</a> of this repository and believe that this is not a duplicate.</li> </ul> <p dir="auto">Looking at this repo — <a href="https://github.com/dargue3/nextjs-v5-object-context">https://github.com/dargue3/nextjs-v5-object-context</a> — this line of code (in <code class="notranslate">pages/index.js</code> used to return the names of all the functions belonging to a React component class before upgrading to <code class="notranslate">next v5</code>.</p> <p dir="auto"><code class="notranslate">Object.getOwnPropertyNames(Object.getPrototypeOf(context))</code></p> <h2 dir="auto">Expected Behavior</h2> <p dir="auto">It should print out <code class="notranslate">["constructor", "onClick", "otherFunction", "render", "componentDidMount", "componentWillUnmount"]</code></p> <h2 dir="auto">Current Behavior</h2> <p dir="auto">It prints out <code class="notranslate">["constructor", "render", "componentWillReceiveProps", "componentWillUpdate"]</code></p> <h2 dir="auto">Steps to reproduce</h2> <p dir="auto">Fire up the repo I pasted above and load <code class="notranslate">localhost:3000</code>. While rendering on the server, this works as expected. You can see the custom functions belonging to the class printing to the terminal. On the client however, any custom functions that you add to the React component will not show up. If you'd like to verify that this is related to <code class="notranslate">v5</code>, downgrade to <code class="notranslate">v4.2.2</code> and you should see the print statement showing up correct on both server and client.</p> <h2 dir="auto">Your Environment</h2> <table role="table"> <thead> <tr> <th>Tech</th> <th>Version</th> </tr> </thead> <tbody> <tr> <td>next</td> <td>v5.0.0</td> </tr> <tr> <td>node</td> <td>v8.6.0</td> </tr> </tbody> </table> <p dir="auto">I can't really speak to whether or not this is a bug (or how the version of Next is even related to this change in expected behavior). Could someone shed some light on what changes to <code class="notranslate">v5</code> could have caused this?</p>
0
<p dir="auto">Challenge <a href="http://www.freecodecamp.com/challenges/waypoint-clone-an-element-using-jquery#?solution=fccss%0A%20%20%24%28document%29.ready%28function%28%29%20%7B%0A%20%20%20%20%24%28%22%23target1%22%29.css%28%22color%22%2C%20%22red%22%29%3B%0A%20%20%20%20%24%28%22%23target1%22%29.prop%28%22disabled%22%2C%20true%29%3B%0A%20%20%20%20%24%28%22%23target4%22%29.remove%28%29%3B%0A%20%20%20%20%24%28%22%23target2%22%29.appendTo%28%22%23right-well%22%29%3B%0A%20%20%20%20%24%28%22%23target5%22%29.clone%28%29.appendTo%28%22%23left-well%22%29%3B%0A%20%20%20%20%0A%0A%20%20%7D%29%3B%0Afcces%0A%0A%3C!--%20Only%20change%20code%20above%20this%20line.%20--%3E%0A%0A%3Cdiv%20class%3D%22container-fluid%22%3E%0A%20%20%3Ch3%20class%3D%22text-primary%20text-center%22%3EjQuery%20Playground%3C%2Fh3%3E%0A%20%20%3Cdiv%20class%3D%22row%22%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-6%22%3E%0A%20%20%20%20%20%20%3Ch4%3E%23left-well%3C%2Fh4%3E%0A%20%20%20%20%20%20%3Cdiv%20class%3D%22well%22%20id%3D%22left-well%22%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target1%22%3E%23target1%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target2%22%3E%23target2%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target3%22%3E%23target3%3C%2Fbutton%3E%0A%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-6%22%3E%0A%20%20%20%20%20%20%3Ch4%3E%23right-well%3C%2Fh4%3E%0A%20%20%20%20%20%20%3Cdiv%20class%3D%22well%22%20id%3D%22right-well%22%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target4%22%3E%23target4%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target5%22%3E%23target5%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target6%22%3E%23target6%3C%2Fbutton%3E%0A%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%3C%2Fdiv%3E%0A%3C%2Fdiv%3E%0A" rel="nofollow">Waypoint: Clone an Element Using jQuery</a> has an issue.<br> User Agent is: <code class="notranslate">Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36</code>.<br> Please describe how to reproduce this issue, and include links to screenshots if possible.</p> <p dir="auto">My code:</p> <div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;script&gt; $(document).ready(function() { $(&quot;#target1&quot;).css(&quot;color&quot;, &quot;red&quot;); $(&quot;#target1&quot;).prop(&quot;disabled&quot;, true); $(&quot;#target4&quot;).remove(); $(&quot;#target2&quot;).appendTo(&quot;#right-well&quot;); $(&quot;#target5&quot;).clone().appendTo(&quot;#left-well&quot;); }); &lt;/script&gt; &lt;!-- Only change code above this line. --&gt; &lt;div class=&quot;container-fluid&quot;&gt; &lt;h3 class=&quot;text-primary text-center&quot;&gt;jQuery Playground&lt;/h3&gt; &lt;div class=&quot;row&quot;&gt; &lt;div class=&quot;col-xs-6&quot;&gt; &lt;h4&gt;#left-well&lt;/h4&gt; &lt;div class=&quot;well&quot; id=&quot;left-well&quot;&gt; &lt;button class=&quot;btn btn-default target&quot; id=&quot;target1&quot;&gt;#target1&lt;/button&gt; &lt;button class=&quot;btn btn-default target&quot; id=&quot;target2&quot;&gt;#target2&lt;/button&gt; &lt;button class=&quot;btn btn-default target&quot; id=&quot;target3&quot;&gt;#target3&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;col-xs-6&quot;&gt; &lt;h4&gt;#right-well&lt;/h4&gt; &lt;div class=&quot;well&quot; id=&quot;right-well&quot;&gt; &lt;button class=&quot;btn btn-default target&quot; id=&quot;target4&quot;&gt;#target4&lt;/button&gt; &lt;button class=&quot;btn btn-default target&quot; id=&quot;target5&quot;&gt;#target5&lt;/button&gt; &lt;button class=&quot;btn btn-default target&quot; id=&quot;target6&quot;&gt;#target6&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; "><pre class="notranslate"><span class="pl-kos">&lt;</span><span class="pl-ent">script</span><span class="pl-kos">&gt;</span> <span class="pl-en">$</span><span class="pl-kos">(</span><span class="pl-smi">document</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">ready</span><span class="pl-kos">(</span><span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-en">$</span><span class="pl-kos">(</span><span class="pl-s">"#target1"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">css</span><span class="pl-kos">(</span><span class="pl-s">"color"</span><span class="pl-kos">,</span> <span class="pl-s">"red"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">$</span><span class="pl-kos">(</span><span class="pl-s">"#target1"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">prop</span><span class="pl-kos">(</span><span class="pl-s">"disabled"</span><span class="pl-kos">,</span> <span class="pl-c1">true</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">$</span><span class="pl-kos">(</span><span class="pl-s">"#target4"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">remove</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">$</span><span class="pl-kos">(</span><span class="pl-s">"#target2"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">appendTo</span><span class="pl-kos">(</span><span class="pl-s">"#right-well"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">$</span><span class="pl-kos">(</span><span class="pl-s">"#target5"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">clone</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">appendTo</span><span class="pl-kos">(</span><span class="pl-s">"#left-well"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">&lt;/</span><span class="pl-ent">script</span><span class="pl-kos">&gt;</span> <span class="pl-c">&lt;!-- Only change code above this line. --&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">div</span> <span class="pl-c1">class</span>="<span class="pl-s">container-fluid</span>"<span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">h3</span> <span class="pl-c1">class</span>="<span class="pl-s">text-primary text-center</span>"<span class="pl-kos">&gt;</span>jQuery Playground<span class="pl-kos">&lt;/</span><span class="pl-ent">h3</span><span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">div</span> <span class="pl-c1">class</span>="<span class="pl-s">row</span>"<span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">div</span> <span class="pl-c1">class</span>="<span class="pl-s">col-xs-6</span>"<span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">h4</span><span class="pl-kos">&gt;</span>#left-well<span class="pl-kos">&lt;/</span><span class="pl-ent">h4</span><span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">div</span> <span class="pl-c1">class</span>="<span class="pl-s">well</span>" <span class="pl-c1">id</span>="<span class="pl-s">left-well</span>"<span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">button</span> <span class="pl-c1">class</span>="<span class="pl-s">btn btn-default target</span>" <span class="pl-c1">id</span>="<span class="pl-s">target1</span>"<span class="pl-kos">&gt;</span>#target1<span class="pl-kos">&lt;/</span><span class="pl-ent">button</span><span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">button</span> <span class="pl-c1">class</span>="<span class="pl-s">btn btn-default target</span>" <span class="pl-c1">id</span>="<span class="pl-s">target2</span>"<span class="pl-kos">&gt;</span>#target2<span class="pl-kos">&lt;/</span><span class="pl-ent">button</span><span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">button</span> <span class="pl-c1">class</span>="<span class="pl-s">btn btn-default target</span>" <span class="pl-c1">id</span>="<span class="pl-s">target3</span>"<span class="pl-kos">&gt;</span>#target3<span class="pl-kos">&lt;/</span><span class="pl-ent">button</span><span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;/</span><span class="pl-ent">div</span><span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;/</span><span class="pl-ent">div</span><span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">div</span> <span class="pl-c1">class</span>="<span class="pl-s">col-xs-6</span>"<span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">h4</span><span class="pl-kos">&gt;</span>#right-well<span class="pl-kos">&lt;/</span><span class="pl-ent">h4</span><span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">div</span> <span class="pl-c1">class</span>="<span class="pl-s">well</span>" <span class="pl-c1">id</span>="<span class="pl-s">right-well</span>"<span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">button</span> <span class="pl-c1">class</span>="<span class="pl-s">btn btn-default target</span>" <span class="pl-c1">id</span>="<span class="pl-s">target4</span>"<span class="pl-kos">&gt;</span>#target4<span class="pl-kos">&lt;/</span><span class="pl-ent">button</span><span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">button</span> <span class="pl-c1">class</span>="<span class="pl-s">btn btn-default target</span>" <span class="pl-c1">id</span>="<span class="pl-s">target5</span>"<span class="pl-kos">&gt;</span>#target5<span class="pl-kos">&lt;/</span><span class="pl-ent">button</span><span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">button</span> <span class="pl-c1">class</span>="<span class="pl-s">btn btn-default target</span>" <span class="pl-c1">id</span>="<span class="pl-s">target6</span>"<span class="pl-kos">&gt;</span>#target6<span class="pl-kos">&lt;/</span><span class="pl-ent">button</span><span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;/</span><span class="pl-ent">div</span><span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;/</span><span class="pl-ent">div</span><span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;/</span><span class="pl-ent">div</span><span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;/</span><span class="pl-ent">div</span><span class="pl-kos">&gt;</span></pre></div>
<p dir="auto">A bug seems to be present: Chrome 46.0.2490.86 m; Windows 8.1 with respect to <code class="notranslate">appendTo()</code> function.</p> <p dir="auto"><code class="notranslate">$("#target2").appendTo($("#right-well"));</code> does work, but not the <code class="notranslate">$("#target2").appendTo("#right-well");</code>, the latter being suggested in the tutorial.</p> <p dir="auto">Hard reload and cache clearing did not seem to solve the problem.</p>
1
<p dir="auto">When the type of TextField is set to number and give it a initial value, once the entered number is deleted, the displayed value becomes 0. If you then enter another number, the zero will stay unless the page is refreshed.</p> <p dir="auto">I've checked the value received in the onChange function, which doesn't come with the leading zero.<br> If the 'value' attribute is not set, this issue won't occur.</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/8428719/30805137-75b4e040-a233-11e7-86c9-03bf40ef12d4.jpg"><img src="https://user-images.githubusercontent.com/8428719/30805137-75b4e040-a233-11e7-86c9-03bf40ef12d4.jpg" alt="7" style="max-width: 100%;"></a></p> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/callemall/material-ui/issues">issues</a> of this repository and believe that this is not a duplicate.</li> </ul> <h2 dir="auto">Expected Behavior</h2> <p dir="auto">If the entered number is deleted, it'd be better to not show the default 0 (as seen in Component Demos).<br> OR<br> Show the default 0, but remove it if the first digit entered is not 0.</p> <h2 dir="auto">Current Behavior</h2> <p dir="auto">The leading zero won't go away.</p> <h2 dir="auto">Steps to Reproduce (for bugs)</h2> <ol dir="auto"> <li>Use a TextField and set type to number. Apply an onChange function.</li> <li>In the browser, enter a number in the field, and remove it. You should see a zero now.</li> <li>Enter another number. You shoud now see a the number with a leading zero.</li> </ol> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/8428719/30804779-0144eea4-a232-11e7-92e3-ca38bcf3e244.jpg"><img src="https://user-images.githubusercontent.com/8428719/30804779-0144eea4-a232-11e7-92e3-ca38bcf3e244.jpg" alt="3" style="max-width: 100%;"></a><br> <a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/8428719/30804812-1c43cd24-a232-11e7-9908-78c0b627f4b6.jpg"><img src="https://user-images.githubusercontent.com/8428719/30804812-1c43cd24-a232-11e7-9908-78c0b627f4b6.jpg" alt="4" style="max-width: 100%;"></a><br> <a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/8428719/30804706-c334b66c-a231-11e7-8585-da485871ed94.jpg"><img src="https://user-images.githubusercontent.com/8428719/30804706-c334b66c-a231-11e7-8585-da485871ed94.jpg" alt="1" style="max-width: 100%;"></a><br> <a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/8428719/30804718-cdc1cdcc-a231-11e7-8717-f2b954f3b6fd.jpg"><img src="https://user-images.githubusercontent.com/8428719/30804718-cdc1cdcc-a231-11e7-8717-f2b954f3b6fd.jpg" alt="2" style="max-width: 100%;"></a></p> <h2 dir="auto">Context</h2> <p dir="auto">This behaviour is okay if the field is used for mobile number.<br> In the case where it's used for currency or quantity, it could be a bit confusing.</p> <h2 dir="auto">Your Environment</h2> <table role="table"> <thead> <tr> <th>Tech</th> <th>Version</th> </tr> </thead> <tbody> <tr> <td>Material-UI</td> <td>1.0.0-beta.12</td> </tr> <tr> <td>React</td> <td>15.0.0</td> </tr> <tr> <td>browser</td> <td>Chrome Version 60.0.3112.113</td> </tr> <tr> <td>etc</td> <td></td> </tr> </tbody> </table>
<p dir="auto">TablePagination is missing from exports</p> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/callemall/material-ui/issues">issues</a> of this repository and believe that this is not a duplicate.</li> </ul> <h2 dir="auto">Expected Behavior</h2> <p dir="auto"><code class="notranslate">import { TablePagination } from 'material-ui/Table';</code> should import the component</p> <h2 dir="auto">Current Behavior</h2> <p dir="auto">the imported is undefined</p> <h2 dir="auto">Steps to Reproduce (for bugs)</h2> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import { TablePagination } from 'material-ui/Table'; console.log(TablePagination) &lt;--undefined"><pre class="notranslate"><code class="notranslate">import { TablePagination } from 'material-ui/Table'; console.log(TablePagination) &lt;--undefined </code></pre></div> <h2 dir="auto">Context</h2> <p dir="auto">it is missing in the source code as well</p> <h2 dir="auto">Your Environment</h2> <table role="table"> <thead> <tr> <th>Tech</th> <th>Version</th> </tr> </thead> <tbody> <tr> <td>Material-UI</td> <td>1.0.0-beta.12</td> </tr> <tr> <td>React</td> <td>15.6.1</td> </tr> <tr> <td>browser</td> <td>chrome 61.0.3163.100 (Official Build) (64-bit)</td> </tr> </tbody> </table>
0
<h5 dir="auto">ISSUE TYPE</h5> <ul dir="auto"> <li>Bug Report</li> </ul> <h5 dir="auto">COMPONENT NAME</h5> <p dir="auto">block<br> include_role</p> <h5 dir="auto">ANSIBLE VERSION</h5> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.4.3.0 config file = /Users/kevinp/Documents/src/cm/ansible/ansible.cfg configured module search path = [u'/Users/kevinp/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] ansible python module location = /Users/kevinp/Documents/src/cm/ansible/venv2/lib/python2.7/site-packages/ansible executable location = /Users/kevinp/Documents/src/cm/ansible/venv2/bin/ansible python version = 2.7.14 (default, Nov 10 2017, 16:16:47) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.38)]"><pre class="notranslate"><code class="notranslate">ansible 2.4.3.0 config file = /Users/kevinp/Documents/src/cm/ansible/ansible.cfg configured module search path = [u'/Users/kevinp/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] ansible python module location = /Users/kevinp/Documents/src/cm/ansible/venv2/lib/python2.7/site-packages/ansible executable location = /Users/kevinp/Documents/src/cm/ansible/venv2/bin/ansible python version = 2.7.14 (default, Nov 10 2017, 16:16:47) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.38)] </code></pre></div> <h5 dir="auto">CONFIGURATION</h5> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ANSIBLE_PIPELINING(/Users/kevinp/Documents/src/cm/ansible/ansible.cfg) = True DEFAULT_HOST_LIST(/Users/kevinp/Documents/src/cm/ansible/ansible.cfg) = [u'/Users/kevinp/Documents/src/cm/ansible/hosts.py'] DEFAULT_TIMEOUT(/Users/kevinp/Documents/src/cm/ansible/ansible.cfg) = 30"><pre class="notranslate"><code class="notranslate">ANSIBLE_PIPELINING(/Users/kevinp/Documents/src/cm/ansible/ansible.cfg) = True DEFAULT_HOST_LIST(/Users/kevinp/Documents/src/cm/ansible/ansible.cfg) = [u'/Users/kevinp/Documents/src/cm/ansible/hosts.py'] DEFAULT_TIMEOUT(/Users/kevinp/Documents/src/cm/ansible/ansible.cfg) = 30 </code></pre></div> <h5 dir="auto">OS / ENVIRONMENT</h5> <p dir="auto">macOS control machine, CentOS 7.4 guest</p> <h5 dir="auto">SUMMARY</h5> <p dir="auto">When using the <code class="notranslate">block</code> task, with an embedded <code class="notranslate">include_role</code> task, it appears that any variables defined within the block don't get propagated to handlers that run as part of the included role.</p> <h5 dir="auto">STEPS TO REPRODUCE</h5> <ol dir="auto"> <li>Create a task with a block declaration that looks like this:</li> </ol> <div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="- block: - include_role: name: my_test_role vars: my_data: &quot;Sample Number 1&quot;"><pre class="notranslate">- <span class="pl-ent">block</span>: - <span class="pl-ent">include_role</span>: <span class="pl-ent">name</span>: <span class="pl-s">my_test_role</span> <span class="pl-ent">vars</span>: <span class="pl-ent">my_data</span>: <span class="pl-s"><span class="pl-pds">"</span>Sample Number 1<span class="pl-pds">"</span></span></pre></div> <ol start="2" dir="auto"> <li>Create a new role named my_test_role with the following task</li> </ol> <div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="- debug: msg: &quot;my_data in role is {{ my_data }}&quot; notify: run my handler changed_when: true"><pre class="notranslate">- <span class="pl-ent">debug</span>: <span class="pl-ent">msg</span>: <span class="pl-s"><span class="pl-pds">"</span>my_data in role is {{ my_data }}<span class="pl-pds">"</span></span> <span class="pl-ent">notify</span>: <span class="pl-s">run my handler</span> <span class="pl-ent">changed_when</span>: <span class="pl-c1">true</span></pre></div> <ol start="3" dir="auto"> <li>Add a handler to the my_test_role with the following declaration</li> </ol> <div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="- name: run my handler debug: msg: &quot;my_data in handler is {{ my_data }}&quot;"><pre class="notranslate">- <span class="pl-ent">name</span>: <span class="pl-s">run my handler</span> <span class="pl-ent">debug</span>: <span class="pl-ent">msg</span>: <span class="pl-s"><span class="pl-pds">"</span>my_data in handler is {{ my_data }}<span class="pl-pds">"</span></span></pre></div> <ol start="4" dir="auto"> <li>run the task</li> </ol> <h5 dir="auto">EXPECTED RESULTS</h5> <p dir="auto">You should see 2 debug messages being printed, something like as follows:</p> <blockquote> <p dir="auto">"my_data in role is Sample Number 1"<br> "my_data in handler is Sample Number 1"</p> </blockquote> <h5 dir="auto">ACTUAL RESULTS</h5> <p dir="auto">The first debug message gets printed as expected, but the second one - the one from the handler - fails due to an undefined variable, something like this:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TASK [role : debug] ***************************** changed: [kspjenkins] =&gt; { &quot;msg&quot;: &quot;my_data in role is Sample Number 1&quot; } RUNNING HANDLER [ : run my handler] ********************************************** FAILED! =&gt; {&quot;msg&quot;: &quot;The task includes an option with an undefined variable....&quot;}`"><pre class="notranslate"><code class="notranslate">TASK [role : debug] ***************************** changed: [kspjenkins] =&gt; { "msg": "my_data in role is Sample Number 1" } RUNNING HANDLER [ : run my handler] ********************************************** FAILED! =&gt; {"msg": "The task includes an option with an undefined variable...."}` </code></pre></div>
<h5 dir="auto">ISSUE TYPE</h5> <ul dir="auto"> <li>Bug Report</li> </ul> <h5 dir="auto">COMPONENT NAME</h5> <p dir="auto">import_role</p> <h5 dir="auto">ANSIBLE VERSION</h5> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.6.0 (devel 8743b20c8e) last updated 2018/02/13 17:38:47 (GMT +200) config file = /home/nikos/Projects/ansible-demo/ansible.cfg configured module search path = ['/home/nikos/Projects/ansible-demo/ansible/lib/modules'] ansible python module location = /home/nikos/Projects/ansible/lib/ansible executable location = /home/nikos/Projects/ansible/bin/ansible python version = 3.6.4 (default, Jan 5 2018, 02:35:40) [GCC 7.2.1 20171224]"><pre class="notranslate"><code class="notranslate">ansible 2.6.0 (devel 8743b20c8e) last updated 2018/02/13 17:38:47 (GMT +200) config file = /home/nikos/Projects/ansible-demo/ansible.cfg configured module search path = ['/home/nikos/Projects/ansible-demo/ansible/lib/modules'] ansible python module location = /home/nikos/Projects/ansible/lib/ansible executable location = /home/nikos/Projects/ansible/bin/ansible python version = 3.6.4 (default, Jan 5 2018, 02:35:40) [GCC 7.2.1 20171224] </code></pre></div> <h5 dir="auto">CONFIGURATION</h5> <h5 dir="auto">OS / ENVIRONMENT</h5> <h5 dir="auto">SUMMARY</h5> <p dir="auto">I am running import_role against a just-above created instance on google cloud. The role runs fine on the distant host, but the role handlers (just a win_reboot task), runs against my localhost.</p> <h5 dir="auto">STEPS TO REPRODUCE</h5> <p dir="auto">This is the tasks that I use:</p> <div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="- gce: name: custom-windows-image disk_auto_delete: no disk_size: &quot;{{ win_server.disk_size }}&quot; external_ip: ephemeral image_family: windows-2016 ip_forward: yes machine_type: n1-highcpu-4 metadata: {} # TODO change this to 'default' network: &quot;{{ project_facts.network.name }}&quot; subnetwork: &quot;{{ win_server.subnet }}&quot; zone: &quot;{{ win_server.zone }}&quot; tags: custom-windows-image register: win_instance - command: &gt;- gcloud beta compute reset-windows-password --quiet --user=&quot;{{ win_server.user }}&quot; --zone=&quot;{{ win_server.zone }}&quot; custom-windows-image register: win_instance_password until: win_instance_password.rc != 1 failed_when: false retries: 5 - add_host: &amp;winrm hostname: win_instance ansible_host: &quot;{{ win_instance.instance_data[0].public_ip }}&quot; ansible_connection: winrm ansible_port: 5986 ansible_winrm_server_cert_validation: ignore ansible_winrm_transport: ntlm ansible_user: &quot;{{ win_server.user }}&quot; ansible_password: &quot;{{ win_instance_password.stdout_lines[1] | regex_replace('password:[\\s]*([^s]*)', '\\1') }}&quot; - gce_firewall: name: custom-windows-image network: &quot;{{ project_facts.network.name }}&quot; allowed: udp:3389;tcp:3389;tcp:5986;icmp src_ranges: &quot;{{ project_facts.local.address }}/32&quot; target_tags: custom-windows-image - wait_for_connection: delegate_to: custom-windows-image vars: *winrm - import_role: name: ansible-windows-setup private: yes vars: windows_setup_hostname: &quot;{{ win_server.name }}&quot; delegate_to: win_instance"><pre class="notranslate">- <span class="pl-ent">gce</span>: <span class="pl-ent">name</span>: <span class="pl-s">custom-windows-image</span> <span class="pl-ent">disk_auto_delete</span>: <span class="pl-s">no</span> <span class="pl-ent">disk_size</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ win_server.disk_size }}<span class="pl-pds">"</span></span> <span class="pl-ent">external_ip</span>: <span class="pl-s">ephemeral</span> <span class="pl-ent">image_family</span>: <span class="pl-s">windows-2016</span> <span class="pl-ent">ip_forward</span>: <span class="pl-s">yes</span> <span class="pl-ent">machine_type</span>: <span class="pl-s">n1-highcpu-4</span> <span class="pl-ent">metadata</span>: <span class="pl-s">{}</span> <span class="pl-c"><span class="pl-c">#</span> TODO change this to 'default'</span> <span class="pl-ent">network</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ project_facts.network.name }}<span class="pl-pds">"</span></span> <span class="pl-ent">subnetwork</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ win_server.subnet }}<span class="pl-pds">"</span></span> <span class="pl-ent">zone</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ win_server.zone }}<span class="pl-pds">"</span></span> <span class="pl-ent">tags</span>: <span class="pl-s">custom-windows-image</span> <span class="pl-ent">register</span>: <span class="pl-s">win_instance</span> - <span class="pl-ent">command</span>: <span class="pl-s">&gt;-</span> <span class="pl-s"> gcloud beta compute reset-windows-password</span> <span class="pl-s"> --quiet</span> <span class="pl-s"> --user="{{ win_server.user }}"</span> <span class="pl-s"> --zone="{{ win_server.zone }}"</span> <span class="pl-s"> custom-windows-image</span> <span class="pl-s"></span> <span class="pl-ent">register</span>: <span class="pl-s">win_instance_password</span> <span class="pl-ent">until</span>: <span class="pl-s">win_instance_password.rc != 1</span> <span class="pl-ent">failed_when</span>: <span class="pl-c1">false</span> <span class="pl-ent">retries</span>: <span class="pl-c1">5</span> - <span class="pl-ent">add_host</span>: <span class="pl-s">&amp;winrm</span> <span class="pl-ent">hostname</span>: <span class="pl-s">win_instance</span> <span class="pl-ent">ansible_host</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ win_instance.instance_data[0].public_ip }}<span class="pl-pds">"</span></span> <span class="pl-ent">ansible_connection</span>: <span class="pl-s">winrm</span> <span class="pl-ent">ansible_port</span>: <span class="pl-c1">5986</span> <span class="pl-ent">ansible_winrm_server_cert_validation</span>: <span class="pl-s">ignore</span> <span class="pl-ent">ansible_winrm_transport</span>: <span class="pl-s">ntlm</span> <span class="pl-ent">ansible_user</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ win_server.user }}<span class="pl-pds">"</span></span> <span class="pl-ent">ansible_password</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ win_instance_password.stdout_lines[1] | regex_replace('password:[<span class="pl-cce">\\</span>s]*([^s]*)', '<span class="pl-cce">\\</span>1') }}<span class="pl-pds">"</span></span> - <span class="pl-ent">gce_firewall</span>: <span class="pl-ent">name</span>: <span class="pl-s">custom-windows-image</span> <span class="pl-ent">network</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ project_facts.network.name }}<span class="pl-pds">"</span></span> <span class="pl-ent">allowed</span>: <span class="pl-s">udp:3389;tcp:3389;tcp:5986;icmp</span> <span class="pl-ent">src_ranges</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ project_facts.local.address }}/32<span class="pl-pds">"</span></span> <span class="pl-ent">target_tags</span>: <span class="pl-s">custom-windows-image</span> - <span class="pl-ent">wait_for_connection</span>: <span class="pl-ent">delegate_to</span>: <span class="pl-s">custom-windows-image</span> <span class="pl-ent">vars</span>: <span class="pl-s">*winrm</span> - <span class="pl-ent">import_role</span>: <span class="pl-ent">name</span>: <span class="pl-s">ansible-windows-setup</span> <span class="pl-ent">private</span>: <span class="pl-s">yes</span> <span class="pl-ent">vars</span>: <span class="pl-ent">windows_setup_hostname</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ win_server.name }}<span class="pl-pds">"</span></span> <span class="pl-ent">delegate_to</span>: <span class="pl-s">win_instance</span></pre></div> <h5 dir="auto">EXPECTED RESULTS</h5> <p dir="auto">The role handler should be executed against the windows instance and reboot it.</p> <h5 dir="auto">ACTUAL RESULTS</h5> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="RUNNING HANDLER [ansible-windows-setup : Reboot windows] ************************************ &lt;127.0.0.1&gt; ESTABLISH LOCAL CONNECTION FOR USER: nikos &lt;127.0.0.1&gt; EXEC (Get-WmiObject -ClassName Win32_OperatingSystem).LastBootUpTime fatal: [localhost]: FAILED! =&gt; { &quot;changed&quot;: false, &quot;failed&quot;: true, &quot;msg&quot;: &quot;win_reboot: failed to get host uptime info, rc: 1, stdout: b'', stderr: b\&quot;/bin/bash: -c: line 0: syntax error near unexpected token `.LastBootUpTime'\\n/bin/bash: -c: line 0: `(Get-WmiObject -ClassName Win32_OperatingSystem).LastBootUpTime'\\n\&quot;&quot;, &quot;reboot&quot;: false } META: ran handlers"><pre class="notranslate"><code class="notranslate">RUNNING HANDLER [ansible-windows-setup : Reboot windows] ************************************ &lt;127.0.0.1&gt; ESTABLISH LOCAL CONNECTION FOR USER: nikos &lt;127.0.0.1&gt; EXEC (Get-WmiObject -ClassName Win32_OperatingSystem).LastBootUpTime fatal: [localhost]: FAILED! =&gt; { "changed": false, "failed": true, "msg": "win_reboot: failed to get host uptime info, rc: 1, stdout: b'', stderr: b\"/bin/bash: -c: line 0: syntax error near unexpected token `.LastBootUpTime'\\n/bin/bash: -c: line 0: `(Get-WmiObject -ClassName Win32_OperatingSystem).LastBootUpTime'\\n\"", "reboot": false } META: ran handlers </code></pre></div>
1
<p dir="auto">I created an <a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings" rel="nofollow">extension</a> to port Sublime keybindings to VS Code keybindings. I made a list of all the key bindings that were missing analogous commands in VS Code.</p> <p dir="auto">Here is the list roughly ordered by importance. Please let me know about more I missed in the comments. If an extension exists with the functionality I added it in the far right column.</p> <table role="table"> <thead> <tr> <th>Windows / Linux</th> <th>Mac</th> <th>Description</th> <th>Issue</th> <th>Extension</th> </tr> </thead> <tbody> <tr> <td><kbd>ctrl</kbd>+left mouse click</td> <td><kbd>cmd</kbd>+left mouse click</td> <td>Add multi cursors</td> <td><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="134647465" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/3130" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/3130/hovercard" href="https://github.com/microsoft/vscode/issues/3130">#3130</a></td> <td>None</td> </tr> <tr> <td><kbd>ctrl</kbd>+<kbd>;</kbd></td> <td>None</td> <td>Go to Word</td> <td><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="184103027" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/14028" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/14028/hovercard" href="https://github.com/microsoft/vscode/issues/14028">#14028</a></td> <td>None</td> </tr> <tr> <td><kbd>ctrl</kbd>+<kbd>+</kbd></td> <td><kbd>cmd</kbd>+<kbd>+</kbd> and <kbd>cmd</kbd>+<kbd>=</kbd></td> <td>Increase Font Size</td> <td><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="184104455" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/14031" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/14031/hovercard" href="https://github.com/microsoft/vscode/issues/14031">#14031</a></td> <td><a href="https://marketplace.visualstudio.com/items?itemName=peterjuras.fontsize-shortcuts" rel="nofollow">FontSize Shortcuts</a></td> </tr> <tr> <td><kbd>ctrl</kbd>+<kbd>-</kbd></td> <td><kbd>cmd</kbd>+<kbd>-</kbd></td> <td>Decrease Font Size</td> <td><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="184104455" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/14031" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/14031/hovercard" href="https://github.com/microsoft/vscode/issues/14031">#14031</a></td> <td><a href="https://marketplace.visualstudio.com/items?itemName=peterjuras.fontsize-shortcuts" rel="nofollow">FontSize Shortcuts</a></td> </tr> <tr> <td><kbd>ctrl</kbd>+<kbd>shift</kbd>+<kbd>m</kbd></td> <td><kbd>ctrl</kbd>+<kbd>shift</kbd>+<kbd>m</kbd></td> <td>Expand selection to brackets</td> <td><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="184252304" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/14089" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/14089/hovercard" href="https://github.com/microsoft/vscode/issues/14089">#14089</a></td> <td><a href="https://marketplace.visualstudio.com/items?itemName=guosong.bracketselection" rel="nofollow">Bracket Selection</a></td> </tr> <tr> <td><kbd>ctrl</kbd>+<kbd>shift</kbd>+<kbd>j</kbd></td> <td><kbd>cmd</kbd>+<kbd>shift</kbd>+<kbd>j</kbd></td> <td>Expand selection to indent level</td> <td><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="184253338" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/14090" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/14090/hovercard" href="https://github.com/microsoft/vscode/issues/14090">#14090</a></td> <td>None</td> </tr> <tr> <td><kbd>alt</kbd>+<kbd>q</kbd></td> <td><kbd>cmd</kbd>+<kbd>alt</kbd>+<kbd>q</kbd></td> <td>Break / Wrap line</td> <td><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="184254616" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/14093" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/14093/hovercard" href="https://github.com/microsoft/vscode/issues/14093">#14093</a></td> <td>None</td> </tr> <tr> <td><kbd>alt</kbd>+<kbd>shift</kbd>+<kbd>1</kbd></td> <td><kbd>alt</kbd>+<kbd>cmd</kbd>+<kbd>1</kbd></td> <td>Switch to single column view</td> <td><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="184255370" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/14094" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/14094/hovercard" href="https://github.com/microsoft/vscode/issues/14094">#14094</a></td> <td>None</td> </tr> <tr> <td><kbd>ctrl</kbd>+<kbd>y</kbd></td> <td><kbd>ctrl</kbd>+<kbd>y</kbd></td> <td>Repeat</td> <td><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="184259007" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/14097" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/14097/hovercard" href="https://github.com/microsoft/vscode/issues/14097">#14097</a></td> <td>None</td> </tr> <tr> <td><kbd>ctrl</kbd>+<kbd>shift</kbd>+<kbd>a</kbd></td> <td><kbd>cmd</kbd>+<kbd>shift</kbd>+<kbd>a</kbd></td> <td>Expand selection to tag</td> <td><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="184259887" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/14098" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/14098/hovercard" href="https://github.com/microsoft/vscode/issues/14098">#14098</a></td> <td><a href="https://marketplace.visualstudio.com/items?itemName=letrieu.expand-region" rel="nofollow">expand-region</a></td> </tr> <tr> <td><kbd>ctrl</kbd>+<kbd>shift</kbd>+<kbd>space</kbd></td> <td><kbd>cmd</kbd>+<kbd>shift</kbd>+<kbd>space</kbd></td> <td>Expand selection to scope</td> <td><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="184260195" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/14099" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/14099/hovercard" href="https://github.com/microsoft/vscode/issues/14099">#14099</a></td> <td><a href="https://marketplace.visualstudio.com/items?itemName=letrieu.expand-region" rel="nofollow">expand-region</a></td> </tr> <tr> <td><kbd>shift</kbd>+<kbd>f11</kbd></td> <td><kbd>ctrl</kbd>+<kbd>shift</kbd>+<kbd>cmd</kbd>+<kbd>f</kbd></td> <td>Enter distraction free mode</td> <td><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="179888245" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/12940" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/12940/hovercard" href="https://github.com/microsoft/vscode/issues/12940">#12940</a></td> <td>None</td> </tr> <tr> <td><kbd>ctrl</kbd>+<kbd>space</kbd></td> <td><kbd>ctrl</kbd>+<kbd>space</kbd></td> <td>Select next auto complete suggestion</td> <td><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="184263102" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/14101" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/14101/hovercard" href="https://github.com/microsoft/vscode/issues/14101">#14101</a></td> <td>None</td> </tr> <tr> <td><kbd>alt</kbd>+<kbd>shift</kbd>+<kbd>w</kbd></td> <td><kbd>ctrl</kbd>+<kbd>shift</kbd>+<kbd>w</kbd></td> <td>Wrap HTML tag</td> <td><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="184263872" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/14103" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/14103/hovercard" href="https://github.com/microsoft/vscode/issues/14103">#14103</a></td> <td>None</td> </tr> <tr> <td><kbd>alt</kbd>+<kbd>.</kbd></td> <td><kbd>cmd</kbd>+<kbd>alt</kbd>+<kbd>.</kbd></td> <td>Close HTML tag</td> <td><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="184264628" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/14104" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/14104/hovercard" href="https://github.com/microsoft/vscode/issues/14104">#14104</a></td> <td><a href="https://marketplace.visualstudio.com/items?itemName=Compulim.compulim-vscode-closetag" rel="nofollow">Close HTML/XML tag</a></td> </tr> <tr> <td><kbd>ctrl</kbd>+<kbd>k</kbd> <kbd>ctrl</kbd>+<kbd>6</kbd></td> <td><kbd>cmd</kbd>+<kbd>k</kbd> <kbd>cmd</kbd>+<kbd>6</kbd></td> <td>Fold level 6</td> <td><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="184265179" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/14106" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/14106/hovercard" href="https://github.com/microsoft/vscode/issues/14106">#14106</a></td> <td>None</td> </tr> <tr> <td><kbd>ctrl</kbd>+<kbd>k</kbd> <kbd>ctrl</kbd>+<kbd>7</kbd></td> <td><kbd>cmd</kbd>+<kbd>k</kbd> <kbd>cmd</kbd>+<kbd>7</kbd></td> <td>Fold level 7</td> <td><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="184265179" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/14106" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/14106/hovercard" href="https://github.com/microsoft/vscode/issues/14106">#14106</a></td> <td>None</td> </tr> <tr> <td><kbd>ctrl</kbd>+<kbd>k</kbd> <kbd>ctrl</kbd>+<kbd>8</kbd></td> <td><kbd>cmd</kbd>+<kbd>k</kbd> <kbd>cmd</kbd>+<kbd>8</kbd></td> <td>Fold level 8</td> <td><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="184265179" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/14106" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/14106/hovercard" href="https://github.com/microsoft/vscode/issues/14106">#14106</a></td> <td>None</td> </tr> <tr> <td><kbd>ctrl</kbd>+<kbd>k</kbd> <kbd>ctrl</kbd>+<kbd>9</kbd></td> <td><kbd>cmd</kbd>+<kbd>k</kbd> <kbd>cmd</kbd>+<kbd>9</kbd></td> <td>Fold level 9</td> <td><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="184265179" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/14106" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/14106/hovercard" href="https://github.com/microsoft/vscode/issues/14106">#14106</a></td> <td>None</td> </tr> <tr> <td><kbd>alt</kbd>+<kbd>0</kbd></td> <td><kbd>cmd</kbd>+<kbd>0</kbd></td> <td>Select open tab index 9</td> <td><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="184255917" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/14095" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/14095/hovercard" href="https://github.com/microsoft/vscode/issues/14095">#14095</a></td> <td>None</td> </tr> </tbody> </table> <p dir="auto">Additionally, here are other actions that are not bound to a keyboard shortcut:</p> <table role="table"> <thead> <tr> <th>Action</th> <th>Issue</th> <th>Extension</th> </tr> </thead> <tbody> <tr> <td>Drag and drop selected text</td> <td><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="120602640" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/1046" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/1046/hovercard" href="https://github.com/microsoft/vscode/issues/1046">#1046</a></td> <td>None</td> </tr> </tbody> </table> <ul dir="auto"> <li>Customize keybinding support in menus (see this comment <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="139023181" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/3776" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/3776/hovercard?comment_id=260324787&amp;comment_type=issue_comment" href="https://github.com/microsoft/vscode/issues/3776#issuecomment-260324787">#3776 (comment)</a>)</li> <li>Customize keybinding support in viewlets (see this <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="142654931" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/4557" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/4557/hovercard" href="https://github.com/microsoft/vscode/issues/4557">#4557</a>)</li> </ul>
<p dir="auto"><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="156322848" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/6683" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/6683/hovercard" href="https://github.com/microsoft/vscode/issues/6683">#6683</a> fix means the integrated terminal cannot be restarted after the process errors without reloading the window.</p>
0
<p dir="auto">Here's the code I'm compiling:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="'use strict' async function recurse(n) { if (n &gt; 0) { console.log(n) await recurse(n - 1) } } recurse(10)"><pre class="notranslate"><code class="notranslate">'use strict' async function recurse(n) { if (n &gt; 0) { console.log(n) await recurse(n - 1) } } recurse(10) </code></pre></div> <p dir="auto">My package.json is:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ &quot;scripts&quot;: { &quot;build&quot;: &quot;babel src --out-dir dist&quot; }, &quot;devDependencies&quot;: { &quot;babel-cli&quot;: &quot;6.0.15&quot;, &quot;babel-plugin-transform-async-to-generator&quot;: &quot;6.0.14&quot; }, &quot;babel&quot;: { &quot;plugins&quot;: [&quot;transform-async-to-generator&quot;] } }"><pre class="notranslate"><code class="notranslate">{ "scripts": { "build": "babel src --out-dir dist" }, "devDependencies": { "babel-cli": "6.0.15", "babel-plugin-transform-async-to-generator": "6.0.14" }, "babel": { "plugins": ["transform-async-to-generator"] } } </code></pre></div> <p dir="auto">The compiled code is:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="'use strict'; let recurse = (function () { var ref = _asyncToGenerator(function* recurse(n) { if (n &gt; 0) { console.log(n); yield recurse(n - 1); } }); return function recurse(_x) { return ref.apply(this, arguments); }; })(); function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, &quot;next&quot;); var callThrow = step.bind(null, &quot;throw&quot;); function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(callNext, callThrow); } } callNext(); }); }; } recurse(10);"><pre class="notranslate"><code class="notranslate">'use strict'; let recurse = (function () { var ref = _asyncToGenerator(function* recurse(n) { if (n &gt; 0) { console.log(n); yield recurse(n - 1); } }); return function recurse(_x) { return ref.apply(this, arguments); }; })(); function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, "next"); var callThrow = step.bind(null, "throw"); function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(callNext, callThrow); } } callNext(); }); }; } recurse(10); </code></pre></div> <p dir="auto">Running this just prints '10', because the generated <code class="notranslate">function* recurse</code> function covers up the real function.</p>
<p dir="auto">This code worked with babel 5.x and doesn't with babel 6.x. The expectation is that countdown1 and countdown2 both produce the same results:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="'use strict'; function sleep(timeout) { return new Promise(function (resolve, reject) { setTimeout(function () { resolve(); }, timeout); }); } const countdown1 = async function (count) { console.log(count); await sleep(1000); if (--count) { await countdown1(count); } }; async function countdown2(count) { console.log(count); await sleep(1000); if (--count) { await countdown2(count); } }; countdown1(5) .then(function () { console.log('countdown1 done'); return countdown2(5); }) .then(function () { console.log('countdown2 done'); });"><pre class="notranslate"><code class="notranslate">'use strict'; function sleep(timeout) { return new Promise(function (resolve, reject) { setTimeout(function () { resolve(); }, timeout); }); } const countdown1 = async function (count) { console.log(count); await sleep(1000); if (--count) { await countdown1(count); } }; async function countdown2(count) { console.log(count); await sleep(1000); if (--count) { await countdown2(count); } }; countdown1(5) .then(function () { console.log('countdown1 done'); return countdown2(5); }) .then(function () { console.log('countdown2 done'); }); </code></pre></div> <p dir="auto">From the produced code, it looks like the transformed countdown2 is getting shadowed by inner functions using the same name.</p>
1
<p dir="auto">When using DataFrame.apply(), it would be helpful to be able to apply different functions to different columns. There's a nice workaround on <a href="http://stackoverflow.com/questions/26434123/pandas-apply-different-functions-to-different-columns" rel="nofollow">StackOverflow</a>:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np import pandas as pd def multi_func(functions): def f(col): return functions[col.name](col) return f df = pd.DataFrame(np.random.random((10, 2)), columns=['A', 'B']) results = df.apply(multi_func({'A': np.mean, 'B': np.sum})) results A 0.401456 B 6.845529 dtype: float64"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span> <span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span> <span class="pl-k">def</span> <span class="pl-en">multi_func</span>(<span class="pl-s1">functions</span>): <span class="pl-k">def</span> <span class="pl-en">f</span>(<span class="pl-s1">col</span>): <span class="pl-k">return</span> <span class="pl-s1">functions</span>[<span class="pl-s1">col</span>.<span class="pl-s1">name</span>](<span class="pl-s1">col</span>) <span class="pl-k">return</span> <span class="pl-s1">f</span> <span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>(<span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">random</span>((<span class="pl-c1">10</span>, <span class="pl-c1">2</span>)), <span class="pl-s1">columns</span><span class="pl-c1">=</span>[<span class="pl-s">'A'</span>, <span class="pl-s">'B'</span>]) <span class="pl-s1">results</span> <span class="pl-c1">=</span> <span class="pl-s1">df</span>.<span class="pl-en">apply</span>(<span class="pl-en">multi_func</span>({<span class="pl-s">'A'</span>: <span class="pl-s1">np</span>.<span class="pl-s1">mean</span>, <span class="pl-s">'B'</span>: <span class="pl-s1">np</span>.<span class="pl-s1">sum</span>})) <span class="pl-s1">results</span> <span class="pl-v">A</span> <span class="pl-c1">0.401456</span> <span class="pl-v">B</span> <span class="pl-c1">6.845529</span> <span class="pl-s1">dtype</span>: <span class="pl-s1">float64</span></pre></div> <p dir="auto">My guess is that the changes would be made in <a href="https://github.com/pandas-dev/pandas/blob/master/pandas/core/frame.py">pandas.core.frame.DataFrame</a>, potentially adding a new <code class="notranslate">_apply_X</code> method. Any thoughts/advice?</p>
<p dir="auto">I'm trying to use pandas to speed up timezone conversions on many datetimes and I can't get around <code class="notranslate">NonExistentTimeErrors</code>. Pandas <code class="notranslate">tz_localize()</code> seems to ignore the <code class="notranslate">ambiguous</code> argument for the non existent time case.</p> <p dir="auto">Example:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import pytz import pandas tz = pytz.timezone('Europe/Warsaw') non_existent = datetime.datetime(2015, 3, 29, 2, 30) tz.normalize(tz.localize(non_existent)) #2015-03-29 03:30:00+02:00 tz.normalize(tz.localize(non_existent, is_dst=False)) #2015-03-29 03:30:00+02:00 pandas.Timestamp(non_existent).tz_localize(tz) # NonExistentTimeError: 2015-03-29 02:30:00 pandas.Timestamp(non_existent).tz_localize(tz, ambiguous=0) # NonExistentTimeError: 2015-03-29 02:30:00"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">pytz</span> <span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-s1">tz</span> <span class="pl-c1">=</span> <span class="pl-s1">pytz</span>.<span class="pl-en">timezone</span>(<span class="pl-s">'Europe/Warsaw'</span>) <span class="pl-s1">non_existent</span> <span class="pl-c1">=</span> <span class="pl-s1">datetime</span>.<span class="pl-en">datetime</span>(<span class="pl-c1">2015</span>, <span class="pl-c1">3</span>, <span class="pl-c1">29</span>, <span class="pl-c1">2</span>, <span class="pl-c1">30</span>) <span class="pl-s1">tz</span>.<span class="pl-en">normalize</span>(<span class="pl-s1">tz</span>.<span class="pl-en">localize</span>(<span class="pl-s1">non_existent</span>)) <span class="pl-c">#2015-03-29 03:30:00+02:00</span> <span class="pl-s1">tz</span>.<span class="pl-en">normalize</span>(<span class="pl-s1">tz</span>.<span class="pl-en">localize</span>(<span class="pl-s1">non_existent</span>, <span class="pl-s1">is_dst</span><span class="pl-c1">=</span><span class="pl-c1">False</span>)) <span class="pl-c">#2015-03-29 03:30:00+02:00</span> <span class="pl-s1">pandas</span>.<span class="pl-v">Timestamp</span>(<span class="pl-s1">non_existent</span>).<span class="pl-en">tz_localize</span>(<span class="pl-s1">tz</span>) <span class="pl-c"># NonExistentTimeError: 2015-03-29 02:30:00</span> <span class="pl-s1">pandas</span>.<span class="pl-v">Timestamp</span>(<span class="pl-s1">non_existent</span>).<span class="pl-en">tz_localize</span>(<span class="pl-s1">tz</span>, <span class="pl-s1">ambiguous</span><span class="pl-c1">=</span><span class="pl-c1">0</span>) <span class="pl-c"># NonExistentTimeError: 2015-03-29 02:30:00</span></pre></div> <p dir="auto">It would be nice if the <code class="notranslate">ambiguous</code> argument worked the same as <code class="notranslate">is_dst</code> in pytz. As it is now, it's impossible afaik to reliably localize a series of datetimes using pandas, since any of them might cause a <code class="notranslate">NonExistentTimeError</code> and there's no way of guiding pandas what to do with such datetimes.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="INSTALLED VERSIONS ------------------ commit: None python: 2.7.5.final.0 python-bits: 64 OS: Linux OS-release: 3.13.0-39-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 pandas: 0.15.1 nose: 1.3.4 Cython: None numpy: 1.9.1 scipy: None statsmodels: None IPython: 2.3.1 sphinx: 1.2.2 patsy: None dateutil: 2.2 pytz: 2013.9 bottleneck: None tables: None numexpr: None matplotlib: None openpyxl: None xlrd: None xlwt: None xlsxwriter: None lxml: None bs4: None html5lib: None httplib2: 0.9 apiclient: 1.3.1 rpy2: None sqlalchemy: None pymysql: None psycopg2: 2.5.4 (dt dec pq3 ext)"><pre class="notranslate"><code class="notranslate">INSTALLED VERSIONS ------------------ commit: None python: 2.7.5.final.0 python-bits: 64 OS: Linux OS-release: 3.13.0-39-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 pandas: 0.15.1 nose: 1.3.4 Cython: None numpy: 1.9.1 scipy: None statsmodels: None IPython: 2.3.1 sphinx: 1.2.2 patsy: None dateutil: 2.2 pytz: 2013.9 bottleneck: None tables: None numexpr: None matplotlib: None openpyxl: None xlrd: None xlwt: None xlsxwriter: None lxml: None bs4: None html5lib: None httplib2: 0.9 apiclient: 1.3.1 rpy2: None sqlalchemy: None pymysql: None psycopg2: 2.5.4 (dt dec pq3 ext) </code></pre></div>
0
<p dir="auto">We could integrate a function for signal words like in windows search. So the user enter <code class="notranslate">signalWord: abc</code> and the app knows for what the user is searching for.</p> <p dir="auto">signal words can be:</p> <ul dir="auto"> <li>window : search for window including browser tabs</li> <li>browser : search for browser tab</li> <li>app : user want to start apps</li> <li>file : search for file or folder</li> <li>cmd : to run command on cmd/ps/...</li> <li>calc : to calculate math formula</li> <li>...</li> </ul>
<h1 dir="auto">Summary of the new feature/enhancement</h1> <p dir="auto">Pressing and holding Windows-Key should show the shortcuts of the curently active application instead of the windows-shortcuts only. For example when working with Lightroom show the lightroom-shortcuts but when working in Explorer show the explorer-shortcuts.</p> <h1 dir="auto">Proposed technical implementation details (optional)</h1> <p dir="auto">The list of available-shorcuts could be read by an API (if possible). Otherwise the list could be maintained on github by the community.</p> <p dir="auto">See the application cheat-sheet for macos to see what this could look like</p>
0
<ul dir="auto"> <li>VSCode Version: 1.1.0-alpha</li> <li>OS Version: Windows 10</li> </ul> <p dir="auto">Steps to Reproduce:</p> <ol dir="auto"> <li>Change language to German or French</li> <li>Observe the file, edit, etc. menus</li> </ol> <p dir="auto">It seems some translations regress after alpha updates. Is this expected?</p>
<ul dir="auto"> <li>VSCode Version: 1.2</li> <li>OS Version: Windows 7, x65</li> </ul> <p dir="auto">Steps to Reproduce:</p> <ol dir="auto"> <li>Open the terminal from within VS code</li> <li>Do <code class="notranslate">git log</code></li> <li>Observe a first page of the command output (while the pager is awaiting for continuation)</li> <li>Select a piece of the output text.</li> <li>Attempt to copy the selected piece using <code class="notranslate">Ctrl + C</code></li> <li>Observe <code class="notranslate">git log</code> terminated.</li> </ol> <p dir="auto">Expected: text copied while application is still running</p> <p dir="auto"><g-emoji class="g-emoji" alias="+1" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f44d.png">👍</g-emoji></p>
0
<p dir="auto">Challenge <a href="http://www.freecodecamp.com/challenges/waypoint-target-a-specific-child-of-an-element-using-jquery" rel="nofollow">http://www.freecodecamp.com/challenges/waypoint-target-a-specific-child-of-an-element-using-jquery</a> has an issue.</p> <p dir="auto">The challenge will not allow the user to proceed even after posting the right solution i.e.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$('.well:nth-child(2)').addClass(&quot;animated bounce&quot;);"><pre class="notranslate"><span class="pl-en">$</span><span class="pl-kos">(</span><span class="pl-s">'.well:nth-child(2)'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">addClass</span><span class="pl-kos">(</span><span class="pl-s">"animated bounce"</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p dir="auto">Currently the workaround to get ahead is to add a space after before and after the colon(Thanks to user <strong><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/saadmehmood233/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/saadmehmood233">@saadmehmood233</a></strong> for pointing it out). The use of these spaces should not be binding as they are not required as per the syntax and it should be removed.</p>
<p dir="auto">Challenge <a href="http://www.freecodecamp.com/challenges/waypoint-comment-your-javascript-code" rel="nofollow">http://www.freecodecamp.com/challenges/waypoint-comment-your-javascript-code</a> has an issue. Please describe how to reproduce it, and include links to screenshots if possible.</p> <p dir="auto">Code "assert(editor.getValue().match(/(//)...../g)," appears on the left hand checklist.</p> <p dir="auto">After completing the challenge and running the code, section completion pop-up appears, and if you try to move on to the next section, the section completion pop-up will continuously appear instead of moving on to the next section.</p> <p dir="auto">Multi-line comments such as this do not pass the test:</p> <p dir="auto">/*</p> <p dir="auto">hello</p> <p dir="auto">*/</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/10805390/9346442/c7ef449c-45ea-11e5-8bd1-d1ebf80add2d.png"><img width="1440" alt="screen shot 2015-08-18 at 8 50 03 pm" src="https://cloud.githubusercontent.com/assets/10805390/9346442/c7ef449c-45ea-11e5-8bd1-d1ebf80add2d.png" style="max-width: 100%;"></a></p>
0
<p dir="auto">There is something missing in javascript after 3.0.0-rc1, versions -rc2 -wip and the latest release.</p> <p dir="auto">It shows a transparent background in modals when loads a single html file as remote content. There is a similar bug <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="18947882" data-permission-text="Title is private" data-url="https://github.com/twbs/bootstrap/issues/10415" data-hovercard-type="issue" data-hovercard-url="/twbs/bootstrap/issues/10415/hovercard" href="https://github.com/twbs/bootstrap/issues/10415">#10415</a>, but this one is not related with Rails.</p> <pre class="notranslate">&lt;html&gt; &lt;head&gt; &lt;link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css"/&gt; &lt;/head&gt; &lt;body&gt; &lt;a href="#myModal" data-toggle="modal" class="btn btn-primary btn-lg"&gt;Launch demo modal&lt;/a&gt; &lt;a href="./test.html" data-toggle="modal" data-target="#myModal2" class="btn btn-primary btn-lg"&gt;Launch demo modal2&lt;/a&gt; &lt;!-- Modal --&gt; &lt;div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;×&lt;/button&gt; &lt;h4 class="modal-title"&gt;Modal title&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; ... &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt; &lt;button type="button" class="btn btn-primary"&gt;Save changes&lt;/button&gt; &lt;/div&gt; &lt;/div&gt;&lt;!-- /.modal-content --&gt; &lt;/div&gt;&lt;!-- /.modal-dialog --&gt; &lt;/div&gt;&lt;!-- /.modal --&gt; &lt;!-- Modal --&gt; &lt;div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;×&lt;/button&gt; &lt;h4 class="modal-title"&gt;Modal title&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; ... &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt; &lt;button type="button" class="btn btn-primary"&gt;Save changes&lt;/button&gt; &lt;/div&gt; &lt;/div&gt;&lt;!-- /.modal-content --&gt; &lt;/div&gt;&lt;!-- /.modal-dialog --&gt; &lt;/div&gt;&lt;!-- /.modal --&gt; &lt;script src="//code.jquery.com/jquery.js"&gt;&lt;/script&gt; &lt;!-- it only works well in 2.3.2 and 3.0.0-rc1 javascript, any other version shows transparent background //netdna.bootstrapcdn.com/bootstrap/3.0.0-rc1/js/bootstrap.min.js //netdna.bootstrapcdn.com/bootstrap/3.0.0-rc2/js/bootstrap.min.js //netdna.bootstrapcdn.com/bootstrap/3.0.0-wip/js/bootstrap.min.js --&gt; &lt;script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"&gt;&lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </pre> <p dir="auto">It fails in MAC OSX 10.8.4 and Windows 7 Professional, in Safari 6.0.5, Firefox 23.0.1, Google Chrome 29.0.1547.65 and Internet Explorer 10.0.9200.16686.</p>
1
<p dir="auto">OS: Windows 7 32 bit, using MinGW version suggested by wiki (because last one just fails)</p> <p dir="auto">Trying to compile example from website.</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/aa477ebb9a19385b6edcb74affad405738b0a571345167a7b7bf90f5a8cc99cc/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f323635363936352f3137343937312f38383330313838382d376233332d313165322d383339372d3538343738613536333135372e4a5047"><img src="https://camo.githubusercontent.com/aa477ebb9a19385b6edcb74affad405738b0a571345167a7b7bf90f5a8cc99cc/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f323635363936352f3137343937312f38383330313838382d376233332d313165322d383339372d3538343738613536333135372e4a5047" alt=" " data-canonical-src="https://f.cloud.github.com/assets/2656965/174971/88301888-7b33-11e2-8397-58478a563157.JPG" style="max-width: 100%;"></a></p> <p dir="auto">description:</p> <p dir="auto">this code works:</p> <div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="use core::*; fn main() { for [&quot;Alice&quot;, &quot;Bob&quot;, &quot;Carol&quot;].each |&amp;name| { do task::spawn { io::println(name); } } }"><pre class="notranslate"><span class="pl-k">use</span> core<span class="pl-kos">::</span><span class="pl-c1">*</span><span class="pl-kos">;</span> <span class="pl-k">fn</span> <span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">for</span> <span class="pl-kos">[</span><span class="pl-s">"Alice"</span><span class="pl-kos">,</span> <span class="pl-s">"Bob"</span><span class="pl-kos">,</span> <span class="pl-s">"Carol"</span><span class="pl-kos">]</span><span class="pl-kos">.</span>each |<span class="pl-c1">&amp;</span>name| <span class="pl-kos">{</span> do task<span class="pl-kos">::</span><span class="pl-v">spawn</span> <span class="pl-kos">{</span> <span class="pl-c1">io</span><span class="pl-kos">:</span><span class="pl-kos">:</span>println<span class="pl-kos">(</span>name<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">but when I add</p> <div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="let v = rand::Rng().shuffle([1, 2, 3]);"><pre class="notranslate"><span class="pl-k">let</span> v = rand<span class="pl-kos">::</span><span class="pl-v">Rng</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">shuffle</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">2</span><span class="pl-kos">,</span> <span class="pl-c1">3</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p dir="auto">like</p> <div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="use core::*; fn main() { for [&quot;Alice&quot;, &quot;Bob&quot;, &quot;Carol&quot;].each |&amp;name| { do task::spawn { let v = rand::Rng().shuffle([1, 2, 3]); io::println(name); } } }"><pre class="notranslate"><span class="pl-k">use</span> core<span class="pl-kos">::</span><span class="pl-c1">*</span><span class="pl-kos">;</span> <span class="pl-k">fn</span> <span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">for</span> <span class="pl-kos">[</span><span class="pl-s">"Alice"</span><span class="pl-kos">,</span> <span class="pl-s">"Bob"</span><span class="pl-kos">,</span> <span class="pl-s">"Carol"</span><span class="pl-kos">]</span><span class="pl-kos">.</span>each |<span class="pl-c1">&amp;</span>name| <span class="pl-kos">{</span> do task<span class="pl-kos">::</span><span class="pl-v">spawn</span> <span class="pl-kos">{</span> let v = <span class="pl-c1">rand</span><span class="pl-kos">:</span><span class="pl-kos">:</span><span class="pl-v">Rng</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span>shuffle<span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">2</span><span class="pl-kos">,</span> <span class="pl-c1">3</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span> io<span class="pl-kos">::</span>println<span class="pl-kos">(</span>name<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">it fails with error :</p> <p dir="auto">The procedure entry point ... rand... extension... not found in the .... dll</p> <p dir="auto">btw: why does rust code highlighting on github look like plain text?</p>
<p dir="auto">From ssylvan:</p> <p dir="auto">Consider this a very preliminary bug report, I only gave it about two<br> minutes because I have to run, so I could probably track this down<br> further with some process monitor logging. In case this is useful as<br> is I'll just tell you here.</p> <p dir="auto">On 64-bit Windows 8 RTM I get this in a message box when running the<br> executable produced by compiling the example on rust-lang.org.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="--------------------------- helloworld.exe - Entry Point Not Found --------------------------- The procedure entry point _ZN4rand14__extensions__10meth_1235514gen_uint_range17_be256aac3933fdb73_04E could not be located in the dynamic link library D:\Programming\rust\helloworld.exe."><pre class="notranslate"><code class="notranslate">--------------------------- helloworld.exe - Entry Point Not Found --------------------------- The procedure entry point _ZN4rand14__extensions__10meth_1235514gen_uint_range17_be256aac3933fdb73_04E could not be located in the dynamic link library D:\Programming\rust\helloworld.exe. </code></pre></div>
1
<h3 dir="auto">Problem</h3> <p dir="auto">Duplicate from <a href="https://stackoverflow.com/questions/72375427/matplotlib-plot-2d-data-in-3d-plot-as-a-projection-on-faces-without-the-2d-dots" rel="nofollow">stackoverflow 72375427</a> .</p> <p dir="auto">When plotting 2D scatter data on a 3D scatter plot (eg as in the <a href="https://matplotlib.org/stable/gallery/mplot3d/2dcollections3d.html" rel="nofollow">example code from matplotlib website</a>, which incidentally shows the problematic behaviour as the sin curve is obviously off by a bit), the 2D data floats "on top" or "alongside" of the 2D face it is supposed to be placed upon and therefore gives the impression to be wrongly plotted. For example, using this to show the projection of dots from the 3D space to 2D planes (3 plot faces) gives the impression that the dots are not at the correct position, because of the parallax (see plot linked below).</p> <p dir="auto"><a href="https://i.stack.imgur.com/yOkNr.png" rel="nofollow">3D plot with 2D plots on sides, as produced by above code</a><br> <a href="https://i.stack.imgur.com/qDabq.png" rel="nofollow">3D plot with 2D plots on sides, as expected</a></p> <p dir="auto">I cannot get the planes to exactly be positioned at a specified coordinate. Setting the x_lim, y_lim and z_lim parameters only slightly improves this, but there is still a slight, seemingly random, margin added beyond the axes limits (contrary to what happens in 2D plots).</p> <h3 dir="auto">Proposed solution</h3> <p dir="auto">I may have missed the option to do this. But it would be nice to have the possibility to overrule the automatic setting of the position of the edge planes so that setting the x_lim, y_lim and z_lim parameters fixes the planes to those specified values (for instance, or another extra parameter).</p> <p dir="auto">Another solution based on generating the 2D graphs as images and adding them to the 3D plot could potentially work, but probably is a messy hack more than a solution.</p>
<p dir="auto">I take an example from<br> <a href="https://stackoverflow.com/questions/23951230/python-axis-limit-in-matplotlib" rel="nofollow">https://stackoverflow.com/questions/23951230/python-axis-limit-in-matplotlib</a></p> <p dir="auto">In mplot3d, when you set, for example, <code class="notranslate">set_xlim(0, 0.8)</code>, the outcome has an extra like <code class="notranslate">set_xlim(0 - eps, 0.8 + eps)</code>, where eps is related to <code class="notranslate">deltas</code>.<br> </p><div class="Box Box--condensed my-2"> <div class="Box-header f6"> <p class="mb-0 text-bold"> <a href="https://github.com/matplotlib/matplotlib/blob/6e76411a4f3e4cc54cae562529d8973fc12e4497/lib/mpl_toolkits/mplot3d/axis3d.py#L187">matplotlib/lib/mpl_toolkits/mplot3d/axis3d.py</a> </p> <p class="mb-0 color-fg-muted"> Line 187 in <a data-pjax="true" class="commit-tease-sha" href="/matplotlib/matplotlib/commit/6e76411a4f3e4cc54cae562529d8973fc12e4497">6e76411</a> </p> </div> <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data"> <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip=""> <tbody><tr class="border-0"> <td id="L187" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="187"></td> <td id="LC187" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">deltas</span> <span class="pl-c1">=</span> (<span class="pl-s1">maxs</span> <span class="pl-c1">-</span> <span class="pl-s1">mins</span>) <span class="pl-c1">/</span> <span class="pl-c1">12.</span> </td> </tr> </tbody></table> </div> </div> <p></p> <p dir="auto">To show the exact lims, you have to change <code class="notranslate">deltas</code> to, for example, <code class="notranslate">0 * (maxs - mins) / 12.</code></p> <p dir="auto">You need something to set exact lims without touching the inside of matplotlib.</p> <p dir="auto"><strong>Code for reproduction</strong></p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt fig = plt.figure() ax = fig.gca(projection = '3d') ax.set_xlim(0,0.8) plt.show()"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">mpl_toolkits</span>.<span class="pl-s1">mplot3d</span> <span class="pl-k">import</span> <span class="pl-v">Axes3D</span> <span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">pyplot</span> <span class="pl-k">as</span> <span class="pl-s1">plt</span> <span class="pl-s1">fig</span> <span class="pl-c1">=</span> <span class="pl-s1">plt</span>.<span class="pl-en">figure</span>() <span class="pl-s1">ax</span> <span class="pl-c1">=</span> <span class="pl-s1">fig</span>.<span class="pl-en">gca</span>(<span class="pl-s1">projection</span> <span class="pl-c1">=</span> <span class="pl-s">'3d'</span>) <span class="pl-s1">ax</span>.<span class="pl-en">set_xlim</span>(<span class="pl-c1">0</span>,<span class="pl-c1">0.8</span>) <span class="pl-s1">plt</span>.<span class="pl-en">show</span>()</pre></div> <p dir="auto"><strong>Actual outcome</strong><br> <a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/18307308/88422611-7f1de980-ce25-11ea-8125-9c795bd0b138.png"><img src="https://user-images.githubusercontent.com/18307308/88422611-7f1de980-ce25-11ea-8125-9c795bd0b138.png" alt="fig" style="max-width: 100%;"></a></p> <p dir="auto"><strong>Matplotlib version</strong></p> <ul dir="auto"> <li>Operating system:macOS 10.14.6</li> <li>Matplotlib version: 3.1.1</li> <li>Python version: 3.7.4</li> </ul> <p dir="auto">The problem was discussed many times in STACK OVERFLOW:<br> <a href="https://stackoverflow.com/questions/23951230/python-axis-limit-in-matplotlib" rel="nofollow">https://stackoverflow.com/questions/23951230/python-axis-limit-in-matplotlib</a><br> <a href="https://stackoverflow.com/questions/46380464/matplotlib-3d-axis-bounds-always-too-large-doesnt-set-lims-correctly" rel="nofollow">https://stackoverflow.com/questions/46380464/matplotlib-3d-axis-bounds-always-too-large-doesnt-set-lims-correctly</a><br> <a href="https://stackoverflow.com/questions/16488182/removing-axes-margins-in-3d-plot" rel="nofollow">https://stackoverflow.com/questions/16488182/removing-axes-margins-in-3d-plot</a></p>
1
<h4 dir="auto">Code Sample, a copy-pastable example if possible</h4> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# This works as expected, and as it worked in the past (0.17.1) pd.concat([pd.util.testing.makeTimeSeries(), pd.Series()], axis=1) # This fails in 0.20.1 pd.concat([pd.util.testing.makeTimeSeries().tz_localize('America/Chicago'), pd.Series()], axis=1)"><pre class="notranslate"><span class="pl-c"># This works as expected, and as it worked in the past (0.17.1)</span> <span class="pl-s1">pd</span>.<span class="pl-en">concat</span>([<span class="pl-s1">pd</span>.<span class="pl-s1">util</span>.<span class="pl-s1">testing</span>.<span class="pl-en">makeTimeSeries</span>(), <span class="pl-s1">pd</span>.<span class="pl-v">Series</span>()], <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-c1">1</span>) <span class="pl-c"># This fails in 0.20.1</span> <span class="pl-s1">pd</span>.<span class="pl-en">concat</span>([<span class="pl-s1">pd</span>.<span class="pl-s1">util</span>.<span class="pl-s1">testing</span>.<span class="pl-en">makeTimeSeries</span>().<span class="pl-en">tz_localize</span>(<span class="pl-s">'America/Chicago'</span>), <span class="pl-s1">pd</span>.<span class="pl-v">Series</span>()], <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-c1">1</span>)</pre></div> <h4 dir="auto">Problem description</h4> <p dir="auto">Only happens with <code class="notranslate">axis=1</code><br> Shouldn't be a problem to concat an empty series to a dataframe...</p> <h4 dir="auto">Expected Output</h4> <p dir="auto">Should filter out empty objects passed to concat.</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="pd.concat([pd.Series(pd.util.testing.makeTimeSeries().tz_localize('America/Chicago'), name='with_tz'), pd.Series(name='empty')], axis=1) Out[2]: with_tz 2000-01-03 00:00:00-06:00 -0.999300 2000-01-04 00:00:00-06:00 -0.800759 2000-01-05 00:00:00-06:00 0.166496 2000-01-06 00:00:00-06:00 -0.496464 2000-01-07 00:00:00-06:00 -0.237731 2000-01-10 00:00:00-06:00 -0.242352 2000-01-11 00:00:00-06:00 1.779163 2000-01-12 00:00:00-06:00 0.193893 "><pre class="notranslate"><span class="pl-s1">pd</span>.<span class="pl-en">concat</span>([<span class="pl-s1">pd</span>.<span class="pl-v">Series</span>(<span class="pl-s1">pd</span>.<span class="pl-s1">util</span>.<span class="pl-s1">testing</span>.<span class="pl-en">makeTimeSeries</span>().<span class="pl-en">tz_localize</span>(<span class="pl-s">'America/Chicago'</span>), <span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s">'with_tz'</span>), <span class="pl-s1">pd</span>.<span class="pl-v">Series</span>(<span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s">'empty'</span>)], <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-c1">1</span>) <span class="pl-v">Out</span>[<span class="pl-c1">2</span>]: <span class="pl-s1">with_tz</span> <span class="pl-c1">2000</span><span class="pl-c1">-</span><span class="pl-c1">01</span><span class="pl-c1">-</span><span class="pl-c1">03</span> <span class="pl-c1">00</span>:<span class="pl-c1">00</span>:<span class="pl-c1">00</span><span class="pl-c1">-</span><span class="pl-c1">06</span>:<span class="pl-c1">00</span> <span class="pl-c1">-</span><span class="pl-c1">0.999300</span> <span class="pl-c1">2000</span><span class="pl-c1">-</span><span class="pl-c1">01</span><span class="pl-c1">-</span><span class="pl-c1">04</span> <span class="pl-c1">00</span>:<span class="pl-c1">00</span>:<span class="pl-c1">00</span><span class="pl-c1">-</span><span class="pl-c1">06</span>:<span class="pl-c1">00</span> <span class="pl-c1">-</span><span class="pl-c1">0.800759</span> <span class="pl-c1">2000</span><span class="pl-c1">-</span><span class="pl-c1">01</span><span class="pl-c1">-</span><span class="pl-c1">05</span> <span class="pl-c1">00</span>:<span class="pl-c1">00</span>:<span class="pl-c1">00</span><span class="pl-c1">-</span><span class="pl-c1">06</span>:<span class="pl-c1">00</span> <span class="pl-c1">0.166496</span> <span class="pl-c1">2000</span><span class="pl-c1">-</span><span class="pl-c1">01</span><span class="pl-c1">-</span><span class="pl-c1">06</span> <span class="pl-c1">00</span>:<span class="pl-c1">00</span>:<span class="pl-c1">00</span><span class="pl-c1">-</span><span class="pl-c1">06</span>:<span class="pl-c1">00</span> <span class="pl-c1">-</span><span class="pl-c1">0.496464</span> <span class="pl-c1">2000</span><span class="pl-c1">-</span><span class="pl-c1">01</span><span class="pl-c1">-</span><span class="pl-c1">07</span> <span class="pl-c1">00</span>:<span class="pl-c1">00</span>:<span class="pl-c1">00</span><span class="pl-c1">-</span><span class="pl-c1">06</span>:<span class="pl-c1">00</span> <span class="pl-c1">-</span><span class="pl-c1">0.237731</span> <span class="pl-c1">2000</span><span class="pl-c1">-</span><span class="pl-c1">01</span><span class="pl-c1">-</span><span class="pl-c1">10</span> <span class="pl-c1">00</span>:<span class="pl-c1">00</span>:<span class="pl-c1">00</span><span class="pl-c1">-</span><span class="pl-c1">06</span>:<span class="pl-c1">00</span> <span class="pl-c1">-</span><span class="pl-c1">0.242352</span> <span class="pl-c1">2000</span><span class="pl-c1">-</span><span class="pl-c1">01</span><span class="pl-c1">-</span><span class="pl-c1">11</span> <span class="pl-c1">00</span>:<span class="pl-c1">00</span>:<span class="pl-c1">00</span><span class="pl-c1">-</span><span class="pl-c1">06</span>:<span class="pl-c1">00</span> <span class="pl-c1">1.779163</span> <span class="pl-c1">2000</span><span class="pl-c1">-</span><span class="pl-c1">01</span><span class="pl-c1">-</span><span class="pl-c1">12</span> <span class="pl-c1">00</span>:<span class="pl-c1">00</span>:<span class="pl-c1">00</span><span class="pl-c1">-</span><span class="pl-c1">06</span>:<span class="pl-c1">00</span> <span class="pl-c1">0.193893</span></pre></div> <h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4> <details> ``` INSTALLED VERSIONS ------------------ commit: None python: 2.7.12.final.0 python-bits: 64 OS: Windows OS-release: 8.1 machine: AMD64 processor: Intel64 Family 6 Model 60 Stepping 3, GenuineIntel byteorder: little LC_ALL: None LANG: None LOCALE: None.None pandas: 0.20.2 pytest: 3.0.7 pip: 9.0.1 setuptools: 34.3.1 Cython: None numpy: 1.12.1 scipy: 0.18.1 xarray: None IPython: 5.3.0 sphinx: None patsy: 0.4.1 dateutil: 2.6.0 pytz: 2017.2 blosc: None bottleneck: None tables: None numexpr: 2.6.2 feather: None matplotlib: 2.0.2 openpyxl: None xlrd: 1.0.0 xlwt: None xlsxwriter: None lxml: None bs4: 4.5.1 html5lib: 0.9999999 sqlalchemy: None pymysql: None psycopg2: None jinja2: 2.9.6 s3fs: None pandas_gbq: None pandas_datareader: None </details>
<h4 dir="auto">Code Sample</h4> <p dir="auto">I am not sure this is the simplest way to produce this error.</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import pandas as pd import pytz from datetime import datetime ldn = pytz.timezone(&quot;Europe/London&quot;) df = pd.DataFrame(data={&quot;times&quot; : [ldn.localize(datetime(2017,5,4, 11, 18)), ldn.localize(datetime(2017,5,4,13,20)), ldn.localize(datetime(2017,3,4, 11, 18)), ldn.localize(datetime(2017,3,4,13,20))], &quot;toGroupBy&quot; : [&quot;a&quot;, &quot;a&quot;, &quot;b&quot;,&quot;b&quot;]}) def timeoffset(df): col = df.times if df.toGroupBy.iloc[0] == &quot;b&quot;: forward = [None for i in range(len(col))] else: forward = [None if i == len(col) -1 else col[i+1] for i in range(len(col))] return pd.DataFrame(data={&quot;forward&quot; : forward}) gb = df.groupby(&quot;toGroupBy&quot;) gb.apply(timeoffset)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span> <span class="pl-k">import</span> <span class="pl-s1">pytz</span> <span class="pl-k">from</span> <span class="pl-s1">datetime</span> <span class="pl-k">import</span> <span class="pl-s1">datetime</span> <span class="pl-s1">ldn</span> <span class="pl-c1">=</span> <span class="pl-s1">pytz</span>.<span class="pl-en">timezone</span>(<span class="pl-s">"Europe/London"</span>) <span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>(<span class="pl-s1">data</span><span class="pl-c1">=</span>{<span class="pl-s">"times"</span> : [<span class="pl-s1">ldn</span>.<span class="pl-en">localize</span>(<span class="pl-en">datetime</span>(<span class="pl-c1">2017</span>,<span class="pl-c1">5</span>,<span class="pl-c1">4</span>, <span class="pl-c1">11</span>, <span class="pl-c1">18</span>)), <span class="pl-s1">ldn</span>.<span class="pl-en">localize</span>(<span class="pl-en">datetime</span>(<span class="pl-c1">2017</span>,<span class="pl-c1">5</span>,<span class="pl-c1">4</span>,<span class="pl-c1">13</span>,<span class="pl-c1">20</span>)), <span class="pl-s1">ldn</span>.<span class="pl-en">localize</span>(<span class="pl-en">datetime</span>(<span class="pl-c1">2017</span>,<span class="pl-c1">3</span>,<span class="pl-c1">4</span>, <span class="pl-c1">11</span>, <span class="pl-c1">18</span>)), <span class="pl-s1">ldn</span>.<span class="pl-en">localize</span>(<span class="pl-en">datetime</span>(<span class="pl-c1">2017</span>,<span class="pl-c1">3</span>,<span class="pl-c1">4</span>,<span class="pl-c1">13</span>,<span class="pl-c1">20</span>))], <span class="pl-s">"toGroupBy"</span> : [<span class="pl-s">"a"</span>, <span class="pl-s">"a"</span>, <span class="pl-s">"b"</span>,<span class="pl-s">"b"</span>]}) <span class="pl-k">def</span> <span class="pl-en">timeoffset</span>(<span class="pl-s1">df</span>): <span class="pl-s1">col</span> <span class="pl-c1">=</span> <span class="pl-s1">df</span>.<span class="pl-s1">times</span> <span class="pl-k">if</span> <span class="pl-s1">df</span>.<span class="pl-s1">toGroupBy</span>.<span class="pl-s1">iloc</span>[<span class="pl-c1">0</span>] <span class="pl-c1">==</span> <span class="pl-s">"b"</span>: <span class="pl-s1">forward</span> <span class="pl-c1">=</span> [<span class="pl-c1">None</span> <span class="pl-k">for</span> <span class="pl-s1">i</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-en">len</span>(<span class="pl-s1">col</span>))] <span class="pl-k">else</span>: <span class="pl-s1">forward</span> <span class="pl-c1">=</span> [<span class="pl-c1">None</span> <span class="pl-k">if</span> <span class="pl-s1">i</span> <span class="pl-c1">==</span> <span class="pl-en">len</span>(<span class="pl-s1">col</span>) <span class="pl-c1">-</span><span class="pl-c1">1</span> <span class="pl-k">else</span> <span class="pl-s1">col</span>[<span class="pl-s1">i</span><span class="pl-c1">+</span><span class="pl-c1">1</span>] <span class="pl-k">for</span> <span class="pl-s1">i</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-en">len</span>(<span class="pl-s1">col</span>))] <span class="pl-k">return</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>(<span class="pl-s1">data</span><span class="pl-c1">=</span>{<span class="pl-s">"forward"</span> : <span class="pl-s1">forward</span>}) <span class="pl-s1">gb</span> <span class="pl-c1">=</span> <span class="pl-s1">df</span>.<span class="pl-en">groupby</span>(<span class="pl-s">"toGroupBy"</span>) <span class="pl-s1">gb</span>.<span class="pl-en">apply</span>(<span class="pl-s1">timeoffset</span>)</pre></div> <h4 dir="auto">Problem description</h4> <p dir="auto">the last line above throws the following stacktrace:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="--------------------------------------------------------------------------- TypeError Traceback (most recent call last) &lt;ipython-input-59-40778c60c413&gt; in &lt;module&gt;() ----&gt; 1 gb.apply(timeoffset) /home/me/git/pandas/pandas/core/groupby.py in apply(self, func, *args, **kwargs) 714 # ignore SettingWithCopy here in case the user mutates 715 with option_context('mode.chained_assignment', None): --&gt; 716 return self._python_apply_general(f) 717 718 def _python_apply_general(self, f): /home/me/git/pandas/pandas/core/groupby.py in _python_apply_general(self, f) 723 keys, 724 values, --&gt; 725 not_indexed_same=mutated or self.mutated) 726 727 def _iterate_slices(self): /home/me/git/pandas/pandas/core/groupby.py in _wrap_applied_output(self, keys, values, not_indexed_same) 3524 elif isinstance(v, DataFrame): 3525 return self._concat_objects(keys, values, -&gt; 3526 not_indexed_same=not_indexed_same) 3527 elif self.grouper.groupings is not None: 3528 if len(self.grouper.groupings) &gt; 1: /home/me/git/pandas/pandas/core/groupby.py in _concat_objects(self, keys, values, not_indexed_same) 913 914 result = concat(values, axis=self.axis, keys=group_keys, --&gt; 915 levels=group_levels, names=group_names) 916 else: 917 /home/me/git/pandas/pandas/core/reshape/concat.py in concat(objs, axis, join, join_axes, ignore_index, keys, levels, names, verify_integrity, copy) 205 verify_integrity=verify_integrity, 206 copy=copy) --&gt; 207 return op.get_result() 208 209 /home/me/git/pandas/pandas/core/reshape/concat.py in get_result(self) 405 new_data = concatenate_block_managers( 406 mgrs_indexers, self.new_axes, concat_axis=self.axis, --&gt; 407 copy=self.copy) 408 if not self.copy: 409 new_data._consolidate_inplace() /home/me/git/pandas/pandas/core/internals.py in concatenate_block_managers(mgrs_indexers, axes, concat_axis, copy) 4830 blocks = [make_block( 4831 concatenate_join_units(join_units, concat_axis, copy=copy), -&gt; 4832 placement=placement) for placement, join_units in concat_plan] 4833 4834 return BlockManager(blocks, axes) /home/me/git/pandas/pandas/core/internals.py in &lt;listcomp&gt;(.0) 4830 blocks = [make_block( 4831 concatenate_join_units(join_units, concat_axis, copy=copy), -&gt; 4832 placement=placement) for placement, join_units in concat_plan] 4833 4834 return BlockManager(blocks, axes) /home/me/git/pandas/pandas/core/internals.py in concatenate_join_units(join_units, concat_axis, copy) 4937 to_concat = [ju.get_reindexed_values(empty_dtype=empty_dtype, 4938 upcasted_na=upcasted_na) -&gt; 4939 for ju in join_units] 4940 4941 if len(to_concat) == 1: /home/me/git/pandas/pandas/core/internals.py in &lt;listcomp&gt;(.0) 4937 to_concat = [ju.get_reindexed_values(empty_dtype=empty_dtype, 4938 upcasted_na=upcasted_na) -&gt; 4939 for ju in join_units] 4940 4941 if len(to_concat) == 1: /home/me/git/pandas/pandas/core/internals.py in get_reindexed_values(self, empty_dtype, upcasted_na) 5210 pass 5211 else: -&gt; 5212 missing_arr = np.empty(self.shape, dtype=empty_dtype) 5213 missing_arr.fill(fill_value) 5214 return missing_arr TypeError: data type not understood"><pre class="notranslate"><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-v">TypeError</span> <span class="pl-v">Traceback</span> (<span class="pl-s1">most</span> <span class="pl-s1">recent</span> <span class="pl-s1">call</span> <span class="pl-s1">last</span>) <span class="pl-c1">&lt;</span><span class="pl-s1">ipython</span><span class="pl-c1">-</span><span class="pl-s1">input</span><span class="pl-c1">-</span><span class="pl-c1">59</span><span class="pl-c1">-</span><span class="pl-c1">40778</span><span class="pl-s1">c60c413</span><span class="pl-c1">&gt;</span> <span class="pl-s1">in</span> <span class="pl-c1">&lt;</span><span class="pl-s1">module</span><span class="pl-c1">&gt;</span>() <span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">1</span> <span class="pl-s1">gb</span>.<span class="pl-en">apply</span>(<span class="pl-s1">timeoffset</span>) <span class="pl-c1">/</span><span class="pl-s1">home</span><span class="pl-c1">/</span><span class="pl-s1">me</span><span class="pl-c1">/</span><span class="pl-s1">git</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">groupby</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">apply</span>(<span class="pl-s1">self</span>, <span class="pl-s1">func</span>, <span class="pl-c1">*</span><span class="pl-s1">args</span>, <span class="pl-c1">**</span><span class="pl-s1">kwargs</span>) <span class="pl-c1">714</span> <span class="pl-c"># ignore SettingWithCopy here in case the user mutates</span> <span class="pl-c1">715</span> <span class="pl-k">with</span> <span class="pl-en">option_context</span>(<span class="pl-s">'mode.chained_assignment'</span>, <span class="pl-c1">None</span>): <span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">716</span> <span class="pl-s1">return</span> <span class="pl-s1">self</span>.<span class="pl-en">_python_apply_general</span>(<span class="pl-s1">f</span>) <span class="pl-c1">717</span> <span class="pl-c1">718</span> <span class="pl-k">def</span> <span class="pl-en">_python_apply_general</span>(<span class="pl-s1">self</span>, <span class="pl-s1">f</span>): <span class="pl-c1">/</span><span class="pl-s1">home</span><span class="pl-c1">/</span><span class="pl-s1">me</span><span class="pl-c1">/</span><span class="pl-s1">git</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">groupby</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">_python_apply_general</span>(<span class="pl-s1">self</span>, <span class="pl-s1">f</span>) <span class="pl-c1">723</span> <span class="pl-s1">keys</span>, <span class="pl-c1">724</span> <span class="pl-s1">values</span>, <span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">725</span> <span class="pl-s1">not_indexed_same</span><span class="pl-c1">=</span><span class="pl-s1">mutated</span> <span class="pl-c1">or</span> <span class="pl-s1">self</span>.<span class="pl-s1">mutated</span>) <span class="pl-c1">726</span> <span class="pl-c1">727</span> <span class="pl-k">def</span> <span class="pl-en">_iterate_slices</span>(<span class="pl-s1">self</span>): <span class="pl-c1">/</span><span class="pl-s1">home</span><span class="pl-c1">/</span><span class="pl-s1">me</span><span class="pl-c1">/</span><span class="pl-s1">git</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">groupby</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">_wrap_applied_output</span>(<span class="pl-s1">self</span>, <span class="pl-s1">keys</span>, <span class="pl-s1">values</span>, <span class="pl-s1">not_indexed_same</span>) <span class="pl-c1">3524</span> <span class="pl-s1">elif</span> <span class="pl-s1">isinstance</span>(<span class="pl-s1">v</span>, <span class="pl-v">DataFrame</span>): <span class="pl-c1">3525</span> <span class="pl-k">return</span> <span class="pl-s1">self</span>.<span class="pl-en">_concat_objects</span>(<span class="pl-s1">keys</span>, <span class="pl-s1">values</span>, <span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">3526</span> <span class="pl-s1">not_indexed_same</span><span class="pl-c1">=</span><span class="pl-s1">not_indexed_same</span>) <span class="pl-c1">3527</span> <span class="pl-s1">elif</span> <span class="pl-s1">self</span>.<span class="pl-s1">grouper</span>.<span class="pl-s1">groupings</span> <span class="pl-c1">is</span> <span class="pl-c1">not</span> <span class="pl-c1">None</span>: <span class="pl-c1">3528</span> <span class="pl-k">if</span> <span class="pl-en">len</span>(<span class="pl-s1">self</span>.<span class="pl-s1">grouper</span>.<span class="pl-s1">groupings</span>) <span class="pl-c1">&gt;</span> <span class="pl-c1">1</span>: <span class="pl-c1">/</span><span class="pl-s1">home</span><span class="pl-c1">/</span><span class="pl-s1">me</span><span class="pl-c1">/</span><span class="pl-s1">git</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">groupby</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">_concat_objects</span>(<span class="pl-s1">self</span>, <span class="pl-s1">keys</span>, <span class="pl-s1">values</span>, <span class="pl-s1">not_indexed_same</span>) <span class="pl-c1">913</span> <span class="pl-c1">914</span> <span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-en">concat</span>(<span class="pl-s1">values</span>, <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-s1">self</span>.<span class="pl-s1">axis</span>, <span class="pl-s1">keys</span><span class="pl-c1">=</span><span class="pl-s1">group_keys</span>, <span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">915</span> <span class="pl-s1">levels</span><span class="pl-c1">=</span><span class="pl-s1">group_levels</span>, <span class="pl-s1">names</span><span class="pl-c1">=</span><span class="pl-s1">group_names</span>) <span class="pl-c1">916</span> <span class="pl-k">else</span>: <span class="pl-c1">917</span> <span class="pl-c1">/</span><span class="pl-s1">home</span><span class="pl-c1">/</span><span class="pl-s1">me</span><span class="pl-c1">/</span><span class="pl-s1">git</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">reshape</span><span class="pl-c1">/</span><span class="pl-s1">concat</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">concat</span>(<span class="pl-s1">objs</span>, <span class="pl-s1">axis</span>, <span class="pl-s1">join</span>, <span class="pl-s1">join_axes</span>, <span class="pl-s1">ignore_index</span>, <span class="pl-s1">keys</span>, <span class="pl-s1">levels</span>, <span class="pl-s1">names</span>, <span class="pl-s1">verify_integrity</span>, <span class="pl-s1">copy</span>) <span class="pl-c1">205</span> <span class="pl-s1">verify_integrity</span><span class="pl-c1">=</span><span class="pl-s1">verify_integrity</span>, <span class="pl-c1">206</span> <span class="pl-s1">copy</span><span class="pl-c1">=</span><span class="pl-s1">copy</span>) <span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">207</span> <span class="pl-s1">return</span> <span class="pl-s1">op</span>.<span class="pl-en">get_result</span>() <span class="pl-c1">208</span> <span class="pl-c1">209</span> <span class="pl-c1">/</span><span class="pl-s1">home</span><span class="pl-c1">/</span><span class="pl-s1">me</span><span class="pl-c1">/</span><span class="pl-s1">git</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">reshape</span><span class="pl-c1">/</span><span class="pl-s1">concat</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">get_result</span>(<span class="pl-s1">self</span>) <span class="pl-c1">405</span> <span class="pl-s1">new_data</span> <span class="pl-c1">=</span> <span class="pl-en">concatenate_block_managers</span>( <span class="pl-c1">406</span> <span class="pl-s1">mgrs_indexers</span>, <span class="pl-s1">self</span>.<span class="pl-s1">new_axes</span>, <span class="pl-s1">concat_axis</span><span class="pl-c1">=</span><span class="pl-s1">self</span>.<span class="pl-s1">axis</span>, <span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">407</span> <span class="pl-s1">copy</span><span class="pl-c1">=</span><span class="pl-s1">self</span>.<span class="pl-s1">copy</span>) <span class="pl-c1">408</span> <span class="pl-k">if</span> <span class="pl-c1">not</span> <span class="pl-s1">self</span>.<span class="pl-s1">copy</span>: <span class="pl-c1">409</span> <span class="pl-s1">new_data</span>.<span class="pl-en">_consolidate_inplace</span>() <span class="pl-c1">/</span><span class="pl-s1">home</span><span class="pl-c1">/</span><span class="pl-s1">me</span><span class="pl-c1">/</span><span class="pl-s1">git</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">internals</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">concatenate_block_managers</span>(<span class="pl-s1">mgrs_indexers</span>, <span class="pl-s1">axes</span>, <span class="pl-s1">concat_axis</span>, <span class="pl-s1">copy</span>) <span class="pl-c1">4830</span> <span class="pl-s1">blocks</span> <span class="pl-c1">=</span> [<span class="pl-en">make_block</span>( <span class="pl-c1">4831</span> <span class="pl-en">concatenate_join_units</span>(<span class="pl-s1">join_units</span>, <span class="pl-s1">concat_axis</span>, <span class="pl-s1">copy</span><span class="pl-c1">=</span><span class="pl-s1">copy</span>), <span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">4832</span> <span class="pl-s1">placement</span><span class="pl-c1">=</span><span class="pl-s1">placement</span>) <span class="pl-s1">for</span> <span class="pl-s1">placement</span>, <span class="pl-s1">join_units</span> <span class="pl-c1">in</span> <span class="pl-s1">concat_plan</span>] <span class="pl-c1">4833</span> <span class="pl-c1">4834</span> <span class="pl-k">return</span> <span class="pl-v">BlockManager</span>(<span class="pl-s1">blocks</span>, <span class="pl-s1">axes</span>) <span class="pl-c1">/</span><span class="pl-s1">home</span><span class="pl-c1">/</span><span class="pl-s1">me</span><span class="pl-c1">/</span><span class="pl-s1">git</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">internals</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-c1">&lt;</span><span class="pl-s1">listcomp</span><span class="pl-c1">&gt;</span>(<span class="pl-c1">.0</span>) <span class="pl-c1">4830</span> <span class="pl-s1">blocks</span> <span class="pl-c1">=</span> [<span class="pl-en">make_block</span>( <span class="pl-c1">4831</span> <span class="pl-en">concatenate_join_units</span>(<span class="pl-s1">join_units</span>, <span class="pl-s1">concat_axis</span>, <span class="pl-s1">copy</span><span class="pl-c1">=</span><span class="pl-s1">copy</span>), <span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">4832</span> <span class="pl-s1">placement</span><span class="pl-c1">=</span><span class="pl-s1">placement</span>) <span class="pl-s1">for</span> <span class="pl-s1">placement</span>, <span class="pl-s1">join_units</span> <span class="pl-c1">in</span> <span class="pl-s1">concat_plan</span>] <span class="pl-c1">4833</span> <span class="pl-c1">4834</span> <span class="pl-k">return</span> <span class="pl-v">BlockManager</span>(<span class="pl-s1">blocks</span>, <span class="pl-s1">axes</span>) <span class="pl-c1">/</span><span class="pl-s1">home</span><span class="pl-c1">/</span><span class="pl-s1">me</span><span class="pl-c1">/</span><span class="pl-s1">git</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">internals</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">concatenate_join_units</span>(<span class="pl-s1">join_units</span>, <span class="pl-s1">concat_axis</span>, <span class="pl-s1">copy</span>) <span class="pl-c1">4937</span> <span class="pl-s1">to_concat</span> <span class="pl-c1">=</span> [<span class="pl-s1">ju</span>.<span class="pl-en">get_reindexed_values</span>(<span class="pl-s1">empty_dtype</span><span class="pl-c1">=</span><span class="pl-s1">empty_dtype</span>, <span class="pl-c1">4938</span> <span class="pl-s1">upcasted_na</span><span class="pl-c1">=</span><span class="pl-s1">upcasted_na</span>) <span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">4939</span> <span class="pl-s1">for</span> <span class="pl-s1">ju</span> <span class="pl-c1">in</span> <span class="pl-s1">join_units</span>] <span class="pl-c1">4940</span> <span class="pl-c1">4941</span> <span class="pl-k">if</span> <span class="pl-en">len</span>(<span class="pl-s1">to_concat</span>) <span class="pl-c1">==</span> <span class="pl-c1">1</span>: <span class="pl-c1">/</span><span class="pl-s1">home</span><span class="pl-c1">/</span><span class="pl-s1">me</span><span class="pl-c1">/</span><span class="pl-s1">git</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">internals</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-c1">&lt;</span><span class="pl-s1">listcomp</span><span class="pl-c1">&gt;</span>(<span class="pl-c1">.0</span>) <span class="pl-c1">4937</span> <span class="pl-s1">to_concat</span> <span class="pl-c1">=</span> [<span class="pl-s1">ju</span>.<span class="pl-en">get_reindexed_values</span>(<span class="pl-s1">empty_dtype</span><span class="pl-c1">=</span><span class="pl-s1">empty_dtype</span>, <span class="pl-c1">4938</span> <span class="pl-s1">upcasted_na</span><span class="pl-c1">=</span><span class="pl-s1">upcasted_na</span>) <span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">4939</span> <span class="pl-s1">for</span> <span class="pl-s1">ju</span> <span class="pl-c1">in</span> <span class="pl-s1">join_units</span>] <span class="pl-c1">4940</span> <span class="pl-c1">4941</span> <span class="pl-k">if</span> <span class="pl-en">len</span>(<span class="pl-s1">to_concat</span>) <span class="pl-c1">==</span> <span class="pl-c1">1</span>: <span class="pl-c1">/</span><span class="pl-s1">home</span><span class="pl-c1">/</span><span class="pl-s1">me</span><span class="pl-c1">/</span><span class="pl-s1">git</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">internals</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">get_reindexed_values</span>(<span class="pl-s1">self</span>, <span class="pl-s1">empty_dtype</span>, <span class="pl-s1">upcasted_na</span>) <span class="pl-c1">5210</span> <span class="pl-k">pass</span> <span class="pl-c1">5211</span> <span class="pl-k">else</span>: <span class="pl-c1">-&gt;</span> <span class="pl-c1">5212</span> <span class="pl-s1">missing_arr</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">empty</span>(<span class="pl-s1">self</span>.<span class="pl-s1">shape</span>, <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">empty_dtype</span>) <span class="pl-c1">5213</span> <span class="pl-s1">missing_arr</span>.<span class="pl-en">fill</span>(<span class="pl-s1">fill_value</span>) <span class="pl-c1">5214</span> <span class="pl-k">return</span> <span class="pl-s1">missing_arr</span> <span class="pl-v">TypeError</span>: <span class="pl-s1">data</span> <span class="pl-s1">type</span> <span class="pl-c1">not</span> <span class="pl-s1">understood</span></pre></div> <h4 dir="auto">Expected Output</h4> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" forward toGroupBy a 0 2017-05-04 13:20:00+01:00 1 NaT b 0 NaT 1 NaT"><pre class="notranslate"> <span class="pl-s1">forward</span> <span class="pl-s1">toGroupBy</span> <span class="pl-s1">a</span> <span class="pl-c1">0</span> <span class="pl-c1">2017</span><span class="pl-c1">-</span><span class="pl-c1">05</span><span class="pl-c1">-</span><span class="pl-c1">04</span> <span class="pl-c1">13</span>:<span class="pl-c1">20</span>:<span class="pl-c1">00</span><span class="pl-c1">+</span><span class="pl-c1">01</span>:<span class="pl-c1">00</span> <span class="pl-c1">1</span> <span class="pl-v">NaT</span> <span class="pl-s1">b</span> <span class="pl-c1">0</span> <span class="pl-v">NaT</span> <span class="pl-c1">1</span> <span class="pl-v">NaT</span></pre></div> <h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4> <details> INSTALLED VERSIONS ------------------ commit: None python: 3.6.0.final.0 python-bits: 64 OS: Linux OS-release: 2.6.32-696.el6.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: en_GB.utf8 LANG: en_GB.utf8 LOCALE: en_GB.UTF-8 <p dir="auto">pandas: 0.20.0rc1+48.gae70ece<br> pytest: None<br> pip: 9.0.1<br> setuptools: 28.8.0<br> Cython: 0.25.2<br> numpy: 1.12.1<br> scipy: None<br> xarray: None<br> IPython: 6.0.0<br> sphinx: None<br> patsy: None<br> dateutil: 2.6.0<br> pytz: 2017.2<br> blosc: None<br> bottleneck: None<br> tables: None<br> numexpr: None<br> feather: None<br> matplotlib: None<br> openpyxl: None<br> xlrd: None<br> xlwt: None<br> xlsxwriter: None<br> lxml: None<br> bs4: None<br> html5lib: 0.999999999<br> sqlalchemy: None<br> pymysql: None<br> psycopg2: None<br> jinja2: 2.9.6<br> s3fs: None<br> pandas_gbq: None<br> pandas_datareader: None</p> </details>
1
<p dir="auto">When I run program about Deep MINIST for Experts on Jupyter notebook,I met this question.How do I solve it?</p>
<p dir="auto">The website of Yann LeCun is down at the moment.<br> Therefore the MNIST-Script for downloading the files doesn't work either. (-&gt; learn/python/learn/datasets/mnist.py won't work)<br> Are there any mirrors?</p>
1
<p dir="auto">Hello, I have some data where inadvertently the x and y data were of different types, eventually after much troubleshooting I discovered that one was <code class="notranslate">np.float32</code> and the other was <code class="notranslate">np.float64</code>. When trying to use least-squares minimization to fit to the data, either <code class="notranslate">scipy.optimize.curve_fit</code> or <code class="notranslate">scipy.optimize.leastsq</code> failed in a weird quasi-silent way. The failure mode is that the parameters are barely changed from the initial guess and the optimization returns even though the result is clearly not good. Below is a minimum example demonstrating the bug (from a jupyter notebook):</p> <h3 dir="auto">Reproducing code example:</h3> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="%pylab inline import numpy as np from scipy.optimize import curve_fit def gauss(x, A, mu, sigma): return A/(sigma*np.sqrt(2*np.pi))*np.exp(-(np.power(x-mu,2)/(2*np.power(sigma,2)))) xdata = np.linspace(-1, 1, 20) p_act = [1.4, 0.2, 0.2] ydata = gauss(xdata, *p_act) + np.random.normal(loc=0, scale=0.05, size=len(xdata)) p0 = [1, 0, 0.1] xdata = xdata.astype(dtype=np.float32) ydata = ydata.astype(dtype=np.float64) fit1, pcov1 = curve_fit(gauss, xdata, ydata, p0=p0) xdata = xdata.astype(dtype=np.float32) ydata = ydata.astype(dtype=np.float32) fit2, pcov2 = curve_fit(gauss, xdata, ydata, p0=p0) print(fit1) print(fit2) plot(xdata, ydata, 'bo') x2 = np.linspace(xdata[0], xdata[-1], 100) plot(x2, gauss(x2, *fit1), 'r--') plot(x2, gauss(x2, *fit2), 'm--')"><pre class="notranslate"><code class="notranslate">%pylab inline import numpy as np from scipy.optimize import curve_fit def gauss(x, A, mu, sigma): return A/(sigma*np.sqrt(2*np.pi))*np.exp(-(np.power(x-mu,2)/(2*np.power(sigma,2)))) xdata = np.linspace(-1, 1, 20) p_act = [1.4, 0.2, 0.2] ydata = gauss(xdata, *p_act) + np.random.normal(loc=0, scale=0.05, size=len(xdata)) p0 = [1, 0, 0.1] xdata = xdata.astype(dtype=np.float32) ydata = ydata.astype(dtype=np.float64) fit1, pcov1 = curve_fit(gauss, xdata, ydata, p0=p0) xdata = xdata.astype(dtype=np.float32) ydata = ydata.astype(dtype=np.float32) fit2, pcov2 = curve_fit(gauss, xdata, ydata, p0=p0) print(fit1) print(fit2) plot(xdata, ydata, 'bo') x2 = np.linspace(xdata[0], xdata[-1], 100) plot(x2, gauss(x2, *fit1), 'r--') plot(x2, gauss(x2, *fit2), 'm--') </code></pre></div> <p dir="auto">The output of the print statements are:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[1. 0.05021768 0.10987875] [1.37911003 0.19699727 0.19586094]"><pre class="notranslate"><code class="notranslate">[1. 0.05021768 0.10987875] [1.37911003 0.19699727 0.19586094] </code></pre></div> <h3 dir="auto">Error message:</h3> <p dir="auto">The only signature is that there is a covariance warning when fitting with the different data types:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/usr/local/lib/python3.7/site-packages/scipy/optimize/minpack.py:794: OptimizeWarning: Covariance of the parameters could not be estimated category=OptimizeWarning)"><pre class="notranslate"><code class="notranslate">/usr/local/lib/python3.7/site-packages/scipy/optimize/minpack.py:794: OptimizeWarning: Covariance of the parameters could not be estimated category=OptimizeWarning) </code></pre></div> <h3 dir="auto">Scipy/Numpy/Python version information:</h3> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="1.1.0 1.15.1 sys.version_info(major=3, minor=7, micro=1, releaselevel='final', serial=0)"><pre class="notranslate"><code class="notranslate">1.1.0 1.15.1 sys.version_info(major=3, minor=7, micro=1, releaselevel='final', serial=0) </code></pre></div>
<p dir="auto">I recently ran into an issue whereby curve_fit was failing to fit a function, even though the guesses were reasonable. The warning reported by Scipy was "/usr/local/depot/Python-3.5.1/lib/python3.5/site-packages/scipy/optimize/minpack.py:690: OptimizeWarning: Covariance of the parameters could not be estimated".</p> <p dir="auto">After hours of searching, I discovered that the problem was that I was using np.float32 arrays for the x and y data. Simply using x.astype(np.float64) resolved the issue. Though the warning provided no help or hints as to the source of the problem.</p> <p dir="auto">This is similar to what was reported in this (rather old) email thread: <a href="http://scipy-user.scipy.narkive.com/wSafjCiz/curve-fit-with-float32-values" rel="nofollow">http://scipy-user.scipy.narkive.com/wSafjCiz/curve-fit-with-float32-values</a>, which proved to be very difficult to find. It would be useful to warn in the curve_fit documentation (and other minimisation functions) about using float32 inputs, particularly as the problem only manifests itself with certain data sets.</p>
1
<h3 dir="auto">Describe the bug</h3> <p dir="auto">We had an existing database that worked fine. However, when we copied all the data from this existing database into a new database, we have found that the ORM is trying to insert the primary key ID from one again. This is the model:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from datetime import datetime from typing import Dict, Union from sqlalchemy import Boolean, Column, Date, Integer, String from database import dal class ClassSession(dal.base): &quot;&quot;&quot; This class is responsible for managing a class session between game sessions and a teacher. &quot;&quot;&quot; __tablename__ = &quot;class_sessions&quot; id = Column(Integer, primary_key=True) name = Column(String(120), nullable=False) teacher_id = Column(Integer, nullable=True) auth_code = Column(String(120), nullable=False) date_created = Column(Date(), nullable=False, default=datetime.now()) class_open = Column(Boolean(), nullable=True) institution = Column(String(130), nullable=True) lock = Column(Boolean(), default=False)"><pre class="notranslate"><code class="notranslate">from datetime import datetime from typing import Dict, Union from sqlalchemy import Boolean, Column, Date, Integer, String from database import dal class ClassSession(dal.base): """ This class is responsible for managing a class session between game sessions and a teacher. """ __tablename__ = "class_sessions" id = Column(Integer, primary_key=True) name = Column(String(120), nullable=False) teacher_id = Column(Integer, nullable=True) auth_code = Column(String(120), nullable=False) date_created = Column(Date(), nullable=False, default=datetime.now()) class_open = Column(Boolean(), nullable=True) institution = Column(String(130), nullable=True) lock = Column(Boolean(), default=False) </code></pre></div> <p dir="auto">This has worked fine for over a year. However, with the new database that has entries with IDs up to 235 and in the datagrip viewer the ID column is in the primary key. When we try and make a new insert we get the following error:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="sqlalchemy.exc.IntegrityError: (psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint &quot;class_sessions_pkey&quot; DETAIL: Key (id)=(2) already exists. [SQL: INSERT INTO class_sessions (name, teacher_id, auth_code, date_created, class_open, institution, lock) VALUES (%(name)s, %(teacher_id)s, %(auth_code)s, %(date_created)s, %(class_open)s, %(institution)s, %(lock)s) RETURNING class_sessions.id] [parameters: {'name': 'test', 'teacher_id': 4, 'auth_code': 'UK268', 'date_created': datetime.datetime(2022, 7, 11, 12, 47, 12, 198753), 'class_open': None, 'institution': 'Test', 'lock': False}] (Background on this error at: https://sqlalche.me/e/14/gkpj)"><pre class="notranslate"><code class="notranslate">sqlalchemy.exc.IntegrityError: (psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "class_sessions_pkey" DETAIL: Key (id)=(2) already exists. [SQL: INSERT INTO class_sessions (name, teacher_id, auth_code, date_created, class_open, institution, lock) VALUES (%(name)s, %(teacher_id)s, %(auth_code)s, %(date_created)s, %(class_open)s, %(institution)s, %(lock)s) RETURNING class_sessions.id] [parameters: {'name': 'test', 'teacher_id': 4, 'auth_code': 'UK268', 'date_created': datetime.datetime(2022, 7, 11, 12, 47, 12, 198753), 'class_open': None, 'institution': 'Test', 'lock': False}] (Background on this error at: https://sqlalche.me/e/14/gkpj) </code></pre></div> <p dir="auto">The ID above trying to be inserted is two. This is because it was the second attempt so the ID is 2 so we can see that the primary key is increasing by one.</p> <h3 dir="auto">To Reproduce</h3> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from sqlalchemy import Boolean, Column, Date, Integer, String from database import dal class ClassSession(dal.base): &quot;&quot;&quot; This class is responsible for managing a class session between game sessions and a teacher. &quot;&quot;&quot; __tablename__ = &quot;class_sessions&quot; id = Column(Integer, primary_key=True) name = Column(String(120), nullable=False) teacher_id = Column(Integer, nullable=True) auth_code = Column(String(120), nullable=False) date_created = Column(Date(), nullable=False, default=datetime.now()) class_open = Column(Boolean(), nullable=True) institution = Column(String(130), nullable=True) lock = Column(Boolean(), default=False) # below is the code that makes the insert in another file def create_class(self, name: str, institution: str) -&gt; ClassSession: &quot;&quot;&quot; Creates a class associated with the self._teacher_id. :param name: (str) name of the class being created :param institution: (str) the name of the institution assigned to the class :return: (ClassSession) the class that was created. &quot;&quot;&quot; auth_code: AuthCode = AuthCode() code_verified: bool = False InstitutionModel.check_institution(name=institution) while code_verified is False: code_exists: bool = self._check_code_exists(auth_code=auth_code.value) if code_exists is False: code_verified = True else: auth_code = AuthCode() new_class: ClassSession = ClassSession( name=name, teacher_id=self._teacher_id, auth_code=auth_code.value, institution=institution, date_created=datetime.now(), ) dal.session.add(new_class) dal.session.commit() disease_permissions: DiseaseManager = DiseaseManager(class_id=new_class.id) for disease in self.disease_list: disease_permissions.add_disease_to_class(disease) return new_class"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">sqlalchemy</span> <span class="pl-k">import</span> <span class="pl-v">Boolean</span>, <span class="pl-v">Column</span>, <span class="pl-v">Date</span>, <span class="pl-v">Integer</span>, <span class="pl-v">String</span> <span class="pl-k">from</span> <span class="pl-s1">database</span> <span class="pl-k">import</span> <span class="pl-s1">dal</span> <span class="pl-k">class</span> <span class="pl-v">ClassSession</span>(<span class="pl-s1">dal</span>.<span class="pl-s1">base</span>): <span class="pl-s">"""</span> <span class="pl-s"> This class is responsible for managing a class session between game sessions and a teacher.</span> <span class="pl-s"> """</span> <span class="pl-s1">__tablename__</span> <span class="pl-c1">=</span> <span class="pl-s">"class_sessions"</span> <span class="pl-s1">id</span> <span class="pl-c1">=</span> <span class="pl-v">Column</span>(<span class="pl-v">Integer</span>, <span class="pl-s1">primary_key</span><span class="pl-c1">=</span><span class="pl-c1">True</span>) <span class="pl-s1">name</span> <span class="pl-c1">=</span> <span class="pl-v">Column</span>(<span class="pl-v">String</span>(<span class="pl-c1">120</span>), <span class="pl-s1">nullable</span><span class="pl-c1">=</span><span class="pl-c1">False</span>) <span class="pl-s1">teacher_id</span> <span class="pl-c1">=</span> <span class="pl-v">Column</span>(<span class="pl-v">Integer</span>, <span class="pl-s1">nullable</span><span class="pl-c1">=</span><span class="pl-c1">True</span>) <span class="pl-s1">auth_code</span> <span class="pl-c1">=</span> <span class="pl-v">Column</span>(<span class="pl-v">String</span>(<span class="pl-c1">120</span>), <span class="pl-s1">nullable</span><span class="pl-c1">=</span><span class="pl-c1">False</span>) <span class="pl-s1">date_created</span> <span class="pl-c1">=</span> <span class="pl-v">Column</span>(<span class="pl-v">Date</span>(), <span class="pl-s1">nullable</span><span class="pl-c1">=</span><span class="pl-c1">False</span>, <span class="pl-s1">default</span><span class="pl-c1">=</span><span class="pl-s1">datetime</span>.<span class="pl-en">now</span>()) <span class="pl-s1">class_open</span> <span class="pl-c1">=</span> <span class="pl-v">Column</span>(<span class="pl-v">Boolean</span>(), <span class="pl-s1">nullable</span><span class="pl-c1">=</span><span class="pl-c1">True</span>) <span class="pl-s1">institution</span> <span class="pl-c1">=</span> <span class="pl-v">Column</span>(<span class="pl-v">String</span>(<span class="pl-c1">130</span>), <span class="pl-s1">nullable</span><span class="pl-c1">=</span><span class="pl-c1">True</span>) <span class="pl-s1">lock</span> <span class="pl-c1">=</span> <span class="pl-v">Column</span>(<span class="pl-v">Boolean</span>(), <span class="pl-s1">default</span><span class="pl-c1">=</span><span class="pl-c1">False</span>) <span class="pl-c"># below is the code that makes the insert in another file</span> <span class="pl-k">def</span> <span class="pl-en">create_class</span>(<span class="pl-s1">self</span>, <span class="pl-s1">name</span>: <span class="pl-s1">str</span>, <span class="pl-s1">institution</span>: <span class="pl-s1">str</span>) <span class="pl-c1">-&gt;</span> <span class="pl-v">ClassSession</span>: <span class="pl-s">"""</span> <span class="pl-s"> Creates a class associated with the self._teacher_id.</span> <span class="pl-s"></span> <span class="pl-s"> :param name: (str) name of the class being created</span> <span class="pl-s"> :param institution: (str) the name of the institution assigned to the class</span> <span class="pl-s"> :return: (ClassSession) the class that was created.</span> <span class="pl-s"> """</span> <span class="pl-s1">auth_code</span>: <span class="pl-v">AuthCode</span> <span class="pl-c1">=</span> <span class="pl-v">AuthCode</span>() <span class="pl-s1">code_verified</span>: <span class="pl-s1">bool</span> <span class="pl-c1">=</span> <span class="pl-c1">False</span> <span class="pl-v">InstitutionModel</span>.<span class="pl-en">check_institution</span>(<span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s1">institution</span>) <span class="pl-k">while</span> <span class="pl-s1">code_verified</span> <span class="pl-c1">is</span> <span class="pl-c1">False</span>: <span class="pl-s1">code_exists</span>: <span class="pl-s1">bool</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-en">_check_code_exists</span>(<span class="pl-s1">auth_code</span><span class="pl-c1">=</span><span class="pl-s1">auth_code</span>.<span class="pl-s1">value</span>) <span class="pl-k">if</span> <span class="pl-s1">code_exists</span> <span class="pl-c1">is</span> <span class="pl-c1">False</span>: <span class="pl-s1">code_verified</span> <span class="pl-c1">=</span> <span class="pl-c1">True</span> <span class="pl-k">else</span>: <span class="pl-s1">auth_code</span> <span class="pl-c1">=</span> <span class="pl-v">AuthCode</span>() <span class="pl-s1">new_class</span>: <span class="pl-v">ClassSession</span> <span class="pl-c1">=</span> <span class="pl-v">ClassSession</span>( <span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s1">name</span>, <span class="pl-s1">teacher_id</span><span class="pl-c1">=</span><span class="pl-s1">self</span>.<span class="pl-s1">_teacher_id</span>, <span class="pl-s1">auth_code</span><span class="pl-c1">=</span><span class="pl-s1">auth_code</span>.<span class="pl-s1">value</span>, <span class="pl-s1">institution</span><span class="pl-c1">=</span><span class="pl-s1">institution</span>, <span class="pl-s1">date_created</span><span class="pl-c1">=</span><span class="pl-s1">datetime</span>.<span class="pl-en">now</span>(), ) <span class="pl-s1">dal</span>.<span class="pl-s1">session</span>.<span class="pl-en">add</span>(<span class="pl-s1">new_class</span>) <span class="pl-s1">dal</span>.<span class="pl-s1">session</span>.<span class="pl-en">commit</span>() <span class="pl-s1">disease_permissions</span>: <span class="pl-v">DiseaseManager</span> <span class="pl-c1">=</span> <span class="pl-v">DiseaseManager</span>(<span class="pl-s1">class_id</span><span class="pl-c1">=</span><span class="pl-s1">new_class</span>.<span class="pl-s1">id</span>) <span class="pl-k">for</span> <span class="pl-s1">disease</span> <span class="pl-c1">in</span> <span class="pl-s1">self</span>.<span class="pl-s1">disease_list</span>: <span class="pl-s1">disease_permissions</span>.<span class="pl-en">add_disease_to_class</span>(<span class="pl-s1">disease</span>) <span class="pl-k">return</span> <span class="pl-s1">new_class</span></pre></div> <h3 dir="auto">Error</h3> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="sqlalchemy.exc.IntegrityError: (psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint &quot;class_sessions_pkey&quot; DETAIL: Key (id)=(2) already exists. [SQL: INSERT INTO class_sessions (name, teacher_id, auth_code, date_created, class_open, institution, lock) VALUES (%(name)s, %(teacher_id)s, %(auth_code)s, %(date_created)s, %(class_open)s, %(institution)s, %(lock)s) RETURNING class_sessions.id] [parameters: {'name': 'test', 'teacher_id': 4, 'auth_code': 'UK268', 'date_created': datetime.datetime(2022, 7, 11, 12, 47, 12, 198753), 'class_open': None, 'institution': 'Test', 'lock': False}] (Background on this error at: https://sqlalche.me/e/14/gkpj)"><pre class="notranslate"><code class="notranslate">sqlalchemy.exc.IntegrityError: (psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "class_sessions_pkey" DETAIL: Key (id)=(2) already exists. [SQL: INSERT INTO class_sessions (name, teacher_id, auth_code, date_created, class_open, institution, lock) VALUES (%(name)s, %(teacher_id)s, %(auth_code)s, %(date_created)s, %(class_open)s, %(institution)s, %(lock)s) RETURNING class_sessions.id] [parameters: {'name': 'test', 'teacher_id': 4, 'auth_code': 'UK268', 'date_created': datetime.datetime(2022, 7, 11, 12, 47, 12, 198753), 'class_open': None, 'institution': 'Test', 'lock': False}] (Background on this error at: https://sqlalche.me/e/14/gkpj) </code></pre></div> <h3 dir="auto">Versions</h3> <ul dir="auto"> <li>OS:</li> <li>Python:</li> <li>SQLAlchemy:</li> <li>Database:</li> <li>DBAPI (eg: psycopg, cx_oracle, mysqlclient):</li> </ul> <h3 dir="auto">Additional context</h3> <p dir="auto"><em>No response</em></p>
<p dir="auto"><strong>Question</strong><br> Given a composite type that is defined by a user following these instructions:<br> <a href="https://docs.sqlalchemy.org/en/13/orm/composites.html" rel="nofollow">https://docs.sqlalchemy.org/en/13/orm/composites.html</a></p> <p dir="auto">Is there a way to register that type with <code class="notranslate">PGInspector</code> or the dialect so that it is available/used during table reflection?</p> <p dir="auto"><strong>Additional Context</strong><br> The closest thing to a solution I've found is the DDL for column reflection:<br> <a href="https://docs.sqlalchemy.org/en/13/core/events.html#sqlalchemy.events.DDLEvents.column_reflect" rel="nofollow">https://docs.sqlalchemy.org/en/13/core/events.html#sqlalchemy.events.DDLEvents.column_reflect</a></p> <p dir="auto">But since unknown column types get reflected as <code class="notranslate">NullType</code> and there might be more than one composite type, it isn't quite enough.</p> <p dir="auto">I could:</p> <ul dir="auto"> <li>Intercept <code class="notranslate">NullType</code> on <code class="notranslate">column_reflect</code></li> <li>Use the column info to query postgres for the correct composite type name</li> <li>Lookup that composite type from a registry of locally defined composites</li> <li>Replace <code class="notranslate">NullType</code> with the correct composite type</li> </ul> <p dir="auto">But I don't see a way to access the connection in an "official feeling way" inside that DDL event. is there one?</p> <p dir="auto">Worst case scenario I'll stash the connection somewhere and retrieve it inside the event, but that's pretty gross so I'd like to avoid it if possible!</p> <p dir="auto"><strong>Related Issues</strong><br> This question is related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="384625505" data-permission-text="Title is private" data-url="https://github.com/sqlalchemy/sqlalchemy/issues/2450" data-hovercard-type="issue" data-hovercard-url="/sqlalchemy/sqlalchemy/issues/2450/hovercard" href="https://github.com/sqlalchemy/sqlalchemy/issues/2450">#2450</a> but doesn't require that the composite type definition is also reflected</p> <p dir="auto">Thanks!</p>
0
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="error: Uncaught ReferenceError: AudioContext is not defined const audioContext = new AudioContext() ^"><pre class="notranslate">error: Uncaught ReferenceError: AudioContext is not defined const audioContext = new <span class="pl-en">AudioContext</span>() ^</pre></div>
<p dir="auto"><code class="notranslate">deno info</code> command can be used to print all dependencies of a module to terminal, but I want to use it in JavaScript/TypeScript code. It would be nice to have a function (let's say <code class="notranslate">Deno.info()</code>) that returns an object with these information.</p>
0
<p dir="auto">When I opened my solution, always got this error message.I am from China.<br> My dev-environment:</p> <blockquote> <p dir="auto">OS: Microsoft Windows 10<br> IDE: Visual Studio Code 0.10.5<br> DNX: 1.0.0-rc1-update1</p> </blockquote> <p dir="auto"><strong>The solution created by visual studio 2013.</strong></p> <hr> <p dir="auto">*.csproj<br> �� Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args)<br> �� Microsoft.Build.Evaluation.Project.Data.InitializeForEvaluation(IToolsetProvider toolsetProvider)<br> �� Microsoft.Build.Evaluation.Evaluator<code class="notranslate">4..ctor(IEvaluatorData</code>4 data, ProjectRootElement projectRootElement, ProjectLoadSettings loadSettings, Int32 maxNodeCount, PropertyDictionary<code class="notranslate">1 environmentProperties, ILoggingService loggingService, IItemFactory</code>2 itemFactory, IToolsetProvider toolsetProvider, ProjectRootElementCache projectRootElementCache, BuildEventContext buildEventContext, ProjectInstance projectInstanceIfAnyForDebuggerOnly)<br> �� Microsoft.Build.Evaluation.Evaluator<code class="notranslate">4.Evaluate(IEvaluatorData</code>4 data, ProjectRootElement root, ProjectLoadSettings loadSettings, Int32 maxNodeCount, PropertyDictionary<code class="notranslate">1 environmentProperties, ILoggingService loggingService, IItemFactory</code>2 itemFactory, IToolsetProvider toolsetProvider, ProjectRootElementCache projectRootElementCache, BuildEventContext buildEventContext, ProjectInstance projectInstanceIfAnyForDebuggerOnly)<br> �� Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation)<br> �� Microsoft.Build.Evaluation.Project.Initialize(IDictionary<code class="notranslate">2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings) �� Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary</code>2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings)<br> �� Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary<code class="notranslate">2 globalProperties, String toolsVersion) �� OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Create(MSBuildOptions options, ILogger logger, String solutionDirectory, String projectFilePath, ICollection</code>1 diagnostics)<br> �� OmniSharp.MSBuild.MSBuildProjectSystem.CreateProject(String projectFilePath)</p>
<p dir="auto"><em>From <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/sporens/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/sporens">@sporens</a> on January 17, 2016 20:57</em></p> <p dir="auto">Hi,</p> <p dir="auto">The command executed by VS Code to install and resolve missing dependancies for an ASP.NET application fails with "Can't find path" when the path to the users' home folder includes a space. For example:<br> c:\users\joeblogs\ &lt;- works<br> c:\users\joe blogs\ &lt;- fails</p> <p dir="auto">Running procmon I see it's attempting to execute:<br> cmd.exe /c start /wait cmd.exe /c "C:\Users\joe blogs.dnx\runtimes\dnx-clr-win-x86.1.0.0-rc1-update1\bin\dnu.cmd restore &amp; pause"</p> <p dir="auto">Which fails.</p> <p dir="auto">Thanks</p> <p dir="auto"><em>Copied from original issue: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="127123285" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/2072" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/2072/hovercard" href="https://github.com/microsoft/vscode/issues/2072">microsoft/vscode#2072</a></em></p>
1
<h3 dir="auto">Bug summary</h3> <p dir="auto">backend bug in matplotlib==3.6.1 with python3.11</p> <p dir="auto">same issue happend when embeding in Qt with PySide6==6.4.0.1</p> <p dir="auto">error report<br> int() argument must be a string, a bytes-like object or a real number, not 'KeyboardModifier'</p> <p dir="auto">This is caused by the "The new Enum system" within the release of PySide6, Qt for Python 6.4</p> <p dir="auto">See<br> <a href="https://www.qt.io/blog/qt-for-python-release-6.4-is-finally-here" rel="nofollow">Qt for python release 6.4 </a></p> <p dir="auto">PySide is in the interesting position of being both Qt (with its C++ roots and all that entails) but also distinctly Python. Where possible, we strive to align PySide further with Python conventions and use as many Python features as we can, if they make sense.</p> <p dir="auto">Quote below:</p> <p dir="auto">The new Enum system</p> <p dir="auto">One such area that we tackled now affects enums, which was implemented as bound C++ classes, but now it is updated to leverage <a href="https://docs.python.org/3/library/enum.html" rel="nofollow">Python's own enum mechanism</a>.</p> <p dir="auto">Although the new Python enums and the old Shiboken-based ones are compatible with each other, but there are a few differences or restrictions:</p> <p dir="auto">Python enums cannot be inherited from each other, whereas Shiboken enums can<br> Python enums do not allow undefined values, Shiboken enums do<br> Python enums always need exactly one argument, Shiboken enums have a default zero value<br> Python enums rarely inherit from int, Shiboken enums always do<br> You can see that some of these differences are between flags. For example, until now, you could either write</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="flags = Qt.Alignment() enum = Qt.AlignmentFlag "><pre class="notranslate"><code class="notranslate">flags = Qt.Alignment() enum = Qt.AlignmentFlag </code></pre></div> <p dir="auto">or use the enum shortcuts like these:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Qt.AlignLeft = Qt.AlignmentFlag.AlignLeft Qt.AlignTop = Qt.AlignmentFlag.AlignTop"><pre class="notranslate"><code class="notranslate">Qt.AlignLeft = Qt.AlignmentFlag.AlignLeft Qt.AlignTop = Qt.AlignmentFlag.AlignTop </code></pre></div> <p dir="auto">These shortcuts, and flags no longer exist (officially) from 6.4.0 onwards. Instead, Python has an <a href="https://docs.python.org/3/library/enum.html#enum.Flag" rel="nofollow">enum.Flags</a> class, which is a subclass of the <a href="https://docs.python.org/3/library/enum.html#enum.Enum" rel="nofollow">enum.Enum</a> class.</p> <p dir="auto">If the thought of updating all your code left and right makes you sweat more than an overheated pumpkin spice latte, do not fret, for salvation has a name, and it’s “forgiveness mode”. This transitory mode allows you to continue using the old constructs but translates them internally into the new ones. For example, if you write</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="flags = Qt.Alignment() enum = Qt.AlignLeft item.setForeground(QColor(Qt.green)) flags_type = QPainter.RenderHints flags = QPainter.RenderHints() chart_view.setRenderHint(QPainter.Antialiasing) "><pre class="notranslate"><code class="notranslate">flags = Qt.Alignment() enum = Qt.AlignLeft item.setForeground(QColor(Qt.green)) flags_type = QPainter.RenderHints flags = QPainter.RenderHints() chart_view.setRenderHint(QPainter.Antialiasing) </code></pre></div> <p dir="auto">you get a construct that mimics the following code, which is the recommended way of using flags and enums:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="flags = Qt.AlignmentFlag(0) enum = Qt.AlignmentFlag.AlignLeft item.setForeground(QColor(Qt.GlobalColor.green)) flags_type = QPainter.RenderHint flags = QPainter.RenderHint(0) chart_view.setRenderHint(QPainter.RenderHint.Antialiasing) "><pre class="notranslate"><code class="notranslate">flags = Qt.AlignmentFlag(0) enum = Qt.AlignmentFlag.AlignLeft item.setForeground(QColor(Qt.GlobalColor.green)) flags_type = QPainter.RenderHint flags = QPainter.RenderHint(0) chart_view.setRenderHint(QPainter.RenderHint.Antialiasing) </code></pre></div> <p dir="auto">With this you can at least initially ignore the difference between old and new enums, as long as the new enums are properties of classes.</p> <h3 dir="auto">Code for reproduction</h3> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import matplotlib print(matplotlib.get_backend()) or from matplotlib.backends.qt_compat import QtWidgets from matplotlib.backends.backend_qtagg import ( FigureCanvas, NavigationToolbar2QT as NavigationToolbar) from matplotlib.figure import Figure"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">matplotlib</span> <span class="pl-en">print</span>(<span class="pl-s1">matplotlib</span>.<span class="pl-en">get_backend</span>()) <span class="pl-s1">or</span> <span class="pl-k">from</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">backends</span>.<span class="pl-s1">qt_compat</span> <span class="pl-k">import</span> <span class="pl-v">QtWidgets</span> <span class="pl-k">from</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">backends</span>.<span class="pl-s1">backend_qtagg</span> <span class="pl-k">import</span> ( <span class="pl-v">FigureCanvas</span>, <span class="pl-v">NavigationToolbar2QT</span> <span class="pl-k">as</span> <span class="pl-v">NavigationToolbar</span>) <span class="pl-k">from</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">figure</span> <span class="pl-k">import</span> <span class="pl-v">Figure</span></pre></div> <h3 dir="auto">Actual outcome</h3> <p dir="auto">Traceback (most recent call last):<br> File "", line 1, in <br> File "C:\Python311\Lib\site-packages\matplotlib_<em>init</em>_.py", line 1182, in get_backend<br> return rcParams['backend']<br> ~~~~~~~~^^^^^^^^^^^<br> File "C:\Python311\Lib\site-packages\matplotlib_<em>init</em>_.py", line 677, in <strong>getitem</strong><br> plt.switch_backend(rcsetup.<em>auto_backend_sentinel)<br> File "C:\Python311\Lib\site-packages\matplotlib\pyplot.py", line 252, in switch_backend<br> switch_backend(candidate)<br> File "C:\Python311\Lib\site-packages\matplotlib\pyplot.py", line 265, in switch_backend<br> backend_mod = importlib.import_module(<br> ^^^^^^^^^^^^^^^^^^^^^^^^<br> File "C:\Python311\Lib\importlib_<em>init</em></em>.py", line 126, in import_module<br> return _bootstrap._gcd_import(name[level:], package, level)<br> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br> File "", line 1206, in _gcd_import<br> File "", line 1178, in _find_and_load<br> File "", line 1149, in _find_and_load_unlocked<br> File "", line 690, in _load_unlocked<br> File "", line 940, in exec_module<br> File "", line 241, in _call_with_frames_removed<br> File "C:\Python311\Lib\site-packages\matplotlib\backends\backend_qtagg.py", line 12, in <br> from .backend_qt import QtCore, QtGui, _BackendQT, FigureCanvasQT<br> File "C:\Python311\Lib\site-packages\matplotlib\backends\backend_qt.py", line 72, in <br> _MODIFIER_KEYS = [<br> ^<br> File "C:\Python311\Lib\site-packages\matplotlib\backends\backend_qt.py", line 73, in <br> (_to_int(getattr(_enum("QtCore.Qt.KeyboardModifier"), mod)),<br> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br> TypeError: int() argument must be a string, a bytes-like object or a real number, not 'KeyboardModifier'</p> <h3 dir="auto">Expected outcome</h3> <p dir="auto">QtAgg</p> <h3 dir="auto">Additional information</h3> <p dir="auto"><em>No response</em></p> <h3 dir="auto">Operating system</h3> <p dir="auto">Windows</p> <h3 dir="auto">Matplotlib Version</h3> <p dir="auto">3.6.1</p> <h3 dir="auto">Matplotlib Backend</h3> <p dir="auto">error as reported</p> <h3 dir="auto">Python version</h3> <p dir="auto">3.11</p> <h3 dir="auto">Jupyter version</h3> <p dir="auto"><em>No response</em></p> <h3 dir="auto">Installation</h3> <p dir="auto">pip</p>
<h3 dir="auto">Bug summary</h3> <p dir="auto">Error while importing matplotlib qt backend.</p> <p dir="auto">The version details are as below<br> matplotlib: 3.6.1<br> pyside: 6.4.0<br> python: 3.9.9</p> <p dir="auto">on a macOS-M1 machine.</p> <h3 dir="auto">Code for reproduction</h3> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from matplotlib.backends.backend_qtagg import NavigationToolbar2QT as NavigationToolbar"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">backends</span>.<span class="pl-s1">backend_qtagg</span> <span class="pl-k">import</span> <span class="pl-v">NavigationToolbar2QT</span> <span class="pl-k">as</span> <span class="pl-v">NavigationToolbar</span></pre></div> <h3 dir="auto">Actual outcome</h3> <p dir="auto">Traceback (most recent call last):<br> File "", line 1, in <br> File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/matplotlib/backends/backend_qtagg.py", line 12, in <br> from .backend_qt import QtCore, QtGui, _BackendQT, FigureCanvasQT<br> File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/matplotlib/backends/backend_qt.py", line 72, in <br> _MODIFIER_KEYS = [<br> File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/matplotlib/backends/backend_qt.py", line 73, in <br> (_to_int(getattr(_enum("QtCore.Qt.KeyboardModifier"), mod)),<br> TypeError: int() argument must be a string, a bytes-like object or a number, not 'KeyboardModifier'</p> <h3 dir="auto">Expected outcome</h3> <p dir="auto">No error!</p> <h3 dir="auto">Additional information</h3> <p dir="auto"><em>No response</em></p> <h3 dir="auto">Operating system</h3> <p dir="auto">OS/X</p> <h3 dir="auto">Matplotlib Version</h3> <p dir="auto">3.6.1</p> <h3 dir="auto">Matplotlib Backend</h3> <p dir="auto">MacOSX</p> <h3 dir="auto">Python version</h3> <p dir="auto">3.9.9</p> <h3 dir="auto">Jupyter version</h3> <p dir="auto"><em>No response</em></p> <h3 dir="auto">Installation</h3> <p dir="auto">pip</p>
1
<p dir="auto">It's currently difficult (impossible?) to create plugins for React that use any of the stuff in <code class="notranslate">lib</code> without using <a href="https://github.com/andreypopp/react-router-component-bower/blob/master/package.json">crazy hacks</a>.</p> <p dir="auto">What's the best way to do this? Separate modules?</p>
<p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong></p> <p dir="auto">Feature</p> <hr> <p dir="auto">There's a common case of having a list of items, keyed by some id, and items can be added/removed over time. For example, say we have a list of users and a button to refresh the list with new data from the server. Here, <code class="notranslate">User</code> is a simple function component.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="users.map((user) =&gt; ( &lt;User key={user.id} data={user} /&gt; )"><pre class="notranslate"><span class="pl-s1">users</span><span class="pl-kos">.</span><span class="pl-c1">map</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">user</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">(</span> <span class="pl-c1">&lt;</span><span class="pl-ent">User</span> <span class="pl-c1">key</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-s1">user</span><span class="pl-kos">.</span><span class="pl-c1">id</span><span class="pl-kos">}</span> <span class="pl-c1">data</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-s1">user</span><span class="pl-kos">}</span> <span class="pl-c1">/</span><span class="pl-c1">&gt;</span> <span class="pl-kos">)</span></pre></div> <p dir="auto">Say this produces the following User elements:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="key: 1000, data: { name: 'foo' } key: 1001, data: { name: 'bar' } key: 1002, data: { name: 'baz' }"><pre class="notranslate"><code class="notranslate">key: 1000, data: { name: 'foo' } key: 1001, data: { name: 'bar' } key: 1002, data: { name: 'baz' } </code></pre></div> <p dir="auto">Later we get the new user list, and these are the resulting elements:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="key: 1003, data: { name: 'quux' } key: 1002, data: { name: 'baz' } key: 1001, data: { name: 'bar' }"><pre class="notranslate"><code class="notranslate">key: 1003, data: { name: 'quux' } key: 1002, data: { name: 'baz' } key: 1001, data: { name: 'bar' } </code></pre></div> <p dir="auto">The operations are:</p> <ul dir="auto"> <li>remove 1000, destroy instance and dom nodes</li> <li>move 1002, update</li> <li>create 1003, with instance and dom nodes</li> </ul> <p dir="auto">Would an option to tell React that it can reuse the instances and dom nodes make sense?</p> <p dir="auto">From the list diff, React has this information (as I understand it):</p> <ul dir="auto"> <li>remove at key: 1000, type: User, index: 0</li> <li>create at key: 1003, type: User. index: 0</li> </ul> <p dir="auto">If we signaled to React that it can reuse elements, and since the 'type' is the same, it could reduce these operations to updating the identity of the underlying instance (key: 1000 -&gt; key: 1003) and then update the instance normally. It could also require a move, but it doesn't here.</p> <p dir="auto">When used, it reduces the combined create/destroy operations of instances and dom nodes from <code class="notranslate">create + destroy</code> to <code class="notranslate">Math.abs(create - destroy)</code>.</p> <p dir="auto">Of course, this has to be opt-in behavior because some components won't clear their internal state, and some DOM nodes can hold uncontrolled state. Also in some cases this could be slower (but I'd wager this is rare).</p> <p dir="auto">The syntax is secondary; I mostly want to hear what's thought about the idea of explicitly permitting React to reuse instances, but this is the simplest idea I have.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;React.Reusable&gt; {users.map(...)} &lt;/React.Reusable&gt;"><pre class="notranslate"><span class="pl-c1">&lt;</span><span class="pl-v">React</span><span class="pl-kos">.</span><span class="pl-v">Reusable</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span><span class="pl-s1">users</span><span class="pl-kos">.</span><span class="pl-en">map</span><span class="pl-kos">(</span>...<span class="pl-kos">)</span><span class="pl-kos">}</span> <span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-v">React</span><span class="pl-kos">.</span><span class="pl-v">Reusable</span><span class="pl-c1">&gt;</span></pre></div> <hr> <p dir="auto"><strong>Why do this in core?</strong></p> <p dir="auto">I can't think of a reasonable way to do this in user space, and the less reasonable ways require duplicating the effort of diffing the list.</p> <p dir="auto">It's just allowing React to simplify the operations it intends to perform.</p> <p dir="auto"><strong>Why do this at all?</strong></p> <p dir="auto">It provides another performance hook for React code, which people can attempt to apply while optimizing their react and react-native apps, if it makes sense in their situation.</p>
0
<h2 dir="auto">📝 Provide a description of the new feature</h2> <h2 dir="auto"><em>What is the expected behavior of the proposed feature? What is the scenario this would be used?</em><br> INCLUDE SYNCTOY INTO POWERTOYS</h2> <p dir="auto">If you'd like to see this feature implemented, add a <g-emoji class="g-emoji" alias="+1" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f44d.png">👍</g-emoji> reaction to this post.</p>
<p dir="auto">When searching for local files it could be convenient to add an option to restrict results to folders.</p> <p dir="auto">In part because it would make results faster, and in part because personally I've found that 90% of the times I just want to open a folder and not a file.</p> <p dir="auto">This could be as simple as adding a <code class="notranslate">f</code> shortcut. Eg: typing <code class="notranslate">f photos</code> in the query.</p>
0
<p dir="auto">Hello,</p> <p dir="auto">I run scrapy v1.1.0</p> <p dir="auto">I need some parts of the url to create some ids. Lately I have been noticing that response.request.url is returning a different url that the one that is used to scrape.</p> <p dir="auto">In my code I use the item['LINK'] = response.request.url but that is putting in the wrong link on some scrapers like 2/10 approximately.</p> <p dir="auto">Is there a better way to fetch the url? The one that is displayed in the debug scrapy output is correct.</p> <p dir="auto">Thank you.</p> <p dir="auto">This one outputted in the debug window is correct:<br> 2016-07-12 13:25:34 [scrapy] DEBUG: Scraped from &lt;200 XXX &gt;</p> <p dir="auto">The one I fetch with response.request.url is different and wrong.</p>
<h3 dir="auto">Description</h3> <p dir="auto">After running the scrapy shell with the defined url, I am getting the attribute error showing the following error: AttributeError: module 'OpenSSL.SSL' has no attribute 'SSLv3_METHOD'</p> <p dir="auto">scrapy shell "<a href="https://quotes.toscrape.com/tag/humor/" rel="nofollow">https://quotes.toscrape.com/tag/humor/</a>"</p> <h3 dir="auto">Steps to Reproduce</h3> <ol dir="auto"> <li>[First Step]</li> <li>[Second Step]</li> <li>[and so on...]</li> </ol> <p dir="auto"><strong>Expected behavior:</strong> [What you expect to happen]</p> <p dir="auto"><strong>Actual behavior:</strong><br> [2022-09-27 01:38:38 [scrapy.utils.log] INFO: Versions: lxml 4.9.1.0, libxml2 2.9.12, cssselect 1.1.0, parsel 1.6.0, w3lib 2.0.1, Twisted 22.8.0, Python 3.9.2 (tags/v3.9.2:1a79785, Feb 19 2021, 13:44:55) [MSC v.1928 64 bit (AMD64)], pyOpenSSL 22.1.0 (OpenSSL 3.0.5 5 Jul 2022), cryptography 38.0.1, Platform Windows-10-10.0.19041-SP0<br> 2022-09-27 01:38:38 [scrapy.crawler] INFO: Overridden settings:<br> {'DUPEFILTER_CLASS': 'scrapy.dupefilters.BaseDupeFilter',<br> 'LOGSTATS_INTERVAL': 0}<br> 2022-09-27 01:38:38 [scrapy.utils.log] DEBUG: Using reactor: twisted.internet.selectreactor.SelectReactor<br> 2022-09-27 01:38:38 [scrapy.extensions.telnet] INFO: Telnet Password: d760ab2d8573ec57<br> 2022-09-27 01:38:38 [scrapy.middleware] INFO: Enabled extensions:<br> ['scrapy.extensions.corestats.CoreStats',<br> 'scrapy.extensions.telnet.TelnetConsole']<br> 2022-09-27 01:38:39 [scrapy.core.downloader.handlers] ERROR: Loading "scrapy.core.downloader.handlers.http.HTTPDownloadHandler" for scheme "http"<br> Traceback (most recent call last):<br> File "d:\python\scraping-project\scrapy\venv\lib\site-packages\scrapy\core\downloader\handlers_<em>init</em>_.py", line 49, in <em>load_handler<br> dhcls = load_object(path)<br> File "d:\python\scraping-project\scrapy\venv\lib\site-packages\scrapy\utils\misc.py", line 61, in load_object<br> mod = import_module(module)<br> File "C:\Users\DELL\AppData\Local\Programs\Python\Python39\lib\importlib_<em>init</em></em>.py", line 127, in import_module<br> return _bootstrap._gcd_import(name[level:], package, level)<br> File "", line 1030, in _gcd_import<br> File "", line 1007, in _find_and_load<br> File "", line 986, in _find_and_load_unlocked<br> File "", line 680, in _load_unlocked<br> File "", line 790, in exec_module<br> File "", line 228, in _call_with_frames_removed<br> File "d:\python\scraping-project\scrapy\venv\lib\site-packages\scrapy\core\downloader\handlers\http.py", line 2, in <br> from scrapy.core.downloader.handlers.http11 import (<br> File "d:\python\scraping-project\scrapy\venv\lib\site-packages\scrapy\core\downloader\handlers\http11.py", line 23, in <br> from scrapy.core.downloader.contextfactory import load_context_factory_from_settings<br> File "d:\python\scraping-project\scrapy\venv\lib\site-packages\scrapy\core\downloader\contextfactory.py", line 11, in <br> from scrapy.core.downloader.tls import DEFAULT_CIPHERS, openssl_methods, ScrapyClientTLSOptions<br> File "d:\python\scraping-project\scrapy\venv\lib\site-packages\scrapy\core\downloader\tls.py", line 23, in <br> METHOD_SSLv3: SSL.SSLv3_METHOD, # SSL 3 (NOT recommended)<br> AttributeError: module 'OpenSSL.SSL' has no attribute 'SSLv3_METHOD']</p> <p dir="auto"><strong>Reproduces how often:</strong> [100%]</p> <h3 dir="auto">Versions</h3> <p dir="auto">Scrapy : 2.6.2<br> lxml : 4.9.1.0<br> libxml2 : 2.9.12<br> cssselect : 1.1.0<br> parsel : 1.6.0<br> w3lib : 2.0.1<br> Twisted : 22.8.0<br> Python : 3.9.2 (tags/v3.9.2:1a79785, Feb 19 2021, 13:44:55) [MSC v.1928 64 bit (AMD64)]<br> pyOpenSSL : 22.1.0 (OpenSSL 3.0.5 5 Jul 2022)<br> cryptography : 37.0.4<br> Platform : Windows-10-10.0.19041-SP0</p> <h3 dir="auto">Additional context</h3> <p dir="auto">Any additional information, configuration, data or output from commands that might be necessary to reproduce or understand the issue. Please try not to include screenshots of code or the command line, paste the contents as text instead. You can use <a href="https://help.github.com/en/articles/creating-and-highlighting-code-blocks">GitHub Flavored Markdown</a> to make the text look better.</p>
0
<h1 dir="auto">Checklist</h1> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have verified that the issue exists against the <code class="notranslate">main</code> branch of Celery.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> This has already been asked to the <a href="https://github.com/celery/celery/discussions">discussions forum</a> first.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the relevant section in the<br> <a href="https://docs.celeryq.dev/en/main/contributing.html#other-bugs" rel="nofollow">contribution guide</a><br> on reporting bugs.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/issues?q=is%3Aissue+label%3A%22Issue+Type%3A+Bug+Report%22+-label%3A%22Category%3A+Documentation%22">issues list</a><br> for similar or identical bug reports.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/pulls?q=is%3Apr+label%3A%22PR+Type%3A+Bugfix%22+-label%3A%22Category%3A+Documentation%22">pull requests list</a><br> for existing proposed fixes.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/commits/main">commit log</a><br> to find out if the bug was already fixed in the main branch.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all related issues and possible duplicate issues<br> in this issue (If there are none, check this box anyway).</li> </ul> <h2 dir="auto">Mandatory Debugging Information</h2> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included the output of <code class="notranslate">celery -A proj report</code> in the issue.<br> (if you are not able to do this, then at least specify the Celery<br> version affected).</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have verified that the issue exists against the <code class="notranslate">main</code> branch of Celery.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included the contents of <code class="notranslate">pip freeze</code> in the issue.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all the versions of all the external dependencies required<br> to reproduce this bug.</li> </ul> <h2 dir="auto">Optional Debugging Information</h2> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue on more than one Python version<br> and/or implementation.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one message broker and/or<br> result backend.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one version of the message<br> broker and/or result backend.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue on more than one operating system.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one workers pool.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue with autoscaling, retries,<br> ETA/Countdown &amp; rate limits disabled.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue after downgrading<br> and/or upgrading Celery and its dependencies.</li> </ul> <h2 dir="auto">Related Issues and Possible Duplicates</h2> <h4 dir="auto">Related Issues</h4> <ul dir="auto"> <li>None</li> </ul> <h4 dir="auto">Possible Duplicates</h4> <ul dir="auto"> <li>None</li> </ul> <h2 dir="auto">Environment &amp; Settings</h2> <p dir="auto"><strong>Celery version</strong>: 5.2.7</p> <details> <summary><b><code class="notranslate">celery report</code> Output:</b></summary> <p dir="auto"> </p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate"></code></pre></div> <p dir="auto"></p> </details> <h1 dir="auto">Steps to Reproduce</h1> <h2 dir="auto">Required Dependencies</h2> <ul dir="auto"> <li><strong>Minimal Python Version</strong>: 3.7.16</li> <li><strong>Minimal Celery Version</strong>: 5.2.7</li> <li><strong>Minimal Kombu Version</strong>: 5.2.4</li> <li><strong>Minimal Broker Version</strong>: N/A or Unknown</li> <li><strong>Minimal Result Backend Version</strong>: N/A or Unknown</li> <li><strong>Minimal OS and/or Kernel Version</strong>: N/A or Unknown</li> <li><strong>Minimal Broker Client Version</strong>: N/A or Unknown</li> <li><strong>Minimal Result Backend Client Version</strong>: N/A or Unknown</li> </ul> <h3 dir="auto">Python Packages</h3> <details> <summary><b><code class="notranslate">pip freeze</code> Output:</b></summary> <p dir="auto"> </p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Django==2.2.28 celery==5.2.7 billiard==3.6.4 pytz==2022.7.1"><pre class="notranslate"><code class="notranslate">Django==2.2.28 celery==5.2.7 billiard==3.6.4 pytz==2022.7.1 </code></pre></div> <p dir="auto"></p> </details> <h3 dir="auto">Other Dependencies</h3> <details> <p dir="auto"> N/A </p> </details> <h2 dir="auto">Minimally Reproducible Test Case</h2> <details> <p dir="auto"> </p><div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# dajngo-test-case def simple_test_test(self): mocked_smth = self.patch( 'path.to.tasks.patched_counter', side_effect=[Exception, True] ) with self.assertRaises(Retry): patching_method() self.assertEqual(mocked_smth.call_count, 2) # tasks.py @shared_task(bind=True) def patching_method(self): try: patched_counter() except Exception as e: raise self.retry(exc=e) # Retry raises, but do not retries task as well def patched_counter(): pass"><pre class="notranslate"><span class="pl-c"># dajngo-test-case</span> <span class="pl-k">def</span> <span class="pl-en">simple_test_test</span>(<span class="pl-s1">self</span>): <span class="pl-s1">mocked_smth</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-en">patch</span>( <span class="pl-s">'path.to.tasks.patched_counter'</span>, <span class="pl-s1">side_effect</span><span class="pl-c1">=</span>[<span class="pl-v">Exception</span>, <span class="pl-c1">True</span>] ) <span class="pl-k">with</span> <span class="pl-s1">self</span>.<span class="pl-en">assertRaises</span>(<span class="pl-v">Retry</span>): <span class="pl-en">patching_method</span>() <span class="pl-s1">self</span>.<span class="pl-en">assertEqual</span>(<span class="pl-s1">mocked_smth</span>.<span class="pl-s1">call_count</span>, <span class="pl-c1">2</span>) <span class="pl-c"># tasks.py</span> <span class="pl-en">@<span class="pl-en">shared_task</span>(<span class="pl-s1">bind</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)</span> <span class="pl-k">def</span> <span class="pl-en">patching_method</span>(<span class="pl-s1">self</span>): <span class="pl-k">try</span>: <span class="pl-en">patched_counter</span>() <span class="pl-k">except</span> <span class="pl-v">Exception</span> <span class="pl-k">as</span> <span class="pl-s1">e</span>: <span class="pl-k">raise</span> <span class="pl-s1">self</span>.<span class="pl-en">retry</span>(<span class="pl-s1">exc</span><span class="pl-c1">=</span><span class="pl-s1">e</span>) <span class="pl-c"># Retry raises, but do not retries task as well</span> <span class="pl-k">def</span> <span class="pl-en">patched_counter</span>(): <span class="pl-k">pass</span></pre></div> <p dir="auto"></p> </details> <h1 dir="auto">Expected Behavior</h1> <p dir="auto">I'm expecting, that after raising Retry inside Django tests it will retry task and set patched_counter to 2</p> <h1 dir="auto">Actual Behavior</h1> <p dir="auto">So it is just running trough first side_effect, raises Retry, so assertRaises works, and going through test function without retry task.<br> My suggest is this is in case of:<br> a) Retry just cannot be faster, then test case (it is not blocking, so it is async maybe?)<br> b) Retry just do not running (I'm not sure why?)</p> <p dir="auto">It worked before update to 5.2.7 from 4.3.1, also updated billiard and pytz to required.</p> <p dir="auto">Also here is the ENVs:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="CELERY_WORKER_DISABLE_RATE_LIMITS = True CELERY_SEND_TASK_ERROR_EMAILS = False CELERY_TASK_ANNOTATIONS = { &quot;*&quot;: { &quot;on_failure&quot;: celery_on_failure # incapsulated logging } } CELERY_QUEUE_HA_POLICY = 'all' BROKER_HOST = os.getenv('BROKER_HOST', 'localhost') BROKER_PORT = os.getenv('BROKER_PORT', 5672) BROKER_USER = os.getenv('BROKER_USER', 'guest') BROKER_PASSWORD = os.getenv('BROKER_PASSWORD', 'guest') BROKER_VHOST = os.getenv('BROKER_VHOST', '/') CELERY_RESULT_BACKEND = 'rpc://{BROKER_USER}:{BROKER_PASSWORD}@{BROKER_HOST}:{BROKER_PORT}/{BROKER_VHOST}'.format( BROKER_USER=BROKER_USER, BROKER_PASSWORD=BROKER_PASSWORD, BROKER_HOST=BROKER_HOST, BROKER_PORT=BROKER_PORT, BROKER_VHOST=BROKER_VHOST, ) CELERY_RESULT_PERSISTENT = True CELERY_TASK_IGNORE_RESULT = True "><pre class="notranslate"><span class="pl-v">CELERY_WORKER_DISABLE_RATE_LIMITS</span> <span class="pl-c1">=</span> <span class="pl-c1">True</span> <span class="pl-v">CELERY_SEND_TASK_ERROR_EMAILS</span> <span class="pl-c1">=</span> <span class="pl-c1">False</span> <span class="pl-v">CELERY_TASK_ANNOTATIONS</span> <span class="pl-c1">=</span> { <span class="pl-s">"*"</span>: { <span class="pl-s">"on_failure"</span>: <span class="pl-s1">celery_on_failure</span> <span class="pl-c"># incapsulated logging</span> } } <span class="pl-v">CELERY_QUEUE_HA_POLICY</span> <span class="pl-c1">=</span> <span class="pl-s">'all'</span> <span class="pl-v">BROKER_HOST</span> <span class="pl-c1">=</span> <span class="pl-s1">os</span>.<span class="pl-en">getenv</span>(<span class="pl-s">'BROKER_HOST'</span>, <span class="pl-s">'localhost'</span>) <span class="pl-v">BROKER_PORT</span> <span class="pl-c1">=</span> <span class="pl-s1">os</span>.<span class="pl-en">getenv</span>(<span class="pl-s">'BROKER_PORT'</span>, <span class="pl-c1">5672</span>) <span class="pl-v">BROKER_USER</span> <span class="pl-c1">=</span> <span class="pl-s1">os</span>.<span class="pl-en">getenv</span>(<span class="pl-s">'BROKER_USER'</span>, <span class="pl-s">'guest'</span>) <span class="pl-v">BROKER_PASSWORD</span> <span class="pl-c1">=</span> <span class="pl-s1">os</span>.<span class="pl-en">getenv</span>(<span class="pl-s">'BROKER_PASSWORD'</span>, <span class="pl-s">'guest'</span>) <span class="pl-v">BROKER_VHOST</span> <span class="pl-c1">=</span> <span class="pl-s1">os</span>.<span class="pl-en">getenv</span>(<span class="pl-s">'BROKER_VHOST'</span>, <span class="pl-s">'/'</span>) <span class="pl-v">CELERY_RESULT_BACKEND</span> <span class="pl-c1">=</span> <span class="pl-s">'rpc://{BROKER_USER}:{BROKER_PASSWORD}@{BROKER_HOST}:{BROKER_PORT}/{BROKER_VHOST}'</span>.<span class="pl-en">format</span>( <span class="pl-v">BROKER_USER</span><span class="pl-c1">=</span><span class="pl-v">BROKER_USER</span>, <span class="pl-v">BROKER_PASSWORD</span><span class="pl-c1">=</span><span class="pl-v">BROKER_PASSWORD</span>, <span class="pl-v">BROKER_HOST</span><span class="pl-c1">=</span><span class="pl-v">BROKER_HOST</span>, <span class="pl-v">BROKER_PORT</span><span class="pl-c1">=</span><span class="pl-v">BROKER_PORT</span>, <span class="pl-v">BROKER_VHOST</span><span class="pl-c1">=</span><span class="pl-v">BROKER_VHOST</span>, ) <span class="pl-v">CELERY_RESULT_PERSISTENT</span> <span class="pl-c1">=</span> <span class="pl-c1">True</span> <span class="pl-v">CELERY_TASK_IGNORE_RESULT</span> <span class="pl-c1">=</span> <span class="pl-c1">True</span></pre></div> <p dir="auto">And especially for testing:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="CELERY_TASK_ALWAYS_EAGER = True CELERY_TASK_EAGER_PROPAGATES = True"><pre class="notranslate"><span class="pl-v">CELERY_TASK_ALWAYS_EAGER</span> <span class="pl-c1">=</span> <span class="pl-c1">True</span> <span class="pl-v">CELERY_TASK_EAGER_PROPAGATES</span> <span class="pl-c1">=</span> <span class="pl-c1">True</span></pre></div> <p dir="auto">Tried to run with eager_mode to False, but it says that Retry does not raising.</p> <p dir="auto">Here also the celery_app file:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from django.conf import settings project_name = 'name' app = celery.Celery(project_name) app.config_from_object('django.conf:settings', namespace='CELERY') app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">django</span>.<span class="pl-s1">conf</span> <span class="pl-k">import</span> <span class="pl-s1">settings</span> <span class="pl-s1">project_name</span> <span class="pl-c1">=</span> <span class="pl-s">'name'</span> <span class="pl-s1">app</span> <span class="pl-c1">=</span> <span class="pl-s1">celery</span>.<span class="pl-v">Celery</span>(<span class="pl-s1">project_name</span>) <span class="pl-s1">app</span>.<span class="pl-en">config_from_object</span>(<span class="pl-s">'django.conf:settings'</span>, <span class="pl-s1">namespace</span><span class="pl-c1">=</span><span class="pl-s">'CELERY'</span>) <span class="pl-s1">app</span>.<span class="pl-en">autodiscover_tasks</span>(<span class="pl-k">lambda</span>: <span class="pl-s1">settings</span>.<span class="pl-v">INSTALLED_APPS</span>)</pre></div>
<h1 dir="auto">Checklist</h1> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have verified that the issue exists against the <code class="notranslate">main</code> branch of Celery.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> This has already been asked to the <a href="https://github.com/celery/celery/discussions">discussions forum</a> first.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have read the relevant section in the<br> <a href="https://docs.celeryq.dev/en/main/contributing.html#other-bugs" rel="nofollow">contribution guide</a><br> on reporting bugs.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/celery/celery/issues?q=is%3Aissue+label%3A%22Issue+Type%3A+Bug+Report%22+-label%3A%22Category%3A+Documentation%22">issues list</a><br> for similar or identical bug reports.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/celery/celery/pulls?q=is%3Apr+label%3A%22PR+Type%3A+Bugfix%22+-label%3A%22Category%3A+Documentation%22">pull requests list</a><br> for existing proposed fixes.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/celery/celery/commits/main">commit log</a><br> to find out if the bug was already fixed in the main branch.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included all related issues and possible duplicate issues<br> in this issue (If there are none, check this box anyway).</li> </ul> <h2 dir="auto">Mandatory Debugging Information</h2> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included the output of <code class="notranslate">celery -A proj report</code> in the issue.<br> (if you are not able to do this, then at least specify the Celery<br> version affected).</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have verified that the issue exists against the <code class="notranslate">main</code> branch of Celery.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included the contents of <code class="notranslate">pip freeze</code> in the issue.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included all the versions of all the external dependencies required<br> to reproduce this bug.</li> </ul> <h2 dir="auto">Optional Debugging Information</h2> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one Python version<br> and/or implementation.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one message broker and/or<br> result backend.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one version of the message<br> broker and/or result backend.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one operating system.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one workers pool.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue with autoscaling, retries,<br> ETA/Countdown &amp; rate limits disabled.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue after downgrading<br> and/or upgrading Celery and its dependencies.</li> </ul> <h2 dir="auto">Related Issues and Possible Duplicates</h2> <h4 dir="auto">Related Issues</h4> <ul dir="auto"> <li>None</li> </ul> <h4 dir="auto">Possible Duplicates</h4> <ul dir="auto"> <li>None</li> </ul> <h2 dir="auto">Environment &amp; Settings</h2> <p dir="auto"><strong>Celery version</strong>:</p> <details> <summary><b><code class="notranslate">celery report</code> Output:</b></summary> <p dir="auto"> </p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate"></code></pre></div> <p dir="auto"></p> </details> <h1 dir="auto">Steps to Reproduce</h1> <h2 dir="auto">Required Dependencies</h2> <ul dir="auto"> <li><strong>Minimal Python Version</strong>: N/A or Unknown</li> <li><strong>Minimal Celery Version</strong>: N/A or Unknown</li> <li><strong>Minimal Kombu Version</strong>: N/A or Unknown</li> <li><strong>Minimal Broker Version</strong>: N/A or Unknown</li> <li><strong>Minimal Result Backend Version</strong>: N/A or Unknown</li> <li><strong>Minimal OS and/or Kernel Version</strong>: N/A or Unknown</li> <li><strong>Minimal Broker Client Version</strong>: N/A or Unknown</li> <li><strong>Minimal Result Backend Client Version</strong>: N/A or Unknown</li> </ul> <h3 dir="auto">Python Packages</h3> <details> <summary><b><code class="notranslate">pip freeze</code> Output:</b></summary> <p dir="auto"> </p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate"></code></pre></div> <p dir="auto"></p> </details> <h3 dir="auto">Other Dependencies</h3> <details> <p dir="auto"> N/A </p> </details> <h2 dir="auto">Minimally Reproducible Test Case</h2> <details> <p dir="auto"> </p><div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"></pre></div> <p dir="auto"></p> </details> <h1 dir="auto">Expected Behavior</h1> <h1 dir="auto">Actual Behavior</h1>
0
<h5 dir="auto">Description of the problem</h5> <p dir="auto">When i import the model it is correct.<br> <a href="https://gyazo.com/ff1c9b427be5ba44ab1a500bffecabeb" rel="nofollow">https://gyazo.com/ff1c9b427be5ba44ab1a500bffecabeb</a></p> <p dir="auto">But with the animation on it flies off into the distance<br> <a href="https://gyazo.com/3ce34820e57708c86c004f7f307a332a" rel="nofollow">https://gyazo.com/3ce34820e57708c86c004f7f307a332a</a></p> <p dir="auto">But it's working fine on Babylon with the same file and animation on:<br> <a href="https://gyazo.com/0791af74b0da7ca1f8ec7e39f8314096" rel="nofollow">https://gyazo.com/0791af74b0da7ca1f8ec7e39f8314096</a></p> <p dir="auto">Animation export settings:<br> <a href="https://gyazo.com/f8666858b9108691b10228caa6d29c6a" rel="nofollow">https://gyazo.com/f8666858b9108691b10228caa6d29c6a</a></p> <p dir="auto">Blend file:<br> <a href="https://drive.google.com/file/d/1kWiWDLJ4rQ98mPha3kcss6cCl5y2iTg3/view?usp=sharing" rel="nofollow">https://drive.google.com/file/d/1kWiWDLJ4rQ98mPha3kcss6cCl5y2iTg3/view?usp=sharing</a></p> <p dir="auto">GLB file:<br> <a href="https://drive.google.com/file/d/1JNY90Zvn4pxuBdQ_PivTMZpDJIpiOsOa/view?usp=sharing" rel="nofollow">https://drive.google.com/file/d/1JNY90Zvn4pxuBdQ_PivTMZpDJIpiOsOa/view?usp=sharing</a></p> <h5 dir="auto">Browser</h5> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> All of them</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Chrome</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Firefox</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Internet Explorer</li> </ul> <h5 dir="auto">OS</h5> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> All of them</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Windows</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> macOS</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Linux</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Android</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> iOS</li> </ul>
<p dir="auto">What is the easiest way to draw a long 3D tube that follows a 3D path.</p> <p dir="auto">I have a collection of 3D points that represent a route through my world and I want to highlight it. If I draw it as a THREE.Line it comes out 1 pixel wide which is impossible to see, so I want it as a 3D solid.</p> <p dir="auto">I tried extruding a shape along a path but that has a couple of issues - the path is defined in 2D and the shape (which is also 2D) doesn't rotate as it is extruded so I get thin points in my solid.</p>
0
<p dir="auto"><a href="https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/logs/kubernetes-e2e-gce/21123/" rel="nofollow">https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/logs/kubernetes-e2e-gce/21123/</a></p> <p dir="auto">Failed: BeforeSuite {Kubernetes e2e suite}</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/e2e.go:154 Aug 4 06:39:58.074: Failed to setup provider config: Error building GCE/GKE provider: Get https://www.googleapis.com/compute/v1/projects/k8s-jkns-e2e-gce/global/networks?alt=json: net/http: TLS handshake timeout /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/e2e.go:151"><pre class="notranslate"><code class="notranslate">/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/e2e.go:154 Aug 4 06:39:58.074: Failed to setup provider config: Error building GCE/GKE provider: Get https://www.googleapis.com/compute/v1/projects/k8s-jkns-e2e-gce/global/networks?alt=json: net/http: TLS handshake timeout /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/e2e.go:151 </code></pre></div> <p dir="auto">Previous issues for this test: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="156417256" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/26135" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/26135/hovercard" href="https://github.com/kubernetes/kubernetes/issues/26135">#26135</a> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="156638964" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/26236" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/26236/hovercard" href="https://github.com/kubernetes/kubernetes/issues/26236">#26236</a> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="161828864" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/27920" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/27920/hovercard" href="https://github.com/kubernetes/kubernetes/issues/27920">#27920</a> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="163806926" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/28492" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/28492/hovercard" href="https://github.com/kubernetes/kubernetes/issues/28492">#28492</a> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="169047628" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/29970" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/29970/hovercard" href="https://github.com/kubernetes/kubernetes/issues/29970">#29970</a></p>
<p dir="auto">We have two sets of labels on internal node object: one is on the object (Minion.Labels), one is on object meta (Minion.ObjectMeta.Labels). We should remove Minion.Labels and fix the conversion properly?</p>
0
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=penberg" rel="nofollow">Pekka Enberg</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-1607?redirect=false" rel="nofollow">SPR-1607</a></strong> and commented</p> <p dir="auto">With Hibernate 3.1, you can set multiple event listeners per type but Spring 2.0 M1 does not support that. Please see the following Hibernate Javadoc: <a href="http://www.hibernate.org/hib_docs/v3/api/org/hibernate/cfg/Configuration.html#setListeners(java.lang.String,%20java.lang.Object%5B%5D)" rel="nofollow">http://www.hibernate.org/hib_docs/v3/api/org/hibernate/cfg/Configuration.html#setListeners(java.lang.String,%20java.lang.Object[])</a></p> <hr> <p dir="auto"><strong>Affects:</strong> 2.0 M1</p> <p dir="auto"><strong>Issue Links:</strong></p> <ul dir="auto"> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398063813" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/6440" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/6440/hovercard" href="https://github.com/spring-projects/spring-framework/issues/6440">#6440</a> Improve Hibernate3 LocalSessionFactoryBean support for event listeners (<em><strong>"is duplicated by"</strong></em>)</li> </ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=kshronts" rel="nofollow">korey shronts</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-7662?redirect=false" rel="nofollow">SPR-7662</a></strong> and commented</p> <p dir="auto">Can multipart request support be added to portlet ResourceRequest processing? Current implementation of DispatcherPortlet only processes multipart requests for ActionRequest(s).</p> <hr> <p dir="auto"><strong>Affects:</strong> 3.0.4</p> <p dir="auto"><strong>Issue Links:</strong></p> <ul dir="auto"> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398109839" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12565" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12565/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12565">#12565</a> Handling Multipart request that is not an Action request ? (<em><strong>"is duplicated by"</strong></em>)</li> </ul> <p dir="auto">3 votes, 3 watchers</p>
0
<p dir="auto">Recently updated to 0.12.2 and a checkbox element hooked up to <code class="notranslate">this.props</code> is dynamically updating in the browser. Using the React inspector for Chrome, <code class="notranslate">this.props.item.isActive</code> seems to be toggling fine, but for some reason the changes don't propagate into the DOM. Not sure if this is specific to the update, or I've messed something up that I don't realize.</p> <p dir="auto">Here's my render function:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="render: function() { let className = ''; if (this.props.item.isActive) className = 'is-active'; return ( &lt;li className={className}&gt; &lt;div className=&quot;view&quot;&gt; &lt;input className=&quot;toggle&quot; type=&quot;checkbox&quot; checked={this.props.item.isActive} onChange={this.toggleActive} /&gt; &lt;span&gt;{this.props.item.text}&lt;/span&gt; &lt;button className=&quot;destroy-item&quot; onClick={this.destroyItem}&gt;&lt;/button&gt; &lt;/div&gt; &lt;/li&gt; ); }"><pre class="notranslate">render: <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">let</span> <span class="pl-s1">className</span> <span class="pl-c1">=</span> <span class="pl-s">''</span><span class="pl-kos">;</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">props</span><span class="pl-kos">.</span><span class="pl-c1">item</span><span class="pl-kos">.</span><span class="pl-c1">isActive</span><span class="pl-kos">)</span> <span class="pl-s1">className</span> <span class="pl-c1">=</span> <span class="pl-s">'is-active'</span><span class="pl-kos">;</span> <span class="pl-k">return</span> <span class="pl-kos">(</span> <span class="pl-c1">&lt;</span><span class="pl-ent">li</span> <span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-s1">className</span><span class="pl-kos">}</span><span class="pl-c1">&gt;</span> <span class="pl-c1">&lt;</span><span class="pl-ent">div</span> <span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-s">"view"</span><span class="pl-c1">&gt;</span> <span class="pl-c1">&lt;</span><span class="pl-ent">input</span> <span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-s">"toggle"</span> <span class="pl-c1">type</span><span class="pl-c1">=</span><span class="pl-s">"checkbox"</span> <span class="pl-c1">checked</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">props</span><span class="pl-kos">.</span><span class="pl-c1">item</span><span class="pl-kos">.</span><span class="pl-c1">isActive</span><span class="pl-kos">}</span> <span class="pl-c1">onChange</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">toggleActive</span><span class="pl-kos">}</span> <span class="pl-c1">/</span><span class="pl-c1">&gt;</span> <span class="pl-c1">&lt;</span><span class="pl-ent">span</span><span class="pl-c1">&gt;</span><span class="pl-kos">{</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">props</span><span class="pl-kos">.</span><span class="pl-c1">item</span><span class="pl-kos">.</span><span class="pl-c1">text</span><span class="pl-kos">}</span><span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-ent">span</span><span class="pl-c1">&gt;</span> <span class="pl-c1">&lt;</span><span class="pl-ent">button</span> <span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-s">"destroy-item"</span> <span class="pl-c1">onClick</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">destroyItem</span><span class="pl-kos">}</span><span class="pl-c1">&gt;</span><span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-ent">button</span><span class="pl-c1">&gt;</span> <span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">&gt;</span> <span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-ent">li</span><span class="pl-c1">&gt;</span> <span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span></pre></div>
<p dir="auto">When using AMD, a component might use React as a dependency. This poses a problem when another instance of React has already manipulated the DOM. The wrong events get fired, or ID collisions occur (<em>Invariant Violation: ReactMount: Two valid but unequal nodes with the same <code class="notranslate">data-reactid</code>: .0</em>).</p> <p dir="auto">jsbin here: <a href="http://jsbin.com/riqotavoxa/11/edit?js,output" rel="nofollow">http://jsbin.com/riqotavoxa/11/edit?js,output</a><br> SO here for internet points: <a href="http://stackoverflow.com/q/28685857/614523" rel="nofollow">http://stackoverflow.com/q/28685857/614523</a><br> Google Group post here: <a href="https://groups.google.com/forum/#!topic/reactjs/RRDUaF19CM0" rel="nofollow">https://groups.google.com/forum/#!topic/reactjs/RRDUaF19CM0</a></p>
0
<p dir="auto">Hi,</p> <p dir="auto">I'm trying to make a component where I want to reuse the same projected 'ng-content' but it doesn't seem to be possible. It would be nice if angular could iterate through all the unnamed ng-contents and replace them.</p> <p dir="auto">Here is a use case example.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@Component({ selector: 'wt-link', template: ` &lt;a *ngIf=&quot;!isRouteActive() [routerLink]=&quot;routerLink&quot;&gt; &lt;ng-content&gt;&lt;/ng-content&gt; &lt;/a&gt; &lt;div *ngIf=&quot;isRouteActive()&quot;&gt; &lt;ng-content&gt;&lt;/ng-content&gt; &lt;/div&gt; ` }) class LinkComponent { ... }"><pre class="notranslate"><code class="notranslate">@Component({ selector: 'wt-link', template: ` &lt;a *ngIf="!isRouteActive() [routerLink]="routerLink"&gt; &lt;ng-content&gt;&lt;/ng-content&gt; &lt;/a&gt; &lt;div *ngIf="isRouteActive()"&gt; &lt;ng-content&gt;&lt;/ng-content&gt; &lt;/div&gt; ` }) class LinkComponent { ... } </code></pre></div> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;wt-link [routerLink]=...&gt;My Link Name&lt;/wt-link&gt;"><pre class="notranslate"><code class="notranslate">&lt;wt-link [routerLink]=...&gt;My Link Name&lt;/wt-link&gt; </code></pre></div> <p dir="auto">The link is displayed in another way if the route is active and I want more changes than simple CSS.</p> <p dir="auto">Is there any workaround?</p>
<p dir="auto">version: <code class="notranslate">ng2-beta12</code><br> For some reason the order in which templates are defined is causing issues with transclusion.</p> <p dir="auto"><a href="http://plnkr.co/edit/OmMGa65bNfrrQn0i5Wwm?p=preview" rel="nofollow">Doesn't Work for buttons but works for link</a></p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;template [ngIf]=&quot;href ===''&quot;&gt; &lt;button [ngClass]=&quot;cssClassList&quot;&gt; &lt;ng-content&gt;&lt;/ng-content&gt; &lt;/button&gt; &lt;/template&gt; &lt;template [ngIf]=&quot;href !==''&quot;&gt; &lt;a [ngClass]=&quot;cssClassList&quot; href=&quot;href&quot;&gt; &lt;ng-content&gt;&lt;/ng-content&gt; &lt;/a&gt; &lt;/template&gt;"><pre class="notranslate"><code class="notranslate">&lt;template [ngIf]="href ===''"&gt; &lt;button [ngClass]="cssClassList"&gt; &lt;ng-content&gt;&lt;/ng-content&gt; &lt;/button&gt; &lt;/template&gt; &lt;template [ngIf]="href !==''"&gt; &lt;a [ngClass]="cssClassList" href="href"&gt; &lt;ng-content&gt;&lt;/ng-content&gt; &lt;/a&gt; &lt;/template&gt; </code></pre></div> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/2133184/14080610/46e6e0a0-f4d4-11e5-9317-4acd79f61101.png"><img src="https://cloud.githubusercontent.com/assets/2133184/14080610/46e6e0a0-f4d4-11e5-9317-4acd79f61101.png" alt="screen shot 2016-03-28 at 10 59 34 am" style="max-width: 100%;"></a></p> <p dir="auto"><a href="http://plnkr.co/edit/ccpnmdnU53B5JqZMBnxP?p=preview" rel="nofollow">Works for buttons but not for links</a></p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;template [ngIf]=&quot;href !==''&quot;&gt; &lt;a [ngClass]=&quot;cssClassList&quot; href=&quot;href&quot;&gt; &lt;ng-content&gt;&lt;/ng-content&gt; &lt;/a&gt; &lt;/template&gt; &lt;template [ngIf]=&quot;href ===''&quot;&gt; &lt;button [ngClass]=&quot;cssClassList&quot;&gt; &lt;ng-content&gt;&lt;/ng-content&gt; &lt;/button&gt; &lt;/template&gt;"><pre class="notranslate"><code class="notranslate">&lt;template [ngIf]="href !==''"&gt; &lt;a [ngClass]="cssClassList" href="href"&gt; &lt;ng-content&gt;&lt;/ng-content&gt; &lt;/a&gt; &lt;/template&gt; &lt;template [ngIf]="href ===''"&gt; &lt;button [ngClass]="cssClassList"&gt; &lt;ng-content&gt;&lt;/ng-content&gt; &lt;/button&gt; &lt;/template&gt; </code></pre></div> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/2133184/14080621/57ccd636-f4d4-11e5-8f57-e5c8fbb856ee.png"><img src="https://cloud.githubusercontent.com/assets/2133184/14080621/57ccd636-f4d4-11e5-8f57-e5c8fbb856ee.png" alt="screen shot 2016-03-28 at 10 59 46 am" style="max-width: 100%;"></a></p>
1
<p dir="auto"><strong>TypeScript Version:</strong></p> <p dir="auto">1.8.7</p> <p dir="auto"><strong>Code</strong></p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function func(val: &quot;Test&quot;) { console.log(val); } func(&quot;Test&quot;);"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">func</span><span class="pl-kos">(</span><span class="pl-s1">val</span>: <span class="pl-s">"Test"</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">val</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-en">func</span><span class="pl-kos">(</span><span class="pl-s">"Test"</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p dir="auto"><strong>Expected behavior:</strong><br> Should work normally and print "Test".</p> <p dir="auto"><strong>Actual behavior:</strong><br> A compile-time error is reported (highlighting <code class="notranslate">func</code>):</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="A signature with an implementation cannot use a string literal type."><pre class="notranslate"><code class="notranslate">A signature with an implementation cannot use a string literal type. </code></pre></div> <hr> <p dir="auto">In my code I had a function that accepted an argument with a type including only two possible string literal values: say <code class="notranslate">"Value1"</code> and <code class="notranslate">"Value2"</code>, e.g <code class="notranslate">function func(val: "Value1" | "Value2")</code>, which worked OK. At some point I decided that "Value2" should not yet be supported so I removed it as an option. This left me with a unary string literal type, e.g. <code class="notranslate">function func(val: "Value1")</code>, but the compiler doesn't seem to like it?</p>
<p dir="auto">Specialized signatures needing to be compatible with an overload was an artificial requirement due to issues in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="46547257" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/943" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/943/hovercard" href="https://github.com/microsoft/TypeScript/issues/943">#943</a>. Now that we've fixed that, we should consider what we're going to do with this rule.</p> <p dir="auto">Could we remove it wholesale? That would potentially be a breaking change, but it seems like good one. Basically, the situations you'd run into this would be where you have something like the following...</p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function doThing(x: &quot;dog&quot;): Dog; function doThing(x: &quot;cat&quot;): Cat; function doThing(x: string): Animal; function doThing(x: string, y?: string): Moose { }"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-s1">doThing</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-s">"dog"</span><span class="pl-kos">)</span>: <span class="pl-smi">Dog</span><span class="pl-kos">;</span> <span class="pl-k">function</span> <span class="pl-s1">doThing</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-s">"cat"</span><span class="pl-kos">)</span>: <span class="pl-smi">Cat</span><span class="pl-kos">;</span> <span class="pl-k">function</span> <span class="pl-s1">doThing</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-smi">string</span><span class="pl-kos">)</span>: <span class="pl-smi">Animal</span><span class="pl-kos">;</span> <span class="pl-k">function</span> <span class="pl-en">doThing</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-smi">string</span><span class="pl-kos">,</span> <span class="pl-s1">y</span>?: <span class="pl-smi">string</span><span class="pl-kos">)</span>: <span class="pl-smi">Moose</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">Where now we'd check if the implementation was assignable to the specialized signatures and give an error. That seems like a good change.</p>
1
<p dir="auto">Ansible Version - 2.0, 2.0.0.2<br> Module - File<br> Description - Trying to create directories more than 1 level deep gives following error:</p> <p dir="auto">There was an issue creating /dir1/dir2 as requested: 'module' object has no attribute 'EEXISTS'</p> <p dir="auto">If i remove dir2, it works. This command use to work with ansible version 1.9.2</p>
<h5 dir="auto">Issue Type:</h5> <p dir="auto">Bug Report</p> <h5 dir="auto">Component Name:</h5> <p dir="auto">file module</p> <h5 dir="auto">Ansible Version:</h5> <p dir="auto">Ansible devel</p> <h5 dir="auto">Ansible Configuration:</h5> <p dir="auto">Default <code class="notranslate">ansible.cfg</code></p> <h5 dir="auto">Environment:</h5> <p dir="auto">Debian, Ubuntu, unprivileged account</p> <h5 dir="auto">Summary:</h5> <p dir="auto"><code class="notranslate">file</code> module cannot create private directories with mode <code class="notranslate">0600</code> more than two levels deep.</p> <h5 dir="auto">Steps To Reproduce:</h5> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- hosts: all become: False tasks: - name: Create private directory file: path: '~/var/lib/private' state: 'directory' mode: '0600' "><pre class="notranslate"><code class="notranslate">- hosts: all become: False tasks: - name: Create private directory file: path: '~/var/lib/private' state: 'directory' mode: '0600' </code></pre></div> <h5 dir="auto">Expected Results:</h5> <p dir="auto">Directories are created without issues.</p> <h5 dir="auto">Actual Results:</h5> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PLAY *************************************************************************** TASK [setup] ******************************************************************* ok: [localhost] TASK [Create private directory] ************************************************ fatal: [localhost]: FAILED! =&gt; {&quot;changed&quot;: false, &quot;failed&quot;: true, &quot;msg&quot;: &quot;There was an issue creating /var/local/drybjed/var/lib/private as requested: 'module' object has no attribute 'EEXISTS'&quot;, &quot;path&quot;: &quot;/var/local/drybjed/var/lib/private&quot;, &quot;state&quot;: &quot;absent&quot;} PLAY RECAP ********************************************************************* localhost : ok=1 changed=0 unreachable=0 failed=1 "><pre class="notranslate"><code class="notranslate">PLAY *************************************************************************** TASK [setup] ******************************************************************* ok: [localhost] TASK [Create private directory] ************************************************ fatal: [localhost]: FAILED! =&gt; {"changed": false, "failed": true, "msg": "There was an issue creating /var/local/drybjed/var/lib/private as requested: 'module' object has no attribute 'EEXISTS'", "path": "/var/local/drybjed/var/lib/private", "state": "absent"} PLAY RECAP ********************************************************************* localhost : ok=1 changed=0 unreachable=0 failed=1 </code></pre></div>
1
<p dir="auto">I have an iOS app.<br> I have set a launch screen image in xCode.<br> I set the same image in a container in the main scaffold.<br> But I see a brief flash of white (or whatever color the scaffold background is) between the launch image and scaffold image. How can I get rid of that?</p>
<p dir="auto">I am trying to figure out this blank screen that shows up between the LaunchImage and my app's first screen. Has anyone noticed that. this is the code I wrote for a simple test.</p> <div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="void main() =&gt; runApp( new MaterialApp( debugShowCheckedModeBanner: false, title: &quot;Sample App&quot;, theme: new ThemeData( primarySwatch: Colors.yellow, ), home: new Scaffold( backgroundColor: Colors.red, body:new Container( child: new Center( child: new Text (&quot; Sample App &quot;, style: new TextStyle( fontSize: 20.0, color: Colors.white ), ) ) ) ) ) );"><pre class="notranslate"><span class="pl-k">void</span> <span class="pl-en">main</span>() <span class="pl-k">=&gt;</span> <span class="pl-en">runApp</span>( <span class="pl-k">new</span> <span class="pl-c1">MaterialApp</span>( debugShowCheckedModeBanner<span class="pl-k">:</span> <span class="pl-c1">false</span>, title<span class="pl-k">:</span> <span class="pl-s">"Sample App"</span>, theme<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">ThemeData</span>( primarySwatch<span class="pl-k">:</span> <span class="pl-c1">Colors</span>.yellow, ), home<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">Scaffold</span>( backgroundColor<span class="pl-k">:</span> <span class="pl-c1">Colors</span>.red, body<span class="pl-k">:</span><span class="pl-k">new</span> <span class="pl-c1">Container</span>( child<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">Center</span>( child<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">Text</span> (<span class="pl-s">" Sample App "</span>, style<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">TextStyle</span>( fontSize<span class="pl-k">:</span> <span class="pl-c1">20.0</span>, color<span class="pl-k">:</span> <span class="pl-c1">Colors</span>.white ), ) ) ) ) ) );</pre></div> <p dir="auto">Here is a video of what happens .,.. see the bklack screen between the launch screen (with logo) and the red screen ... (from 1 secs to about 4 secs.)</p> <p dir="auto"><a href="https://youtu.be/EpB_AdekLNc" rel="nofollow">https://youtu.be/EpB_AdekLNc</a></p> <p dir="auto">The Android equivalent of this issue is <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="361496461" data-permission-text="Title is private" data-url="https://github.com/flutter/flutter/issues/22007" data-hovercard-type="issue" data-hovercard-url="/flutter/flutter/issues/22007/hovercard" href="https://github.com/flutter/flutter/issues/22007">#22007</a>.</p>
1
<ul dir="auto"> <li>Electron version:1.3.3</li> <li>Operating system:Windows7</li> </ul> <p dir="auto">Why in renderer process the webContents.session Event 'will-download' callbacks params DownloadItem Method setSavePath('path') it had no effect. But in main process is all right</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// In the renderer process. const {BrowserWindow} = require('electron').remote let win = new BrowserWindow() win.webContents.session.on('will-download', (event, item, webContents) =&gt; { // Set the save path, making Electron not to prompt a save dialog. item.setSavePath('/tmp/save.pdf') // Then Electron still pop prompt a save dialog. })"><pre class="notranslate"><code class="notranslate">// In the renderer process. const {BrowserWindow} = require('electron').remote let win = new BrowserWindow() win.webContents.session.on('will-download', (event, item, webContents) =&gt; { // Set the save path, making Electron not to prompt a save dialog. item.setSavePath('/tmp/save.pdf') // Then Electron still pop prompt a save dialog. }) </code></pre></div>
<p dir="auto">Hello,</p> <p dir="auto"><a href="http://electron.atom.io/docs/all/#downloaditem" rel="nofollow"><code class="notranslate">DownloadItem.setSavePath()</code></a> is supposed to prevent the save dialog, which is exactly what I need. However, this doesn't work in a renderer process. The save dialog still appears. In fact, the <code class="notranslate">"will-download"</code> event handler is called <em>after</em> the save dialog appeared and had been closed. The code was contracted for this issue:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="require(&quot;electron&quot;).remote.getCurrentWebContents().session.on(&quot;will-download&quot;, function(event, item, webContents) { item.setSavePath(`C:\\Path\\${item.getFilename()}`); });"><pre class="notranslate"><span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"electron"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">remote</span><span class="pl-kos">.</span><span class="pl-en">getCurrentWebContents</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">session</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">"will-download"</span><span class="pl-kos">,</span> <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">event</span><span class="pl-kos">,</span> <span class="pl-s1">item</span><span class="pl-kos">,</span> <span class="pl-s1">webContents</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-s1">item</span><span class="pl-kos">.</span><span class="pl-en">setSavePath</span><span class="pl-kos">(</span><span class="pl-s">`C:\\Path\\<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">item</span><span class="pl-kos">.</span><span class="pl-en">getFilename</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p dir="auto">Although, <em>this does work</em> in allowing you to cancel requests:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="require(&quot;electron&quot;).remote.getCurrentWebContents().session.webRequest.onBeforeRequest( function(...) { ... });"><pre class="notranslate"><span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"electron"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">remote</span><span class="pl-kos">.</span><span class="pl-en">getCurrentWebContents</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">session</span><span class="pl-kos">.</span><span class="pl-c1">webRequest</span><span class="pl-kos">.</span><span class="pl-c1">onBeforeRequest</span><span class="pl-kos">(</span> <span class="pl-k">function</span><span class="pl-kos">(</span>...<span class="pl-kos">)</span> <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p dir="auto">Also, <code class="notranslate">DownloadItem.setSavePath()</code> in the main process works as expected. It prevents the save dialog:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="let window = new require(&quot;electron&quot;).BrowserWindow(); ... window.webContents.session.on(&quot;will-download&quot;, function(event, item, webContents) { item.setSavePath(`C:\\Path\\${item.getFilename()}`); });"><pre class="notranslate"><span class="pl-k">let</span> <span class="pl-s1">window</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"electron"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">BrowserWindow</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> ... <span class="pl-s1">window</span><span class="pl-kos">.</span><span class="pl-c1">webContents</span><span class="pl-kos">.</span><span class="pl-c1">session</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">"will-download"</span><span class="pl-kos">,</span> <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">event</span><span class="pl-kos">,</span> <span class="pl-s1">item</span><span class="pl-kos">,</span> <span class="pl-s1">webContents</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-s1">item</span><span class="pl-kos">.</span><span class="pl-en">setSavePath</span><span class="pl-kos">(</span><span class="pl-s">`C:\\Path\\<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">item</span><span class="pl-kos">.</span><span class="pl-en">getFilename</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p dir="auto">Further, having a <code class="notranslate">"will-download"</code> event handler function in both processes basically works, because you can successfully use the <code class="notranslate">DownloadItem</code> in the renderer process to print the download status every second.</p> <hr> <p dir="auto">Unfortunately, I couldn't think of a workaround. I don't think there's any possibility to call a function of the renderer process from the main process synchronously and get a result which, then, could be used for <code class="notranslate">setSavePath()</code> to be called from the main process. Is there still some way to get the <code class="notranslate">setSavePath()</code> logic into the renderer process while this bug persists?</p>
1
<p dir="auto">See <a href="http://jsbin.com/taxat/1/" rel="nofollow">http://jsbin.com/taxat/1/</a><br> Tested on MacOS 10.8.5, Firefox 26 and Chrome 32.</p> <p dir="auto">Using</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;div class=&quot;hidden-md hidden-lg&quot;&gt;XS and SM - via hidden&lt;/div&gt;"><pre class="notranslate"><code class="notranslate">&lt;div class="hidden-md hidden-lg"&gt;XS and SM - via hidden&lt;/div&gt; </code></pre></div> <p dir="auto">the content is shown in both xs and sm resolutions. Correct.</p> <p dir="auto">But using</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;div class=&quot;visible-xs visible-sm&quot;&gt;XS and SM - via visible&lt;/div&gt;"><pre class="notranslate"><code class="notranslate">&lt;div class="visible-xs visible-sm"&gt;XS and SM - via visible&lt;/div&gt; </code></pre></div> <p dir="auto">the content is only shown in sm resolution. Not correct, content should show in xs as well.</p> <p dir="auto">Probably similar issue with other resolution combinations.</p>
<p dir="auto"><a href="https://dl.dropboxusercontent.com/u/37682778/error/index.html" rel="nofollow">https://dl.dropboxusercontent.com/u/37682778/error/index.html</a></p>
1
<p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong><br> bug</p> <p dir="auto"><strong>What is the current behavior?</strong><br> Sometimes, Webpack generates code that contains Promises that are not rejectable. If an error is thrown in those Promise's body, the Promise is not rejected and thus the error bubbles up to the console, uncatched.</p> <p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong><br> Let's lazy-load some module based on the value of an input field (a real world use-case would be a SPA that loads modules based on the current route)...</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" let input = document.createElement('input'); document.body.appendChild(input); input.addEventListener('change', function(){ let path; path = input.value; import(`${path}`) .then(module =&gt; document.body.innerText = module.default) .catch(reason =&gt; {console.log(reason); /* go to 404 maybe... */}) }) "><pre class="notranslate"><span class="pl-k">let</span> <span class="pl-s1">input</span> <span class="pl-c1">=</span> <span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-en">createElement</span><span class="pl-kos">(</span><span class="pl-s">'input'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-c1">body</span><span class="pl-kos">.</span><span class="pl-en">appendChild</span><span class="pl-kos">(</span><span class="pl-s1">input</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">input</span><span class="pl-kos">.</span><span class="pl-en">addEventListener</span><span class="pl-kos">(</span><span class="pl-s">'change'</span><span class="pl-kos">,</span> <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">{</span> <span class="pl-k">let</span> <span class="pl-s1">path</span><span class="pl-kos">;</span> <span class="pl-s1">path</span> <span class="pl-c1">=</span> <span class="pl-s1">input</span><span class="pl-kos">.</span><span class="pl-c1">value</span><span class="pl-kos">;</span> <span class="pl-k">import</span><span class="pl-kos">(</span><span class="pl-s">`<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">path</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span> <span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-smi">module</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-c1">body</span><span class="pl-kos">.</span><span class="pl-c1">innerText</span> <span class="pl-c1">=</span> <span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-c1">default</span><span class="pl-kos">)</span> <span class="pl-kos">.</span><span class="pl-en">catch</span><span class="pl-kos">(</span><span class="pl-s1">reason</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span><span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">reason</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">/* go to 404 maybe... */</span><span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p dir="auto">if the value of the input field is not a valid module path, it throws.<br> It would be nice and clean to let developer decide whether or not to catch that exception.<br> If the developer doesn't catch it, it will naturally bubble up to the console. That's the expected behaviour of promises, anyway.</p> <p dir="auto"><strong>What is the expected behavior?</strong><br> If a Promise is rejected it should be catchable.</p> <p dir="auto"><strong>If this is a feature request, what is motivation or use case for changing the behavior?</strong><br> When working with Promises the developer should be in control about whether or not to catch the possible exception.</p> <p dir="auto"><strong>Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.</strong></p> <p dir="auto">Node: 6.11.3<br> Webpack 3.5.6<br> OS: Windows 10</p>
<p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong><br> Bug</p> <p dir="auto"><strong>What is the current behavior?</strong><br> Currently, if you dynamically call the import function and you are offline, the catch function is never called. Webpack generates an uncaught exception.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import('./my-component') .then(module =&gt; {}) .catch(err =&gt; console.log(err)"><pre class="notranslate"><code class="notranslate">import('./my-component') .then(module =&gt; {}) .catch(err =&gt; console.log(err) </code></pre></div> <p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong><br> Step 1)</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="window.loadChunk = () =&gt; { import('./my-component') .then(module =&gt; {}) .catch(err =&gt; console.log(err)) }"><pre class="notranslate"><code class="notranslate">window.loadChunk = () =&gt; { import('./my-component') .then(module =&gt; {}) .catch(err =&gt; console.log(err)) } </code></pre></div> <p dir="auto">Step 2)<br> Load the bundle on the page, you should now have available <code class="notranslate">loadChunk</code> function</p> <p dir="auto">Step 3)<br> Put your browser in "offline mode"</p> <p dir="auto">Step 4)<br> call the <code class="notranslate">loadChunk()</code> function</p> <p dir="auto"><strong>What is the expected behavior?</strong><br> Expected behavior is that the <code class="notranslate">catch</code> function is called and error logged.</p> <p dir="auto"><strong>Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.</strong><br> Using: Webpack v<em>3.3.0</em><br> This happens because the <code class="notranslate">import</code> function is converted into a Promise that wraps the <code class="notranslate">require.ensure</code>. Any time the require.ensure rejects the promise, it automatically calls the ensure's OnError callback which throws an exception. Async exceptions are not caught by the parent Promise, resulting in the bug above.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// var prom = import('./my-component) var prom = new Promise(function (resolve) { __webpack_require__.e/* require.ensure */(1).then((function (require) { resolve(__webpack_require__( /* webpackChunkName: &quot;my-component&quot; */697)); }).bind(null, __webpack_require__)).catch(__webpack_require__.oe); }); // __webpack_require__.oe (On Error) __webpack_require__.oe = function(err) { console.error(err); throw err; };"><pre class="notranslate"><code class="notranslate">// var prom = import('./my-component) var prom = new Promise(function (resolve) { __webpack_require__.e/* require.ensure */(1).then((function (require) { resolve(__webpack_require__( /* webpackChunkName: "my-component" */697)); }).bind(null, __webpack_require__)).catch(__webpack_require__.oe); }); // __webpack_require__.oe (On Error) __webpack_require__.oe = function(err) { console.error(err); throw err; }; </code></pre></div> <p dir="auto">Please let me know if I'm missing something, maybe in the configuration, or if this is really a bug.</p>
1
<p dir="auto"><strong>TypeScript Version:</strong></p> <p dir="auto">1.8.10</p> <p dir="auto"><strong>Code</strong></p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import Symbol from './Symbol'; export interface Iterable&lt;T&gt; { [Symbol.iterator](): Iterator&lt;T&gt;; }"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-smi">Symbol</span> <span class="pl-k">from</span> <span class="pl-s">'./Symbol'</span><span class="pl-kos">;</span> <span class="pl-k">export</span> <span class="pl-k">interface</span> <span class="pl-smi">Iterable</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span> <span class="pl-kos">[</span><span class="pl-smi">Symbol</span><span class="pl-kos">.</span><span class="pl-c1">iterator</span><span class="pl-kos">]</span><span class="pl-kos">(</span><span class="pl-kos">)</span>: <span class="pl-smi">Iterator</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">&gt;</span><span class="pl-kos">;</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">In Dojo 2, <a href="https://github.com/dojo/core/blob/master/src/Symbol.ts#L164">we provide a shim for <code class="notranslate">Symbol</code></a>. One of the things we have decided to do as a matter of principal is not modify the global namespace with any of our shims, but provide them as modules where the consumer has to make an explicit dependency on that shim. At runtime, we offload to the native API if present, otherwise we provide replicate functionality.</p> <p dir="auto">This pattern works effectively, even when targeting ES6, except for <code class="notranslate">Symbol</code> because of the TypeScript's compiler's insistence that we reference the native one.</p> <p dir="auto">Is there a good reason why TypeScript disallows this when targeting ES6? If so, is there any way to provide a transparent shim without modifying the global namespace anyone can think of?</p> <p dir="auto"><strong>Expected behavior:</strong></p> <p dir="auto">No errors when targeting <code class="notranslate">es6</code>.</p> <p dir="auto"><strong>Actual behavior:</strong></p> <p dir="auto">When target is <code class="notranslate">es6</code> we get the following error:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="'Symbol' reference does not refer to the global Symbol constructor object."><pre class="notranslate"><code class="notranslate">'Symbol' reference does not refer to the global Symbol constructor object. </code></pre></div>
<p dir="auto"><strong>TypeScript Version:</strong></p> <p dir="auto">1.7.5 / 1.8.0-beta / nightly (1.9.0-dev.20160217)</p> <p dir="auto"><strong>Code</strong></p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// try augmenting the SymbolContructor to have some expected symbol on it. // in RxJS5's case, it'll be the Symbol.observable symbol from the es-observable spec. interface SymbolConstructor { observable: symbol; } interface Observablesque&lt;T&gt; { [Symbol.observable]: () =&gt; Subscribable&lt;T&gt; }"><pre class="notranslate"><span class="pl-c">// try augmenting the SymbolContructor to have some expected symbol on it.</span> <span class="pl-c">// in RxJS5's case, it'll be the Symbol.observable symbol from the es-observable spec.</span> <span class="pl-k">interface</span> <span class="pl-smi">SymbolConstructor</span> <span class="pl-kos">{</span> <span class="pl-c1">observable</span>: <span class="pl-smi">symbol</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">interface</span> <span class="pl-smi">Observablesque</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span> <span class="pl-kos">[</span><span class="pl-smi">Symbol</span><span class="pl-kos">.</span><span class="pl-c1">observable</span><span class="pl-kos">]</span>: <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi">Subscribable</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">&gt;</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">or</p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// try importing some symbol reference (I get why this might not work) import {$$observable} from './symbol/observable'; interface Observablesque&lt;T&gt; { [$$observable]: () =&gt; Subscribable&lt;T&gt; }"><pre class="notranslate"><span class="pl-c">// try importing some symbol reference (I get why this might not work)</span> <span class="pl-k">import</span> <span class="pl-kos">{</span><span class="pl-s1">$$observable</span><span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'./symbol/observable'</span><span class="pl-kos">;</span> <span class="pl-k">interface</span> <span class="pl-smi">Observablesque</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span> <span class="pl-kos">[</span><span class="pl-s1">$$observable</span><span class="pl-kos">]</span>: <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi">Subscribable</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">&gt;</span> <span class="pl-kos">}</span></pre></div> <p dir="auto"><strong>Expected behavior:</strong></p> <p dir="auto">I should be able to enforce types that have symbols on them, custom or otherwise.</p> <p dir="auto"><strong>Actual behavior:</strong></p> <p dir="auto">I get really confused and go get myself a coffee.</p>
1
<h3 dir="auto">System info</h3> <ul dir="auto"> <li>Playwright Version: [v1.35]</li> <li>Operating System: [Windows]</li> <li>Browser: [Edge]</li> <li>Other info:</li> </ul> <h3 dir="auto">Source code</h3> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I provided exact source code that allows reproducing the issue locally.<br> The code of a simple page</li> </ul> <div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;html&gt; &lt;body&gt; THING &lt;img src=&quot;api/myImage.png&quot;/&gt; &lt;/body&gt; &lt;/html&gt;"><pre class="notranslate"><span class="pl-kos">&lt;</span><span class="pl-ent">html</span><span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">body</span><span class="pl-kos">&gt;</span> THING <span class="pl-kos">&lt;</span><span class="pl-ent">img</span> <span class="pl-c1">src</span>="<span class="pl-s">api/myImage.png</span>"/&gt; <span class="pl-kos">&lt;/</span><span class="pl-ent">body</span><span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;/</span><span class="pl-ent">html</span><span class="pl-kos">&gt;</span></pre></div> <p dir="auto">That end up with the following image in playwright because I try to mock my api and it's not up<br> <a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/3164314/252685402-3b7a41c0-9796-4ede-a811-fb979ea91f93.png"><img src="https://user-images.githubusercontent.com/3164314/252685402-3b7a41c0-9796-4ede-a811-fb979ea91f93.png" alt="image" style="max-width: 100%;"></a></p> <p dir="auto">with my following test, only a 404 explaining my image can't be found (normal)</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="test(&quot;TEST&quot;, async ({ page }) =&gt; { await page.goto('index.html'); })"><pre class="notranslate"><span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">"TEST"</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> page <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">goto</span><span class="pl-kos">(</span><span class="pl-s">'index.html'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p dir="auto"><strong>Link to the GitHub repository with the repro</strong></p> <p dir="auto">[https://github.com/your_profile/playwright_issue_title]</p> <p dir="auto">or</p> <p dir="auto"><strong>Config file</strong></p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// playwright.config.ts import { defineConfig, devices } from '@playwright/test'; export default defineConfig({ projects: [ { name: 'Microsoft Edge', use: { ...devices['Desktop Edge'], channel: 'msedge', baseURL: 'http://localhost:4200/' }, } });"><pre class="notranslate"><span class="pl-c">// playwright.config.ts</span> <span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">defineConfig</span><span class="pl-kos">,</span> <span class="pl-s1">devices</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'@playwright/test'</span><span class="pl-kos">;</span> <span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-en">defineConfig</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">projects</span>: <span class="pl-kos">[</span> <span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-s">'Microsoft Edge'</span><span class="pl-kos">,</span> <span class="pl-c1">use</span>: <span class="pl-kos">{</span> ...<span class="pl-s1">devices</span><span class="pl-kos">[</span><span class="pl-s">'Desktop Edge'</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-c1">channel</span>: <span class="pl-s">'msedge'</span><span class="pl-kos">,</span> <span class="pl-c1">baseURL</span>: <span class="pl-s">'http://localhost:4200/'</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos"></span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p dir="auto"><strong>Test file (self-contained)</strong></p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { test } from '@playwright/test'; test(&quot;TEST&quot;, async ({ page }) =&gt; { await page.route(`/api/myImage.png`, async route =&gt; { await route.fulfill({ status: 200, path: &quot;screenshot.png&quot;, }); }); await page.goto('index.html'); })"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">test</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'@playwright/test'</span><span class="pl-kos">;</span> <span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">"TEST"</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> page <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">route</span><span class="pl-kos">(</span><span class="pl-s">`/api/myImage.png`</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-s1">route</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-k">await</span> <span class="pl-s1">route</span><span class="pl-kos">.</span><span class="pl-en">fulfill</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">status</span>: <span class="pl-c1">200</span><span class="pl-kos">,</span> <span class="pl-c1">path</span>: <span class="pl-s">"screenshot.png"</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">goto</span><span class="pl-kos">(</span><span class="pl-s">'index.html'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p dir="auto"><strong>Steps</strong></p> <ul dir="auto"> <li>[Run the test]</li> <li>[...]</li> </ul> <p dir="auto"><strong>Expected</strong><br> The image is mocked and screenshot.png is displayed on the interface</p> <p dir="auto"><strong>Actual</strong></p> <p dir="auto">The image is not displayed on my interface, and the interface of my web app doesn't display anymore<br> page.goto: Navigation failed because page was closed!</p> <p dir="auto">navigating to "<a href="http://localhost:8080/index.html" rel="nofollow">http://localhost:8080/index.html</a>", waiting until "load"</p>
<p dir="auto">It would be great to be able to use pattern well adopted in React Testing Library tests - a custom render function which contains wrappers required by each component (ie. providers). Let's take a look at the example:</p> <div class="highlight highlight-source-tsx notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// Button.test.tsx import { test as base, expect } from '@playwright/experimental-ct-react'; import { CustomWrapper } from 'src/CustomWrapper'; import { Button } from './Button'; const test = base.extend({ mount: async ({ mount: baseMount }, use) =&gt; { const mount: typeof baseMount = (component) =&gt; baseMount(&lt;CustomWrapper&gt;{component}&lt;/CustomWrapper&gt;); await use(mount); } }) test('works', async ({ mount }) =&gt; { const component = await mount(&lt;Button&gt;a button&lt;/Button&gt;); await expect(await component.screenshot()).toMatchSnapshot(); })"><pre class="notranslate"><span class="pl-c">// Button.test.tsx</span> <span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">test</span> <span class="pl-k">as</span> <span class="pl-s1">base</span><span class="pl-kos">,</span> <span class="pl-s1">expect</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'@playwright/experimental-ct-react'</span><span class="pl-kos">;</span> <span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-smi">CustomWrapper</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'src/CustomWrapper'</span><span class="pl-kos">;</span> <span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-smi">Button</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'./Button'</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">test</span> <span class="pl-c1">=</span> <span class="pl-s1">base</span><span class="pl-kos">.</span><span class="pl-en">extend</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-en">mount</span>: <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">mount</span>: <span class="pl-s1">baseMount</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s1">use</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-k">const</span> <span class="pl-en">mount</span>: <span class="pl-k">typeof</span> <span class="pl-s1">baseMount</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-s1">component</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-en">baseMount</span><span class="pl-kos">(</span><span class="pl-c1">&lt;</span><span class="pl-smi">CustomWrapper</span><span class="pl-c1">&gt;</span><span class="pl-kos">{</span><span class="pl-s1">component</span><span class="pl-kos">}</span><span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-smi">CustomWrapper</span><span class="pl-c1">&gt;</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">await</span> <span class="pl-en">use</span><span class="pl-kos">(</span><span class="pl-s1">mount</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">'works'</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> mount <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-k">const</span> <span class="pl-s1">component</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-en">mount</span><span class="pl-kos">(</span><span class="pl-c1">&lt;</span><span class="pl-smi">Button</span><span class="pl-c1">&gt;</span>a button<span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-smi">Button</span><span class="pl-c1">&gt;</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">await</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-k">await</span> <span class="pl-s1">component</span><span class="pl-kos">.</span><span class="pl-en">screenshot</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toMatchSnapshot</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p dir="auto">The above example works, because everything is implemented within the test module. This pattern, however, is not working when extracting extended <code class="notranslate">test</code> object to a separate module like so:</p> <div class="highlight highlight-source-tsx notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// componentTest.tsx import { test as base } from '@playwright/experimental-ct-react'; import { CustomWrapper } from 'src/CustomWrapper'; const test = base.extend({ mount: async ({ mount: baseMount }, use) =&gt; { const mount: typeof baseMount = (component) =&gt; baseMount(&lt;CustomWrapper&gt;{component}&lt;/CustomWrapper&gt;); await use(mount); } }) export * from '@playwright/experimental-ct-react'; export { test };"><pre class="notranslate"><span class="pl-c">// componentTest.tsx</span> <span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">test</span> <span class="pl-k">as</span> <span class="pl-s1">base</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'@playwright/experimental-ct-react'</span><span class="pl-kos">;</span> <span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-smi">CustomWrapper</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'src/CustomWrapper'</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">test</span> <span class="pl-c1">=</span> <span class="pl-s1">base</span><span class="pl-kos">.</span><span class="pl-en">extend</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-en">mount</span>: <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">mount</span>: <span class="pl-s1">baseMount</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s1">use</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-k">const</span> <span class="pl-en">mount</span>: <span class="pl-k">typeof</span> <span class="pl-s1">baseMount</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-s1">component</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-en">baseMount</span><span class="pl-kos">(</span><span class="pl-c1">&lt;</span><span class="pl-smi">CustomWrapper</span><span class="pl-c1">&gt;</span><span class="pl-kos">{</span><span class="pl-s1">component</span><span class="pl-kos">}</span><span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-smi">CustomWrapper</span><span class="pl-c1">&gt;</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">await</span> <span class="pl-en">use</span><span class="pl-kos">(</span><span class="pl-s1">mount</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-k">export</span> <span class="pl-c1">*</span> <span class="pl-k">from</span> <span class="pl-s">'@playwright/experimental-ct-react'</span><span class="pl-kos">;</span> <span class="pl-k">export</span> <span class="pl-kos">{</span> <span class="pl-s1">test</span> <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div> <div class="highlight highlight-source-tsx notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// Button.test.tsx import { test, expect } from 'src/componentTest'; // &lt;----- this imports resolve to strings import { Button } from './Button'; test('works', async ({ mount }) =&gt; { const component = await mount(&lt;Button&gt;a button&lt;/Button&gt;); await expect(await component.screenshot()).toMatchSnapshot(); })"><pre class="notranslate"><span class="pl-c">// Button.test.tsx</span> <span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">test</span><span class="pl-kos">,</span> <span class="pl-s1">expect</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'src/componentTest'</span><span class="pl-kos">;</span> <span class="pl-c">// &lt;----- this imports resolve to strings</span> <span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-smi">Button</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'./Button'</span><span class="pl-kos">;</span> <span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">'works'</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> mount <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-k">const</span> <span class="pl-s1">component</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-en">mount</span><span class="pl-kos">(</span><span class="pl-c1">&lt;</span><span class="pl-smi">Button</span><span class="pl-c1">&gt;</span>a button<span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-smi">Button</span><span class="pl-c1">&gt;</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">await</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-k">await</span> <span class="pl-s1">component</span><span class="pl-kos">.</span><span class="pl-en">screenshot</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toMatchSnapshot</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p dir="auto">I assume this is due to custom <code class="notranslate">tsxTransform.ts</code> that keeps track of every component/jsx module that is imported within test module.</p> <p dir="auto">SIDE NOTE: Even though I can't really figure out if it's possible to easily workaround this, in order to actually be able to test I found a hacky way to achieve this result by monkey-patching <code class="notranslate">react-dom</code> like so:</p> <div class="highlight highlight-source-tsx notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// react-dom.patched.tsx import _ReactDOM from '../node_modules/react-dom'; import { CustomWrapper } from './CustomWrapper'; const ReactDOM = Object.create(_ReactDOM); ReactDOM.render = (children, el) =&gt; _ReactDOM.render(&lt;CustomWrapper&gt;{children}&lt;/CustomWrapper&gt;, el); export default ReactDOM;"><pre class="notranslate"><span class="pl-c">// react-dom.patched.tsx</span> <span class="pl-k">import</span> <span class="pl-s1">_ReactDOM</span> <span class="pl-k">from</span> <span class="pl-s">'../node_modules/react-dom'</span><span class="pl-kos">;</span> <span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-smi">CustomWrapper</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'./CustomWrapper'</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-smi">ReactDOM</span> <span class="pl-c1">=</span> <span class="pl-smi">Object</span><span class="pl-kos">.</span><span class="pl-en">create</span><span class="pl-kos">(</span><span class="pl-s1">_ReactDOM</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-smi">ReactDOM</span><span class="pl-kos">.</span><span class="pl-en">render</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-s1">children</span><span class="pl-kos">,</span> <span class="pl-s1">el</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-s1">_ReactDOM</span><span class="pl-kos">.</span><span class="pl-en">render</span><span class="pl-kos">(</span><span class="pl-c1">&lt;</span><span class="pl-smi">CustomWrapper</span><span class="pl-c1">&gt;</span><span class="pl-kos">{</span><span class="pl-s1">children</span><span class="pl-kos">}</span><span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-smi">CustomWrapper</span><span class="pl-c1">&gt;</span><span class="pl-kos">,</span> <span class="pl-s1">el</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-smi">ReactDOM</span><span class="pl-kos">;</span></pre></div> <p dir="auto">and then I alias <code class="notranslate">react-dom</code> in Vite configuration that is passed to Playwright.</p> <p dir="auto">What do you guys think about it?</p>
0
<p dir="auto">by <strong>vladimir.webdev</strong>:</p> <pre class="notranslate">Complete code to reproduce: package main import ( "fmt" "websocket" ) func openConn(ch chan&lt;- int) { ws, err := websocket.Dial("ws://localhost:9999/", "", "http:// localhost/") if err != nil { fmt.Sprintf("Dial: " + err.String()) } defer ws.Close() ch &lt;- 1 } func main() { ch := make(chan int) for i := 0; i &lt; 1000; i++ { go openConn(ch) } ch &lt;- 1 } It fails with: runtime/cgo: pthread_create failed: Resource temporarily unavailable SIGABRT: abort PC=0xf97422 Discussion: <a href="http://groups.google.com/group/golang-nuts/browse_thread/thread/520bdb93d99ee536/a1fdd8c8640cce46#a1fdd8c8640cce46" rel="nofollow">http://groups.google.com/group/golang-nuts/browse_thread/thread/520bdb93d99ee536/a1fdd8c8640cce46#a1fdd8c8640cce46</a> Quote from [email protected]: The websocket.Dial function is (indirectly) using cgo. Each cgo call behaves like a syscall. The websocket.Dial() function will try to allocate C memory when performing address lookup - the memory allocation (a cgo call) causes the Go runtime to create another OS thread to handle goroutines. An OS thread (presumably, the newly created one) calls websocket.Dial() from another goroutine created by your program, and tries to allocate another piece of C memory, which in turn creates another OS thread. This ends up creating too many OS threads.</pre>
<p dir="auto">by <strong><a href="mailto:[email protected]">[email protected]</a></strong>:</p> <pre class="notranslate">What steps will reproduce the problem? 1. use amd64 OpenBSD-current 1. checkout current tip 2. run the src/all.bash script with bash What is the expected output? go builds. What do you see instead? Most of the time, the compiler hangs while building the "math" or the "regex" package. But sometimes I get an error instead: # Building packages and commands for openbsd/amd64. runtime errors sync/atomic unicode math runtime: split stack overflow: 0x20c8bfe78 &lt; 0x20c8c0000 throw: runtime: split stack overflow goroutine 1 [syscall]: goroutine 2 [chan receive]: main.(*builder).do(0xf8400a9210, 0xf8400a9160, 0xf8400d2c40, 0xf8400a96e0) /home/tobias/src/go/src/cmd/go/build.go:532 +0x3ed main.runInstall(0x691070, 0xf840054230, 0x100000001, 0x0) /home/tobias/src/go/src/cmd/go/build.go:180 +0x1cc main.main() /home/tobias/src/go/src/cmd/go/main.go:132 +0x2d8 created by _rt0_amd64 /home/tobias/src/go/src/pkg/runtime/asm_amd64.s:69 +0xd1 goroutine 3 [runnable]: syscall.Syscall6() /home/tobias/src/go/src/pkg/syscall/asm_openbsd_amd64.s:57 +0x61 syscall.wait4(0x248c, 0xf8401941c0, 0x0, 0xf84010cf30, 0x1, ...) /home/tobias/src/go/src/pkg/syscall/zsyscall_openbsd_amd64.go:32 +0x81 syscall.Wait4(0x248c, 0x20c8bf584, 0xf800000000, 0xf84010cf30, 0xf840087d80, ...) /home/tobias/src/go/src/pkg/syscall/syscall_bsd.go:136 +0x6a os.(*Process).Wait(0xf8402254a0, 0x20c8bf660, 0x0, 0x0, 0xf840225c40, ...) /home/tobias/src/go/src/pkg/os/exec_unix.go:24 +0xe1 os/exec.(*Cmd).Wait(0xf840236600, 0x0, 0x0, 0x0) /home/tobias/src/go/src/pkg/os/exec/exec.go:294 +0x1ba os/exec.(*Cmd).Run(0xf840236600, 0x55ce08, 0xf840087d20, 0xf8401da690) /home/tobias/src/go/src/pkg/os/exec/exec.go:220 +0x6d main.(*builder).runOut(0xf8400a9210, 0xf8400c6900, 0x22, 0xf840187e91, 0x200000006, ...) /home/tobias/src/go/src/cmd/go/build.go:963 +0x17e main.(*builder).run(0xf8400a9210, 0xf8400c6900, 0x22, 0xf840187e91, 0x6, ...) /home/tobias/src/go/src/cmd/go/build.go:930 +0x8d main.goToolchain.gc(0xf8400a9210, 0xf8400d2540, 0xf840112720, 0x200000023, 0xf840225be0, ...) /home/tobias/src/go/src/cmd/go/build.go:1056 +0x782 main.goToolchain.gc·i(0x0, 0xf8400a9210, 0xf8400d2540, 0xf840112720, 0x100000023, ...) /home/tobias/src/go/src/cmd/go/bootstrap.go:0 +0xce main.(*builder).build(0x43d0b7, 0xf8401192c0, 0xf8402ca1c0, 0x0, 0x206, ...) /home/tobias/src/go/src/cmd/go/build.go:604 +0x8aa created by main.(*builder).do /home/tobias/src/go/src/cmd/go/build.go:529 +0x3bf goroutine 4 [runnable]: syscall.Syscall() /home/tobias/src/go/src/pkg/syscall/asm_openbsd_amd64.s:34 +0x5b syscall.Open(0x5a01f4, 0x9, 0x10000, 0xf840194320, 0x0, ...) /home/tobias/src/go/src/pkg/syscall/zsyscall_openbsd_amd64.go:738 +0x71 os.OpenFile(0x5a01f4, 0x100000009, 0x0, 0xf8402ecc00, 0x0, ...) /home/tobias/src/go/src/pkg/os/file_unix.go:66 +0x67 os.Open(0x5a01f4, 0x7665642f00000009, 0x2050d5fb0, 0x0, 0x0, ...) /home/tobias/src/go/src/pkg/os/file.go:230 +0x54 os/exec.(*Cmd).stdin(0xf8402cb200, 0x0, 0x0, 0x0, 0x1d000001c0, ...) /home/tobias/src/go/src/pkg/os/exec/exec.go:145 +0x8a os/exec.(*Cmd).Start(0xf8402cb200, 0x0, 0x0, 0x20c8c0700) /home/tobias/src/go/src/pkg/os/exec/exec.go:234 +0x1fb os/exec.(*Cmd).Run(0xf8402cb200, 0x55ce08, 0xf8403a2b40, 0xf8401da690) /home/tobias/src/go/src/pkg/os/exec/exec.go:217 +0x25 main.(*builder).runOut(0xf8400a9210, 0xf8401a6ed0, 0x20, 0xf84007a989, 0x200000004, ...) /home/tobias/src/go/src/cmd/go/build.go:963 +0x17e main.(*builder).run(0xf8400a9210, 0xf8401a6ed0, 0x20, 0xf84007a989, 0x4, ...) /home/tobias/src/go/src/cmd/go/build.go:930 +0x8d main.goToolchain.gc(0xf8400a9210, 0xf8401068c0, 0xf8400c4660, 0x200000021, 0xf840233c80, ...) /home/tobias/src/go/src/cmd/go/build.go:1056 +0x782 main.goToolchain.gc·i(0x0, 0xf8400a9210, 0xf8401068c0, 0xf8400c4660, 0x200000021, ...) /home/tobias/src/go/src/cmd/go/bootstrap.go:0 +0xce main.(*builder).build(0xf8400a9210, 0xf8402d9840, 0x20c8c0f00, 0x40fda2, 0x4fdb78, ...) /home/tobias/src/go/src/cmd/go/build.go:604 +0x8aa main._func_004(0xf840147d98, 0xf840147da0, 0xf840147db8, 0x427c60, 0xf8402d9840, ...) /home/tobias/src/go/src/cmd/go/build.go:478 +0x2ff main._func_005(0xf840147d98, 0xf840147238, 0x0, 0x0) /home/tobias/src/go/src/cmd/go/build.go:527 +0xc0 created by main.(*builder).do /home/tobias/src/go/src/cmd/go/build.go:529 +0x3bf goroutine 5 [syscall]: syscall.Syscall6() /home/tobias/src/go/src/pkg/syscall/asm_openbsd_amd64.s:38 +0x5 syscall.wait4(0x610d, 0xf840194420, 0x0, 0xf8402c7090, 0x1, ...) /home/tobias/src/go/src/pkg/syscall/zsyscall_openbsd_amd64.go:32 +0x81 syscall.Wait4(0x610d, 0x20c8c1584, 0xf800000000, 0xf8402c7090, 0xf8403a2d20, ...) /home/tobias/src/go/src/pkg/syscall/syscall_bsd.go:136 +0x6a os.(*Process).Wait(0xf840225660, 0x20c8c1660, 0x0, 0x0, 0xf8402259c0, ...) /home/tobias/src/go/src/pkg/os/exec_unix.go:24 +0xe1 os/exec.(*Cmd).Wait(0xf840236700, 0x0, 0x0, 0x0) /home/tobias/src/go/src/pkg/os/exec/exec.go:294 +0x1ba os/exec.(*Cmd).Run(0xf840236700, 0x55ce08, 0xf840087060, 0xf8401da690) /home/tobias/src/go/src/pkg/os/exec/exec.go:220 +0x6d main.(*builder).runOut(0xf8400a9210, 0xf8400edf60, 0x27, 0xf8401878a1, 0x20000000b, ...) /home/tobias/src/go/src/cmd/go/build.go:963 +0x17e main.(*builder).run(0xf8400a9210, 0xf8400edf60, 0x27, 0xf8401878a1, 0xb, ...) /home/tobias/src/go/src/cmd/go/build.go:930 +0x8d main.goToolchain.gc(0xf8400a9210, 0xf840106000, 0xf8401feb10, 0x200000028, 0xf840225900, ...) /home/tobias/src/go/src/cmd/go/build.go:1056 +0x782 main.goToolchain.gc·i(0x0, 0xf8400a9210, 0xf840106000, 0xf8401feb10, 0x200000028, ...) /home/tobias/src/go/src/cmd/go/bootstrap.go:0 +0xce main.(*builder).build(0xf8400a9210, 0xf8402d9000, 0x20c8c1f00, 0x40fda2, 0x4fdb78, ...) /home/tobias/src/go/src/cmd/go/build.go:604 +0x8aa main._func_004(0xf840147d98, 0xf840147da0, 0xf840147db8, 0x427c60, 0xf8402d9000, ...) /home/tobias/src/go/src/cmd/go/build.go:478 +0x2ff main._func_005(0xf840147d98, 0xf840147238, 0x0, 0x0) /home/tobias/src/go/src/cmd/go/build.go:527 +0xc0 created by main.(*builder).do /home/tobias/src/go/src/cmd/go/build.go:529 +0x3bf goroutine 6 [runnable]: syscall.Syscall() /home/tobias/src/go/src/pkg/syscall/asm_openbsd_amd64.s:34 +0x5b syscall.Close(0x8, 0x0, 0x0, 0xf8402a3000) /home/tobias/src/go/src/pkg/syscall/zsyscall_openbsd_amd64.go:337 +0x54 syscall.forkExec(0xf840355810, 0xf80000002d, 0xf8402cb100, 0x100000000c, 0xf840260980, ...) /home/tobias/src/go/src/pkg/syscall/exec_unix.go:173 +0x492 syscall.StartProcess(0xf840355810, 0xf80000002d, 0xf8402cb100, 0x100000000c, 0xf840260980, ...) /home/tobias/src/go/src/pkg/syscall/exec_unix.go:212 +0x76 os.StartProcess(0xf840355810, 0x2d, 0xf8402cb100, 0x100000000c, 0xf8402aee00, ...) /home/tobias/src/go/src/pkg/os/exec_posix.go:43 +0x307 os/exec.(*Cmd).Start(0xf8402cb000, 0x0, 0x0, 0x20c8c2700) /home/tobias/src/go/src/pkg/os/exec/exec.go:248 +0x4a7 os/exec.(*Cmd).Run(0xf8402cb000, 0x55ce08, 0xf8402cfcc0, 0xf8401da690) /home/tobias/src/go/src/pkg/os/exec/exec.go:217 +0x25 main.(*builder).runOut(0xf8400a9210, 0xf8400ed4e0, 0x23, 0xf840187aa1, 0x200000007, ...) /home/tobias/src/go/src/cmd/go/build.go:963 +0x17e main.(*builder).run(0xf8400a9210, 0xf8400ed4e0, 0x23, 0xf840187aa1, 0x7, ...) /home/tobias/src/go/src/cmd/go/build.go:930 +0x8d main.goToolchain.gc(0xf8400a9210, 0xf8401061c0, 0xf8401bb240, 0x200000024, 0xf8402255a0, ...) /home/tobias/src/go/src/cmd/go/build.go:1056 +0x782 main.goToolchain.gc·i(0x0, 0xf8400a9210, 0xf8401061c0, 0xf8401bb240, 0x100000024, ...) /home/tobias/src/go/src/cmd/go/bootstrap.go:0 +0xce main.(*builder).build(0xf8400a9210, 0xf8402d92c0, 0x20c8c2f00, 0x40fda2, 0x4fdb78, ...) /home/tobias/src/go/src/cmd/go/build.go:604 +0x8aa main._func_004(0xf840147d98, 0xf840147da0, 0xf840147db8, 0x427c60, 0xf8402d92c0, ...) /home/tobias/src/go/src/cmd/go/build.go:478 +0x2ff main._func_005(0xf840147d98, 0xf840147238, 0x0, 0x0) /home/tobias/src/go/src/cmd/go/build.go:527 +0xc0 created by main.(*builder).do /home/tobias/src/go/src/cmd/go/build.go:529 +0x3bf goroutine 49 [runnable]: syscall.Syscall() /home/tobias/src/go/src/pkg/syscall/asm_openbsd_amd64.s:34 +0x5b syscall.Read(0x5, 0xf840191800, 0x20000000200, 0x0, 0x0, ...) /home/tobias/src/go/src/pkg/syscall/zsyscall_openbsd_amd64.go:800 +0x78 os.(*File).read(0xf840194148, 0xf840191800, 0x20000000200, 0x500b48, 0x0, ...) /home/tobias/src/go/src/pkg/os/file_unix.go:163 +0x58 os.(*File).Read(0xf840194148, 0xf840191800, 0x20000000200, 0x0, 0x0, ...) /home/tobias/src/go/src/pkg/os/file.go:95 +0x83 bytes.(*Buffer).ReadFrom(0xf840087d20, 0xf8400b2090, 0xf840194148, 0x0, 0x0, ...) /home/tobias/src/go/src/pkg/bytes/buffer.go:153 +0x199 io.Copy(0xf8401da690, 0xf840087d20, 0xf8400b2090, 0xf840194148, 0x0, ...) /home/tobias/src/go/src/pkg/io/io.go:333 +0xc2 os/exec._func_003(0xf840288130, 0xf840194138, 0x463656, 0x500ed0, 0x4391e2, ...) /home/tobias/src/go/src/pkg/os/exec/exec.go:201 +0x5a os/exec._func_004(0xf840194118, 0xf84028df80, 0x0, 0x0) /home/tobias/src/go/src/pkg/os/exec/exec.go:260 +0x1e created by os/exec.(*Cmd).Start /home/tobias/src/go/src/pkg/os/exec/exec.go:261 +0x661 goroutine 50 [runnable]: syscall.Syscall() /home/tobias/src/go/src/pkg/syscall/asm_openbsd_amd64.s:34 +0x5b syscall.Read(0x7, 0xf840091000, 0x20000000200, 0x0, 0x0, ...) /home/tobias/src/go/src/pkg/syscall/zsyscall_openbsd_amd64.go:800 +0x78 os.(*File).read(0xf840194238, 0xf840091000, 0x20000000200, 0x500b48, 0x0, ...) /home/tobias/src/go/src/pkg/os/file_unix.go:163 +0x58 os.(*File).Read(0xf840194238, 0xf840091000, 0x20000000200, 0x0, 0x0, ...) /home/tobias/src/go/src/pkg/os/file.go:95 +0x83 bytes.(*Buffer).ReadFrom(0xf840087060, 0xf8400b2090, 0xf840194238, 0x0, 0x0, ...) /home/tobias/src/go/src/pkg/bytes/buffer.go:153 +0x199 io.Copy(0xf8401da690, 0xf840087060, 0xf8400b2090, 0xf840194238, 0x0, ...) /home/tobias/src/go/src/pkg/io/io.go:333 +0xc2 os/exec._func_003(0xf840288500, 0xf840194228, 0x463656, 0xf0, 0x401e6f78, ...) /home/tobias/src/go/src/pkg/os/exec/exec.go:201 +0x5a os/exec._func_004(0xf8401941b0, 0xf8402abc80, 0x0, 0x0) /home/tobias/src/go/src/pkg/os/exec/exec.go:260 +0x1e created by os/exec.(*Cmd).Start /home/tobias/src/go/src/pkg/os/exec/exec.go:261 +0x661 Which operating system are you using? OpenBSD-current (5.1 beta, current publicly available snapshot will do it) <a href="http://ftp.openbsd.org/pub/OpenBSD/snapshots/amd64/" rel="nofollow">http://ftp.openbsd.org/pub/OpenBSD/snapshots/amd64/</a> Which revision are you using? (hg identify) $ hg identify a45cc1950c26 tip</pre>
0
<p dir="auto">I'm not hugely familiar with CLI standards, but I don't think I've ever run in to the requirement that --flags precede the positional arguments. I spent a long while trying to get <code class="notranslate">--allow-net</code> to work before realising this was necessary.</p> <p dir="auto"><code class="notranslate">deno run --allow-net something.ts</code> vs <code class="notranslate">deno run something.ts --allow-net</code></p> <p dir="auto">Is there any reason not to support both forms?</p> <p dir="auto">Alternately, a warning that the arguments were being ignored as invalid would have helped me understand.</p>
<p dir="auto">The order of the CLI flags should not be of importance. Check this example</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/6124435/62263509-c9d87180-b41c-11e9-8da9-b683316e0ad7.png"><img src="https://user-images.githubusercontent.com/6124435/62263509-c9d87180-b41c-11e9-8da9-b683316e0ad7.png" alt="image" style="max-width: 100%;"></a></p> <p dir="auto">Shouldn't</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" deno test.ts --config tsconfig.json"><pre class="notranslate"><code class="notranslate"> deno test.ts --config tsconfig.json </code></pre></div> <p dir="auto">be the same as</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="deno --config tsconfig.json test.ts"><pre class="notranslate"><code class="notranslate">deno --config tsconfig.json test.ts </code></pre></div> <p dir="auto">or maybe I'm wrong?</p>
1
<h3 dir="auto">Is there an existing issue for this?</h3> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the existing issues</li> </ul> <h3 dir="auto">This issue exists in the latest npm version</h3> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I am using the latest npm</li> </ul> <h3 dir="auto">Current Behavior</h3> <p dir="auto">I am unable to install angular CLI after changes <code class="notranslate">--location=global</code> in node module.</p> <p dir="auto">Please look i this issue</p> <h3 dir="auto">Expected Behavior</h3> <p dir="auto">NPM should be installed without any error and support Angular CLI to install</p> <h3 dir="auto">Steps To Reproduce</h3> <ol dir="auto"> <li>In this environment...</li> <li>With this config...</li> <li>Run '...'</li> <li>See error...</li> </ol> <h3 dir="auto">Environment</h3> <ul dir="auto"> <li>npm: 8.11</li> <li>Node.js: 16.16</li> <li>OS Name: Window 10</li> <li>System Model Name:</li> <li>npm config:</li> </ul> <div class="highlight highlight-source-ini notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="; copy and paste output from `npm config ls` here"><pre class="notranslate"><span class="pl-c"><span class="pl-c">;</span> copy and paste output from `npm config ls` here</span></pre></div>
<h3 dir="auto">Is there an existing issue for this?</h3> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the existing issues</li> </ul> <h3 dir="auto">This issue exists in the latest npm version</h3> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I am using the latest npm</li> </ul> <h3 dir="auto">Current Behavior</h3> <p dir="auto">current version of npm (8.11.0, node 16.15.1) writes a warning to STDERR on every command, that is a warning about using deprecated options. The message is...</p> <p dir="auto"><code class="notranslate">npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.</code></p> <p dir="auto">The message is written to STDERR regardless of whether or not the command run uses the --global or --local options. For example, the command...</p> <p dir="auto">npm -v</p> <p dir="auto">outputs the message, even though -v is the only option used, and writes to STDERR, even though it states it's purpose to be a warning, not an error, and the command still executes successfully.</p> <p dir="auto">The result for my organization is to break our nightly builds. Our builds need to monitor STDERR for REAL build errors, which also use STDERR to capture a variety of aberrant build conditions including security vulnerabilities that are reported back to the build pipeline via STDERR in a script that runs "npm audit" and analyzes the results.</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/18708621/171736746-431947f2-430d-4b29-b33f-c84284757d21.png"><img src="https://user-images.githubusercontent.com/18708621/171736746-431947f2-430d-4b29-b33f-c84284757d21.png" alt="npm-warn" style="max-width: 100%;"></a></p> <h3 dir="auto">Expected Behavior</h3> <p dir="auto">IMHO, this warning should only be written if the deprecated options are used, and should be written to STDOUT since it is not an error, just a warning.</p> <h3 dir="auto">Steps To Reproduce</h3> <ol dir="auto"> <li>In Windows...</li> <li>Running node 16.15.1 and npm 8.11.0</li> <li>Run any npm command, i.e. npm -v</li> <li>See results...<br> <a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/18708621/171734613-188a0d55-ad69-4b02-b7d0-26f1e15320d5.png"><img src="https://user-images.githubusercontent.com/18708621/171734613-188a0d55-ad69-4b02-b7d0-26f1e15320d5.png" alt="npm output" style="max-width: 100%;"></a></li> </ol> <h3 dir="auto">Environment</h3> <ul dir="auto"> <li>npm: 8.11.0</li> <li>Node.js: 16.15.1</li> <li>OS Name: Windows 10</li> <li>System Model Name: Dell Precision 5500 series</li> <li>npm config:</li> </ul> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="; &quot;user&quot; config from C:\Users\xxxx\.npmrc cafile = &quot;C:\\cert\\OGS_int_CA.pem&quot; ; node bin location = C:\Program Files\nodejs\node.exe ; node version = v16.15.1 ; npm local prefix = C:\Users\xxxx ; npm version = 8.11.0 ; cwd = C:\Users\xxxx ; HOME = C:\Users\xxxx ; Run `npm config ls -l` to show all defaults."><pre class="notranslate"><code class="notranslate">; "user" config from C:\Users\xxxx\.npmrc cafile = "C:\\cert\\OGS_int_CA.pem" ; node bin location = C:\Program Files\nodejs\node.exe ; node version = v16.15.1 ; npm local prefix = C:\Users\xxxx ; npm version = 8.11.0 ; cwd = C:\Users\xxxx ; HOME = C:\Users\xxxx ; Run `npm config ls -l` to show all defaults. </code></pre></div>
1
<h4 dir="auto">Description</h4> <p dir="auto">Incorrect clustering results when using dbscan clustering with brute algorithm and large values.<br> See the below code snippet - when the data type is changed to float64 or the algorithm is changed to ball_tree the correct clustering results are obtained.<br> For context, the large values are geographic coordinates.<br> I suspect this is because of the use of squared euclidean distance in the brute algorithm, which is outside the range where float32 can provide adequate precision: </p><div class="Box Box--condensed my-2"> <div class="Box-header f6"> <p class="mb-0 text-bold"> <a href="https://github.com/scikit-learn/scikit-learn/blob/7b136e92acf49d46251479b75c88cba632de1937/sklearn/neighbors/base.py#L699">scikit-learn/sklearn/neighbors/base.py</a> </p> <p class="mb-0 color-fg-muted"> Line 699 in <a data-pjax="true" class="commit-tease-sha" href="/scikit-learn/scikit-learn/commit/7b136e92acf49d46251479b75c88cba632de1937">7b136e9</a> </p> </div> <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data"> <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip=""> <tbody><tr class="border-0"> <td id="L699" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="699"></td> <td id="LC699" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-c"># for efficiency, use squared euclidean distances</span> </td> </tr> </tbody></table> </div> </div> <p></p> <p dir="auto">Perhaps it would be appropriate to warn if epsilon is so small compared to the values being clustered that it will cause issues with precision.</p> <h4 dir="auto">Steps/Code to Reproduce</h4> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np from sklearn.cluster import DBSCAN from scipy.spatial import distance_matrix import platform; print(platform.platform()) import sys; print(&quot;Python&quot;, sys.version) import numpy; print(&quot;NumPy&quot;, numpy.__version__) import scipy; print(&quot;SciPy&quot;, scipy.__version__) import sklearn; print(&quot;Scikit-Learn&quot;, sklearn.__version__) xy = np.array([[400000, 400000], [400000, 400000+1], [400000, 400000+5] ], dtype=np.float32) print(distance_matrix(xy, xy)) print('incorrect', DBSCAN(eps=2, min_samples=1, algorithm='brute' ).fit(xy.astype(np.float32)).labels_) print('correct ', DBSCAN(eps=2, min_samples=1, algorithm='brute' ).fit(xy.astype(np.float64)).labels_) print('correct ', DBSCAN(eps=2, min_samples=1, algorithm='ball_tree' ).fit(xy.astype(np.float32)).labels_) "><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span> <span class="pl-k">from</span> <span class="pl-s1">sklearn</span>.<span class="pl-s1">cluster</span> <span class="pl-k">import</span> <span class="pl-v">DBSCAN</span> <span class="pl-k">from</span> <span class="pl-s1">scipy</span>.<span class="pl-s1">spatial</span> <span class="pl-k">import</span> <span class="pl-s1">distance_matrix</span> <span class="pl-k">import</span> <span class="pl-s1">platform</span>; <span class="pl-en">print</span>(<span class="pl-s1">platform</span>.<span class="pl-en">platform</span>()) <span class="pl-k">import</span> <span class="pl-s1">sys</span>; <span class="pl-en">print</span>(<span class="pl-s">"Python"</span>, <span class="pl-s1">sys</span>.<span class="pl-s1">version</span>) <span class="pl-k">import</span> <span class="pl-s1">numpy</span>; <span class="pl-en">print</span>(<span class="pl-s">"NumPy"</span>, <span class="pl-s1">numpy</span>.<span class="pl-s1">__version__</span>) <span class="pl-k">import</span> <span class="pl-s1">scipy</span>; <span class="pl-en">print</span>(<span class="pl-s">"SciPy"</span>, <span class="pl-s1">scipy</span>.<span class="pl-s1">__version__</span>) <span class="pl-k">import</span> <span class="pl-s1">sklearn</span>; <span class="pl-en">print</span>(<span class="pl-s">"Scikit-Learn"</span>, <span class="pl-s1">sklearn</span>.<span class="pl-s1">__version__</span>) <span class="pl-s1">xy</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>([[<span class="pl-c1">400000</span>, <span class="pl-c1">400000</span>], [<span class="pl-c1">400000</span>, <span class="pl-c1">400000</span><span class="pl-c1">+</span><span class="pl-c1">1</span>], [<span class="pl-c1">400000</span>, <span class="pl-c1">400000</span><span class="pl-c1">+</span><span class="pl-c1">5</span>] ], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">np</span>.<span class="pl-s1">float32</span>) <span class="pl-en">print</span>(<span class="pl-en">distance_matrix</span>(<span class="pl-s1">xy</span>, <span class="pl-s1">xy</span>)) <span class="pl-en">print</span>(<span class="pl-s">'incorrect'</span>, <span class="pl-v">DBSCAN</span>(<span class="pl-s1">eps</span><span class="pl-c1">=</span><span class="pl-c1">2</span>, <span class="pl-s1">min_samples</span><span class="pl-c1">=</span><span class="pl-c1">1</span>, <span class="pl-s1">algorithm</span><span class="pl-c1">=</span><span class="pl-s">'brute'</span> ).<span class="pl-en">fit</span>(<span class="pl-s1">xy</span>.<span class="pl-en">astype</span>(<span class="pl-s1">np</span>.<span class="pl-s1">float32</span>)).<span class="pl-s1">labels_</span>) <span class="pl-en">print</span>(<span class="pl-s">'correct '</span>, <span class="pl-v">DBSCAN</span>(<span class="pl-s1">eps</span><span class="pl-c1">=</span><span class="pl-c1">2</span>, <span class="pl-s1">min_samples</span><span class="pl-c1">=</span><span class="pl-c1">1</span>, <span class="pl-s1">algorithm</span><span class="pl-c1">=</span><span class="pl-s">'brute'</span> ).<span class="pl-en">fit</span>(<span class="pl-s1">xy</span>.<span class="pl-en">astype</span>(<span class="pl-s1">np</span>.<span class="pl-s1">float64</span>)).<span class="pl-s1">labels_</span>) <span class="pl-en">print</span>(<span class="pl-s">'correct '</span>, <span class="pl-v">DBSCAN</span>(<span class="pl-s1">eps</span><span class="pl-c1">=</span><span class="pl-c1">2</span>, <span class="pl-s1">min_samples</span><span class="pl-c1">=</span><span class="pl-c1">1</span>, <span class="pl-s1">algorithm</span><span class="pl-c1">=</span><span class="pl-s">'ball_tree'</span> ).<span class="pl-en">fit</span>(<span class="pl-s1">xy</span>.<span class="pl-en">astype</span>(<span class="pl-s1">np</span>.<span class="pl-s1">float32</span>)).<span class="pl-s1">labels_</span>) </pre></div> <h4 dir="auto">Results</h4> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Windows-10-10.0.17134-SP0 Python 3.7.2 (default, Feb 21 2019, 17:35:59) [MSC v.1915 64 bit (AMD64)] NumPy 1.16.1 SciPy 1.2.1 Scikit-Learn 0.20.3 [[0. 1. 5.] [1. 0. 4.] [5. 4. 0.]] incorrect [0 1 0] correct [0 0 1] correct [0 0 1]"><pre class="notranslate"><span class="pl-v">Windows</span><span class="pl-c1">-</span><span class="pl-c1">10</span><span class="pl-c1">-</span><span class="pl-c1">10.0</span>.<span class="pl-c1">17134</span><span class="pl-c1">-</span><span class="pl-v">SP0</span> <span class="pl-v">Python</span> <span class="pl-c1">3.7</span><span class="pl-c1">.2</span> (<span class="pl-s1">default</span>, <span class="pl-v">Feb</span> <span class="pl-c1">21</span> <span class="pl-c1">2019</span>, <span class="pl-c1">17</span>:<span class="pl-c1">35</span>:<span class="pl-c1">59</span>) [<span class="pl-v">MSC</span> <span class="pl-s1">v</span><span class="pl-c1">.1915</span> <span class="pl-c1">64</span> <span class="pl-en">bit</span> (<span class="pl-v">AMD64</span>)] <span class="pl-v">NumPy</span> <span class="pl-c1">1.16</span><span class="pl-c1">.1</span> <span class="pl-v">SciPy</span> <span class="pl-c1">1.2</span><span class="pl-c1">.1</span> <span class="pl-v">Scikit</span><span class="pl-c1">-</span><span class="pl-v">Learn</span> <span class="pl-c1">0.20</span><span class="pl-c1">.3</span> [[<span class="pl-c1">0.</span> <span class="pl-c1">1.</span> <span class="pl-c1">5.</span>] [<span class="pl-c1">1.</span> <span class="pl-c1">0.</span> <span class="pl-c1">4.</span>] [<span class="pl-c1">5.</span> <span class="pl-c1">4.</span> <span class="pl-c1">0.</span>]] <span class="pl-s1">incorrect</span> [<span class="pl-c1">0</span> <span class="pl-c1">1</span> <span class="pl-c1">0</span>] <span class="pl-s1">correct</span> [<span class="pl-c1">0</span> <span class="pl-c1">0</span> <span class="pl-c1">1</span>] <span class="pl-s1">correct</span> [<span class="pl-c1">0</span> <span class="pl-c1">0</span> <span class="pl-c1">1</span>]</pre></div>
<h4 dir="auto">Description</h4> <p dir="auto">I noticed that sklearn.metrics.pairwise.pairwise_distances function agrees with np.linalg.norm when using np.float64 arrays, but disagrees when using np.float32 arrays. See the code snippet below.</p> <h4 dir="auto">Steps/Code to Reproduce</h4> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np import scipy import sklearn.metrics.pairwise # create 64-bit vectors a and b that are very similar to each other a_64 = np.array([61.221637725830078125, 71.60662841796875, -65.7512664794921875], dtype=np.float64) b_64 = np.array([61.221637725830078125, 71.60894012451171875, -65.72847747802734375], dtype=np.float64) # create 32-bit versions of a and b a_32 = a_64.astype(np.float32) b_32 = b_64.astype(np.float32) # compute the distance from a to b using numpy, for both 64-bit and 32-bit dist_64_np = np.array([np.linalg.norm(a_64 - b_64)], dtype=np.float64) dist_32_np = np.array([np.linalg.norm(a_32 - b_32)], dtype=np.float32) # compute the distance from a to b using sklearn, for both 64-bit and 32-bit dist_64_sklearn = sklearn.metrics.pairwise.pairwise_distances([a_64], [b_64]) dist_32_sklearn = sklearn.metrics.pairwise.pairwise_distances([a_32], [b_32]) # note that the 64-bit sklearn results agree exactly with numpy, but the 32-bit results disagree np.set_printoptions(precision=200) print(dist_64_np) print(dist_32_np) print(dist_64_sklearn) print(dist_32_sklearn)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span> <span class="pl-k">import</span> <span class="pl-s1">scipy</span> <span class="pl-k">import</span> <span class="pl-s1">sklearn</span>.<span class="pl-s1">metrics</span>.<span class="pl-s1">pairwise</span> <span class="pl-c"># create 64-bit vectors a and b that are very similar to each other</span> <span class="pl-s1">a_64</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>([<span class="pl-c1">61.221637725830078125</span>, <span class="pl-c1">71.60662841796875</span>, <span class="pl-c1">-</span><span class="pl-c1">65.7512664794921875</span>], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">np</span>.<span class="pl-s1">float64</span>) <span class="pl-s1">b_64</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>([<span class="pl-c1">61.221637725830078125</span>, <span class="pl-c1">71.60894012451171875</span>, <span class="pl-c1">-</span><span class="pl-c1">65.72847747802734375</span>], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">np</span>.<span class="pl-s1">float64</span>) <span class="pl-c"># create 32-bit versions of a and b</span> <span class="pl-s1">a_32</span> <span class="pl-c1">=</span> <span class="pl-s1">a_64</span>.<span class="pl-en">astype</span>(<span class="pl-s1">np</span>.<span class="pl-s1">float32</span>) <span class="pl-s1">b_32</span> <span class="pl-c1">=</span> <span class="pl-s1">b_64</span>.<span class="pl-en">astype</span>(<span class="pl-s1">np</span>.<span class="pl-s1">float32</span>) <span class="pl-c"># compute the distance from a to b using numpy, for both 64-bit and 32-bit</span> <span class="pl-s1">dist_64_np</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>([<span class="pl-s1">np</span>.<span class="pl-s1">linalg</span>.<span class="pl-en">norm</span>(<span class="pl-s1">a_64</span> <span class="pl-c1">-</span> <span class="pl-s1">b_64</span>)], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">np</span>.<span class="pl-s1">float64</span>) <span class="pl-s1">dist_32_np</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>([<span class="pl-s1">np</span>.<span class="pl-s1">linalg</span>.<span class="pl-en">norm</span>(<span class="pl-s1">a_32</span> <span class="pl-c1">-</span> <span class="pl-s1">b_32</span>)], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">np</span>.<span class="pl-s1">float32</span>) <span class="pl-c"># compute the distance from a to b using sklearn, for both 64-bit and 32-bit</span> <span class="pl-s1">dist_64_sklearn</span> <span class="pl-c1">=</span> <span class="pl-s1">sklearn</span>.<span class="pl-s1">metrics</span>.<span class="pl-s1">pairwise</span>.<span class="pl-en">pairwise_distances</span>([<span class="pl-s1">a_64</span>], [<span class="pl-s1">b_64</span>]) <span class="pl-s1">dist_32_sklearn</span> <span class="pl-c1">=</span> <span class="pl-s1">sklearn</span>.<span class="pl-s1">metrics</span>.<span class="pl-s1">pairwise</span>.<span class="pl-en">pairwise_distances</span>([<span class="pl-s1">a_32</span>], [<span class="pl-s1">b_32</span>]) <span class="pl-c"># note that the 64-bit sklearn results agree exactly with numpy, but the 32-bit results disagree</span> <span class="pl-s1">np</span>.<span class="pl-en">set_printoptions</span>(<span class="pl-s1">precision</span><span class="pl-c1">=</span><span class="pl-c1">200</span>) <span class="pl-en">print</span>(<span class="pl-s1">dist_64_np</span>) <span class="pl-en">print</span>(<span class="pl-s1">dist_32_np</span>) <span class="pl-en">print</span>(<span class="pl-s1">dist_64_sklearn</span>) <span class="pl-en">print</span>(<span class="pl-s1">dist_32_sklearn</span>)</pre></div> <h4 dir="auto">Expected Results</h4> <p dir="auto">I expect that the results from sklearn.metrics.pairwise.pairwise_distances would agree with np.linalg.norm for both 64-bit and 32-bit. In other words, I expect the following output:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ 0.0229059506440019884643266578905240749008953571319580078125] [ 0.02290595136582851409912109375] [[ 0.0229059506440019884643266578905240749008953571319580078125]] [[ 0.02290595136582851409912109375]]"><pre class="notranslate"><code class="notranslate">[ 0.0229059506440019884643266578905240749008953571319580078125] [ 0.02290595136582851409912109375] [[ 0.0229059506440019884643266578905240749008953571319580078125]] [[ 0.02290595136582851409912109375]] </code></pre></div> <h4 dir="auto">Actual Results</h4> <p dir="auto">The code snippet above produces the following output for me:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ 0.0229059506440019884643266578905240749008953571319580078125] [ 0.02290595136582851409912109375] [[ 0.0229059506440019884643266578905240749008953571319580078125]] [[ 0.03125]]"><pre class="notranslate"><code class="notranslate">[ 0.0229059506440019884643266578905240749008953571319580078125] [ 0.02290595136582851409912109375] [[ 0.0229059506440019884643266578905240749008953571319580078125]] [[ 0.03125]] </code></pre></div> <h4 dir="auto">Versions</h4> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Darwin-16.6.0-x86_64-i386-64bit ('Python', '2.7.11 | 64-bit | (default, Jun 11 2016, 03:41:56) \n[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]') ('NumPy', '1.11.3') ('SciPy', '0.19.0') ('Scikit-Learn', '0.18.1')"><pre class="notranslate"><code class="notranslate">Darwin-16.6.0-x86_64-i386-64bit ('Python', '2.7.11 | 64-bit | (default, Jun 11 2016, 03:41:56) \n[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]') ('NumPy', '1.11.3') ('SciPy', '0.19.0') ('Scikit-Learn', '0.18.1') </code></pre></div>
1
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; cv2.__version__ '4.5.1' &gt;&gt;&gt; cv2.minAreaRect(np.array([[1,1],[1,10],[10,10],[10,1]])) ((5.5, 5.5), (9.0, 9.0), 90.0)"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; cv2.__version__ '4.5.1' &gt;&gt;&gt; cv2.minAreaRect(np.array([[1,1],[1,10],[10,10],[10,1]])) ((5.5, 5.5), (9.0, 9.0), 90.0) </code></pre></div> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; cv2.__version__ '4.2.0' &gt;&gt;&gt; cv2.minAreaRect(np.array([[1,1],[1,10],[10,10],[10,1]])) ((5.5, 5.5), (9.0, 9.0), -90.0)"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; cv2.__version__ '4.2.0' &gt;&gt;&gt; cv2.minAreaRect(np.array([[1,1],[1,10],[10,10],[10,1]])) ((5.5, 5.5), (9.0, 9.0), -90.0) </code></pre></div> <p dir="auto">Shouldn't the angle information returned be [-90,0)? 4.5.1 is different from 4.2.0</p>
<h5 dir="auto">System information (version)</h5> <ul dir="auto"> <li>OpenCV =&gt; branch <code class="notranslate">3.4</code></li> <li>Operating System / Platform =&gt; Ubuntu 18.04</li> <li>Compiler =&gt; g++ 7.4.0</li> </ul> <h5 dir="auto">Detailed description</h5> <p dir="auto">This issue aims at discussing and inviting suggestions for supporting <code class="notranslate">string</code> data type in <code class="notranslate">Constant</code> layer. Currently, <code class="notranslate">getMatFromTensor</code> only supports few data types from <a href="https://github.com/onnx/onnx/blob/master/docs/Operators.md#type-constraints-20">this list</a>.</p> <p dir="auto">Also, see <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="551165928" data-permission-text="Title is private" data-url="https://github.com/opencv/opencv/issues/16370" data-hovercard-type="issue" data-hovercard-url="/opencv/opencv/issues/16370/hovercard?comment_id=578788207&amp;comment_type=issue_comment" href="https://github.com/opencv/opencv/issues/16370#issuecomment-578788207">#16370 (comment)</a></p> <h5 dir="auto">Steps to reproduce</h5> <p dir="auto">Code,</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#include&lt;opencv2/dnn.hpp&gt; #include&lt;vector&gt; #include&lt;iostream&gt; int main() { const std::string model = &quot;model.onnx&quot;; cv::dnn::Net net = cv::dnn::readNet( model ); // error }"><pre class="notranslate">#<span class="pl-k">include</span><span class="pl-s"><span class="pl-pds">&lt;</span>opencv2/dnn.hpp<span class="pl-pds">&gt;</span></span> #<span class="pl-k">include</span><span class="pl-s"><span class="pl-pds">&lt;</span>vector<span class="pl-pds">&gt;</span></span> #<span class="pl-k">include</span><span class="pl-s"><span class="pl-pds">&lt;</span>iostream<span class="pl-pds">&gt;</span></span> <span class="pl-k">int</span> <span class="pl-en">main</span>() { <span class="pl-k">const</span> std::string model = <span class="pl-s"><span class="pl-pds">"</span>model.onnx<span class="pl-pds">"</span></span>; cv::dnn::Net net = <span class="pl-c1">cv::dnn::readNet</span>( model ); <span class="pl-c"><span class="pl-c">//</span> error</span> }</pre></div> <p dir="auto"><code class="notranslate">model.onnx</code> available <a href="https://github.com/opencv/opencv/files/4074830/model.zip">here</a>.</p> <p dir="auto">Apply the commits in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="554708915" data-permission-text="Title is private" data-url="https://github.com/opencv/opencv/issues/16424" data-hovercard-type="pull_request" data-hovercard-url="/opencv/opencv/pull/16424/hovercard" href="https://github.com/opencv/opencv/pull/16424">#16424</a> before executing the above code. You will be able to see an error conveying that the tensor is empty and will be thrown by <code class="notranslate">getMatFromTensor</code>.</p>
0
<ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/incubator-dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/incubator-dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate. (This page is missing)</li> </ul> <h3 dir="auto">Environment</h3> <ul dir="auto"> <li>Dubbo version: 2.7.1-SNAPSHOT</li> <li>Operating System version: MacOSX 10.14.1</li> <li>Java version: 1.8.0_191</li> </ul> <h3 dir="auto">Steps to reproduce this issue</h3> <ol dir="auto"> <li>Define exception class and other rpc classes<br> 定义异常类和其他 RPC 相关类</li> </ol> <h4 dir="auto">API Defination</h4> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public class ValidationException extends RuntimeException { public ValidationException(String message) { super(message); } }"><pre class="notranslate"><span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">ValidationException</span> <span class="pl-k">extends</span> <span class="pl-smi">RuntimeException</span> { <span class="pl-k">public</span> <span class="pl-smi">ValidationException</span>(<span class="pl-smi">String</span> <span class="pl-s1">message</span>) { <span class="pl-en">super</span>(<span class="pl-s1">message</span>); } }</pre></div> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public interface MailService { MailResponse send(MailRequest request); }"><pre class="notranslate"><span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-smi">MailService</span> { <span class="pl-smi">MailResponse</span> <span class="pl-en">send</span>(<span class="pl-smi">MailRequest</span> <span class="pl-s1">request</span>); }</pre></div> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@Data public class MailRequest implements Serializable { /** * 收件人邮箱地址 */ @NotBlank(message = &quot;收件人不能为空&quot;) @Email(message = &quot;收件人只能是一个 Email 地址&quot;) private String to; }"><pre class="notranslate"><span class="pl-c1">@</span><span class="pl-c1">Data</span> <span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">MailRequest</span> <span class="pl-k">implements</span> <span class="pl-smi">Serializable</span> { <span class="pl-c">/**</span> <span class="pl-c"> * 收件人邮箱地址</span> <span class="pl-c"> */</span> <span class="pl-c1">@</span><span class="pl-c1">NotBlank</span>(<span class="pl-s1">message</span> = <span class="pl-s">"收件人不能为空"</span>) <span class="pl-c1">@</span><span class="pl-c1">Email</span>(<span class="pl-s1">message</span> = <span class="pl-s">"收件人只能是一个 Email 地址"</span>) <span class="pl-k">private</span> <span class="pl-smi">String</span> <span class="pl-s1">to</span>; }</pre></div> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@Data public class MailResponse implements Serializable { /** 是否成功*/ private boolean success = true; }"><pre class="notranslate"><span class="pl-c1">@</span><span class="pl-c1">Data</span> <span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">MailResponse</span> <span class="pl-k">implements</span> <span class="pl-smi">Serializable</span> { <span class="pl-c">/** 是否成功*/</span> <span class="pl-k">private</span> <span class="pl-smi">boolean</span> <span class="pl-s1">success</span> = <span class="pl-c1">true</span>; }</pre></div> <h4 dir="auto">Provider</h4> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@Service(version = &quot;${service.version}&quot;,protocol = &quot;${dubbo.protocol.id}&quot;,application = &quot;${dubbo.application.name}&quot;,registry = &quot;${dubbo.registry.id}&quot;,executes = 32) public class MailServiceImpl implements MailService { // ... @Override public ServerResponse send(MailRequest request) { Validator validator = Validation.buildDefaultValidatorFactory().getValidator(); Set&lt;ConstraintViolation&lt;MailRequest&gt;&gt; vset = validator.validate(request); if (!vset.isEmpty()) { throw new ValidationException(vset.iterator().next().getMessage()); } return new MailResponse(); } }"><pre class="notranslate"><span class="pl-c1">@</span><span class="pl-c1">Service</span>(<span class="pl-s1">version</span> = <span class="pl-s">"${service.version}"</span>,<span class="pl-s1">protocol</span> = <span class="pl-s">"${dubbo.protocol.id}"</span>,<span class="pl-s1">application</span> = <span class="pl-s">"${dubbo.application.name}"</span>,<span class="pl-s1">registry</span> = <span class="pl-s">"${dubbo.registry.id}"</span>,<span class="pl-s1">executes</span> = <span class="pl-c1">32</span>) <span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">MailServiceImpl</span> <span class="pl-k">implements</span> <span class="pl-smi">MailService</span> { <span class="pl-c">// ...</span> <span class="pl-c1">@</span><span class="pl-c1">Override</span> <span class="pl-k">public</span> <span class="pl-smi">ServerResponse</span> <span class="pl-en">send</span>(<span class="pl-smi">MailRequest</span> <span class="pl-s1">request</span>) { <span class="pl-smi">Validator</span> <span class="pl-s1">validator</span> = <span class="pl-smi">Validation</span>.<span class="pl-en">buildDefaultValidatorFactory</span>().<span class="pl-en">getValidator</span>(); <span class="pl-smi">Set</span>&lt;<span class="pl-smi">ConstraintViolation</span>&lt;<span class="pl-smi">MailRequest</span>&gt;&gt; <span class="pl-s1">vset</span> = <span class="pl-s1">validator</span>.<span class="pl-en">validate</span>(<span class="pl-s1">request</span>); <span class="pl-k">if</span> (!<span class="pl-s1">vset</span>.<span class="pl-en">isEmpty</span>()) { <span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-smi">ValidationException</span>(<span class="pl-s1">vset</span>.<span class="pl-en">iterator</span>().<span class="pl-en">next</span>().<span class="pl-en">getMessage</span>()); } <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-smi">MailResponse</span>(); } }</pre></div> <h4 dir="auto">Consumer</h4> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" try { MailResponse response = mailService.send(request); System.out.println(response.isSuccess()); } catch (Exception e) { e.printStackTrace(); }"><pre class="notranslate"> <span class="pl-k">try</span> { <span class="pl-smi">MailResponse</span> <span class="pl-s1">response</span> = <span class="pl-s1">mailService</span>.<span class="pl-en">send</span>(<span class="pl-s1">request</span>); <span class="pl-smi">System</span>.<span class="pl-s1">out</span>.<span class="pl-en">println</span>(<span class="pl-s1">response</span>.<span class="pl-en">isSuccess</span>()); } <span class="pl-k">catch</span> (<span class="pl-smi">Exception</span> <span class="pl-s1">e</span>) { <span class="pl-s1">e</span>.<span class="pl-en">printStackTrace</span>(); }</pre></div> <h3 dir="auto">Expected Result</h3> <p dir="auto">此处应当可捕获 <code class="notranslate">ValidationException</code></p> <p dir="auto">Expect <code class="notranslate">ValidationException</code> to be caught.</p> <h3 dir="auto">Actual Result</h3> <p dir="auto">但是我们捕获到了 <code class="notranslate">UndeclaredThrowableException</code></p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="java.lang.reflect.UndeclaredThrowableException at com.sun.proxy.$Proxy36.send(Unknown Source) at test.....MailRunner.lambda$runner$0(MailRunner.java:38) at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:804) at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:794) at org.springframework.boot.SpringApplication.run(SpringApplication.java:324) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) at test.....MailRunner.main(MailRunner.java:54) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor$ReferenceBeanInvocationHandler.invoke(ReferenceAnnotationBeanPostProcessor.java:159) ... 8 more Caused by: ....ValidationException: may not be empty at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at com.googlecode.jsonrpc4j.DefaultExceptionResolver.createThrowable(DefaultExceptionResolver.java:162) at com.googlecode.jsonrpc4j.DefaultExceptionResolver.resolveException(DefaultExceptionResolver.java:82) at com.googlecode.jsonrpc4j.JsonRpcClient.readResponse(JsonRpcClient.java:345) at com.googlecode.jsonrpc4j.JsonRpcClient.readResponse(JsonRpcClient.java:285) at com.googlecode.jsonrpc4j.JsonRpcHttpClient.invoke(JsonRpcHttpClient.java:161) at com.googlecode.jsonrpc4j.spring.JsonProxyFactoryBean.invoke(JsonProxyFactoryBean.java:136) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) at com.sun.proxy.$Proxy35.send(Unknown Source) at com.alibaba.dubbo.common.bytecode.Wrapper0.invokeMethod(Wrapper0.java) at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:47) at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:76) at com.alibaba.dubbo.rpc.protocol.AbstractProxyProtocol$2.doInvoke(AbstractProxyProtocol.java:97) at com.alibaba.dubbo.rpc.protocol.AbstractInvoker.invoke(AbstractInvoker.java:155) at com.alibaba.dubbo.rpc.listener.ListenerInvokerWrapper.invoke(ListenerInvokerWrapper.java:77) at com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:62) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) at com.alibaba.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:54) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) at com.alibaba.dubbo.rpc.filter.ConsumerContextFilter.invoke(ConsumerContextFilter.java:49) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) at com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:56) at com.alibaba.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:78) at com.alibaba.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:244) at com.alibaba.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:75) at com.alibaba.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:52) at com.alibaba.dubbo.common.bytecode.proxy0.send(proxy0.java) ... 13 more"><pre class="notranslate"><code class="notranslate">java.lang.reflect.UndeclaredThrowableException at com.sun.proxy.$Proxy36.send(Unknown Source) at test.....MailRunner.lambda$runner$0(MailRunner.java:38) at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:804) at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:794) at org.springframework.boot.SpringApplication.run(SpringApplication.java:324) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) at test.....MailRunner.main(MailRunner.java:54) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor$ReferenceBeanInvocationHandler.invoke(ReferenceAnnotationBeanPostProcessor.java:159) ... 8 more Caused by: ....ValidationException: may not be empty at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at com.googlecode.jsonrpc4j.DefaultExceptionResolver.createThrowable(DefaultExceptionResolver.java:162) at com.googlecode.jsonrpc4j.DefaultExceptionResolver.resolveException(DefaultExceptionResolver.java:82) at com.googlecode.jsonrpc4j.JsonRpcClient.readResponse(JsonRpcClient.java:345) at com.googlecode.jsonrpc4j.JsonRpcClient.readResponse(JsonRpcClient.java:285) at com.googlecode.jsonrpc4j.JsonRpcHttpClient.invoke(JsonRpcHttpClient.java:161) at com.googlecode.jsonrpc4j.spring.JsonProxyFactoryBean.invoke(JsonProxyFactoryBean.java:136) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) at com.sun.proxy.$Proxy35.send(Unknown Source) at com.alibaba.dubbo.common.bytecode.Wrapper0.invokeMethod(Wrapper0.java) at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:47) at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:76) at com.alibaba.dubbo.rpc.protocol.AbstractProxyProtocol$2.doInvoke(AbstractProxyProtocol.java:97) at com.alibaba.dubbo.rpc.protocol.AbstractInvoker.invoke(AbstractInvoker.java:155) at com.alibaba.dubbo.rpc.listener.ListenerInvokerWrapper.invoke(ListenerInvokerWrapper.java:77) at com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:62) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) at com.alibaba.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:54) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) at com.alibaba.dubbo.rpc.filter.ConsumerContextFilter.invoke(ConsumerContextFilter.java:49) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) at com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:56) at com.alibaba.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:78) at com.alibaba.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:244) at com.alibaba.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:75) at com.alibaba.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:52) at com.alibaba.dubbo.common.bytecode.proxy0.send(proxy0.java) ... 13 more </code></pre></div>
<ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li> </ul> <h3 dir="auto">Environment</h3> <ul dir="auto"> <li>Dubbo version: v2.7.3</li> <li>Java version: 1.8</li> </ul> <h3 dir="auto">Actual Result</h3> <p dir="auto"><a href="https://github.com/apache/dubbo/blob/master/dubbo-common/src/main/java/org/apache/dubbo/common/config/ConfigurationUtils.java#L77">https://github.com/apache/dubbo/blob/master/dubbo-common/src/main/java/org/apache/dubbo/common/config/ConfigurationUtils.java#L77</a></p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="logger.warn(&quot;You specified the config centre, but there's not even one single config item in it.&quot;);"><pre class="notranslate"><span class="pl-s1">logger</span>.<span class="pl-en">warn</span>(<span class="pl-s">"You specified the config centre, but there's not even one single config item in it."</span>);</pre></div> <h3 dir="auto">Expected Result</h3> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="logger.warn(&quot;You specified the config center, but there's not even one single config item in it.&quot;);"><pre class="notranslate"><span class="pl-s1">logger</span>.<span class="pl-en">warn</span>(<span class="pl-s">"You specified the config center, but there's not even one single config item in it."</span>);</pre></div> <p dir="auto">Although <code class="notranslate">centre</code> has a simmilar meaning with <code class="notranslate">center</code>, we usually call a config center <code class="notranslate">config center</code> but not <code class="notranslate">config centre</code>. so consider changing it to <code class="notranslate">config center</code>?</p>
0
<pre class="notranslate">I don't know if there are relevant open bugs for this. I didn't see any on a quick glance. This issue is for tracking work toward being able to call Go from C programs (perhaps linked into the program already, perhaps as a dynload .so file). Elias Naur has done some good work getting the raw technical details of things like large-model, position-independent code working. The biggest step that remains is defining what it means to enter a Go program. Do we use the usual 'run main.init+main.main' that we use for standalone binaries? Do we use something else? Is os.Args defined? And so on. I expect this to happen after Go 1.1.</pre>
<p dir="auto">by <strong><a href="mailto:[email protected]">[email protected]</a></strong>:</p> <pre class="notranslate">Although it's already possible to link C code into a Go program (that controls the entry point), it would be highly useful to me to have the opposite (running a Go runtime in a C program). I'm mostly interested in exposing exported Go symbols and bindings to Python (and Ruby, Java, and similar), and PostgreSQL. In the latter case, the sandboxed variant of Go provides a more unique advantage as it can be run as a "trusted" language.</pre>
1
<p dir="auto">I'm submitting this as a bug, instead of a support question on SO, because I'm getting this error after a very clean install of the operating system. The error occurs when I attempt to do the most basic validation, but just importing tensorflow!</p> <hr> <h3 dir="auto">System information</h3> <ul dir="auto"> <li> <p dir="auto"><strong>Have I written custom code (as opposed to using a stock example script provided in TensorFlow)</strong>:<br> No custom code, the error is occurring when I do <code class="notranslate">import tensorflow as tf</code> at the repl</p> </li> <li> <p dir="auto"><strong>OS Platform and Distribution (e.g., Linux Ubuntu 16.04)</strong>:<br> Windows 10 Home, version 1703, fresh install (the only other thing installed on the computer is Chrome and Anaconda distribution of Python 3.6)</p> </li> <li> <p dir="auto"><strong>TensorFlow installed from (source or binary)</strong>:<br> Binary. Followed the instruction to the letter, except type in 'pip' instead of 'pip3', as in:<br> <code class="notranslate">pip3 install --upgrade tensorflow-gpu</code> (this is after installing cuda and cudablas)</p> </li> <li> <p dir="auto"><strong>TensorFlow version (use command below)</strong>:<br> 1.3 (whatever is in the repo as of about 30 minutes ago)</p> </li> <li> <p dir="auto"><strong>Python version</strong>: Python 3.6.1 :: Anaconda custom (64-bit)</p> </li> <li> <p dir="auto"><strong>Bazel version (if compiling from source)</strong>:</p> </li> <li> <p dir="auto"><strong>CUDA/cuDNN version</strong>:</p> </li> </ul> <blockquote> <p dir="auto">nvcc --version<br> nvcc: NVIDIA (R) Cuda compiler driver<br> Copyright (c) 2005-2016 NVIDIA Corporation<br> Built on Mon_Jan__9_17:32:33_CST_2017<br> Cuda compilation tools, release 8.0, V8.0.60</p> </blockquote> <ul dir="auto"> <li> <p dir="auto"><strong>GPU model and memory</strong>:<br> NVIDIA GeForce GTX 960M<br> Approx. Total Memory: 18313 MB</p> </li> <li> <p dir="auto"><strong>Exact command to reproduce</strong>:<br> import tensorflow as tf</p> </li> </ul> <h3 dir="auto">Describe the problem</h3> <p dir="auto">I re-imaged my windows 10 laptop, installed Chrome, installed the latest anaconda python 3.6 and attempted to install tensorflow following the official instructions on the web page (all of this within the last hour or two of filing this ticket).</p> <p dir="auto">Installed Cuda and Cudablas from nvidia's website, as required by TF instructions.<br> Installed tensorflow-gpu</p> <p dir="auto">Saw an exception related to some setuptools file not being found (sorry, didn't keep a record of that)<br> Upgraded setuptools</p> <p dir="auto">Did a reinstall of tensorflow, but added <code class="notranslate">--force-reinstall</code> flag, which claimed to have installed tensorflow without errors:</p> <p dir="auto">Successfully installed bleach-1.5.0 html5lib-0.9999999 markdown-2.6.9 numpy-1.13.1 protobuf-3.4.0 setuptools-36.5.0 six-1.11.0 tensorflow-gpu-1.3.0 tensorflow-tensorboard-0.1.6 werkzeug-0.12.2 wheel-0.30.0</p> <p dir="auto">Ran the import command and saw these exception trace:</p> <h3 dir="auto">Source code / logs</h3> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(C:\Users\someuser\Anaconda3) C:\Users\someuser&gt;python Python 3.6.1 |Anaconda custom (64-bit)| (default, May 11 2017, 13:25:24) [MSC v.1900 64 bit (AMD64)] on win32 Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information. &gt;&gt;&gt; import tensorflow as tf Traceback (most recent call last): File &quot;C:\Users\someuser\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py&quot;, line 18, in swig_import_helper return importlib.import_module(mname) File &quot;C:\Users\someuser\Anaconda3\lib\importlib\__init__.py&quot;, line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 978, in _gcd_import File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 961, in _find_and_load File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 950, in _find_and_load_unlocked File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 648, in _load_unlocked File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 560, in module_from_spec File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 922, in create_module File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 205, in _call_with_frames_removed ImportError: DLL load failed: The specified module could not be found. During handling of the above exception, another exception occurred: Traceback (most recent call last): File &quot;C:\Users\someuser\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py&quot;, line 41, in &lt;module&gt; from tensorflow.python.pywrap_tensorflow_internal import * File &quot;C:\Users\someuser\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py&quot;, line 21, in &lt;module&gt; _pywrap_tensorflow_internal = swig_import_helper() File &quot;C:\Users\someuser\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py&quot;, line 20, in swig_import_helper return importlib.import_module('_pywrap_tensorflow_internal') File &quot;C:\Users\someuser\Anaconda3\lib\importlib\__init__.py&quot;, line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ModuleNotFoundError: No module named '_pywrap_tensorflow_internal' During handling of the above exception, another exception occurred: Traceback (most recent call last): File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt; File &quot;C:\Users\someuser\Anaconda3\lib\site-packages\tensorflow\__init__.py&quot;, line 24, in &lt;module&gt; from tensorflow.python import * File &quot;C:\Users\someuser\Anaconda3\lib\site-packages\tensorflow\python\__init__.py&quot;, line 49, in &lt;module&gt; from tensorflow.python import pywrap_tensorflow File &quot;C:\Users\someuser\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py&quot;, line 52, in &lt;module&gt; raise ImportError(msg) ImportError: Traceback (most recent call last): File &quot;C:\Users\someuser\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py&quot;, line 18, in swig_import_helper return importlib.import_module(mname) File &quot;C:\Users\someuser\Anaconda3\lib\importlib\__init__.py&quot;, line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 978, in _gcd_import File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 961, in _find_and_load File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 950, in _find_and_load_unlocked File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 648, in _load_unlocked File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 560, in module_from_spec File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 922, in create_module File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 205, in _call_with_frames_removed ImportError: DLL load failed: The specified module could not be found. During handling of the above exception, another exception occurred: Traceback (most recent call last): File &quot;C:\Users\someuser\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py&quot;, line 41, in &lt;module&gt; from tensorflow.python.pywrap_tensorflow_internal import * File &quot;C:\Users\someuser\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py&quot;, line 21, in &lt;module&gt; _pywrap_tensorflow_internal = swig_import_helper() File &quot;C:\Users\someuser\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py&quot;, line 20, in swig_import_helper return importlib.import_module('_pywrap_tensorflow_internal') File &quot;C:\Users\someuser\Anaconda3\lib\importlib\__init__.py&quot;, line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ModuleNotFoundError: No module named '_pywrap_tensorflow_internal' Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/install_sources#common_installation_problems for some common reasons and solutions. Include the entire stack trace above this error message when asking for help."><pre class="notranslate"><code class="notranslate">(C:\Users\someuser\Anaconda3) C:\Users\someuser&gt;python Python 3.6.1 |Anaconda custom (64-bit)| (default, May 11 2017, 13:25:24) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. &gt;&gt;&gt; import tensorflow as tf Traceback (most recent call last): File "C:\Users\someuser\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper return importlib.import_module(mname) File "C:\Users\someuser\Anaconda3\lib\importlib\__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "&lt;frozen importlib._bootstrap&gt;", line 978, in _gcd_import File "&lt;frozen importlib._bootstrap&gt;", line 961, in _find_and_load File "&lt;frozen importlib._bootstrap&gt;", line 950, in _find_and_load_unlocked File "&lt;frozen importlib._bootstrap&gt;", line 648, in _load_unlocked File "&lt;frozen importlib._bootstrap&gt;", line 560, in module_from_spec File "&lt;frozen importlib._bootstrap_external&gt;", line 922, in create_module File "&lt;frozen importlib._bootstrap&gt;", line 205, in _call_with_frames_removed ImportError: DLL load failed: The specified module could not be found. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\someuser\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 41, in &lt;module&gt; from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Users\someuser\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in &lt;module&gt; _pywrap_tensorflow_internal = swig_import_helper() File "C:\Users\someuser\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper return importlib.import_module('_pywrap_tensorflow_internal') File "C:\Users\someuser\Anaconda3\lib\importlib\__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ModuleNotFoundError: No module named '_pywrap_tensorflow_internal' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "&lt;stdin&gt;", line 1, in &lt;module&gt; File "C:\Users\someuser\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 24, in &lt;module&gt; from tensorflow.python import * File "C:\Users\someuser\Anaconda3\lib\site-packages\tensorflow\python\__init__.py", line 49, in &lt;module&gt; from tensorflow.python import pywrap_tensorflow File "C:\Users\someuser\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 52, in &lt;module&gt; raise ImportError(msg) ImportError: Traceback (most recent call last): File "C:\Users\someuser\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper return importlib.import_module(mname) File "C:\Users\someuser\Anaconda3\lib\importlib\__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "&lt;frozen importlib._bootstrap&gt;", line 978, in _gcd_import File "&lt;frozen importlib._bootstrap&gt;", line 961, in _find_and_load File "&lt;frozen importlib._bootstrap&gt;", line 950, in _find_and_load_unlocked File "&lt;frozen importlib._bootstrap&gt;", line 648, in _load_unlocked File "&lt;frozen importlib._bootstrap&gt;", line 560, in module_from_spec File "&lt;frozen importlib._bootstrap_external&gt;", line 922, in create_module File "&lt;frozen importlib._bootstrap&gt;", line 205, in _call_with_frames_removed ImportError: DLL load failed: The specified module could not be found. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\someuser\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 41, in &lt;module&gt; from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Users\someuser\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in &lt;module&gt; _pywrap_tensorflow_internal = swig_import_helper() File "C:\Users\someuser\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper return importlib.import_module('_pywrap_tensorflow_internal') File "C:\Users\someuser\Anaconda3\lib\importlib\__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ModuleNotFoundError: No module named '_pywrap_tensorflow_internal' Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/install_sources#common_installation_problems for some common reasons and solutions. Include the entire stack trace above this error message when asking for help. </code></pre></div>
<p dir="auto">Hi - Thanks for all your hard work on this! - I've been having a problem getting Tensorflow-GPU to work on my Windows 10 notebook with a GTX 1080. I've tried to make sure all the paths are correct, etc. and have followed all the tips I can find.</p> <p dir="auto">I ran the tensorflow_self_check.py script and got the following result:</p> <p dir="auto">PS D:\Users\Frank Davidson\Documents\python&gt; python .\tensorflow_self_check.py<br> ERROR: Failed to import the TensorFlow module.</p> <ul dir="auto"> <li> <p dir="auto">Python version is 3.6.</p> </li> <li> <p dir="auto">TensorFlow is installed at: C:\Program Files\Python36\lib\site-packages\tensorflow</p> </li> <li> <p dir="auto">All required DLLs appear to be present. Please open an issue on the<br> TensorFlow GitHub page: <a href="https://github.com/tensorflow/tensorflow/issues">https://github.com/tensorflow/tensorflow/issues</a><br> PS D:\Users\Frank Davidson\Documents\python&gt;</p> </li> </ul> <p dir="auto">Here is the full stack trace when I try to import tensorflow:</p> <p dir="auto">PS C:\Users\Frank Davidson&gt; python<br> Python 3.6.2 (v3.6.2:5fd33b5, Jul 8 2017, 04:57:36) [MSC v.1900 64 bit (AMD64)] on win32<br> Type "help", "copyright", "credits" or "license" for more information.</p> <blockquote> <blockquote> <blockquote> <p dir="auto">import tensorflow as tf<br> Traceback (most recent call last):<br> File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_i<br> mport_helper<br> return importlib.import_module(mname)<br> File "C:\Program Files\Python36\lib\importlib_<em>init</em>_.py", line 126, in import_module<br> return _bootstrap._gcd_import(name[level:], package, level)<br> File "", line 978, in _gcd_import<br> File "", line 961, in _find_and_load<br> File "", line 950, in _find_and_load_unlocked<br> File "", line 648, in _load_unlocked<br> File "", line 560, in module_from_spec<br> File "", line 922, in create_module<br> File "", line 205, in _call_with_frames_removed<br> ImportError: DLL load failed: The specified module could not be found.</p> </blockquote> </blockquote> </blockquote> <p dir="auto">During handling of the above exception, another exception occurred:</p> <p dir="auto">Traceback (most recent call last):<br> File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 41, in <br> from tensorflow.python.pywrap_tensorflow_internal import *<br> File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in <br> _pywrap_tensorflow_internal = swig_import_helper()<br> File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_i<br> mport_helper<br> return importlib.import_module('<em>pywrap_tensorflow_internal')<br> File "C:\Program Files\Python36\lib\importlib_<em>init</em></em>.py", line 126, in import_module<br> return _bootstrap._gcd_import(name[level:], package, level)<br> ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'</p> <p dir="auto">During handling of the above exception, another exception occurred:</p> <p dir="auto">Traceback (most recent call last):<br> File "", line 1, in <br> File "C:\Program Files\Python36\lib\site-packages\tensorflow_<em>init</em>_.py", line 24, in <br> from tensorflow.python import *<br> File "C:\Program Files\Python36\lib\site-packages\tensorflow\python_<em>init</em>_.py", line 49, in <br> from tensorflow.python import pywrap_tensorflow<br> File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 52, in <br> raise ImportError(msg)<br> ImportError: Traceback (most recent call last):<br> File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_i<br> mport_helper<br> return importlib.import_module(mname)<br> File "C:\Program Files\Python36\lib\importlib_<em>init</em>_.py", line 126, in import_module<br> return _bootstrap._gcd_import(name[level:], package, level)<br> File "", line 978, in _gcd_import<br> File "", line 961, in _find_and_load<br> File "", line 950, in _find_and_load_unlocked<br> File "", line 648, in _load_unlocked<br> File "", line 560, in module_from_spec<br> File "", line 922, in create_module<br> File "", line 205, in _call_with_frames_removed<br> ImportError: DLL load failed: The specified module could not be found.</p> <p dir="auto">During handling of the above exception, another exception occurred:</p> <p dir="auto">Traceback (most recent call last):<br> File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 41, in <br> from tensorflow.python.pywrap_tensorflow_internal import *<br> File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in <br> _pywrap_tensorflow_internal = swig_import_helper()<br> File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_i<br> mport_helper<br> return importlib.import_module('<em>pywrap_tensorflow_internal')<br> File "C:\Program Files\Python36\lib\importlib_<em>init</em></em>.py", line 126, in import_module<br> return _bootstrap._gcd_import(name[level:], package, level)<br> ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'</p> <p dir="auto">Failed to load the native TensorFlow runtime.</p> <p dir="auto">See <a href="https://www.tensorflow.org/install/install_sources#common_installation_problems" rel="nofollow">https://www.tensorflow.org/install/install_sources#common_installation_problems</a></p> <p dir="auto">for some common reasons and solutions. Include the entire stack trace<br> above this error message when asking for help.</p> <p dir="auto">Any help is greatly appreciated!</p> <p dir="auto">Frank</p>
1
<h1 dir="auto">Environment</h1> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Windows build number: Windows 10 Version 1909 Build 18363.836 PowerToys version: 18.1 PowerToy module for which you are reporting the bug (if applicable): Run"><pre class="notranslate"><code class="notranslate">Windows build number: Windows 10 Version 1909 Build 18363.836 PowerToys version: 18.1 PowerToy module for which you are reporting the bug (if applicable): Run </code></pre></div> <h1 dir="auto">Steps to reproduce</h1> <ul dir="auto"> <li>Open PowerToys Run box (Alt + Space)</li> <li>Input Calc for Calculator</li> <li>Open Calculator</li> <li>Open PowerToys Run box (Alt + Space) again</li> </ul> <h1 dir="auto">Expected behavior</h1> <p dir="auto">Is expected a clean run box for every instance of search.</p> <h1 dir="auto">Actual behavior</h1> <p dir="auto">Is keeping the last terms I used.</p> <h1 dir="auto">Screenshots</h1> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/66121192/83535085-fc814980-a4c7-11ea-8f6b-6c1d014a6b76.png"><img src="https://user-images.githubusercontent.com/66121192/83535085-fc814980-a4c7-11ea-8f6b-6c1d014a6b76.png" alt="Anotação 2020-06-02 115516" style="max-width: 100%;"></a></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/65631993/82387225-1a749600-9a54-11ea-8e53-7f5a316b176d.gif"><img src="https://user-images.githubusercontent.com/65631993/82387225-1a749600-9a54-11ea-8e53-7f5a316b176d.gif" alt="vl9jLZAIRn_Trim-output" data-animated-image="" style="max-width: 100%;"></a><br> as you can see it goes to the same window i searched before . I am not very good at explaining i hope you can get what im trying to say</p>
1
<h2 dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/16353144/61019849-3936e480-a3ce-11e9-8332-77c7fee4fe50.png"><img src="https://user-images.githubusercontent.com/16353144/61019849-3936e480-a3ce-11e9-8332-77c7fee4fe50.png" alt="image" style="max-width: 100%;"></a></h2> <h2 dir="auto">Platform: Windows10 1703<br> OS Version: 15063.1387</h2> <p dir="auto">After search many documents &amp; issues, I got no answer.<br> Is there anybody knows what happened to the installation of deno?</p>
<p dir="auto">Example:</p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import express from &quot;npm:express@4&quot;; const app = express(); const port = 3000; app.get('/', (req, res) =&gt; { res.send('Hello World!'); }); app.listen(port, () =&gt; { console.log(`Example app listening on port ${port}`); });"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">express</span> <span class="pl-k">from</span> <span class="pl-s">"npm:express@4"</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">app</span> <span class="pl-c1">=</span> <span class="pl-en">express</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">port</span> <span class="pl-c1">=</span> <span class="pl-c1">3000</span><span class="pl-kos">;</span> <span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-s">'/'</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-s1">req</span><span class="pl-kos">,</span> <span class="pl-s1">res</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-s1">res</span><span class="pl-kos">.</span><span class="pl-en">send</span><span class="pl-kos">(</span><span class="pl-s">'Hello World!'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">listen</span><span class="pl-kos">(</span><span class="pl-s1">port</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">`Example app listening on port <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">port</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p dir="auto">Depends on <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1044668985" data-permission-text="Title is private" data-url="https://github.com/denoland/deno/issues/12648" data-hovercard-type="issue" data-hovercard-url="/denoland/deno/issues/12648/hovercard" href="https://github.com/denoland/deno/issues/12648">#12648</a></p>
0
<p dir="auto">For a piece of code at work, we had a set of tasks that are essentially wrappers around a function. Originally each function was implemented independently. To reduce code duplication, I tried to make a higher order function that would take in the wrapped function (<code class="notranslate">ship_function</code>) and return a task that called it and did the other boilerplate code. This code is below:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="def make_ship_function(ship_function, shipment_type_name, task_name): @task(ignore_result=True, name=__name__ + &quot;.&quot; + task_name) @transaction.commit_manually def inner(oblpn_nbr, facility_code, company_code, user = None): try: if not CWLoginContext.user and user: set_login_context_user(user) set_facility_and_company(facility_code, company_code) (retval, msg) = ship_function(oblpn_nbr, facility_code, company_code) if not retval: transaction.rollback() cwlog.error('{0}.process_shipment_ws returned false: {1}'.format(shipment_type_name, msg)) CWLoginContext.user = None raise Exception(msg) transaction.commit() CWLoginContext.user = None return True, None except Exception, e: transaction.rollback() if connection.queries: cwlog.error(connection.queries[-1]) cwlog.error('Exception in {0}.process_shipment_ws: {1}'.format(shipment_type_name, e)) CWLoginContext.user = None raise e return inner"><pre class="notranslate"><code class="notranslate">def make_ship_function(ship_function, shipment_type_name, task_name): @task(ignore_result=True, name=__name__ + "." + task_name) @transaction.commit_manually def inner(oblpn_nbr, facility_code, company_code, user = None): try: if not CWLoginContext.user and user: set_login_context_user(user) set_facility_and_company(facility_code, company_code) (retval, msg) = ship_function(oblpn_nbr, facility_code, company_code) if not retval: transaction.rollback() cwlog.error('{0}.process_shipment_ws returned false: {1}'.format(shipment_type_name, msg)) CWLoginContext.user = None raise Exception(msg) transaction.commit() CWLoginContext.user = None return True, None except Exception, e: transaction.rollback() if connection.queries: cwlog.error(connection.queries[-1]) cwlog.error('Exception in {0}.process_shipment_ws: {1}'.format(shipment_type_name, e)) CWLoginContext.user = None raise e return inner </code></pre></div> <p dir="auto">This code does not work properly. Even though in the task decorator, I specify the name of the task, all tasks generated by make_ship_function will all have the same name, inner. This goes against my expectations gotten from reading the docs here: <a href="http://celery.readthedocs.org/en/latest/userguide/tasks.html#names" rel="nofollow">http://celery.readthedocs.org/en/latest/userguide/tasks.html#names</a> .</p>
<h1 dir="auto">Checklist</h1> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/issues?utf8=%E2%9C%93&amp;q=is%3Aissue+label%3A%22Category%3A+Documentation%22+">issues list</a><br> for similar or identical bug reports.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/pulls?q=is%3Apr+label%3A%22Category%3A+Documentation%22">pull requests list</a><br> for existing proposed fixes.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/commits/master">commit log</a><br> to find out if the bug was already fixed in the master branch.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all related issues and possible duplicate issues in this issue<br> (If there are none, check this box anyway).</li> </ul> <h2 dir="auto">Related Issues and Possible Duplicates</h2> <h4 dir="auto">Related Issues</h4> <ul dir="auto"> <li>introduced by: PR <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="324688811" data-permission-text="Title is private" data-url="https://github.com/celery/celery/issues/4745" data-hovercard-type="pull_request" data-hovercard-url="/celery/celery/pull/4745/hovercard" href="https://github.com/celery/celery/pull/4745">#4745</a></li> </ul> <h4 dir="auto">Possible Duplicates</h4> <ul dir="auto"> <li>None</li> </ul> <h1 dir="auto">Description</h1> <p dir="auto">The <a href="https://github.com/celery/celery/blob/7f9daab9d3007d2a52f7813cf12dd7fa5666c98b/docs/userguide/tasks.rst#tips-and-best-practices">user guide for tasks</a> states: "Results can be enabled/disabled on a per-execution basis, by passing the <code class="notranslate">ignore_result</code> boolean parameter, when calling <code class="notranslate">apply_async</code> <em>or <code class="notranslate">delay</code></em>" (emphasis mine)</p> <p dir="auto">To me, this seems to suggest that you could so something like <code class="notranslate">mytask.delay(ignore_result=True)</code>. However, that will just cause the kwarg to be passed through to the task itself, or rather, it causes an exception:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TypeError: mytask() got an unexpected keyword argument 'ignore_result'"><pre class="notranslate"><code class="notranslate">TypeError: mytask() got an unexpected keyword argument 'ignore_result' </code></pre></div> <p dir="auto">Looking at the <a href="https://github.com/celery/celery/blob/7f9daab9d3007d2a52f7813cf12dd7fa5666c98b/docs/userguide/calling.rst#basics">user guide on calling tasks</a>, it becomes clear that <code class="notranslate">delay</code> is just a "Shortcut to send a task message, <em>but doesn’t support execution options</em>" (emphasis mine) and hence <code class="notranslate">apply_async</code> must be used instead.</p> <h1 dir="auto">Suggestions</h1> <p dir="auto">Unless I'm completely misunderstanding something here, I suggest that it is made more clear in the user guide for tasks that usage of <code class="notranslate">apply_async</code> rather than <code class="notranslate">delay</code> is required to use the <code class="notranslate">ignore_result</code> kwarg.</p>
0
<p dir="auto"><strong>Context</strong></p> <p dir="auto">Local variables (defined with the <code class="notranslate">#</code> character at a element attribute) don't apply for this use case: rqw local variables for a loop with <code class="notranslate">ngFor</code>.</p> <p dir="auto">In fact, when you define a local variable on an HTML element it corresponds to the component if any. When there is no component on the element, the variable refers to the element itself.</p> <p dir="auto">Specifying a value for a local variable allows you to select a specific directive associated with the current element. For example:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;input #name=&quot;ngForm&quot; ngControl=&quot;name&quot; [(ngModel)]=&quot;company.name&quot;/&gt;"><pre class="notranslate"><code class="notranslate">&lt;input #name="ngForm" ngControl="name" [(ngModel)]="company.name"/&gt; </code></pre></div> <p dir="auto">will set the instance of the <code class="notranslate">ngForm</code> directive associated with the current in the <code class="notranslate">name</code> variable.</p> <p dir="auto">So local variables don't allow to set a value created for the current element of a loop.</p> <p dir="auto">If I try to do something like that:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;div *ngFor=&quot;#elt of eltList&quot; &gt; &lt;span #localVariable=&quot;elt.title&quot;&gt;&lt;/span&gt; {{localVariable}} &lt;/div&gt;"><pre class="notranslate"><code class="notranslate">&lt;div *ngFor="#elt of eltList" &gt; &lt;span #localVariable="elt.title"&gt;&lt;/span&gt; {{localVariable}} &lt;/div&gt; </code></pre></div> <p dir="auto">I have this following error:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Error: Template parse errors: There is no directive with &quot;exportAs&quot; set to &quot;elt.title&quot; (&quot; &lt;div *ngFor=&quot;#elt of eltList&quot; &gt; &lt;span [ERROR -&gt;]#localVariable=&quot;elt.title&quot;&gt;&lt;/span&gt; {{localVariable}} &lt;/div&gt; &quot;): AppComponent@2:10"><pre class="notranslate"><code class="notranslate">Error: Template parse errors: There is no directive with "exportAs" set to "elt.title" (" &lt;div *ngFor="#elt of eltList" &gt; &lt;span [ERROR -&gt;]#localVariable="elt.title"&gt;&lt;/span&gt; {{localVariable}} &lt;/div&gt; "): AppComponent@2:10 </code></pre></div> <p dir="auto">Angular2 actually looks for a directive matching the provided name <code class="notranslate">elt.title</code> here)... This plunkr shows this: <a href="https://plnkr.co/edit/qcMGr9FS7yQD8LbX18uY?p=preview" rel="nofollow">https://plnkr.co/edit/qcMGr9FS7yQD8LbX18uY?p=preview</a>. The section "Local variables" of this link <a href="http://victorsavkin.com/post/119943127151/angular-2-template-syntax" rel="nofollow">http://victorsavkin.com/post/119943127151/angular-2-template-syntax</a> also describes this.</p> <p dir="auto">In addition to the current element of the iteration, <code class="notranslate">ngFor</code> only provides a set of exported values that can be aliased to local variables: <code class="notranslate">index</code>, <code class="notranslate">last</code>, <code class="notranslate">even</code> and <code class="notranslate">odd</code>.</p> <p dir="auto"><strong>Question</strong></p> <p dir="auto">It would be interested to have a way to define custom local variables within the loop. This way you could define a computed variable once and use it several times in the loop block.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;div *ngFor=&quot;#t of todos; #i=index; #formattedTodoName=format(t.name)&quot;&gt; {{formattedTodoName}} (...) {{formattedTodoName}} &lt;/div&gt;"><pre class="notranslate"><code class="notranslate">&lt;div *ngFor="#t of todos; #i=index; #formattedTodoName=format(t.name)"&gt; {{formattedTodoName}} (...) {{formattedTodoName}} &lt;/div&gt; </code></pre></div> <p dir="auto">I would be interested in having your feedbacks.</p> <p dir="auto">This question follows the one from the StackOverflow website: <a href="http://stackoverflow.com/questions/35257455/ng2-how-to-create-variable-in-ngfor-loop/" rel="nofollow">http://stackoverflow.com/questions/35257455/ng2-how-to-create-variable-in-ngfor-loop/</a>.</p> <p dir="auto">Thanks very much!</p>
<p dir="auto">It looks like if I use the <code class="notranslate">@Attribute</code> on a class constructor:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="constructor(@Attribute('tabindex') tabindex: string) {}"><pre class="notranslate"><span class="pl-en">constructor</span><span class="pl-kos">(</span>@<span class="pl-v">Attribute</span><span class="pl-kos">(</span><span class="pl-s">'tabindex'</span><span class="pl-kos">)</span> <span class="pl-s1">tabindex</span>: <span class="pl-s1">string</span><span class="pl-kos">)</span><span class="pl-kos"></span> <span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div> <p dir="auto">it causes the TS compiler to throw a semantic error:</p> <div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="src/app/components/checkbox/checkbox.ts(63,14): error TS1239: Unable to resolve signature of parameter decorator when called as an expression. Supplied parameters do not match any signature of call target."><pre class="notranslate">src/app/components/checkbox/checkbox.ts(63,14): error TS1239: Unable to resolve signature of parameter decorator when called as an expression. Supplied parameters <span class="pl-k">do</span> not match any signature of call target.</pre></div>
0
<h2 dir="auto"><g-emoji class="g-emoji" alias="bug" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f41b.png">🐛</g-emoji> Bug</h2> <p dir="auto">I think the vector strides are passed incorrectly to <code class="notranslate">gemv</code> on GPU. It works well on CPU.</p> <h2 dir="auto">To Reproduce</h2> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import torch mat = torch.randn(2, 2).cuda() vec = torch.randn(2).cuda().requires_grad_(True) (mat @ vec).sum().backward()"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">torch</span> <span class="pl-s1">mat</span> <span class="pl-c1">=</span> <span class="pl-s1">torch</span>.<span class="pl-en">randn</span>(<span class="pl-c1">2</span>, <span class="pl-c1">2</span>).<span class="pl-en">cuda</span>() <span class="pl-s1">vec</span> <span class="pl-c1">=</span> <span class="pl-s1">torch</span>.<span class="pl-en">randn</span>(<span class="pl-c1">2</span>).<span class="pl-en">cuda</span>().<span class="pl-en">requires_grad_</span>(<span class="pl-c1">True</span>) (<span class="pl-s1">mat</span> @ <span class="pl-s1">vec</span>).<span class="pl-en">sum</span>().<span class="pl-en">backward</span>()</pre></div> <p dir="auto">Here I get:</p> <blockquote> <p dir="auto">RuntimeError: at::cuda::blas::gemv argument incx must be positive and less than 2147483647 but got 0</p> </blockquote> <p dir="auto">Originally I found the bug as an issue during DGER in the gradient of <code class="notranslate">mat @ vec</code>, in the generated function <code class="notranslate">MvBackward::apply</code> in <code class="notranslate">torch/csrc/autograd/generated/Functions.cpp</code>. The error message is the same as <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="477959921" data-permission-text="Title is private" data-url="https://github.com/cornellius-gp/gpytorch/issues/834" data-hovercard-type="issue" data-hovercard-url="/cornellius-gp/gpytorch/issues/834/hovercard" href="https://github.com/cornellius-gp/gpytorch/issues/834">cornellius-gp/gpytorch#834</a> . But, attempting to write minimal code to reproduce that, I hit this other bug instead.</p> <h2 dir="auto">Expected behavior</h2> <p dir="auto">The gradient for <code class="notranslate">vec</code> should be calculated, and the program should not crash.</p> <h2 dir="auto">Environment</h2> <p dir="auto">I have reproduced this bug in <code class="notranslate">master</code>, and Pytorch 1.4.</p> <details> <summary> Details of master version</summary> <blockquote> <p dir="auto">PyTorch version: 1.6.0a0+cf82011<br> Is debug build: No<br> CUDA used to build PyTorch: 10.0</p> <p dir="auto">OS: Ubuntu 16.04.6 LTS<br> GCC version: (Ubuntu 7.1.0-10ubuntu1~16.04.york0) 7.1.0<br> CMake version: version 3.14.0</p> <p dir="auto">Python version: 3.7<br> Is CUDA available: Yes<br> CUDA runtime version: 10.0.130<br> GPU models and configuration:<br> GPU 0: GeForce GTX 1080<br> GPU 1: GeForce GT 710</p> <p dir="auto">Nvidia driver version: 418.87.01<br> cuDNN version: /usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.5</p> <p dir="auto">Versions of relevant libraries:<br> [pip3] numpy==1.11.0<br> [conda] blas 1.0 mkl<br> [conda] gpytorch 1.0.1 dev_0 <br> [conda] magma-cuda100 2.5.2 1 pytorch<br> [conda] mkl 2020.0 166<br> [conda] mkl-include 2020.1 217<br> [conda] mkl-service 2.3.0 py37he904b0f_0<br> [conda] mkl_fft 1.0.15 py37ha843d7b_0<br> [conda] mkl_random 1.1.0 py37hd6b4f25_0<br> [conda] numpy 1.18.1 py37h4f9e942_0<br> [conda] numpy-base 1.18.1 py37hde5b4d6_1<br> [conda] numpydoc 0.9.2 py_0<br> [conda] torch 1.6.0a0+cf82011 pypi_0 pypi<br> [conda] torchvision 0.6.0 pypi_0 pypi</p> </blockquote> </details> <details> <summary>Details of 1.4.0 version</summary> <blockquote> <p dir="auto">PyTorch version: 1.4.0<br> Is debug build: No<br> CUDA used to build PyTorch: 10.1</p> <p dir="auto">OS: Ubuntu 16.04.6 LTS<br> GCC version: (Ubuntu 7.1.0-10ubuntu1~16.04.york0) 7.1.0<br> CMake version: version 3.16.0-rc3</p> <p dir="auto">Python version: 3.7<br> Is CUDA available: Yes<br> CUDA runtime version: 10.1.243<br> GPU models and configuration:<br> GPU 0: GeForce GTX 1080<br> GPU 1: GeForce GT 710</p> <p dir="auto">Nvidia driver version: 418.87.01<br> cuDNN version: /usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.5</p> <p dir="auto">Versions of relevant libraries:<br> [pip3] gpytorch==1.0.1<br> [pip3] numpy==1.18.2<br> [pip3] torch==1.4.0<br> [pip3] torchvision==0.5.0<br> [conda] Could not collect</p> </blockquote> </details> <h2 dir="auto">Additional context</h2> <p dir="auto">I would fix this myself but the C++ call stack is too deep and I get lost. I also don't know where the <code class="notranslate">generated/</code> functions come from. Thus I pass the baton to you, and will use a workaround.</p> <h2 dir="auto">Workaround</h2> <p dir="auto">Use <code class="notranslate">vec.unsqueeze(-1)</code> to turn it into a <code class="notranslate">gemm</code>. Squeeze the result.</p> <p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ezyang/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ezyang">@ezyang</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ssnl/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ssnl">@ssnl</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/albanD/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/albanD">@albanD</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/zou3519/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/zou3519">@zou3519</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/gqchen/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/gqchen">@gqchen</a></p>
<h2 dir="auto"><g-emoji class="g-emoji" alias="bug" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f41b.png">🐛</g-emoji> Bug</h2> <h2 dir="auto">To Reproduce</h2> <p dir="auto">Steps to reproduce the behavior:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import torch import torch.nn as nn torch.set_default_tensor_type('torch.cuda.FloatTensor') x = nn.Parameter(torch.ones(2, 2)) (x @ torch.ones(2)).sum().backward() --------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) &lt;ipython-input-11-c3b66f275e9a&gt; in &lt;module&gt;() 1 x = nn.Parameter(torch.ones(2, 2)) ----&gt; 2 (x @ torch.ones(2)).sum().backward() 1 frames /usr/local/lib/python3.6/dist-packages/torch/autograd/__init__.py in backward(tensors, grad_tensors, retain_graph, create_graph, grad_variables) 97 Variable._execution_engine.run_backward( 98 tensors, grad_tensors, retain_graph, create_graph, ---&gt; 99 allow_unreachable=True) # allow_unreachable flag 100 101 RuntimeError: cublas runtime error : an invalid numeric value was used as an argument at /pytorch/aten/src/THC/THCBlas.cu:120"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">torch</span> <span class="pl-k">import</span> <span class="pl-s1">torch</span>.<span class="pl-s1">nn</span> <span class="pl-k">as</span> <span class="pl-s1">nn</span> <span class="pl-s1">torch</span>.<span class="pl-en">set_default_tensor_type</span>(<span class="pl-s">'torch.cuda.FloatTensor'</span>) <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-s1">nn</span>.<span class="pl-v">Parameter</span>(<span class="pl-s1">torch</span>.<span class="pl-en">ones</span>(<span class="pl-c1">2</span>, <span class="pl-c1">2</span>)) (<span class="pl-s1">x</span> @ <span class="pl-s1">torch</span>.<span class="pl-en">ones</span>(<span class="pl-c1">2</span>)).<span class="pl-en">sum</span>().<span class="pl-en">backward</span>() <span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-v">RuntimeError</span> <span class="pl-v">Traceback</span> (<span class="pl-s1">most</span> <span class="pl-s1">recent</span> <span class="pl-s1">call</span> <span class="pl-s1">last</span>) <span class="pl-c1">&lt;</span><span class="pl-s1">ipython</span><span class="pl-c1">-</span><span class="pl-s1">input</span><span class="pl-c1">-</span><span class="pl-c1">11</span><span class="pl-c1">-</span><span class="pl-s1">c3b66f275e9a</span><span class="pl-c1">&gt;</span> <span class="pl-s1">in</span> <span class="pl-c1">&lt;</span><span class="pl-s1">module</span><span class="pl-c1">&gt;</span>() <span class="pl-c1">1</span> <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-s1">nn</span>.<span class="pl-v">Parameter</span>(<span class="pl-s1">torch</span>.<span class="pl-en">ones</span>(<span class="pl-c1">2</span>, <span class="pl-c1">2</span>)) <span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">2</span> (<span class="pl-s1">x</span> @ <span class="pl-s1">torch</span>.<span class="pl-en">ones</span>(<span class="pl-c1">2</span>)).<span class="pl-en">sum</span>().<span class="pl-en">backward</span>() <span class="pl-c1">1</span> <span class="pl-s1">frames</span> <span class="pl-c1">/</span><span class="pl-s1">usr</span><span class="pl-c1">/</span><span class="pl-s1">local</span><span class="pl-c1">/</span><span class="pl-s1">lib</span><span class="pl-c1">/</span><span class="pl-s1">python3</span>.<span class="pl-c1">6</span><span class="pl-c1">/</span><span class="pl-s1">dist</span><span class="pl-c1">-</span><span class="pl-s1">packages</span><span class="pl-c1">/</span><span class="pl-s1">torch</span><span class="pl-c1">/</span><span class="pl-s1">autograd</span><span class="pl-c1">/</span><span class="pl-s1">__init__</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">backward</span>(<span class="pl-s1">tensors</span>, <span class="pl-s1">grad_tensors</span>, <span class="pl-s1">retain_graph</span>, <span class="pl-s1">create_graph</span>, <span class="pl-s1">grad_variables</span>) <span class="pl-c1">97</span> <span class="pl-v">Variable</span>.<span class="pl-s1">_execution_engine</span>.<span class="pl-en">run_backward</span>( <span class="pl-c1">98</span> <span class="pl-s1">tensors</span>, <span class="pl-s1">grad_tensors</span>, <span class="pl-s1">retain_graph</span>, <span class="pl-s1">create_graph</span>, <span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">99</span> <span class="pl-s1">allow_unreachable</span><span class="pl-c1">=</span><span class="pl-c1">True</span>) <span class="pl-c"># allow_unreachable flag</span> <span class="pl-c1">100</span> <span class="pl-c1">101</span> <span class="pl-v">RuntimeError</span>: <span class="pl-s1">cublas</span> <span class="pl-s1">runtime</span> <span class="pl-s1">error</span> : <span class="pl-s1">an</span> <span class="pl-s1">invalid</span> <span class="pl-s1">numeric</span> <span class="pl-s1">value</span> <span class="pl-s1">was</span> <span class="pl-s1">used</span> <span class="pl-k">as</span> <span class="pl-s1">an</span> <span class="pl-s1">argument</span> <span class="pl-s1">at</span> <span class="pl-c1">/</span><span class="pl-s1">pytorch</span><span class="pl-c1">/</span><span class="pl-s1">aten</span><span class="pl-c1">/</span><span class="pl-s1">src</span><span class="pl-c1">/</span><span class="pl-v">THC</span><span class="pl-c1">/</span><span class="pl-v">THCBlas</span>.<span class="pl-s1">cu</span>:<span class="pl-c1">120</span></pre></div> <h2 dir="auto">Expected behavior</h2> <p dir="auto">No exception is raised.</p> <h2 dir="auto">Environment</h2> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Collecting environment information... PyTorch version: 1.3.1+cu100 Is debug build: No CUDA used to build PyTorch: 10.0.130 OS: Ubuntu 18.04.3 LTS GCC version: (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 CMake version: version 3.12.0 Python version: 3.6 Is CUDA available: Yes CUDA runtime version: 10.0.130 GPU models and configuration: GPU 0: Tesla T4 Nvidia driver version: 418.67 cuDNN version: /usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.3 Versions of relevant libraries: [pip3] numpy==1.17.4 [pip3] torch==1.3.1+cu100 [pip3] torchsummary==1.5.1 [pip3] torchtext==0.3.1 [pip3] torchvision==0.4.2+cu100 [conda] Could not collect"><pre class="notranslate"><code class="notranslate">Collecting environment information... PyTorch version: 1.3.1+cu100 Is debug build: No CUDA used to build PyTorch: 10.0.130 OS: Ubuntu 18.04.3 LTS GCC version: (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 CMake version: version 3.12.0 Python version: 3.6 Is CUDA available: Yes CUDA runtime version: 10.0.130 GPU models and configuration: GPU 0: Tesla T4 Nvidia driver version: 418.67 cuDNN version: /usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.3 Versions of relevant libraries: [pip3] numpy==1.17.4 [pip3] torch==1.3.1+cu100 [pip3] torchsummary==1.5.1 [pip3] torchtext==0.3.1 [pip3] torchvision==0.4.2+cu100 [conda] Could not collect </code></pre></div> <p dir="auto">This code was run on Google Colab. The bug also reproduces on my server (Ubuntu 16.04LTS, 4x GTX1080Ti GPUs).</p> <h2 dir="auto">Additional context</h2> <p dir="auto">The bug doesn't occur if:</p> <ol dir="auto"> <li>If I replace <code class="notranslate">sum()</code> with <code class="notranslate">mean()</code></li> </ol> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="(x @ torch.ones(2)).mean().backward()"><pre class="notranslate">(<span class="pl-s1">x</span> @ <span class="pl-s1">torch</span>.<span class="pl-en">ones</span>(<span class="pl-c1">2</span>)).<span class="pl-en">mean</span>().<span class="pl-en">backward</span>()</pre></div> <ol start="2" dir="auto"> <li>If I use a different shape of the tensor</li> </ol> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="(x @ torch.ones(2, 1)).sum().backward()"><pre class="notranslate">(<span class="pl-s1">x</span> @ <span class="pl-s1">torch</span>.<span class="pl-en">ones</span>(<span class="pl-c1">2</span>, <span class="pl-c1">1</span>)).<span class="pl-en">sum</span>().<span class="pl-en">backward</span>()</pre></div> <ol start="3" dir="auto"> <li>If I run the code on CPU</li> </ol> <p dir="auto">Therefore, I believe that this is not intended behavior.</p> <p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ezyang/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ezyang">@ezyang</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/gchanan/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/gchanan">@gchanan</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/zou3519/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/zou3519">@zou3519</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jerryzh168/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jerryzh168">@jerryzh168</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ssnl/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ssnl">@ssnl</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/albanD/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/albanD">@albanD</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/gqchen/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/gqchen">@gqchen</a></p>
1
<p dir="auto">Hello Everyone,</p> <p dir="auto">I am a newbie to Electron (Atom-shell), Was figuring out the api provided in ATOM shell. While doing mock up codes. I was unable to find any api to retrieve cookies and delete specific cookies for domain.</p> <p dir="auto">Am i missing something, can someone put me in a right direction.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Mac : ~/Library/Application Support/&lt;appName&gt;/Cookies i deleted all were gone. windows : appData/&lt;appName&gt;/cookies "><pre class="notranslate"><code class="notranslate">Mac : ~/Library/Application Support/&lt;appName&gt;/Cookies i deleted all were gone. windows : appData/&lt;appName&gt;/cookies </code></pre></div> <p dir="auto">deletion will delete everything But is there any api to collect all Cookies and manage selective domains to delete them? or can we enable <a href="https://developer.chrome.com/extensions/cookies" rel="nofollow">https://developer.chrome.com/extensions/cookies</a> api</p> <p dir="auto">BTW, I just love the architecture and way atom is working embedding CEF and Node</p> <p dir="auto">Cheers!!!!!</p>
<p dir="auto">Can atom-shell support cookie?</p>
1
<h2 dir="auto">Bug Report</h2> <p dir="auto">I'm use <a href="https://github.com/AlexGilleran/jsx-control-statements">[email protected]</a> plugin.<br> Production build is work properly but when I start development mode I have error <code class="notranslate">undefined is not a function</code></p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/3369304/111654069-79906c00-8819-11eb-855e-6aa094b053b6.png"><img src="https://user-images.githubusercontent.com/3369304/111654069-79906c00-8819-11eb-855e-6aa094b053b6.png" alt="image" style="max-width: 100%;"></a></p> <p dir="auto">In the source code of my development build I see this</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/3369304/111654253-a3e22980-8819-11eb-88e6-d80818d4ecad.png"><img src="https://user-images.githubusercontent.com/3369304/111654253-a3e22980-8819-11eb-88e6-d80818d4ecad.png" alt="image" style="max-width: 100%;"></a></p> <p dir="auto"><strong>Expected behavior</strong><br> Development build work properly</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- Babel version(s): v7.13.10 - Node/npm version: Node 13 - Monorepo: no - How you are using Babel: webpack"><pre class="notranslate"><code class="notranslate">- Babel version(s): v7.13.10 - Node/npm version: Node 13 - Monorepo: no - How you are using Babel: webpack </code></pre></div> <p dir="auto"><strong>Additional context</strong></p> <p dir="auto">I found similar issue with <a href="https://github.com/airbnb/babel-plugin-inline-react-svg/issues/91" data-hovercard-type="issue" data-hovercard-url="/airbnb/babel-plugin-inline-react-svg/issues/91/hovercard">babel-plugin-inline-react-svg</a></p>
<p dir="auto">I've run into this a couple of times recently and haven't been able to figure out why it happens. I put together this small test case:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var className = `${prefix}__header`; var obj = {}; obj[className] = true; obj[className + '--open'] = true; obj[className + '--active'] = true; // This works var classes = cx(obj); // This doesn't var classes = cx({ [className]: true, [className + '--open']: true, [className + '--active']: true });"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">className</span> <span class="pl-c1">=</span> <span class="pl-s">`<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">prefix</span><span class="pl-kos">}</span></span>__header`</span><span class="pl-kos">;</span> <span class="pl-k">var</span> <span class="pl-s1">obj</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-s1">obj</span><span class="pl-kos">[</span><span class="pl-s1">className</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span><span class="pl-kos">;</span> <span class="pl-s1">obj</span><span class="pl-kos">[</span><span class="pl-s1">className</span> <span class="pl-c1">+</span> <span class="pl-s">'--open'</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span><span class="pl-kos">;</span> <span class="pl-s1">obj</span><span class="pl-kos">[</span><span class="pl-s1">className</span> <span class="pl-c1">+</span> <span class="pl-s">'--active'</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span><span class="pl-kos">;</span> <span class="pl-c">// This works</span> <span class="pl-k">var</span> <span class="pl-s1">classes</span> <span class="pl-c1">=</span> <span class="pl-en">cx</span><span class="pl-kos">(</span><span class="pl-s1">obj</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// This doesn't</span> <span class="pl-k">var</span> <span class="pl-s1">classes</span> <span class="pl-c1">=</span> <span class="pl-en">cx</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-kos">[</span><span class="pl-s1">className</span><span class="pl-kos">]</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-s1">className</span> <span class="pl-c1">+</span> <span class="pl-s">'--open'</span><span class="pl-kos">]</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-s1">className</span> <span class="pl-c1">+</span> <span class="pl-s">'--active'</span><span class="pl-kos">]</span>: <span class="pl-c1">true</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p dir="auto">With the error</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Parse Error: Duplicate data property in object literal not allowed in strict mode"><pre class="notranslate"><code class="notranslate">Parse Error: Duplicate data property in object literal not allowed in strict mode </code></pre></div>
0
<p dir="auto"><strong>TypeScript Version:</strong></p> <p dir="auto">nightly (1.9.0-dev.20160522-1.0)</p> <p dir="auto"><strong>Description</strong></p> <p dir="auto">I'm trying to add a reference from the root:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import {Hero} from &quot;/models/hero&quot;;"><pre class="notranslate"><code class="notranslate">import {Hero} from "/models/hero"; </code></pre></div> <p dir="auto">But it only works if I add both <code class="notranslate">models</code> and <code class="notranslate">/models</code> to the rootDirs array:</p> <p dir="auto">tsconfig.json</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" &quot;rootDirs&quot;: [ &quot;models&quot;, &quot;/models&quot; ] "><pre class="notranslate"><code class="notranslate"> "rootDirs": [ "models", "/models" ] </code></pre></div> <p dir="auto">If I only use one (either one) I get <code class="notranslate">error TS2307: Cannot find module '/models/hero'</code></p> <p dir="auto">Seems odd that I need both for it to work.</p>
<p dir="auto"><strong>TypeScript Version:</strong></p> <p dir="auto">nightly (1.9.0-dev.20160217)</p> <p dir="auto"><strong>Code</strong></p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="let greeting:string; let x = (message: string | number) =&gt; { if (typeof message !== &quot;string&quot;) { return; } // It's obvious, that message must be a string now. It works with &quot;else statement&quot; but not with early return. greeting = message; } }"><pre class="notranslate"><span class="pl-k">let</span> <span class="pl-s1">greeting</span>:<span class="pl-smi">string</span><span class="pl-kos">;</span> <span class="pl-k">let</span> <span class="pl-en">x</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-s1">message</span>: <span class="pl-smi">string</span> <span class="pl-c1">|</span> <span class="pl-smi">number</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-k">typeof</span> <span class="pl-s1">message</span> <span class="pl-c1">!==</span> <span class="pl-s">"string"</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-c">// It's obvious, that message must be a string now. It works with "else statement" but not with early return.</span> <span class="pl-s1">greeting</span> <span class="pl-c1">=</span> <span class="pl-s1">message</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <p dir="auto"><strong>Expected behavior:</strong><br> No raising error.</p> <p dir="auto"><strong>Actual behavior:</strong><br> Compiler raises an error that type string | number cannot be assigned to string variable.</p>
0
<p dir="auto"><strong>1 What version of Go are you using (go version)?</strong></p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ go version go version go1.6 linux/amd64"><pre class="notranslate"><code class="notranslate">$ go version go version go1.6 linux/amd64 </code></pre></div> <p dir="auto"><strong>2 What operating system and processor architecture are you using?</strong></p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ cat /etc/issue Ubuntu 15.10 \n \l $ lscpu Architecture: x86_64 ..."><pre class="notranslate"><code class="notranslate">$ cat /etc/issue Ubuntu 15.10 \n \l $ lscpu Architecture: x86_64 ... </code></pre></div> <p dir="auto"><strong>3 What did you do?</strong></p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ tree $GOPATH/src ├── a │ ├── a.go │ └── vendor │ └── b │ └── b.go └── build └── main.go $ cat $GOPATH/src/build/main.go"><pre class="notranslate"><code class="notranslate">$ tree $GOPATH/src ├── a │ ├── a.go │ └── vendor │ └── b │ └── b.go └── build └── main.go $ cat $GOPATH/src/build/main.go </code></pre></div> <div class="highlight highlight-source-go notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="package main import ( &quot;go/ast&quot; &quot;go/build&quot; &quot;go/importer&quot; &quot;go/parser&quot; &quot;go/token&quot; &quot;go/types&quot; &quot;os&quot; &quot;path&quot; ) func panicOnErr(err error) { if err != nil { panic(err.Error()) } } func main() { gopath := os.Getenv(&quot;GOPATH&quot;) dir := path.Join(gopath, &quot;src&quot;, &quot;a&quot;) // println(&quot;dir: &quot; + dir) fset := token.NewFileSet() buildPkg, err := build.ImportDir(dir, build.ImportMode(0)) panicOnErr(err) astFiles := []*ast.File{} for _, filename := range buildPkg.GoFiles { file, err := parser.ParseFile(fset, path.Join(dir, filename), nil, parser.AllErrors) panicOnErr(err) astFiles = append(astFiles, file) } for _, filename := range buildPkg.CgoFiles { file, err := parser.ParseFile(fset, path.Join(dir, filename), nil, parser.AllErrors) panicOnErr(err) astFiles = append(astFiles, file) } typesInfo := &amp;types.Info{ Types: make(map[ast.Expr]types.TypeAndValue), Defs: make(map[*ast.Ident]types.Object), Uses: make(map[*ast.Ident]types.Object), } var conf types.Config conf.Importer = importer.Default() conf.IgnoreFuncBodies = true typesPkg, err := conf.Check(buildPkg.Name, fset, astFiles, typesInfo) panicOnErr(err) _ = typesPkg }"><pre class="notranslate"><span class="pl-k">package</span> main <span class="pl-k">import</span> ( <span class="pl-s">"go/ast"</span> <span class="pl-s">"go/build"</span> <span class="pl-s">"go/importer"</span> <span class="pl-s">"go/parser"</span> <span class="pl-s">"go/token"</span> <span class="pl-s">"go/types"</span> <span class="pl-s">"os"</span> <span class="pl-s">"path"</span> ) <span class="pl-k">func</span> <span class="pl-en">panicOnErr</span>(<span class="pl-s1">err</span> <span class="pl-smi">error</span>) { <span class="pl-k">if</span> <span class="pl-s1">err</span> <span class="pl-c1">!=</span> <span class="pl-c1">nil</span> { <span class="pl-en">panic</span>(<span class="pl-s1">err</span>.<span class="pl-en">Error</span>()) } } <span class="pl-k">func</span> <span class="pl-en">main</span>() { <span class="pl-s1">gopath</span> <span class="pl-c1">:=</span> <span class="pl-s1">os</span>.<span class="pl-en">Getenv</span>(<span class="pl-s">"GOPATH"</span>) <span class="pl-s1">dir</span> <span class="pl-c1">:=</span> <span class="pl-s1">path</span>.<span class="pl-en">Join</span>(<span class="pl-s1">gopath</span>, <span class="pl-s">"src"</span>, <span class="pl-s">"a"</span>) <span class="pl-c">// println("dir: " + dir)</span> <span class="pl-s1">fset</span> <span class="pl-c1">:=</span> <span class="pl-s1">token</span>.<span class="pl-en">NewFileSet</span>() <span class="pl-s1">buildPkg</span>, <span class="pl-s1">err</span> <span class="pl-c1">:=</span> <span class="pl-s1">build</span>.<span class="pl-en">ImportDir</span>(<span class="pl-s1">dir</span>, <span class="pl-s1">build</span>.<span class="pl-en">ImportMode</span>(<span class="pl-c1">0</span>)) <span class="pl-en">panicOnErr</span>(<span class="pl-s1">err</span>) <span class="pl-s1">astFiles</span> <span class="pl-c1">:=</span> []<span class="pl-c1">*</span>ast.<span class="pl-smi">File</span>{} <span class="pl-k">for</span> <span class="pl-s1">_</span>, <span class="pl-s1">filename</span> <span class="pl-c1">:=</span> <span class="pl-k">range</span> <span class="pl-s1">buildPkg</span>.<span class="pl-c1">GoFiles</span> { <span class="pl-s1">file</span>, <span class="pl-s1">err</span> <span class="pl-c1">:=</span> <span class="pl-s1">parser</span>.<span class="pl-en">ParseFile</span>(<span class="pl-s1">fset</span>, <span class="pl-s1">path</span>.<span class="pl-en">Join</span>(<span class="pl-s1">dir</span>, <span class="pl-s1">filename</span>), <span class="pl-c1">nil</span>, <span class="pl-s1">parser</span>.<span class="pl-c1">AllErrors</span>) <span class="pl-en">panicOnErr</span>(<span class="pl-s1">err</span>) <span class="pl-s1">astFiles</span> <span class="pl-c1">=</span> <span class="pl-en">append</span>(<span class="pl-s1">astFiles</span>, <span class="pl-s1">file</span>) } <span class="pl-k">for</span> <span class="pl-s1">_</span>, <span class="pl-s1">filename</span> <span class="pl-c1">:=</span> <span class="pl-k">range</span> <span class="pl-s1">buildPkg</span>.<span class="pl-c1">CgoFiles</span> { <span class="pl-s1">file</span>, <span class="pl-s1">err</span> <span class="pl-c1">:=</span> <span class="pl-s1">parser</span>.<span class="pl-en">ParseFile</span>(<span class="pl-s1">fset</span>, <span class="pl-s1">path</span>.<span class="pl-en">Join</span>(<span class="pl-s1">dir</span>, <span class="pl-s1">filename</span>), <span class="pl-c1">nil</span>, <span class="pl-s1">parser</span>.<span class="pl-c1">AllErrors</span>) <span class="pl-en">panicOnErr</span>(<span class="pl-s1">err</span>) <span class="pl-s1">astFiles</span> <span class="pl-c1">=</span> <span class="pl-en">append</span>(<span class="pl-s1">astFiles</span>, <span class="pl-s1">file</span>) } <span class="pl-s1">typesInfo</span> <span class="pl-c1">:=</span> <span class="pl-c1">&amp;</span>types.<span class="pl-smi">Info</span>{ <span class="pl-c1">Types</span>: <span class="pl-en">make</span>(<span class="pl-k">map</span>[ast.<span class="pl-smi">Expr</span>]types.<span class="pl-smi">TypeAndValue</span>), <span class="pl-c1">Defs</span>: <span class="pl-en">make</span>(<span class="pl-k">map</span>[<span class="pl-c1">*</span>ast.<span class="pl-smi">Ident</span>]types.<span class="pl-smi">Object</span>), <span class="pl-c1">Uses</span>: <span class="pl-en">make</span>(<span class="pl-k">map</span>[<span class="pl-c1">*</span>ast.<span class="pl-smi">Ident</span>]types.<span class="pl-smi">Object</span>), } <span class="pl-k">var</span> <span class="pl-s1">conf</span> types.<span class="pl-smi">Config</span> <span class="pl-s1">conf</span>.<span class="pl-c1">Importer</span> <span class="pl-c1">=</span> <span class="pl-s1">importer</span>.<span class="pl-en">Default</span>() <span class="pl-s1">conf</span>.<span class="pl-c1">IgnoreFuncBodies</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span> <span class="pl-s1">typesPkg</span>, <span class="pl-s1">err</span> <span class="pl-c1">:=</span> <span class="pl-s1">conf</span>.<span class="pl-en">Check</span>(<span class="pl-s1">buildPkg</span>.<span class="pl-c1">Name</span>, <span class="pl-s1">fset</span>, <span class="pl-s1">astFiles</span>, <span class="pl-s1">typesInfo</span>) <span class="pl-en">panicOnErr</span>(<span class="pl-s1">err</span>) <span class="pl-s1">_</span> <span class="pl-c1">=</span> <span class="pl-s1">typesPkg</span> }</pre></div> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ cat $GOPATH/src/a/a.go"><pre class="notranslate"><code class="notranslate">$ cat $GOPATH/src/a/a.go </code></pre></div> <div class="highlight highlight-source-go notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" package a import &quot;b&quot; var foo = b.Foo"><pre class="notranslate"> <span class="pl-k">package</span> a <span class="pl-k">import</span> <span class="pl-s">"b"</span> <span class="pl-k">var</span> <span class="pl-s1">foo</span> <span class="pl-c1">=</span> <span class="pl-s1">b</span>.<span class="pl-c1">Foo</span></pre></div> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ cat $GOPATH/src/a/vendor/b/b.go"><pre class="notranslate"><code class="notranslate">$ cat $GOPATH/src/a/vendor/b/b.go </code></pre></div> <div class="highlight highlight-source-go notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" package b var Foo = &quot;bar&quot;"><pre class="notranslate"> <span class="pl-k">package</span> b <span class="pl-k">var</span> <span class="pl-s1">Foo</span> <span class="pl-c1">=</span> <span class="pl-s">"bar"</span></pre></div> <p dir="auto"><strong>4 What did you expect to see?</strong></p> <p dir="auto">Nothing (that's OK)</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ go run build/main.go"><pre class="notranslate"><code class="notranslate">$ go run build/main.go </code></pre></div> <p dir="auto"><strong>5 What did you see instead?</strong></p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ go env &amp;&amp; go version &amp;&amp; go run $GOPATH/src/build/main.go GOARCH=&quot;amd64&quot; GOBIN=&quot;&quot; GOEXE=&quot;&quot; GOHOSTARCH=&quot;amd64&quot; GOHOSTOS=&quot;linux&quot; GOOS=&quot;linux&quot; GOPATH=&quot;/home/benny/Entwicklung/testdebug/gopath&quot; GORACE=&quot;&quot; GOROOT=&quot;/home/benny/bin/go&quot; GOTOOLDIR=&quot;/home/benny/bin/go/pkg/tool/linux_amd64&quot; GO15VENDOREXPERIMENT=&quot;1&quot; CC=&quot;gcc&quot; GOGCCFLAGS=&quot;-fPIC -m64 -pthread -fmessage-length=0&quot; CXX=&quot;g++&quot; CGO_ENABLED=&quot;1&quot; go version go1.6 linux/amd64 panic: a/a.go:3:8: could not import b (can't find import: a/vendor/b) goroutine 1 [running]: panic(0x653760, 0xc82000ade0) go/src/runtime/panic.go:464 +0x3e6 main.panicOnErr(0x7fb0a76aac58, 0xc82000fe00) build/main.go:16 +0x7e main.main() build/main.go:56 +0x8bd exit status 2"><pre class="notranslate"><code class="notranslate">$ go env &amp;&amp; go version &amp;&amp; go run $GOPATH/src/build/main.go GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/benny/Entwicklung/testdebug/gopath" GORACE="" GOROOT="/home/benny/bin/go" GOTOOLDIR="/home/benny/bin/go/pkg/tool/linux_amd64" GO15VENDOREXPERIMENT="1" CC="gcc" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0" CXX="g++" CGO_ENABLED="1" go version go1.6 linux/amd64 panic: a/a.go:3:8: could not import b (can't find import: a/vendor/b) goroutine 1 [running]: panic(0x653760, 0xc82000ade0) go/src/runtime/panic.go:464 +0x3e6 main.panicOnErr(0x7fb0a76aac58, 0xc82000fe00) build/main.go:16 +0x7e main.main() build/main.go:56 +0x8bd exit status 2 </code></pre></div> <p dir="auto"><strong>Further information</strong></p> <p dir="auto">When installing the vendor package</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ go install $GOPATH/src/a/vendor/b "><pre class="notranslate"><code class="notranslate">$ go install $GOPATH/src/a/vendor/b </code></pre></div> <p dir="auto">before running</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ go run $GOPATH/src/build/main.go"><pre class="notranslate"><code class="notranslate">$ go run $GOPATH/src/build/main.go </code></pre></div> <p dir="auto">It runs fine as expected. After removing the build</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ rm $GOPATH/pkg/linux_amd64/a/vendor/b.a"><pre class="notranslate"><code class="notranslate">$ rm $GOPATH/pkg/linux_amd64/a/vendor/b.a </code></pre></div> <p dir="auto">It complains again</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ go run $GOPATH/src/build/main.go panic: a/a.go:3:8: could not import b (can't find import: a/vendor/b) goroutine 1 [running]: panic(0x653760, 0xc82000ade0) go/src/runtime/panic.go:464 +0x3e6 main.panicOnErr(0x7fb0a76aac58, 0xc82000fe00) build/main.go:16 +0x7e main.main() build/main.go:56 +0x8bd exit status 2"><pre class="notranslate"><code class="notranslate">$ go run $GOPATH/src/build/main.go panic: a/a.go:3:8: could not import b (can't find import: a/vendor/b) goroutine 1 [running]: panic(0x653760, 0xc82000ade0) go/src/runtime/panic.go:464 +0x3e6 main.panicOnErr(0x7fb0a76aac58, 0xc82000fe00) build/main.go:16 +0x7e main.main() build/main.go:56 +0x8bd exit status 2 </code></pre></div> <p dir="auto">Probably related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="131174883" data-permission-text="Title is private" data-url="https://github.com/golang/go/issues/14215" data-hovercard-type="issue" data-hovercard-url="/golang/go/issues/14215/hovercard" href="https://github.com/golang/go/issues/14215">#14215</a></p>
<p dir="auto">It is common to use go/types is as part of a go generate command<br> or other command line tool to introspect a Go package.</p> <p dir="auto">The go tool goes to some lengths to ensure that whenever<br> you operate on a package, it builds the source for that<br> package into object form before using it, so you don't<br> end up using symbol information that's out of date with respect<br> to the source.</p> <p dir="auto">When using go/types from a command line tool, you<br> don't have that luxury, and it's not necessarily appropriate<br> to call "go install" automatically.</p> <p dir="auto">I believe that a better way would be for the default<br> importer to use the object file data only if it's newer<br> than the source files, otherwise fall back to using the<br> source directly. Or at least it would be nice to have<br> that option, so that it's easy to make go generate<br> utilities operate on the up to date code.</p> <p dir="auto">I hope this could be considered before Go 1.5 as<br> we won't be able to change this behaviour after then.</p>
1
<h3 dir="auto">Example 1</h3> <p dir="auto">This came up with a student who upgraded from 0.6 to 1.0 directly, so never even got a chance to see a deprecation warning, let alone find an explanation for new behavior:</p> <div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; beforefor = true true julia&gt; for i in 1:2 beforefor = false end julia&gt; beforefor # this is surprising bit true julia&gt; beforeif = true true julia&gt; if 1 == 1 beforeif = false end false julia&gt; beforeif # Another surprise! false julia&gt; function foo() infunc = true for i in 1:10 infunc = false end @show infunc end foo (generic function with 1 method) julia&gt; foo() # &quot;I don't get this&quot; infunc = false "><pre class="notranslate">julia<span class="pl-k">&gt;</span> beforefor <span class="pl-k">=</span> <span class="pl-c1">true</span> <span class="pl-c1">true</span> julia<span class="pl-k">&gt;</span> <span class="pl-k">for</span> i <span class="pl-k">in</span> <span class="pl-c1">1</span><span class="pl-k">:</span><span class="pl-c1">2</span> beforefor <span class="pl-k">=</span> <span class="pl-c1">false</span> <span class="pl-k">end</span> julia<span class="pl-k">&gt;</span> beforefor <span class="pl-c"><span class="pl-c">#</span> this is surprising bit</span> <span class="pl-c1">true</span> julia<span class="pl-k">&gt;</span> beforeif <span class="pl-k">=</span> <span class="pl-c1">true</span> <span class="pl-c1">true</span> julia<span class="pl-k">&gt;</span> <span class="pl-k">if</span> <span class="pl-c1">1</span> <span class="pl-k">==</span> <span class="pl-c1">1</span> beforeif <span class="pl-k">=</span> <span class="pl-c1">false</span> <span class="pl-k">end</span> <span class="pl-c1">false</span> julia<span class="pl-k">&gt;</span> beforeif <span class="pl-c"><span class="pl-c">#</span> Another surprise!</span> <span class="pl-c1">false</span> julia<span class="pl-k">&gt;</span> <span class="pl-k">function</span> <span class="pl-en">foo</span>() infunc <span class="pl-k">=</span> <span class="pl-c1">true</span> <span class="pl-k">for</span> i <span class="pl-k">in</span> <span class="pl-c1">1</span><span class="pl-k">:</span><span class="pl-c1">10</span> infunc <span class="pl-k">=</span> <span class="pl-c1">false</span> <span class="pl-k">end</span> <span class="pl-c1">@show</span> infunc <span class="pl-k">end</span> foo (generic <span class="pl-k">function</span> with <span class="pl-c1">1</span> method) julia<span class="pl-k">&gt;</span> <span class="pl-c1">foo</span>() <span class="pl-c"><span class="pl-c">#</span> "I don't get this"</span> infunc <span class="pl-k">=</span> <span class="pl-c1">false</span> </pre></div> <h3 dir="auto">Example 2</h3> <div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; total_lines = 0 0 julia&gt; list_of_files = [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;] 3-element Array{String,1}: &quot;a&quot; &quot;b&quot; &quot;c&quot; julia&gt; for file in list_of_files # fake read file lines_in_file = 5 total_lines += lines_in_file end ERROR: UndefVarError: total_lines not defined Stacktrace: [1] top-level scope at ./REPL[3]:4 [inlined] [2] top-level scope at ./none:0 julia&gt; total_lines # This crushs the students willingness to learn 0"><pre class="notranslate">julia<span class="pl-k">&gt;</span> total_lines <span class="pl-k">=</span> <span class="pl-c1">0</span> <span class="pl-c1">0</span> julia<span class="pl-k">&gt;</span> list_of_files <span class="pl-k">=</span> [<span class="pl-s"><span class="pl-pds">"</span>a<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>b<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>c<span class="pl-pds">"</span></span>] <span class="pl-c1">3</span><span class="pl-k">-</span>element Array{String,<span class="pl-c1">1</span>}<span class="pl-k">:</span> <span class="pl-s"><span class="pl-pds">"</span>a<span class="pl-pds">"</span></span> <span class="pl-s"><span class="pl-pds">"</span>b<span class="pl-pds">"</span></span> <span class="pl-s"><span class="pl-pds">"</span>c<span class="pl-pds">"</span></span> julia<span class="pl-k">&gt;</span> <span class="pl-k">for</span> file <span class="pl-k">in</span> list_of_files <span class="pl-c"><span class="pl-c">#</span> fake read file</span> lines_in_file <span class="pl-k">=</span> <span class="pl-c1">5</span> total_lines <span class="pl-k">+=</span> lines_in_file <span class="pl-k">end</span> ERROR<span class="pl-k">:</span> UndefVarError<span class="pl-k">:</span> total_lines not defined Stacktrace<span class="pl-k">:</span> [<span class="pl-c1">1</span>] top<span class="pl-k">-</span>level scope at <span class="pl-k">./</span>REPL[<span class="pl-c1">3</span>]<span class="pl-k">:</span><span class="pl-c1">4</span> [inlined] [<span class="pl-c1">2</span>] top<span class="pl-k">-</span>level scope at <span class="pl-k">./</span>none<span class="pl-k">:</span><span class="pl-c1">0</span> julia<span class="pl-k">&gt;</span> total_lines <span class="pl-c"><span class="pl-c">#</span> This crushs the students willingness to learn</span> <span class="pl-c1">0</span></pre></div> <p dir="auto">I "get" why this happens in the sense that I think I can explain, with sufficient reference to the arcana in the manual about what introduces scopes and what doesn't, but I think that this is problematic for interactive use.</p> <p dir="auto">In example one, you get a silent failure. In example two, you get an error message that is very there-is-no-spoon. Thats roughly comparable to some Python code I wrote in a notebook at work today.</p> <p dir="auto">I'm not sure what the rules are in Python, but I do know that generally you can't assign to things at the global scope without invoking global. But at the REPL it does work, presumably because at the REPL the rules are different or the same logic as if they were all are in the scope of function is applied.</p> <p dir="auto">I can't language-lawyer the rules enough to propose the concrete change I would like, and based on Slack this isn't even necessarily perceived as an issue by some people, so I don't know where to go with this except to flag it.</p> <p dir="auto">Cross-refs:<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="189236901" data-permission-text="Title is private" data-url="https://github.com/JuliaLang/julia/issues/19324" data-hovercard-type="pull_request" data-hovercard-url="/JuliaLang/julia/pull/19324/hovercard" href="https://github.com/JuliaLang/julia/pull/19324">#19324</a><br> <a href="https://discourse.julialang.org/t/repl-and-for-loops-scope-behavior-change/13514" rel="nofollow">https://discourse.julialang.org/t/repl-and-for-loops-scope-behavior-change/13514</a><br> <a href="https://stackoverflow.com/questions/51930537/scope-of-variables-in-julia" rel="nofollow">https://stackoverflow.com/questions/51930537/scope-of-variables-in-julia</a></p>
1
<p dir="auto">I am debugging PackageCompiler issue, which looks like is on Julia's C side: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="474532541" data-permission-text="Title is private" data-url="https://github.com/JuliaLang/julia/issues/32733" data-hovercard-type="issue" data-hovercard-url="/JuliaLang/julia/issues/32733/hovercard" href="https://github.com/JuliaLang/julia/issues/32733">#32733</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="469577626" data-permission-text="Title is private" data-url="https://github.com/TsurHerman/Fezzik/issues/3" data-hovercard-type="issue" data-hovercard-url="/TsurHerman/Fezzik/issues/3/hovercard" href="https://github.com/TsurHerman/Fezzik/issues/3">TsurHerman/Fezzik#3</a><br> I compiled (in Arch Linux, gcc v9.1) julia with <code class="notranslate">make debug</code>. Started julia-debug REPL, command <code class="notranslate">using Makie</code> just trowed error (using regular version of julia error is not trowed):</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; using Makie [ Info: Precompiling Makie [ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a] [Detaching after vfork from child process 25323] julia-debug: /home/kest/Projects/julia/src/gf.c:1188: check_ambiguous_visitor: Assertion `!jl_subtype((jl_value_t*)sig, (jl_value_t*)type)' failed. signal (6): Aborted in expression starting at /home/kest/.julia/packages/StructArrays/RkrVr/src/structarray.jl:80 gsignal at /usr/lib/libc.so.6 (unknown line) abort at /usr/lib/libc.so.6 (unknown line) ..."><pre class="notranslate"><code class="notranslate">julia&gt; using Makie [ Info: Precompiling Makie [ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a] [Detaching after vfork from child process 25323] julia-debug: /home/kest/Projects/julia/src/gf.c:1188: check_ambiguous_visitor: Assertion `!jl_subtype((jl_value_t*)sig, (jl_value_t*)type)' failed. signal (6): Aborted in expression starting at /home/kest/.julia/packages/StructArrays/RkrVr/src/structarray.jl:80 gsignal at /usr/lib/libc.so.6 (unknown line) abort at /usr/lib/libc.so.6 (unknown line) ... </code></pre></div> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; versioninfo() Julia Version 1.1.1 Commit 55e36cc308 (2019-05-16 04:10 UTC) DEBUG build Platform Info: OS: Linux (x86_64-pc-linux-gnu) CPU: Intel(R) Core(TM) i5-4670K CPU @ 3.40GHz WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-6.0.1 (ORCJIT, haswell)"><pre class="notranslate"><code class="notranslate">julia&gt; versioninfo() Julia Version 1.1.1 Commit 55e36cc308 (2019-05-16 04:10 UTC) DEBUG build Platform Info: OS: Linux (x86_64-pc-linux-gnu) CPU: Intel(R) Core(TM) i5-4670K CPU @ 3.40GHz WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-6.0.1 (ORCJIT, haswell) </code></pre></div> <p dir="auto">Maybe somebody can comment?</p>
<p dir="auto">While trying to track down a memory leak in <code class="notranslate">Metalhead</code>, I discovered the following assertion failure:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; using Images [ Info: Precompiling Images [916415d5-f1e6-5110-898d-aaa5f9f070e0] Assertion failed: (!jl_subtype((jl_value_t*)sig, (jl_value_t*)type)), function check_ambiguous_visitor, file /Users/sabae/src/julia/src/gf.c, line 1189. signal (6): Abort trap: 6 in expression starting at /Users/sabae/.julia/packages/Images/3bPWU/src/Images.jl:46 __pthread_kill at /usr/lib/system/libsystem_kernel.dylib (unknown line) Allocations: 3702182 (Pool: 3701803; Big: 379); GC: 5 ERROR: Failed to precompile Images [916415d5-f1e6-5110-898d-aaa5f9f070e0] to /Users/sabae/.julia/compiled/v1.1/Images/H8Vxc.ji. Stacktrace: [1] error(::String) at ./error.jl:33 [2] macro expansion at ./logging.jl:313 [inlined] [3] compilecache(::Base.PkgId, ::String) at ./loading.jl:1190 [4] macro expansion at ./logging.jl:311 [inlined] [5] _require(::Base.PkgId) at ./loading.jl:947 [6] require(::Base.PkgId) at ./loading.jl:858 [7] macro expansion at ./logging.jl:311 [inlined] [8] require(::Module, ::Symbol) at ./loading.jl:840"><pre class="notranslate"><code class="notranslate">julia&gt; using Images [ Info: Precompiling Images [916415d5-f1e6-5110-898d-aaa5f9f070e0] Assertion failed: (!jl_subtype((jl_value_t*)sig, (jl_value_t*)type)), function check_ambiguous_visitor, file /Users/sabae/src/julia/src/gf.c, line 1189. signal (6): Abort trap: 6 in expression starting at /Users/sabae/.julia/packages/Images/3bPWU/src/Images.jl:46 __pthread_kill at /usr/lib/system/libsystem_kernel.dylib (unknown line) Allocations: 3702182 (Pool: 3701803; Big: 379); GC: 5 ERROR: Failed to precompile Images [916415d5-f1e6-5110-898d-aaa5f9f070e0] to /Users/sabae/.julia/compiled/v1.1/Images/H8Vxc.ji. Stacktrace: [1] error(::String) at ./error.jl:33 [2] macro expansion at ./logging.jl:313 [inlined] [3] compilecache(::Base.PkgId, ::String) at ./loading.jl:1190 [4] macro expansion at ./logging.jl:311 [inlined] [5] _require(::Base.PkgId) at ./loading.jl:947 [6] require(::Base.PkgId) at ./loading.jl:858 [7] macro expansion at ./logging.jl:311 [inlined] [8] require(::Module, ::Symbol) at ./loading.jl:840 </code></pre></div> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; versioninfo() Julia Version 1.1.0-DEV.376 Commit 23bf90292e (2018-10-04 16:18 UTC) DEBUG build Platform Info: OS: macOS (x86_64-apple-darwin17.7.0) CPU: Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-6.0.1 (ORCJIT, skylake)"><pre class="notranslate"><code class="notranslate">julia&gt; versioninfo() Julia Version 1.1.0-DEV.376 Commit 23bf90292e (2018-10-04 16:18 UTC) DEBUG build Platform Info: OS: macOS (x86_64-apple-darwin17.7.0) CPU: Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-6.0.1 (ORCJIT, skylake) </code></pre></div>
1
<h3 dir="auto">Apache Airflow version</h3> <p dir="auto">2.4.1</p> <h3 dir="auto">What happened</h3> <p dir="auto">Clicking Refresh on the graph view of any DAG does not refresh the view, it just gets stuck refreshing forever.<br> In the JS console, it displays the following error message on each refresh:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Uncaught SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data N http://internal-airflow/static/dist/graph.c3f9b20b23ed9651c62a.js:2 jQuery 7 N http://internal-airflow/static/dist/graph.c3f9b20b23ed9651c62a.js:2 R http://internal-airflow/static/dist/graph.c3f9b20b23ed9651c62a.js:2 $/&lt; http://internal-airflow/static/dist/d3.min.js:1"><pre class="notranslate"><code class="notranslate">Uncaught SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data N http://internal-airflow/static/dist/graph.c3f9b20b23ed9651c62a.js:2 jQuery 7 N http://internal-airflow/static/dist/graph.c3f9b20b23ed9651c62a.js:2 R http://internal-airflow/static/dist/graph.c3f9b20b23ed9651c62a.js:2 $/&lt; http://internal-airflow/static/dist/d3.min.js:1 </code></pre></div> <p dir="auto">This happens even on a fresh DAG with no runs, even if the JSON returned by the request to <code class="notranslate">/object/task_instances?dag_id=test_dag&amp;execution_date=2022-10-20T11:17:22.870600+00:00</code> is empty, but also on normal DAGs.</p> <p dir="auto">The container logs also show no problems, just that the GET-request was made.</p> <h3 dir="auto">What you think should happen instead</h3> <p dir="auto">Refresh the graph.</p> <h3 dir="auto">How to reproduce</h3> <p dir="auto">Create a DAG with one EmptyOperator, go to graph view, click refresh.</p> <h3 dir="auto">Operating System</h3> <p dir="auto">CentOS 8</p> <h3 dir="auto">Versions of Apache Airflow Providers</h3> <p dir="auto">apache-airflow-providers-databricks<br> apache-airflow-providers-microsoft-azure</p> <h3 dir="auto">Deployment</h3> <p dir="auto">Docker-Compose</p> <h3 dir="auto">Deployment details</h3> <p dir="auto">Docker version 20.10.14, build a224086</p> <p dir="auto">We use official image apache/airflow:2.4.1-python3.9 slightly extended with the above providers and a custom fix for the python package <code class="notranslate">thrift</code> used by the DatabricksOperator. It's a small fix just to make it work with our proxy.</p> <h3 dir="auto">Anything else</h3> <p dir="auto">We upgraded from 2.3.3 to 2.4.1, had no problems in 2.3.3.</p> <p dir="auto">Tested with Firefox and Edge, both are the same. In Edge, the error message is <code class="notranslate">VM90:1 Uncaught SyntaxError: "[object Object]" is not valid JSON</code></p> <h3 dir="auto">Are you willing to submit PR?</h3> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Yes I am willing to submit a PR!</li> </ul> <h3 dir="auto">Code of Conduct</h3> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow this project's <a href="https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md">Code of Conduct</a></li> </ul>
<h3 dir="auto">Apache Airflow version</h3> <p dir="auto">2.4.1</p> <h3 dir="auto">What happened</h3> <p dir="auto">After starting a DAG, the auto-refresh works in the grid view but not in the graph view.</p> <p dir="auto">The top-right auto-refresh icon shows indefinitely that the page is refreshing but nothing happens.</p> <p dir="auto">It is necessary to refresh the whole page to show the current status.</p> <h3 dir="auto">What you think should happen instead</h3> <p dir="auto">The auto-refresh should work and show the current status of the tasks.</p> <h3 dir="auto">How to reproduce</h3> <p dir="auto">Start a DAG in version 2.4.1.</p> <h3 dir="auto">Operating System</h3> <p dir="auto">Alpine on Kubernetes</p> <h3 dir="auto">Versions of Apache Airflow Providers</h3> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="apache-airflow-providers-apache-hdfs==3.1.0 apache-airflow-providers-celery==3.0.0 apache-airflow-providers-cncf-kubernetes==4.4.0 apache-airflow-providers-common-sql==1.2.0 apache-airflow-providers-datadog==3.0.0 apache-airflow-providers-exasol==2.1.3 apache-airflow-providers-ftp==3.1.0 apache-airflow-providers-http==4.0.0 apache-airflow-providers-imap==3.0.0 apache-airflow-providers-jenkins==3.0.0 apache-airflow-providers-microsoft-mssql==3.2.1 apache-airflow-providers-odbc==3.1.2 apache-airflow-providers-oracle==3.1.0 apache-airflow-providers-postgres==5.0.0 apache-airflow-providers-redis==3.0.0 apache-airflow-providers-slack==5.1.0 apache-airflow-providers-sqlite==3.2.1 apache-airflow-providers-ssh==3.2.0"><pre class="notranslate"><code class="notranslate">apache-airflow-providers-apache-hdfs==3.1.0 apache-airflow-providers-celery==3.0.0 apache-airflow-providers-cncf-kubernetes==4.4.0 apache-airflow-providers-common-sql==1.2.0 apache-airflow-providers-datadog==3.0.0 apache-airflow-providers-exasol==2.1.3 apache-airflow-providers-ftp==3.1.0 apache-airflow-providers-http==4.0.0 apache-airflow-providers-imap==3.0.0 apache-airflow-providers-jenkins==3.0.0 apache-airflow-providers-microsoft-mssql==3.2.1 apache-airflow-providers-odbc==3.1.2 apache-airflow-providers-oracle==3.1.0 apache-airflow-providers-postgres==5.0.0 apache-airflow-providers-redis==3.0.0 apache-airflow-providers-slack==5.1.0 apache-airflow-providers-sqlite==3.2.1 apache-airflow-providers-ssh==3.2.0 </code></pre></div> <h3 dir="auto">Deployment</h3> <p dir="auto">Other 3rd-party Helm chart</p> <h3 dir="auto">Deployment details</h3> <p dir="auto"><em>No response</em></p> <h3 dir="auto">Anything else</h3> <p dir="auto"><em>No response</em></p> <h3 dir="auto">Are you willing to submit PR?</h3> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Yes I am willing to submit a PR!</li> </ul> <h3 dir="auto">Code of Conduct</h3> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow this project's <a href="https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md">Code of Conduct</a></li> </ul>
1
<p dir="auto">I couldn't figure out to add support for arbitrary class labels to the SVMs and add a <code class="notranslate">classes_</code> attribute.<br> I'm moving to other stuff for the moment, it would be great if someone found some time for this.</p> <p dir="auto">The trouble comes with <code class="notranslate">class_weight</code> and regression. I think it would be good to add a <code class="notranslate">LabelEncoder</code> somewhere to take care of the encoding of the <code class="notranslate">class_weights</code>. But apparently the implementation also requires a class-weights on the python side in the regression case. And the <code class="notranslate">LabelEncoder</code> should obviously not be used in the SVR.</p> <p dir="auto">This is doable but I couldn't make it pretty so I just left it :-/</p>
<p dir="auto"><code class="notranslate">from sklearn.datasets import fetch_mldata</code><br> <code class="notranslate">mnist = fetch_mldata('MNIST original', data_home='./data')</code></p> <p dir="auto">when I use this, it not working and in cmd show</p> <p dir="auto"><code class="notranslate">Traceback (most recent call last): File "mnistTest.py", line 7, in &lt;module&gt; mnist = fetch_mldata('MNIST original', data_home='./data') File "C:\Python27\lib\site-packages\sklearn\datasets\mldata.py", line 142, in fetch_mldata mldata_url = urlopen(urlname) File "C:\Python27\lib\urllib2.py", line 154, in urlopen return opener.open(url, data, timeout) File "C:\Python27\lib\urllib2.py", line 429, in open response = self._open(req, data) File "C:\Python27\lib\urllib2.py", line 447, in _open '_open', req) File "C:\Python27\lib\urllib2.py", line 407, in _call_chain result = func(*args) File "C:\Python27\lib\urllib2.py", line 1228, in http_open return self.do_open(httplib.HTTPConnection, req) File "C:\Python27\lib\urllib2.py", line 1198, in do_open raise URLError(err) urllib2.URLError: &lt;urlopen error [Errno 10060] A connection attempt failed becau se the connected party did not properly respond after a period of time, or estab lished connection failed because connected host has failed to respond&gt;</code></p>
0
<h4 dir="auto">Problem description</h4> <p dir="auto">pd.read_hdf() segfaults when called from multiple threads in read only mode.</p> <p dir="auto">From the documentation I expected that reading a HDF5 file in another thread would work. In the example each file is mapped out to its own thread and the thread is responsible for opening and closing the file. Note that when I used HDF5 files with compression the segfault happened everytime. When I was making the minimal example, I used no compression and fround it does not segfault about 80% of the time. The test code shows that when complib is set, but complevel is 0 (i.e no compression) the failure rate is 100%.</p> <p dir="auto">This problem is also reported in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="131691514" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/12236" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/12236/hovercard" href="https://github.com/pandas-dev/pandas/issues/12236">#12236</a></p> <h4 dir="auto">Test Code</h4> <p dir="auto">Note this fails reliably when complib is not None. When complib=None the failure rate is ~ 20% for me in limited testing.</p> <p dir="auto">This is another example of # but shows effect of compression settings on the issue</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np import pandas as pd import concurrent.futures as cf # Failure rate # - Fails with Segmentation fault COMPLIB, COMPLEVEL = None, 0 # 2 out of 10 tests COMPLIB, COMPLEVEL = 'zlib', 9 # 3 out of 3 tests COMPLIB, COMPLEVEL = 'zlib', 0 # 3 out of 3 tests COMPLIB, COMPLEVEL = 'blosc', 0 # 3 out of 3 tests COMPLIB, COMPLEVEL = 'blosc', 1 # 3 out of 3 tests COMPLIB, COMPLEVEL = 'lzo', 0 # 3 out of 3 tests COMPLIB, COMPLEVEL = 'bzip2', 0 # 3 out of 3 tests # create test data a = np.random.rand(1000000) b = np.random.rand(1000000) d1 = pd.DataFrame(dict(a=a*1, b=b*1)) d2 = pd.DataFrame(dict(a=a*2, b=b*2)) d3 = pd.DataFrame(dict(a=a*3, b=b*3)) d4 = pd.DataFrame(dict(a=a*4, b=b*4)) d1.to_hdf('d1.h5', '/data', complib=COMPLIB, complevel=COMPLEVEL) d2.to_hdf('d2.h5', '/data', complib=COMPLIB, complevel=COMPLEVEL) d3.to_hdf('d3.h5', '/data', complib=COMPLIB, complevel=COMPLEVEL) d4.to_hdf('d4.h5', '/data', complib=COMPLIB, complevel=COMPLEVEL) files = ['d{}.h5'.format(i) for i in range(1, 5)] # map reads out to threads e = cf.ThreadPoolExecutor() futures = [e.submit(pd.read_hdf, f, '/data/', mode='r') for f in files] "><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span> <span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span> <span class="pl-k">import</span> <span class="pl-s1">concurrent</span>.<span class="pl-s1">futures</span> <span class="pl-k">as</span> <span class="pl-s1">cf</span> <span class="pl-c"># Failure rate</span> <span class="pl-c"># - Fails with Segmentation fault</span> <span class="pl-v">COMPLIB</span>, <span class="pl-v">COMPLEVEL</span> <span class="pl-c1">=</span> <span class="pl-c1">None</span>, <span class="pl-c1">0</span> <span class="pl-c"># 2 out of 10 tests</span> <span class="pl-v">COMPLIB</span>, <span class="pl-v">COMPLEVEL</span> <span class="pl-c1">=</span> <span class="pl-s">'zlib'</span>, <span class="pl-c1">9</span> <span class="pl-c"># 3 out of 3 tests</span> <span class="pl-v">COMPLIB</span>, <span class="pl-v">COMPLEVEL</span> <span class="pl-c1">=</span> <span class="pl-s">'zlib'</span>, <span class="pl-c1">0</span> <span class="pl-c"># 3 out of 3 tests</span> <span class="pl-v">COMPLIB</span>, <span class="pl-v">COMPLEVEL</span> <span class="pl-c1">=</span> <span class="pl-s">'blosc'</span>, <span class="pl-c1">0</span> <span class="pl-c"># 3 out of 3 tests</span> <span class="pl-v">COMPLIB</span>, <span class="pl-v">COMPLEVEL</span> <span class="pl-c1">=</span> <span class="pl-s">'blosc'</span>, <span class="pl-c1">1</span> <span class="pl-c"># 3 out of 3 tests</span> <span class="pl-v">COMPLIB</span>, <span class="pl-v">COMPLEVEL</span> <span class="pl-c1">=</span> <span class="pl-s">'lzo'</span>, <span class="pl-c1">0</span> <span class="pl-c"># 3 out of 3 tests</span> <span class="pl-v">COMPLIB</span>, <span class="pl-v">COMPLEVEL</span> <span class="pl-c1">=</span> <span class="pl-s">'bzip2'</span>, <span class="pl-c1">0</span> <span class="pl-c"># 3 out of 3 tests</span> <span class="pl-c"># create test data</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">rand</span>(<span class="pl-c1">1000000</span>) <span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">rand</span>(<span class="pl-c1">1000000</span>) <span class="pl-s1">d1</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>(<span class="pl-en">dict</span>(<span class="pl-s1">a</span><span class="pl-c1">=</span><span class="pl-s1">a</span><span class="pl-c1">*</span><span class="pl-c1">1</span>, <span class="pl-s1">b</span><span class="pl-c1">=</span><span class="pl-s1">b</span><span class="pl-c1">*</span><span class="pl-c1">1</span>)) <span class="pl-s1">d2</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>(<span class="pl-en">dict</span>(<span class="pl-s1">a</span><span class="pl-c1">=</span><span class="pl-s1">a</span><span class="pl-c1">*</span><span class="pl-c1">2</span>, <span class="pl-s1">b</span><span class="pl-c1">=</span><span class="pl-s1">b</span><span class="pl-c1">*</span><span class="pl-c1">2</span>)) <span class="pl-s1">d3</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>(<span class="pl-en">dict</span>(<span class="pl-s1">a</span><span class="pl-c1">=</span><span class="pl-s1">a</span><span class="pl-c1">*</span><span class="pl-c1">3</span>, <span class="pl-s1">b</span><span class="pl-c1">=</span><span class="pl-s1">b</span><span class="pl-c1">*</span><span class="pl-c1">3</span>)) <span class="pl-s1">d4</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>(<span class="pl-en">dict</span>(<span class="pl-s1">a</span><span class="pl-c1">=</span><span class="pl-s1">a</span><span class="pl-c1">*</span><span class="pl-c1">4</span>, <span class="pl-s1">b</span><span class="pl-c1">=</span><span class="pl-s1">b</span><span class="pl-c1">*</span><span class="pl-c1">4</span>)) <span class="pl-s1">d1</span>.<span class="pl-en">to_hdf</span>(<span class="pl-s">'d1.h5'</span>, <span class="pl-s">'/data'</span>, <span class="pl-s1">complib</span><span class="pl-c1">=</span><span class="pl-v">COMPLIB</span>, <span class="pl-s1">complevel</span><span class="pl-c1">=</span><span class="pl-v">COMPLEVEL</span>) <span class="pl-s1">d2</span>.<span class="pl-en">to_hdf</span>(<span class="pl-s">'d2.h5'</span>, <span class="pl-s">'/data'</span>, <span class="pl-s1">complib</span><span class="pl-c1">=</span><span class="pl-v">COMPLIB</span>, <span class="pl-s1">complevel</span><span class="pl-c1">=</span><span class="pl-v">COMPLEVEL</span>) <span class="pl-s1">d3</span>.<span class="pl-en">to_hdf</span>(<span class="pl-s">'d3.h5'</span>, <span class="pl-s">'/data'</span>, <span class="pl-s1">complib</span><span class="pl-c1">=</span><span class="pl-v">COMPLIB</span>, <span class="pl-s1">complevel</span><span class="pl-c1">=</span><span class="pl-v">COMPLEVEL</span>) <span class="pl-s1">d4</span>.<span class="pl-en">to_hdf</span>(<span class="pl-s">'d4.h5'</span>, <span class="pl-s">'/data'</span>, <span class="pl-s1">complib</span><span class="pl-c1">=</span><span class="pl-v">COMPLIB</span>, <span class="pl-s1">complevel</span><span class="pl-c1">=</span><span class="pl-v">COMPLEVEL</span>) <span class="pl-s1">files</span> <span class="pl-c1">=</span> [<span class="pl-s">'d{}.h5'</span>.<span class="pl-en">format</span>(<span class="pl-s1">i</span>) <span class="pl-k">for</span> <span class="pl-s1">i</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-c1">1</span>, <span class="pl-c1">5</span>)] <span class="pl-c"># map reads out to threads</span> <span class="pl-s1">e</span> <span class="pl-c1">=</span> <span class="pl-s1">cf</span>.<span class="pl-v">ThreadPoolExecutor</span>() <span class="pl-s1">futures</span> <span class="pl-c1">=</span> [<span class="pl-s1">e</span>.<span class="pl-en">submit</span>(<span class="pl-s1">pd</span>.<span class="pl-s1">read_hdf</span>, <span class="pl-s1">f</span>, <span class="pl-s">'/data/'</span>, <span class="pl-s1">mode</span><span class="pl-c1">=</span><span class="pl-s">'r'</span>) <span class="pl-k">for</span> <span class="pl-s1">f</span> <span class="pl-c1">in</span> <span class="pl-s1">files</span>]</pre></div> <h4 dir="auto">Expected Output</h4> <p dir="auto">a list of 4 futures that can be</p> <h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4> <details> INSTALLED VERSIONS ------------------ commit: None python: 3.6.0.final.0 python-bits: 64 OS: Darwin OS-release: 15.6.0 machine: x86_64 processor: i386 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 <p dir="auto">pandas: 0.19.2<br> nose: None<br> pip: 9.0.1<br> setuptools: 28.8.0<br> Cython: None<br> numpy: 1.12.0<br> scipy: None<br> statsmodels: None<br> xarray: None<br> IPython: 5.1.0<br> sphinx: None<br> patsy: None<br> dateutil: 2.6.0<br> pytz: 2016.10<br> blosc: None<br> bottleneck: None<br> tables: 3.3.0<br> numexpr: 2.6.1<br> matplotlib: 2.0.0<br> openpyxl: None<br> xlrd: None<br> xlwt: None<br> xlsxwriter: None<br> lxml: None<br> bs4: None<br> html5lib: 0.9999999<br> httplib2: None<br> apiclient: None<br> sqlalchemy: None<br> pymysql: None<br> psycopg2: None<br> jinja2: 2.9.4<br> boto: None<br> pandas_datareader: None</p> </details> <p dir="auto">Crash Report</p> <details> python(7164,0x700000c10000) malloc: *** error for object 0x7f8ba3655e60: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug Abort trap: 6 </details>
<p dir="auto">I was about to answer an SO question giving the standard "use <code class="notranslate">lambda</code> or <code class="notranslate">functools.partial</code>" to create a new function with bound arguments when to my surprise my example didn't work with the OP's code. After some experimentation, it turns out to be because we don't always get the same return type. For example:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="df = pd.DataFrame(np.arange(5, dtype=np.int64), index=pd.DatetimeIndex(start='2014/01/01', periods=5, freq='d')) def f(x,a=1): print(type(x)) return int(isinstance(x, pd.DataFrame)) + 1000*a"><pre class="notranslate"><code class="notranslate">df = pd.DataFrame(np.arange(5, dtype=np.int64), index=pd.DatetimeIndex(start='2014/01/01', periods=5, freq='d')) def f(x,a=1): print(type(x)) return int(isinstance(x, pd.DataFrame)) + 1000*a </code></pre></div> <p dir="auto">After which:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; df.resample(&quot;M&quot;, how=f) &lt;class 'pandas.core.series.Series'&gt; 0 2014-01-31 1000 &gt;&gt;&gt; df.resample(&quot;M&quot;, how=lambda x: f(x,5)) &lt;class 'pandas.core.series.Series'&gt; 0 2014-01-31 5000 &gt;&gt;&gt; df.resample(&quot;M&quot;, how=partial(f, a=9)) &lt;class 'pandas.core.frame.DataFrame'&gt; 0 2014-01-31 9001"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; df.resample("M", how=f) &lt;class 'pandas.core.series.Series'&gt; 0 2014-01-31 1000 &gt;&gt;&gt; df.resample("M", how=lambda x: f(x,5)) &lt;class 'pandas.core.series.Series'&gt; 0 2014-01-31 5000 &gt;&gt;&gt; df.resample("M", how=partial(f, a=9)) &lt;class 'pandas.core.frame.DataFrame'&gt; 0 2014-01-31 9001 </code></pre></div> <p dir="auto"><code class="notranslate">how</code> shouldn't care about how the function was constructed, only whether it's callable, and we should be getting the same result (whether Series or DataFrame) fed into <code class="notranslate">how</code> in every case.</p>
0
<p dir="auto"><em>Please make sure that this is a build/installation issue. As per our <a href="https://github.com/tensorflow/tensorflow/blob/master/ISSUES.md">GitHub Policy</a>, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template</em></p> <p dir="auto"><strong>System information</strong></p> <ul dir="auto"> <li>OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows 10</li> <li>Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: N/A</li> <li>TensorFlow installed from (source or binary): Source</li> <li>TensorFlow version: 1.12</li> <li>Python version: 3.6</li> <li>Installed using virtualenv? pip? conda?: pip</li> <li>Bazel version (if compiling from source): 0.18.1</li> <li>GCC/Compiler version (if compiling from source): Visual Stuido 2015</li> <li>CUDA/cuDNN version: CUDA 10/ cudnn 7</li> <li>GPU model and memory: Titan V</li> </ul> <p dir="auto"><strong>Describe the problem</strong><br> Unable to build with Tensor RT in windows. Newest version (Tensor RT5) claims windows support but build script (configure.py) assumes linux only.</p> <p dir="auto">Has anybody successfully built with TensorRT5 on windows? Will TF 1.13 include support?</p>
<p dir="auto">Ref <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="211483260" data-permission-text="Title is private" data-url="https://github.com/tensorflow/tensorflow/issues/8023" data-hovercard-type="issue" data-hovercard-url="/tensorflow/tensorflow/issues/8023/hovercard" href="https://github.com/tensorflow/tensorflow/issues/8023">#8023</a></p> <h3 dir="auto">System information</h3> <ul dir="auto"> <li><strong>Have I written custom code (as opposed to using a stock example script provided in TensorFlow)</strong>: Yes</li> <li><strong>OS Platform and Distribution (e.g., Linux Ubuntu 16.04)</strong>: Ubuntu 16.04</li> <li><strong>TensorFlow installed from (source or binary)</strong>: Docker image</li> <li><strong>TensorFlow version (use command below)</strong>: 1.1.0</li> <li><strong>Bazel version (if compiling from source)</strong>: N/A</li> <li><strong>CUDA/cuDNN version</strong>: Per Docker image</li> <li><strong>GPU model and memory</strong>: K80</li> <li><strong>Exact command to reproduce</strong>: N/A</li> </ul> <h3 dir="auto">Describe the problem</h3> <p dir="auto">The logging configuration in <code class="notranslate">tf_logging</code> is odd and inconsistent with how things are generally done in Python.</p> <p dir="auto">In general, it's typical to attach handlers to the root logger in Python: <a href="https://docs.python.org/2/library/logging.html#logging.Logger.propagate" rel="nofollow">https://docs.python.org/2/library/logging.html#logging.Logger.propagate</a></p> <p dir="auto">However, because <code class="notranslate">tf_logging</code> sets up its own stream handler, and does not disable the propagate flag, anybody who does follow the standard Python convention of attaching handlers to the root logger gets duplicated log output from TensorFlow.</p> <p dir="auto">Per <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="211483260" data-permission-text="Title is private" data-url="https://github.com/tensorflow/tensorflow/issues/8023" data-hovercard-type="issue" data-hovercard-url="/tensorflow/tensorflow/issues/8023/hovercard" href="https://github.com/tensorflow/tensorflow/issues/8023">#8023</a>, while this isn't a bug per se, it's still wrong and undesirable.</p> <p dir="auto">The cleanest way forward is probably to just set <code class="notranslate">propagate=False</code> on the TF logger.</p>
0
<p dir="auto">by <strong>sorosj</strong>:</p> <pre class="notranslate">What steps will reproduce the problem? 1. Compile a 64bit kernel (with 32bit executables support) 2. boot into a 32bit environment with that kernel (32bit compiler, gnu utiles &amp; all) 3. try to run ./all.bash What is the expected output? golang compiles fine What do you see instead? ==snip== %%%% making lib9 %%%% quietgcc -I"/home/johnny/dev/golang/include" -ggdb -O2 -c "/home/johnny/dev/golang/src/lib9/_p9dir.c" quietgcc -I"/home/johnny/dev/golang/include" -ggdb -O2 -c "/home/johnny/dev/golang/src/lib9/_exits.c" quietgcc -I"/home/johnny/dev/golang/include" -ggdb -O2 -c "/home/johnny/dev/golang/src/lib9/argv0.c" quietgcc -I"/home/johnny/dev/golang/include" -ggdb -O2 -c "/home/johnny/dev/golang/src/lib9/atoi.c" /home/johnny/dev/golang/src/lib9/_exits.c:1:0: sorry, unimplemented: 64-bit mode not compiled in /home/johnny/dev/golang/src/lib9/atoi.c:1:0: sorry, unimplemented: 64-bit mode not compiled in /home/johnny/dev/golang/src/lib9/argv0.c:1:0: sorry, unimplemented: 64-bit mode not compiled in make: *** [atoi.o] Error 1 make: *** Waiting for unfinished jobs.... make: *** [_exits.o] Error 1 make: *** [argv0.o] Error 1 /home/johnny/dev/golang/src/lib9/_p9dir.c:1:0: sorry, unimplemented: 64-bit mode not compiled in make: *** [_p9dir.o] Error 1 ==snip== Which operating system are you using? Linux 2.6.36 (gentoo ~x86) Which revision are you using? (hg identify) f1939161b11a tip Please provide any additional information below. I changed to a 64 bit kernel because i needed to support 64bit chroots, i have a cross-compilation toolchain installed which is how I compiled the kernel.</pre>
<pre class="notranslate">go version go1.3 darwin/amd64 Create two files: "foo.go": package foo func foo() { NOPE I AM A SYNTAX ERROR } j "foo_test.go": package foo Then run `go test` and the test passes. If you add a single test case to `foo_test.go`, then it errors as expected. I believe that this was not the behavior with Go 1.2 but haven't verified. I have a lot of test cases for really basic packages that I just want to test compilation, and it no longer is testing that, when it was before.</pre>
0
<p dir="auto">See example below. There is no "sex" in the styled table.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from IPython.display import display as d import pandas as pd df=pd.DataFrame.from_dict(dict(survived=[1,0,0,0,1,1,1,1], sex=[&quot;Male&quot;, &quot;Female&quot;, &quot;Male&quot;, &quot;Female&quot;, &quot;Male&quot;, &quot;Female&quot;,&quot;Female&quot;, &quot;Female&quot; ])) table=pd.crosstab(df.survived, df.sex) table.loc[&quot;rate&quot;] = table.iloc[-1] / table.sum() d(table) ftable = table.style.format(&quot;{:.0%}&quot;, subset=pd.IndexSlice[&quot;rate&quot;,:]) d(ftable)"><pre class="notranslate"><code class="notranslate">from IPython.display import display as d import pandas as pd df=pd.DataFrame.from_dict(dict(survived=[1,0,0,0,1,1,1,1], sex=["Male", "Female", "Male", "Female", "Male", "Female","Female", "Female" ])) table=pd.crosstab(df.survived, df.sex) table.loc["rate"] = table.iloc[-1] / table.sum() d(table) ftable = table.style.format("{:.0%}", subset=pd.IndexSlice["rate",:]) d(ftable) </code></pre></div>
<p dir="auto">I don't know if anyone's profiled the test suite, but we'd get major performance boosts if we wrote a Cython version of assert_almost_equal. Is there another open issue for this already?</p>
0
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=skaffman" rel="nofollow">Kenny MacLeod</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-6315?redirect=false" rel="nofollow">SPR-6315</a></strong> and commented</p> <p dir="auto">This is a deliberately refiled duplicate of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398097770" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/10827" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/10827/hovercard" href="https://github.com/spring-projects/spring-framework/issues/10827">#10827</a>, which was originally filed as a "refactor", and I think it perhaps should be "bug".</p> <p dir="auto">Between 3.0.0 M4 and RC1, the protected parseStringValue method disappeared from PropertyPlaceholderConfigurer. For custom subclasses, this method was the main entry point into the superclass functionality. Since it had not been deprecated, it seemed like the correct thing to do, but has now been removed, breaking compile-time compatibility between 2.5 and 3.0.</p> <p dir="auto">Can the method be reinstated somehow, that perhaps invokes the new methods that do the work? It can then be marked as deprecated.</p> <hr> <p dir="auto"><strong>Affects:</strong> 3.0 RC1</p> <p dir="auto"><strong>Issue Links:</strong></p> <ul dir="auto"> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398097770" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/10827" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/10827/hovercard" href="https://github.com/spring-projects/spring-framework/issues/10827">#10827</a> parseStringValue gone from PropertyPlaceholderConfigurer (<em><strong>"duplicates"</strong></em>)</li> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398100489" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/11180" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/11180/hovercard" href="https://github.com/spring-projects/spring-framework/issues/11180">#11180</a> Backward compatibility issue in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer</li> </ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=tbecker" rel="nofollow">Tommy Becker</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-7901?redirect=false" rel="nofollow">SPR-7901</a></strong> and commented</p> <p dir="auto">We're experiencing OOM errors during unit test runs. We make fairly heavy use of Java based context configuration in our application as well as the tests. Upon investigation, I see that there are a number of ApplicationContext instances still referenced on the heap that should be collectable. It appears that the way the ConfigurationClassEnhancer is registering its BeanMethodInterceptor with the CGLIB generated subclass is the problem. In <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398096291" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/10601" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/10601/hovercard" href="https://github.com/spring-projects/spring-framework/issues/10601">#10601</a>, this was changed from Enhancer.registerCallbacks() to Enhancer.registerStaticCallbacks() to work around the fact that the former only applies the advice when method calls originate from the same thread that registered the callback. However using the static callback mechanism results in a static reference from the generated subclass to the interceptor, which in turn keeps a reference to the BeanFactory. So the BeanFactory is never eligible for GC, even after its been closed. Although problems running unit tests reveled the problem, we're most likely experiencing it at runtime as well since our application does close contexts and start new ones dynamically in response to some events.</p> <p dir="auto">As a potential fix, it would be nice if the BeanMethodInterceptor could receive a callback itself when the BeanFactory it references is closed, so it can then unregister itself from the CGLIB proxy. Alternatively, perhaps a WeakReference to the BeanFactory could be used from the interceptor.</p> <hr> <p dir="auto"><strong>Affects:</strong> 3.0.3</p> <p dir="auto"><strong>Attachments:</strong></p> <ul dir="auto"> <li><a href="https://jira.spring.io/secure/attachment/17729/mylyn-context.zip" rel="nofollow">mylyn-context.zip</a> (<em>105.42 kB</em>)</li> </ul> <p dir="auto"><strong>Issue Links:</strong></p> <ul dir="auto"> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398111696" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12878" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12878/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12878">#12878</a> CGLIB enhanced <code class="notranslate">@Configuration</code> classes cannot be garbage collected (<em><strong>"is duplicated by"</strong></em>)</li> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398110499" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12663" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12663/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12663">#12663</a> MemoryLeak in Cglib2AopProxy.ProxyCallbackFilter</li> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398111696" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12878" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12878/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12878">#12878</a> CGLIB enhanced <code class="notranslate">@Configuration</code> classes cannot be garbage collected</li> </ul> <p dir="auto"><strong>Referenced from:</strong> commits <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/d2faef44fa2c6f55d8a9fdac77ada63657a86864/hovercard" href="https://github.com/spring-projects/spring-framework/commit/d2faef44fa2c6f55d8a9fdac77ada63657a86864"><tt>d2faef4</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/43676bd660bcfdfea437fdb046ba05c6785d4121/hovercard" href="https://github.com/spring-projects/spring-framework/commit/43676bd660bcfdfea437fdb046ba05c6785d4121"><tt>43676bd</tt></a></p> <p dir="auto">5 votes, 3 watchers</p>
0
<h2 dir="auto"><g-emoji class="g-emoji" alias="bug" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f41b.png">🐛</g-emoji> Bug</h2> <p dir="auto">Using a numpy array <code class="notranslate">i</code> as index for a torch tensor <code class="notranslate">t</code> (i.e. <code class="notranslate">t[i]</code>) is interpreted differently than indexing a numpy array with the same index, or indexing t with the index converted to a tensor.</p> <h2 dir="auto">To Reproduce</h2> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import torch import numpy as np a=np.array([0.]) t=torch.tensor([0.]) i=np.array([[0,0],[0,0]]) a[i] # Fine t[torch.tensor(i)] # Fine t[i] # IndexError: too many indices for tensor of dimension 1"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">torch</span> <span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span> <span class="pl-s1">a</span><span class="pl-c1">=</span><span class="pl-s1">np</span>.<span class="pl-en">array</span>([<span class="pl-c1">0.</span>]) <span class="pl-s1">t</span><span class="pl-c1">=</span><span class="pl-s1">torch</span>.<span class="pl-en">tensor</span>([<span class="pl-c1">0.</span>]) <span class="pl-s1">i</span><span class="pl-c1">=</span><span class="pl-s1">np</span>.<span class="pl-en">array</span>([[<span class="pl-c1">0</span>,<span class="pl-c1">0</span>],[<span class="pl-c1">0</span>,<span class="pl-c1">0</span>]]) <span class="pl-s1">a</span>[<span class="pl-s1">i</span>] <span class="pl-c"># Fine</span> <span class="pl-s1">t</span>[<span class="pl-s1">torch</span>.<span class="pl-en">tensor</span>(<span class="pl-s1">i</span>)] <span class="pl-c"># Fine</span> <span class="pl-s1">t</span>[<span class="pl-s1">i</span>] <span class="pl-c"># IndexError: too many indices for tensor of dimension 1</span></pre></div> <h2 dir="auto">Expected behavior</h2> <p dir="auto">I expected the last line to behave the same as the previous two.</p> <h2 dir="auto">Environment</h2> <p dir="auto">PyTorch version: 1.4.0<br> Is debug build: No<br> CUDA used to build PyTorch: 10.1</p> <p dir="auto">OS: Debian GNU/Linux bullseye/sid<br> GCC version: (Debian 9.2.1-30) 9.2.1 20200224<br> CMake version: version 3.16.3</p> <p dir="auto">Python version: 3.7<br> Is CUDA available: Yes<br> CUDA runtime version: 10.1.168<br> GPU models and configuration: GPU 0: Quadro M2000M<br> Nvidia driver version: 440.64<br> cuDNN version: /usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.5</p> <p dir="auto">Versions of relevant libraries:<br> [pip3] numpy==1.17.4<br> [pip3] numpydoc==0.7.0<br> [pip3] torch==1.4.0<br> [pip3] torchvision==0.5.0<br> [conda] Could not collect</p> <h2 dir="auto">Additional context</h2> <p dir="auto">This appears related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="458367111" data-permission-text="Title is private" data-url="https://github.com/pytorch/pytorch/issues/22013" data-hovercard-type="issue" data-hovercard-url="/pytorch/pytorch/issues/22013/hovercard" href="https://github.com/pytorch/pytorch/issues/22013">#22013</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="520591820" data-permission-text="Title is private" data-url="https://github.com/pytorch/pytorch/issues/29522" data-hovercard-type="issue" data-hovercard-url="/pytorch/pytorch/issues/29522/hovercard" href="https://github.com/pytorch/pytorch/issues/29522">#29522</a> (possibly <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="426927315" data-permission-text="Title is private" data-url="https://github.com/pytorch/pytorch/issues/18616" data-hovercard-type="issue" data-hovercard-url="/pytorch/pytorch/issues/18616/hovercard" href="https://github.com/pytorch/pytorch/issues/18616">#18616</a>). If a numpy array is treated as an arbitrary Iterable, it is probably a duplicate of one of those, although there is the possibility of handling array-like types differently. I am reporting this because I am not sure the issue is exactly the same, but please don't hesitate to close this issue if it is redundant.</p>
<h2 dir="auto"><g-emoji class="g-emoji" alias="books" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f4da.png">📚</g-emoji> Documentation</h2> <p dir="auto">The docs for <a href="https://pytorch.org/docs/master/tensors.html#torch.Tensor.index_put_" rel="nofollow">index_put_</a> state in the second paragraph:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="If accumulate is True, the elements in tensor are added to self. If accumulate is False, the behavior is undefined if indices contain duplicate elements."><pre class="notranslate"><code class="notranslate">If accumulate is True, the elements in tensor are added to self. If accumulate is False, the behavior is undefined if indices contain duplicate elements. </code></pre></div> <p dir="auto">It should be corrected to <code class="notranslate">elements in _value_ are added to self</code>.</p>
0
<p dir="auto"><strong>Migrated issue, originally created by Marco Martinez (<a href="https://github.com/marcomartinez">@marcomartinez</a>)</strong></p> <p dir="auto">I'm trying to get <code class="notranslate">column_descriptions</code> from a query that I'm building that contains multiple joins to the same target, but I'm getting the following error message:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last): File &quot;bug-alias.py&quot;, line 37, in test query.column_descriptions File &quot;/home/mmartinez/env/sa/lib/python2.7/site-packages/sqlalchemy/orm/query.py&quot;, line 2583, in column_descriptions for ent in self._entities File &quot;/home/mmartinez/env/sa/lib/python2.7/site-packages/sqlalchemy/orm/util.py&quot;, line 398, in __getattr__ raise AttributeError(key) AttributeError: entity"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last): File "bug-alias.py", line 37, in test query.column_descriptions File "/home/mmartinez/env/sa/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2583, in column_descriptions for ent in self._entities File "/home/mmartinez/env/sa/lib/python2.7/site-packages/sqlalchemy/orm/util.py", line 398, in __getattr__ raise AttributeError(key) AttributeError: entity </code></pre></div> <p dir="auto">Here's an example of what my code pre-1.0 was doing:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import sqlalchemy as sa from sqlalchemy import orm from sqlalchemy.ext.declarative import declarative_base Session = orm.Session() Base = declarative_base() class User(Base): __tablename__ = 'user' id = sa.Column(sa.Integer(), primary_key=True) name = sa.Column(sa.Unicode(), nullable=False, unique=True) class MyData(Base): __tablename__ = 'mydata' id = sa.Column(sa.Integer(), primary_key=True) data = sa.Column(sa.Unicode(), nullable=False, unique=True) created_by_id = sa.Column(sa.ForeignKey(User.id)) created_by = orm.relationship(User, foreign_keys=[created_by_id]) modified_by_id = sa.Column(sa.ForeignKey(User.id)) modified_by = orm.relationship(User, foreign_keys=[modified_by_id]) Creator = orm.aliased(User) Modifier = orm.aliased(User) query = ( Session.query( MyData.data, sa.literal(u'why').label('someliteral'), # Literals will fail too Creator.name.label('created_by'), Modifier.name.label('modfied_by') ) .join(Creator, MyData.created_by) .join(Modifier, MyData.modified_by) ) print ([d['name'] for d in query.column_descriptions]) "><pre class="notranslate"><code class="notranslate">import sqlalchemy as sa from sqlalchemy import orm from sqlalchemy.ext.declarative import declarative_base Session = orm.Session() Base = declarative_base() class User(Base): __tablename__ = 'user' id = sa.Column(sa.Integer(), primary_key=True) name = sa.Column(sa.Unicode(), nullable=False, unique=True) class MyData(Base): __tablename__ = 'mydata' id = sa.Column(sa.Integer(), primary_key=True) data = sa.Column(sa.Unicode(), nullable=False, unique=True) created_by_id = sa.Column(sa.ForeignKey(User.id)) created_by = orm.relationship(User, foreign_keys=[created_by_id]) modified_by_id = sa.Column(sa.ForeignKey(User.id)) modified_by = orm.relationship(User, foreign_keys=[modified_by_id]) Creator = orm.aliased(User) Modifier = orm.aliased(User) query = ( Session.query( MyData.data, sa.literal(u'why').label('someliteral'), # Literals will fail too Creator.name.label('created_by'), Modifier.name.label('modfied_by') ) .join(Creator, MyData.created_by) .join(Modifier, MyData.modified_by) ) print ([d['name'] for d in query.column_descriptions]) </code></pre></div> <p dir="auto">Reading the 1.0 changlog, I tried this instead (which worked) :</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="query = ( Session.query( MyData.data, sa.literal(u'why').label('someliteral'), ) .join(MyData.created_by, aliased=True) .add_column(User.name.label('created_by')) .reset_joinpoint() .join(MyData.modified_by, aliased=True) .add_column(User.name.label('modified_by')) .reset_joinpoint() ) print ([d['name'] for d in query.column_descriptions]) "><pre class="notranslate"><code class="notranslate">query = ( Session.query( MyData.data, sa.literal(u'why').label('someliteral'), ) .join(MyData.created_by, aliased=True) .add_column(User.name.label('created_by')) .reset_joinpoint() .join(MyData.modified_by, aliased=True) .add_column(User.name.label('modified_by')) .reset_joinpoint() ) print ([d['name'] for d in query.column_descriptions]) </code></pre></div> <p dir="auto">Am I missing something? Thanks in advance.</p>
<p dir="auto"><strong>Migrated issue, originally created by Pavel Brych</strong></p> <p dir="auto">After upgrading to 1.0.2 resp. 1.0.3 SQLAlchemy, this error popped up. It happens when label() is used with attribute of aliased entity.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#!/usr/bin/python # -*- coding: utf-8 -*- from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import aliased Base = declarative_base() class User(Base): __tablename__ = 'users' id = Column(Integer, primary_key=True) username = Column(String(255)) realname = Column(String(255)) e = create_engine(&quot;postgresql://user:passwd@localhost/db_name&quot;, echo=True) Base.metadata.create_all(e) session = Session(e) user = aliased(User,name=&quot;user&quot;) q = session.query(user.username.label(&quot;username&quot;)) print(q.column_descriptions)"><pre class="notranslate"><code class="notranslate">#!/usr/bin/python # -*- coding: utf-8 -*- from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import aliased Base = declarative_base() class User(Base): __tablename__ = 'users' id = Column(Integer, primary_key=True) username = Column(String(255)) realname = Column(String(255)) e = create_engine("postgresql://user:passwd@localhost/db_name", echo=True) Base.metadata.create_all(e) session = Session(e) user = aliased(User,name="user") q = session.query(user.username.label("username")) print(q.column_descriptions) </code></pre></div> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last): File &quot;/home/pavel/python/hores/src/sqlalchemytest.py&quot;, line 27, in &lt;module&gt; print(q.column_descriptions) File &quot;/usr/lib64/python3.4/site-packages/sqlalchemy/orm/query.py&quot;, line 2583, in column_descriptions for ent in self._entities File &quot;/usr/lib64/python3.4/site-packages/sqlalchemy/orm/query.py&quot;, line 2583, in &lt;listcomp&gt; for ent in self._entities File &quot;/usr/lib64/python3.4/site-packages/sqlalchemy/orm/util.py&quot;, line 398, in __getattr__ raise AttributeError(key) AttributeError: entity"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last): File "/home/pavel/python/hores/src/sqlalchemytest.py", line 27, in &lt;module&gt; print(q.column_descriptions) File "/usr/lib64/python3.4/site-packages/sqlalchemy/orm/query.py", line 2583, in column_descriptions for ent in self._entities File "/usr/lib64/python3.4/site-packages/sqlalchemy/orm/query.py", line 2583, in &lt;listcomp&gt; for ent in self._entities File "/usr/lib64/python3.4/site-packages/sqlalchemy/orm/util.py", line 398, in __getattr__ raise AttributeError(key) AttributeError: entity </code></pre></div>
1
<p dir="auto">Microsoft Windows [Version 10.0.18363.418]<br> (c) 2019 Microsoft Corporation. All rights reserved.</p> <p dir="auto">C:\Users\byr&gt;npm install -g expo-cli<br> npm WARN deprecated [email protected]: request has been deprecated, see <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="427331880" data-permission-text="Title is private" data-url="https://github.com/request/request/issues/3142" data-hovercard-type="issue" data-hovercard-url="/request/request/issues/3142/hovercard" href="https://github.com/request/request/issues/3142">request/request#3142</a><br> npm ERR! cb() never called!</p> <p dir="auto">npm ERR! This is an error with npm itself. Please report this error at:<br> npm ERR! <a href="https://npm.community" rel="nofollow">https://npm.community</a></p> <p dir="auto">npm ERR! A complete log of this run can be found in:<br> npm ERR! C:\Users\byr\AppData\Roaming\npm-cache_logs\2020-03-12T08_35_11_476Z-debug.log</p> <p dir="auto">C:\Users\byr&gt;</p> <p dir="auto">help me</p>
<h3 dir="auto">Is there an existing issue for this?</h3> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the existing issues</li> </ul> <h3 dir="auto">This issue exists in the latest npm version</h3> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I am using the latest npm</li> </ul> <h3 dir="auto">Current Behavior</h3> <p dir="auto">Hello,<br> I want to execute preinstall script BEFORE the dependencies of my project describes in package.json are downloads, but it doesn't occurs in:$ npm --version8.5.3<br> Thanks in advance</p> <h3 dir="auto">Expected Behavior</h3> <p dir="auto">Execution the preinstall script BEFORE any action of the install script</p> <h3 dir="auto">Steps To Reproduce</h3> <p dir="auto">npm install<br> The preinstall script defined in package JSON executes AFTER the dependencies are downloaded, NOT BEFORE.</p> <h3 dir="auto">Environment</h3> <ul dir="auto"> <li>npm:</li> <li>Node.js:</li> <li>OS Name:</li> <li>System Model Name:</li> <li>npm config:</li> </ul> <div class="highlight highlight-source-ini notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="; copy and paste output from `npm config ls` here"><pre class="notranslate"><span class="pl-c"><span class="pl-c">;</span> copy and paste output from `npm config ls` here</span></pre></div>
0
<p dir="auto">I have a shuffled series with a bunch of sinvalues in float16, like this:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" tdata.time_sin 110405276 -0.183105 175560878 -0.301270 ... 130331292 -0.158813 6782127 -0.282471 Name: time_sin, Length: 18490389, dtype: float16"><pre class="notranslate"><code class="notranslate"> tdata.time_sin 110405276 -0.183105 175560878 -0.301270 ... 130331292 -0.158813 6782127 -0.282471 Name: time_sin, Length: 18490389, dtype: float16 </code></pre></div> <p dir="auto">There's no NaN values, everything's a sinus of something:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="tdata.time_sin[np.isnan(tdata.time_sin) == True].count() 0"><pre class="notranslate"><code class="notranslate">tdata.time_sin[np.isnan(tdata.time_sin) == True].count() 0 </code></pre></div> <p dir="auto">But for some reason, <code class="notranslate">mean() </code>chokes somewhere in the middle like it's overflowing:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" tdata.time_sin.mean() nan tdata.time_sin[:328720].mean() 0.0 tdata.time_sin[:328721].mean() nan tdata.time_sin[328719:328722] 117467643 -0.639648 85318746 0.956055 10829780 0.112000 Name: time_sin, dtype: float16"><pre class="notranslate"><code class="notranslate"> tdata.time_sin.mean() nan tdata.time_sin[:328720].mean() 0.0 tdata.time_sin[:328721].mean() nan tdata.time_sin[328719:328722] 117467643 -0.639648 85318746 0.956055 10829780 0.112000 Name: time_sin, dtype: float16 </code></pre></div> <p dir="auto">And it works fine when converted to float32:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="foo = tdata.time_sin.astype(np.float32) foo.mean() 0.20143597"><pre class="notranslate"><code class="notranslate">foo = tdata.time_sin.astype(np.float32) foo.mean() 0.20143597 </code></pre></div> <p dir="auto">Is this weird or am I missing something about float16?</p> <p dir="auto">This behavior persists after pickling and loading and sorting by index, although it now chokes much earlier:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="zzz = pickle.load(open('timesin.pkl', 'rb')) bb = zzz.sort_index() bb[:74351].mean() -0.0 bb[:74352].mean() nan bb[74350:74355] 749371 -0.898438 749393 -0.898438 749432 -0.898438 749447 -0.898438 749479 -0.898438 Name: time_sin, dtype: float16 "><pre class="notranslate"><code class="notranslate">zzz = pickle.load(open('timesin.pkl', 'rb')) bb = zzz.sort_index() bb[:74351].mean() -0.0 bb[:74352].mean() nan bb[74350:74355] 749371 -0.898438 749393 -0.898438 749432 -0.898438 749447 -0.898438 749479 -0.898438 Name: time_sin, dtype: float16 </code></pre></div> <h4 dir="auto">Problem description</h4> <h4 dir="auto">Expected Output</h4> <h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4> <details> <p dir="auto">pd.show_versions()</p> <h2 dir="auto">INSTALLED VERSIONS</h2> <p dir="auto">commit: None<br> python: 3.5.2.final.0<br> python-bits: 64<br> OS: Linux<br> OS-release: 4.4.0-119-generic<br> machine: x86_64<br> processor: x86_64<br> byteorder: little<br> LC_ALL: en_US.UTF-8<br> LANG: en_US.UTF-8<br> LOCALE: en_US.UTF-8</p> <p dir="auto">pandas: 0.22.0<br> pytest: None<br> pip: 9.0.3<br> setuptools: 39.0.1<br> Cython: None<br> numpy: 1.14.2<br> scipy: 1.0.1<br> pyarrow: None<br> xarray: None<br> IPython: 6.3.1<br> sphinx: None<br> patsy: None<br> dateutil: 2.7.2<br> pytz: 2018.3<br> blosc: None<br> bottleneck: None<br> tables: None<br> numexpr: None<br> feather: None<br> matplotlib: 2.2.2<br> openpyxl: None<br> xlrd: None<br> xlwt: None<br> xlsxwriter: None<br> lxml: None<br> bs4: None<br> html5lib: 1.0.1<br> sqlalchemy: None<br> pymysql: None<br> psycopg2: None<br> jinja2: 2.10<br> s3fs: None<br> fastparquet: None<br> pandas_gbq: None<br> pandas_datareader: None</p> </details>
<p dir="auto">open issues &amp; xref</p> <ul dir="auto"> <li>(fillna) <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="288078410" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/19205" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/19205/hovercard" href="https://github.com/pandas-dev/pandas/issues/19205">#19205</a></li> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="89118179" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/10382" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/10382/hovercard" href="https://github.com/pandas-dev/pandas/issues/10382">#10382</a></li> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="210444839" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/15517" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/15517/hovercard" href="https://github.com/pandas-dev/pandas/issues/15517">#15517</a></li> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="9240591" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/2511" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/2511/hovercard" href="https://github.com/pandas-dev/pandas/issues/2511">#2511</a></li> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="235384856" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/16686" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/16686/hovercard" href="https://github.com/pandas-dev/pandas/issues/16686">#16686</a></li> </ul> <p dir="auto">think this should be a bug. When calling the fill_na method in a pandas Series of type np.float16 it raises a ValueError, because of invalid dtype. May be there is a reason for that I can't guess, but I think it's a bug because it does not detect np.float16 as a subclass of np.floating. I'm using Python 3.4, didn't test if it also fails in Python 2. It fails for both methods, 'pad' and 'bfill'.</p> <p dir="auto">For np.float32 and np.float64 it works correctly. This code reproduces the error with np.float16:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import numpy as np import pandas as pd s = pd.Series(np.random.randn(100), dtype=np.float16) rets = s.fillna(method='bfill')"><pre class="notranslate"><code class="notranslate">import numpy as np import pandas as pd s = pd.Series(np.random.randn(100), dtype=np.float16) rets = s.fillna(method='bfill') </code></pre></div> <p dir="auto">and this is the ValueError it generates:</p> <hr> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ValueError Traceback (most recent call last) &lt;ipython-input-133-5610749057ca&gt; in &lt;module&gt;() 3 4 s = pd.Series(np.random.randn(100), dtype=np.float16) ----&gt; 5 rets = s.fillna(method='bfill') /opt/anaconda3/lib/python3.4/site-packages/pandas/core/generic.py in fillna(self, value, method, axis, inplace, limit, downcast) 2227 inplace=inplace, 2228 coerce=True, -&gt; 2229 downcast=downcast) 2230 else: 2231 if method is not None: /opt/anaconda3/lib/python3.4/site-packages/pandas/core/internals.py in interpolate(self, **kwargs) 2223 2224 def interpolate(self, **kwargs): -&gt; 2225 return self.apply('interpolate', **kwargs) 2226 2227 def shift(self, **kwargs): /opt/anaconda3/lib/python3.4/site-packages/pandas/core/internals.py in apply(self, f, axes, filter, do_integrity_check, **kwargs) 2190 copy=align_copy) 2191 -&gt; 2192 applied = getattr(b, f)(**kwargs) 2193 2194 if isinstance(applied, list): /opt/anaconda3/lib/python3.4/site-packages/pandas/core/internals.py in interpolate(self, method, axis, index, values, inplace, limit, fill_value, coerce, downcast, **kwargs) 648 fill_value=fill_value, 649 coerce=coerce, --&gt; 650 downcast=downcast) 651 # try an interp method 652 try: /opt/anaconda3/lib/python3.4/site-packages/pandas/core/internals.py in _interpolate_with_fill(self, method, axis, inplace, limit, fill_value, coerce, downcast) 693 limit=limit, 694 fill_value=fill_value, --&gt; 695 dtype=self.dtype) 696 values = self._try_coerce_result(values) 697 /opt/anaconda3/lib/python3.4/site-packages/pandas/core/common.py in interpolate_2d(values, method, axis, limit, fill_value, dtype) 1576 values = transf(pad_2d(transf(values), limit=limit, mask=mask, dtype=dtype)) 1577 else: -&gt; 1578 values = transf(backfill_2d(transf(values), limit=limit, mask=mask, dtype=dtype)) 1579 1580 # reshape back /opt/anaconda3/lib/python3.4/site-packages/pandas/core/common.py in backfill_2d(values, limit, mask, dtype) 1378 1379 if _method is None: -&gt; 1380 raise ValueError('Invalid dtype for backfill_2d [%s]' % dtype.name) 1381 1382 if mask is None: ValueError: Invalid dtype for backfill_2d [float16]"><pre class="notranslate"><code class="notranslate">ValueError Traceback (most recent call last) &lt;ipython-input-133-5610749057ca&gt; in &lt;module&gt;() 3 4 s = pd.Series(np.random.randn(100), dtype=np.float16) ----&gt; 5 rets = s.fillna(method='bfill') /opt/anaconda3/lib/python3.4/site-packages/pandas/core/generic.py in fillna(self, value, method, axis, inplace, limit, downcast) 2227 inplace=inplace, 2228 coerce=True, -&gt; 2229 downcast=downcast) 2230 else: 2231 if method is not None: /opt/anaconda3/lib/python3.4/site-packages/pandas/core/internals.py in interpolate(self, **kwargs) 2223 2224 def interpolate(self, **kwargs): -&gt; 2225 return self.apply('interpolate', **kwargs) 2226 2227 def shift(self, **kwargs): /opt/anaconda3/lib/python3.4/site-packages/pandas/core/internals.py in apply(self, f, axes, filter, do_integrity_check, **kwargs) 2190 copy=align_copy) 2191 -&gt; 2192 applied = getattr(b, f)(**kwargs) 2193 2194 if isinstance(applied, list): /opt/anaconda3/lib/python3.4/site-packages/pandas/core/internals.py in interpolate(self, method, axis, index, values, inplace, limit, fill_value, coerce, downcast, **kwargs) 648 fill_value=fill_value, 649 coerce=coerce, --&gt; 650 downcast=downcast) 651 # try an interp method 652 try: /opt/anaconda3/lib/python3.4/site-packages/pandas/core/internals.py in _interpolate_with_fill(self, method, axis, inplace, limit, fill_value, coerce, downcast) 693 limit=limit, 694 fill_value=fill_value, --&gt; 695 dtype=self.dtype) 696 values = self._try_coerce_result(values) 697 /opt/anaconda3/lib/python3.4/site-packages/pandas/core/common.py in interpolate_2d(values, method, axis, limit, fill_value, dtype) 1576 values = transf(pad_2d(transf(values), limit=limit, mask=mask, dtype=dtype)) 1577 else: -&gt; 1578 values = transf(backfill_2d(transf(values), limit=limit, mask=mask, dtype=dtype)) 1579 1580 # reshape back /opt/anaconda3/lib/python3.4/site-packages/pandas/core/common.py in backfill_2d(values, limit, mask, dtype) 1378 1379 if _method is None: -&gt; 1380 raise ValueError('Invalid dtype for backfill_2d [%s]' % dtype.name) 1381 1382 if mask is None: ValueError: Invalid dtype for backfill_2d [float16] </code></pre></div> <p dir="auto">And my guess is that the problem is this part of the code, I can debug it once you confirm this is a bug:<br> <a href="https://github.com/pydata/pandas/blob/master/pandas/core/common.py#L2459">https://github.com/pydata/pandas/blob/master/pandas/core/common.py#L2459</a></p>
1
<p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong><br> <strong>BUG</strong></p> <p dir="auto"><strong>What is the current behavior?</strong><br> <code class="notranslate">require.resolveWeak()</code> can't statically determine module string passed to it as well as <code class="notranslate">import().then</code>.</p> <p dir="auto"><em>modules[moduleId] is undefined here</em>:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));"><pre class="notranslate"><span class="pl-s1">modules</span><span class="pl-kos">[</span><span class="pl-s1">moduleId</span><span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-en">call</span><span class="pl-kos">(</span><span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-c1">exports</span><span class="pl-kos">,</span> <span class="pl-smi">module</span><span class="pl-kos">,</span> <span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-c1">exports</span><span class="pl-kos">,</span> <span class="pl-en">hotCreateRequire</span><span class="pl-kos">(</span><span class="pl-s1">moduleId</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <blockquote> <p dir="auto">the moduleId is "./src/components recursive ^\.\/.*$"</p> </blockquote> <p dir="auto">Here's the trace:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TypeError: Cannot read property 'call' of undefined __webpack_require__ http://localhost:3000/static/bootstrap.js:694:29 fn http://localhost:3000/static/bootstrap.js:115:20 resolve http://localhost:3000/static/main.js:35453:34 requireSync http://localhost:3000/static/main.js:80:58 webpackJsonp.../async-module/src/index.js.exports.default http://localhost:3000/static/main.js:165:10 Loadable http://localhost:3000/static/main.js:4176:47 getComponent http://localhost:3000/static/main.js:35434:35 new App http://localhost:3000/static/main.js:35379:16 http://localhost:3000/static/main.js:12070:18 measureLifeCyclePerf http://localhost:3000/static/main.js:11850:12"><pre class="notranslate"><code class="notranslate">TypeError: Cannot read property 'call' of undefined __webpack_require__ http://localhost:3000/static/bootstrap.js:694:29 fn http://localhost:3000/static/bootstrap.js:115:20 resolve http://localhost:3000/static/main.js:35453:34 requireSync http://localhost:3000/static/main.js:80:58 webpackJsonp.../async-module/src/index.js.exports.default http://localhost:3000/static/main.js:165:10 Loadable http://localhost:3000/static/main.js:4176:47 getComponent http://localhost:3000/static/main.js:35434:35 new App http://localhost:3000/static/main.js:35379:16 http://localhost:3000/static/main.js:12070:18 measureLifeCyclePerf http://localhost:3000/static/main.js:11850:12 </code></pre></div> <p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong><br> For example, try:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="require.resolveWeak(`${+new Date() % 2 ? './Example' : './Loading'}`)"><pre class="notranslate"><span class="pl-en">require</span><span class="pl-kos">.</span><span class="pl-en">resolveWeak</span><span class="pl-kos">(</span><span class="pl-s">`<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-c1">+</span><span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">%</span> <span class="pl-c1">2</span> ? <span class="pl-s">'./Example'</span> : <span class="pl-s">'./Loading'</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span></pre></div> <p dir="auto"><strong>What is the expected behavior?</strong><br> The expected behavior is that <code class="notranslate">resolveWeak</code> will return the <code class="notranslate">moduleId</code> of the corresponding module. The weird thing is that it works when using Webpack on the server, but in the browser (Chrome) it does not work.</p> <p dir="auto">In addition, the following works:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import(/* webpackChunkName: &quot;[request]&quot; */ `${+new Date() % 2 ? './Example' : './Loading'}`).then(..."><pre class="notranslate"><span class="pl-k">import</span><span class="pl-kos">(</span><span class="pl-c">/* webpackChunkName: "[request]" */</span> <span class="pl-s">`<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-c1">+</span><span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">%</span> <span class="pl-c1">2</span> ? <span class="pl-s">'./Example'</span> : <span class="pl-s">'./Loading'</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">then</span><span class="pl-kos">(</span>...</pre></div> <p dir="auto"><strong>If this is a feature request, what is motivation or use case for changing the behavior?</strong><br> The motivation and use case for this is for tools like <em>React Loadable</em> and <em><a href="https://github.com/faceyspacey/react-universal-component">React Universal Component</a></em> which allow for async-loading + server-side rendering of the same component. Currently such tools don't allow for dynamic component selection (because it depends on <code class="notranslate">resolveWeak</code> for synchronous loading if the module is already available).</p> <p dir="auto">If it was just a case of using <code class="notranslate">import().then</code>, such expressions would work. But <code class="notranslate">resolveWeak</code> is needed to make the server-side synchronous rendering magic happen, as well as the synchronous rendering on initial load in the browser if the corresponding chunks are embedded before <code class="notranslate">main</code>.</p> <p dir="auto">This is a very important feature for the React Loadable and React Universal Component community and any other future async packages.</p> <p dir="auto"><strong>Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.</strong></p> <p dir="auto">VERSION: 2.6.1 + 3.0.0<br> NODE: 7.7.2<br> OSX</p>
<h1 dir="auto">Bug report</h1> <p dir="auto"><strong>What is the current behavior?</strong><br> "dev" build exits with status 2.</p> <p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong><br> It happens when executing <code class="notranslate">webpack serve --progress --profile --config webpack.dev.js</code></p> <h3 dir="auto">Webpack config</h3> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/* eslint-disable import/no-dynamic-require */ const path = require('path'); const { camelCase, startCase } = require('lodash'); const webpack = require('webpack'); const { ModuleFederationPlugin } = webpack.container; const cwd = process.cwd(); const DIST_PATH = path.resolve(cwd, 'dist'); const SRC_PATH = path.resolve(cwd, 'src'); const PACKAGE_JSON_PATH = path.resolve(cwd, 'package.json'); const INDEX_JS_PATH = path.resolve(SRC_PATH, 'index.js'); const isDev = process.env.BABEL_ENV === 'development'; const NODE_MODULES = 'node_modules'; // PATH FROM EK-REACT_MODULE-BUILD (ie: ek-react-module-build/node_modules) const NODE_MODULES_ABSOLUTE_PATH = path.resolve(__dirname, NODE_MODULES); // PATH FROM WHERE THE BUILD IS TRIGGERED (ie: ek-request/node_modules) const NODE_MODULES_RELATIVE_PATH = path.resolve(cwd, NODE_MODULES); const { id: packageId, exposes, name, packageName, parentPath = '', remotes, shared } = require(PACKAGE_JSON_PATH); const getDefaultExpose = () =&gt; { const componentName = startCase(name).replace(/ /g, ''); const fullComponentPath = `./${componentName}`; return { [fullComponentPath]: './' }; }; const baseConfig = { context: SRC_PATH, entry: INDEX_JS_PATH, resolve: { extensions: ['.js'], // Avoid duplicates (each module imports only once from app/node_modules) modules: [ NODE_MODULES_ABSOLUTE_PATH, NODE_MODULES_RELATIVE_PATH, NODE_MODULES ] }, output: { path: DIST_PATH, filename: path.join(parentPath, packageId, 'index.js'), chunkFilename: path.join(parentPath, packageId, 'static', '[name].[chunkhash].js'), publicPath: 'auto', library: packageName || packageId, libraryTarget: 'umd' }, module: { rules: [ { test: /\.js$/, include: [SRC_PATH], use: [ { loader: require.resolve('babel-loader'), options: { presets: [ [ require.resolve('@babel/preset-env'), { // debug: true, corejs: { version: '3.14' }, useBuiltIns: 'usage', targets: 'defaults' } ], [ require.resolve('@babel/preset-react'), { development: isDev } ] ], plugins: [ require.resolve('babel-plugin-styled-components'), require.resolve('@babel/plugin-proposal-class-properties') ] } } ] }, { test: /\.css$/, use: [ 'css-loader' ], type: 'javascript/auto' }, { test: /\.(png|jpe?g|gif|woff|woff2|eot|ttf)$/, loader: 'file-loader', options: { name: '[path][name].[ext]' }, type: 'javascript/auto' }, { test: /\.svg$/, use: [ require.resolve('@svgr/webpack'), { loader: require.resolve('url-loader'), options: { esModule: false } } ], type: 'javascript/auto' } ] }, plugins: [ new ModuleFederationPlugin({ name: `${camelCase(name)}`, filename: path.join(parentPath, packageId, 'remoteEntry.js'), exposes: exposes || getDefaultExpose(), shared, remotes }) ] }; module.exports = baseConfig;"><pre class="notranslate"><span class="pl-c">/* eslint-disable import/no-dynamic-require */</span> <span class="pl-k">const</span> <span class="pl-s1">path</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'path'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-kos">{</span> camelCase<span class="pl-kos">,</span> startCase <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'lodash'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">webpack</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'webpack'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-kos">{</span> ModuleFederationPlugin <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-s1">webpack</span><span class="pl-kos">.</span><span class="pl-c1">container</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">cwd</span> <span class="pl-c1">=</span> <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-en">cwd</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-c1">DIST_PATH</span> <span class="pl-c1">=</span> <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s1">cwd</span><span class="pl-kos">,</span> <span class="pl-s">'dist'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-c1">SRC_PATH</span> <span class="pl-c1">=</span> <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s1">cwd</span><span class="pl-kos">,</span> <span class="pl-s">'src'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-c1">PACKAGE_JSON_PATH</span> <span class="pl-c1">=</span> <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s1">cwd</span><span class="pl-kos">,</span> <span class="pl-s">'package.json'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-c1">INDEX_JS_PATH</span> <span class="pl-c1">=</span> <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-c1">SRC_PATH</span><span class="pl-kos">,</span> <span class="pl-s">'index.js'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">isDev</span> <span class="pl-c1">=</span> <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">BABEL_ENV</span> <span class="pl-c1">===</span> <span class="pl-s">'development'</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-c1">NODE_MODULES</span> <span class="pl-c1">=</span> <span class="pl-s">'node_modules'</span><span class="pl-kos">;</span> <span class="pl-c">// PATH FROM EK-REACT_MODULE-BUILD (ie: ek-react-module-build/node_modules)</span> <span class="pl-k">const</span> <span class="pl-c1">NODE_MODULES_ABSOLUTE_PATH</span> <span class="pl-c1">=</span> <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s1">__dirname</span><span class="pl-kos">,</span> <span class="pl-c1">NODE_MODULES</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// PATH FROM WHERE THE BUILD IS TRIGGERED (ie: ek-request/node_modules)</span> <span class="pl-k">const</span> <span class="pl-c1">NODE_MODULES_RELATIVE_PATH</span> <span class="pl-c1">=</span> <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s1">cwd</span><span class="pl-kos">,</span> <span class="pl-c1">NODE_MODULES</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-kos">{</span> <span class="pl-c1">id</span>: <span class="pl-s1">packageId</span><span class="pl-kos">,</span> exposes<span class="pl-kos">,</span> name<span class="pl-kos">,</span> packageName<span class="pl-kos">,</span> parentPath <span class="pl-c1">=</span> <span class="pl-s">''</span><span class="pl-kos">,</span> remotes<span class="pl-kos">,</span> shared <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-c1">PACKAGE_JSON_PATH</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-en">getDefaultExpose</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-k">const</span> <span class="pl-s1">componentName</span> <span class="pl-c1">=</span> <span class="pl-en">startCase</span><span class="pl-kos">(</span><span class="pl-s1">name</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">replace</span><span class="pl-kos">(</span><span class="pl-pds"><span class="pl-c1">/</span> <span class="pl-c1">/</span>g</span><span class="pl-kos">,</span> <span class="pl-s">''</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">fullComponentPath</span> <span class="pl-c1">=</span> <span class="pl-s">`./<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">componentName</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">;</span> <span class="pl-k">return</span> <span class="pl-kos">{</span> <span class="pl-kos">[</span><span class="pl-s1">fullComponentPath</span><span class="pl-kos">]</span>: <span class="pl-s">'./'</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">baseConfig</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">context</span>: <span class="pl-c1">SRC_PATH</span><span class="pl-kos">,</span> <span class="pl-c1">entry</span>: <span class="pl-c1">INDEX_JS_PATH</span><span class="pl-kos">,</span> <span class="pl-c1">resolve</span>: <span class="pl-kos">{</span> <span class="pl-c1">extensions</span>: <span class="pl-kos">[</span><span class="pl-s">'.js'</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-c">// Avoid duplicates (each module imports only once from app/node_modules)</span> <span class="pl-c1">modules</span>: <span class="pl-kos">[</span> <span class="pl-c1">NODE_MODULES_ABSOLUTE_PATH</span><span class="pl-kos">,</span> <span class="pl-c1">NODE_MODULES_RELATIVE_PATH</span><span class="pl-kos">,</span> <span class="pl-c1">NODE_MODULES</span> <span class="pl-kos">]</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">output</span>: <span class="pl-kos">{</span> <span class="pl-c1">path</span>: <span class="pl-c1">DIST_PATH</span><span class="pl-kos">,</span> <span class="pl-c1">filename</span>: <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">join</span><span class="pl-kos">(</span><span class="pl-s1">parentPath</span><span class="pl-kos">,</span> <span class="pl-s1">packageId</span><span class="pl-kos">,</span> <span class="pl-s">'index.js'</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c1">chunkFilename</span>: <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">join</span><span class="pl-kos">(</span><span class="pl-s1">parentPath</span><span class="pl-kos">,</span> <span class="pl-s1">packageId</span><span class="pl-kos">,</span> <span class="pl-s">'static'</span><span class="pl-kos">,</span> <span class="pl-s">'[name].[chunkhash].js'</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c1">publicPath</span>: <span class="pl-s">'auto'</span><span class="pl-kos">,</span> <span class="pl-c1">library</span>: <span class="pl-s1">packageName</span> <span class="pl-c1">||</span> <span class="pl-s1">packageId</span><span class="pl-kos">,</span> <span class="pl-c1">libraryTarget</span>: <span class="pl-s">'umd'</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">module</span>: <span class="pl-kos">{</span> <span class="pl-c1">rules</span>: <span class="pl-kos">[</span> <span class="pl-kos">{</span> <span class="pl-c1">test</span>: <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">\.</span>js<span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span> <span class="pl-c1">include</span>: <span class="pl-kos">[</span><span class="pl-c1">SRC_PATH</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-c1">use</span>: <span class="pl-kos">[</span> <span class="pl-kos">{</span> <span class="pl-c1">loader</span>: <span class="pl-en">require</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s">'babel-loader'</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c1">options</span>: <span class="pl-kos">{</span> <span class="pl-c1">presets</span>: <span class="pl-kos">[</span> <span class="pl-kos">[</span> <span class="pl-en">require</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s">'@babel/preset-env'</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c">// debug: true,</span> <span class="pl-c1">corejs</span>: <span class="pl-kos">{</span> <span class="pl-c1">version</span>: <span class="pl-s">'3.14'</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">useBuiltIns</span>: <span class="pl-s">'usage'</span><span class="pl-kos">,</span> <span class="pl-c1">targets</span>: <span class="pl-s">'defaults'</span> <span class="pl-kos">}</span> <span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-kos">[</span> <span class="pl-en">require</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s">'@babel/preset-react'</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">development</span>: <span class="pl-s1">isDev</span> <span class="pl-kos">}</span> <span class="pl-kos">]</span> <span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-c1">plugins</span>: <span class="pl-kos">[</span> <span class="pl-en">require</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s">'babel-plugin-styled-components'</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-en">require</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s">'@babel/plugin-proposal-class-properties'</span><span class="pl-kos">)</span> <span class="pl-kos">]</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-kos">]</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">test</span>: <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">\.</span>css<span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span> <span class="pl-c1">use</span>: <span class="pl-kos">[</span> <span class="pl-s">'css-loader'</span> <span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-c1">type</span>: <span class="pl-s">'javascript/auto'</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">test</span>: <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">\.</span><span class="pl-kos">(</span>png<span class="pl-c1">|</span>jpe?g<span class="pl-c1">|</span>gif<span class="pl-c1">|</span>woff<span class="pl-c1">|</span>woff2<span class="pl-c1">|</span>eot<span class="pl-c1">|</span>ttf<span class="pl-kos">)</span><span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span> <span class="pl-c1">loader</span>: <span class="pl-s">'file-loader'</span><span class="pl-kos">,</span> <span class="pl-c1">options</span>: <span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-s">'[path][name].[ext]'</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">type</span>: <span class="pl-s">'javascript/auto'</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">test</span>: <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">\.</span>svg<span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span> <span class="pl-c1">use</span>: <span class="pl-kos">[</span> <span class="pl-en">require</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s">'@svgr/webpack'</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">loader</span>: <span class="pl-en">require</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s">'url-loader'</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c1">options</span>: <span class="pl-kos">{</span> <span class="pl-c1">esModule</span>: <span class="pl-c1">false</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-c1">type</span>: <span class="pl-s">'javascript/auto'</span> <span class="pl-kos">}</span> <span class="pl-kos">]</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">plugins</span>: <span class="pl-kos">[</span> <span class="pl-k">new</span> <span class="pl-v">ModuleFederationPlugin</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-s">`<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-en">camelCase</span><span class="pl-kos">(</span><span class="pl-s1">name</span><span class="pl-kos">)</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">,</span> <span class="pl-c1">filename</span>: <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">join</span><span class="pl-kos">(</span><span class="pl-s1">parentPath</span><span class="pl-kos">,</span> <span class="pl-s1">packageId</span><span class="pl-kos">,</span> <span class="pl-s">'remoteEntry.js'</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c1">exposes</span>: <span class="pl-s1">exposes</span> <span class="pl-c1">||</span> <span class="pl-en">getDefaultExpose</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span> shared<span class="pl-kos">,</span> remotes <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">]</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-c1">exports</span> <span class="pl-c1">=</span> <span class="pl-s1">baseConfig</span><span class="pl-kos">;</span></pre></div> <h3 dir="auto">Webpack dev config</h3> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const path = require('path'); const portfinder = require('portfinder'); const request = require('request'); const DEVELOPMENT_MODE = 'development'; process.env.BABEL_ENV = DEVELOPMENT_MODE; process.env.NODE_ENV = DEVELOPMENT_MODE; const baseConfig = require('./webpack.base'); const cwd = process.cwd(); const PACKAGE_JSON_PATH = path.resolve(cwd, 'package.json'); const HOST = process.env.HOST || '0.0.0.0'; const PROXY_SERVER_PORT = process.env.PROXY_SERVER_PORT || 8000; // eslint-disable-next-line import/no-dynamic-require const { id: packageId } = require(PACKAGE_JSON_PATH); let errorStatus = false; async function startDevServer() { // Find a suitable port portfinder.basePort = 8001; const port = await portfinder.getPortPromise(); // Override some configuration for development environment const devConfig = { ...baseConfig, devtool: 'inline-source-map', mode: DEVELOPMENT_MODE, target: 'web', devServer: { compress: true, host: HOST, hot: true, port, writeToDisk: true } }; // Register module on local proxy server setInterval(() =&gt; { request( `http://${HOST}:${PROXY_SERVER_PORT}/register/${encodeURIComponent(`/${packageId}`)}/${port}`, (error, response) =&gt; { if (response &amp;&amp; response.statusCode === 404) { process.stdout.write('Attempt to connect to server\n'); } if (error) { if (!errorStatus) { console.error({ error }); } errorStatus = true; } } ); }, 1000); return devConfig; } module.exports = startDevServer;"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">path</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'path'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">portfinder</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'portfinder'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">request</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'request'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-c1">DEVELOPMENT_MODE</span> <span class="pl-c1">=</span> <span class="pl-s">'development'</span><span class="pl-kos">;</span> <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">BABEL_ENV</span> <span class="pl-c1">=</span> <span class="pl-c1">DEVELOPMENT_MODE</span><span class="pl-kos">;</span> <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">NODE_ENV</span> <span class="pl-c1">=</span> <span class="pl-c1">DEVELOPMENT_MODE</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">baseConfig</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'./webpack.base'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">cwd</span> <span class="pl-c1">=</span> <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-en">cwd</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-c1">PACKAGE_JSON_PATH</span> <span class="pl-c1">=</span> <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s1">cwd</span><span class="pl-kos">,</span> <span class="pl-s">'package.json'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-c1">HOST</span> <span class="pl-c1">=</span> <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">HOST</span> <span class="pl-c1">||</span> <span class="pl-s">'0.0.0.0'</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-c1">PROXY_SERVER_PORT</span> <span class="pl-c1">=</span> <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">PROXY_SERVER_PORT</span> <span class="pl-c1">||</span> <span class="pl-c1">8000</span><span class="pl-kos">;</span> <span class="pl-c">// eslint-disable-next-line import/no-dynamic-require</span> <span class="pl-k">const</span> <span class="pl-kos">{</span> <span class="pl-c1">id</span>: <span class="pl-s1">packageId</span> <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-c1">PACKAGE_JSON_PATH</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">let</span> <span class="pl-s1">errorStatus</span> <span class="pl-c1">=</span> <span class="pl-c1">false</span><span class="pl-kos">;</span> <span class="pl-k">async</span> <span class="pl-k">function</span> <span class="pl-en">startDevServer</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-c">// Find a suitable port</span> <span class="pl-s1">portfinder</span><span class="pl-kos">.</span><span class="pl-c1">basePort</span> <span class="pl-c1">=</span> <span class="pl-c1">8001</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">port</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">portfinder</span><span class="pl-kos">.</span><span class="pl-en">getPortPromise</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Override some configuration for development environment</span> <span class="pl-k">const</span> <span class="pl-s1">devConfig</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> ...<span class="pl-s1">baseConfig</span><span class="pl-kos">,</span> <span class="pl-c1">devtool</span>: <span class="pl-s">'inline-source-map'</span><span class="pl-kos">,</span> <span class="pl-c1">mode</span>: <span class="pl-c1">DEVELOPMENT_MODE</span><span class="pl-kos">,</span> <span class="pl-c1">target</span>: <span class="pl-s">'web'</span><span class="pl-kos">,</span> <span class="pl-c1">devServer</span>: <span class="pl-kos">{</span> <span class="pl-c1">compress</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">host</span>: <span class="pl-c1">HOST</span><span class="pl-kos">,</span> <span class="pl-c1">hot</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> port<span class="pl-kos">,</span> <span class="pl-c1">writeToDisk</span>: <span class="pl-c1">true</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// Register module on local proxy server</span> <span class="pl-en">setInterval</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-s1">request</span><span class="pl-kos">(</span> <span class="pl-s">`http://<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-c1">HOST</span><span class="pl-kos">}</span></span>:<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-c1">PROXY_SERVER_PORT</span><span class="pl-kos">}</span></span>/register/<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-en">encodeURIComponent</span><span class="pl-kos">(</span><span class="pl-s">`/<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">packageId</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span><span class="pl-kos">}</span></span>/<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">port</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-s1">error</span><span class="pl-kos">,</span> <span class="pl-s1">response</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">response</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-s1">response</span><span class="pl-kos">.</span><span class="pl-c1">statusCode</span> <span class="pl-c1">===</span> <span class="pl-c1">404</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">stdout</span><span class="pl-kos">.</span><span class="pl-en">write</span><span class="pl-kos">(</span><span class="pl-s">'Attempt to connect to server\n'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">error</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-s1">errorStatus</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">error</span><span class="pl-kos">(</span><span class="pl-kos">{</span> error <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-s1">errorStatus</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">1000</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">return</span> <span class="pl-s1">devConfig</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-c1">exports</span> <span class="pl-c1">=</span> <span class="pl-s1">startDevServer</span><span class="pl-kos">;</span></pre></div> <p dir="auto"><strong>What is the expected behavior?</strong><br> The build should finish without errors, this property is supported per configuration.</p> <p dir="auto"><strong>Other relevant information:</strong></p> <h3 dir="auto">Using:</h3> <div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&quot;dependencies&quot;: { &quot;@babel/core&quot;: &quot;^7.13.10&quot;, &quot;@babel/preset-env&quot;: &quot;^7.14.4&quot;, &quot;@babel/preset-react&quot;: &quot;^7.12.13&quot;, &quot;@svgr/webpack&quot;: &quot;^5.5.0&quot;, &quot;babel-loader&quot;: &quot;^8.2.2&quot;, &quot;babel-plugin-styled-components&quot;: &quot;^1.12.0&quot;, &quot;core-js&quot;: &quot;^3.14.0&quot;, &quot;css-loader&quot;: &quot;^5.2.6&quot;, &quot;css-minimizer-webpack-plugin&quot;: &quot;^3.0.1&quot;, &quot;file-loader&quot;: &quot;^6.2.0&quot;, &quot;lodash&quot;: &quot;^4.17.21&quot;, &quot;portfinder&quot;: &quot;^1.0.28&quot;, &quot;request&quot;: &quot;^2.88.2&quot;, &quot;url-loader&quot;: &quot;^4.1.1&quot;, &quot;webpack&quot;: &quot;^5.38.1&quot;, &quot;webpack-cli&quot;: &quot;^4.5.0&quot;, &quot;webpack-dev-server&quot;: &quot;^4.0.0-beta.3&quot; },"><pre class="notranslate"><span class="pl-ent">"dependencies"</span>: { <span class="pl-ent">"@babel/core"</span>: <span class="pl-s"><span class="pl-pds">"</span>^7.13.10<span class="pl-pds">"</span></span>, <span class="pl-ent">"@babel/preset-env"</span>: <span class="pl-s"><span class="pl-pds">"</span>^7.14.4<span class="pl-pds">"</span></span>, <span class="pl-ent">"@babel/preset-react"</span>: <span class="pl-s"><span class="pl-pds">"</span>^7.12.13<span class="pl-pds">"</span></span>, <span class="pl-ent">"@svgr/webpack"</span>: <span class="pl-s"><span class="pl-pds">"</span>^5.5.0<span class="pl-pds">"</span></span>, <span class="pl-ent">"babel-loader"</span>: <span class="pl-s"><span class="pl-pds">"</span>^8.2.2<span class="pl-pds">"</span></span>, <span class="pl-ent">"babel-plugin-styled-components"</span>: <span class="pl-s"><span class="pl-pds">"</span>^1.12.0<span class="pl-pds">"</span></span>, <span class="pl-ent">"core-js"</span>: <span class="pl-s"><span class="pl-pds">"</span>^3.14.0<span class="pl-pds">"</span></span>, <span class="pl-ent">"css-loader"</span>: <span class="pl-s"><span class="pl-pds">"</span>^5.2.6<span class="pl-pds">"</span></span>, <span class="pl-ent">"css-minimizer-webpack-plugin"</span>: <span class="pl-s"><span class="pl-pds">"</span>^3.0.1<span class="pl-pds">"</span></span>, <span class="pl-ent">"file-loader"</span>: <span class="pl-s"><span class="pl-pds">"</span>^6.2.0<span class="pl-pds">"</span></span>, <span class="pl-ent">"lodash"</span>: <span class="pl-s"><span class="pl-pds">"</span>^4.17.21<span class="pl-pds">"</span></span>, <span class="pl-ent">"portfinder"</span>: <span class="pl-s"><span class="pl-pds">"</span>^1.0.28<span class="pl-pds">"</span></span>, <span class="pl-ent">"request"</span>: <span class="pl-s"><span class="pl-pds">"</span>^2.88.2<span class="pl-pds">"</span></span>, <span class="pl-ent">"url-loader"</span>: <span class="pl-s"><span class="pl-pds">"</span>^4.1.1<span class="pl-pds">"</span></span>, <span class="pl-ent">"webpack"</span>: <span class="pl-s"><span class="pl-pds">"</span>^5.38.1<span class="pl-pds">"</span></span>, <span class="pl-ent">"webpack-cli"</span>: <span class="pl-s"><span class="pl-pds">"</span>^4.5.0<span class="pl-pds">"</span></span>, <span class="pl-ent">"webpack-dev-server"</span>: <span class="pl-s"><span class="pl-pds">"</span>^4.0.0-beta.3<span class="pl-pds">"</span></span> },</pre></div> <p dir="auto">Node.js version: ^12<br> Operating System: OSX</p>
0
<p dir="auto"><strong>I'm submitting a ...</strong> (check one with "x")</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[x] bug report =&gt; search github for a similar issue or PR before submitting [ ] feature request [ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question"><pre class="notranslate"><code class="notranslate">[x] bug report =&gt; search github for a similar issue or PR before submitting [ ] feature request [ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question </code></pre></div> <p dir="auto"><strong>Current behavior</strong><br> When using CommonJS (or ES2015 modules), the order of imports matters when importing an AngularJS app to bootstrap. Here is an example Plunkr that demonstrates the problem: <a href="https://plnkr.co/edit/lKE6a3sPqjMWvoWJF9oT?p=preview" rel="nofollow">https://plnkr.co/edit/lKE6a3sPqjMWvoWJF9oT?p=preview</a></p> <p dir="auto">But basically:</p> <p dir="auto">When AngularJS lives in: <code class="notranslate">app.js</code> like this one:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import * as angular from 'angular'; export default angular.module('app', []) .run(function() { console.log('Angular 1 is running!')})"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-s1">angular</span> <span class="pl-k">from</span> <span class="pl-s">'angular'</span><span class="pl-kos">;</span> <span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-s1">angular</span><span class="pl-kos">.</span><span class="pl-en">module</span><span class="pl-kos">(</span><span class="pl-s">'app'</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-kos">.</span><span class="pl-en">run</span><span class="pl-kos">(</span><span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">'Angular 1 is running!'</span><span class="pl-kos">)</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p dir="auto">and Angular lives in <code class="notranslate">main.ts</code> like this one:</p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import 'core-js/es7/reflect'; import 'zone.js'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { UpgradeModule } from '@angular/upgrade/static'; import { AppModule } from './app.module'; import app from '../app/app'; const platform = platformBrowserDynamic(); platform.bootstrapModule(AppModule).then(platformRef =&gt; { const upgrade = platformRef.injector.get(UpgradeModule) as UpgradeModule; upgrade.bootstrap(document.body, [app.name], { strictDi: true}) })"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s">'core-js/es7/reflect'</span><span class="pl-kos">;</span> <span class="pl-k">import</span> <span class="pl-s">'zone.js'</span><span class="pl-kos">;</span> <span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">platformBrowserDynamic</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'@angular/platform-browser-dynamic'</span><span class="pl-kos">;</span> <span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-smi">UpgradeModule</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'@angular/upgrade/static'</span><span class="pl-kos">;</span> <span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-smi">AppModule</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'./app.module'</span><span class="pl-kos">;</span> <span class="pl-k">import</span> <span class="pl-s1">app</span> <span class="pl-k">from</span> <span class="pl-s">'../app/app'</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">platform</span> <span class="pl-c1">=</span> <span class="pl-en">platformBrowserDynamic</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">platform</span><span class="pl-kos">.</span><span class="pl-en">bootstrapModule</span><span class="pl-kos">(</span><span class="pl-smi">AppModule</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-s1">platformRef</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-k">const</span> <span class="pl-s1">upgrade</span> <span class="pl-c1">=</span> <span class="pl-s1">platformRef</span><span class="pl-kos">.</span><span class="pl-c1">injector</span><span class="pl-kos">.</span><span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-smi">UpgradeModule</span><span class="pl-kos">)</span> <span class="pl-k">as</span> <span class="pl-smi">UpgradeModule</span><span class="pl-kos">;</span> <span class="pl-s1">upgrade</span><span class="pl-kos">.</span><span class="pl-en">bootstrap</span><span class="pl-kos">(</span><span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-c1">body</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-c1">name</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">strictDi</span>: <span class="pl-c1">true</span><span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p dir="auto">The bootstrap will fail with:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Unhandled Promise rejection: AngularJS v1.x is not loaded! ; Zone: &lt;root&gt; ; Task: Promise.then ; Value: Error: AngularJS v1.x is not loaded!"><pre class="notranslate"><code class="notranslate">Unhandled Promise rejection: AngularJS v1.x is not loaded! ; Zone: &lt;root&gt; ; Task: Promise.then ; Value: Error: AngularJS v1.x is not loaded! </code></pre></div> <p dir="auto">However, moving <code class="notranslate">import app from './app'</code> before <code class="notranslate">zone.js</code> import, the bootstrap will work</p> <p dir="auto"><strong>Expected behavior</strong><br> Importing an AngularJS app should work after the main dependency imports like <code class="notranslate">zone.js</code> and <code class="notranslate">reflect</code> and other libraries.</p> <p dir="auto"><strong>Minimal reproduction of the problem with instructions</strong><br> Here is the Plunkr: <a href="https://plnkr.co/edit/lKE6a3sPqjMWvoWJF9oT?p=preview" rel="nofollow">https://plnkr.co/edit/lKE6a3sPqjMWvoWJF9oT?p=preview</a></p> <p dir="auto">The code above also recreates the problem</p> <p dir="auto"><strong>Please tell us about your environment:</strong> Windows 10, VSCode, Webpack bundling (SystemJS fails as well).</p> <ul dir="auto"> <li> <p dir="auto"><strong>Angular version:</strong> Angular 4.1.0 and AngularJS 1.6.4</p> </li> <li> <p dir="auto"><strong>Browser:</strong> all</p> </li> <li> <p dir="auto"><strong>Language:</strong> TypeScript</p> </li> </ul>
<p dir="auto"><strong>I'm submitting a ...</strong> (check one with "x")</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[x ] bug report =&gt; search github for a similar issue or PR before submitting [ ] feature request [ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question"><pre class="notranslate"><code class="notranslate">[x ] bug report =&gt; search github for a similar issue or PR before submitting [ ] feature request [ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question </code></pre></div> <p dir="auto"><strong>Current behavior</strong><br> Attempting to bootstrap a hybrid app using UpgradeModule, if AngularJS is loaded using <code class="notranslate">import * as angular from 'angular'</code> then the console reports the error 'AngularJS v1.x is not loaded!' if AngularJS is loaded from a script tag, the application boostraps correctly without error.</p> <p dir="auto"><strong>Expected behavior</strong><br> It should be possible to load AngularJS using import</p> <p dir="auto"><strong>Minimal reproduction of the problem with instructions</strong><br> not working - <a href="https://plnkr.co/edit/KJijAJY8lQYRnnwuGOSK?p=preview" rel="nofollow">https://plnkr.co/edit/KJijAJY8lQYRnnwuGOSK?p=preview</a><br> working (with script tag) - <a href="https://plnkr.co/edit/VQWj0OOmY5SF2i2Y9RmI?p=preview" rel="nofollow">https://plnkr.co/edit/VQWj0OOmY5SF2i2Y9RmI?p=preview</a></p> <p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong><br> To allow AngularJS to be bundled easily and use its type definitions</p> <p dir="auto"><strong>Please tell us about your environment:</strong><br> Chrome 58 on Windows 10</p> <ul dir="auto"> <li> <p dir="auto"><strong>Angular version:</strong> 4.1</p> </li> <li> <p dir="auto"><strong>Browser:</strong> Chrome 58 on Windows 10</p> </li> <li> <p dir="auto"><strong>Language:</strong> Typescript 2.1</p> </li> </ul>
1
<h1 dir="auto">Problem statement</h1> <p dir="auto">When extending your desktop to multiple monitors, Windows 10 allows you to position and align the monitors, but on a pixel by pixel alignment. When using multiple monitors of different sizes and resolutions, it is difficult to drag your mouse from one monitor to the next when the sizes are different. Where the monitors don't align, your mouse cursor hits an invisible wall. Your eyes go to the next monitor looking for the cursor, but it's trapped on the previous monitor, right on the edge where your eyes don't see it. To find your mouse, your frantically wiggle your mouse around to find it, eventually dislodging it from the invisible wall, but sometimes sending it to a screen you don't expect.</p> <h1 dir="auto">Proposed feature</h1> <p dir="auto">Always let the mouse go from one screen to the next. Never hit an invisible wall between screens.</p> <h1 dir="auto">Technical suggestions</h1> <p dir="auto">You could either align the edges by percentage or specify an action when the "invisible wall" is hit.<br> Option A - If the mouse leaves monitor 1 at 5% of the total height, have it enter the adjacent monitor 2 at the same 5% height.<br> Option B - If the mouse leaves monitor 1 at 5% of the total height, and this does not align with Monitor 2, provide a rule for how this is handled. This could be things like "always at the top," "middle of monitor," or "bottom of monitor."<br> Option C - If you want to prove your coding skills and make a real power toy, let every edge of a monitor be assignable to connect to any other screen or screens. Sometimes the second monitor is both up and to the right. Some people expect to use the right edge while other use the top edge. Let us assign both edges to the second monitor. Or even better yet, let us position and size it however we like, such as the top right edge and the right edge. Use the percentage method to make it happen.</p>
<h1 dir="auto">Environment</h1> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Windows build number: Microsoft Windows [Version 10.0.18362.836] PowerToys version: PowerToysSetup-0.18.1-x64 PowerToy module for which you are reporting the bug (if applicable): PowerToys Run"><pre class="notranslate"><code class="notranslate">Windows build number: Microsoft Windows [Version 10.0.18362.836] PowerToys version: PowerToysSetup-0.18.1-x64 PowerToy module for which you are reporting the bug (if applicable): PowerToys Run </code></pre></div> <h1 dir="auto">Steps to reproduce</h1> <p dir="auto">Install 0.18.1-x64 version</p> <h1 dir="auto">Expected behavior</h1> <p dir="auto">Alt+Space triggering the search bar</p> <h1 dir="auto">Actual behavior</h1> <p dir="auto">After installation of the new version, the shortcut of Alt+Space stopped working. It doesn't open the search bar.</p> <h1 dir="auto">Things that I tried</h1> <ul dir="auto"> <li>Reboot the system. It didn't work</li> <li>Reinstall the program. It didn't work</li> <li>I remove the 0.18.1 and downgrade to 0.18.0 and the PowerToys Run is working.</li> </ul>
0
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=tuomas_kiviaho" rel="nofollow">Tuomas Kiviaho</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-6107?redirect=false" rel="nofollow">SPR-6107</a></strong> and commented</p> <p dir="auto">In order to define bean using factory method from other than bean class itself requires currently using of a registered factory bean. Registered factory bean feels quite useless when implementing factory method pattern. In worst case bean count duplicates if bean name of factory bean has to be generated on the fly.</p> <p dir="auto">MethodInvokingFactoryBean (with help of MethodInvoker) allows static class as prefix of factory method name and can therefore be used as registered factory bean but incorporating of this logic directly to org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod (and possibly to some other places than I've overlooked) would omit the need of factory bean altogether in these cases. Using MethodInvoker might also be beneficial since it already contains logic to handle illegal state scenarios which would be possible with this addition.</p> <hr> <p dir="auto"><strong>Affects:</strong> 2.5.6</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=benrowlands" rel="nofollow">Ben Rowlands</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-5125?redirect=false" rel="nofollow">SPR-5125</a></strong> and commented</p> <p dir="auto">The Spring DAO exception hierarchy is not fine grained enough to isolate duplicate key errors. A duplicate key error is an example of where an application may catch the exception and invoke alternative logic instead of just letting it fall down the stack.</p> <p dir="auto">For example, we read messages from a queue and insert the data into a database. We explicitly catch a duplicate key insert exception as this indicates we've processed the same message earlier. This is more efficient than a guarding the update with a check-then-act (which also introduces a race condition that may lead to dup-key exception anyway).</p> <p dir="auto">Additionally, if we use single-phase commit for our JMS and DB transactions (commit DB first then JMS) a failure scenario is that the DB transaction commits but the JMS transaction rollsback. In this case the message is delivered again and we get a dup-key exception. We can then safely ignore such duplicate messages.</p> <p dir="auto">A dup-key error is currently classified as a DataIntegrityViolationException along with other errors such as a data bounds error so we can't simply catch this exception type. We could work around this be checking the vendor error-code/state however this is not portable and cumbersome.</p> <p dir="auto">Ideally an exception like:</p> <p dir="auto">public class DuplicateKeyException extends DataIntegrityViolationException { }</p> <p dir="auto">Spring already provides mappings from vendor specific codes so it would be very powerful if it could provide a fine grained exception to allow this common duplicate-key handling pattern to be detected just using exception type.</p> <p dir="auto">We currently use the following SQLExceptions to detect a dup-key:</p> <ul dir="auto"> <li>Sybase: error-state=23000</li> <li>DB2: error-state=23505</li> </ul> <hr> <p dir="auto"><strong>Issue Links:</strong></p> <ul dir="auto"> <li><a href="https://jira.spring.io/browse/SPRNET-1215" rel="nofollow">SPRNET-1215</a> Add DuplicateKeyException to DAO exception hierachy (<em><strong>"is depended on by"</strong></em>)</li> <li><a href="https://jira.spring.io/browse/SPRNET-1216" rel="nofollow">SPRNET-1216</a> Change exception translation mappings to throw DuplicateKeyException (<em><strong>"is depended on by"</strong></em>)</li> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398090700" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/9799" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/9799/hovercard" href="https://github.com/spring-projects/spring-framework/issues/9799">#9799</a> Add DuplicateKeyException to DAO exception hierachy (<em><strong>"is duplicated by"</strong></em>)</li> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398074031" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/7663" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/7663/hovercard" href="https://github.com/spring-projects/spring-framework/issues/7663">#7663</a> Subclass DataIntegrityViolationException to represent main constraint types and translate SQL exceptons into appropriate subclass</li> </ul> <p dir="auto"><strong>Referenced from:</strong> commits <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/a0139abf1e4088e60ae6cd56bbc4779dd522cfde/hovercard" href="https://github.com/spring-projects/spring-framework/commit/a0139abf1e4088e60ae6cd56bbc4779dd522cfde"><tt>a0139ab</tt></a></p> <p dir="auto">1 votes, 2 watchers</p>
0
<p dir="auto"><a href="https://github.com/electron/electron/files/6303484/exceptions.txt">exceptions.txt</a></p> <h3 dir="auto">Preflight Checklist</h3> <p dir="auto">I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.<br> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.<br> I have searched the <a href="https://www.github.com/electron/electron/issues">issue tracker</a> for a feature request that matches the one I want to file, without success.</p> <h3 dir="auto">Electron Version</h3> <p dir="auto">12.0.2,11.x</p> <h3 dir="auto">What operating system are you using?</h3> <p dir="auto">Windows</p> <h3 dir="auto">Operating System Version</h3> <p dir="auto">windows 7</p> <h3 dir="auto">What arch are you using?</h3> <p dir="auto">ia32</p> <h3 dir="auto">Last Known Working Electron version</h3> <p dir="auto">I do not know</p> <h3 dir="auto">Expected Behavior</h3> <p dir="auto">Worked well as windows 10</p> <h3 dir="auto">Actual Behavior</h3> <ol dir="auto"> <li>crashed sometimes, not everytime</li> <li>or the same as <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="848881606" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/28487" data-hovercard-type="issue" data-hovercard-url="/electron/electron/issues/28487/hovercard" href="https://github.com/electron/electron/issues/28487">#28487</a></li> <li>the contextIsolation is false</li> </ol> <h3 dir="auto">Testcase Gist URL</h3> <p dir="auto"><em>No response</em></p>
<h3 dir="auto">Preflight Checklist</h3> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://www.github.com/electron/electron/issues">issue tracker</a> for a feature request that matches the one I want to file, without success.</li> </ul> <h3 dir="auto">Electron Version</h3> <p dir="auto">11.4.5</p> <h3 dir="auto">What operating system are you using?</h3> <p dir="auto">Windows</p> <h3 dir="auto">Operating System Version</h3> <p dir="auto">Windows 10 version 1903</p> <h3 dir="auto">What arch are you using?</h3> <p dir="auto">ia32</p> <h3 dir="auto">Last Known Working Electron version</h3> <p dir="auto">9.4.4</p> <h3 dir="auto">Expected Behavior</h3> <p dir="auto">I would expect a <code class="notranslate">RangeError: Maximum call stack size exceeded</code> exception to be printed to the console. In other words, a Javascript stack overflow should not crash the renderer process.</p> <h3 dir="auto">Actual Behavior</h3> <p dir="auto">The renderer process crashes. Here's a piece of the symbolized dump:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Operating system: Windows NT 10.0.18362 329 CPU: x86 AuthenticAMD family 16 model 2 stepping 3 8 CPUs GPU: UNKNOWN Crash reason: EXCEPTION_STACK_OVERFLOW Crash address: 0x1c188f0 Process uptime: 5 seconds Thread 0 (crashed) 0 electron.exe!Builtins_InterpreterEntryTrampoline + 0x90 eip = 0x01c188f0 esp = 0x0b373000 ebp = 0x0b373014 ebx = 0x0b901698 esi = 0x5634f5bd edi = 0x4e8a8591 eax = 0x50182329 ecx = 0x00000000 edx = 0x50182329 efl = 0x00010246 Found by: given as instruction pointer in context 1 electron.exe!Builtins_InterpreterEntryTrampoline + 0xc2 eip = 0x01c18922 esp = 0x0b37301c ebp = 0x0b373038 Found by: previous frame's frame pointer 2 electron.exe!Builtins_InterpreterEntryTrampoline + 0xc2 eip = 0x01c18922 esp = 0x0b373040 ebp = 0x0b37305c Found by: previous frame's frame pointer 3 electron.exe!Builtins_InterpreterEntryTrampoline + 0xc2 eip = 0x01c18922 esp = 0x0b373064 ebp = 0x0b373080 Found by: previous frame's frame pointer 4 electron.exe!Builtins_InterpreterEntryTrampoline + 0xc2 eip = 0x01c18922 esp = 0x0b373088 ebp = 0x0b3730a4 Found by: previous frame's frame pointer 5 electron.exe!Builtins_InterpreterEntryTrampoline + 0xc2 eip = 0x01c18922 esp = 0x0b3730ac ebp = 0x0b3730c8 Found by: previous frame's frame pointer 6 electron.exe!Builtins_InterpreterEntryTrampoline + 0xc2 eip = 0x01c18922 esp = 0x0b3730d0 ebp = 0x0b3730ec Found by: previous frame's frame pointer 7 electron.exe!Builtins_InterpreterEntryTrampoline + 0xc2 eip = 0x01c18922 esp = 0x0b3730f4 ebp = 0x0b373110 Found by: previous frame's frame pointer 8 electron.exe!Builtins_InterpreterEntryTrampoline + 0xc2 eip = 0x01c18922 esp = 0x0b373118 ebp = 0x0b373134 Found by: previous frame's frame pointer (This goes on for 14k+ frames)"><pre class="notranslate"><code class="notranslate">Operating system: Windows NT 10.0.18362 329 CPU: x86 AuthenticAMD family 16 model 2 stepping 3 8 CPUs GPU: UNKNOWN Crash reason: EXCEPTION_STACK_OVERFLOW Crash address: 0x1c188f0 Process uptime: 5 seconds Thread 0 (crashed) 0 electron.exe!Builtins_InterpreterEntryTrampoline + 0x90 eip = 0x01c188f0 esp = 0x0b373000 ebp = 0x0b373014 ebx = 0x0b901698 esi = 0x5634f5bd edi = 0x4e8a8591 eax = 0x50182329 ecx = 0x00000000 edx = 0x50182329 efl = 0x00010246 Found by: given as instruction pointer in context 1 electron.exe!Builtins_InterpreterEntryTrampoline + 0xc2 eip = 0x01c18922 esp = 0x0b37301c ebp = 0x0b373038 Found by: previous frame's frame pointer 2 electron.exe!Builtins_InterpreterEntryTrampoline + 0xc2 eip = 0x01c18922 esp = 0x0b373040 ebp = 0x0b37305c Found by: previous frame's frame pointer 3 electron.exe!Builtins_InterpreterEntryTrampoline + 0xc2 eip = 0x01c18922 esp = 0x0b373064 ebp = 0x0b373080 Found by: previous frame's frame pointer 4 electron.exe!Builtins_InterpreterEntryTrampoline + 0xc2 eip = 0x01c18922 esp = 0x0b373088 ebp = 0x0b3730a4 Found by: previous frame's frame pointer 5 electron.exe!Builtins_InterpreterEntryTrampoline + 0xc2 eip = 0x01c18922 esp = 0x0b3730ac ebp = 0x0b3730c8 Found by: previous frame's frame pointer 6 electron.exe!Builtins_InterpreterEntryTrampoline + 0xc2 eip = 0x01c18922 esp = 0x0b3730d0 ebp = 0x0b3730ec Found by: previous frame's frame pointer 7 electron.exe!Builtins_InterpreterEntryTrampoline + 0xc2 eip = 0x01c18922 esp = 0x0b3730f4 ebp = 0x0b373110 Found by: previous frame's frame pointer 8 electron.exe!Builtins_InterpreterEntryTrampoline + 0xc2 eip = 0x01c18922 esp = 0x0b373118 ebp = 0x0b373134 Found by: previous frame's frame pointer (This goes on for 14k+ frames) </code></pre></div> <h3 dir="auto">Testcase Gist URL</h3> <p dir="auto"><a href="https://gist.github.com/tarruda/654839161e411c1989ddf479bcbb5332">https://gist.github.com/tarruda/654839161e411c1989ddf479bcbb5332</a></p> <h3 dir="auto">Additional Information</h3> <p dir="auto">Here's the code snippet which triggers the crash:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="try { function run() { run(); }; run(); } catch (e) { console.error(e); }"><pre class="notranslate"><span class="pl-k">try</span> <span class="pl-kos">{</span> <span class="pl-k">function</span> <span class="pl-en">run</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-en">run</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-en">run</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">catch</span> <span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">error</span><span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">Another simple way to reproduce the crash is by running electron with <code class="notranslate">--remote-debugging-port</code> and pasting the snippet on devtools console.</p> <p dir="auto">The crash is reproducible on the following versions:</p> <ul dir="auto"> <li>14.0.0-nightly.20210503</li> <li>13.0.0-beta.20</li> <li>12.0.6</li> <li>11.4.5</li> <li>10.4.5</li> </ul> <p dir="auto">It doesn't seem to be reproducible in windows 32-bit versions of node.js 14.16 or chrome 90.</p> <p dir="auto">In the gist I've added a script which will automatically download the proper electron version + symbols and run the app. Here's how it can be quickly reproduced with cmd.exe:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="git clone https://gist.github.com/tarruda/654839161e411c1989ddf479bcbb5332 electron-win32bit-crash cd electron-win32bit-crash npm install npm start"><pre class="notranslate"><code class="notranslate">git clone https://gist.github.com/tarruda/654839161e411c1989ddf479bcbb5332 electron-win32bit-crash cd electron-win32bit-crash npm install npm start </code></pre></div> <p dir="auto">The bootstrap-run.js file can be edited to try different versions.</p>
1
<p dir="auto">I've tried to train intermediate layers independently but when I run my code I've got out of memory issue.</p> <p dir="auto">I would like to know <strong>retain_graph = True</strong> is the problem? or not and what I have to do to solve this problem.</p> <p dir="auto">I am using hugging face BERT model and this is my code</p> <p dir="auto">Thank you.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" t_outputs = t_model(**intputs) s_outputs = s_model(**inputs) encoder_layers = args.encoder_layers loss = torch.nn.KLDivLoss(reduction='batchmean') batch, row, col = s_outputs[3][1].size() for i, k in enumerate(encoder_layers): output = loss(F.log_softmax(s_outputs[3][i+1], dim=2).view(batch*row, 1, col), F.softmax(t_result[3][k+1],dim=2).view(batch*row, 1, col)) # to freeze layers for name, p in s_model.named_parameters(): if &quot;layer.&quot; + str(i-1) in name: p.requires_grad = False output.backward(retain_graph=True) "><pre class="notranslate"><code class="notranslate"> t_outputs = t_model(**intputs) s_outputs = s_model(**inputs) encoder_layers = args.encoder_layers loss = torch.nn.KLDivLoss(reduction='batchmean') batch, row, col = s_outputs[3][1].size() for i, k in enumerate(encoder_layers): output = loss(F.log_softmax(s_outputs[3][i+1], dim=2).view(batch*row, 1, col), F.softmax(t_result[3][k+1],dim=2).view(batch*row, 1, col)) # to freeze layers for name, p in s_model.named_parameters(): if "layer." + str(i-1) in name: p.requires_grad = False output.backward(retain_graph=True) </code> </pre></div> <p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/albanD/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/albanD">@albanD</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/mruberry/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/mruberry">@mruberry</a></p>
<p dir="auto">Ok, sorry to bother you again, and really sorry if I am just doing it wrong again (I looked at the docs for things that would address this, but didn't see anything after looking at it quickly).</p> <p dir="auto">It appears that the next segment of code leaks CUDA memory. I don't believe I had this problem on 0.2.0 (or some version close to that) on the code that I was running (that I prefer to not publicly disclose, which is why I came up with this example instead):</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="net = torch.nn.Linear(30000,1).cuda() data = torch.ones(100, 30000).cuda() for rep in range(1000): for batchIndices in range(0,100,100): batch = torch.autograd.Variable(data[batchIndices:batchIndices+10], requires_grad=True) net.forward(batch).norm(2).backward(create_graph=True) batch.grad.norm(2).backward()"><pre class="notranslate"><code class="notranslate">net = torch.nn.Linear(30000,1).cuda() data = torch.ones(100, 30000).cuda() for rep in range(1000): for batchIndices in range(0,100,100): batch = torch.autograd.Variable(data[batchIndices:batchIndices+10], requires_grad=True) net.forward(batch).norm(2).backward(create_graph=True) batch.grad.norm(2).backward() </code></pre></div> <p dir="auto"><code class="notranslate">nvidia-smi</code> output:</p> <p dir="auto">After first run of this:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="| 0 TITAN X (Pascal) Off | 00000000:02:00.0 Off | N/A | | 33% 55C P8 14W / 250W | 2417MiB / 12189MiB | 0% Default |"><pre class="notranslate"><code class="notranslate">| 0 TITAN X (Pascal) Off | 00000000:02:00.0 Off | N/A | | 33% 55C P8 14W / 250W | 2417MiB / 12189MiB | 0% Default | </code></pre></div> <p dir="auto">After second run of this (but without the lines defining <code class="notranslate">net</code> and <code class="notranslate">data</code>):</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="| 0 TITAN X (Pascal) Off | 00000000:02:00.0 Off | N/A | | 32% 51C P2 58W / 250W | 4417MiB / 12189MiB | 0% Default |"><pre class="notranslate"><code class="notranslate">| 0 TITAN X (Pascal) Off | 00000000:02:00.0 Off | N/A | | 32% 51C P2 58W / 250W | 4417MiB / 12189MiB | 0% Default | </code></pre></div> <p dir="auto">This seems like a similar issue to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="275917710" data-permission-text="Title is private" data-url="https://github.com/pytorch/pytorch/issues/3824" data-hovercard-type="issue" data-hovercard-url="/pytorch/pytorch/issues/3824/hovercard" href="https://github.com/pytorch/pytorch/issues/3824">#3824</a>. The code in that issue's first post that reproduces it is similar to mine, so I suspect I am doing it correctly (just to defend myself!).</p> <p dir="auto"><code class="notranslate">torch.__version__</code> is <code class="notranslate">'0.3.0.post4'</code></p> <p dir="auto">I downgraded pytorch to 0.2.0 to make sure it didn't happen, and it appears not to; <code class="notranslate">torch.__version__</code> says <code class="notranslate">'0.2.0_0'</code>.</p> <p dir="auto">Sorry if you are working on this already; I hope that some more feedback wouldn't be too annoying, at least.</p> <p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ezyang/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ezyang">@ezyang</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ssnl/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ssnl">@ssnl</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/albanD/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/albanD">@albanD</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/zou3519/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/zou3519">@zou3519</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/gqchen/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/gqchen">@gqchen</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ngimel/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ngimel">@ngimel</a></p>
1
<p dir="auto"><strong>TypeScript Version:</strong></p> <p dir="auto">1.8</p> <p dir="auto"><strong>Code</strong></p> <p dir="auto">I have following tsconfig.json file in my project root directory (e.g. P:\MyProjectRoot\tsconfig.json):</p> <div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{ &quot;compileOnSave&quot;: true, &quot;compilerOptions&quot;: { &quot;preserveConstEnums&quot;: true, &quot;experimentalDecorators&quot;: true, &quot;declaration&quot;: false, &quot;emitBOM&quot;: true, &quot;sourceMap&quot;: true, &quot;outFile&quot;: &quot;Scripts/site/Serene.Web.js&quot; } }"><pre class="notranslate">{ <span class="pl-ent">"compileOnSave"</span>: <span class="pl-c1">true</span>, <span class="pl-ent">"compilerOptions"</span>: { <span class="pl-ent">"preserveConstEnums"</span>: <span class="pl-c1">true</span>, <span class="pl-ent">"experimentalDecorators"</span>: <span class="pl-c1">true</span>, <span class="pl-ent">"declaration"</span>: <span class="pl-c1">false</span>, <span class="pl-ent">"emitBOM"</span>: <span class="pl-c1">true</span>, <span class="pl-ent">"sourceMap"</span>: <span class="pl-c1">true</span>, <span class="pl-ent">"outFile"</span>: <span class="pl-s"><span class="pl-pds">"</span>Scripts/site/Serene.Web.js<span class="pl-pds">"</span></span> } }</pre></div> <p dir="auto">I have my .ts files under some sub folders of ~/Scripts and ~/Modules directories.</p> <p dir="auto">I'm running TypeScript compiler with the following command line:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" P:\MyProjectRoot&gt;&quot;c:\Program Files (x86)\Microsoft SDKs\TypeScript\1.8\tsc&quot;"><pre class="notranslate"><code class="notranslate"> P:\MyProjectRoot&gt;"c:\Program Files (x86)\Microsoft SDKs\TypeScript\1.8\tsc" </code></pre></div> <p dir="auto"><strong>Expected behavior:</strong></p> <p dir="auto">I expect it to generate a output at P:\MyProjectRoot\scripts\site\Serene.Web.js</p> <p dir="auto"><strong>Actual behavior:</strong></p> <p dir="auto">tsc just exists without generating a file or giving any error.</p> <p dir="auto">If i run same command line under P:\MyProjectRoot\scripts:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" P:\MyProjectRoot\scripts&gt;&quot;c:\Program Files (x86)\Microsoft SDKs\TypeScript\1.8\tsc&quot;"><pre class="notranslate"><code class="notranslate"> P:\MyProjectRoot\scripts&gt;"c:\Program Files (x86)\Microsoft SDKs\TypeScript\1.8\tsc" </code></pre></div> <p dir="auto">It generates the expected output.</p> <p dir="auto">As a side note, tsc is not in path, not sure if it has any effects.</p> <p dir="auto">Also this root folder has a .csproj file with TypeScript configured. I tried to delete all files except tsconfig.json in root directory, but it had no effect.</p> <p dir="auto">There is no other tsconfig.json file in subdirectories or parent folders.</p>
<p dir="auto">From the kangax compatibility table (<a href="http://kangax.github.io/compat-table/es6/#block-level_function_declaration" rel="nofollow">related test</a>):</p> <blockquote> <p dir="auto"><a href="http://kangax.github.io/compat-table/es6/index.html#block-level-function-note" rel="nofollow">14</a> Note that prior to ES6, it was <a href="http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls" rel="nofollow">recommended</a> that ES5 implementations forbid block-level declarations in strict mode.</p> </blockquote> <p dir="auto">In ES6, block-level function declarations have block scoping in strict mode. Currently the following is a compiler error in TypeScript:</p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&quot;use strict&quot;; function f() { // error TS2393: Duplicate function implementation. return 1; } { function f() { // error TS2393: Duplicate function implementation. return 2; } console.log(f() === 2); } console.log(f() === 1);"><pre class="notranslate"><span class="pl-s">"use strict"</span><span class="pl-kos">;</span> <span class="pl-k">function</span> <span class="pl-en">f</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-c">// error TS2393: Duplicate function implementation.</span> <span class="pl-k">return</span> <span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">{</span> <span class="pl-k">function</span> <span class="pl-en">f</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-c">// error TS2393: Duplicate function implementation.</span> <span class="pl-k">return</span> <span class="pl-c1">2</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-en">f</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">===</span> <span class="pl-c1">2</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-en">f</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">===</span> <span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p dir="auto">We should consider the following changes:</p> <ol dir="auto"> <li>Allow the above in ES6 when in strict mode, with the function declaration <code class="notranslate">f</code> being block-scoped with respect to name resolution.</li> <li>For ES5 strict-mode, allow the above with the following emit:</li> </ol> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&quot;use strict&quot;; function f() { return 1; } { function f_1() { return 2; } console.log(f_1() === 2); } console.log(f() === 1);"><pre class="notranslate"><span class="pl-s">"use strict"</span><span class="pl-kos">;</span> <span class="pl-k">function</span> <span class="pl-en">f</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">{</span> <span class="pl-k">function</span> <span class="pl-en">f_1</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-c1">2</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-en">f_1</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">===</span> <span class="pl-c1">2</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-en">f</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">===</span> <span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
0
<pre class="notranslate">pi@raspberrypi ~ $ go version go version devel +c61a75775ab6 Fri Mar 22 17:46:45 2013 -0400 linux/arm pi@raspberrypi ~ $ cd $ov/go-client/hellovg pi@raspberrypi ~/gowork/src/github.com/ajstarks/openvg/go-client/hellovg $ ./hellovg fatal error: malloc/free - deadlock [signal 0xb code=0x1 addr=0x2f0 pc=0x2cc04] goroutine 1 [syscall]: [fp=0xb689ff1c] return() /home/pi/go/src/pkg/runtime/asm_arm.s:275 [fp=0xb689ff44] runtime.cgocall(0x33a54, 0xb576c) /home/pi/go/src/pkg/runtime/cgocall.c:149 +0xd8 [fp=0xb689ff6c] runtime.cgocall(0xb6f5f5f5, 0xff0000) /home/pi/go/src/pkg/runtime/cgocall.c:149 +0xd8 goroutine 2 [syscall]: Note that all tests passed for the build. This is my standard test when I pull a new release on my raspi-- rebuild everything, rebuild the cgo-based openvg library, rebuild all clients. What do you see instead? Crash Which compiler are you using (5g, 6g, 8g, gccgo)? 5g, cgo Which operating system are you using? Linux raspberrypi 3.6.11+ #385 PREEMPT Fri Mar 1 21:53:22 GMT 2013 armv6l GNU/Linux Which version are you using? (run 'go version') go version devel +c61a75775ab6 Fri Mar 22 17:46:45 2013 -0400 linux/arm Please provide any additional information below. The crashing program is linked with a cgo-created OpenVG library. See: <a href="https://github.com/ajstarks/openvg/blob/master/openvg.go">https://github.com/ajstarks/openvg/blob/master/openvg.go</a></pre>
<pre class="notranslate">What does 'go version' print? go version go1.3beta2 +5bf1a8b3aeea Thu May 29 13:47:31 2014 -0400 darwin/amd64 What steps reproduce the problem? If possible, include a link to a program on play.golang.org. 1. run this code: <a href="http://play.golang.org/p/hxuIOC49ac" rel="nofollow">http://play.golang.org/p/hxuIOC49ac</a> What happened? A quarter to a half of the requests have errors such as: - http: can't write HTTP request on broken connection - Get <a href="http://www.adobe.com/nz/nz-sitemap.xml" rel="nofollow">http://www.adobe.com/nz/nz-sitemap.xml</a>: EOF What should have happened instead? All get requests should succeed Please provide any additional information below. If you put a 1 second sleep between each request they all succeed I looked for possibly related issues and this and found these that seem to be related: <a href="https://golang.org/issue/4677" rel="nofollow">https://golang.org/issue/4677</a> <a href="https://golang.org/issue/3514" rel="nofollow">https://golang.org/issue/3514</a></pre>
0
<p dir="auto">We propose to add a <code class="notranslate">pod/dockercmd</code> subresource, so that user can run some userful docker command on his container, such as commit the image of his container by running <code class="notranslate">docker commit</code>.</p> <p dir="auto">By now, k8s just support the <code class="notranslate">docker logs</code> and <code class="notranslate">docker attach</code>command by the <code class="notranslate">pod/log</code> and <code class="notranslate">pod/attach</code> subresource. Our idea is to add a general <code class="notranslate">pod/dockercmd</code> subresource to support more useful docker commands(and disable some dangerous commands such as <code class="notranslate">docker stop</code>), the existing <code class="notranslate">pod/log</code> and <code class="notranslate">pod/attache</code> subresource can be deprecated after the <code class="notranslate">pod/dockercmd</code> subresource is supported.</p> <p dir="auto">Such a way is much more extensible: if we want support another docker command in the future, just add it to the "whitelist", instead of adding a new subresource and duplicating a lot of code.</p> <p dir="auto">Any comment is welcomed.</p>
<p dir="auto">Passed on kubernetes-test-go 3-4 times, and then failed:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TestGC gc_controller_test.go:122: [1]pod's deleted expected and actual did not match. expected: [a] actual: [b]"><pre class="notranslate"><code class="notranslate">TestGC gc_controller_test.go:122: [1]pod's deleted expected and actual did not match. expected: [a] actual: [b] </code></pre></div> <p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/brendandburns/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/brendandburns">@brendandburns</a></p>
0
<p dir="auto">I'm using Chrome version 21 and Mac OS X 10.7.</p> <p dir="auto">I <strong>don't</strong> have this same problem on Firefox 14, Safari 6, or Opera 12.</p>
<p dir="auto">Tabs used as tabbable content areas for swapping out panes of content display no content each time the page is refreshed. I have to click on the second tab to display the content included in both tabs.</p> <p dir="auto">For info, in my tabs, there aint any js effect but bootstrap-tabs.js.</p>
0
<p dir="auto">Deep Learning VM images/tf-2-0-cpu-experimental-20190502</p> <div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="googcheng@tensorflow-4-vm:~$ git clone https://github.com/tensorflow/tensorflow.git Cloning into 'tensorflow'... remote: Enumerating objects: 2167, done. remote: Counting objects: 100% (2167/2167), done. remote: Compressing objects: 100% (845/845), done. remote: Total 598119 (delta 1392), reused 1643 (delta 1320), pack-reused 595952 Receiving objects: 100% (598119/598119), 343.85 MiB | 47.04 MiB/s, done. Resolving deltas: 100% (483846/483846), done. googcheng@tensorflow-4-vm:~$ ls tensorflow googcheng@tensorflow-4-vm:~$ cd tensorflow/ googcheng@tensorflow-4-vm:~/tensorflow$ ls ACKNOWLEDGMENTS AUTHORS CODEOWNERS CONTRIBUTING.md LICENSE RELEASE.md third_party ADOPTERS.md BUILD configure ISSUES.md models.BUILD SECURITY.md tools arm_compiler.BUILD CODE_OF_CONDUCT.md configure.py ISSUE_TEMPLATE.md README.md tensorflow WORKSPACE googcheng@tensorflow-4-vm:~/tensorflow$ bazel run -c opt --copt=-mavx2 --copt=-mfma \ &gt; tensorflow/examples/speech_commands:train -- \ &gt; --model_architecture=tiny_conv --window_stride=20 --preprocess=average \ &gt; --wanted_words=&quot;yes,no&quot; --silence_percentage=25 --unknown_percentage=25 --quantize=1 Extracting Bazel installation... Starting local Bazel server and connecting to it... INFO: Options provided by the client: Inherited 'common' options: --isatty=1 --terminal_columns=112 INFO: Reading rc options for 'run' from /home/googcheng/tensorflow/.bazelrc: Inherited 'build' options: --apple_platform_type=macos --define framework_shared_object=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone --strategy=Genrule=standalone -c opt --announce_rc --define=grpc_no_ares=true --define=PREFIX=/usr --define=LIBDIR=$(PREFIX)/lib --define=INCLUDEDIR=$(PREFIX)/include ERROR: /home/googcheng/.cache/bazel/_bazel_googcheng/c7d71bbdf8501e4441f5b58bb2db4ae1/external/io_bazel_rules_closure/closure/protobuf/closure_proto_library.bzl:66:21: name 'ProtoInfo' is not defined (did you mean 'protos'?) ERROR: error loading package '': Extension 'closure/protobuf/closure_proto_library.bzl' has errors ERROR: error loading package '': Extension 'closure/protobuf/closure_proto_library.bzl' has errors INFO: Elapsed time: 5.973s INFO: 0 processes. FAILED: Build did NOT complete successfully (0 packages loaded) FAILED: Build did NOT complete successfully (0 packages loaded) googcheng@tensorflow-4-vm:~/tensorflow$ git log commit 94feeb1c0ade3c673a758c0794e19c82b6e868b6 Author: Tiezhen WANG &lt;[email protected]&gt; Date: Fri May 31 03:18:30 2019 -0700 nit remove unnecessary indirection in all_ops_resolver. PiperOrigin-RevId: 250856298 commit b1a535b3abc11de5e00f5b40b2a7f795b7160376 Author: A. Unique TensorFlower &lt;[email protected]&gt; Date: Fri May 31 02:49:19 2019 -0700 Test that tf.saved_model.load() does not add to the TRAINABLE_VARIABLES collection and add a comment why. There is no change in behavior."><pre class="notranslate">googcheng@tensorflow-4-vm:<span class="pl-k">~</span>$ git clone https://github.com/tensorflow/tensorflow.git Cloning into <span class="pl-s"><span class="pl-pds">'</span>tensorflow<span class="pl-pds">'</span></span>... remote: Enumerating objects: 2167, done. remote: Counting objects: 100% (2167/2167), done. remote: Compressing objects: 100% (845/845), done. remote: Total 598119 (delta 1392), reused 1643 (delta 1320), pack-reused 595952 Receiving objects: 100% (598119/598119), 343.85 MiB <span class="pl-k">|</span> 47.04 MiB/s, done. Resolving deltas: 100% (483846/483846), done. googcheng@tensorflow-4-vm:<span class="pl-k">~</span>$ ls tensorflow googcheng@tensorflow-4-vm:<span class="pl-k">~</span>$ <span class="pl-c1">cd</span> tensorflow/ googcheng@tensorflow-4-vm:<span class="pl-k">~</span>/tensorflow$ ls ACKNOWLEDGMENTS AUTHORS CODEOWNERS CONTRIBUTING.md LICENSE RELEASE.md third_party ADOPTERS.md BUILD configure ISSUES.md models.BUILD SECURITY.md tools arm_compiler.BUILD CODE_OF_CONDUCT.md configure.py ISSUE_TEMPLATE.md README.md tensorflow WORKSPACE googcheng@tensorflow-4-vm:<span class="pl-k">~</span>/tensorflow$ bazel run -c opt --copt=-mavx2 --copt=-mfma \ <span class="pl-k">&gt;</span> tensorflow/examples/speech_commands:train -- \ <span class="pl-k">&gt;</span> --model_architecture=tiny_conv --window_stride=20 --preprocess=average \ <span class="pl-k">&gt;</span> --wanted_words=<span class="pl-s"><span class="pl-pds">"</span>yes,no<span class="pl-pds">"</span></span> --silence_percentage=25 --unknown_percentage=25 --quantize=1 Extracting Bazel installation... Starting <span class="pl-k">local</span> Bazel server and connecting to it... INFO: Options provided by the client: Inherited <span class="pl-s"><span class="pl-pds">'</span>common<span class="pl-pds">'</span></span> options: --isatty=1 --terminal_columns=112 INFO: Reading rc options <span class="pl-k">for</span> <span class="pl-s"><span class="pl-pds">'</span>run<span class="pl-pds">'</span></span> from /home/googcheng/tensorflow/.bazelrc: Inherited <span class="pl-s"><span class="pl-pds">'</span>build<span class="pl-pds">'</span></span> options: --apple_platform_type=macos --define framework_shared_object=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone --strategy=Genrule=standalone -c opt --announce_rc --define=grpc_no_ares=true --define=PREFIX=/usr --define=LIBDIR=<span class="pl-s"><span class="pl-pds">$(</span>PREFIX<span class="pl-pds">)</span></span>/lib --define=INCLUDEDIR=<span class="pl-s"><span class="pl-pds">$(</span>PREFIX<span class="pl-pds">)</span></span>/include ERROR: /home/googcheng/.cache/bazel/_bazel_googcheng/c7d71bbdf8501e4441f5b58bb2db4ae1/external/io_bazel_rules_closure/closure/protobuf/closure_proto_library.bzl:66:21: name <span class="pl-s"><span class="pl-pds">'</span>ProtoInfo<span class="pl-pds">'</span></span> is not defined (did you mean <span class="pl-s"><span class="pl-pds">'</span>protos<span class="pl-pds">'</span></span><span class="pl-k">?</span>) ERROR: error loading package <span class="pl-s"><span class="pl-pds">'</span><span class="pl-pds">'</span></span>: Extension <span class="pl-s"><span class="pl-pds">'</span>closure/protobuf/closure_proto_library.bzl<span class="pl-pds">'</span></span> has errors ERROR: error loading package <span class="pl-s"><span class="pl-pds">'</span><span class="pl-pds">'</span></span>: Extension <span class="pl-s"><span class="pl-pds">'</span>closure/protobuf/closure_proto_library.bzl<span class="pl-pds">'</span></span> has errors INFO: Elapsed time: 5.973s INFO: 0 processes. FAILED: Build did NOT <span class="pl-c1">complete</span> successfully (0 packages loaded) FAILED: Build did NOT <span class="pl-c1">complete</span> successfully (0 packages loaded) googcheng@tensorflow-4-vm:<span class="pl-k">~</span>/tensorflow$ git log commit 94feeb1c0ade3c673a758c0794e19c82b6e868b6 Author: Tiezhen WANG <span class="pl-k">&lt;</span>[email protected]<span class="pl-k">&gt;</span> Date: Fri May 31 03:18:30 2019 -0700 nit remove unnecessary indirection <span class="pl-k">in</span> all_ops_resolver. PiperOrigin-RevId: 250856298 commit b1a535b3abc11de5e00f5b40b2a7f795b7160376 Author: A. Unique TensorFlower <span class="pl-k">&lt;</span>[email protected]<span class="pl-k">&gt;</span> Date: Fri May 31 02:49:19 2019 -0700 Test that <span class="pl-en">tf.saved_model.load</span>() does not add to the TRAINABLE_VARIABLES collection and add a comment why. There is no change <span class="pl-k">in</span> behavior.</pre></div>
<p dir="auto">I am using the Graph Transforms Tool (built with Bazel) to prepare my graph for Android TensorFlow Inference.</p> <p dir="auto">When using <code class="notranslate">--transforms='quantize_weights'</code> everything works just fine.<br> But with <code class="notranslate">--transforms='quantize_weights quantize_nodes'</code> I get this:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="I/TensorFlowInferenceInterface: Checking to see if TensorFlow native methods are already loaded I/TensorFlowInferenceInterface: TensorFlow native methods already loaded A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 22562 (obin.loremipsum) [ 03-24 19:19:10.194 375: 375 W/ ] debuggerd: handling request: pid=22562 uid=10173 gid=10173 tid=22562"><pre class="notranslate"><code class="notranslate">I/TensorFlowInferenceInterface: Checking to see if TensorFlow native methods are already loaded I/TensorFlowInferenceInterface: TensorFlow native methods already loaded A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 22562 (obin.loremipsum) [ 03-24 19:19:10.194 375: 375 W/ ] debuggerd: handling request: pid=22562 uid=10173 gid=10173 tid=22562 </code></pre></div> <p dir="auto">I don't have any clue on what has happened.<br> I wasn't able to find anything related online.</p>
0
<p dir="auto">The behaviour below occurs in versions <code class="notranslate">'0.15.0rc1-21-g32c5016'</code> and <code class="notranslate">'0.14.1'</code>.</p> <p dir="auto">When the <code class="notranslate">label</code> passed to the <code class="notranslate">drop</code> method of a <code class="notranslate">Series</code> is not in the index:<br> (a) if the index is not all booleans then an error is raised<br> (b) if the index is all booleans and has length &gt; 1 then no error is raised; the original series is returned<br> (c) if the index is all booleans and has length == 1 then an error is raised</p> <p dir="auto">I propose that:</p> <ol dir="auto"> <li>the difference between the behaviour in (a) and (b) should be documented</li> <li>the behaviour in (c) should be changed to match that in (b)</li> </ol> <p dir="auto">Examples of current behaviour:<br> (a)</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; pd.Series([1, 1], index=['a', True]).drop(False) ValueError: labels [False] not contained in axis"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">pd</span>.<span class="pl-v">Series</span>([<span class="pl-c1">1</span>, <span class="pl-c1">1</span>], <span class="pl-s1">index</span><span class="pl-c1">=</span>[<span class="pl-s">'a'</span>, <span class="pl-c1">True</span>]).<span class="pl-en">drop</span>(<span class="pl-c1">False</span>) <span class="pl-v">ValueError</span>: <span class="pl-s1">labels</span> [<span class="pl-c1">False</span>] <span class="pl-c1">not</span> <span class="pl-s1">contained</span> <span class="pl-c1">in</span> <span class="pl-s1">axis</span></pre></div> <p dir="auto">(b)</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; pd.Series([1, 1], index=[True, True]).drop(False) True 1 True 1 dtype: int64"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">pd</span>.<span class="pl-v">Series</span>([<span class="pl-c1">1</span>, <span class="pl-c1">1</span>], <span class="pl-s1">index</span><span class="pl-c1">=</span>[<span class="pl-c1">True</span>, <span class="pl-c1">True</span>]).<span class="pl-en">drop</span>(<span class="pl-c1">False</span>) <span class="pl-c1">True</span> <span class="pl-c1">1</span> <span class="pl-c1">True</span> <span class="pl-c1">1</span> <span class="pl-s1">dtype</span>: <span class="pl-s1">int64</span></pre></div> <p dir="auto">(c)</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; pd.Series([1], index=[True]).drop(False) ValueError: labels [False] not contained in axis"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">pd</span>.<span class="pl-v">Series</span>([<span class="pl-c1">1</span>], <span class="pl-s1">index</span><span class="pl-c1">=</span>[<span class="pl-c1">True</span>]).<span class="pl-en">drop</span>(<span class="pl-c1">False</span>) <span class="pl-v">ValueError</span>: <span class="pl-s1">labels</span> [<span class="pl-c1">False</span>] <span class="pl-c1">not</span> <span class="pl-s1">contained</span> <span class="pl-c1">in</span> <span class="pl-s1">axis</span></pre></div>
<p dir="auto">Hello,</p> <p dir="auto">The following code ran perfectly fine on 0.14.1, but breaks on 0.15 RC1, raising<br> ValueError: cannot reindex from a duplicate axis.<br> Is it a bug or an intended change of behaviour? Thanks.</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import pandas as pd import numpy as np d = {'Quantity' : pd.Series([1., 2., 3., 4., 5.], index=['foo', 'foo', 'foo', 'foo', 'bar']), 'Group' : pd.Series([1, 2, 1, 2, 1], index=['foo', 'foo', 'foo', 'foo', 'bar'])} df = pd.DataFrame(d) groups = df.groupby([df.index, 'Group'], sort=False, as_index=True) temp = groups['Quantity'].apply(lambda x: x+np.roll(x, 1)) df['QuantityApplied'] = temp"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span> <span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span> <span class="pl-s1">d</span> <span class="pl-c1">=</span> {<span class="pl-s">'Quantity'</span> : <span class="pl-s1">pd</span>.<span class="pl-v">Series</span>([<span class="pl-c1">1.</span>, <span class="pl-c1">2.</span>, <span class="pl-c1">3.</span>, <span class="pl-c1">4.</span>, <span class="pl-c1">5.</span>], <span class="pl-s1">index</span><span class="pl-c1">=</span>[<span class="pl-s">'foo'</span>, <span class="pl-s">'foo'</span>, <span class="pl-s">'foo'</span>, <span class="pl-s">'foo'</span>, <span class="pl-s">'bar'</span>]), <span class="pl-s">'Group'</span> : <span class="pl-s1">pd</span>.<span class="pl-v">Series</span>([<span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">1</span>], <span class="pl-s1">index</span><span class="pl-c1">=</span>[<span class="pl-s">'foo'</span>, <span class="pl-s">'foo'</span>, <span class="pl-s">'foo'</span>, <span class="pl-s">'foo'</span>, <span class="pl-s">'bar'</span>])} <span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>(<span class="pl-s1">d</span>) <span class="pl-s1">groups</span> <span class="pl-c1">=</span> <span class="pl-s1">df</span>.<span class="pl-en">groupby</span>([<span class="pl-s1">df</span>.<span class="pl-s1">index</span>, <span class="pl-s">'Group'</span>], <span class="pl-s1">sort</span><span class="pl-c1">=</span><span class="pl-c1">False</span>, <span class="pl-s1">as_index</span><span class="pl-c1">=</span><span class="pl-c1">True</span>) <span class="pl-s1">temp</span> <span class="pl-c1">=</span> <span class="pl-s1">groups</span>[<span class="pl-s">'Quantity'</span>].<span class="pl-en">apply</span>(<span class="pl-k">lambda</span> <span class="pl-s1">x</span>: <span class="pl-s1">x</span><span class="pl-c1">+</span><span class="pl-s1">np</span>.<span class="pl-en">roll</span>(<span class="pl-s1">x</span>, <span class="pl-c1">1</span>)) <span class="pl-s1">df</span>[<span class="pl-s">'QuantityApplied'</span>] <span class="pl-c1">=</span> <span class="pl-s1">temp</span></pre></div> <p dir="auto">Pandas 0.15.0 RC1</p>
0
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="deno compile -A --unstable main.ts -o ngs-signer -L debug Check file:///Users/synadia/Dropbox/code/src/github.com/aricart/nas-nats/ngs-signer/main.ts Compile file:///Users/synadia/Dropbox/code/src/github.com/aricart/nas-nats/ngs-signer/main.ts Emit ngs-signer synadia@malaga ~/D/c/s/g/a/n/ngs-signer (main)&gt; ./ngs-signer -c ngs-signer.conf error: Module not found"><pre class="notranslate"><code class="notranslate">deno compile -A --unstable main.ts -o ngs-signer -L debug Check file:///Users/synadia/Dropbox/code/src/github.com/aricart/nas-nats/ngs-signer/main.ts Compile file:///Users/synadia/Dropbox/code/src/github.com/aricart/nas-nats/ngs-signer/main.ts Emit ngs-signer synadia@malaga ~/D/c/s/g/a/n/ngs-signer (main)&gt; ./ngs-signer -c ngs-signer.conf error: Module not found </code></pre></div> <p dir="auto">Running with <code class="notranslate">-L debug</code> doesn't produce any useful messages.</p> <p dir="auto">Verified that executables fail both in OS X, and x86_64-unknown-linux-gnu.</p> <p dir="auto">If the above error is a true error (perhaps changes in the bundling in 1.19.0, a path/url to the missing module would be great) - all previous versions have been stable.</p>
<p dir="auto">Since v1.19.0 was released, we're seeing a problem when running <code class="notranslate">deno compile</code> in Github Actions.</p> <p dir="auto">See: <a href="https://github.com/ecadlabs/taqueria/runs/5234787765?check_suite_focus=true">https://github.com/ecadlabs/taqueria/runs/5234787765?check_suite_focus=true</a></p> <p dir="auto">We were using:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- name: Setup Deno uses: denoland/setup-deno@v1 with: deno-version: &quot;^1.0.0&quot;"><pre class="notranslate"><code class="notranslate">- name: Setup Deno uses: denoland/setup-deno@v1 with: deno-version: "^1.0.0" </code></pre></div> <p dir="auto">When I hardcode the version to 1.18.2 everything works fine:</p> <p dir="auto"><a href="https://github.com/ecadlabs/taqueria/runs/5236615612?check_suite_focus=true">https://github.com/ecadlabs/taqueria/runs/5236615612?check_suite_focus=true</a></p>
1
<ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/mui-org/material-ui/issues">issues</a> of this repository and believe that this is not a duplicate.</li> </ul> <h2 dir="auto">Expected Behavior</h2> <p dir="auto">When using material-ui with Server Side Rendering -<br> There should be no validation issues shown by <a href="https://validator.w3.org" rel="nofollow">https://validator.w3.org</a></p> <h2 dir="auto">Current Behavior</h2> <p dir="auto">There are many validation issues thrown by <a href="https://validator.w3.org" rel="nofollow">https://validator.w3.org</a> when using Material-UI with server side rendering</p> <h2 dir="auto">Steps to Reproduce (for bugs)</h2> <ol dir="auto"> <li>Go to <a href="https://validator.w3.org" rel="nofollow">https://validator.w3.org</a></li> <li>Enter <a href="https://material-ui.com/" rel="nofollow">https://material-ui.com/</a> in address Bar (since material-ui-next is exactly the use-case which is Server-Side-Rendering with Material-UI</li> <li>There are many error generated, some of them quite easy to fix.</li> <li>Enter URLs of other pages from components demo and there are some similar errors and some other errors as well</li> </ol> <h2 dir="auto">Context</h2> <p dir="auto">I want to create an application which validates with W3C validator.</p> <h2 dir="auto">Your Environment</h2> <table role="table"> <thead> <tr> <th>Tech</th> <th>Version</th> </tr> </thead> <tbody> <tr> <td>Material-UI</td> <td>1.0.0-beta.27</td> </tr> <tr> <td>React</td> <td>16.2.0</td> </tr> <tr> <td>browser</td> <td></td> </tr> <tr> <td>etc</td> <td></td> </tr> </tbody> </table>
<ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/mui-org/material-ui/issues">issues</a> of this repository and believe that this is not a duplicate.</li> </ul> <h2 dir="auto">Expected Behavior</h2> <p dir="auto">You should be able to use a <code class="notranslate">[Switch]</code> inside an <code class="notranslate">[ExpansionPanel]</code></p> <h2 dir="auto">Current Behavior</h2> <p dir="auto">When you include a <code class="notranslate">[Switch]</code> inside an <code class="notranslate">[ExpansionPanel]</code> every time you toggle the switch, the expansion panel collapses.</p> <h2 dir="auto">Steps to Reproduce (for bugs)</h2> <ol dir="auto"> <li><a href="https://codesandbox.io/s/wwq1nq4w77" rel="nofollow">https://codesandbox.io/s/wwq1nq4w77</a></li> <li>Insert Switch into ExpansionPanel</li> <li>Use switch</li> </ol> <h2 dir="auto">Context</h2> <p dir="auto">I need to switch between advanced content inside the panel.</p> <h2 dir="auto">Your Environment</h2> <table role="table"> <thead> <tr> <th>Tech</th> <th>Version</th> </tr> </thead> <tbody> <tr> <td>Material-UI</td> <td>1.0.0-beta.22</td> </tr> <tr> <td>React</td> <td>16.0.0</td> </tr> <tr> <td>browser</td> <td>Safari Version 11.0.1 (13604.3.5)</td> </tr> </tbody> </table>
0
<h3 dir="auto">What problem does this feature solve?</h3> <p dir="auto">similar to angularjs directives, would like the ability to alias the names the component's parent uses to pass values</p> <h3 dir="auto">What does the proposed API look like?</h3> <p dir="auto">component:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="export default { name: &quot;paging&quot;, props: { &quot;count&quot;: {&quot;name&quot;: &quot;pagingCount&quot;, &quot;type&quot;: Number} }, "><pre class="notranslate"><code class="notranslate">export default { name: "paging", props: { "count": {"name": "pagingCount", "type": Number} }, </code></pre></div> <p dir="auto">parent:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;paging v-bind:paging-count=&quot;itemsCount&quot;&gt;&lt;/paging&gt;"><pre class="notranslate"><code class="notranslate">&lt;paging v-bind:paging-count="itemsCount"&gt;&lt;/paging&gt; </code></pre></div>
<h3 dir="auto">What problem does this feature solve?</h3> <p dir="auto">Debugging from template code is frustratingly impractical because you lose access to the conventional tools available to you in plain javascript. The reference to the <code class="notranslate">console</code> is missing because it is not in the scope of the component instance. Yes, you can add it to the component instance or even the global Vue prototype, but to have to do this every time you need to debug, and then remove for the sake of keeping your code clean, is needlessly tedious.</p> <p dir="auto">Additionally, the <code class="notranslate">debugger</code> keyword (for example within an in-template IIFE) is barely of any use because the compiled variables do not match those of the component instance.</p> <p dir="auto">This has been an issue for me for a while now, but I was more forgiving of it because how incredible Vue otherwise is. However, I recently noticed that <a href="https://svelte.dev/docs#debug" rel="nofollow">Svelte.js offers a pretty nifty OOTB feature for debugging in templates</a>.</p> <p dir="auto">From their docs:</p> <blockquote> <p dir="auto">The {<a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/debug/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/debug">@debug</a> ...} tag offers an alternative to console.log(...). It logs the values of specific variables whenever they change, and pauses code execution if you have devtools open.</p> <p dir="auto">It accepts a comma-separated list of variable names (not arbitrary expressions).</p> <p dir="auto">The {<a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/debug/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/debug">@debug</a>} tag without any arguments will insert a debugger statement that gets triggered when any state changes, as opposed to the specified variables.</p> </blockquote> <p dir="auto">Is there any way we can bring this into Vue template syntax?</p> <h3 dir="auto">What does the proposed API look like?</h3> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;template&gt; &lt;div&gt; {{ @debug }} or {{ @debug var1, var2, ..., varN }} &lt;/div&gt; &lt;/template&gt;"><pre class="notranslate"><code class="notranslate">&lt;template&gt; &lt;div&gt; {{ @debug }} or {{ @debug var1, var2, ..., varN }} &lt;/div&gt; &lt;/template&gt; </code></pre></div>
0
<p dir="auto">Hi,<br> Thank you for your awesome work which I regularly use!<br> Unfortunately after a <a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.kruskal.html" rel="nofollow">Kruskal-Wallis H-test</a> for independent samples I need to perform a Dunn test which is not already present and does not exist at all in Python (I only managed to found an R implementation <a href="https://cran.r-project.org/web/packages/dunn.test/index.html" rel="nofollow">cf this link</a>).</p>
<p dir="auto">When using <code class="notranslate">scipy.interpolate.interp1d</code> and specifying the same x-value multiple times the result is undefined, i.e., it depends on the interpolation method used (<code class="notranslate">kind</code>), but not in a very predictable way. The result ranges from <code class="notranslate">np.nan</code>, through any of the y-values that correspond to the duplicate x-values, to exceptions in the case of quadric and cubic splines.</p> <p dir="auto">I guess this is a weird edge case, so maybe it is okay to be inconsistent and not support it at all. This would make a lot of sense to me. In this case, I would like to suggest updating the documentation to something like <code class="notranslate">x-values must be unique</code>, potentially paired with an exception if non-unique values are encountered.</p> <p dir="auto">Alternatively, one could sanitize the input by merging duplicates, e.g., by computing their mean. That said, I didn't spend a lot of time thinking this option through so it might be unexpected for some interpolation methods.</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; from scipy.interpolate import interp1d &gt;&gt;&gt; kinds = ['linear', 'nearest', 'nearest-up', 'zero', 'slinear', 'previous', 'next'] &gt;&gt;&gt; for kind in kinds: ... print(f&quot;Output for Kind: {kind} \n {interp1d([0, 0, 1], [0, 0.5, 1], kind=kind)(0)}\n----&quot;) ... Output for Kind: linear nan # also creates warnings when called outside of f-string ---- Output for Kind: nearest 0.0 ---- Output for Kind: nearest-up 0.5 ---- Output for Kind: zero 0.5 ---- Output for Kind: slinear 0.5 ---- Output for Kind: previous 0.5 # should this not be 0.0 since the previous value should be 0 ---- Output for Kind: next 0.0 # should this not be 0.5 since the next value is 0.5 ---- &gt;&gt;&gt; interp1d([0, 0, 1], [0, 0.5, 1], kind=&quot;quadric&quot;)(0) Traceback (most recent call last): File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt; File &quot;/home/sebastian/.local/lib/python3.8/site-packages/scipy/interpolate/interpolate.py&quot;, line 443, in __init__ raise NotImplementedError(&quot;%s is unsupported: Use fitpack &quot; NotImplementedError: quadric is unsupported: Use fitpack routines for other types. &gt;&gt;&gt; interp1d([0, 0, 1], [0, 0.5, 1], kind=&quot;cubic&quot;)(0) Traceback (most recent call last): File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt; File &quot;/home/sebastian/.local/lib/python3.8/site-packages/scipy/interpolate/interpolate.py&quot;, line 546, in __init__ self._spline = make_interp_spline(xx, yy, k=order, File &quot;/home/sebastian/.local/lib/python3.8/site-packages/scipy/interpolate/_bsplines.py&quot;, line 788, in make_interp_spline raise ValueError(&quot;Expect x to not have duplicates&quot;) ValueError: Expect x to not have duplicates"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-k">from</span> <span class="pl-s1">scipy</span>.<span class="pl-s1">interpolate</span> <span class="pl-k">import</span> <span class="pl-s1">interp1d</span> <span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">kinds</span> <span class="pl-c1">=</span> [<span class="pl-s">'linear'</span>, <span class="pl-s">'nearest'</span>, <span class="pl-s">'nearest-up'</span>, <span class="pl-s">'zero'</span>, <span class="pl-s">'slinear'</span>, <span class="pl-s">'previous'</span>, <span class="pl-s">'next'</span>] <span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-k">for</span> <span class="pl-s1">kind</span> <span class="pl-c1">in</span> <span class="pl-s1">kinds</span>: ... <span class="pl-s1">print</span>(<span class="pl-s">f"Output for Kind: <span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">kind</span><span class="pl-kos">}</span></span> <span class="pl-cce">\n</span> <span class="pl-s1"><span class="pl-kos">{</span><span class="pl-en">interp1d</span>([<span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">1</span>], [<span class="pl-c1">0</span>, <span class="pl-c1">0.5</span>, <span class="pl-c1">1</span>], <span class="pl-s1">kind</span><span class="pl-c1">=</span><span class="pl-s1">kind</span>)(<span class="pl-c1">0</span>)<span class="pl-kos">}</span></span><span class="pl-cce">\n</span>----"</span>) ... <span class="pl-v">Output</span> <span class="pl-s1">for</span> <span class="pl-v">Kind</span>: <span class="pl-s1">linear</span> <span class="pl-s1">nan</span> <span class="pl-c"># also creates warnings when called outside of f-string</span> <span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-v">Output</span> <span class="pl-s1">for</span> <span class="pl-v">Kind</span>: <span class="pl-s1">nearest</span> <span class="pl-c1">0.0</span> <span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-v">Output</span> <span class="pl-s1">for</span> <span class="pl-v">Kind</span>: <span class="pl-s1">nearest</span><span class="pl-c1">-</span><span class="pl-s1">up</span> <span class="pl-c1">0.5</span> <span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-v">Output</span> <span class="pl-s1">for</span> <span class="pl-v">Kind</span>: <span class="pl-s1">zero</span> <span class="pl-c1">0.5</span> <span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-v">Output</span> <span class="pl-s1">for</span> <span class="pl-v">Kind</span>: <span class="pl-s1">slinear</span> <span class="pl-c1">0.5</span> <span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-v">Output</span> <span class="pl-s1">for</span> <span class="pl-v">Kind</span>: <span class="pl-s1">previous</span> <span class="pl-c1">0.5</span> <span class="pl-c"># should this not be 0.0 since the previous value should be 0</span> <span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-v">Output</span> <span class="pl-s1">for</span> <span class="pl-v">Kind</span>: <span class="pl-s1">next</span> <span class="pl-c1">0.0</span> <span class="pl-c"># should this not be 0.5 since the next value is 0.5</span> <span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-en">interp1d</span>([<span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">1</span>], [<span class="pl-c1">0</span>, <span class="pl-c1">0.5</span>, <span class="pl-c1">1</span>], <span class="pl-s1">kind</span><span class="pl-c1">=</span><span class="pl-s">"quadric"</span>)(<span class="pl-c1">0</span>) <span class="pl-v">Traceback</span> (<span class="pl-s1">most</span> <span class="pl-s1">recent</span> <span class="pl-s1">call</span> <span class="pl-s1">last</span>): <span class="pl-v">File</span> <span class="pl-s">"&lt;stdin&gt;"</span>, <span class="pl-s1">line</span> <span class="pl-c1">1</span>, <span class="pl-s1">in</span> <span class="pl-c1">&lt;</span><span class="pl-s1">module</span><span class="pl-c1">&gt;</span> <span class="pl-v">File</span> <span class="pl-s">"/home/sebastian/.local/lib/python3.8/site-packages/scipy/interpolate/interpolate.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">443</span>, <span class="pl-s1">in</span> <span class="pl-s1">__init__</span> <span class="pl-k">raise</span> <span class="pl-v">NotImplementedError</span>(<span class="pl-s">"%s is unsupported: Use fitpack "</span> <span class="pl-v">NotImplementedError</span>: <span class="pl-s1">quadric</span> <span class="pl-c1">is</span> <span class="pl-s1">unsupported</span>: <span class="pl-v">Use</span> <span class="pl-s1">fitpack</span> <span class="pl-s1">routines</span> <span class="pl-k">for</span> <span class="pl-s1">other</span> <span class="pl-s1">types</span>. <span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-en">interp1d</span>([<span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">1</span>], [<span class="pl-c1">0</span>, <span class="pl-c1">0.5</span>, <span class="pl-c1">1</span>], <span class="pl-s1">kind</span><span class="pl-c1">=</span><span class="pl-s">"cubic"</span>)(<span class="pl-c1">0</span>) <span class="pl-v">Traceback</span> (<span class="pl-s1">most</span> <span class="pl-s1">recent</span> <span class="pl-s1">call</span> <span class="pl-s1">last</span>): <span class="pl-v">File</span> <span class="pl-s">"&lt;stdin&gt;"</span>, <span class="pl-s1">line</span> <span class="pl-c1">1</span>, <span class="pl-c1">in</span> <span class="pl-c1">&lt;</span><span class="pl-s1">module</span><span class="pl-c1">&gt;</span> <span class="pl-v">File</span> <span class="pl-s">"/home/sebastian/.local/lib/python3.8/site-packages/scipy/interpolate/interpolate.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">546</span>, <span class="pl-s1">in</span> <span class="pl-s1">__init__</span> <span class="pl-s1">self</span>.<span class="pl-s1">_spline</span> <span class="pl-c1">=</span> <span class="pl-s1">make_interp_spline</span>(<span class="pl-s1">xx</span>, <span class="pl-s1">yy</span>, <span class="pl-s1">k</span><span class="pl-c1">=</span><span class="pl-s1">order</span>, <span class="pl-v">File</span> <span class="pl-s">"/home/sebastian/.local/lib/python3.8/site-packages/scipy/interpolate/_bsplines.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">788</span>, <span class="pl-s1">in</span> <span class="pl-s1">make_interp_spline</span> <span class="pl-s1">raise</span> <span class="pl-v">ValueError</span>(<span class="pl-s">"Expect x to not have duplicates"</span>) <span class="pl-v">ValueError</span>: <span class="pl-v">Expect</span> <span class="pl-s1">x</span> <span class="pl-s1">to</span> <span class="pl-c1">not</span> <span class="pl-s1">have</span> <span class="pl-s1">duplicates</span></pre></div>
0
<p dir="auto">Is there any way we can get more sugar for events as observables e.g.</p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import {Component, View, Directive, Output, EventEmitter, HostListener} from 'angular2/angular2'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; import {ElementRef} from 'angular2/core'; @Directive({ selector: '[draggable]' }) export class Draggable { mouseup = new EventEmitter(); mousemove = new EventEmitter(); mousedown = new EventEmitter(); mousedrag; @HostListener('mouseup', ['$event']) onMouseup(event) { this.mouseup.next(event); } @HostListener('mousedown', ['$event']) onMousedown(event) { this.mousedown.next(event); } @HostListener('mousemove', ['$event']) onMousemove(event) { this.mousemove.next(event); } constructor(public element: ElementRef) { this.element.nativeElement.style.position = 'relative'; this.element.nativeElement.style.cursor = 'pointer'; this.mousedrag = this.mousedown._subject .map(event =&gt; { event.preventDefault(); // calculate offsets when mouse down return { left: event.clientX - this.element.nativeElement.getBoundingClientRect().left, top: event.clientY - this.element.nativeElement.getBoundingClientRect().top }; }) .flatMap(imageOffset =&gt; { return this.mousemove._subject .map(pos =&gt; { // calculate offsets from mouse down to mouse moves return { top: pos.clientY - imageOffset.top, left: pos.clientX - imageOffset.left }; }) .takeUntil(this.mouseup._subject); }); } onInit() { this.mousedrag.subscribe({ next: pos =&gt; { // Update position this.element.nativeElement.style.top = pos.top + 'px'; this.element.nativeElement.style.left = pos.left + 'px'; } }); } } @Component({ selector: 'app' }) @View({ // needed in order to tell Angular's compiler what's in the template directives: [ Draggable ], styles: [` [draggable] { -webkit-transform: translate3d(0, 0, 0); -moz-transform: translate3d(0, 0, 0); -ms-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); background-image: url(https://cdn.rawgit.com/Reactive-Extensions/rx.angular.js/master/examples/draganddrop/logo.png); background-repeat: no-repeat; background-position: center; background-size: contain; height: 200px; width: 200px; color: #000000; border: 1px solid #666666; padding: 10px; } `], template: ` &lt;div draggable&gt; Draggable Div &lt;/div&gt; ` }) export class App { constructor() { } } "><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span><span class="pl-smi">Component</span><span class="pl-kos">,</span> <span class="pl-smi">View</span><span class="pl-kos">,</span> <span class="pl-smi">Directive</span><span class="pl-kos">,</span> <span class="pl-smi">Output</span><span class="pl-kos">,</span> <span class="pl-smi">EventEmitter</span><span class="pl-kos">,</span> <span class="pl-smi">HostListener</span><span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'angular2/angular2'</span><span class="pl-kos">;</span> <span class="pl-k">import</span> <span class="pl-kos">{</span><span class="pl-smi">DOM</span><span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'angular2/src/core/dom/dom_adapter'</span><span class="pl-kos">;</span> <span class="pl-k">import</span> <span class="pl-kos">{</span><span class="pl-smi">ElementRef</span><span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'angular2/core'</span><span class="pl-kos">;</span> @<span class="pl-smi">Directive</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">selector</span>: <span class="pl-s">'[draggable]'</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-k">export</span> <span class="pl-k">class</span> <span class="pl-smi">Draggable</span> <span class="pl-kos">{</span> <span class="pl-c1">mouseup</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">EventEmitter</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c1">mousemove</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">EventEmitter</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c1">mousedown</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">EventEmitter</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c1">mousedrag</span><span class="pl-kos">;</span> @<span class="pl-smi">HostListener</span><span class="pl-kos">(</span><span class="pl-s">'mouseup'</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-s">'$event'</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-en">onMouseup</span><span class="pl-kos">(</span><span class="pl-s1">event</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">mouseup</span><span class="pl-kos">.</span><span class="pl-en">next</span><span class="pl-kos">(</span><span class="pl-s1">event</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> @<span class="pl-smi">HostListener</span><span class="pl-kos">(</span><span class="pl-s">'mousedown'</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-s">'$event'</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-en">onMousedown</span><span class="pl-kos">(</span><span class="pl-s1">event</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">mousedown</span><span class="pl-kos">.</span><span class="pl-en">next</span><span class="pl-kos">(</span><span class="pl-s1">event</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> @<span class="pl-smi">HostListener</span><span class="pl-kos">(</span><span class="pl-s">'mousemove'</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-s">'$event'</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-en">onMousemove</span><span class="pl-kos">(</span><span class="pl-s1">event</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">mousemove</span><span class="pl-kos">.</span><span class="pl-en">next</span><span class="pl-kos">(</span><span class="pl-s1">event</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-k">public</span> <span class="pl-s1">element</span>: <span class="pl-smi">ElementRef</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">element</span><span class="pl-kos">.</span><span class="pl-c1">nativeElement</span><span class="pl-kos">.</span><span class="pl-c1">style</span><span class="pl-kos">.</span><span class="pl-c1">position</span> <span class="pl-c1">=</span> <span class="pl-s">'relative'</span><span class="pl-kos">;</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">element</span><span class="pl-kos">.</span><span class="pl-c1">nativeElement</span><span class="pl-kos">.</span><span class="pl-c1">style</span><span class="pl-kos">.</span><span class="pl-c1">cursor</span> <span class="pl-c1">=</span> <span class="pl-s">'pointer'</span><span class="pl-kos">;</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">mousedrag</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">mousedown</span><span class="pl-kos">.</span><span class="pl-c1">_subject</span> <span class="pl-kos">.</span><span class="pl-en">map</span><span class="pl-kos">(</span><span class="pl-s1">event</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-s1">event</span><span class="pl-kos">.</span><span class="pl-en">preventDefault</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// calculate offsets when mouse down</span> <span class="pl-k">return</span> <span class="pl-kos">{</span> <span class="pl-c1">left</span>: <span class="pl-s1">event</span><span class="pl-kos">.</span><span class="pl-c1">clientX</span> <span class="pl-c1">-</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">element</span><span class="pl-kos">.</span><span class="pl-c1">nativeElement</span><span class="pl-kos">.</span><span class="pl-en">getBoundingClientRect</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">left</span><span class="pl-kos">,</span> <span class="pl-c1">top</span>: <span class="pl-s1">event</span><span class="pl-kos">.</span><span class="pl-c1">clientY</span> <span class="pl-c1">-</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">element</span><span class="pl-kos">.</span><span class="pl-c1">nativeElement</span><span class="pl-kos">.</span><span class="pl-en">getBoundingClientRect</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">top</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">.</span><span class="pl-en">flatMap</span><span class="pl-kos">(</span><span class="pl-s1">imageOffset</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">mousemove</span><span class="pl-kos">.</span><span class="pl-c1">_subject</span> <span class="pl-kos">.</span><span class="pl-en">map</span><span class="pl-kos">(</span><span class="pl-s1">pos</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-c">// calculate offsets from mouse down to mouse moves</span> <span class="pl-k">return</span> <span class="pl-kos">{</span> <span class="pl-c1">top</span>: <span class="pl-s1">pos</span><span class="pl-kos">.</span><span class="pl-c1">clientY</span> <span class="pl-c1">-</span> <span class="pl-s1">imageOffset</span><span class="pl-kos">.</span><span class="pl-c1">top</span><span class="pl-kos">,</span> <span class="pl-c1">left</span>: <span class="pl-s1">pos</span><span class="pl-kos">.</span><span class="pl-c1">clientX</span> <span class="pl-c1">-</span> <span class="pl-s1">imageOffset</span><span class="pl-kos">.</span><span class="pl-c1">left</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">.</span><span class="pl-en">takeUntil</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">mouseup</span><span class="pl-kos">.</span><span class="pl-c1">_subject</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-en">onInit</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">mousedrag</span><span class="pl-kos">.</span><span class="pl-en">subscribe</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-en">next</span>: <span class="pl-s1">pos</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-c">// Update position</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">element</span><span class="pl-kos">.</span><span class="pl-c1">nativeElement</span><span class="pl-kos">.</span><span class="pl-c1">style</span><span class="pl-kos">.</span><span class="pl-c1">top</span> <span class="pl-c1">=</span> <span class="pl-s1">pos</span><span class="pl-kos">.</span><span class="pl-c1">top</span> <span class="pl-c1">+</span> <span class="pl-s">'px'</span><span class="pl-kos">;</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">element</span><span class="pl-kos">.</span><span class="pl-c1">nativeElement</span><span class="pl-kos">.</span><span class="pl-c1">style</span><span class="pl-kos">.</span><span class="pl-c1">left</span> <span class="pl-c1">=</span> <span class="pl-s1">pos</span><span class="pl-kos">.</span><span class="pl-c1">left</span> <span class="pl-c1">+</span> <span class="pl-s">'px'</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> @<span class="pl-smi">Component</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">selector</span>: <span class="pl-s">'app'</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> @<span class="pl-smi">View</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c">// needed in order to tell Angular's compiler what's in the template</span> <span class="pl-c1">directives</span>: <span class="pl-kos">[</span> <span class="pl-smi">Draggable</span> <span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-c1">styles</span>: <span class="pl-kos">[</span><span class="pl-s">`</span> <span class="pl-s"> [draggable] {</span> <span class="pl-s"> -webkit-transform: translate3d(0, 0, 0);</span> <span class="pl-s"> -moz-transform: translate3d(0, 0, 0);</span> <span class="pl-s"> -ms-transform: translate3d(0, 0, 0);</span> <span class="pl-s"> transform: translate3d(0, 0, 0);</span> <span class="pl-s"> background-image: url(https://cdn.rawgit.com/Reactive-Extensions/rx.angular.js/master/examples/draganddrop/logo.png);</span> <span class="pl-s"> background-repeat: no-repeat;</span> <span class="pl-s"> background-position: center;</span> <span class="pl-s"> background-size: contain;</span> <span class="pl-s"> height: 200px;</span> <span class="pl-s"> width: 200px;</span> <span class="pl-s"> color: #000000;</span> <span class="pl-s"> border: 1px solid #666666;</span> <span class="pl-s"> padding: 10px;</span> <span class="pl-s"> }</span> <span class="pl-s"> `</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-c1">template</span>: <span class="pl-s">`</span> <span class="pl-s"></span> <span class="pl-s"> &lt;div draggable&gt;</span> <span class="pl-s"> Draggable Div</span> <span class="pl-s"> &lt;/div&gt;</span> <span class="pl-s"></span> <span class="pl-s"> `</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-k">export</span> <span class="pl-k">class</span> <span class="pl-smi">App</span> <span class="pl-kos">{</span> <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <p dir="auto"><code class="notranslate">[sidenote] bonus points if you can understand this madness</code></p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="this.mousedrag = this.mousedown._subject.map(event =&gt; (event.preventDefault(), { left: event.clientX - this.element.nativeElement.getBoundingClientRect().left, top: event.clientY - this.element.nativeElement.getBoundingClientRect().top })).flatMap(imageOffset =&gt; this.mousemove._subject.map(pos =&gt; ({ top: pos.clientY - imageOffset.top, left: pos.clientX - imageOffset.left })).takeUntil(this.mouseup._subject));"><pre class="notranslate"><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">mousedrag</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">mousedown</span><span class="pl-kos">.</span><span class="pl-c1">_subject</span><span class="pl-kos">.</span><span class="pl-en">map</span><span class="pl-kos">(</span><span class="pl-s1">event</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">(</span><span class="pl-s1">event</span><span class="pl-kos">.</span><span class="pl-en">preventDefault</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">left</span>: <span class="pl-s1">event</span><span class="pl-kos">.</span><span class="pl-c1">clientX</span> <span class="pl-c1">-</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">element</span><span class="pl-kos">.</span><span class="pl-c1">nativeElement</span><span class="pl-kos">.</span><span class="pl-en">getBoundingClientRect</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">left</span><span class="pl-kos">,</span> <span class="pl-c1">top</span>: <span class="pl-s1">event</span><span class="pl-kos">.</span><span class="pl-c1">clientY</span> <span class="pl-c1">-</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">element</span><span class="pl-kos">.</span><span class="pl-c1">nativeElement</span><span class="pl-kos">.</span><span class="pl-en">getBoundingClientRect</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">top</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">flatMap</span><span class="pl-kos">(</span><span class="pl-s1">imageOffset</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">mousemove</span><span class="pl-kos">.</span><span class="pl-c1">_subject</span><span class="pl-kos">.</span><span class="pl-en">map</span><span class="pl-kos">(</span><span class="pl-s1">pos</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">top</span>: <span class="pl-s1">pos</span><span class="pl-kos">.</span><span class="pl-c1">clientY</span> <span class="pl-c1">-</span> <span class="pl-s1">imageOffset</span><span class="pl-kos">.</span><span class="pl-c1">top</span><span class="pl-kos">,</span> <span class="pl-c1">left</span>: <span class="pl-s1">pos</span><span class="pl-kos">.</span><span class="pl-c1">clientX</span> <span class="pl-c1">-</span> <span class="pl-s1">imageOffset</span><span class="pl-kos">.</span><span class="pl-c1">left</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">takeUntil</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">mouseup</span><span class="pl-kos">.</span><span class="pl-c1">_subject</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p dir="auto"><a href="https://tipe.io?ref=github-comment" rel="nofollow"><img src="https://user-images.githubusercontent.com/1016365/34912701-7edec34c-f89c-11e7-8c89-bed6cef064b5.png" alt="github-tipe-logo" style="max-width: 100%;"></a></p>
<p dir="auto">Not sure this is a good idea, or even possible, but thought I'd throw it out there.</p> <p dir="auto">In vanilla Rx, if I wanted to listen to a DOM event to do a typeahead or something I'd do something like:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="//get DOM element const input = document.getElementById('myInput'); //observable of click events const inputs$ = Rx.Observable.fromEvent(input, 'keyup'); //map changes to requests const responses$ = inputs$.flatMap(ev =&gt; myHttpService.get(ev.target.value)); //subscribe to responses responses$.subscribe(json =&gt; console.log(json));"><pre class="notranslate"><span class="pl-c">//get DOM element</span> <span class="pl-k">const</span> <span class="pl-s1">input</span> <span class="pl-c1">=</span> <span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-en">getElementById</span><span class="pl-kos">(</span><span class="pl-s">'myInput'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">//observable of click events</span> <span class="pl-k">const</span> <span class="pl-s1">inputs$</span> <span class="pl-c1">=</span> <span class="pl-v">Rx</span><span class="pl-kos">.</span><span class="pl-c1">Observable</span><span class="pl-kos">.</span><span class="pl-en">fromEvent</span><span class="pl-kos">(</span><span class="pl-s1">input</span><span class="pl-kos">,</span> <span class="pl-s">'keyup'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">//map changes to requests</span> <span class="pl-k">const</span> <span class="pl-s1">responses$</span> <span class="pl-c1">=</span> <span class="pl-s1">inputs$</span><span class="pl-kos">.</span><span class="pl-en">flatMap</span><span class="pl-kos">(</span><span class="pl-s1">ev</span> <span class="pl-c1">=&gt;</span> <span class="pl-s1">myHttpService</span><span class="pl-kos">.</span><span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-s1">ev</span><span class="pl-kos">.</span><span class="pl-c1">target</span><span class="pl-kos">.</span><span class="pl-c1">value</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">//subscribe to responses</span> <span class="pl-s1">responses$</span><span class="pl-kos">.</span><span class="pl-en">subscribe</span><span class="pl-kos">(</span><span class="pl-s1">json</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">json</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p dir="auto">In current ng2, if I wanted to do the equivalent, I'd do something like:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@Component({ selector: 'my-component' }) @View({ template: ` &lt;div [ng-form-model]=&quot;myForm&quot;&gt; &lt;input type=&quot;text&quot; ng-control=&quot;query&quot;&gt; &lt;/div&gt; &lt;ul&gt; &lt;li *ng-for=&quot;#result of results | async&quot;&gt;{{result.text}}&lt;/li&gt; &lt;/ul&gt; ` }) class MyComponent { constructor(public http: Http, fb: FormBuilder){ //create form group this.myForm = fb.group({ query: &quot;&quot; }); //subscribe to value changes, map to responses, bind to view w/ pipe this.results = this.myForm.controls.query.valueChanges .toRx() .flatMap(query =&gt; this.http.get(`/foos?q=${query}`) .map(res =&gt; res.json()); } }"><pre class="notranslate">@<span class="pl-v">Component</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">selector</span>: <span class="pl-s">'my-component'</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> @<span class="pl-v">View</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">template</span>: <span class="pl-s">`</span> <span class="pl-s"> &lt;div [ng-form-model]="myForm"&gt;</span> <span class="pl-s"> &lt;input type="text" ng-control="query"&gt;</span> <span class="pl-s"> &lt;/div&gt;</span> <span class="pl-s"> &lt;ul&gt;</span> <span class="pl-s"> &lt;li *ng-for="#result of results | async"&gt;{{result.text}}&lt;/li&gt;</span> <span class="pl-s"> &lt;/ul&gt;</span> <span class="pl-s">`</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-k">class</span> <span class="pl-v">MyComponent</span> <span class="pl-kos">{</span> <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-s1">public</span> <span class="pl-s1">http</span>: <span class="pl-v">Http</span><span class="pl-kos">,</span> <span class="pl-s1">fb</span>: <span class="pl-v">FormBuilder</span><span class="pl-kos">)</span><span class="pl-kos">{</span> <span class="pl-c">//create form group</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">myForm</span> <span class="pl-c1">=</span> <span class="pl-s1">fb</span><span class="pl-kos">.</span><span class="pl-en">group</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">query</span>: <span class="pl-s">""</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">//subscribe to value changes, map to responses, bind to view w/ pipe</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">results</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">myForm</span><span class="pl-kos">.</span><span class="pl-c1">controls</span><span class="pl-kos">.</span><span class="pl-c1">query</span><span class="pl-kos">.</span><span class="pl-c1">valueChanges</span> <span class="pl-kos">.</span><span class="pl-en">toRx</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">.</span><span class="pl-c1">flatMap</span><span class="pl-kos">(</span><span class="pl-s1">query</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">http</span><span class="pl-kos">.</span><span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-s">`/foos?q=<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">query</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span> <span class="pl-kos">.</span><span class="pl-en">map</span><span class="pl-kos">(</span><span class="pl-s1">res</span> <span class="pl-c1">=&gt;</span> <span class="pl-s1">res</span><span class="pl-kos">.</span><span class="pl-en">json</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">This all works great (or will, once Rx stuff settles).</p> <p dir="auto">However, if I wanted to do the same sort of thing from an arbitrary event (unrelated to forms, like a mousedrag or button click or whatever), there's not a good way (I can see) to get an Observable from a DOM event, so you have to do something like:</p> <div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;button (click)=&quot;makeRequest($event)&quot;&gt;Make Request&lt;/button&gt;"><pre class="notranslate"><span class="pl-kos">&lt;</span><span class="pl-ent">button</span> <span class="pl-c1">(click)</span>="<span class="pl-s">makeRequest($event)</span>"<span class="pl-kos">&gt;</span>Make Request<span class="pl-kos">&lt;/</span><span class="pl-ent">button</span><span class="pl-kos">&gt;</span></pre></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="//snip class MyComponent { makeRequest($event){ this.http.get($event.target.url) .map(res =&gt; res.json()) .subscribe(results =&gt; this.results = results); } }"><pre class="notranslate"><span class="pl-c">//snip</span> <span class="pl-k">class</span> <span class="pl-v">MyComponent</span> <span class="pl-kos">{</span> <span class="pl-en">makeRequest</span><span class="pl-kos">(</span><span class="pl-s1">$event</span><span class="pl-kos">)</span><span class="pl-kos">{</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">http</span><span class="pl-kos">.</span><span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-s1">$event</span><span class="pl-kos">.</span><span class="pl-c1">target</span><span class="pl-kos">.</span><span class="pl-c1">url</span><span class="pl-kos">)</span> <span class="pl-kos">.</span><span class="pl-en">map</span><span class="pl-kos">(</span><span class="pl-s1">res</span> <span class="pl-c1">=&gt;</span> <span class="pl-s1">res</span><span class="pl-kos">.</span><span class="pl-en">json</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">.</span><span class="pl-en">subscribe</span><span class="pl-kos">(</span><span class="pl-s1">results</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">results</span> <span class="pl-c1">=</span> <span class="pl-s1">results</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">which isn't nearly as clean.</p> <p dir="auto">Proposed idea would be to provide a way to delegate / bind an arbitrary DOM event to a Subject/Observable, so that it could be easily subscribed to and handled reactively.</p> <p dir="auto"><del>Something like (totally made up syntax here, point being we're binding the click event to the Subject):</del></p> <p dir="auto">Edit: see <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="105490360" data-permission-text="Title is private" data-url="https://github.com/angular/angular/issues/4062" data-hovercard-type="issue" data-hovercard-url="/angular/angular/issues/4062/hovercard?comment_id=231615401&amp;comment_type=issue_comment" href="https://github.com/angular/angular/issues/4062#issuecomment-231615401">#4062 (comment)</a> for current proposal</p> <div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;button [(click)]=&quot;clicks$&quot;&gt;make request&lt;/button&gt;"><pre class="notranslate"><span class="pl-kos">&lt;</span><span class="pl-ent">button</span> <span class="pl-c1">[(click)]</span>="<span class="pl-s">clicks$</span>"<span class="pl-kos">&gt;</span>make request<span class="pl-kos">&lt;/</span><span class="pl-ent">button</span><span class="pl-kos">&gt;</span></pre></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class MyComponent { clicks$ = new Rx.Subject(); constructor(){ this.results = this.clicks$ .flatMap(ev =&gt; http.get('someurl.json')) .map(res =&gt; res.json()) } }"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">MyComponent</span> <span class="pl-kos">{</span> <span class="pl-c1">clicks$</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Rx</span><span class="pl-kos">.</span><span class="pl-c1">Subject</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">{</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">results</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">clicks$</span> <span class="pl-kos">.</span><span class="pl-en">flatMap</span><span class="pl-kos">(</span><span class="pl-s1">ev</span> <span class="pl-c1">=&gt;</span> <span class="pl-s1">http</span><span class="pl-kos">.</span><span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-s">'someurl.json'</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">.</span><span class="pl-en">map</span><span class="pl-kos">(</span><span class="pl-s1">res</span> <span class="pl-c1">=&gt;</span> <span class="pl-s1">res</span><span class="pl-kos">.</span><span class="pl-en">json</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">I saw <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="104931690" data-permission-text="Title is private" data-url="https://github.com/angular/angular/issues/3992" data-hovercard-type="pull_request" data-hovercard-url="/angular/angular/pull/3992/hovercard" href="https://github.com/angular/angular/pull/3992">#3992</a>, but I believe this is for emitting events "out" from the component, whereas this idea is more for usage within a component.</p> <p dir="auto">Thoughts?</p>
1
<p dir="auto">Is there currently a way to run a locally built npm executable script using <code class="notranslate">deno run</code>. I'm thinking of something like this:</p> <div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="deno run --allow-env --allow-read npm:&lt;local-path&gt;"><pre class="notranslate">deno run --allow-env --allow-read npm:<span class="pl-k">&lt;</span>local-path<span class="pl-k">&gt;</span></pre></div> <p dir="auto">The scenario is running node code that we don't to publish to a public repository.</p> <p dir="auto">I discovered the <code class="notranslate">createRequire</code> method, e.g.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { createRequire } from &quot;node:module&quot;; const require = createRequire(import.meta.url); require(&quot;./script.js&quot;);"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">createRequire</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"node:module"</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">require</span> <span class="pl-c1">=</span> <span class="pl-en">createRequire</span><span class="pl-kos">(</span><span class="pl-k">import</span><span class="pl-kos">.</span><span class="pl-c1">meta</span><span class="pl-kos">.</span><span class="pl-c1">url</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">require</span><span class="pl-kos">(</span><span class="pl-s">"./script.js"</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p dir="auto">However, the script has some behavior that isn't handled well including a dynamic <code class="notranslate">import()</code> of an <code class="notranslate">mjs</code> module as well as Mathjax which might also do some non-standard importing? I'm guessing that <code class="notranslate">deno run</code> for <code class="notranslate">npm</code> scripts might setup some additional facilities to make more scenarios work properly than <code class="notranslate">createRequire</code> does?</p> <p dir="auto">Anyway, if there is a way to do this for local npm executable scripts it would be fabulous!</p>
<p dir="auto">Is there any way to use a local (modified) copy of an NPM package instead of a published one in this command? Thanks!</p> <div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="deno run -A --unstable npm:vite"><pre class="notranslate">deno run -A --unstable npm:vite</pre></div>
1
<p dir="auto">Hi!</p> <p dir="auto">Thanks for a great &amp; amazing library - been a very smooth ride so far building <a href="https://github.com/iverberk/nomad-ui">https://github.com/iverberk/nomad-ui</a> with react and material-ui</p> <p dir="auto">I'm done with the first run on the layout, and currently testing it out on mobile.</p> <p dir="auto">I can't seem to find any documentation on Tabs and how they work with scroll / overflow on mobile devices.</p> <p dir="auto">Is it something that is currently supported in <code class="notranslate">@stable</code> - or is there any work-arounds for it - it looks quite smashed together on an iPhone6S with just 6 tabs in use :)</p> <p dir="auto">Thanks again and love what you are doing!</p>
<p dir="auto">The polymer paper-elements library contains a tab bar that is scrollable (see example E. <a href="https://elements.polymer-project.org/elements/paper-tabs?view=demo:demo/index.html" rel="nofollow">https://elements.polymer-project.org/elements/paper-tabs?view=demo:demo/index.html</a>).</p> <p dir="auto">Is it possible to support this scrollable property for the tab bar in material-ui?</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/9976658/8647786/7160a856-295b-11e5-9ac7-c28d891efd2a.png"><img src="https://cloud.githubusercontent.com/assets/9976658/8647786/7160a856-295b-11e5-9ac7-c28d891efd2a.png" alt="schermafbeelding 2015-07-13 om 12 33 23" style="max-width: 100%;"></a></p>
1
<h3 dir="auto">Describe the bug</h3> <p dir="auto">When the input is a Pandas DataFrame with multiple dtypes in the columns and the output is also Pandas, the dtypes aren't preserved but cast to a common type.</p> <p dir="auto">I believe this happens because <code class="notranslate">check_array</code> does this cast:</p> <p dir="auto"></p><div class="Box Box--condensed my-2"> <div class="Box-header f6"> <p class="mb-0 text-bold"> <a href="https://github.com/scikit-learn/scikit-learn/blob/188267212cb5459bfba947c9ece083c0b5f63518/sklearn/utils/validation.py#L788">scikit-learn/sklearn/utils/validation.py</a> </p> <p class="mb-0 color-fg-muted"> Line 788 in <a data-pjax="true" class="commit-tease-sha" href="/scikit-learn/scikit-learn/commit/188267212cb5459bfba947c9ece083c0b5f63518">1882672</a> </p> </div> <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data"> <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip=""> <tbody><tr class="border-0"> <td id="L788" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="788"></td> <td id="LC788" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">dtype_orig</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">result_type</span>(<span class="pl-c1">*</span><span class="pl-s1">dtypes_orig</span>) </td> </tr> </tbody></table> </div> </div> <p></p> <p dir="auto">And transforms it into a NumPy array. But then when transformed back to a Pandas DataFrame, the dtypes aren't recovered:</p> <p dir="auto"></p><div class="Box Box--condensed my-2"> <div class="Box-header f6"> <p class="mb-0 text-bold"> <a href="https://github.com/scikit-learn/scikit-learn/blob/188267212cb5459bfba947c9ece083c0b5f63518/sklearn/utils/_set_output.py#L60">scikit-learn/sklearn/utils/_set_output.py</a> </p> <p class="mb-0 color-fg-muted"> Line 60 in <a data-pjax="true" class="commit-tease-sha" href="/scikit-learn/scikit-learn/commit/188267212cb5459bfba947c9ece083c0b5f63518">1882672</a> </p> </div> <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data"> <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip=""> <tbody><tr class="border-0"> <td id="L60" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="60"></td> <td id="LC60" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>(<span class="pl-s1">data_to_wrap</span>, <span class="pl-s1">index</span><span class="pl-c1">=</span><span class="pl-s1">index</span>, <span class="pl-s1">columns</span><span class="pl-c1">=</span><span class="pl-s1">columns</span>, <span class="pl-s1">copy</span><span class="pl-c1">=</span><span class="pl-c1">False</span>) </td> </tr> </tbody></table> </div> </div> <p></p> <h3 dir="auto">Steps/Code to Reproduce</h3> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import pandas as pd from sklearn.feature_selection import VarianceThreshold df = pd.DataFrame({&quot;a&quot;: [True, False, True], &quot;b&quot;: [1, 2, 3]}) print(df) print(VarianceThreshold().set_output(transform=&quot;pandas&quot;).fit_transform(df)) print((df.dtypes == out.dtypes).all())"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span> <span class="pl-k">from</span> <span class="pl-s1">sklearn</span>.<span class="pl-s1">feature_selection</span> <span class="pl-k">import</span> <span class="pl-v">VarianceThreshold</span> <span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>({<span class="pl-s">"a"</span>: [<span class="pl-c1">True</span>, <span class="pl-c1">False</span>, <span class="pl-c1">True</span>], <span class="pl-s">"b"</span>: [<span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">3</span>]}) <span class="pl-en">print</span>(<span class="pl-s1">df</span>) <span class="pl-en">print</span>(<span class="pl-v">VarianceThreshold</span>().<span class="pl-en">set_output</span>(<span class="pl-s1">transform</span><span class="pl-c1">=</span><span class="pl-s">"pandas"</span>).<span class="pl-en">fit_transform</span>(<span class="pl-s1">df</span>)) <span class="pl-en">print</span>((<span class="pl-s1">df</span>.<span class="pl-s1">dtypes</span> <span class="pl-c1">==</span> <span class="pl-s1">out</span>.<span class="pl-s1">dtypes</span>).<span class="pl-en">all</span>())</pre></div> <h3 dir="auto">Expected Results</h3> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" a b 0 True 1 1 False 2 2 True 3 a b 0 True 1 1 False 2 2 True 3 True"><pre class="notranslate"><code class="notranslate"> a b 0 True 1 1 False 2 2 True 3 a b 0 True 1 1 False 2 2 True 3 True </code></pre></div> <h3 dir="auto">Actual Results</h3> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" a b 0 True 1 1 False 2 2 True 3 a b 0 1 1 1 0 2 2 1 3 False"><pre class="notranslate"><code class="notranslate"> a b 0 True 1 1 False 2 2 True 3 a b 0 1 1 1 0 2 2 1 3 False </code></pre></div> <h3 dir="auto">Versions</h3> <div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="System: python: 3.10.6 (main, Mar 10 2023, 10:55:28) [GCC 11.3.0] executable: .../bin/python machine: Linux-5.15.0-71-generic-x86_64-with-glibc2.35 Python dependencies: sklearn: 1.2.2 pip: 23.1.2 setuptools: 65.5.1 numpy: 1.24.3 scipy: 1.10.1 Cython: None pandas: 2.0.1 matplotlib: 3.7.1 joblib: 1.2.0 threadpoolctl: 3.1.0 Built with OpenMP: True threadpoolctl info: user_api: blas internal_api: openblas prefix: libopenblas filepath: .../lib/python3.10/site-packages/numpy.libs/libopenblas64_p-r0-15028c96.3.21.so version: 0.3.21 threading_layer: pthreads architecture: Haswell num_threads: 12 user_api: openmp internal_api: openmp prefix: libgomp filepath: .../lib/python3.10/site-packages/scikit_learn.libs/libgomp-a34b3233.so.1.0.0 version: None num_threads: 12 user_api: blas internal_api: openblas prefix: libopenblas filepath: .../lib/python3.10/site-packages/scipy.libs/libopenblasp-r0-41284840.3.18.so version: 0.3.18 threading_layer: pthreads architecture: Haswell num_threads: 12"><pre class="notranslate">System: python: 3.10.6 (main, Mar 10 2023, 10:55:28) [GCC 11.3.0] executable: .../bin/python machine: Linux-5.15.0-71-generic-x86_64-with-glibc2.35 Python dependencies: sklearn: 1.2.2 pip: 23.1.2 setuptools: 65.5.1 numpy: 1.24.3 scipy: 1.10.1 Cython: None pandas: 2.0.1 matplotlib: 3.7.1 joblib: 1.2.0 threadpoolctl: 3.1.0 Built with OpenMP: True threadpoolctl info: user_api: blas internal_api: openblas prefix: libopenblas filepath: .../lib/python3.10/site-packages/numpy.libs/libopenblas64_p-r0-15028c96.3.21.so version: 0.3.21 threading_layer: pthreads architecture: Haswell num_threads: 12 user_api: openmp internal_api: openmp prefix: libgomp filepath: .../lib/python3.10/site-packages/scikit_learn.libs/libgomp-a34b3233.so.1.0.0 version: None num_threads: 12 user_api: blas internal_api: openblas prefix: libopenblas filepath: .../lib/python3.10/site-packages/scipy.libs/libopenblasp-r0-41284840.3.18.so version: 0.3.18 threading_layer: pthreads architecture: Haswell num_threads: 12</pre></div>
<p dir="auto"><code class="notranslate">Scorer</code> objects currently provide an interface that returns a scalar score given an estimator and test data. This is necessary for <code class="notranslate">*SearchCV</code> to calculate a mean score across folds, and determine the best score among parameters.</p> <p dir="auto">This is very hampering in terms of the diagnostic information available from a cross-fold validation or parameter exploration, which one can see by comparing to the catalogue of <code class="notranslate">metrics</code> that includes: precision and recall with F-score; scores for each of multiple classes as well as an aggregate; and error distributions (i.e. PR-curve or confusion matrix). <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/solomonm/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/solomonm">@solomonm</a> (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="12773836" data-permission-text="Title is private" data-url="https://github.com/scikit-learn/scikit-learn/issues/1837" data-hovercard-type="issue" data-hovercard-url="/scikit-learn/scikit-learn/issues/1837/hovercard" href="https://github.com/scikit-learn/scikit-learn/issues/1837">#1837</a>) and I (ML, an implementation within <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="11954190" data-permission-text="Title is private" data-url="https://github.com/scikit-learn/scikit-learn/issues/1768" data-hovercard-type="pull_request" data-hovercard-url="/scikit-learn/scikit-learn/pull/1768/hovercard" href="https://github.com/scikit-learn/scikit-learn/pull/1768">#1768</a>) have independently sought Precision and Recall to be returned from cross-validation routines when F1 is used as the cross-validation objective; <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/eickenberg/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/eickenberg">@eickenberg</a> on <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="8452341" data-permission-text="Title is private" data-url="https://github.com/scikit-learn/scikit-learn/issues/1381" data-hovercard-type="pull_request" data-hovercard-url="/scikit-learn/scikit-learn/pull/1381/hovercard" href="https://github.com/scikit-learn/scikit-learn/pull/1381#commitcomment-2607318">#1381 (comment)</a> posed a concern regarding array of scores corresponding to multiple targets.</p> <p dir="auto">I thought it deserved an Issue of its own to solidify the argument and its solution.</p> <p dir="auto">Some design options:</p> <ol dir="auto"> <li>Allow multiple scorers to be provided to <code class="notranslate">cross_val_score</code> or <code class="notranslate">*SearchCV</code> (henceforth <code class="notranslate">CVEvaluator</code>), with one specified as the objective. But since the <code class="notranslate">Scorer</code> generally calls <code class="notranslate">estimator.{predict,decision_function,predict_proba}</code>, each scorer would repeat this work.</li> <li>Separate the objective and non-objective metrics as parameters to <code class="notranslate">CVEvaluator</code>: the <code class="notranslate">scoring</code> parameter remains as it is and a <code class="notranslate">diagnostics</code> parameter provides a callable with similar (same?) arguments as <code class="notranslate">Scorer</code>, but returning a dict. This means that the prediction work is repeated but not necessarily as many times as there are metrics. This diagnostics callable is more flexible and perhaps could be passed the training data as well as the test data.</li> <li>Continue to use the <code class="notranslate">scoring</code> parameter, but allow the <code class="notranslate">Scorer</code> to return a dict with a special key for the objective score. This would need to be handled by the caller. For backwards compatibility, no existing scorers would change their behaviour of returning a float. This ensures no repeated prediction work.</li> <li>Add an additional method to the <code class="notranslate">Scorer</code> interface that generates a set of named outputs (as with <code class="notranslate">calc_names</code> proposed in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="12773836" data-permission-text="Title is private" data-url="https://github.com/scikit-learn/scikit-learn/issues/1837" data-hovercard-type="issue" data-hovercard-url="/scikit-learn/scikit-learn/issues/1837/hovercard" href="https://github.com/scikit-learn/scikit-learn/issues/1837">#1837</a>), again with a special key for the objective score. This allows users to continue using <code class="notranslate">scoring='f1'</code> but get back precision and recall for free.</li> </ol> <p dir="auto">Note that 3. and 4. potentially allow for any set of metrics to be composed into a scorer without redundant prediction work (and 1. allows composition with highly redundant prediction work).</p> <p dir="auto">Comments, critiques and suggestions are very welcome.</p>
0
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function fn() {} `blah${fn()}blah` // actual: `blah${fn() }blah` // expected: `blah${fn()}blah`"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">fn</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span><span class="pl-kos">}</span> <span class="pl-s">`blah<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-en">fn</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">}</span></span>blah`</span> <span class="pl-c">// actual:</span> <span class="pl-s">`blah<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-en">fn</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">}</span></span>blah`</span> <span class="pl-c">// expected:</span> <span class="pl-s">`blah<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-en">fn</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">}</span></span>blah`</span></pre></div>
<p dir="auto">This is what I get after Ctrl+K+D in VS:</p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="throw Error(`${JSON.stringify(this.value) } cannot be found in ${JSON.stringify(y) }`);"><pre class="notranslate"><span class="pl-k">throw</span> <span class="pl-smi">Error</span><span class="pl-kos">(</span><span class="pl-s">`<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-smi">JSON</span><span class="pl-kos">.</span><span class="pl-en">stringify</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">value</span><span class="pl-kos">)</span> <span class="pl-kos">}</span></span> cannot be found in <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-smi">JSON</span><span class="pl-kos">.</span><span class="pl-en">stringify</span><span class="pl-kos">(</span><span class="pl-s1">y</span><span class="pl-kos">)</span> <span class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p dir="auto">As you see, a space was inserted after <code class="notranslate">JSON.stringify(...)</code>. The bug doesn't appear if a plain variable is used: <code class="notranslate">${x}</code>.</p>
1