问:
G++ aborts compilation with no error message when file contains large array initializer
I'm using Code::Blocks (v20.03) with MinGW64 g++ compiler (Windows 11), g++ --version shows (first line):

g++.exe (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders) 12.2.0

When trying to compile file that contains large two-dimensional array initializer - like this:

```<code>#define ROW { { 0.0,  0.0 }, {  1.0,  1.0 }, {  2.0,  2.0 }, {  3.0,  3.0 }, {  4.0,  4.0 }, \
    {  5.0,  5.0 }, {  6.0,  6.0 }, {  7.0,  7.0 }, {  8.0,  8.0 }, {  9.0,  9.0 } }
#define ROW8 ROW, ROW, ROW, ROW, ROW, ROW, ROW, ROW
#define ROW64 ROW8, ROW8, ROW8, ROW8, ROW8, ROW8, ROW8, ROW8
#define ROW512 ROW64, ROW64, ROW64, ROW64, ROW64, ROW64, ROW64, ROW64
#define ROW4096 ROW512, ROW512, ROW512, ROW512, ROW512, ROW512, ROW512, ROW512

template <typename T>
class cplx_t {
public:
  T m_re;
  T m_im;

    cplx_t() : m_re(), m_im() {
    }

    cplx_t(const T& re, const T& im) : m_re(re), m_im(im) {
    }

};

cplx_t<double> test_arr[2048][10] = {
    ROW512, ROW512, ROW512, ROW512
};

int main() {
}
</code>```

using command:

g++ ./test_large_init.cpp --verbose

no output file is generated - console dump:

```<code>Using built-in specs.
COLLECT_GCC=C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin\g++.exe
COLLECT_LTO_WRAPPER=c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/12.2.0/lto-wrapper.exe
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-w64-mingw32
Configured with: ../configure --prefix=/r/winlibs64-11.3.0ucrt/2604.gcc/inst_gcc-12.2.0/share/gcc --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-offload-targets=nvptx-none --with-pkgversion='MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders' --with-tune=generic --enable-checking=release --enable-threads=posix --disable-sjlj-exceptions --disable-libunwind-exceptions --disable-serial-configure --disable-bootstrap --enable-host-shared --enable-plugin --disable-default-ssp --disable-rpath --disable-libstdcxx-debug --disable-version-specific-runtime-libs --with-stabs --disable-symvers --enable-languages=c,c++,fortran,lto,objc,obj-c++,jit --disable-gold --disable-nls --disable-stage1-checking --disable-win32-registry --disable-multilib --enable-ld --enable-libquadmath --enable-libada --enable-libssp --enable-libstdcxx --enable-lto --enable-fully-dynamic-string --enable-libgomp --enable-graphite --enable-mingw-wildcard --enable-libstdcxx-time --disable-libstdcxx-pch --with-mpc=/e/Prog/winlibs64-11.3.0ucrt/custombuilt --with-mpfr=/e/Prog/winlibs64-11.3.0ucrt/custombuilt --with-gmp=/e/Prog/winlibs64-11.3.0ucrt/custombuilt --with-isl=/e/Prog/winlibs64-11.3.0ucrt/custombuilt --enable-libstdcxx-backtrace --enable-install-libiberty --enable-__cxa_atexit --without-included-gettext --with-diagnostics-color=auto --enable-clocale=generic --with-libiconv --with-system-zlib --with-build-sysroot=/r/winlibs64-11.3.0ucrt/2604.gcc/gcc-12.2.0/build_mingw/mingw-w64 CFLAGS='-I/e/Prog/winlibs64-11.3.0ucrt/custombuilt/include/libdl-win32 -D__USE_MINGW_ACCESS' CXXFLAGS=-D__USE_MINGW_ACCESS LDFLAGS='-Wl,--disable-nxcompat -Wl,--disable-high-entropy-va -Wl,--disable-dynamicbase'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders)
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'a-'
 c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/12.2.0/cc1plus.exe -quiet -v -iprefix c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/ -D_REENTRANT ./test_large_init.cpp -quiet -dumpdir a- -dumpbase test_large_init.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -version -o C:\Users\user\AppData\Local\Temp\ccv3X4Fb.s
GNU C++17 (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders) version 12.2.0 (x86_64-w64-mingw32)
        compiled by GNU C version 12.2.0, GMP version 6.2.1, MPFR version 4.1.0, MPC version 1.2.1, isl version UNKNOWN-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../include/c++/12.2.0"
ignoring duplicate directory "c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../include/c++/12.2.0/x86_64-w64-mingw32"
ignoring duplicate directory "c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../include/c++/12.2.0/backward"
ignoring duplicate directory "c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/12.2.0/include"
ignoring nonexistent directory "R:/winlibs64-11.3.0ucrt/2604.gcc/inst_gcc-12.2.0/share/gcc/include"
ignoring nonexistent directory "/r/winlibs64-11.3.0ucrt/2604.gcc/inst_gcc-12.2.0/share/gcc/include"
ignoring duplicate directory "c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/12.2.0/include-fixed"
ignoring duplicate directory "c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/include"
ignoring nonexistent directory "/mingw/include"
#include "..." search starts here:
#include <...> search starts here:
 c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../include/c++/12.2.0
 c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../include/c++/12.2.0/x86_64-w64-mingw32
 c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../include/c++/12.2.0/backward
 c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/include
 c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../include
 c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/include-fixed
 c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/include
End of search list.
GNU C++17 (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders) version 12.2.0 (x86_64-w64-mingw32)
        compiled by GNU C version 12.2.0, GMP version 6.2.1, MPFR version 4.1.0, MPC version 1.2.1, isl version UNKNOWN-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 16512d3bcd6e7fc30e988209e0d6f609
</code>```

But when i remove initialization:

```<code>
#define ROW { { 0.0,  0.0 }, {  1.0,  1.0 }, {  2.0,  2.0 }, {  3.0,  3.0 }, {  4.0,  4.0 }, \
    {  5.0,  5.0 }, {  6.0,  6.0 }, {  7.0,  7.0 }, {  8.0,  8.0 }, {  9.0,  9.0 } }
#define ROW8 ROW, ROW, ROW, ROW, ROW, ROW, ROW, ROW
#define ROW64 ROW8, ROW8, ROW8, ROW8, ROW8, ROW8, ROW8, ROW8
#define ROW512 ROW64, ROW64, ROW64, ROW64, ROW64, ROW64, ROW64, ROW64
#define ROW4096 ROW512, ROW512, ROW512, ROW512, ROW512, ROW512, ROW512, ROW512

template <typename T>
class cplx_t {
public:
  T m_re;
  T m_im;

    cplx_t() : m_re(), m_im() {
    }

    cplx_t(const T& re, const T& im) : m_re(re), m_im(im) {
    }

};

cplx_t<double> test_arr[2048][10];

int main() {
}
</code>```

GCC generates output file properly - console dump:

```<code>Using built-in specs.
COLLECT_GCC=C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin\g++.exe
COLLECT_LTO_WRAPPER=c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/12.2.0/lto-wrapper.exe
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-w64-mingw32
Configured with: ../configure --prefix=/r/winlibs64-11.3.0ucrt/2604.gcc/inst_gcc-12.2.0/share/gcc --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-offload-targets=nvptx-none --with-pkgversion='MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders' --with-tune=generic --enable-checking=release --enable-threads=posix --disable-sjlj-exceptions --disable-libunwind-exceptions --disable-serial-configure --disable-bootstrap --enable-host-shared --enable-plugin --disable-default-ssp --disable-rpath --disable-libstdcxx-debug --disable-version-specific-runtime-libs --with-stabs --disable-symvers --enable-languages=c,c++,fortran,lto,objc,obj-c++,jit --disable-gold --disable-nls --disable-stage1-checking --disable-win32-registry --disable-multilib --enable-ld --enable-libquadmath --enable-libada --enable-libssp --enable-libstdcxx --enable-lto --enable-fully-dynamic-string --enable-libgomp --enable-graphite --enable-mingw-wildcard --enable-libstdcxx-time --disable-libstdcxx-pch --with-mpc=/e/Prog/winlibs64-11.3.0ucrt/custombuilt --with-mpfr=/e/Prog/winlibs64-11.3.0ucrt/custombuilt --with-gmp=/e/Prog/winlibs64-11.3.0ucrt/custombuilt --with-isl=/e/Prog/winlibs64-11.3.0ucrt/custombuilt --enable-libstdcxx-backtrace --enable-install-libiberty --enable-__cxa_atexit --without-included-gettext --with-diagnostics-color=auto --enable-clocale=generic --with-libiconv --with-system-zlib --with-build-sysroot=/r/winlibs64-11.3.0ucrt/2604.gcc/gcc-12.2.0/build_mingw/mingw-w64 CFLAGS='-I/e/Prog/winlibs64-11.3.0ucrt/custombuilt/include/libdl-win32 -D__USE_MINGW_ACCESS' CXXFLAGS=-D__USE_MINGW_ACCESS LDFLAGS='-Wl,--disable-nxcompat -Wl,--disable-high-entropy-va -Wl,--disable-dynamicbase'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders)
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'a-'
 c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/12.2.0/cc1plus.exe -quiet -v -iprefix c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/ -D_REENTRANT ./test_large_init.cpp -quiet -dumpdir a- -dumpbase test_large_init.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -version -o C:\Users\user\AppData\Local\Temp\cczLmXyT.s
GNU C++17 (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders) version 12.2.0 (x86_64-w64-mingw32)
        compiled by GNU C version 12.2.0, GMP version 6.2.1, MPFR version 4.1.0, MPC version 1.2.1, isl version UNKNOWN-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../include/c++/12.2.0"
ignoring duplicate directory "c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../include/c++/12.2.0/x86_64-w64-mingw32"
ignoring duplicate directory "c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../include/c++/12.2.0/backward"
ignoring duplicate directory "c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/12.2.0/include"
ignoring nonexistent directory "R:/winlibs64-11.3.0ucrt/2604.gcc/inst_gcc-12.2.0/share/gcc/include"
ignoring nonexistent directory "/r/winlibs64-11.3.0ucrt/2604.gcc/inst_gcc-12.2.0/share/gcc/include"
ignoring duplicate directory "c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/12.2.0/include-fixed"
ignoring duplicate directory "c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/include"
ignoring nonexistent directory "/mingw/include"
#include "..." search starts here:
#include <...> search starts here:
 c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../include/c++/12.2.0
 c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../include/c++/12.2.0/x86_64-w64-mingw32
 c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../include/c++/12.2.0/backward
 c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/include
 c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../include
 c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/include-fixed
 c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/include
End of search list.
GNU C++17 (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders) version 12.2.0 (x86_64-w64-mingw32)
        compiled by GNU C version 12.2.0, GMP version 6.2.1, MPFR version 4.1.0, MPC version 1.2.1, isl version UNKNOWN-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 16512d3bcd6e7fc30e988209e0d6f609
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'a-'
 c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/as.exe -v -o C:\Users\user\AppData\Local\Temp\ccbZLACV.o C:\Users\user\AppData\Local\Temp\cczLmXyT.s
GNU assembler version 2.39 (x86_64-w64-mingw32) using BFD version (Binutils for MinGW-W64 x86_64, built by Brecht Sanders) 2.39
COMPILER_PATH=c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/12.2.0/;c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../libexec/gcc/;c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/
LIBRARY_PATH=c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/;c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/;c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/lib/../lib/;c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../lib/;c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/lib/;c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'a.'
 c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/12.2.0/collect2.exe -plugin c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/12.2.0/liblto_plugin.dll -plugin-opt=c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/12.2.0/lto-wrapper.exe -plugin-opt=-fresolution=C:\Users\user\AppData\Local\Temp\ccNqe6C1.res -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32 -plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lkernel32 -m i386pep -Bdynamic c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/crtbegin.o -Lc:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0 -Lc:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc -Lc:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/lib/../lib -Lc:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../lib -Lc:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/lib -Lc:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../.. C:\Users\user\AppData\Local\Temp\ccbZLACV.o -lstdc++ -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/crtend.o
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'a.'
</code>```

Moreover - if i replace cplx_t template with std::complex code can be compiled even with initializer:

```<code>

#include <complex>

#define ROW { { 0.0,  0.0 }, {  1.0,  1.0 }, {  2.0,  2.0 }, {  3.0,  3.0 }, {  4.0,  4.0 }, \
    {  5.0,  5.0 }, {  6.0,  6.0 }, {  7.0,  7.0 }, {  8.0,  8.0 }, {  9.0,  9.0 } }
#define ROW8 ROW, ROW, ROW, ROW, ROW, ROW, ROW, ROW
#define ROW64 ROW8, ROW8, ROW8, ROW8, ROW8, ROW8, ROW8, ROW8
#define ROW512 ROW64, ROW64, ROW64, ROW64, ROW64, ROW64, ROW64, ROW64
#define ROW4096 ROW512, ROW512, ROW512, ROW512, ROW512, ROW512, ROW512, ROW512

std::complex<double> test_arr[2048][10] = {
    ROW512, ROW512, ROW512, ROW512
};

int main() {
}
</code>```

The question is - what causes g++ to abort compilation without even printing ANY error message?

Best regards (and thanks for the patience).

PS Inspired by @463035818_is_not_a_number i've tried to run cplx_t version using https://godbolt.org/ - results:

GCC 10.4 - compiles well.

GCC 12.2 - compilation failed, output:

```<code>g++: internal compiler error: Segmentation fault signal terminated program cc1plus
Please submit a full bug report, with preprocessed source (by using -freport-bug).
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 4
</code>```

x86-64 clang 15.0.0 - compilation successful.

x86-64 clang 3.0.0 - compilation fails with output:

```<code><source>:22:16: error: variable has incomplete type 'cplx_t<double> [2048][10]'
cplx_t<double> test_arr[2048][10] = {
               ^
1 error generated.
Compiler returned: 1
</code>```

Body:
I'm using Code::Blocks (v20.03) with MinGW64 g++ compiler (Windows 11), g++ --version shows (first line):

g++.exe (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders) 12.2.0

When trying to compile file that contains large two-dimensional array initializer - like this:

#define ROW { { 0.0,  0.0 }, {  1.0,  1.0 }, {  2.0,  2.0 }, {  3.0,  3.0 }, {  4.0,  4.0 }, \
    {  5.0,  5.0 }, {  6.0,  6.0 }, {  7.0,  7.0 }, {  8.0,  8.0 }, {  9.0,  9.0 } }
#define ROW8 ROW, ROW, ROW, ROW, ROW, ROW, ROW, ROW
#define ROW64 ROW8, ROW8, ROW8, ROW8, ROW8, ROW8, ROW8, ROW8
#define ROW512 ROW64, ROW64, ROW64, ROW64, ROW64, ROW64, ROW64, ROW64
#define ROW4096 ROW512, ROW512, ROW512, ROW512, ROW512, ROW512, ROW512, ROW512

template <typename T>
class cplx_t {
public:
  T m_re;
  T m_im;

    cplx_t() : m_re(), m_im() {
    }

    cplx_t(const T& re, const T& im) : m_re(re), m_im(im) {
    }

};

cplx_t<double> test_arr[2048][10] = {
    ROW512, ROW512, ROW512, ROW512
};

int main() {
}

using command:

g++ ./test_large_init.cpp --verbose

no output file is generated - console dump:

Using built-in specs.
COLLECT_GCC=C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin\g++.exe
COLLECT_LTO_WRAPPER=c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/12.2.0/lto-wrapper.exe
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-w64-mingw32
Configured with: ../configure --prefix=/r/winlibs64-11.3.0ucrt/2604.gcc/inst_gcc-12.2.0/share/gcc --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-offload-targets=nvptx-none --with-pkgversion='MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders' --with-tune=generic --enable-checking=release --enable-threads=posix --disable-sjlj-exceptions --disable-libunwind-exceptions --disable-serial-configure --disable-bootstrap --enable-host-shared --enable-plugin --disable-default-ssp --disable-rpath --disable-libstdcxx-debug --disable-version-specific-runtime-libs --with-stabs --disable-symvers --enable-languages=c,c++,fortran,lto,objc,obj-c++,jit --disable-gold --disable-nls --disable-stage1-checking --disable-win32-registry --disable-multilib --enable-ld --enable-libquadmath --enable-libada --enable-libssp --enable-libstdcxx --enable-lto --enable-fully-dynamic-string --enable-libgomp --enable-graphite --enable-mingw-wildcard --enable-libstdcxx-time --disable-libstdcxx-pch --with-mpc=/e/Prog/winlibs64-11.3.0ucrt/custombuilt --with-mpfr=/e/Prog/winlibs64-11.3.0ucrt/custombuilt --with-gmp=/e/Prog/winlibs64-11.3.0ucrt/custombuilt --with-isl=/e/Prog/winlibs64-11.3.0ucrt/custombuilt --enable-libstdcxx-backtrace --enable-install-libiberty --enable-__cxa_atexit --without-included-gettext --with-diagnostics-color=auto --enable-clocale=generic --with-libiconv --with-system-zlib --with-build-sysroot=/r/winlibs64-11.3.0ucrt/2604.gcc/gcc-12.2.0/build_mingw/mingw-w64 CFLAGS='-I/e/Prog/winlibs64-11.3.0ucrt/custombuilt/include/libdl-win32 -D__USE_MINGW_ACCESS' CXXFLAGS=-D__USE_MINGW_ACCESS LDFLAGS='-Wl,--disable-nxcompat -Wl,--disable-high-entropy-va -Wl,--disable-dynamicbase'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders)
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'a-'
 c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/12.2.0/cc1plus.exe -quiet -v -iprefix c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/ -D_REENTRANT ./test_large_init.cpp -quiet -dumpdir a- -dumpbase test_large_init.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -version -o C:\Users\user\AppData\Local\Temp\ccv3X4Fb.s
GNU C++17 (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders) version 12.2.0 (x86_64-w64-mingw32)
        compiled by GNU C version 12.2.0, GMP version 6.2.1, MPFR version 4.1.0, MPC version 1.2.1, isl version UNKNOWN-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../include/c++/12.2.0"
ignoring duplicate directory "c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../include/c++/12.2.0/x86_64-w64-mingw32"
ignoring duplicate directory "c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../include/c++/12.2.0/backward"
ignoring duplicate directory "c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/12.2.0/include"
ignoring nonexistent directory "R:/winlibs64-11.3.0ucrt/2604.gcc/inst_gcc-12.2.0/share/gcc/include"
ignoring nonexistent directory "/r/winlibs64-11.3.0ucrt/2604.gcc/inst_gcc-12.2.0/share/gcc/include"
ignoring duplicate directory "c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/12.2.0/include-fixed"
ignoring duplicate directory "c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/include"
ignoring nonexistent directory "/mingw/include"
#include "..." search starts here:
#include <...> search starts here:
 c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../include/c++/12.2.0
 c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../include/c++/12.2.0/x86_64-w64-mingw32
 c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../include/c++/12.2.0/backward
 c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/include
 c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../include
 c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/include-fixed
 c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/include
End of search list.
GNU C++17 (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders) version 12.2.0 (x86_64-w64-mingw32)
        compiled by GNU C version 12.2.0, GMP version 6.2.1, MPFR version 4.1.0, MPC version 1.2.1, isl version UNKNOWN-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 16512d3bcd6e7fc30e988209e0d6f609

But when i remove initialization:

#define ROW { { 0.0,  0.0 }, {  1.0,  1.0 }, {  2.0,  2.0 }, {  3.0,  3.0 }, {  4.0,  4.0 }, \
    {  5.0,  5.0 }, {  6.0,  6.0 }, {  7.0,  7.0 }, {  8.0,  8.0 }, {  9.0,  9.0 } }
#define ROW8 ROW, ROW, ROW, ROW, ROW, ROW, ROW, ROW
#define ROW64 ROW8, ROW8, ROW8, ROW8, ROW8, ROW8, ROW8, ROW8
#define ROW512 ROW64, ROW64, ROW64, ROW64, ROW64, ROW64, ROW64, ROW64
#define ROW4096 ROW512, ROW512, ROW512, ROW512, ROW512, ROW512, ROW512, ROW512

template <typename T>
class cplx_t {
public:
  T m_re;
  T m_im;

    cplx_t() : m_re(), m_im() {
    }

    cplx_t(const T& re, const T& im) : m_re(re), m_im(im) {
    }

};

cplx_t<double> test_arr[2048][10];

int main() {
}

GCC generates output file properly - console dump:

Using built-in specs.
COLLECT_GCC=C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin\g++.exe
COLLECT_LTO_WRAPPER=c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/12.2.0/lto-wrapper.exe
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-w64-mingw32
Configured with: ../configure --prefix=/r/winlibs64-11.3.0ucrt/2604.gcc/inst_gcc-12.2.0/share/gcc --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-offload-targets=nvptx-none --with-pkgversion='MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders' --with-tune=generic --enable-checking=release --enable-threads=posix --disable-sjlj-exceptions --disable-libunwind-exceptions --disable-serial-configure --disable-bootstrap --enable-host-shared --enable-plugin --disable-default-ssp --disable-rpath --disable-libstdcxx-debug --disable-version-specific-runtime-libs --with-stabs --disable-symvers --enable-languages=c,c++,fortran,lto,objc,obj-c++,jit --disable-gold --disable-nls --disable-stage1-checking --disable-win32-registry --disable-multilib --enable-ld --enable-libquadmath --enable-libada --enable-libssp --enable-libstdcxx --enable-lto --enable-fully-dynamic-string --enable-libgomp --enable-graphite --enable-mingw-wildcard --enable-libstdcxx-time --disable-libstdcxx-pch --with-mpc=/e/Prog/winlibs64-11.3.0ucrt/custombuilt --with-mpfr=/e/Prog/winlibs64-11.3.0ucrt/custombuilt --with-gmp=/e/Prog/winlibs64-11.3.0ucrt/custombuilt --with-isl=/e/Prog/winlibs64-11.3.0ucrt/custombuilt --enable-libstdcxx-backtrace --enable-install-libiberty --enable-__cxa_atexit --without-included-gettext --with-diagnostics-color=auto --enable-clocale=generic --with-libiconv --with-system-zlib --with-build-sysroot=/r/winlibs64-11.3.0ucrt/2604.gcc/gcc-12.2.0/build_mingw/mingw-w64 CFLAGS='-I/e/Prog/winlibs64-11.3.0ucrt/custombuilt/include/libdl-win32 -D__USE_MINGW_ACCESS' CXXFLAGS=-D__USE_MINGW_ACCESS LDFLAGS='-Wl,--disable-nxcompat -Wl,--disable-high-entropy-va -Wl,--disable-dynamicbase'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders)
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'a-'
 c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/12.2.0/cc1plus.exe -quiet -v -iprefix c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/ -D_REENTRANT ./test_large_init.cpp -quiet -dumpdir a- -dumpbase test_large_init.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -version -o C:\Users\user\AppData\Local\Temp\cczLmXyT.s
GNU C++17 (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders) version 12.2.0 (x86_64-w64-mingw32)
        compiled by GNU C version 12.2.0, GMP version 6.2.1, MPFR version 4.1.0, MPC version 1.2.1, isl version UNKNOWN-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../include/c++/12.2.0"
ignoring duplicate directory "c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../include/c++/12.2.0/x86_64-w64-mingw32"
ignoring duplicate directory "c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../include/c++/12.2.0/backward"
ignoring duplicate directory "c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/12.2.0/include"
ignoring nonexistent directory "R:/winlibs64-11.3.0ucrt/2604.gcc/inst_gcc-12.2.0/share/gcc/include"
ignoring nonexistent directory "/r/winlibs64-11.3.0ucrt/2604.gcc/inst_gcc-12.2.0/share/gcc/include"
ignoring duplicate directory "c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/12.2.0/include-fixed"
ignoring duplicate directory "c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/include"
ignoring nonexistent directory "/mingw/include"
#include "..." search starts here:
#include <...> search starts here:
 c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../include/c++/12.2.0
 c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../include/c++/12.2.0/x86_64-w64-mingw32
 c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../include/c++/12.2.0/backward
 c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/include
 c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../include
 c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/include-fixed
 c:\programdata\chocolatey\lib\mingw\tools\install\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/include
End of search list.
GNU C++17 (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders) version 12.2.0 (x86_64-w64-mingw32)
        compiled by GNU C version 12.2.0, GMP version 6.2.1, MPFR version 4.1.0, MPC version 1.2.1, isl version UNKNOWN-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 16512d3bcd6e7fc30e988209e0d6f609
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'a-'
 c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/as.exe -v -o C:\Users\user\AppData\Local\Temp\ccbZLACV.o C:\Users\user\AppData\Local\Temp\cczLmXyT.s
GNU assembler version 2.39 (x86_64-w64-mingw32) using BFD version (Binutils for MinGW-W64 x86_64, built by Brecht Sanders) 2.39
COMPILER_PATH=c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/12.2.0/;c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../libexec/gcc/;c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/
LIBRARY_PATH=c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/;c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/;c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/lib/../lib/;c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../lib/;c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/lib/;c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'a.'
 c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/12.2.0/collect2.exe -plugin c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/12.2.0/liblto_plugin.dll -plugin-opt=c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/12.2.0/lto-wrapper.exe -plugin-opt=-fresolution=C:\Users\user\AppData\Local\Temp\ccNqe6C1.res -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32 -plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lkernel32 -m i386pep -Bdynamic c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/crtbegin.o -Lc:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0 -Lc:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc -Lc:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/lib/../lib -Lc:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../lib -Lc:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/lib -Lc:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../.. C:\Users\user\AppData\Local\Temp\ccbZLACV.o -lstdc++ -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/crtend.o
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'a.'

Moreover - if i replace cplx_t template with std::complex code can be compiled even with initializer:

#include <complex>

#define ROW { { 0.0,  0.0 }, {  1.0,  1.0 }, {  2.0,  2.0 }, {  3.0,  3.0 }, {  4.0,  4.0 }, \
    {  5.0,  5.0 }, {  6.0,  6.0 }, {  7.0,  7.0 }, {  8.0,  8.0 }, {  9.0,  9.0 } }
#define ROW8 ROW, ROW, ROW, ROW, ROW, ROW, ROW, ROW
#define ROW64 ROW8, ROW8, ROW8, ROW8, ROW8, ROW8, ROW8, ROW8
#define ROW512 ROW64, ROW64, ROW64, ROW64, ROW64, ROW64, ROW64, ROW64
#define ROW4096 ROW512, ROW512, ROW512, ROW512, ROW512, ROW512, ROW512, ROW512

std::complex<double> test_arr[2048][10] = {
    ROW512, ROW512, ROW512, ROW512
};

int main() {
}

The question is - what causes g++ to abort compilation without even printing ANY error message?

Best regards (and thanks for the patience).

PS Inspired by @463035818_is_not_a_number i've tried to run cplx_t version using https://godbolt.org/ - results:

GCC 10.4 - compiles well.

GCC 12.2 - compilation failed, output:

g++: internal compiler error: Segmentation fault signal terminated program cc1plus
Please submit a full bug report, with preprocessed source (by using -freport-bug).
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 4

x86-64 clang 15.0.0 - compilation successful.

x86-64 clang 3.0.0 - compilation fails with output:

<source>:22:16: error: variable has incomplete type 'cplx_t<double> [2048][10]'
cplx_t<double> test_arr[2048][10] = {
               ^
1 error generated.
Compiler returned: 1


来源: stackexchange

问:
make audio play at particular duration using wavesurfer
I am trying to make audio play at a manually set start time like 30s with the help of wavesurfer

Tried to use this following function but it didn't work

`

```<code>wavesurfer.setCurrentTime(Math.max(0, 30));
</code>```

`

ContentLicense: CC BY-SA 4.0

Body:
I am trying to make audio play at a manually set start time like 30s with the help of wavesurfer

Tried to use this following function but it didn't work

`

wavesurfer.setCurrentTime(Math.max(0, 30));

`


问:
File not getting read properly after downloading a file using axios?
I declared a function download_file() which downloads a file using axios

async function download_file(url, filename) {
  const file_stream = fs.createWriteStream(filename);

  await axios({
    method: "GET",
    url: url,
    responseType: "stream",
  })
    .then(function (response) {
      response.data.pipe(file_stream);
    })
    .catch(function (error) {
      console.error(error);
    });

  file_stream.on("finished", () => {
    file_stream.close();
  });
}
```
<p>Then I tried to download a png file and tried to read it.</p>
<pre class="lang-js prettyprint-override"><code>
await download_file(
  "https://assets.vercel.com/image/upload/v1662090959/front/nextjs/twitter-card.png",
  "twitter.png"
);

// File cannot be read properly after calling the download_file() function
const data = fs.readFileSync("twitter.png", { encoding: "utf8" });
console.log(data);
</code>```

But the output is nothing.

However, when I try to read a png file without calling the download_file() function.
The data is printed without any issue

This duplicate marked question doesn't solve, whats wrong with my code. As I am awaiting the call from axios, I don't need to promisify my download_file() function. Clarify if I am wrong

Body:
I declared a function download_file() which downloads a file using axios

async function download_file(url, filename) {
  const file_stream = fs.createWriteStream(filename);

  await axios({
    method: "GET",
    url: url,
    responseType: "stream",
  })
    .then(function (response) {
      response.data.pipe(file_stream);
    })
    .catch(function (error) {
      console.error(error);
    });

  file_stream.on("finished", () => {
    file_stream.close();
  });
}

Then I tried to download a png file and tried to read it.

await download_file(
  "https://assets.vercel.com/image/upload/v1662090959/front/nextjs/twitter-card.png",
  "twitter.png"
);

// File cannot be read properly after calling the download_file() function
const data = fs.readFileSync("twitter.png", { encoding: "utf8" });
console.log(data);

But the output is nothing.

However, when I try to read a png file without calling the download_file() function.
The data is printed without any issue

This duplicate marked question doesn't solve, whats wrong with my code. As I am awaiting the call from axios, I don't need to promisify my download_file() function. Clarify if I am wrong


问:
How to select all the rows of a html table from all pages
I have a html table for which the below library is applied to get pagination, sorting and searching.

```<code>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.13.1/js/jquery.dataTables.min.js"></script>
</code>```

However there is a requirement to have a search box for each columns. I found a way to do that but it is not able to search the data across all the pages. Below is the javascript

```<code><script>
  function filterTable(thisInput, thisIndex) {
    $('table').show();
    var selection = thisInput.value;

    var dataset = $('table tbody').find('tr');
    // show all rows first
    dataset.show();
    // filter the rows that should be hidden
    dataset.filter(function(index, item) {
    return $(item).find($("td:nth-child("+thisIndex+")")).text().toLowerCase().indexOf(selection) === -1;
    }).hide();

}
<script>
<body>
.....
          <input type="text" placeholder="Enter First Name" name="fname" id="fname" onkeyup="filterTable(this, 1)">
                <input type="text" placeholder="Enter Middle Name" name="mname" id="mname" onkeyup="filterTable(this, 2)">
                <input type="text" placeholder="Enter Last Name" name="lname" id="lname" onkeyup="filterTable(this, 3)">
....
</body>

</code>```

Any help here would be appreciated.
Thanks

Body:
I have a html table for which the below library is applied to get pagination, sorting and searching.

However there is a requirement to have a search box for each columns. I found a way to do that but it is not able to search the data across all the pages. Below is the javascript


问:
Celery beat PeriodicTask max executions
Im trying to put max executions to my PeriodicTask with IntervalSchedule.

I know total_run_count but, ¿how can use it to put max executions to my PeriodicTask?

```<code>@receiver(post_save, sender=AutoTask)
def create_periodic_task(sender, instance, **kwargs):
   interval = IntervalSchedule.objects.get_or_create(every=instance.every, period=instance.periodicity)[0]
   PeriodicTask.objects.create(name=instance.title, task="create_autotask", start_time=instance.creation_date, total_run_count=instance.repetitions, interval=interval)
</code>```

I coded this, but, in this case, I can configure the interval (example : each 2 days ), but... how can I limitate the repetitions?

Ty

Title: Celery beat PeriodicTask max executions

Body:
Im trying to put max executions to my PeriodicTask with IntervalSchedule.

I know total_run_count but, ¿how can use it to put max executions to my PeriodicTask?

@receiver(post_save, sender=AutoTask)
def create_periodic_task(sender, instance, **kwargs):
   interval = IntervalSchedule.objects.get_or_create(every=instance.every, period=instance.periodicity)[0]
   PeriodicTask.objects.create(name=instance.title, task="create_autotask", start_time=instance.creation_date, total_run_count=instance.repetitions, interval=interval)

I coded this, but, in this case, I can configure the interval (example : each 2 days ), but... how can I limitate the repetitions?

Ty


问:
How to stop video playing when using slider in loop using React
I am using Reactjs/nextjs and i integrated slider ( youtube video slider) which is working fine but i want if i play any video and click on "Arrow button(< or >) "(previous or next) then youtube video should stop,In other words whenever we click on next or previous button then current video should pause,How can i do this ? Here is my current code</p>
```<code>import React from 'react';
import axios from 'axios';
import Image from 'next/image'
import Link from "next/link";
import YouTube from "react-youtube";

class Blogs extends React.Component {
    state = {
        trending: []
      }

    componentDidMount() {
        axios.get('xxxxxxxxxxxxxxxxxxxxxxxxxxxxx/getallvideos',
        )
          .then(res => {
            const trending = res.data;
            this.setState({ trending });
          })
      }

    render() {
    const opts = {
            height: "315",
            width: "560",
            frameBorder: "0",
            title : "YouTube video player",
            playerVars: {
              autoplay: 0,
            },
          };

 return (
          <section className="article-main pt-0 bg  line  videos_page">
<div className="container">
<h2 className="bigheading text-center mt-5">All Videos

<img src="img/heading-line.png" /></h2>
<div className="row pt-5">
<img className='graphic_image' src='https://res.cloudinary.com/sapiangroup/image/upload/v1658492928/serge/graphic_yvw8xd.png' data-aos="zoom-in" data-aos-delay="900" />

<div id="demo" className="carousel slide" data-bs-ride="carousel">
  <div className="carousel-inner">
    {this.state.trending.map((post, index) => {
return (
    <>
        <div className={`carousel-item ${index === 0 ? 'active' : ''}`}>
            <YouTube videoId={post.VideoId}
                                opts={opts} />
        </div>

    </>
     )
 })}
  </div>
  <button className="carousel-control-prev" type="button" data-bs-target="#demo" data-bs-slide="prev">
    <span className="carousel-control-prev-icon"></span>
  </button>
  <button className="carousel-control-next" type="button" data-bs-target="#demo" data-bs-slide="next">
    <span className="carousel-control-next-icon"></span>
  </button>
</div>
</div>
</div>
</section>
      );

    }
  }

  export default Blogs;
</code>```

Body:
I am using Reactjs/nextjs and i integrated slider ( youtube video slider) which is working fine but i want if i play any video and click on "Arrow button(< or >) "(previous or next) then youtube video should stop,In other words whenever we click on next or previous button then current video should pause,How can i do this ? Here is my current code

import React from 'react';
import axios from 'axios';
import Image from 'next/image'
import Link from "next/link";
import YouTube from "react-youtube";

class Blogs extends React.Component {
    state = {
        trending: []
      }

    componentDidMount() {
        axios.get('xxxxxxxxxxxxxxxxxxxxxxxxxxxxx/getallvideos',
        )
          .then(res => {
            const trending = res.data;
            this.setState({ trending });
          })
      }

    render() {
    const opts = {
            height: "315",
            width: "560",
            frameBorder: "0",
            title : "YouTube video player",
            playerVars: {
              autoplay: 0,
            },
          };

 return (

All Videos

    {this.state.trending.map((post, index) => {
return (
    <>
        <div className={`carousel-item ${index === 0 ? 'active' : ''}`}>
            <YouTube videoId={post.VideoId}
                                opts={opts} />

    </>
     )
 })}

  <button className="carousel-control-prev" type="button" data-bs-target="#demo" data-bs-slide="prev">

  </button>
  <button className="carousel-control-next" type="button" data-bs-target="#demo" data-bs-slide="next">

  </button>

      );

    }
  }

  export default Blogs;


问:
A recursive function has different performance in different docker containers
I have a visualization application that runs on Azure. One thing has been noticed that it has significant performance difference when it runs in a dev ubuntu container (on Azure) and a prod ubuntu container (sits on the same Azure service plan, so they share the CPU power and memory, and they're build with exactly the same DockerFile) and my local windows desktop.

The following recursive function, which code-wise, is exactly the same in these three environments, has very different performance in runtime. It take ~15s in the dev-container and 0.2s in the prod container and my local windows machine.

By looking at the code,I can't think of any reason that can explain this performance difference. I'm new to Python development, container, and Azure. Wondering if anyone can point me where should I start to fix the issue?

To make this clearly, this function is to build a tree from the given node map and edge map, called around 100 times recursively.

```<code>    def _traverse_alpha_model(self, node_map: Dict[int, AlphaNodesExt], edge_map: Dict[int, List[AlphaEdges]],
                              node_id: int, alpha_model: dict, weight: float = 0.):
        """
        Recursively traverse the graph and add child nodes, adding weight if factor node

        :param node_map: map of node id to node model
        :param edge_map: map of from node id to list of edge models
        :param node_id: current node id as int
        :param alpha_model: empty dict to start
        :param weight: weight of current node (default: 0.)
        """
        # frontier_log.info("Traverse alpha model, node_id: {node_id}".format(node_id=str(node_id)))

        inner_start = time.time()
        node = node_map[node_id]
        # frontier_log.info("     Map node. Time taken: {s} s".format(s=time.time()-inner_start))

        inner_start = time.time()
        node_type = self._node_type_service.get_node_type(node.node_type_id)
        # frontier_log.info("     Get node type. Time taken: {s} s".format(s=time.time() - inner_start))

        inner_start = time.time()
        alpha_model.update(**node.to_dict(node_type))
        # frontier_log.info("     Update node type to alpha model. Time taken: {s} s".format(s=time.time() - inner_start))

        inner_start = time.time()
        alpha_model['weight'] = weight
        # frontier_log.info("     Add weight. Time taken: {s} s".format(s=time.time() - inner_start))

        inner_start = time.time()
        children = edge_map[node.id]
        # frontier_log.info("     Find children given node id. Time taken: {s} s".format(s=time.time() - inner_start))

        if not children:
            return

        inner_start = time.time()
        alpha_model['children'] = [dict() for _child in children]
        # frontier_log.info("     Initialize children with empty dictionary. Time taken: {s} s".format(s=time.time() - inner_start))

        for idx, child_edge in enumerate(children):
            self._traverse_alpha_model(node_map, edge_map, child_edge.to_node_id, alpha_model['children'][idx],
                                       weight=child_edge.weight)

</code>```

And this is my Docker file

```<code># Linux image to pull
FROM ubuntu:18.04

# Environment Variables
ENV PROJECT_DIR=/opt/frontier
ENV PORT=5001

# apt-get and system utilities
RUN apt-get update && apt-get install -y \
    curl apt-transport-https debconf-utils \
    && rm -rf /var/lib/apt/lists/*

# downloading the requisite packages
RUN apt-get update
RUN apt-get -y install locales
RUN apt-get -y install build-essential
RUN apt-get -y install zlib1g-dev
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=US/California
RUN apt-get -y install software-properties-common
RUN locale-gen en_US.UTF-8
RUN update-locale LANG=en_US.UTF-8

#installing python
RUN apt-get -y install python3
RUN apt install -y python3-pip
RUN pip3 install --upgrade pip
# RUN apt-get -y install python3-openssl

# adding custom MS repository
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list > /etc/apt/sources.list.d/mssql-release.list

# install SQL Server drivers and tools
RUN apt-get update && ACCEPT_EULA=Y apt-get install -y msodbcsql17 mssql-tools
RUN echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
RUN /bin/bash -c "source ~/.bashrc"
RUN apt-get -y install unixodbc-dev

# Install requirements and mount codebase
RUN mkdir -p $PROJECT_DIR
WORKDIR $PROJECT_DIR
ADD ./requirements.txt $PROJECT_DIR/requirements.txt
RUN pip3 install -r $PROJECT_DIR/requirements.txt
ADD . $PROJECT_DIR
COPY . $PROJECT_DIR
EXPOSE $PORT
CMD ["python3", "-m", "frontier"]
</code>```

Body:
I have a visualization application that runs on Azure. One thing has been noticed that it has significant performance difference when it runs in a dev ubuntu container (on Azure) and a prod ubuntu container (sits on the same Azure service plan, so they share the CPU power and memory, and they're build with exactly the same DockerFile) and my local windows desktop.

The following recursive function, which code-wise, is exactly the same in these three environments, has very different performance in runtime. It take ~15s in the dev-container and 0.2s in the prod container and my local windows machine.

By looking at the code,I can't think of any reason that can explain this performance difference. I'm new to Python development, container, and Azure. Wondering if anyone can point me where should I start to fix the issue?

To make this clearly, this function is to build a tree from the given node map and edge map, called around 100 times recursively.

    def _traverse_alpha_model(self, node_map: Dict[int, AlphaNodesExt], edge_map: Dict[int, List[AlphaEdges]],
                              node_id: int, alpha_model: dict, weight: float = 0.):
        """
        Recursively traverse the graph and add child nodes, adding weight if factor node

        :param node_map: map of node id to node model
        :param edge_map: map of from node id to list of edge models
        :param node_id: current node id as int
        :param alpha_model: empty dict to start
        :param weight: weight of current node (default: 0.)
        """
        # frontier_log.info("Traverse alpha model, node_id: {node_id}".format(node_id=str(node_id)))

        inner_start = time.time()
        node = node_map[node_id]
        # frontier_log.info("     Map node. Time taken: {s} s".format(s=time.time()-inner_start))

        inner_start = time.time()
        node_type = self._node_type_service.get_node_type(node.node_type_id)
        # frontier_log.info("     Get node type. Time taken: {s} s".format(s=time.time() - inner_start))

        inner_start = time.time()
        alpha_model.update(**node.to_dict(node_type))
        # frontier_log.info("     Update node type to alpha model. Time taken: {s} s".format(s=time.time() - inner_start))

        inner_start = time.time()
        alpha_model['weight'] = weight
        # frontier_log.info("     Add weight. Time taken: {s} s".format(s=time.time() - inner_start))

        inner_start = time.time()
        children = edge_map[node.id]
        # frontier_log.info("     Find children given node id. Time taken: {s} s".format(s=time.time() - inner_start))

        if not children:
            return

        inner_start = time.time()
        alpha_model['children'] = [dict() for _child in children]
        # frontier_log.info("     Initialize children with empty dictionary. Time taken: {s} s".format(s=time.time() - inner_start))

        for idx, child_edge in enumerate(children):
            self._traverse_alpha_model(node_map, edge_map, child_edge.to_node_id, alpha_model['children'][idx],
                                       weight=child_edge.weight)

And this is my Docker file

# Linux image to pull
FROM ubuntu:18.04

# Environment Variables
ENV PROJECT_DIR=/opt/frontier
ENV PORT=5001

# apt-get and system utilities
RUN apt-get update && apt-get install -y \
    curl apt-transport-https debconf-utils \
    && rm -rf /var/lib/apt/lists/*

# downloading the requisite packages
RUN apt-get update
RUN apt-get -y install locales
RUN apt-get -y install build-essential
RUN apt-get -y install zlib1g-dev
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=US/California
RUN apt-get -y install software-properties-common
RUN locale-gen en_US.UTF-8
RUN update-locale LANG=en_US.UTF-8

#installing python
RUN apt-get -y install python3
RUN apt install -y python3-pip
RUN pip3 install --upgrade pip
# RUN apt-get -y install python3-openssl

# adding custom MS repository
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list > /etc/apt/sources.list.d/mssql-release.list

# install SQL Server drivers and tools
RUN apt-get update && ACCEPT_EULA=Y apt-get install -y msodbcsql17 mssql-tools
RUN echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
RUN /bin/bash -c "source ~/.bashrc"
RUN apt-get -y install unixodbc-dev

# Install requirements and mount codebase
RUN mkdir -p $PROJECT_DIR
WORKDIR $PROJECT_DIR
ADD ./requirements.txt $PROJECT_DIR/requirements.txt
RUN pip3 install -r $PROJECT_DIR/requirements.txt
ADD . $PROJECT_DIR
COPY . $PROJECT_DIR
EXPOSE $PORT
CMD ["python3", "-m", "frontier"]


问:
Check the response of a html form submit in jsp page with iframe as target
```<code><iframe id ="loginFrame" name ="loginFrame" title="login"></iframe>
<form name='loginForm' id="loginForm" method="POST" action="/home/login" target="loginFrame">
</form>
</code>```

After submitting the form, I need to display a popup/alert based on the HTTP response code.
If it is 200, I need to display the login successful alert and if 400 a login failure alert.
How to proceed?

Body:
<form name='loginForm' id="loginForm" method="POST" action="/home/login" target="loginFrame">
</form>

After submitting the form, I need to display a popup/alert based on the HTTP response code.
If it is 200, I need to display the login successful alert and if 400 a login failure alert.
How to proceed?


问:
WS_EX_LAYERED window chroma key (LWA_COLORKEY) doesn't work in Windows 7 with Aero Glass enabled
I'm trying to make a DirectX8 application (Game Maker) chroma keyed using layered windows (WS_EX_LAYERED extended style flags, and LWA_COLORKEY method) for transparency and correct hit testing on a borderless window. However, out of all platforms I've tested it on, Windows 7 fails but specifically only when Aero Glass is turned on. The effect works for apparently one frame, and then stops working - the chroma key then comes out to the screen and the window is a full rectangle, including mouse hit testing. Turning off Aero Glass in advanced appearance, or changing to a Basic or Classic theme fixes the issue, but that's undesirable.

__declspec(dllexport) double __cdecl __gm82core_setchromakey(double enable, double color) {
    if (enable>=0.5) {
        SetWindowLong(window_handle,GWL_EXSTYLE,GetWindowLong(window_handle,GWL_EXSTYLE) | WS_EX_LAYERED);
        SetLayeredWindowAttributes(window_handle,((DWORD)color)&0x00ffffff,0xff,LWA_COLORKEY);
    } else {
        SetWindowLong(window_handle,GWL_EXSTYLE,GetWindowLong(window_handle,GWL_EXSTYLE) & ~WS_EX_LAYERED);
    }
    return 0;
}
```

broken effect in Win7 with Aero Glass enabled

(The variable types are all double because the develoment platform (Game Maker) only allows for doubles to be passed to native code)

I've read that there are issues using colors that have the same value on multiple channels like white or yellow for chroma key, and tried using colors such as rgb (253,254,255) or (201,202,203), to similar results.

I've read that chroma keying apparently broke in Windows 7 RC1, and we can just assume that wasn't fixed for RTM due to the experienced behavior.

I've read that in Win 7 and earlier, child windows cannot be chroma keyed, and I've attempted to remove the window's parent using SetParent(), to similar results (and introducing other issues in the process), despite the window's parent being disabled and invisible when the application is launched in borderless mode.

The effect works fine until the window is updated, and then never again, which is an issue as the program has animated controls.

Was verified to work in various versions of Win 10 dated as far back as 1903:
effect working as intended in Win10

I've used an alternate method using DWM direct compositing using a 32 bit ARGB surface format, which allows per-pixel alpha transparency in all platforms, however does not allow for mouse hit testing, which is undesirable for this application due to its free-form window.

Even though the effect works properly in Win10, I'd like to support Win7 as well since that's a common target for the extension package this code is from.

Body:
I'm trying to make a DirectX8 application (Game Maker) chroma keyed using layered windows (WS_EX_LAYERED extended style flags, and LWA_COLORKEY method) for transparency and correct hit testing on a borderless window. However, out of all platforms I've tested it on, Windows 7 fails but specifically only when Aero Glass is turned on. The effect works for apparently one frame, and then stops working - the chroma key then comes out to the screen and the window is a full rectangle, including mouse hit testing. Turning off Aero Glass in advanced appearance, or changing to a Basic or Classic theme fixes the issue, but that's undesirable.

__declspec(dllexport) double __cdecl __gm82core_setchromakey(double enable, double color) {
    if (enable>=0.5) {
        SetWindowLong(window_handle,GWL_EXSTYLE,GetWindowLong(window_handle,GWL_EXSTYLE) | WS_EX_LAYERED);
        SetLayeredWindowAttributes(window_handle,((DWORD)color)&0x00ffffff,0xff,LWA_COLORKEY);
    } else {
        SetWindowLong(window_handle,GWL_EXSTYLE,GetWindowLong(window_handle,GWL_EXSTYLE) & ~WS_EX_LAYERED);
    }
    return 0;
}

broken effect in Win7 with Aero Glass enabled

(The variable types are all double because the develoment platform (Game Maker) only allows for doubles to be passed to native code)

I've read that there are issues using colors that have the same value on multiple channels like white or yellow for chroma key, and tried using colors such as rgb (253,254,255) or (201,202,203), to similar results.

I've read that chroma keying apparently broke in Windows 7 RC1, and we can just assume that wasn't fixed for RTM due to the experienced behavior.

I've read that in Win 7 and earlier, child windows cannot be chroma keyed, and I've attempted to remove the window's parent using SetParent(), to similar results (and introducing other issues in the process), despite the window's parent being disabled and invisible when the application is launched in borderless mode.

The effect works fine until the window is updated, and then never again, which is an issue as the program has animated controls.

Was verified to work in various versions of Win 10 dated as far back as 1903:
effect working as intended in Win10

I've used an alternate method using DWM direct compositing using a 32 bit ARGB surface format, which allows per-pixel alpha transparency in all platforms, however does not allow for mouse hit testing, which is undesirable for this application due to its free-form window.

Even though the effect works properly in Win10, I'd like to support Win7 as well since that's a common target for the extension package this code is from.


问:
How to keep a global variable's value when refreshing the page content in Asp.Net Blazor
This application is ASP.Net Blazor version 7. The application is a quote system. While the user is working on a quote, the quote number is stored in a global variable using a state container. There is a product details page on which the user can click a button to add the item to the quote as long as there is an active quote number stored in the global variable. There are substitute items on the product details page which the user can click on to view that product. The substitute item details route to the same component as the product details. The problem is that in order to get the substitute item details to display on the page, I need to use the NavigationManager NavigateTo and force the page to load otherwise the item details on the page do not get updated. However, forcing the page to load removes the quote number from the global variable. Once the quote number is lost, the user can no longer add items to the quote. I tried using an href and NavLink but neither one would update the contents of the page.

How can I refresh the content of the page without losing the value in the global variable?

```<code>public class QuoteIdentifier
{
    public string QuoteNumber { get; private set; }
    public event Action OnChange;

    public void SetQuoteNumber(string id)
    {
        QuoteNumber = id;
        NotifyStateChanged();
    }

    public void Reset()
    {
        QuoteNumber = null;
        NotifyStateChanged();
    }

    void NotifyStateChanged() => OnChange?.Invoke();
}
</code>```

product details page

```<code>@page "/Products/Product/{PartNo}"
[Inject]
public QuoteIdentifier QuoteIdentifier { get; set; }

void NavigateTo(string itemNo)
{
    NavManager.NavigateTo($"/Products/Product/{NavManager.UrlEncode(itemNo)}", true);
}
</code>```

edit

I was populating all of my page content in the OnInitialized method which only fires once, thus forcing me to reload the page to get the new page contents to show. I moved the code to populate the content to the OnParametersSet method, removed the forced reload in the NavigateTo, reset my object which holds my page content when my parameter is set, and the content now displays and I do not lose the value of my quote number.

Body:
This application is ASP.Net Blazor version 7. The application is a quote system. While the user is working on a quote, the quote number is stored in a global variable using a state container. There is a product details page on which the user can click a button to add the item to the quote as long as there is an active quote number stored in the global variable. There are substitute items on the product details page which the user can click on to view that product. The substitute item details route to the same component as the product details. The problem is that in order to get the substitute item details to display on the page, I need to use the NavigationManager NavigateTo and force the page to load otherwise the item details on the page do not get updated. However, forcing the page to load removes the quote number from the global variable. Once the quote number is lost, the user can no longer add items to the quote. I tried using an href and NavLink but neither one would update the contents of the page.

How can I refresh the content of the page without losing the value in the global variable?

public class QuoteIdentifier
{
    public string QuoteNumber { get; private set; }
    public event Action OnChange;

    public void SetQuoteNumber(string id)
    {
        QuoteNumber = id;
        NotifyStateChanged();
    }

    public void Reset()
    {
        QuoteNumber = null;
        NotifyStateChanged();
    }

    void NotifyStateChanged() => OnChange?.Invoke();
}

product details page

@page "/Products/Product/{PartNo}"
[Inject]
public QuoteIdentifier QuoteIdentifier { get; set; }

void NavigateTo(string itemNo)
{
    NavManager.NavigateTo($"/Products/Product/{NavManager.UrlEncode(itemNo)}", true);
}

edit

I was populating all of my page content in the OnInitialized method which only fires once, thus forcing me to reload the page to get the new page contents to show. I moved the code to populate the content to the OnParametersSet method, removed the forced reload in the NavigateTo, reset my object which holds my page content when my parameter is set, and the content now displays and I do not lose the value of my quote number.


问:
how dropdown selected id pass vue to services.js file
how id pass  vue to services.js

api.services.js

```<code>return axios.get(API_URL+'/product/all?id='+custom_id})
      .then((res) => res.data);

</code>```

tobar.vue

```<code><script setup>
const dropdownItem = 1;
const dropdownItems = computed(() => items);

onMounted(() => {
  ApiService.getStores().then(data => {
    data.forEach(value => {
      items.push({ name: value.shop, value: value.id });
    });
  });
});
const onChange = event => {
  console.log(event.value);
};
</script>

<template>
  <Dropdown
    id="state"
    v-model="dropdownItem"
    :options="dropdownItems"
    :filter="true"
    optionLabel="name"
    optionValue="value"
    :placeholder="value"
    @change="onChange"
  />
</template>

</code>```

1- const onChange  (event.value) how to pass (API_URL+'/product/all?id='+custom_id) custom_id in api.services.js to get data

2- const dropdownItem = 1; v-model="dropdownItem" default value selected its not working, how to solve this

Body:
how id pass  vue to services.js

api.services.js

return axios.get(API_URL+'/product/all?id='+custom_id})
      .then((res) => res.data);

tobar.vue

<template>
  <Dropdown
    id="state"
    v-model="dropdownItem"
    :options="dropdownItems"
    :filter="true"
    optionLabel="name"
    optionValue="value"
    :placeholder="value"
    @change="onChange"
  />
</template>

1- const onChange  (event.value) how to pass (API_URL+'/product/all?id='+custom_id) custom_id in api.services.js to get data

2- const dropdownItem = 1; v-model="dropdownItem" default value selected its not working, how to solve this


问:
Javascript acting different in two different versions
Let me display the code first and then try to explain the problem.

```<code>function toggleButton(filter, button) {
    var buttonOn = false;

    if ( button.value === "ON" ) {
    buttonOn = true;
    }

    if ( buttonOn ) {
        button.value = "OFF";
        button.className = "btn_tgl btn_tgl_off";
    }
    else {
        button.value = "ON";
        button.className = "btn_tgl btn_tgl_on";
    }

    checkItem();
}

function checkItem(alreadyGotStuff) {
    if(!alreadyGotStuff){
        do this
    }
    else{
        do that
    }
}
</code>```

So the problem is this. In the trunk and production version of the program that uses this script, when the toggleButton makes its run and checkItem(); is called, alreadyGotStuff is undefined. This is correct as I need it to be undefined so the first if statement will suceed and it will do this. There are other functions in the script that will make a call     checkItem(true);, thus the function will do that. In my development branch, when the call is checkItem();, the value is always true. It doesn't matter what browser I am using, and the script is exactly the same. Why is it passing undefined in one version, and staying true in the other?

Thanks

ContentLicense: CC BY-SA 3.0

Body:
Let me display the code first and then try to explain the problem.

function toggleButton(filter, button) {
    var buttonOn = false;

    if ( button.value === "ON" ) {
    buttonOn = true;
    }

    if ( buttonOn ) {
        button.value = "OFF";
        button.className = "btn_tgl btn_tgl_off";
    }
    else {
        button.value = "ON";
        button.className = "btn_tgl btn_tgl_on";
    }

    checkItem();
}

function checkItem(alreadyGotStuff) {
    if(!alreadyGotStuff){
        do this
    }
    else{
        do that
    }
}

So the problem is this. In the trunk and production version of the program that uses this script, when the toggleButton makes its run and checkItem(); is called, alreadyGotStuff is undefined. This is correct as I need it to be undefined so the first if statement will suceed and it will do this. There are other functions in the script that will make a call     checkItem(true);, thus the function will do that. In my development branch, when the call is checkItem();, the value is always true. It doesn't matter what browser I am using, and the script is exactly the same. Why is it passing undefined in one version, and staying true in the other?

Thanks


问:
How to delete text between two characters if conditions are satisfied
I want to detect text between two characters and delete the text including that two characters.

For Example:

choice(IN1T, endless )

choice("ENDMAN", endless )

In second example, the code would just pass that sentence and wouldn't change anything because after ' ( ' there is ' " ', but in the first example, it would delete 'IN1T,' and the output would be for the first example:

choice( endless )

Second example would be the same, as I mentoined before.
Output of the Second Sentence:

choice("ENDMAN", endless )

I found already solution on similar question:
How to delete the words between two delimiters?

The Answer of linked Question was:

```<code>re.sub(r'<.+>', s, '')
</code>```

Similar thing that would maybe better explain the second thing I need this for:

Example:

{sometext here}

I would like to detect the written inside "{" and "}" and delete it if it is 14 characters or smaller including the curly brackets.

The thing is, I want to limit how much letters can be there, for example maximum 14 letters, as more letters would be invalid.

The above solution deletes text between "<" and ">" which isn't exactly what I need. I want it to pass the part of the sentence that starts with " because it would be something else completely.

Body:
I want to detect text between two characters and delete the text including that two characters.

For Example:

choice(IN1T, endless )

choice("ENDMAN", endless )

In second example, the code would just pass that sentence and wouldn't change anything because after ' ( ' there is ' " ', but in the first example, it would delete 'IN1T,' and the output would be for the first example:

choice( endless )

Second example would be the same, as I mentoined before.
Output of the Second Sentence:

choice("ENDMAN", endless )

I found already solution on similar question:
How to delete the words between two delimiters?

The Answer of linked Question was:

re.sub(r'<.+>', s, '')

Similar thing that would maybe better explain the second thing I need this for:

Example:

{sometext here}

I would like to detect the written inside "{" and "}" and delete it if it is 14 characters or smaller including the curly brackets.

The thing is, I want to limit how much letters can be there, for example maximum 14 letters, as more letters would be invalid.

The above solution deletes text between "<" and ">" which isn't exactly what I need. I want it to pass the part of the sentence that starts with " because it would be something else completely.


问:
how to save matplotlib figures in a movie-file using a plot function
I have a function that creates matplotlib figure

```<code>def make_figure(some_input):`
    fig,ax = plt.subplots(figsize=(10,10))
    ....
    ....
    return fig,ax
</code>```

I then make some figures

```<code>for x in input:
   fig,ax = make_figure(x)
   fig.savefig(f'name{number}.png')
</code>```

How can I save those figures in a movie file?

I wanted to do animation with Matplotlib, but I cannot get it working with my "make_figure" function.

thx!

Body:
I have a function that creates matplotlib figure

def make_figure(some_input):`
    fig,ax = plt.subplots(figsize=(10,10))
    ....
    ....
    return fig,ax

I then make some figures

for x in input:
   fig,ax = make_figure(x)
   fig.savefig(f'name{number}.png')

How can I save those figures in a movie file?

I wanted to do animation with Matplotlib, but I cannot get it working with my "make_figure" function.

thx!


问:
Configuring Azure Log Alerts using two columns from a summarized table
I am trying to configure an alert in Azure that will send an email when a device has responded as "offline" 3 or more times in the last 15 minutes. The query I am using returns a summarized table with two columns, "Name" and "Count", where Count represents the number of offline responses.

Name
Count

ABC
4

DEF
3

My issue comes into play when trying to set up the conditions for the alert. Ideally I want to trigger an alert for any row where Count is greater than or equal to 3.

I can measure off of Table Rows or Count, but cannot seem to wrap my head around how to set up measurement and dimension splitting in a way that behaves similar to my goal I covered above. Thus far I have been able to set it up using Count, but it seems to only allow aggregating the values in Count, rather than looking at each row individually.

I have considered writing individual queries for each device that would return every offline response, and simply alerting off of the number of rows returned. I would much rather keep this contained to a single query. Thank you for any help you can provide.


问:
OTP in react-native
I have 4 inputs on my login screen once the user fills in the first input the focus should be automatically moved to the next input but then I get an error while executing my script

Well, with react-native I try to activate the focus on my next input once the previous one is validated but I stall badly.

Here is my reference table

const inputRef = [
    useRef(null),
    useRef(null),
    useRef(null),
    useRef(null),
    useRef(null),
  ]
```
<p>my function to activate the focus on the next input</p>
<pre class="lang-js prettyprint-override"><code>_next_input = (index) =>{
  console.log(inputRef[index+1].current.focus)
}
</code>```

my implementation

inputRef.map((reference_input , idx)=>(
  <OtpCard
    key={idx}
    ref={ reference_input }
    onChange = { (string)=> {
      if(string != '')
        _next_input(idx)
      else
        console.log('value is empty')
    }}
  />
))
```

Title: OTP in react-native

Body:
I have 4 inputs on my login screen once the user fills in the first input the focus should be automatically moved to the next input but then I get an error while executing my script

Well, with react-native I try to activate the focus on my next input once the previous one is validated but I stall badly.

Here is my reference table

const inputRef = [
    useRef(null),
    useRef(null),
    useRef(null),
    useRef(null),
    useRef(null),
  ]

my function to activate the focus on the next input

_next_input = (index) =>{
  console.log(inputRef[index+1].current.focus)
}

my implementation

inputRef.map((reference_input , idx)=>(
  <OtpCard
    key={idx}
    ref={ reference_input }
    onChange = { (string)=> {
      if(string != '')
        _next_input(idx)
      else
        console.log('value is empty')
    }}
  />
))


问:
How do I give a community user permission to PersonAccount Fields?
I have a User with a Customer Community Plus Login User License. I am getting the following error when running some code as this user that inserts a new Account record:

```<code>Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, BCH_AccountTrigger: execution of AfterInsert

caused by: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, DDH.HC_ProgramEligibility_Trigger: execution of AfterInsert

caused by: DDH.HC_SQuery.SQueryException: Permission Denied: cannot read [Account] object field(s) {PersonBirthdate}
</code>```

When I do the same as a System Admin, Everything works as expected. How do I give access to PersonBirthdate to this Customer Community Plus Login User via a permission set?

I tried searching the Object Settings for this field and could not find it.

Body:
I have a User with a Customer Community Plus Login User License. I am getting the following error when running some code as this user that inserts a new Account record:

Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, BCH_AccountTrigger: execution of AfterInsert

caused by: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, DDH.HC_ProgramEligibility_Trigger: execution of AfterInsert

caused by: DDH.HC_SQuery.SQueryException: Permission Denied: cannot read [Account] object field(s) {PersonBirthdate}

When I do the same as a System Admin, Everything works as expected. How do I give access to PersonBirthdate to this Customer Community Plus Login User via a permission set?

I tried searching the Object Settings for this field and could not find it.


问:
SOAP API call from python with pagination
I need to retrieve objects from the SOAP API. I am facing the issue while applying the pagination because some objects have a greater number than 1000 to be returned. As per my knowledge, SOAP returns only 1000 rows/objects by default. I want to retrieve all the rows of a query.

```<code>
import requests

# SOAP request URL

url = "http://example.net/Object/"

# structured XML

payload = """\<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?\>
\<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/%5C"\>
\<soap:Body\>
\<tag xmlns="http://example.net/object"\>
\<tag\>{query_variable}\</tag\>
\</tag\>
\</soap:Body\>
\</soap:Envelope\>"""

# headers

headers = {
'Content-Type': 'application/soap+xml; charset=utf-8'
}

# POST request

response = requests.request("POST", url, headers=headers, data=payload)
</code>```

In my case, some of my objects has 1000+ rows and I need to get all the rows. I am confused how to apply pagination into this request. How I can check for the next page? I have tried total_pages & next_page attribute from the response object. But since, its a post request so it doesn;t work. Any lead on this

Body:
I need to retrieve objects from the SOAP API. I am facing the issue while applying the pagination because some objects have a greater number than 1000 to be returned. As per my knowledge, SOAP returns only 1000 rows/objects by default. I want to retrieve all the rows of a query.

import requests

# SOAP request URL

url = "http://example.net/Object/"

# structured XML

payload = """\<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?\>
\<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/%5C"\>
\<soap:Body\>
\<tag xmlns="http://example.net/object"\>
\<tag\>{query_variable}\</tag\>
\</tag\>
\</soap:Body\>
\</soap:Envelope\>"""

# headers

headers = {
'Content-Type': 'application/soap+xml; charset=utf-8'
}

# POST request

response = requests.request("POST", url, headers=headers, data=payload)

In my case, some of my objects has 1000+ rows and I need to get all the rows. I am confused how to apply pagination into this request. How I can check for the next page? I have tried total_pages & next_page attribute from the response object. But since, its a post request so it doesn;t work. Any lead on this


问:
when in Sequelize I am trying to select columns for both inner joined table some of the joined table columns are nested in alias
I am still new to Sequelize and I am trying to select specific columns from both table in inner join using sequelize. Here is what I have

```<code>        const paramPostgres: QueryBuilder = {
        raw: false,
        nest: true,
        include: [{
            model: UserAccountDeRepository.getInstance().model, as: "userAccountTableAlias",
            attributes: ["account"],
            required: true
        }],
        attributes: ["is_archived", "status", "udiId"],
        where: {
        '$userAccountTableAlias.user$': usernames
        }
    }
</code>```

as you can see attributes: ["is_archived", "status", "udiId"] gives me the columns I want from main table while attributes: ["account"] gives me the column name I want from joined table. My problem is the following response format:

```<code>[{"is_archived":false,"status":"COMPLETED","udiId":"9e8350f1-fab0-4861-96ae-1268118c49a3","userAccountTableAlias":{"account":"133b5f93-916b-46c1-b429-6c071c752097"}}]
</code>```

as you can see all columns are back but account from joined model is buried in userAccountTableAlias

what I want to get is the following

```<code>    [{"is_archived":false,"status":"COMPLETED","udiId":"9e8350f1-fab0-4861-96ae-1268118c49a3","account":"133b5f93-916b-46c1-b429-6c071c752097"}]
</code>```

but not sure how to achieve that. I appreciate any help

Body:
I am still new to Sequelize and I am trying to select specific columns from both table in inner join using sequelize. Here is what I have

        const paramPostgres: QueryBuilder = {
        raw: false,
        nest: true,
        include: [{
            model: UserAccountDeRepository.getInstance().model, as: "userAccountTableAlias",
            attributes: ["account"],
            required: true
        }],
        attributes: ["is_archived", "status", "udiId"],
        where: {
        '$userAccountTableAlias.user$': usernames
        }
    }

as you can see attributes: ["is_archived", "status", "udiId"] gives me the columns I want from main table while attributes: ["account"] gives me the column name I want from joined table. My problem is the following response format:

[{"is_archived":false,"status":"COMPLETED","udiId":"9e8350f1-fab0-4861-96ae-1268118c49a3","userAccountTableAlias":{"account":"133b5f93-916b-46c1-b429-6c071c752097"}}]

as you can see all columns are back but account from joined model is buried in userAccountTableAlias

what I want to get is the following

    [{"is_archived":false,"status":"COMPLETED","udiId":"9e8350f1-fab0-4861-96ae-1268118c49a3","account":"133b5f93-916b-46c1-b429-6c071c752097"}]

but not sure how to achieve that. I appreciate any help


问:
Javascript and Python integration in backend
The project I'm working on is like an online compiler, but the problem is the backend receives an intermediate representation of code (a graph), which has to be converted into python code and then run.
The backend will be using NodeJS. I was wondering what the best way is to do this.

Convert graph to code in JS, then run the python code.

Pass the graph to a python program, which converts it and executes accordingly.

At end the results will be sent to frontend through NodeJS.


问:
Variable Console Logged Twice
I have recently learning react for front end development and have encountered the problem when using useStates. I tried to input a value in a textbox and submit it by clicking a submit button. Normally, only 1 response would be logged on the console, however it appeared twice.

Would be grateful if someone could spot where went wrong in my code snippet.
`

```<code>import './App.css';
import { Button } from 'react-bootstrap';
import { useState } from "react";
import axios from 'axios';

function App () {

  const [key, setKey] = useState(null);
  const [submit, setSubmit] = useState(false);

  function getKey(val){
    setKey({[val.target.name]: val.target.value})
  }

  {
    console.log(key)
    axios
    .post('https://jsonplaceholder.typicode.com/posts', key)
    .then(response => {
      console.log(response)
    })
  }

  return (
      <>
      <div className = "App">

        <h1>Type in the keyword you wish to search: </h1>
        <input
          type = "text"
          name = "keyword"
          onChange = {getKey}
          />
        <Button onClick = {() => setSubmit(true)} > Submit!</Button>
      </div>
      </>
  );

}

export default App;

</code>```

`

Title: Variable Console Logged Twice

Body:
I have recently learning react for front end development and have encountered the problem when using useStates. I tried to input a value in a textbox and submit it by clicking a submit button. Normally, only 1 response would be logged on the console, however it appeared twice.

Would be grateful if someone could spot where went wrong in my code snippet.
`

import './App.css';
import { Button } from 'react-bootstrap';
import { useState } from "react";
import axios from 'axios';

function App () {

  const [key, setKey] = useState(null);
  const [submit, setSubmit] = useState(false);

  function getKey(val){
    setKey({[val.target.name]: val.target.value})
  }

  {
    console.log(key)
    axios
    .post('https://jsonplaceholder.typicode.com/posts', key)
    .then(response => {
      console.log(response)
    })
  }

  return (
      <>

Type in the keyword you wish to search:

        <input
          type = "text"
          name = "keyword"
          onChange = {getKey}
          />
        <Button onClick = {() => setSubmit(true)} > Submit!</Button>

      </>
  );

}

export default App;

`


问:
AppStudioPlugin.DeveloperPortalAPIFailed after upgrading Teams Toolkit to 4.2.0
After upgrading Teams Toolkit to 4.2.0, while debugging team Application in Visual studio code, it fails with

API call to Developer Portal failed: Error, Request failed with status code 403, API name: create-app, X-Correlation-ID: undefined. This may come from some intermittent service error. Please wait for a few minutes and retry the current step. data: "<%3Fxml version="<REDACTED: user-file-path>" encoding="<REDACTED: user-file-path>"%3F>\nAuthenticationFailedServer failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the <REDACTED: user-file-path>:<REDACTED: user-file-path>:2022-12-21T17:17:27.0783537ZAuthentication scheme Bearer is not supported in this version."

stack:
DeveloperPortalAPIFailed: API call to Developer Portal failed: Error, Request failed with status code 403, API name: create-app, X-Correlation-ID: undefined. This may come from some intermittent service error. Please wait for a few minutes and retry the current step. data: "<%3Fxml version="<REDACTED: user-file-path>" encoding="<REDACTED: user-file-path>"%3F>\nAuthenticationFailedServer failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the <REDACTED: user-file-path>:<REDACTED: user-file-path>:2022-12-21T17:17:27.0783537ZAuthentication scheme Bearer is not supported in this version."
at AppStudioResultFactory.SystemError (<REDACTED: user-file-path>:2:7338905)
at wrapException (<REDACTED: user-file-path>:2:7304721)
at Object.importApp (<REDACTED: user-file-path>:2:7308431)
at process.processTicksAndRejections (node:<REDACTED: user-file-path>:96:5)
at async Object.createTeamsApp (<REDACTED: user-file-path>:2:7286749)
at async AppManifest.provision (<REDACTED: user-file-path>:2:7258303)
at async AppManifest. (<REDACTED: user-file-path>:2:6625833)
at async TeamsfxCore.provision (<REDACTED: user-file-path>:2:6128194)
at async TeamsfxCore. (<REDACTED: user-file-path>:2:6625833)
at async FxCore.provisionResourcesOld (<REDACTED: user-file-path>:2:7628193)
at async FxCore. (<REDACTED: user-file-path>:2:7772838)
at async exports.ProjectSettingsWriterMW (<REDACTED: user-file-path>:2:7846344)
at async exports.ContextInjectorMW (<REDACTED: user-file-path>:2:7761355)
at async FxCore. (<REDACTED: user-file-path>:2:7768296)
at async exports.VideoFilterAppBlockerMW (<REDACTED: user-file-path>:2:7896895)
at async exports.ProjectSettingsLoaderMW (<REDACTED: user-file-path>:2:7844791)
at async exports.ProjectVersionCheckerMW (<REDACTED: user-file-path>:2:7849870)
at async exports.AadManifestMigrationMW (<REDACTED: user-file-path>:2:7740883)
at async exports.ProjectConsolidateMW (<REDACTED: user-file-path>:2:7761067)
at async exports.ProjectMigratorMW (<REDACTED: user-file-path>:2:7810098)
at async exports.ConcurrentLockerMW (<REDACTED: user-file-path>:2:7743579)
at async exports.ErrorHandlerMW (<REDACTED: user-file-path>:2:7774291)

While debugging teams app in visual studio code, it should load the application in Microsoft Teams. Instead it is failing. This is after upgrading Team Toolkit to v4.2.0


问:
Golang: Is it possible to configure dlv to run in a path different from my application?
I'm working on a CLI system and would like to know how I can run the dlv in a different path than my application, in order to be able to debug some issues. It is possible?

I've already tried to perform some configurations within the vscode debug tool.
I hope I can run the debug within this tool.


问:
Why are some fonts don't show up properly on server with Puppeteer?
My code generates a transparent screenshot with an SVG input and overlays it in a video.  There are some issues with the fonts.  All fonts display correctly on my local Windows environment.  But some fonts DO NOT display correctly on the linux server.  What can the problem?

screenshot of display of the SVG file on a browser

screenshot of video snapshot from local

screenshot of display of the SVG file on a browser

Here are snippets of a font that works and one that doesn't.

```<code><g transform="matrix(1 0 0 1 800.64 329.62)" style=""  >
        <text xml:space="preserve" font-family="Ecuyerr" font-size="50" font-style="normal" font-weight="400" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1; white-space: pre;" paint-order="stroke"  ><tspan x="-135.5" y="15.71" >Ecuyerr</tspan></text>
</g>

<g transform="matrix(1 0 0 1 332.6 250.68)" style=""  >
        <text xml:space="preserve" font-family="Carolyna Cute" font-size="50" font-style="normal" font-weight="400" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1; white-space: pre;" paint-order="stroke"  ><tspan x="-126.97" y="15.71" >Carolyna Cute</tspan></text>
</g>
</code>```

Puppeteer uses a link to get the font info.

```<code><link href='https://domain/fonts/fonts.css' rel='stylesheet'>
</code>```
```<code>@font-face {
    font-family: 'Carolyna Cute';
    src: url('carolynacute-webfont.eot');
    src: url('carolynacute-webfont.eot?#iefix') format('embedded-opentype'),
         url('carolynacute-webfont.woff2') format('woff2'),
         url('carolynacute-webfont.woff') format('woff'),
         url('carolynacute-webfont.ttf') format('truetype'),
         url('carolynacute-webfont.svg#carolyna__cuteregular') format('svg');
    font-weight: normal;
    font-style: normal;
}
@font

@font-face {
    font-family: 'Ecuyerr';
    src: url('ecuyerr-webfont.eot');
    src: url('ecuyerr-webfont.eot?#iefix') format('embedded-opentype'),
         url('ecuyerr-webfont.woff2') format('woff2'),
         url('ecuyerr-webfont.woff') format('woff'),
         url('ecuyerr-webfont.ttf') format('truetype'),
         url('ecuyerr-webfont.svg#ecuyerdaxregular') format('svg');
    font-weight: normal;
    font-style: normal;
}
</code>```

I have added "--font-render-hinting=none".  It doesn't work.

Then I upload true type fonts to the /usr/shared/fonts directory.  It seems to fix all fonts except one, Carolyna Cute.

Then I get another set of the font and update the CSS file and upload the true type to the fonts folder.  It is still not working.

1 font not working

Body:
My code generates a transparent screenshot with an SVG input and overlays it in a video.  There are some issues with the fonts.  All fonts display correctly on my local Windows environment.  But some fonts DO NOT display correctly on the linux server.  What can the problem?

screenshot of display of the SVG file on a browser

screenshot of video snapshot from local

screenshot of display of the SVG file on a browser

Here are snippets of a font that works and one that doesn't.

<g transform="matrix(1 0 0 1 800.64 329.62)" style=""  >
        <text xml:space="preserve" font-family="Ecuyerr" font-size="50" font-style="normal" font-weight="400" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1; white-space: pre;" paint-order="stroke"  ><tspan x="-135.5" y="15.71" >Ecuyerr</tspan></text>
</g>

<g transform="matrix(1 0 0 1 332.6 250.68)" style=""  >
        <text xml:space="preserve" font-family="Carolyna Cute" font-size="50" font-style="normal" font-weight="400" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1; white-space: pre;" paint-order="stroke"  ><tspan x="-126.97" y="15.71" >Carolyna Cute</tspan></text>
</g>

Puppeteer uses a link to get the font info.

<link href='https://domain/fonts/fonts.css' rel='stylesheet'>

@font-face {
    font-family: 'Carolyna Cute';
    src: url('carolynacute-webfont.eot');
    src: url('carolynacute-webfont.eot?#iefix') format('embedded-opentype'),
         url('carolynacute-webfont.woff2') format('woff2'),
         url('carolynacute-webfont.woff') format('woff'),
         url('carolynacute-webfont.ttf') format('truetype'),
         url('carolynacute-webfont.svg#carolyna__cuteregular') format('svg');
    font-weight: normal;
    font-style: normal;
}
@font

@font-face {
    font-family: 'Ecuyerr';
    src: url('ecuyerr-webfont.eot');
    src: url('ecuyerr-webfont.eot?#iefix') format('embedded-opentype'),
         url('ecuyerr-webfont.woff2') format('woff2'),
         url('ecuyerr-webfont.woff') format('woff'),
         url('ecuyerr-webfont.ttf') format('truetype'),
         url('ecuyerr-webfont.svg#ecuyerdaxregular') format('svg');
    font-weight: normal;
    font-style: normal;
}

I have added "--font-render-hinting=none".  It doesn't work.

Then I upload true type fonts to the /usr/shared/fonts directory.  It seems to fix all fonts except one, Carolyna Cute.

Then I get another set of the font and update the CSS file and upload the true type to the fonts folder.  It is still not working.

1 font not working


问:
Cannot find module or its corresponding type declarations (monorepo)
Im trying to install, run and learn https://github.com/CMSgov/design-system, but after installation (yarn install), i can't execute (yarn develop) since im getting error for actually any import from @cmsgov/design-system in packages/docs.
There is something probably that needs to be added or modified in tsconfig.json and this is how it looks like:

```<code>   {
      "compilerOptions": {
        "target": "es2015",
        "jsx": "react",
        "module": "esnext",
        "moduleResolution": "node",
        "resolveJsonModule": true,
        "allowSyntheticDefaultImports": true,
        "esModuleInterop": true,
        "baseUrl": ".",
        "skipLibCheck": true
      },
      "include": ["packages/**/src/**/*"]
    }
</code>```

Ive tried to manually install package inside docs using:

```<code>npm install --save @cmsgov/design-system
</code>```

but without success. Node versions i've tried to compile with are:
18.12.1
and 16.19.0

Because there are no types in DefinetlyTyped, i've also created decs.d.ts in root:

```<code>declare module "@cmsgov/design-system"
</code>```

Is there maybe something related to lerna settings or something else.

Thanks in advice

Body:
Im trying to install, run and learn https://github.com/CMSgov/design-system, but after installation (yarn install), i can't execute (yarn develop) since im getting error for actually any import from @cmsgov/design-system in packages/docs.
There is something probably that needs to be added or modified in tsconfig.json and this is how it looks like:

   {
      "compilerOptions": {
        "target": "es2015",
        "jsx": "react",
        "module": "esnext",
        "moduleResolution": "node",
        "resolveJsonModule": true,
        "allowSyntheticDefaultImports": true,
        "esModuleInterop": true,
        "baseUrl": ".",
        "skipLibCheck": true
      },
      "include": ["packages/**/src/**/*"]
    }

Ive tried to manually install package inside docs using:

npm install --save @cmsgov/design-system

but without success. Node versions i've tried to compile with are:
18.12.1
and 16.19.0

Because there are no types in DefinetlyTyped, i've also created decs.d.ts in root:

declare module "@cmsgov/design-system"

Is there maybe something related to lerna settings or something else.

Thanks in advice