问:
subprocess-exited-with-error while trying to install pydoop
I'm trying to install pydoop on my ubuntu but ended with the following errors.

```<code>note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pydoop
  Running setup.py clean for pydoop
Failed to build pydoop
Installing collected packages: pydoop
  Running setup.py install for pydoop ... error
  error: subprocess-exited-with-error

  × Running setup.py install for pydoop did not run successfully.
  │ exit code: 1
  ╰─> [79 lines of output]
      using setuptools version 65.6.3
      running install
      /home/manoj/.local/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.linux-aarch64-cpython-310
      creating build/lib.linux-aarch64-cpython-310/pydoop
      copying pydoop/config.py -> build/lib.linux-aarch64-cpython-310/pydoop
      copying pydoop/hadoop_utils.py -> build/lib.linux-aarch64-cpython-310/pydoop
      copying pydoop/hadut.py -> build/lib.linux-aarch64-cpython-310/pydoop
      copying pydoop/__init__.py -> build/lib.linux-aarch64-cpython-310/pydoop
      copying pydoop/test_support.py -> build/lib.linux-aarch64-cpython-310/pydoop
      copying pydoop/test_utils.py -> build/lib.linux-aarch64-cpython-310/pydoop
      copying pydoop/avrolib.py -> build/lib.linux-aarch64-cpython-310/pydoop
      copying pydoop/jc.py -> build/lib.linux-aarch64-cpython-310/pydoop
      copying pydoop/version.py -> build/lib.linux-aarch64-cpython-310/pydoop
      creating build/lib.linux-aarch64-cpython-310/pydoop/mapreduce
      copying pydoop/mapreduce/binary_protocol.py -> build/lib.linux-aarch64-cpython-310/pydoop/mapreduce
      copying pydoop/mapreduce/__init__.py -> build/lib.linux-aarch64-cpython-310/pydoop/mapreduce
      copying pydoop/mapreduce/pipes.py -> build/lib.linux-aarch64-cpython-310/pydoop/mapreduce
      copying pydoop/mapreduce/api.py -> build/lib.linux-aarch64-cpython-310/pydoop/mapreduce
      copying pydoop/mapreduce/connections.py -> build/lib.linux-aarch64-cpython-310/pydoop/mapreduce
      creating build/lib.linux-aarch64-cpython-310/pydoop/hdfs
      copying pydoop/hdfs/__init__.py -> build/lib.linux-aarch64-cpython-310/pydoop/hdfs
      copying pydoop/hdfs/file.py -> build/lib.linux-aarch64-cpython-310/pydoop/hdfs
      copying pydoop/hdfs/fs.py -> build/lib.linux-aarch64-cpython-310/pydoop/hdfs
      copying pydoop/hdfs/path.py -> build/lib.linux-aarch64-cpython-310/pydoop/hdfs
      copying pydoop/hdfs/common.py -> build/lib.linux-aarch64-cpython-310/pydoop/hdfs
      creating build/lib.linux-aarch64-cpython-310/pydoop/app
      copying pydoop/app/argparse_types.py -> build/lib.linux-aarch64-cpython-310/pydoop/app
      copying pydoop/app/submit.py -> build/lib.linux-aarch64-cpython-310/pydoop/app
      copying pydoop/app/__init__.py -> build/lib.linux-aarch64-cpython-310/pydoop/app
      copying pydoop/app/main.py -> build/lib.linux-aarch64-cpython-310/pydoop/app
      copying pydoop/app/script.py -> build/lib.linux-aarch64-cpython-310/pydoop/app
      copying pydoop/app/script_template.py -> build/lib.linux-aarch64-cpython-310/pydoop/app
      creating build/lib.linux-aarch64-cpython-310/pydoop/utils
      copying pydoop/utils/misc.py -> build/lib.linux-aarch64-cpython-310/pydoop/utils
      copying pydoop/utils/__init__.py -> build/lib.linux-aarch64-cpython-310/pydoop/utils
      copying pydoop/utils/conversion_tables.py -> build/lib.linux-aarch64-cpython-310/pydoop/utils
      copying pydoop/utils/py3compat.py -> build/lib.linux-aarch64-cpython-310/pydoop/utils
      copying pydoop/utils/jvm.py -> build/lib.linux-aarch64-cpython-310/pydoop/utils
      creating build/lib.linux-aarch64-cpython-310/pydoop/hdfs/core
      copying pydoop/hdfs/core/__init__.py -> build/lib.linux-aarch64-cpython-310/pydoop/hdfs/core
      copying pydoop/pydoop.properties -> build/lib.linux-aarch64-cpython-310/pydoop
      running build_ext
      checking for TLS support
      creating /tmp/pydoop_6tyh2mvj/tmp
      creating /tmp/pydoop_6tyh2mvj/tmp/pydoop_6tyh2mvj
      aarch64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/python3.10 -c /tmp/pydoop_6tyh2mvj/temp.c -o /tmp/pydoop_6tyh2mvj/tmp/pydoop_6tyh2mvj/temp.o
      building 'pydoop.native_core_hdfs' extension
      creating build/temp.linux-aarch64-cpython-310
      creating build/temp.linux-aarch64-cpython-310/src
      creating build/temp.linux-aarch64-cpython-310/src/libhdfs
      creating build/temp.linux-aarch64-cpython-310/src/libhdfs/common
      creating build/temp.linux-aarch64-cpython-310/src/libhdfs/os
      creating build/temp.linux-aarch64-cpython-310/src/libhdfs/os/posix
      creating build/temp.linux-aarch64-cpython-310/src/native_core_hdfs
      aarch64-linux-gnu-gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DHAVE_BETTER_TLS -I/usr/lib/jvm/java-8-openjdk-arm64/include -Inative/jni_include -I/usr/lib/jvm/java-8-openjdk-arm64/lib -I/usr/lib/jvm/java-8-openjdk-arm64/include/linux -Isrc/libhdfs -Isrc/libhdfs/include -Isrc/libhdfs/os/posix -I/usr/include/python3.10 -c src/libhdfs/common/htable.c -o build/temp.linux-aarch64-cpython-310/src/libhdfs/common/htable.o -Wno-write-strings
      aarch64-linux-gnu-gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DHAVE_BETTER_TLS -I/usr/lib/jvm/java-8-openjdk-arm64/include -Inative/jni_include -I/usr/lib/jvm/java-8-openjdk-arm64/lib -I/usr/lib/jvm/java-8-openjdk-arm64/include/linux -Isrc/libhdfs -Isrc/libhdfs/include -Isrc/libhdfs/os/posix -I/usr/include/python3.10 -c src/libhdfs/exception.c -o build/temp.linux-aarch64-cpython-310/src/libhdfs/exception.o -Wno-write-strings
      aarch64-linux-gnu-gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DHAVE_BETTER_TLS -I/usr/lib/jvm/java-8-openjdk-arm64/include -Inative/jni_include -I/usr/lib/jvm/java-8-openjdk-arm64/lib -I/usr/lib/jvm/java-8-openjdk-arm64/include/linux -Isrc/libhdfs -Isrc/libhdfs/include -Isrc/libhdfs/os/posix -I/usr/include/python3.10 -c src/libhdfs/hdfs.c -o build/temp.linux-aarch64-cpython-310/src/libhdfs/hdfs.o -Wno-write-strings
      aarch64-linux-gnu-gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DHAVE_BETTER_TLS -I/usr/lib/jvm/java-8-openjdk-arm64/include -Inative/jni_include -I/usr/lib/jvm/java-8-openjdk-arm64/lib -I/usr/lib/jvm/java-8-openjdk-arm64/include/linux -Isrc/libhdfs -Isrc/libhdfs/include -Isrc/libhdfs/os/posix -I/usr/include/python3.10 -c src/libhdfs/jni_helper.c -o build/temp.linux-aarch64-cpython-310/src/libhdfs/jni_helper.o -Wno-write-strings
      aarch64-linux-gnu-gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DHAVE_BETTER_TLS -I/usr/lib/jvm/java-8-openjdk-arm64/include -Inative/jni_include -I/usr/lib/jvm/java-8-openjdk-arm64/lib -I/usr/lib/jvm/java-8-openjdk-arm64/include/linux -Isrc/libhdfs -Isrc/libhdfs/include -Isrc/libhdfs/os/posix -I/usr/include/python3.10 -c src/libhdfs/os/posix/mutexes.c -o build/temp.linux-aarch64-cpython-310/src/libhdfs/os/posix/mutexes.o -Wno-write-strings
      aarch64-linux-gnu-gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DHAVE_BETTER_TLS -I/usr/lib/jvm/java-8-openjdk-arm64/include -Inative/jni_include -I/usr/lib/jvm/java-8-openjdk-arm64/lib -I/usr/lib/jvm/java-8-openjdk-arm64/include/linux -Isrc/libhdfs -Isrc/libhdfs/include -Isrc/libhdfs/os/posix -I/usr/include/python3.10 -c src/libhdfs/os/posix/thread.c -o build/temp.linux-aarch64-cpython-310/src/libhdfs/os/posix/thread.o -Wno-write-strings
      aarch64-linux-gnu-gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DHAVE_BETTER_TLS -I/usr/lib/jvm/java-8-openjdk-arm64/include -Inative/jni_include -I/usr/lib/jvm/java-8-openjdk-arm64/lib -I/usr/lib/jvm/java-8-openjdk-arm64/include/linux -Isrc/libhdfs -Isrc/libhdfs/include -Isrc/libhdfs/os/posix -I/usr/include/python3.10 -c src/libhdfs/os/posix/thread_local_storage.c -o build/temp.linux-aarch64-cpython-310/src/libhdfs/os/posix/thread_local_storage.o -Wno-write-strings
      aarch64-linux-gnu-gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DHAVE_BETTER_TLS -I/usr/lib/jvm/java-8-openjdk-arm64/include -Inative/jni_include -I/usr/lib/jvm/java-8-openjdk-arm64/lib -I/usr/lib/jvm/java-8-openjdk-arm64/include/linux -Isrc/libhdfs -Isrc/libhdfs/include -Isrc/libhdfs/os/posix -I/usr/include/python3.10 -c src/native_core_hdfs/hdfs_file.cc -o build/temp.linux-aarch64-cpython-310/src/native_core_hdfs/hdfs_file.o -Wno-write-strings
      aarch64-linux-gnu-gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DHAVE_BETTER_TLS -I/usr/lib/jvm/java-8-openjdk-arm64/include -Inative/jni_include -I/usr/lib/jvm/java-8-openjdk-arm64/lib -I/usr/lib/jvm/java-8-openjdk-arm64/include/linux -Isrc/libhdfs -Isrc/libhdfs/include -Isrc/libhdfs/os/posix -I/usr/include/python3.10 -c src/native_core_hdfs/hdfs_fs.cc -o build/temp.linux-aarch64-cpython-310/src/native_core_hdfs/hdfs_fs.o -Wno-write-strings
      aarch64-linux-gnu-gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DHAVE_BETTER_TLS -I/usr/lib/jvm/java-8-openjdk-arm64/include -Inative/jni_include -I/usr/lib/jvm/java-8-openjdk-arm64/lib -I/usr/lib/jvm/java-8-openjdk-arm64/include/linux -Isrc/libhdfs -Isrc/libhdfs/include -Isrc/libhdfs/os/posix -I/usr/include/python3.10 -c src/native_core_hdfs/hdfs_module.cc -o build/temp.linux-aarch64-cpython-310/src/native_core_hdfs/hdfs_module.o -Wno-write-strings
      aarch64-linux-gnu-g++ -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -g -fwrapv -O2 build/temp.linux-aarch64-cpython-310/src/libhdfs/common/htable.o build/temp.linux-aarch64-cpython-310/src/libhdfs/exception.o build/temp.linux-aarch64-cpython-310/src/libhdfs/hdfs.o build/temp.linux-aarch64-cpython-310/src/libhdfs/jni_helper.o build/temp.linux-aarch64-cpython-310/src/libhdfs/os/posix/mutexes.o build/temp.linux-aarch64-cpython-310/src/libhdfs/os/posix/thread.o build/temp.linux-aarch64-cpython-310/src/libhdfs/os/posix/thread_local_storage.o build/temp.linux-aarch64-cpython-310/src/native_core_hdfs/hdfs_file.o build/temp.linux-aarch64-cpython-310/src/native_core_hdfs/hdfs_fs.o build/temp.linux-aarch64-cpython-310/src/native_core_hdfs/hdfs_module.o -L/usr/lib/jvm/java-8-openjdk-arm64/Libraries -L/usr/lib/jvm/java-8-openjdk-arm64/jre/lib/aarch64/server -L/usr/lib/aarch64-linux-gnu -ldl -ljvm -o build/lib.linux-aarch64-cpython-310/pydoop/native_core_hdfs.cpython-310-aarch64-linux-gnu.so -Wl,-rpath,/usr/lib/jvm/java-8-openjdk-arm64/jre/lib/aarch64/server
      building 'pydoop.sercore' extension
      creating build/temp.linux-aarch64-cpython-310/src/sercore
      creating build/temp.linux-aarch64-cpython-310/src/sercore/HadoopUtils
      aarch64-linux-gnu-gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -Isrc/sercore/HadoopUtils -I/usr/include/python3.10 -c src/sercore/HadoopUtils/SerialUtils.cc -o build/temp.linux-aarch64-cpython-310/src/sercore/HadoopUtils/SerialUtils.o -Wno-write-strings -std=c++11 -O3
      src/sercore/HadoopUtils/SerialUtils.cc:21:10: fatal error: rpc/types.h: No such file or directory
         21 | #include <rpc/types.h>
            |          ^~~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/aarch64-linux-gnu-gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> pydoop

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
</code>```

I've tried upgrading and downgrading pip versions and I've tried everything that I could. I'm using python version 3.10.6 and pip version 22.3.1

Body:
I'm trying to install pydoop on my ubuntu but ended with the following errors.

note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pydoop
  Running setup.py clean for pydoop
Failed to build pydoop
Installing collected packages: pydoop
  Running setup.py install for pydoop ... error
  error: subprocess-exited-with-error

  × Running setup.py install for pydoop did not run successfully.
  │ exit code: 1
  ╰─> [79 lines of output]
      using setuptools version 65.6.3
      running install
      /home/manoj/.local/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.linux-aarch64-cpython-310
      creating build/lib.linux-aarch64-cpython-310/pydoop
      copying pydoop/config.py -> build/lib.linux-aarch64-cpython-310/pydoop
      copying pydoop/hadoop_utils.py -> build/lib.linux-aarch64-cpython-310/pydoop
      copying pydoop/hadut.py -> build/lib.linux-aarch64-cpython-310/pydoop
      copying pydoop/__init__.py -> build/lib.linux-aarch64-cpython-310/pydoop
      copying pydoop/test_support.py -> build/lib.linux-aarch64-cpython-310/pydoop
      copying pydoop/test_utils.py -> build/lib.linux-aarch64-cpython-310/pydoop
      copying pydoop/avrolib.py -> build/lib.linux-aarch64-cpython-310/pydoop
      copying pydoop/jc.py -> build/lib.linux-aarch64-cpython-310/pydoop
      copying pydoop/version.py -> build/lib.linux-aarch64-cpython-310/pydoop
      creating build/lib.linux-aarch64-cpython-310/pydoop/mapreduce
      copying pydoop/mapreduce/binary_protocol.py -> build/lib.linux-aarch64-cpython-310/pydoop/mapreduce
      copying pydoop/mapreduce/__init__.py -> build/lib.linux-aarch64-cpython-310/pydoop/mapreduce
      copying pydoop/mapreduce/pipes.py -> build/lib.linux-aarch64-cpython-310/pydoop/mapreduce
      copying pydoop/mapreduce/api.py -> build/lib.linux-aarch64-cpython-310/pydoop/mapreduce
      copying pydoop/mapreduce/connections.py -> build/lib.linux-aarch64-cpython-310/pydoop/mapreduce
      creating build/lib.linux-aarch64-cpython-310/pydoop/hdfs
      copying pydoop/hdfs/__init__.py -> build/lib.linux-aarch64-cpython-310/pydoop/hdfs
      copying pydoop/hdfs/file.py -> build/lib.linux-aarch64-cpython-310/pydoop/hdfs
      copying pydoop/hdfs/fs.py -> build/lib.linux-aarch64-cpython-310/pydoop/hdfs
      copying pydoop/hdfs/path.py -> build/lib.linux-aarch64-cpython-310/pydoop/hdfs
      copying pydoop/hdfs/common.py -> build/lib.linux-aarch64-cpython-310/pydoop/hdfs
      creating build/lib.linux-aarch64-cpython-310/pydoop/app
      copying pydoop/app/argparse_types.py -> build/lib.linux-aarch64-cpython-310/pydoop/app
      copying pydoop/app/submit.py -> build/lib.linux-aarch64-cpython-310/pydoop/app
      copying pydoop/app/__init__.py -> build/lib.linux-aarch64-cpython-310/pydoop/app
      copying pydoop/app/main.py -> build/lib.linux-aarch64-cpython-310/pydoop/app
      copying pydoop/app/script.py -> build/lib.linux-aarch64-cpython-310/pydoop/app
      copying pydoop/app/script_template.py -> build/lib.linux-aarch64-cpython-310/pydoop/app
      creating build/lib.linux-aarch64-cpython-310/pydoop/utils
      copying pydoop/utils/misc.py -> build/lib.linux-aarch64-cpython-310/pydoop/utils
      copying pydoop/utils/__init__.py -> build/lib.linux-aarch64-cpython-310/pydoop/utils
      copying pydoop/utils/conversion_tables.py -> build/lib.linux-aarch64-cpython-310/pydoop/utils
      copying pydoop/utils/py3compat.py -> build/lib.linux-aarch64-cpython-310/pydoop/utils
      copying pydoop/utils/jvm.py -> build/lib.linux-aarch64-cpython-310/pydoop/utils
      creating build/lib.linux-aarch64-cpython-310/pydoop/hdfs/core
      copying pydoop/hdfs/core/__init__.py -> build/lib.linux-aarch64-cpython-310/pydoop/hdfs/core
      copying pydoop/pydoop.properties -> build/lib.linux-aarch64-cpython-310/pydoop
      running build_ext
      checking for TLS support
      creating /tmp/pydoop_6tyh2mvj/tmp
      creating /tmp/pydoop_6tyh2mvj/tmp/pydoop_6tyh2mvj
      aarch64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/python3.10 -c /tmp/pydoop_6tyh2mvj/temp.c -o /tmp/pydoop_6tyh2mvj/tmp/pydoop_6tyh2mvj/temp.o
      building 'pydoop.native_core_hdfs' extension
      creating build/temp.linux-aarch64-cpython-310
      creating build/temp.linux-aarch64-cpython-310/src
      creating build/temp.linux-aarch64-cpython-310/src/libhdfs
      creating build/temp.linux-aarch64-cpython-310/src/libhdfs/common
      creating build/temp.linux-aarch64-cpython-310/src/libhdfs/os
      creating build/temp.linux-aarch64-cpython-310/src/libhdfs/os/posix
      creating build/temp.linux-aarch64-cpython-310/src/native_core_hdfs
      aarch64-linux-gnu-gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DHAVE_BETTER_TLS -I/usr/lib/jvm/java-8-openjdk-arm64/include -Inative/jni_include -I/usr/lib/jvm/java-8-openjdk-arm64/lib -I/usr/lib/jvm/java-8-openjdk-arm64/include/linux -Isrc/libhdfs -Isrc/libhdfs/include -Isrc/libhdfs/os/posix -I/usr/include/python3.10 -c src/libhdfs/common/htable.c -o build/temp.linux-aarch64-cpython-310/src/libhdfs/common/htable.o -Wno-write-strings
      aarch64-linux-gnu-gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DHAVE_BETTER_TLS -I/usr/lib/jvm/java-8-openjdk-arm64/include -Inative/jni_include -I/usr/lib/jvm/java-8-openjdk-arm64/lib -I/usr/lib/jvm/java-8-openjdk-arm64/include/linux -Isrc/libhdfs -Isrc/libhdfs/include -Isrc/libhdfs/os/posix -I/usr/include/python3.10 -c src/libhdfs/exception.c -o build/temp.linux-aarch64-cpython-310/src/libhdfs/exception.o -Wno-write-strings
      aarch64-linux-gnu-gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DHAVE_BETTER_TLS -I/usr/lib/jvm/java-8-openjdk-arm64/include -Inative/jni_include -I/usr/lib/jvm/java-8-openjdk-arm64/lib -I/usr/lib/jvm/java-8-openjdk-arm64/include/linux -Isrc/libhdfs -Isrc/libhdfs/include -Isrc/libhdfs/os/posix -I/usr/include/python3.10 -c src/libhdfs/hdfs.c -o build/temp.linux-aarch64-cpython-310/src/libhdfs/hdfs.o -Wno-write-strings
      aarch64-linux-gnu-gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DHAVE_BETTER_TLS -I/usr/lib/jvm/java-8-openjdk-arm64/include -Inative/jni_include -I/usr/lib/jvm/java-8-openjdk-arm64/lib -I/usr/lib/jvm/java-8-openjdk-arm64/include/linux -Isrc/libhdfs -Isrc/libhdfs/include -Isrc/libhdfs/os/posix -I/usr/include/python3.10 -c src/libhdfs/jni_helper.c -o build/temp.linux-aarch64-cpython-310/src/libhdfs/jni_helper.o -Wno-write-strings
      aarch64-linux-gnu-gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DHAVE_BETTER_TLS -I/usr/lib/jvm/java-8-openjdk-arm64/include -Inative/jni_include -I/usr/lib/jvm/java-8-openjdk-arm64/lib -I/usr/lib/jvm/java-8-openjdk-arm64/include/linux -Isrc/libhdfs -Isrc/libhdfs/include -Isrc/libhdfs/os/posix -I/usr/include/python3.10 -c src/libhdfs/os/posix/mutexes.c -o build/temp.linux-aarch64-cpython-310/src/libhdfs/os/posix/mutexes.o -Wno-write-strings
      aarch64-linux-gnu-gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DHAVE_BETTER_TLS -I/usr/lib/jvm/java-8-openjdk-arm64/include -Inative/jni_include -I/usr/lib/jvm/java-8-openjdk-arm64/lib -I/usr/lib/jvm/java-8-openjdk-arm64/include/linux -Isrc/libhdfs -Isrc/libhdfs/include -Isrc/libhdfs/os/posix -I/usr/include/python3.10 -c src/libhdfs/os/posix/thread.c -o build/temp.linux-aarch64-cpython-310/src/libhdfs/os/posix/thread.o -Wno-write-strings
      aarch64-linux-gnu-gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DHAVE_BETTER_TLS -I/usr/lib/jvm/java-8-openjdk-arm64/include -Inative/jni_include -I/usr/lib/jvm/java-8-openjdk-arm64/lib -I/usr/lib/jvm/java-8-openjdk-arm64/include/linux -Isrc/libhdfs -Isrc/libhdfs/include -Isrc/libhdfs/os/posix -I/usr/include/python3.10 -c src/libhdfs/os/posix/thread_local_storage.c -o build/temp.linux-aarch64-cpython-310/src/libhdfs/os/posix/thread_local_storage.o -Wno-write-strings
      aarch64-linux-gnu-gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DHAVE_BETTER_TLS -I/usr/lib/jvm/java-8-openjdk-arm64/include -Inative/jni_include -I/usr/lib/jvm/java-8-openjdk-arm64/lib -I/usr/lib/jvm/java-8-openjdk-arm64/include/linux -Isrc/libhdfs -Isrc/libhdfs/include -Isrc/libhdfs/os/posix -I/usr/include/python3.10 -c src/native_core_hdfs/hdfs_file.cc -o build/temp.linux-aarch64-cpython-310/src/native_core_hdfs/hdfs_file.o -Wno-write-strings
      aarch64-linux-gnu-gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DHAVE_BETTER_TLS -I/usr/lib/jvm/java-8-openjdk-arm64/include -Inative/jni_include -I/usr/lib/jvm/java-8-openjdk-arm64/lib -I/usr/lib/jvm/java-8-openjdk-arm64/include/linux -Isrc/libhdfs -Isrc/libhdfs/include -Isrc/libhdfs/os/posix -I/usr/include/python3.10 -c src/native_core_hdfs/hdfs_fs.cc -o build/temp.linux-aarch64-cpython-310/src/native_core_hdfs/hdfs_fs.o -Wno-write-strings
      aarch64-linux-gnu-gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DHAVE_BETTER_TLS -I/usr/lib/jvm/java-8-openjdk-arm64/include -Inative/jni_include -I/usr/lib/jvm/java-8-openjdk-arm64/lib -I/usr/lib/jvm/java-8-openjdk-arm64/include/linux -Isrc/libhdfs -Isrc/libhdfs/include -Isrc/libhdfs/os/posix -I/usr/include/python3.10 -c src/native_core_hdfs/hdfs_module.cc -o build/temp.linux-aarch64-cpython-310/src/native_core_hdfs/hdfs_module.o -Wno-write-strings
      aarch64-linux-gnu-g++ -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -g -fwrapv -O2 build/temp.linux-aarch64-cpython-310/src/libhdfs/common/htable.o build/temp.linux-aarch64-cpython-310/src/libhdfs/exception.o build/temp.linux-aarch64-cpython-310/src/libhdfs/hdfs.o build/temp.linux-aarch64-cpython-310/src/libhdfs/jni_helper.o build/temp.linux-aarch64-cpython-310/src/libhdfs/os/posix/mutexes.o build/temp.linux-aarch64-cpython-310/src/libhdfs/os/posix/thread.o build/temp.linux-aarch64-cpython-310/src/libhdfs/os/posix/thread_local_storage.o build/temp.linux-aarch64-cpython-310/src/native_core_hdfs/hdfs_file.o build/temp.linux-aarch64-cpython-310/src/native_core_hdfs/hdfs_fs.o build/temp.linux-aarch64-cpython-310/src/native_core_hdfs/hdfs_module.o -L/usr/lib/jvm/java-8-openjdk-arm64/Libraries -L/usr/lib/jvm/java-8-openjdk-arm64/jre/lib/aarch64/server -L/usr/lib/aarch64-linux-gnu -ldl -ljvm -o build/lib.linux-aarch64-cpython-310/pydoop/native_core_hdfs.cpython-310-aarch64-linux-gnu.so -Wl,-rpath,/usr/lib/jvm/java-8-openjdk-arm64/jre/lib/aarch64/server
      building 'pydoop.sercore' extension
      creating build/temp.linux-aarch64-cpython-310/src/sercore
      creating build/temp.linux-aarch64-cpython-310/src/sercore/HadoopUtils
      aarch64-linux-gnu-gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -Isrc/sercore/HadoopUtils -I/usr/include/python3.10 -c src/sercore/HadoopUtils/SerialUtils.cc -o build/temp.linux-aarch64-cpython-310/src/sercore/HadoopUtils/SerialUtils.o -Wno-write-strings -std=c++11 -O3
      src/sercore/HadoopUtils/SerialUtils.cc:21:10: fatal error: rpc/types.h: No such file or directory
         21 | #include <rpc/types.h>
            |          ^~~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/aarch64-linux-gnu-gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> pydoop

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

I've tried upgrading and downgrading pip versions and I've tried everything that I could. I'm using python version 3.10.6 and pip version 22.3.1


来源: stackexchange

问:
Is there a way to simulate A4 pages breaks in React?
I have a Page component in my React application with the size of A4 page. Inside this Page component I have multiple different nested children. However I came across a problem.

Problem lays when children of one Page component overflow it's height. How can I create another instance of Page component and move children that are overflowing to that component. Also, if possible, for solution to be recursive because n Page component can also have children that are overflowing it's height.

I tried multiple different solutions but all of them were either ineffective or full of bugs.

I have a page component:

```<code>const Page = ({ children }) => {
    return <div style={{ width: A4.width, height: A4.height }}> {children} </div>
}
</code>```

And this is in some particular container:

```<code>const Container = () => {
    return (
        <Page>
            <div className="child" />
            <div className="child" />

            {/* This should be moved into another Page instance programmatically */}
            <div className="child" />
        </Page>
    }
}
</code>```

And this is my CSS:

.child {
    position: relative;
    width: 100%;
    height: 50%;
    border: 2px solid black;
}
```

NOTE: This question does not refer and is not identical as this one: How to make a HTML Page in A4 paper size page(s)?
I need a way to dynamically create containers and append children from previous containers that are overflowing the height of said previous containers.

ContentLicense: CC BY-SA 4.0

Body:
I have a Page component in my React application with the size of A4 page. Inside this Page component I have multiple different nested children. However I came across a problem.

Problem lays when children of one Page component overflow it's height. How can I create another instance of Page component and move children that are overflowing to that component. Also, if possible, for solution to be recursive because n Page component can also have children that are overflowing it's height.

I tried multiple different solutions but all of them were either ineffective or full of bugs.

I have a page component:

const Page = ({ children }) => {
    return
 {children}

}

And this is in some particular container:

const Container = () => {
    return (
        <Page>

            {/* This should be moved into another Page instance programmatically */}

        </Page>
    }
}

And this is my CSS:

.child {
    position: relative;
    width: 100%;
    height: 50%;
    border: 2px solid black;
}

NOTE: This question does not refer and is not identical as this one: How to make a HTML Page in A4 paper size page(s)?
I need a way to dynamically create containers and append children from previous containers that are overflowing the height of said previous containers.


问:
Detecting the lines (structure edges) in a charcoal drawing image
I want to detect the all lines of a structure's edges but I can't detect every line. Does anyone know how to do that?

I want to detect lines in this picture but it's really noisy and I can't detect every line. I tried denoising, blurring and other things then I used canny line detection but it didn't find every line.

Here is the original image:

I want to detect every edge of those structures.
Can anyone do that?

I got this with denoising:

My code:

```<code>
gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
denoised = cv2.fastNlMeansDenoising(gray_image,None,20)
blur_image = cv2.medianBlur(denoised,5)
cv2.imshow('blur_image 2',blur_image)
edges = cv2.Canny(blur, 40, 255)
cv2.imshow('canny_image',edges)

# Hough Transform
lines = cv2.HoughLinesP(edges, 1, np.pi/180, 50, minLineLength=50, maxLineGap=10)

</code>```

Can anyone help me?

Body:
I want to detect the all lines of a structure's edges but I can't detect every line. Does anyone know how to do that?

I want to detect lines in this picture but it's really noisy and I can't detect every line. I tried denoising, blurring and other things then I used canny line detection but it didn't find every line.

Here is the original image:

I want to detect every edge of those structures.
Can anyone do that?

I got this with denoising:

My code:

gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
denoised = cv2.fastNlMeansDenoising(gray_image,None,20)
blur_image = cv2.medianBlur(denoised,5)
cv2.imshow('blur_image 2',blur_image)
edges = cv2.Canny(blur, 40, 255)
cv2.imshow('canny_image',edges)

# Hough Transform
lines = cv2.HoughLinesP(edges, 1, np.pi/180, 50, minLineLength=50, maxLineGap=10)

Can anyone help me?


问:
AnyLogic population cannot enter process -> location of agents missing
I created a model in which transporters should arrive at the same time as a dataset I collected in real-life. But when I run my model, the following Error occurs:

```<code>Exception during discrete event execution:
root.<population>[0]:
This agent isn't located in any space
</code>```

My steps until now:

Create a population with agents of the type of my agents and fill them with the values of my data

create an event which checks every minute for all objects of my population if their arrival time equals the models time

Write a function that enters them into my process and on the road to come to my factory

Therefor every transporter exists already before being entered into my process so that the event can check the condition.

My problem:
When the condition is true and the object should enter my process an error occurs:

```<code>Exception during discrete event execution:
    root.<population>[0]:
    This agent isn't located in any space
</code>```

Other times when I run the model, this error occurs:

```<code>root.mplkws[-1]:
This agent is already defined as agent living in space 'Discrete 2D' and can't have behaviour for space 'Continuous'
</code>```

I don't understand why they dont have their initial space already. Everything was created in the Main method and I dont know how and where to change the populations agents location
I tried to set the space on the enter block with agent.setSpace(getSpace())but nothing changed.

Body:
I created a model in which transporters should arrive at the same time as a dataset I collected in real-life. But when I run my model, the following Error occurs:

Exception during discrete event execution:
root.<population>[0]:
This agent isn't located in any space

My steps until now:

Create a population with agents of the type of my agents and fill them with the values of my data

create an event which checks every minute for all objects of my population if their arrival time equals the models time

Write a function that enters them into my process and on the road to come to my factory

Therefor every transporter exists already before being entered into my process so that the event can check the condition.

My problem:
When the condition is true and the object should enter my process an error occurs:

Exception during discrete event execution:
    root.<population>[0]:
    This agent isn't located in any space

Other times when I run the model, this error occurs:

root.mplkws[-1]:
This agent is already defined as agent living in space 'Discrete 2D' and can't have behaviour for space 'Continuous'

I don't understand why they dont have their initial space already. Everything was created in the Main method and I dont know how and where to change the populations agents location
I tried to set the space on the enter block with agent.setSpace(getSpace())but nothing changed.


问:
How to separate html hints
I’m 15 years old and besides from English I also started to study French. I am using a flashcard app which is called as Anki for learning French vocabulary.So I downloaded an awesome deck for enhancing my vocabulary, then I partly redesigned it for my needs.
There are example sentences for most of the cards. On computer it works very well with no mistake. But when it comes to Ankidroid (mobile version of Anki app) it doesn’t show me example sentence section.

For example it is the first view when I look at the backside of my card:
First view

You may see “show exs” button when I click it, it shows up the example French sentence
Here is when I look at the French example sentence:Example french sentence without translation

And when you may see “answer” button pops out when I click “show exs” button.
Here what it looks like when I click answer button:
Translated example french sentence

Please come to me with a solution :) On desktop it has no problem. On Ankidroid media has no problem either. When I check card fields, example sentence section is there. But it doesn’t even appear.
I will be very contented if you can help.

And I don't expect you to know what Anki is etc. I think my problem is because of that Translation is under the untranslated button. If someone who knows html can make "translation" button a separate one just like "wiki" button, it will be solved :)

Here is the code of backside of my card:

```<code><hr id=answer>

{{type:Word with article}} <br>

{{Word with article}} <br> {{Noun declension}}<br>

{{Parisian French Audio (Voice 1)}}

<i><gr>
   <div id="aa" style="display:none">
 audio: {{Word with declinations}}</div>
</i></gr>
<p>

<div id="basicm">{{Basic meanings of word}}<br></div>

<!------------------------------------------------>
<!------------------------------------------------>
<!------------------------------------------------>

<div id="buttonsBox">

<button onclick="ShowWikt()">wikt</button>

<button id="button"  onclick="ShowExs()" style="display:none">show example</button><br>

<button id="answerButton" onclick="ShowExsTrans()" style="display:none">translation</button><br>

</div>
<span id='a'> </span>
<!------------------------------------------------>
<!------------------------------------------------>
<!------------------------------------------------>

<script>
//  document.getElementById("a").textContent=document.getElementById("exsents").innerHTML.length<1;
  var answerShown = 0;

if (document.getElementById("exsents").innerHTML.length <1){
  document.getElementById('button').style.display="none";
} else {
  document.getElementById('button').style.display="";
}

<!-------><!-------><!-------><!------->
<!--check whether the audio transcript shows or not--!>
var transcript = document.getElementById("tags").innerHTML;

if (transcript.indexOf("adj")>-1){
  document.getElementById("aa").style.display = "";
}
<!-------><!-------><!-------><!------->

function ShowWikt() {
  document.getElementById("showWikt").style.display = "";
  document.getElementById("showExs").style.display = "none";
}

function ShowExs() {
  if (document.getElementById("showExs").style.display != "") {
    document.getElementById("showWikt").style.display = "none";
    document.getElementById("showExs").style.display = "";

    if (answerShown == 0) {
      document.getElementById("answerButton").style.display = "";
      answerShown = 1;
    }
  }
}

function ShowExsTrans() {
  document.getElementById("ExsNoTrans").style.display = "none";
  document.getElementById("answerButton").style.display = "none";
  document.getElementById("ExsTrans").style.display = "";
}

</script>
<!------------------------------------------------>
<!------------------------------------------------>
<!------------------------------------------------>

<!------------------------------------------------>
<div id="showWikt" style="display:none">
{{Wiktionary entry}}
</div>
<!------------------------------------------------>
<div id="showExs" style="display:none">

  <!---->
  <div id="ExsNoTrans">
    {{Example sentences without translation}}
  </div>
  <!---->
  <div id="ExsTrans" style="display:none">
    {{Example sentences}}
  </div>
  <!---->

</div>
<!------------------------------------------------>

<!------------------------------------------------>

<span id='exsents' style="display:none">{{Example sentences}}</span>

<div id="tags" style=" display:none">{{Tags}}</div>
</code>```

I tried to change html by my own but each time I failed.

Title: How to separate html hints

Body:
I’m 15 years old and besides from English I also started to study French. I am using a flashcard app which is called as Anki for learning French vocabulary.So I downloaded an awesome deck for enhancing my vocabulary, then I partly redesigned it for my needs.
There are example sentences for most of the cards. On computer it works very well with no mistake. But when it comes to Ankidroid (mobile version of Anki app) it doesn’t show me example sentence section.

For example it is the first view when I look at the backside of my card:
First view

You may see “show exs” button when I click it, it shows up the example French sentence
Here is when I look at the French example sentence:Example french sentence without translation

And when you may see “answer” button pops out when I click “show exs” button.
Here what it looks like when I click answer button:
Translated example french sentence

Please come to me with a solution :) On desktop it has no problem. On Ankidroid media has no problem either. When I check card fields, example sentence section is there. But it doesn’t even appear.
I will be very contented if you can help.

And I don't expect you to know what Anki is etc. I think my problem is because of that Translation is under the untranslated button. If someone who knows html can make "translation" button a separate one just like "wiki" button, it will be solved :)

Here is the code of backside of my card:

{{type:Word with article}}

{{Word with article}}
 {{Noun declension}}

{{Parisian French Audio (Voice 1)}}

<gr>

 audio: {{Word with declinations}}

</gr>

{{Basic meanings of word}}

<button onclick="ShowWikt()">wikt</button>

<button id="button"  onclick="ShowExs()" style="display:none">show example</button>

<button id="answerButton" onclick="ShowExsTrans()" style="display:none">translation</button>

{{Wiktionary entry}}

    {{Example sentences without translation}}

    {{Example sentences}}

{{Example sentences}}

{{Tags}}

I tried to change html by my own but each time I failed.


问:
All arbitrary object properties are a string except a few
I would like to do something like this

interface Foo {
  firstException: number;
  secondException: string[];

  [key: string]: string; // doesn't do what I want
}
```
<p>But the last line causes type errors</p>
<pre class="lang-none prettyprint-override"><code>Property 'firstException' of type 'number' is not assignable to 'string' index type 'string'.
</code>```

I have to do [key: string]: any; or [key: string]: unknown;. I could also do [key: string]: string | number | string[]; but then I'll have to check the type any time I access a property.

Is there a way to say that all keys that are not explicitly defined will hold string values?

Body:
I would like to do something like this

interface Foo {
  firstException: number;
  secondException: string[];

  [key: string]: string; // doesn't do what I want
}

But the last line causes type errors

Property 'firstException' of type 'number' is not assignable to 'string' index type 'string'.

I have to do [key: string]: any; or [key: string]: unknown;. I could also do [key: string]: string | number | string[]; but then I'll have to check the type any time I access a property.

Is there a way to say that all keys that are not explicitly defined will hold string values?


问:
How to fix Flutter app showing in foreground when phone screen is locked
I had a problem during the development of my mobile application in flutter. My app was always in the foreground (even when the phone was locked).

If this happens to you, I have the solution for you:

1- Open your AndroidManifest.xml file.
2- Find your app's activity tag.
3- Change the value of the android:showWhenLocked attribute to false to indicate that your app should not be displayed in the foreground when the phone screen is locked.

The code :
android:showWhenLocked="false"


问:
Apollo client fetchMore not updating data cache [Nextjs]?
I am try to use @apollo/client in my nextjs application (only frontend). My backend is done using nestjs-graphql. I am facing one problem using @apollo/client.

Here is my code-

client.ts

```<code>//Initialize apolloClient
let apolloClient: ApolloClient<NormalizedCacheObject>;

//Creating link
function createIsomorphLink() {
    return new HttpLink({
        uri: "http://localhost:5000/piechat",
        credentials: 'same-origin'
    })
}

//Create apollo client
function createApolloClient() {
    return new ApolloClient({
        ssrMode: true,
        link: createIsomorphLink(),
        cache: new InMemoryCache()
    })
}

//Initialize Apollo
export function initializeApollo(initialState = null) {
    const _apolloClient = apolloClient ?? createApolloClient()
    if (initialState) {
        const existingCache = _apolloClient.extract()
        const data = merge(initialState, existingCache)
        _apolloClient.cache.restore(data)
    }
    if (!apolloClient) apolloClient = _apolloClient
    return _apolloClient
}

//Use Apollo
export function useApollo(initialState = null) {
    const store = useMemo(() => initializeApollo(initialState), [initialState])
    return store
}
</code>```

Then in nextjs getServerSideProps-

```<code>export const getServerSideProps: GetServerSideProps = async (ctx) => {
  const apolloClient = initializeApollo()
  await apolloClient.query({
    query: GET_CONVERSATION_LIST,
    context: { headers: { authorization: `Bearer ${ctx.req.cookies["session"]}` } },
    errorPolicy: "all"
  })
  return {
    props: {
      initialApolloState: apolloClient.cache.extract(),
    }
  }
}
</code>```

Then in one conversation.tsx(I use this data)-

```<code>const { data } = useQuery<GetConversationData>(GET_CONVERSATION_LIST);
</code>```

On the other component (createConver.tsx) I use fetchMore function-

```<code>const { fetchMore } = useQuery(GET_CONVERSATION_LIST)

useEffect(() => {
    if (data) { //If new data creation is success
        fetchMore({
            context: { headers: { authorization: `Bearer ${getCookie("session")}` } }, updateQuery(_, { fetchMoreResult }) {
                return fetchMoreResult
            }
        })
    }
}, [data])
</code>```

Everything is well. But when I refresh my page, I see that new data not comes. please see this gif- enter image description here

But I am not understanding what is the problem. I am not getting any docs or any things else. Please help me anyone.

Body:
I am try to use @apollo/client in my nextjs application (only frontend). My backend is done using nestjs-graphql. I am facing one problem using @apollo/client.

Here is my code-

client.ts

//Initialize apolloClient
let apolloClient: ApolloClient<NormalizedCacheObject>;

//Creating link
function createIsomorphLink() {
    return new HttpLink({
        uri: "http://localhost:5000/piechat",
        credentials: 'same-origin'
    })
}

//Create apollo client
function createApolloClient() {
    return new ApolloClient({
        ssrMode: true,
        link: createIsomorphLink(),
        cache: new InMemoryCache()
    })
}

//Initialize Apollo
export function initializeApollo(initialState = null) {
    const _apolloClient = apolloClient ?? createApolloClient()
    if (initialState) {
        const existingCache = _apolloClient.extract()
        const data = merge(initialState, existingCache)
        _apolloClient.cache.restore(data)
    }
    if (!apolloClient) apolloClient = _apolloClient
    return _apolloClient
}

//Use Apollo
export function useApollo(initialState = null) {
    const store = useMemo(() => initializeApollo(initialState), [initialState])
    return store
}

Then in nextjs getServerSideProps-

export const getServerSideProps: GetServerSideProps = async (ctx) => {
  const apolloClient = initializeApollo()
  await apolloClient.query({
    query: GET_CONVERSATION_LIST,
    context: { headers: { authorization: `Bearer ${ctx.req.cookies["session"]}` } },
    errorPolicy: "all"
  })
  return {
    props: {
      initialApolloState: apolloClient.cache.extract(),
    }
  }
}

Then in one conversation.tsx(I use this data)-

const { data } = useQuery<GetConversationData>(GET_CONVERSATION_LIST);

On the other component (createConver.tsx) I use fetchMore function-

const { fetchMore } = useQuery(GET_CONVERSATION_LIST)

useEffect(() => {
    if (data) { //If new data creation is success
        fetchMore({
            context: { headers: { authorization: `Bearer ${getCookie("session")}` } }, updateQuery(_, { fetchMoreResult }) {
                return fetchMoreResult
            }
        })
    }
}, [data])

Everything is well. But when I refresh my page, I see that new data not comes. please see this gif- enter image description here

But I am not understanding what is the problem. I am not getting any docs or any things else. Please help me anyone.


问:
OMNeT++ changing channel throughput sliding window default parameters in INET
Using the Measuring Channel Throughput tutorial, I am unable to locate the method to change the interval ([s]) and numValueLimit parameters.  When used in the INI file, I get the following error: Entry potentially does not match any parameters.

The tutorial states

Channel throughput is a statistic of transmitter modules, such as the PacketTransmitter in LayeredEthernetPhy. Throughput is measured with a sliding window. By default, the window is 0.1s or 100 packets, whichever comes first. The parameters of the window, such as the window interval, are configurable from the ini file, as module.statistic.parameter. For example:

*.host.eth[0].phyLayer.transmitter.throughput.interval = 0.2s

When I run the tutorial out of the box and allow ~50 packet transmissions, the throughput vector:
ChannelThroughputMeasurementShowcase.destination.eth[0].phyLayer.receiver has only one entry in the throughput:vector which is ~44 Mbps.
From what I can tell, this is an average from multiple measurements based on this sliding window.

What I would like to do is change this sliding window so that I can get more values in the vector based on the described settings.

Have these values been depreciated in this new version of OMNeT/INET?

I'm using INET version: inet-4.4.1-302861f35c along with OMNet++ Version: 6.0, Build id: 220413-71d8fab425


问:
unable to connect django sevice with rabbitmq service using docker
I am trying to connect RabbitMQ with Django application. But when I run the command "docker-compose up" I get this error "pika.exceptions.AMQPConnectionError" can someone explain me the reason for this error and also suggest me its solution. I am sharing the code of docker-compose file and the publisher code where the main error is.

docker-compose.yml

```<code>version: '3.8'
services:
  db:
    image: postgres:9.6-alpine
    restart: always
    environment:
#      - HOST:localhost
      - POSTGRES_DB=admin
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=admin123
#      MYSQL_ROOT_PASSWORD: root
    volumes:
      - ./postgres-data:/var/lib/postgresql/data
    ports:
      - 5432:5432

  rabbitmq:
    image: rabbitmq:3.8-management-alpine
    hostname: rabbitmq
    ports:
      - 15673:15672
    environment:
      - RABBITMQ_DEFAULT_HOST=localhost
      - RABBITMQ_DEFAULT_USER=guest
      - RABBITMQ_DEFAULT_PASS=guest

  backend:
    build:
      context: .
      dockerfile: Dockerfile
    command: python manage.py runserver 0.0.0.0:8000
    ports:
      - 8000:8000
    volumes:
      - .:/app
    environment:
      - RABBITMQ_DEFAULT_HOST=rabbitmq
      - RABBITMQ_DEFAULT_USER=guest
      - RABBITMQ_DEFAULT_PASS=guest

    depends_on:
      - db
      - rabbitmq
</code>```

produce.py

```<code>import pika, os, django
from .models import Product

# amqps://bescccok:rsjlBxeksDvwcp23H0QDJh83qttksbsF@sparrow.rmq.cloudamqp.com/bescccok

connection = pika.BlockingConnection(
    pika.ConnectionParameters('localhost')
)

channel = connection.channel()

def callback(ch, method, properties, body):
    import json
    print('Received in admin')
    id = json.loads(body)
    product = Product.objects.get(id=id)
    product.likes = product.likes + 1
    print("Product Liked!!! ")

channel.basic_consume(queue='admin', on_message_callback=callback, auto_ack=True)

print("Started Consuming")

channel.start_consuming()

channel.close()

</code>```

I tried to changing the hostname in docker-compose file in rabbitmq service and add the servicein pika connection function, still it didn't work.

Body:
I am trying to connect RabbitMQ with Django application. But when I run the command "docker-compose up" I get this error "pika.exceptions.AMQPConnectionError" can someone explain me the reason for this error and also suggest me its solution. I am sharing the code of docker-compose file and the publisher code where the main error is.

docker-compose.yml

version: '3.8'
services:
  db:
    image: postgres:9.6-alpine
    restart: always
    environment:
#      - HOST:localhost
      - POSTGRES_DB=admin
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=admin123
#      MYSQL_ROOT_PASSWORD: root
    volumes:
      - ./postgres-data:/var/lib/postgresql/data
    ports:
      - 5432:5432

  rabbitmq:
    image: rabbitmq:3.8-management-alpine
    hostname: rabbitmq
    ports:
      - 15673:15672
    environment:
      - RABBITMQ_DEFAULT_HOST=localhost
      - RABBITMQ_DEFAULT_USER=guest
      - RABBITMQ_DEFAULT_PASS=guest

  backend:
    build:
      context: .
      dockerfile: Dockerfile
    command: python manage.py runserver 0.0.0.0:8000
    ports:
      - 8000:8000
    volumes:
      - .:/app
    environment:
      - RABBITMQ_DEFAULT_HOST=rabbitmq
      - RABBITMQ_DEFAULT_USER=guest
      - RABBITMQ_DEFAULT_PASS=guest

    depends_on:
      - db
      - rabbitmq

produce.py

import pika, os, django
from .models import Product

# amqps://bescccok:rsjlBxeksDvwcp23H0QDJh83qttksbsF@sparrow.rmq.cloudamqp.com/bescccok

connection = pika.BlockingConnection(
    pika.ConnectionParameters('localhost')
)

channel = connection.channel()

def callback(ch, method, properties, body):
    import json
    print('Received in admin')
    id = json.loads(body)
    product = Product.objects.get(id=id)
    product.likes = product.likes + 1
    print("Product Liked!!! ")

channel.basic_consume(queue='admin', on_message_callback=callback, auto_ack=True)

print("Started Consuming")

channel.start_consuming()

channel.close()

I tried to changing the hostname in docker-compose file in rabbitmq service and add the servicein pika connection function, still it didn't work.


问:
send 2 value in form with dropzone js
Hi I want send value(product_id, order_id) to database along with upload image
but only image upload because my form doesnt have any button sumit
is there any way to add id along with image?</p>
```<code> <script>
    Dropzone.autoDiscover = false;
    var photosGallery = []

    var drop = new Dropzone('#photog', {
        addRemoveLinks: true,
        url: "{{ route('front.photouser.upload') }}",
        type:"POST",

        sending: function(file, xhr, formData){
            formData.append("_token","{{csrf_token()}}")
        },
        success: function(file, response){
            photosGallery.push(response.original_name)
            if (response['level'] == 1) {
                $('.level1_message').html(response['message']);

            }

        }

    });
    productGallery = function(){
        document.getElementById('product-photo').value = photosGallery
    }

</script>

<form  action="{{route('front.photouser.upload')}}" class="dropzone" method="post"  id="my-great-dropzone" data-id="{{Auth::user()->id}}" enctype="multipart/form-data">
                       @csrf
                       <input type="hidden" name="original_name[]" id="product-photo">
                       <input name="product_id"  value="{{$product->id}}" type="hidden"  id="product_id" >
                       <input name="product_pivot"  value="{{$product->pivot->id}}" type="hidden"  id="product_pivot" >
                       <div class="form-group">
                           <input type="hidden" name="original_name[]" id="product-photo">
                           <div id="photog" class="dropzone"></div>
                       </div>
                   </form>
</code>```

Title: send 2 value in form with dropzone js

Body:
Hi I want send value(product_id, order_id) to database along with upload image
but only image upload because my form doesnt have any button sumit
is there any way to add id along with image?

<form  action="{{route('front.photouser.upload')}}" class="dropzone" method="post"  id="my-great-dropzone" data-id="{{Auth::user()->id}}" enctype="multipart/form-data">
                       @csrf
                       <input type="hidden" name="original_name[]" id="product-photo">
                       <input name="product_id"  value="{{$product->id}}" type="hidden"  id="product_id" >
                       <input name="product_pivot"  value="{{$product->pivot->id}}" type="hidden"  id="product_pivot" >

                           <input type="hidden" name="original_name[]" id="product-photo">

                   </form>


问:
How to update Message Activity without refresh?
I am making app where users can chat with each other in app , but the problem is when user send message it doesn't appear in chat box until user refresh the activity . how can i update chat without refresh ?

this is my code

```<code> ParseQuery<Message> parseQuery = ParseQuery.getQuery(Message.class);
    subscriptionHandling = parseLiveQueryClient.subscribe(parseQuery);
    subscriptionHandling.handleEvent(SubscriptionHandling.Event.CREATE, new SubscriptionHandling.HandleEventCallback<Message>() {
        @Override
        public void onEvent(ParseQuery<Message> query, final Message message) {
            // HANDLING create event
            getActivity().runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    mList.add(message);
                    msgAdapter.notifyDataSetChanged();
                    show_message.scrollToPosition(mList.size() - 1);
                }
            });

public void onEvent(ParseQuery<Message> query, Message message) {
            getActivity().runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    mList.clear();
                    getData();
                }
            });

public void onClick(View v) {
            Message msg = parseMessenger.SendMessage(send_txt.getText().toString(), null, new SaveCallback() {
                @Override
                public void done(ParseException e) {
                    send_txt.setText("");
                }
            }, new SendCallback() {
                @Override
                public void done(ParseException e) {
                }
            });
            if (mList == null) {
                mList = new ArrayList<Message>();
            }
        }
    });
    getData();

 private void getData() {
    ParseQuery<Message> messageFromQuery = Message.getAllMessage();
    messageFromQuery.whereEqualTo(Message.COL_USER_FROM, userFrom);
    messageFromQuery.whereEqualTo(Message.COL_USER_TO, userTo);
    ParseQuery<Message> messageToQuery = Message.getAllMessage();
    messageToQuery.whereEqualTo(Message.COL_USER_TO, userFrom);
    messageToQuery.whereEqualTo(Message.COL_USER_FROM, userTo);
    List<ParseQuery<Message>> messageQueries = new ArrayList<ParseQuery<Message>>();
    messageQueries.add(messageFromQuery);
    messageQueries.add(messageToQuery);
    ParseQuery<Message> messageQuery = ParseQuery.or(messageQueries);
    messageQuery.orderByAscending("createdAt");
    messageQuery.findInBackground(new FindCallback<Message>() {
        @Override
        public void done(List<Message> messages, ParseException e) {
            if (messages != null) {
                mList.clear();
                mList.addAll(messages);
                msgAdapter = new MsgAdapter(requireContext(), mList, userTo.getObjectId(), userTo);
                show_message.setAdapter(msgAdapter);
                show_message.scrollToPosition(mList.size() - 1);
            }
        }
    });

}
</code>```

i can add auto refresh when send button is clicked but i don't want so , it will not look nice when users use it .. please help

Body:
I am making app where users can chat with each other in app , but the problem is when user send message it doesn't appear in chat box until user refresh the activity . how can i update chat without refresh ?

this is my code

 ParseQuery<Message> parseQuery = ParseQuery.getQuery(Message.class);
    subscriptionHandling = parseLiveQueryClient.subscribe(parseQuery);
    subscriptionHandling.handleEvent(SubscriptionHandling.Event.CREATE, new SubscriptionHandling.HandleEventCallback<Message>() {
        @Override
        public void onEvent(ParseQuery<Message> query, final Message message) {
            // HANDLING create event
            getActivity().runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    mList.add(message);
                    msgAdapter.notifyDataSetChanged();
                    show_message.scrollToPosition(mList.size() - 1);
                }
            });

public void onEvent(ParseQuery<Message> query, Message message) {
            getActivity().runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    mList.clear();
                    getData();
                }
            });

public void onClick(View v) {
            Message msg = parseMessenger.SendMessage(send_txt.getText().toString(), null, new SaveCallback() {
                @Override
                public void done(ParseException e) {
                    send_txt.setText("");
                }
            }, new SendCallback() {
                @Override
                public void done(ParseException e) {
                }
            });
            if (mList == null) {
                mList = new ArrayList<Message>();
            }
        }
    });
    getData();

 private void getData() {
    ParseQuery<Message> messageFromQuery = Message.getAllMessage();
    messageFromQuery.whereEqualTo(Message.COL_USER_FROM, userFrom);
    messageFromQuery.whereEqualTo(Message.COL_USER_TO, userTo);
    ParseQuery<Message> messageToQuery = Message.getAllMessage();
    messageToQuery.whereEqualTo(Message.COL_USER_TO, userFrom);
    messageToQuery.whereEqualTo(Message.COL_USER_FROM, userTo);
    List<ParseQuery<Message>> messageQueries = new ArrayList<ParseQuery<Message>>();
    messageQueries.add(messageFromQuery);
    messageQueries.add(messageToQuery);
    ParseQuery<Message> messageQuery = ParseQuery.or(messageQueries);
    messageQuery.orderByAscending("createdAt");
    messageQuery.findInBackground(new FindCallback<Message>() {
        @Override
        public void done(List<Message> messages, ParseException e) {
            if (messages != null) {
                mList.clear();
                mList.addAll(messages);
                msgAdapter = new MsgAdapter(requireContext(), mList, userTo.getObjectId(), userTo);
                show_message.setAdapter(msgAdapter);
                show_message.scrollToPosition(mList.size() - 1);
            }
        }
    });

}

i can add auto refresh when send button is clicked but i don't want so , it will not look nice when users use it .. please help


问:
Conditional Formatting: Highlight cells of a range if cell equal to any values of an array
I would like to streamline the visualization of scales in the guitar fretboard.
However, I can't overcome the current problem

From the range B3:S8 (the entire fretboard) I would like to highlight the cells which match with the values of the range W3:W9 (the C major scale)

I've found some intermediate solutions, where I would need to repeat it for each line of the range of the fret.

Seeking now a way where the whole fret range would match an one dimension array of values.


问:
Suggest ways to delete folders from local without delete github repo and already pushed files?
Just                                                                                After creating a static html web project I used to create one repo in github and push the following files in ->main branch. After that I want to delete the project folder from my computer. I used -rm and other  commands too. But whenever I pushed the changes into git repo my folder along with files in git repo deleted immediately. Can you please solve the problem or suggest some commands ?</p>


问:
Bash: decode string with url escaped hex codes
I am curl-ing webpage titles, some of them contain escaped characters (HEX code?), most likely coming from Wordpress esc_url() https://developer.wordpress.org/reference/functions/esc_url/

```<code># title=$(curl -s $theurl | grep -o "<title>[^<]*" | tail -c+8)
title='Questions & Answers'
touch $title'.txt'
</code>```

How can I UN-escape or decode these back, without having to make a list and replace them

```<code>& = Ampersand
’ = Right Single Quotation Mark
- = Hyphen-Minus
...
</code>```

Body:
I am curl-ing webpage titles, some of them contain escaped characters (HEX code?), most likely coming from Wordpress esc_url() https://developer.wordpress.org/reference/functions/esc_url/

# title=$(curl -s $theurl | grep -o "<title>[^<]*" | tail -c+8)
title='Questions & Answers'
touch $title'.txt'

How can I UN-escape or decode these back, without having to make a list and replace them

& = Ampersand
’ = Right Single Quotation Mark
- = Hyphen-Minus
...


问:
TypeScript migration, Formik resetForm and setSubmitting has no call signatures error
tried to figure this out but could not find any solution here. I am relatively new to TypeScript, and trying to migrate a JS project to TS, which uses Formik, did not had major problems with it, except this one, where I cannot specify the type of resetForm and setSubmitting.

import { Formik, Form, FormikState, FormikHelpers } from 'formik';
import * as yup from 'yup';
import { useAppSelector } from 'custom-hooks';

import SelectOption from 'components/elements/select';
import PriceBelowInput from 'components/elements/pricebelowinput';
import Button from 'components/elements/button';
import EditableTitle from 'components/elements/editabletitle';

import { tracking, currencyLabels } from 'shared/js';
import { BUTTON_COLORS, BUTTON_TYPE } from 'components/elements/button/consts';

interface BudgetBoostSchedule extends HandleSubmitValues {
  chargeAmountKWh: number;
  isActive: boolean;
  singleChargeDay: string;
}

interface HandleSubmitValues {
  priceBelow: number;
  scheduleNickName: string;
  chargingOutputName: string;
  id?: string;
  scheduleType?: string;
}

interface IAddSchedule {
  color: string;
  condition: {
    BUDGET_BOOST: boolean;
    BUDGET_CHARGE: boolean;
    SCHEDULED_BOOST: boolean;
    SCHEDULED_CHARGE: boolean;
    SINGLE_CHARGE: boolean;
  };
  current: Element;
  heaters: { value: string; label: string }[];
  labels: {
    boostLabel: string;
    cancelBtnLabel: string;
    chargeLabel: string;
    defaultTitle: string;
    submitBtnLabel: string;
    updateBtnLabel: string;
    validation: {
      chargeAmountMinutes: string;
      scheduleNickName: string;
      scheduleNickNameMax: string;
    };
  };
  name: string;
  onCancelBtnClick: () => void;
  onClose: () => void;
  onSubmitBtnClick: (x: HandleSubmitValues) => void;
  schedule: BudgetBoostSchedule | null;
  setter: () => void;
}

const AddSchedule = (props: IAddSchedule) => {
  console.log(' ~ file: addschedule.tsx:15 ~ AddSchedule ~ props', props);
  const { labels, schedule, heaters, onCancelBtnClick, onSubmitBtnClick } = props;
  const store = useAppSelector((state) => state);
  const { countryCode } = store.location.activeLocation.address;

  const getInitialValues = () => ({
    scheduleNickName: schedule?.scheduleNickName || labels?.defaultTitle,
    chargingOutputName: schedule?.chargingOutputName || heaters?.[0]?.value,
    priceBelow: schedule?.priceBelow || 0,
  });

  const getValidationSchema = () => {
    const validationText = labels?.validation;

    return yup.object().shape({
      scheduleNickName: yup.string().max(24, validationText?.scheduleNickNameMax).required(validationText?.scheduleNickName),
    });
  };

  const handleSubmit = (
    values: HandleSubmitValues,
    { resetForm, setSubmitting }: { resetForm: any; setSubmitting: FormikHelpers<HandleSubmitValues> }
  ) => {
    const scheduleToSubmit = { ...values, priceBelow: values.priceBelow || 10, scheduleType: 'Budget' };

    console.log(' ~ file: addschedule.tsx:94 ~ handleSubmit ~ values', values);
    if (schedule) {
      scheduleToSubmit.id = schedule.id;
    }

    onSubmitBtnClick(scheduleToSubmit);
    setSubmitting(false);
    resetForm(getInitialValues());

    tracking({
      name: `${schedule ? labels?.updateBtnLabel : labels?.submitBtnLabel} button`,
      location: `schedules/ add or edit schedule`,
      action: 'submit',
    });
  };

  const handleOnClick = () => {
    onCancelBtnClick();
    tracking({
      name: `${labels?.cancelBtnLabel} button`,
      location: `schedules/ add or edit schedule`,
      action: 'click',
    });
  };

  return (

      <Formik initialValues={getInitialValues()} enableReinitialize onSubmit={handleSubmit} validationSchema={getValidationSchema()}>
        {({ isSubmitting }) => (
          <Form>

              <EditableTitle className="bud-boost-add-schedule__content--title" name="scheduleNickName" id="scheduleNickName" iconName="editWhite" />

              <SelectOption name="chargingOutputName" optionList={heaters} label={labels?.boostLabel} />

              <PriceBelowInput title={labels?.chargeLabel} name="priceBelow" unitLabel={currencyLabels(countryCode)} />

              <Button className={BUTTON_COLORS.pink} label={labels?.cancelBtnLabel} onClick={handleOnClick} />
              <Button
                className={`${BUTTON_COLORS.pink} ${BUTTON_COLORS.filled}`}
                type={BUTTON_TYPE.SUBMIT}
                isDisabled={isSubmitting}
                label={schedule ? labels?.updateBtnLabel : labels?.submitBtnLabel}
              />

          </Form>
        )}
      </Formik>

  );
};

export default AddSchedule;```

I understand that I am not typing correctly setSubmitting and resetForm, but can't figure out where to look at.
I get the error in the handleSubmit function:
setSubmitting(false);
resetForm(getInitialValues());
with these too, where if I put anything besides any, triggers the no call signature error

Body:
tried to figure this out but could not find any solution here. I am relatively new to TypeScript, and trying to migrate a JS project to TS, which uses Formik, did not had major problems with it, except this one, where I cannot specify the type of resetForm and setSubmitting.

import { Formik, Form, FormikState, FormikHelpers } from 'formik';
import * as yup from 'yup';
import { useAppSelector } from 'custom-hooks';

import SelectOption from 'components/elements/select';
import PriceBelowInput from 'components/elements/pricebelowinput';
import Button from 'components/elements/button';
import EditableTitle from 'components/elements/editabletitle';

import { tracking, currencyLabels } from 'shared/js';
import { BUTTON_COLORS, BUTTON_TYPE } from 'components/elements/button/consts';

interface BudgetBoostSchedule extends HandleSubmitValues {
  chargeAmountKWh: number;
  isActive: boolean;
  singleChargeDay: string;
}

interface HandleSubmitValues {
  priceBelow: number;
  scheduleNickName: string;
  chargingOutputName: string;
  id?: string;
  scheduleType?: string;
}

interface IAddSchedule {
  color: string;
  condition: {
    BUDGET_BOOST: boolean;
    BUDGET_CHARGE: boolean;
    SCHEDULED_BOOST: boolean;
    SCHEDULED_CHARGE: boolean;
    SINGLE_CHARGE: boolean;
  };
  current: Element;
  heaters: { value: string; label: string }[];
  labels: {
    boostLabel: string;
    cancelBtnLabel: string;
    chargeLabel: string;
    defaultTitle: string;
    submitBtnLabel: string;
    updateBtnLabel: string;
    validation: {
      chargeAmountMinutes: string;
      scheduleNickName: string;
      scheduleNickNameMax: string;
    };
  };
  name: string;
  onCancelBtnClick: () => void;
  onClose: () => void;
  onSubmitBtnClick: (x: HandleSubmitValues) => void;
  schedule: BudgetBoostSchedule | null;
  setter: () => void;
}

const AddSchedule = (props: IAddSchedule) => {
  console.log(' ~ file: addschedule.tsx:15 ~ AddSchedule ~ props', props);
  const { labels, schedule, heaters, onCancelBtnClick, onSubmitBtnClick } = props;
  const store = useAppSelector((state) => state);
  const { countryCode } = store.location.activeLocation.address;

  const getInitialValues = () => ({
    scheduleNickName: schedule?.scheduleNickName || labels?.defaultTitle,
    chargingOutputName: schedule?.chargingOutputName || heaters?.[0]?.value,
    priceBelow: schedule?.priceBelow || 0,
  });

  const getValidationSchema = () => {
    const validationText = labels?.validation;

    return yup.object().shape({
      scheduleNickName: yup.string().max(24, validationText?.scheduleNickNameMax).required(validationText?.scheduleNickName),
    });
  };

  const handleSubmit = (
    values: HandleSubmitValues,
    { resetForm, setSubmitting }: { resetForm: any; setSubmitting: FormikHelpers<HandleSubmitValues> }
  ) => {
    const scheduleToSubmit = { ...values, priceBelow: values.priceBelow || 10, scheduleType: 'Budget' };

    console.log(' ~ file: addschedule.tsx:94 ~ handleSubmit ~ values', values);
    if (schedule) {
      scheduleToSubmit.id = schedule.id;
    }

    onSubmitBtnClick(scheduleToSubmit);
    setSubmitting(false);
    resetForm(getInitialValues());

    tracking({
      name: `${schedule ? labels?.updateBtnLabel : labels?.submitBtnLabel} button`,
      location: `schedules/ add or edit schedule`,
      action: 'submit',
    });
  };

  const handleOnClick = () => {
    onCancelBtnClick();
    tracking({
      name: `${labels?.cancelBtnLabel} button`,
      location: `schedules/ add or edit schedule`,
      action: 'click',
    });
  };

  return (

      <Formik initialValues={getInitialValues()} enableReinitialize onSubmit={handleSubmit} validationSchema={getValidationSchema()}>
        {({ isSubmitting }) => (
          <Form>

              <EditableTitle className="bud-boost-add-schedule__content--title" name="scheduleNickName" id="scheduleNickName" iconName="editWhite" />

              <SelectOption name="chargingOutputName" optionList={heaters} label={labels?.boostLabel} />

              <PriceBelowInput title={labels?.chargeLabel} name="priceBelow" unitLabel={currencyLabels(countryCode)} />

              <Button className={BUTTON_COLORS.pink} label={labels?.cancelBtnLabel} onClick={handleOnClick} />
              <Button
                className={`${BUTTON_COLORS.pink} ${BUTTON_COLORS.filled}`}
                type={BUTTON_TYPE.SUBMIT}
                isDisabled={isSubmitting}
                label={schedule ? labels?.updateBtnLabel : labels?.submitBtnLabel}
              />

          </Form>
        )}
      </Formik>

  );
};

export default AddSchedule;

I understand that I am not typing correctly setSubmitting and resetForm, but can't figure out where to look at.
I get the error in the handleSubmit function:
setSubmitting(false);
resetForm(getInitialValues());
with these too, where if I put anything besides any, triggers the no call signature error


问:
Spring Boot Project Practice # Error with html file compiling
When running Spring boot, there is error "Code language not supported or denied" Source: Code Runner(extension). Then I installed extension HTML snippets and HTML5 boilerplates but it didn't work please help me to resolve it > Ineed to check local embaded server functioning.

.I tried to search error and follow those steps like installing reauired extentions.
.I installed HTML snippets and HTML5 boilerplate but I couldn't resolved it


问:
Array Value getting deleted automatically once the forEach loop ends
My array's values get deleted automatically and can't get to know why.

I am working on a e-commerce website for a client and I am working on cart feature. My app connects to the Mongodb using mongoose, i have passport for authentication. When i hit '/cart' route, my code finds the user from the mongodb database using it's username stored in cookie, then go through the 'inCart' field and fetch the product's document id's after which i use findById to find that product and save it into a array the code works till here and my array holds the documents but as soon as my findById loop exits, the array is empty again IDK why.

I have spent so much time figuring the why but i can't get to the answer and so any solution is a huge thanks.

My App Js - cart route code:

array has values till line number 18, and then from line 20 array gets empty

app.get("/cart", function (req, res){
    var userID = req.cookies["userEmail"];
    var cartProducts = [];

    User.findOne({username: userID}, function (err, user){
        if (err){
            console.log(err);
        } else {
            user['inCart'].forEach(function (productId) {
                Product.findById(productId, function (err, doc){
                    if (err) {
                        console.log(err);
                    } else {
                        // console.log(doc)
                        cartProducts.push(doc);
                        // console.log(cartProducts)
                    };
                    // console.log(cartProducts) - works
                });
                // console.log(cartProducts); - not working from here
            });
        };
    });
    // console.log(cartProducts)

    res.render("cart", { cart: cartProducts })
});
```

Results:

Body:
My array's values get deleted automatically and can't get to know why.

I am working on a e-commerce website for a client and I am working on cart feature. My app connects to the Mongodb using mongoose, i have passport for authentication. When i hit '/cart' route, my code finds the user from the mongodb database using it's username stored in cookie, then go through the 'inCart' field and fetch the product's document id's after which i use findById to find that product and save it into a array the code works till here and my array holds the documents but as soon as my findById loop exits, the array is empty again IDK why.

I have spent so much time figuring the why but i can't get to the answer and so any solution is a huge thanks.

My App Js - cart route code:

array has values till line number 18, and then from line 20 array gets empty

app.get("/cart", function (req, res){
    var userID = req.cookies["userEmail"];
    var cartProducts = [];

    User.findOne({username: userID}, function (err, user){
        if (err){
            console.log(err);
        } else {
            user['inCart'].forEach(function (productId) {
                Product.findById(productId, function (err, doc){
                    if (err) {
                        console.log(err);
                    } else {
                        // console.log(doc)
                        cartProducts.push(doc);
                        // console.log(cartProducts)
                    };
                    // console.log(cartProducts) - works
                });
                // console.log(cartProducts); - not working from here
            });
        };
    });
    // console.log(cartProducts)

    res.render("cart", { cart: cartProducts })
});

Results:


问:
Error during Intellij idea remote Tomcat Server debug
I've some problems during configuration of remote Tomcat Server in Intellij
I've got a java web app that need to run in a cluster configuration, so I've got 3 Linux VMS in which I've installed tomcat server.

The problem is that I need to use this 3 tomcat servers together in debug mode in order to test and check issues.
I've tried some things but I was not able to get a solution.

OPTION A: configuring Remote JVM Debug:
I've tried to configure a Remote JVM Debug on my intellij configuring Catalina to listen to another port (2001) and launch it with the command: sh catalina.sh jpda start -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:2001 but it stucks on this message "Connected to the target VM, address: 'IP:2001', transport: 'socket'"

OPTION B: remote Tomcat server:
I've tried configuring a remote Tomcat server (that is the thing I prefer) configuring remote host with SFTP, but in this case Tomcat service start, it works for some minutes and after that it goes in TimeoutException
[](https://i.stack.imgur.com/XmDKx.png)

I hope anyone can help me, I read a lot of thing on the internet but no-one works.


问:
nodemon not recognizing the file: EISDIR error
I was doing this tutorial of FCC and coding along. But when in minute 23 nodemon is used, my terminal keeps giving this error:

[nodemon] Internal watch failed: EISDIR: illegal operation on a directory, watch '//wsl$/Ubuntu/home/sahand/Projects/Restaurant-Reviews/backend'

I understand that the EISDIR error means that the command is looking for a file but I am giving it a folder, but server.js is a file!

i'd appreciate it if anyone could tell me what is happening here.

I revisited all steps and redownloaded the packages but nothing seems to work.


问:
AWS EKS load balancer creation fails while creating for EKS cluster
I have created an EKS cluster with two public subnets, however, created one worker node (instance type = t3.small) in one of the public subnets successfully.

I am able to create Nginx deployment and nodePort service and able to query the deployment and other k8s objects and also able to access this web application using node port (<Service-public-ip:nodeport>) successfully.

I am trying to create a load balancer alb and nlb, but both are failing

The whole setup is using the terraform file. I need help to identify why lb (both types) creation is failing, and how can i fix this in my terraform files

Terraform file for network load balancer:

```<code>resource "kubernetes_service_v1" "nlb-nginx-service" {
  metadata {
    name = "nlb-nginx-service"
    annotations = {
      "service.beta.kubernetes.io/aws-load-balancer-type" = "external"
      "service.beta.kubernetes.io/aws-load-balancer-nlb-target-type" = "ip"
      "service.beta.kubernetes.io/aws-load-balancer-scheme" = "internet-facing"
    }
  }
  spec {
    selector = {
      app = kubernetes_deployment_v1.nginx-application.spec.0.selector.0.match_labels.app
    }

    port {
      name        = "http"
      port        = 80
      target_port = 80
    }
    type = "LoadBalancer"
  }
}
</code>```

ERROR I get when I describe the nlb service

```<code>Events:
  Type    Reason                Age   From                Message
  ----    ------                ----  ----                -------
  Normal  EnsuringLoadBalancer  119s  service-controller  Ensuring load balancer
PS F:\k8s-terraform-project\terraform-on-aws-ec2-main\k8s>

</code>```

terraform file for application load balancer:

```<code>resource "kubernetes_service_v1" "alb-nginx-service" {
  metadata {
    name = "alb-nginx-service"
    annotations = {
      "kubernetes.io/ingress.class" = "alb"
    }
  }
  spec {
    selector = {
      app = kubernetes_deployment_v1.nginx-application.spec.0.selector.0.match_labels.app
    }

    port {
      name        = "http"
      port        = 80
      target_port = 80
    }
    type = "LoadBalancer"
  }
}
</code>```

ERROR I get when i describe the nlb service

```<code>Events:
  Type     Reason                  Age                  From                Message
  ----     ------                  ----                 ----                -------
  Normal   EnsuringLoadBalancer    52s (x6 over 3m29s)  service-controller  Ensuring load balancer
  Warning  SyncLoadBalancerFailed  52s (x6 over 3m28s)  service-controller  Error syncing load balancer: failed to ensure load balancer: could not find any suitable subnets for creating the ELB
PS F:\k8s-terraform-project\terraform-on-aws-ec2-main\k8s>
</code>```

Steps I took to identify, but unfortunately didnt work

tried to create these services on the cluster one by one

checked the services logs but didnt not get a clue

Seems somewhere lb is not able to find a public subnet to place the lb service in aws, as it says 'could not find any suitable subnets for creating the ELB', but not aware where to mention/assign public subnet for my lb

Body:
I have created an EKS cluster with two public subnets, however, created one worker node (instance type = t3.small) in one of the public subnets successfully.

I am able to create Nginx deployment and nodePort service and able to query the deployment and other k8s objects and also able to access this web application using node port (<Service-public-ip:nodeport>) successfully.

I am trying to create a load balancer alb and nlb, but both are failing

The whole setup is using the terraform file. I need help to identify why lb (both types) creation is failing, and how can i fix this in my terraform files

Terraform file for network load balancer:

resource "kubernetes_service_v1" "nlb-nginx-service" {
  metadata {
    name = "nlb-nginx-service"
    annotations = {
      "service.beta.kubernetes.io/aws-load-balancer-type" = "external"
      "service.beta.kubernetes.io/aws-load-balancer-nlb-target-type" = "ip"
      "service.beta.kubernetes.io/aws-load-balancer-scheme" = "internet-facing"
    }
  }
  spec {
    selector = {
      app = kubernetes_deployment_v1.nginx-application.spec.0.selector.0.match_labels.app
    }

    port {
      name        = "http"
      port        = 80
      target_port = 80
    }
    type = "LoadBalancer"
  }
}

ERROR I get when I describe the nlb service

Events:
  Type    Reason                Age   From                Message
  ----    ------                ----  ----                -------
  Normal  EnsuringLoadBalancer  119s  service-controller  Ensuring load balancer
PS F:\k8s-terraform-project\terraform-on-aws-ec2-main\k8s>

terraform file for application load balancer:

resource "kubernetes_service_v1" "alb-nginx-service" {
  metadata {
    name = "alb-nginx-service"
    annotations = {
      "kubernetes.io/ingress.class" = "alb"
    }
  }
  spec {
    selector = {
      app = kubernetes_deployment_v1.nginx-application.spec.0.selector.0.match_labels.app
    }

    port {
      name        = "http"
      port        = 80
      target_port = 80
    }
    type = "LoadBalancer"
  }
}

ERROR I get when i describe the nlb service

Events:
  Type     Reason                  Age                  From                Message
  ----     ------                  ----                 ----                -------
  Normal   EnsuringLoadBalancer    52s (x6 over 3m29s)  service-controller  Ensuring load balancer
  Warning  SyncLoadBalancerFailed  52s (x6 over 3m28s)  service-controller  Error syncing load balancer: failed to ensure load balancer: could not find any suitable subnets for creating the ELB
PS F:\k8s-terraform-project\terraform-on-aws-ec2-main\k8s>

Steps I took to identify, but unfortunately didnt work

tried to create these services on the cluster one by one

checked the services logs but didnt not get a clue

Seems somewhere lb is not able to find a public subnet to place the lb service in aws, as it says 'could not find any suitable subnets for creating the ELB', but not aware where to mention/assign public subnet for my lb


问:
How to use custom HttpClient handler
I'm new to Java and Spring, and I'm wondering if it's possible to write my own HttpClient doOnConnected handler. The main reason for this is to check if some headers exist before each request and possibly do other things.

Something like this  in c#

My code for example:

```<code>HttpClient httpClient = HttpClient.create()
        .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 5000)
        .responseTimeout(Duration.ofMillis(5000))
        .doOnConnected(conn ->
                conn.addHandlerLast(new ReadTimeoutHandler(5000, TimeUnit.MILLISECONDS))
                    .addHandlerLast(new WriteTimeoutHandler(5000, TimeUnit.MILLISECONDS))
                    .addHandlerLast(new MyCustomHandler()
        );
</code>```

Title: How to use custom HttpClient handler

Body:
I'm new to Java and Spring, and I'm wondering if it's possible to write my own HttpClient doOnConnected handler. The main reason for this is to check if some headers exist before each request and possibly do other things.

Something like this  in c#

My code for example:

HttpClient httpClient = HttpClient.create()
        .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 5000)
        .responseTimeout(Duration.ofMillis(5000))
        .doOnConnected(conn ->
                conn.addHandlerLast(new ReadTimeoutHandler(5000, TimeUnit.MILLISECONDS))
                    .addHandlerLast(new WriteTimeoutHandler(5000, TimeUnit.MILLISECONDS))
                    .addHandlerLast(new MyCustomHandler()
        );


问:
Why do I get a warning "Assigning 'void' from a function reset()" in Visual Studio Code?
I have written a class where one method is used to extract the vintage year from a wine's product name:

```<code>private function parse_vintage($prodname) {
    // Try to find the vintage in the product name "NNNN NNNN 2018 (winetype)" (e.g. "Chateau Petrus 2001 (Red)")
    $words = explode(' ', $prodname);
    $vintages = preg_grep("/(19|20)[0-9]{2}/", $words);
    $vintage = reset($vintages);
    return ($vintage ? $vintage : "");
}
</code>```

The function works fine. But in my code editor (Visual Studio Code) I get a coding warning stating that says Assigning "void" from a function reset(). See image below:

If I copy the method to another file and the warning disappears. Why do I get this warning... and only in this and similar contexts? As far as I know, the reset() function is not a void function... Is it something wrong with any of my Extensions? (BTW I use Devsense's PHP extension and some other as well...)

Body:
I have written a class where one method is used to extract the vintage year from a wine's product name:

private function parse_vintage($prodname) {
    // Try to find the vintage in the product name "NNNN NNNN 2018 (winetype)" (e.g. "Chateau Petrus 2001 (Red)")
    $words = explode(' ', $prodname);
    $vintages = preg_grep("/(19|20)[0-9]{2}/", $words);
    $vintage = reset($vintages);
    return ($vintage ? $vintage : "");
}

The function works fine. But in my code editor (Visual Studio Code) I get a coding warning stating that says Assigning "void" from a function reset(). See image below:

If I copy the method to another file and the warning disappears. Why do I get this warning... and only in this and similar contexts? As far as I know, the reset() function is not a void function... Is it something wrong with any of my Extensions? (BTW I use Devsense's PHP extension and some other as well...)


问:
how to isolate a user class from other users? TELEBOT
I make a telegram bot to search for anime. For API requests, I made an additional file with a class containing class fields as search parameters as well as functions that return dictionaries with data. In the main file, I created an object of this class so that the user fills in the class fields as he enters information, and then gets the result from the class method. Everything works well for one user, but when using the bot by different users at the same time, choosing one makes changes for all users. how can a class be isolated so that everyone works with a personal instance

```<code>import telebot
from telebot import types
import n
import psy_db

bot = telebot.TeleBot('')
search_class=n.ani_search()

@bot.message_handler(commands=['start'])
def hello(message):
    bot.send_message(message.from_user.id, text=f'hello,{message.from_user.first_name}!')
</code>```
```<code>
import requests
from dataclasses import dataclass
from typing import Optional

@dataclass
class ani_search:
    id_user:Optional[int]=None
    name_media: Optional[str] = None
    name_char: Optional[str] = None
    rank: Optional[int] = None
    type: Optional[str] = None
    genre: Optional[list] = None
    id_char: Optional[int] = None
    id_media: Optional[int] = None
    page: Optional[int]= 1
    page_char: Optional[int]= 1
    search_type: Optional[str]= None
    iter = 0
</code>```

I tried to dynamically create class objects for each user by his ID using the vars() function, but it didn't work.
I haven't been studying python for very long, so don't laugh :)

Body:
I make a telegram bot to search for anime. For API requests, I made an additional file with a class containing class fields as search parameters as well as functions that return dictionaries with data. In the main file, I created an object of this class so that the user fills in the class fields as he enters information, and then gets the result from the class method. Everything works well for one user, but when using the bot by different users at the same time, choosing one makes changes for all users. how can a class be isolated so that everyone works with a personal instance

import telebot
from telebot import types
import n
import psy_db

bot = telebot.TeleBot('')
search_class=n.ani_search()

@bot.message_handler(commands=['start'])
def hello(message):
    bot.send_message(message.from_user.id, text=f'hello,{message.from_user.first_name}!')

import requests
from dataclasses import dataclass
from typing import Optional

@dataclass
class ani_search:
    id_user:Optional[int]=None
    name_media: Optional[str] = None
    name_char: Optional[str] = None
    rank: Optional[int] = None
    type: Optional[str] = None
    genre: Optional[list] = None
    id_char: Optional[int] = None
    id_media: Optional[int] = None
    page: Optional[int]= 1
    page_char: Optional[int]= 1
    search_type: Optional[str]= None
    iter = 0

I tried to dynamically create class objects for each user by his ID using the vars() function, but it didn't work.
I haven't been studying python for very long, so don't laugh :)


问:
Oracle AdvancedQueuing: failing to broadcast (ORA-24033: no recipients for message, Python client)
I am referring to the following project on GitHub: poc-oracle-aq

The code responsible for publishing messages is located in scripts/publisher.py:

```<code>def loop(connection, queue_high, queue_low, name):
    recipients = ['Subscriber01', 'Subscriber02', 'Subscriber03']
    while True:
        pause = random.randint(10, 30)
        sleep(float(pause) / 10.)
        value = random.randint(1, 100)
        message = {'timestamp': datetime.now(), 'source': name, 'value': value}
        if value < 10:
            logging.info('sending {}'.format(message))
            queue_low.enqone(connection.msgproperties(payload=json.dumps(message, cls=DateTimeEncoder), recipients=recipients))
        elif value > 90:
            logging.info('sending {}'.format(message))
            queue_high.enqone(connection.msgproperties(payload=json.dumps(message, cls=DateTimeEncoder), recipients=recipients))

        connection.commit()
</code>```

This is working  well for multicast, where subscribers are listed as recipients and provided as a message parameter when calling the enqone() method.

However according to the documentation I should be able to perform the same call without specifying the recipients in order to broadcast the message to all subscribers.

When setting the recipients to None in the first line of the loop() function above:

```<code>recipients = None
</code>```

I get the following error when I try:

```<code>  File "src/oracledb/impl/thick/queue.pyx", line 117, in oracledb.thick_impl.ThickQueueImpl.enq_one
  File "src/oracledb/impl/thick/utils.pyx", line 410, in oracledb.thick_impl._raise_from_odpi
  File "src/oracledb/impl/thick/utils.pyx", line 400, in oracledb.thick_impl._raise_from_info
oracledb.exceptions.DatabaseError: ORA-24033: no recipients for message
</code>```

According to the documentation that means:

Error code: ORA-24033 Description: no
recipients for message Cause: An enqueue was performed on a queue that
has been set up for multiple dequeuers but there were neither explicit
recipients specified in the call nor were any queue subscribers
determined to be recipients for this message. Action: Either pass a
list of recipients in the enqueue call or add subscribers to the queue
for receiving this message.

However I do have subscribers running and listening when the publisher is sending the message. Is there an undocumented parameter when calling enqone()?

I am using Oracle Thick Client 19.8 and Oracle Enterprise 19.3.

Body:
I am referring to the following project on GitHub: poc-oracle-aq

The code responsible for publishing messages is located in scripts/publisher.py:

def loop(connection, queue_high, queue_low, name):
    recipients = ['Subscriber01', 'Subscriber02', 'Subscriber03']
    while True:
        pause = random.randint(10, 30)
        sleep(float(pause) / 10.)
        value = random.randint(1, 100)
        message = {'timestamp': datetime.now(), 'source': name, 'value': value}
        if value < 10:
            logging.info('sending {}'.format(message))
            queue_low.enqone(connection.msgproperties(payload=json.dumps(message, cls=DateTimeEncoder), recipients=recipients))
        elif value > 90:
            logging.info('sending {}'.format(message))
            queue_high.enqone(connection.msgproperties(payload=json.dumps(message, cls=DateTimeEncoder), recipients=recipients))

        connection.commit()

This is working  well for multicast, where subscribers are listed as recipients and provided as a message parameter when calling the enqone() method.

However according to the documentation I should be able to perform the same call without specifying the recipients in order to broadcast the message to all subscribers.

When setting the recipients to None in the first line of the loop() function above:

recipients = None

I get the following error when I try:

  File "src/oracledb/impl/thick/queue.pyx", line 117, in oracledb.thick_impl.ThickQueueImpl.enq_one
  File "src/oracledb/impl/thick/utils.pyx", line 410, in oracledb.thick_impl._raise_from_odpi
  File "src/oracledb/impl/thick/utils.pyx", line 400, in oracledb.thick_impl._raise_from_info
oracledb.exceptions.DatabaseError: ORA-24033: no recipients for message

According to the documentation that means:

Error code: ORA-24033 Description: no
recipients for message Cause: An enqueue was performed on a queue that
has been set up for multiple dequeuers but there were neither explicit
recipients specified in the call nor were any queue subscribers
determined to be recipients for this message. Action: Either pass a
list of recipients in the enqueue call or add subscribers to the queue
for receiving this message.

However I do have subscribers running and listening when the publisher is sending the message. Is there an undocumented parameter when calling enqone()?

I am using Oracle Thick Client 19.8 and Oracle Enterprise 19.3.


问:
Passing a PHP variable to Vue component as prop doesn't work
I'm trying to pass a string from a laravel blade to a vue component but vue keeps telling me that the variable is undefined. I've tried every solution and nothing seems to work.

header.blade.php

```
<h4>headerComponent.vue</h4>
<pre class="lang-html prettyprint-override"><code><button v-on:click="toggleForm"> TEST </button>
<script>
    export default {
        props: {
            page: String
        },
        data() {
            return {
                //
            }
        },
        methods: {
            toggleForm: function() {
                console.log(this.page);
            }
        }
    }
</script>
</code>```

I also tried

props: ['page'],
```
<p>and</p>
<pre class="lang-html prettyprint-override"><code><header-component :page="'{{$page}}'"/>
</code>```

and yes the $page variable does show a string when I dd($page)

Body:
I'm trying to pass a string from a laravel blade to a vue component but vue keeps telling me that the variable is undefined. I've tried every solution and nothing seems to work.

header.blade.php

headerComponent.vue

<button v-on:click="toggleForm"> TEST </button>

I also tried

props: ['page'],

and

and yes the $page variable does show a string when I dd($page)