问:
Material UI input value text being cut off when using 'Poppins' web font?
I was wondering if anybody has encountered any issues with form input elements when using Material UI and custom web fonts (the 'Poppins' web font to be exact)?

It seems that characters are cut off from the input even though a full width (100%) style is applied to the element and parent containers.

It just seems that the input width does not adapt when the input value is updated (this does seem to work for other fonts but not the Poppins font)

Input with Poppins

Input without Poppins

The TextField Markup I have is:

```<code>    <TextField
          label={label}
          error={hasError}
          helperText={errorText || helperText}
          InputProps={{
            endAdornment: (
              <InputAdornment
                position="end"
                style={{ marginLeft: 0, marginBottom: 4 }}
              >
                <CalendarMonth fontSize="small" />
              </InputAdornment>
            ),
          }}
        />
</code>```

It's probably something silly I'm missing, but any pointers in the right direction on this would be much appreciated

Body:
I was wondering if anybody has encountered any issues with form input elements when using Material UI and custom web fonts (the 'Poppins' web font to be exact)?

It seems that characters are cut off from the input even though a full width (100%) style is applied to the element and parent containers.

It just seems that the input width does not adapt when the input value is updated (this does seem to work for other fonts but not the Poppins font)

Input with Poppins

Input without Poppins

The TextField Markup I have is:

    <TextField
          label={label}
          error={hasError}
          helperText={errorText || helperText}
          InputProps={{
            endAdornment: (
              <InputAdornment
                position="end"
                style={{ marginLeft: 0, marginBottom: 4 }}
              >
                <CalendarMonth fontSize="small" />
              </InputAdornment>
            ),
          }}
        />

It's probably something silly I'm missing, but any pointers in the right direction on this would be much appreciated


来源: stackexchange

问:
How to set global variables in gitlab-ci dynamically?
Any idea on how to set global variables in gitlab-ci.yml dynamically?

```<code>DebFileName: echo $TagName | awk -F-stage '{print $1}'
</code>```

Look, I am trying to do it this way where DebFileName is a global variables defined inside gitlab-ci.yml and when I am trying to access it in some job below like this

```<code>script:
    - echo "DebFileName=" $DebFileName

</code>```

Then it is giving this output:

```<code>$ echo "DebFileName=" $DebFileName
DebFileName= echo 1.1.97-stage | awk -F-stage "{print }"
</code>```

Whereas, when I use it this way:

```<code>script:
    - echo $TagName | awk -F-stage '{print $1}'
</code>```

then it shows 1.1.97. And that's what I want. Any pointers?

ContentLicense: CC BY-SA 4.0

Body:
Any idea on how to set global variables in gitlab-ci.yml dynamically?

DebFileName: echo $TagName | awk -F-stage '{print $1}'

Look, I am trying to do it this way where DebFileName is a global variables defined inside gitlab-ci.yml and when I am trying to access it in some job below like this

script:
    - echo "DebFileName=" $DebFileName

Then it is giving this output:

$ echo "DebFileName=" $DebFileName
DebFileName= echo 1.1.97-stage | awk -F-stage "{print }"

Whereas, when I use it this way:

script:
    - echo $TagName | awk -F-stage '{print $1}'

then it shows 1.1.97. And that's what I want. Any pointers?


问:
Android Studio - How to post an HTTP request to Google reverse image search?
I'm currently developing an app to acquire a picture using the phone camera and request some results to the Google reverse image search.

Now, for what I've researched so far Google APIs accepts a picture URL as input to make the reverse search, but I don't have an URL, since it's a picture the user takes in that moment, and I only have the Bitmap.

How can I pass the picture as input to the Google reverse image search using a post HTML request?

I'm using Android Studio and Java.

Here's my code:

```<code>public void onActivityResult(ActivityResult result) {
if (result.getResultCode() == Activity.RESULT_OK && result.getData() != null) {
    Bundle bundle = result.getData().getExtras();
    Bitmap bitmap = (Bitmap) bundle.get("data");

    requestQueue = Volley.newRequestQueue(context);
    //getRequest();
    //postRequest();
}
}
</code>```

Body:
I'm currently developing an app to acquire a picture using the phone camera and request some results to the Google reverse image search.

Now, for what I've researched so far Google APIs accepts a picture URL as input to make the reverse search, but I don't have an URL, since it's a picture the user takes in that moment, and I only have the Bitmap.

How can I pass the picture as input to the Google reverse image search using a post HTML request?

I'm using Android Studio and Java.

Here's my code:

public void onActivityResult(ActivityResult result) {
if (result.getResultCode() == Activity.RESULT_OK && result.getData() != null) {
    Bundle bundle = result.getData().getExtras();
    Bitmap bitmap = (Bitmap) bundle.get("data");

    requestQueue = Volley.newRequestQueue(context);
    //getRequest();
    //postRequest();
}
}


问:
C# SqlDependency equivalent in PHP 7.4.29 and SQL SERVER 2012
I couldn't find any resources on google and don't know where to start. Is there a PHP equivalent of C# SQLDependency? Where do I get it?
I have followed this answer to enable service broker

ALTER DATABASE [DBNAME] SET ENABLE_BROKER WITH ROLLBACK IMMEDIATE

Thanks in advance


问:
What is the format of ECDSA Signature used in practical applications?
The output format of ECDSA Signature Algorithm is a tuple (r,s) according to its wiki aticle and other similar sources.

But when I triedy the signature generated through their my own algo through standard crypto programming libraries, the signature required as input is a single hex string.

I have searched the internet for standards regarding this conversion but haven't found much satisfactory results.


问:
Gmaps.NET MapProvider.TryGetProvider return null
I’m trying to use MapProvider.TryGetProvider(int guid) and it always return null for all of the maps.
When I create the map object and initial it with any provider the map load  successfully without any problem but when I use TryGetProvider for the same provider it return null.
Thank you for your help

Map.MapProvider = MapProvider.TryGetProvider(value.GetType().GUID)

UPDATE:

I did success to reload the map provider by the next code line:

_selectedMapProvider = value; var assemblyType = Assembly.Load("GMap.NET.Core"); Map.MapProvider = (GMapProvider)assemblyType.GetType($"GMap.NET.MapProviders.{SelectedMapProvider.GetType().Name}").GetField("Instance").GetValue(null); Map.ReloadMap();

But I’m trying to use something more fast then use reflection, like the TryGetProvider


问:
Error SSL CloudFlare install hosting Cpanel "ERR_SSL_VERSION_OR_CIPHER_MISMATCH"
I will share with you a case when installing SSL Free provided by CloudFlare and installing
Key + Cert on hosting when accessing with Chrome error "ERR_SSL_VERSION_OR_CIPHER_MISMATCH" try with Firefox "Secure connection failed and firefox did not connect" I have searched through some informative websites and found out do "You should turn on 'Always use HTTPS' as well as 'Automatic HTTPS Rewrites' on that SSL/TLS app, this will make sure all resources are loaded over HTTPS including the main page" and I am using Wordpress source code web, just adding rule in .htaccess force HTTPS solved this error and successfully accessed the website.

```<code>RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</code>```

Successfully processed

Body:
I will share with you a case when installing SSL Free provided by CloudFlare and installing
Key + Cert on hosting when accessing with Chrome error "ERR_SSL_VERSION_OR_CIPHER_MISMATCH" try with Firefox "Secure connection failed and firefox did not connect" I have searched through some informative websites and found out do "You should turn on 'Always use HTTPS' as well as 'Automatic HTTPS Rewrites' on that SSL/TLS app, this will make sure all resources are loaded over HTTPS including the main page" and I am using Wordpress source code web, just adding rule in .htaccess force HTTPS solved this error and successfully accessed the website.

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Successfully processed


问:
React-Snap doesn't get the clamp in styled-components
I have the width: clamp(0.6rem, 7vw + 0.2rem, 2.4rem); in a styled-component and when I postbuild with the react-snap the width disappears from the pre-render html style css, but if I put width: 2rem it is ok.

Why and how to make the clamp work?


问:
Use a function from software expansion package x-cube-memsmic1
I am working on a project of sound source localization and want to lit an individual ws2812 Led in the direction of the sound source.

I came across an expansion software package x-cube-memsmic1 (https://www.st.com/en/embedded-software/x-cube-memsmic1.html) which uses Acoustic SL library to estimate the angle of the sound source and send the angle along with some other things to PC via USB. The description says that the audio_application.c and usbd_audio_if.c contains some functions to get the angle from the source and send it.

Now I don't know which function does this and how?

Can someone tell me how can I get that specific function so I can put it in main loop?

Thanks
Viki

```<code>#include "audio_application.h"
#include "acoustic_sl.h"

uint16_t PDM_Buffer[((((AUDIO_IN_CHANNELS * AUDIO_IN_SAMPLING_FREQUENCY) / 1000) * MAX_DECIMATION_FACTOR) / 16)* N_MS ];

/* Private variables ---------------------------------------------------------*/

/*Handler and Config structure for Source Localization*/
AcousticSL_Handler_t libSoundSourceLoc_Handler_Instance;
AcousticSL_Config_t  libSoundSourceLoc_Config_Instance;
volatile int16_t  SOURCE_Angle_Value = 0;
volatile uint16_t SOURCE_Enable_Value = 1;
extern UART_HandleTypeDef UartHandle;
volatile int32_t result[2];

static uint16_t PCM_Buffer[AUDIO_IN_CHANNELS * AUDIO_IN_SAMPLING_FREQUENCY / 1000];

void CCA02M2_AUDIO_IN_HalfTransfer_CallBack(uint32_t Instance)
{
  UNUSED(Instance);
  AudioProcess();
}

void CCA02M2_AUDIO_IN_TransferComplete_CallBack(uint32_t Instance)
{
  UNUSED(Instance);
  AudioProcess();
}

void AudioProcess(void)
{
  if (CCA02M2_AUDIO_IN_PDMToPCM(CCA02M2_AUDIO_INSTANCE, (uint16_t *)PDM_Buffer, PCM_Buffer) != BSP_ERROR_NONE)
  {
    Error_Handler();
  }

  if (AcousticSL_Data_Input((int16_t *)&PCM_Buffer[BOTTOM_LEFT_MIC], (int16_t *)&PCM_Buffer[TOP_RIGHT_MIC],
                            (int16_t *)&PCM_Buffer[BOTTOM_RIGHT_MIC], (int16_t *)&PCM_Buffer[TOP_LEFT_MIC], &libSoundSourceLoc_Handler_Instance) == 1U)
  {
    SW_Task2_Start(); /*Localization Processing Task*/
  }

  Send_Audio_to_USB((int16_t *)PCM_Buffer, AUDIO_IN_SAMPLING_FREQUENCY / 1000 * AUDIO_IN_CHANNELS);
}

void Audio_Libraries_Init(void)
{
  __IO uint32_t error_value = 0;
  /* Enable CRC peripheral to unlock the library */
  __CRC_CLK_ENABLE();

  /*Setup Source Localization static parameters*/
  libSoundSourceLoc_Handler_Instance.channel_number = 4;
  libSoundSourceLoc_Handler_Instance.M12_distance = DIAGONAL;
  libSoundSourceLoc_Handler_Instance.M34_distance = DIAGONAL;
  libSoundSourceLoc_Handler_Instance.sampling_frequency = AUDIO_IN_SAMPLING_FREQUENCY;
  libSoundSourceLoc_Handler_Instance.algorithm = ACOUSTIC_SL_ALGORITHM_GCCP;
  libSoundSourceLoc_Handler_Instance.ptr_M1_channels = 4;
  libSoundSourceLoc_Handler_Instance.ptr_M2_channels = 4;
  libSoundSourceLoc_Handler_Instance.ptr_M3_channels = 4;
  libSoundSourceLoc_Handler_Instance.ptr_M4_channels = 4;
  libSoundSourceLoc_Handler_Instance.samples_to_process = 512;
  (void)AcousticSL_getMemorySize(&libSoundSourceLoc_Handler_Instance);
  libSoundSourceLoc_Handler_Instance.pInternalMemory = (uint32_t *)malloc(libSoundSourceLoc_Handler_Instance.internal_memory_size);
  error_value += AcousticSL_Init(&libSoundSourceLoc_Handler_Instance);

  /*Setup Source Localization dynamic parameters*/
  libSoundSourceLoc_Config_Instance.resolution = 10;
  libSoundSourceLoc_Config_Instance.threshold = 24;
  error_value += AcousticSL_setConfig(&libSoundSourceLoc_Handler_Instance, &libSoundSourceLoc_Config_Instance);

  /*Error Management*/
  if (error_value != 0U)
  {
    Error_Handler();
  }

  /*Malloc Failure*/
  if (libSoundSourceLoc_Handler_Instance.pInternalMemory == NULL)
  {
    Error_Handler();
  }

}

void SW_IRQ_Tasks_Init(void)
{
  HAL_NVIC_SetPriority((IRQn_Type)EXTI1_IRQn, 0x0D, 0);
  HAL_NVIC_EnableIRQ((IRQn_Type)EXTI1_IRQn);

  HAL_NVIC_SetPriority((IRQn_Type)EXTI2_IRQn, 0x0E, 0);
  HAL_NVIC_EnableIRQ((IRQn_Type)EXTI2_IRQn);

}

void SW_Task1_Callback(void)
{

}

void SW_Task2_Callback(void)
{
  (void)AcousticSL_Process((int32_t *)&result, &libSoundSourceLoc_Handler_Instance);

  if (result[0] == ACOUSTIC_SL_NO_AUDIO_DETECTED)
  {
    result[0] = -1;
  }

  if (result[0] != -1)
  {
    char output[4];
    int32_t n = sprintf(output, "%li", (int32_t)result[0]);
    (void)HAL_UART_Transmit(&UartHandle, (uint8_t *)"    ", 4, 0xFFFF);
    (void)HAL_UART_Transmit(&UartHandle, (uint8_t *)"\r", 1, 0xFFFF);
    (void)HAL_UART_Transmit(&UartHandle, (uint8_t *)output, (uint16_t)n, 0xFFFF);
  }
}

void SW_Task1_Start(void)
{
  HAL_NVIC_SetPendingIRQ(EXTI1_IRQn);
}

void SW_Task2_Start(void)
{
  HAL_NVIC_SetPendingIRQ(EXTI2_IRQn);
}

void Error_Handler(void)
{
  while (1);
}
</code>```

Body:
I am working on a project of sound source localization and want to lit an individual ws2812 Led in the direction of the sound source.

I came across an expansion software package x-cube-memsmic1 (https://www.st.com/en/embedded-software/x-cube-memsmic1.html) which uses Acoustic SL library to estimate the angle of the sound source and send the angle along with some other things to PC via USB. The description says that the audio_application.c and usbd_audio_if.c contains some functions to get the angle from the source and send it.

Now I don't know which function does this and how?

Can someone tell me how can I get that specific function so I can put it in main loop?

Thanks
Viki

#include "audio_application.h"
#include "acoustic_sl.h"

uint16_t PDM_Buffer[((((AUDIO_IN_CHANNELS * AUDIO_IN_SAMPLING_FREQUENCY) / 1000) * MAX_DECIMATION_FACTOR) / 16)* N_MS ];

/* Private variables ---------------------------------------------------------*/

/*Handler and Config structure for Source Localization*/
AcousticSL_Handler_t libSoundSourceLoc_Handler_Instance;
AcousticSL_Config_t  libSoundSourceLoc_Config_Instance;
volatile int16_t  SOURCE_Angle_Value = 0;
volatile uint16_t SOURCE_Enable_Value = 1;
extern UART_HandleTypeDef UartHandle;
volatile int32_t result[2];

static uint16_t PCM_Buffer[AUDIO_IN_CHANNELS * AUDIO_IN_SAMPLING_FREQUENCY / 1000];

void CCA02M2_AUDIO_IN_HalfTransfer_CallBack(uint32_t Instance)
{
  UNUSED(Instance);
  AudioProcess();
}

void CCA02M2_AUDIO_IN_TransferComplete_CallBack(uint32_t Instance)
{
  UNUSED(Instance);
  AudioProcess();
}

void AudioProcess(void)
{
  if (CCA02M2_AUDIO_IN_PDMToPCM(CCA02M2_AUDIO_INSTANCE, (uint16_t *)PDM_Buffer, PCM_Buffer) != BSP_ERROR_NONE)
  {
    Error_Handler();
  }

  if (AcousticSL_Data_Input((int16_t *)&PCM_Buffer[BOTTOM_LEFT_MIC], (int16_t *)&PCM_Buffer[TOP_RIGHT_MIC],
                            (int16_t *)&PCM_Buffer[BOTTOM_RIGHT_MIC], (int16_t *)&PCM_Buffer[TOP_LEFT_MIC], &libSoundSourceLoc_Handler_Instance) == 1U)
  {
    SW_Task2_Start(); /*Localization Processing Task*/
  }

  Send_Audio_to_USB((int16_t *)PCM_Buffer, AUDIO_IN_SAMPLING_FREQUENCY / 1000 * AUDIO_IN_CHANNELS);
}

void Audio_Libraries_Init(void)
{
  __IO uint32_t error_value = 0;
  /* Enable CRC peripheral to unlock the library */
  __CRC_CLK_ENABLE();

  /*Setup Source Localization static parameters*/
  libSoundSourceLoc_Handler_Instance.channel_number = 4;
  libSoundSourceLoc_Handler_Instance.M12_distance = DIAGONAL;
  libSoundSourceLoc_Handler_Instance.M34_distance = DIAGONAL;
  libSoundSourceLoc_Handler_Instance.sampling_frequency = AUDIO_IN_SAMPLING_FREQUENCY;
  libSoundSourceLoc_Handler_Instance.algorithm = ACOUSTIC_SL_ALGORITHM_GCCP;
  libSoundSourceLoc_Handler_Instance.ptr_M1_channels = 4;
  libSoundSourceLoc_Handler_Instance.ptr_M2_channels = 4;
  libSoundSourceLoc_Handler_Instance.ptr_M3_channels = 4;
  libSoundSourceLoc_Handler_Instance.ptr_M4_channels = 4;
  libSoundSourceLoc_Handler_Instance.samples_to_process = 512;
  (void)AcousticSL_getMemorySize(&libSoundSourceLoc_Handler_Instance);
  libSoundSourceLoc_Handler_Instance.pInternalMemory = (uint32_t *)malloc(libSoundSourceLoc_Handler_Instance.internal_memory_size);
  error_value += AcousticSL_Init(&libSoundSourceLoc_Handler_Instance);

  /*Setup Source Localization dynamic parameters*/
  libSoundSourceLoc_Config_Instance.resolution = 10;
  libSoundSourceLoc_Config_Instance.threshold = 24;
  error_value += AcousticSL_setConfig(&libSoundSourceLoc_Handler_Instance, &libSoundSourceLoc_Config_Instance);

  /*Error Management*/
  if (error_value != 0U)
  {
    Error_Handler();
  }

  /*Malloc Failure*/
  if (libSoundSourceLoc_Handler_Instance.pInternalMemory == NULL)
  {
    Error_Handler();
  }

}

void SW_IRQ_Tasks_Init(void)
{
  HAL_NVIC_SetPriority((IRQn_Type)EXTI1_IRQn, 0x0D, 0);
  HAL_NVIC_EnableIRQ((IRQn_Type)EXTI1_IRQn);

  HAL_NVIC_SetPriority((IRQn_Type)EXTI2_IRQn, 0x0E, 0);
  HAL_NVIC_EnableIRQ((IRQn_Type)EXTI2_IRQn);

}

void SW_Task1_Callback(void)
{

}

void SW_Task2_Callback(void)
{
  (void)AcousticSL_Process((int32_t *)&result, &libSoundSourceLoc_Handler_Instance);

  if (result[0] == ACOUSTIC_SL_NO_AUDIO_DETECTED)
  {
    result[0] = -1;
  }

  if (result[0] != -1)
  {
    char output[4];
    int32_t n = sprintf(output, "%li", (int32_t)result[0]);
    (void)HAL_UART_Transmit(&UartHandle, (uint8_t *)"    ", 4, 0xFFFF);
    (void)HAL_UART_Transmit(&UartHandle, (uint8_t *)"\r", 1, 0xFFFF);
    (void)HAL_UART_Transmit(&UartHandle, (uint8_t *)output, (uint16_t)n, 0xFFFF);
  }
}

void SW_Task1_Start(void)
{
  HAL_NVIC_SetPendingIRQ(EXTI1_IRQn);
}

void SW_Task2_Start(void)
{
  HAL_NVIC_SetPendingIRQ(EXTI2_IRQn);
}

void Error_Handler(void)
{
  while (1);
}


问:
IBM ACE Specified Character is not supported Error
Recently i installed IBM ACE 12.0.6.0 on Windows 10, and when i try to execute any command in IBM ACE Console this error output:

```<code>`C:\Program Files\IBM\ACE\12.0.6.0>mqsilist
WARNING: Specified charset is not supported, UTF-8 is used for default charset
Exception in thread "main" java/lang/ExceptionInInitializerError
        at java/lang/J9VMInternals.ensureError (J9VMInternals.java:145)
        at java/lang/J9VMInternals.recordInitializationFailure (J9VMInternals.java:134)
        at com/ibm/jvm/io/LocalizedInputStream.getInputStream (LocalizedInputStream.java:332)
        at java/io/InputStreamReader.<init> (InputStreamReader.java:87)
        at java/io/FileReader.<init> (FileReader.java:83)
        at sun/misc/MetaIndex.registerDirectory (MetaIndex.java:177)
        at sun/misc/Launcher$ExtClassLoader$1.run (Launcher.java:171)
        at sun/misc/Launcher$ExtClassLoader$1.run (Launcher.java:166)
        at java/security/AccessController.doPrivileged (AccessController.java:747)
        at sun/misc/Launcher$ExtClassLoader.createExtClassLoader (Launcher.java:165)
        at sun/misc/Launcher$ExtClassLoader.getExtClassLoader (Launcher.java:152)
        at sun/misc/Launcher.<init> (Launcher.java:82)
        at sun/misc/Launcher.<clinit> (Launcher.java:68)
        at java/lang/ClassLoader.initializeClassLoaders (ClassLoader.java:196)
        at java/lang/Thread.initialize (Thread.java:411)
        at java/lang/Thread.<init> (Thread.java:158)
java/nio/charset/UnsupportedCharsetException: MS65001
        at java/nio/charset/Charset.forName (Charset.java:579)
        at com/ibm/jvm/io/ConsoleInputStream.<clinit> (ConsoleInputStream.java:100)
        at com/ibm/jvm/io/LocalizedInputStream.getInputStream (LocalizedInputStream.java:332)
        at java/io/InputStreamReader.<init> (InputStreamReader.java:87)
        at java/io/FileReader.<init> (FileReader.java:83)
        at sun/misc/MetaIndex.registerDirectory (MetaIndex.java:177)
        at sun/misc/Launcher$ExtClassLoader$1.run (Launcher.java:171)
        at sun/misc/Launcher$ExtClassLoader$1.run (Launcher.java:166)
        at java/security/AccessController.doPrivileged (AccessController.java:747)
        at sun/misc/Launcher$ExtClassLoader.createExtClassLoader (Launcher.java:165)
        at sun/misc/Launcher$ExtClassLoader.getExtClassLoader (Launcher.java:152)
        at sun/misc/Launcher.<init> (Launcher.java:82)
        at sun/misc/Launcher.<clinit> (Launcher.java:68)
        at java/lang/ClassLoader.initializeClassLoaders (ClassLoader.java:196)
        at java/lang/Thread.initialize (Thread.java:411)
        at java/lang/Thread.<init> (Thread.java:158)`
</code>```

I check the current encoding charset

```<code>PS C:\Users\Admin> [System.Text.Encoding]::Default
IsSingleByte      : True
BodyName          : iso-8859-1
EncodingName      : Western European (Windows)
HeaderName        : Windows-1252
WebName           : Windows-1252
WindowsCodePage   : 1252
IsBrowserDisplay  : True
IsBrowserSave     : True
IsMailNewsDisplay : True
IsMailNewsSave    : True
EncoderFallback   : System.Text.InternalEncoderBestFitFallback
DecoderFallback   : System.Text.InternalDecoderBestFitFallback
IsReadOnly        : True
CodePage          : 1252

</code>```

And in Region section in Control Panel System Locale is set English(United States). I'm from Serbia if that's important.

I think this is encoding and Java problem, but i don't know how to change default charset.

Body:
Recently i installed IBM ACE 12.0.6.0 on Windows 10, and when i try to execute any command in IBM ACE Console this error output:

`C:\Program Files\IBM\ACE\12.0.6.0>mqsilist
WARNING: Specified charset is not supported, UTF-8 is used for default charset
Exception in thread "main" java/lang/ExceptionInInitializerError
        at java/lang/J9VMInternals.ensureError (J9VMInternals.java:145)
        at java/lang/J9VMInternals.recordInitializationFailure (J9VMInternals.java:134)
        at com/ibm/jvm/io/LocalizedInputStream.getInputStream (LocalizedInputStream.java:332)
        at java/io/InputStreamReader.<init> (InputStreamReader.java:87)
        at java/io/FileReader.<init> (FileReader.java:83)
        at sun/misc/MetaIndex.registerDirectory (MetaIndex.java:177)
        at sun/misc/Launcher$ExtClassLoader$1.run (Launcher.java:171)
        at sun/misc/Launcher$ExtClassLoader$1.run (Launcher.java:166)
        at java/security/AccessController.doPrivileged (AccessController.java:747)
        at sun/misc/Launcher$ExtClassLoader.createExtClassLoader (Launcher.java:165)
        at sun/misc/Launcher$ExtClassLoader.getExtClassLoader (Launcher.java:152)
        at sun/misc/Launcher.<init> (Launcher.java:82)
        at sun/misc/Launcher.<clinit> (Launcher.java:68)
        at java/lang/ClassLoader.initializeClassLoaders (ClassLoader.java:196)
        at java/lang/Thread.initialize (Thread.java:411)
        at java/lang/Thread.<init> (Thread.java:158)
java/nio/charset/UnsupportedCharsetException: MS65001
        at java/nio/charset/Charset.forName (Charset.java:579)
        at com/ibm/jvm/io/ConsoleInputStream.<clinit> (ConsoleInputStream.java:100)
        at com/ibm/jvm/io/LocalizedInputStream.getInputStream (LocalizedInputStream.java:332)
        at java/io/InputStreamReader.<init> (InputStreamReader.java:87)
        at java/io/FileReader.<init> (FileReader.java:83)
        at sun/misc/MetaIndex.registerDirectory (MetaIndex.java:177)
        at sun/misc/Launcher$ExtClassLoader$1.run (Launcher.java:171)
        at sun/misc/Launcher$ExtClassLoader$1.run (Launcher.java:166)
        at java/security/AccessController.doPrivileged (AccessController.java:747)
        at sun/misc/Launcher$ExtClassLoader.createExtClassLoader (Launcher.java:165)
        at sun/misc/Launcher$ExtClassLoader.getExtClassLoader (Launcher.java:152)
        at sun/misc/Launcher.<init> (Launcher.java:82)
        at sun/misc/Launcher.<clinit> (Launcher.java:68)
        at java/lang/ClassLoader.initializeClassLoaders (ClassLoader.java:196)
        at java/lang/Thread.initialize (Thread.java:411)
        at java/lang/Thread.<init> (Thread.java:158)`

I check the current encoding charset

PS C:\Users\Admin> [System.Text.Encoding]::Default
IsSingleByte      : True
BodyName          : iso-8859-1
EncodingName      : Western European (Windows)
HeaderName        : Windows-1252
WebName           : Windows-1252
WindowsCodePage   : 1252
IsBrowserDisplay  : True
IsBrowserSave     : True
IsMailNewsDisplay : True
IsMailNewsSave    : True
EncoderFallback   : System.Text.InternalEncoderBestFitFallback
DecoderFallback   : System.Text.InternalDecoderBestFitFallback
IsReadOnly        : True
CodePage          : 1252

And in Region section in Control Panel System Locale is set English(United States). I'm from Serbia if that's important.

I think this is encoding and Java problem, but i don't know how to change default charset.


问:
RPI UART receiving weird data
I have a Raspberry Pi 3B+ with an IC card reader that uses UART. The program is written in Python.
The data it receives is often wrong, but sometimes accurate.

There are 3 variations of the same card:

b'\\x02\\t\\x01\\xf4\\xec7\\xf6\\xd1\\x03'
HEX: f4ec37f6
DEC: 4109121526

b'\\x01\\x02\\x9d\\x85\\\\xfe'
HEX: 855cfe
DEC: 0008740094

b'\\x01\\x86\\x9d\\xc5\\\\xfe'
HEX: c55cfe
DEC: 0012934398
```

The first variation is the right one, which the card reader of my computer always reads the same result 4109121526, and it seldom appears on the RPI. For the other 2 variations, they always show up without a specific pattern.

The baud rate is 9600, I tried other rates, but it got even worse. The timeout is 0.5s, doesn't seem to matter.
Tried switching to a better power supply, nothing changed.
The store that sold me the reader told me to check the protocol and do data validation, but I have no idea what he's talking about. Is that related to the issue?

Got any idea? Thanks in advance!

Title: RPI UART receiving weird data

Body:
I have a Raspberry Pi 3B+ with an IC card reader that uses UART. The program is written in Python.
The data it receives is often wrong, but sometimes accurate.

There are 3 variations of the same card:

b'\\x02\\t\\x01\\xf4\\xec7\\xf6\\xd1\\x03'
HEX: f4ec37f6
DEC: 4109121526

b'\\x01\\x02\\x9d\\x85\\\\xfe'
HEX: 855cfe
DEC: 0008740094

b'\\x01\\x86\\x9d\\xc5\\\\xfe'
HEX: c55cfe
DEC: 0012934398

The first variation is the right one, which the card reader of my computer always reads the same result 4109121526, and it seldom appears on the RPI. For the other 2 variations, they always show up without a specific pattern.

The baud rate is 9600, I tried other rates, but it got even worse. The timeout is 0.5s, doesn't seem to matter.
Tried switching to a better power supply, nothing changed.
The store that sold me the reader told me to check the protocol and do data validation, but I have no idea what he's talking about. Is that related to the issue?

Got any idea? Thanks in advance!


问:
React JS - How to get multiple location info as autocomplete in a single input
I have a single input:

```<code><input autoComplete='street-address' value={location} />
</code>```

I'd like to get not only the user's street address as a hint but also a locality, postal code, etc... in the same input, that's possible?

I Searched through the documentation but I only found examples with multiple inputs but that's not what I'm searching for.

Edit:
I'll try to elaborate my question hiding sensitive data:
When I tap on my input I get, as hint, my home full address but when I tap on it the input is filled only with my street address.

Take a look at the screenshots below

Body:
I have a single input:

<input autoComplete='street-address' value={location} />

I'd like to get not only the user's street address as a hint but also a locality, postal code, etc... in the same input, that's possible?

I Searched through the documentation but I only found examples with multiple inputs but that's not what I'm searching for.

Edit:
I'll try to elaborate my question hiding sensitive data:
When I tap on my input I get, as hint, my home full address but when I tap on it the input is filled only with my street address.

Take a look at the screenshots below


问:
How to make a dark background for E-Mails in dark mode?
I got an issue while coding an HTML/CSS E-Mail template.
As you can see in my title it has something to do with dark mode.

If its not in dark mode I got a normal dark (f.ex.) background as I specified it in the stylesheet or directly in the HTML area.

Here I got a problem with my header (and footer).

So this is what I tried:

```<code><!--[if mso | IE]>
<table width="600" align="center" cellpadding="0" cellspacing="0" border="0">
    <tr>
        <td>
            <![endif]-->

<table class="content" align="center" width="100%" cellpadding="0" cellspacing="0" border="0" style="max-width:600px;">
<tr><td>

<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr><td align="center" valign="middle" style="background-color:rgb(38,38,38);padding:20px 0;border-bottom:2px solid rgb(175,150,100);">
<a href="https://voh-shop.de">
<img class="logo" src="img/k_logo_weiss-fs2.png" width="156" height="auto" border="0" alt="Logo" style="width:156px !important;"></a>
</td></tr>
</code>```

Don't worry about unclosed tables etc.
Its just the header and at all its working.

And here is the external CSS for dark mode (maybe this doesn't matter):
@media (prefers-color-scheme: dark) { HTML BODY, BODY P, BODY BLOCKQUOTE, BODY CENTER, BODY FORM, BODY UL, BODY LI, BODY OL, BODY PRE, BODY TABLE, BODY TD, BODY TR {color:rgb(255,255,255) !important;} .content * {color:rgb(255,255,255)!important;} .col50, #mfg, #details, .col100-summe {background:rgb(0,0,0)!important;} }

But that problem occurred just on Outlook and Gmail (-app).

As you can see the border-color is set as rgb(38,38,38) and that should be quiet dark :) but there is a setting on Outlook and Gmail which makes everything (text included) in dark mode bright like white.

That's how it was supposed to look like (MacOs default E-Mail App):

And that's how it actually looks like on Outlook (Windows App) and Gmail (iOs App):

I don't know yet how to solve this issue.

It would be very helpful if you could help me solving it.

Thx, JD

Body:
I got an issue while coding an HTML/CSS E-Mail template.
As you can see in my title it has something to do with dark mode.

If its not in dark mode I got a normal dark (f.ex.) background as I specified it in the stylesheet or directly in the HTML area.

Here I got a problem with my header (and footer).

So this is what I tried:

Don't worry about unclosed tables etc.
Its just the header and at all its working.

And here is the external CSS for dark mode (maybe this doesn't matter):
@media (prefers-color-scheme: dark) { HTML BODY, BODY P, BODY BLOCKQUOTE, BODY CENTER, BODY FORM, BODY UL, BODY LI, BODY OL, BODY PRE, BODY TABLE, BODY TD, BODY TR {color:rgb(255,255,255) !important;} .content * {color:rgb(255,255,255)!important;} .col50, #mfg, #details, .col100-summe {background:rgb(0,0,0)!important;} }

But that problem occurred just on Outlook and Gmail (-app).

As you can see the border-color is set as rgb(38,38,38) and that should be quiet dark :) but there is a setting on Outlook and Gmail which makes everything (text included) in dark mode bright like white.

That's how it was supposed to look like (MacOs default E-Mail App):

And that's how it actually looks like on Outlook (Windows App) and Gmail (iOs App):

I don't know yet how to solve this issue.

It would be very helpful if you could help me solving it.

Thx, JD


问:
Residual vs Fitted values plot, weird linear line
Thanks for taking the time to read my post.

I am researching the relationship between songs featured in TV series and their music popularity. By using a DiD, I have estimated the average treatment effect. Furthermore, I would like to conduct a simple residual analysis by plotting the fitted values. The plot seems "okay" but there is a weird linear line on the left which I cannot explain (see picture). Does somebody have an idea what this could indicate?

residual vs fitted values plot

There seems to be a pattern that looks linear. Although I am not investigating a linear relationship. What interpretations can I make about this plot?

Kind regards,
Max


问:
Setting textfields as integers or doubles in JavaFX JDBC Eclipse
I am writting a program where the user can input a set of data which will directly go into a database. Hence, where the user can input all the data he needs to fill in to insert it into the database, I need to make two of the textfields as integers and one as a double. However, I cannot seem to find what is the code to set a textfield as integer or double, instead of doing:
"expeditionDate.setText(Date)". Therefore, I was hoping if anyone knows the set of code to set a textfield as a integer or double. However, I cannot cast it into a String as I will need to make calcualtions using the data.</p>
```<code>void setTextField(String Date, double Time , int Altitude, int Distance, String Notes) {

        expeditionDate.setText(Date);
        expeditionTime.(Time);;
        expeditionAltitude.setText(Altitude);;
        expeditionDistance = Distance;
        expeditionNotes.setText(Notes);

    }

</code>```

Body:
I am writting a program where the user can input a set of data which will directly go into a database. Hence, where the user can input all the data he needs to fill in to insert it into the database, I need to make two of the textfields as integers and one as a double. However, I cannot seem to find what is the code to set a textfield as integer or double, instead of doing:
"expeditionDate.setText(Date)". Therefore, I was hoping if anyone knows the set of code to set a textfield as a integer or double. However, I cannot cast it into a String as I will need to make calcualtions using the data.

void setTextField(String Date, double Time , int Altitude, int Distance, String Notes) {

        expeditionDate.setText(Date);
        expeditionTime.(Time);;
        expeditionAltitude.setText(Altitude);;
        expeditionDistance = Distance;
        expeditionNotes.setText(Notes);

    }


问:
How can I handle Ineheritence for my data model Structs to have a Main Struct with different sub structs that represent different types?
I have various types of Worksheet structs that I use to populate a view, where the user fills out entries and these are then saved.

So far I've just used each struct individually, but I realized it would be more efficient to have a main 'Worksheet' struct that holds the common properties (id, date) so that I can reuse some views rather than creating a different view for every single type of Worksheet.

For example, here is how I read data of a certain worksheet:

```<code>  if let diaryArray = vm.readData(of: [Diary](), from: "diary_data") {
                let sortedArray = diaryArray.sorted(by: {$0.date > $1.date})
                vm.diaries = sortedArray
            }
</code>```

I'd like this to be something like

```<code> if let diaryArray = vm.readData(of: [T](), from: "\(path)_data") {
                let sortedArray = diaryArray.sorted(by: {$0.date > $1.date})
                vm.worksheets = sortedArray
            }
</code>```

So, I won't know what type of worksheet it is yet, but that it is a worksheet that has a date property for sure, so I can sort it by that, with this approach I could just reuse this view and function instead of having to write this for every type.

I've tried two ways so far to achieve this with my structs:

firstly, using protocols:

```<code>protocol Worksheet: Codable, Identifiable, Hashable {
  var id: String { get set }
  var date: Date { get set }
}

extension Worksheet {
static func parseVehicleFields(id: String, date: Date) -> (String, Date) {
    let id = ""
    let date = Date()
    return (id, date)
}
}

struct Diary: Worksheet {

var id: String
var date: Date

var title: String
var situation: String
var thoughts: String
var emotions: String
var physicalSensations: String
var behaviours: String
var analysis: String
var alternative: String
var outcome: String

init() {

    self.id = ""
    self.date = Date()

    self.title = ""
    self.situation = ""
    self.thoughts = ""
    self.emotions = ""
    self.physicalSensations = ""
    self.behaviours = ""
    self.analysis = ""
    self.alternative = ""
    self.outcome = ""
}

}

struct Goal: Worksheet {

var mainGoal: String

var notificationActive: Bool
var notificationDate: Date

var obstacles: String
var positiveBehaviours: String

var immediateActions: String

var goalAchieved: Bool

init() {

    self.mainGoal = ""
    self.notificationActive = false
    self.notificationDate = Date()

    self.obstacles = ""
    self.positiveBehaviours = ""

    self.immediateActions = ""
    self.goalAchieved = false
}

}
</code>```

It seems close, but I get the error of 'Type 'any Worksheet' cannot conform to 'Decodable''

when trying this:

```<code>            if let array = vm.readData(of: [any Worksheet](), from: "\(path)_data") {
                let sortedArray = array.sorted(by: {$0.date > $1.date})
                vm.worksheets = sortedArray
            }
</code>```

Here is the save function for reference:

```<code>func saveWorksheetProtocol<T: Worksheet>(for type: [T], to path: String) {
        let directoryURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first
        let documentURL = (directoryURL?.appendingPathComponent(path).appendingPathExtension("json"))!
        let jsonEncoder = JSONEncoder()
        let data = try? jsonEncoder.encode(type)
        do {
            try data?.write(to: documentURL, options: .noFileProtection)
        } catch {
            print("Error...Cannot save data!!!See error: \(error.localizedDescription)")
        }
    }
</code>```

It works if I use Diary as the parameter, but that defeats the point of trying to make this Generic to Worksheets, not their specific types.

Alternatively, I tried a method that creates a major Struct type of Worksheet, that contains the other types. This actually works nicely, except I have to hold empty data for EVERY type of worksheet, if I want to create an array of only 'Diary' entries for example, and this seems redundant and inefficient:

```<code>struct Worksheet: Codable, Identifiable, Hashable {

  var id: String
  var date: Date
  var diary: Diary2
  var goal: Goal2
  var experiment: Experiment2

init() {

    self.id = ""
    self.date = Date()
    self.diary = Diary2()
    self.goal = Goal2()
    self.experiment = Experiment2()

}

}

struct Diary: Codable, Hashable {

var title: String
var situation: String
var thoughts: String
var emotions: String
var physicalSensations: String
var behaviours: String
var analysis: String
var alternative: String
var outcome: String

init() {

    self.title = ""
    self.situation = ""
    self.thoughts = ""
    self.emotions = ""
    self.physicalSensations = ""
    self.behaviours = ""
    self.analysis = ""
    self.alternative = ""
    self.outcome = ""
}

}

struct Goal: Codable, Hashable {

var mainGoal: String

var notificationActive: Bool
var notificationDate: Date

var obstacles: String
var positiveBehaviours: String

var immediateActions: String

var goalAchieved: Bool

init() {

    self.mainGoal = ""
    self.notificationActive = false
    self.notificationDate = Date()

    self.obstacles = ""
    self.positiveBehaviours = ""

    self.immediateActions = ""
    self.goalAchieved = false
}

}
</code>```

So here I can just find a specific 'Worksheet', sort it, and then later access the values of whichever one it is, i.e. worksheet.diary.title, worksheet.goal.title etc. But this means each entry has redundant values of every other, and I tried making each type optional, but I could not then use them with bindings, as I was getting unresolvable unwrap errors, if the type i.e. 'Diary?' was optional in the Worksheet struct:

```<code>                    TextField("", text: $entry.diary!.title, axis: .vertical) <- error would be here, even when checking if diary exist first.
                        .lineLimit(20)
                        .disabled(!editMode)

</code>```

So I am looking for a way to handle my Worksheet types more efficiently, so that I can reduce repetitive code for functions and views where possible.

Body:
I have various types of Worksheet structs that I use to populate a view, where the user fills out entries and these are then saved.

So far I've just used each struct individually, but I realized it would be more efficient to have a main 'Worksheet' struct that holds the common properties (id, date) so that I can reuse some views rather than creating a different view for every single type of Worksheet.

For example, here is how I read data of a certain worksheet:

  if let diaryArray = vm.readData(of: [Diary](), from: "diary_data") {
                let sortedArray = diaryArray.sorted(by: {$0.date > $1.date})
                vm.diaries = sortedArray
            }

I'd like this to be something like

 if let diaryArray = vm.readData(of: [T](), from: "\(path)_data") {
                let sortedArray = diaryArray.sorted(by: {$0.date > $1.date})
                vm.worksheets = sortedArray
            }

So, I won't know what type of worksheet it is yet, but that it is a worksheet that has a date property for sure, so I can sort it by that, with this approach I could just reuse this view and function instead of having to write this for every type.

I've tried two ways so far to achieve this with my structs:

firstly, using protocols:

protocol Worksheet: Codable, Identifiable, Hashable {
  var id: String { get set }
  var date: Date { get set }
}

extension Worksheet {
static func parseVehicleFields(id: String, date: Date) -> (String, Date) {
    let id = ""
    let date = Date()
    return (id, date)
}
}

struct Diary: Worksheet {

var id: String
var date: Date

var title: String
var situation: String
var thoughts: String
var emotions: String
var physicalSensations: String
var behaviours: String
var analysis: String
var alternative: String
var outcome: String

init() {

    self.id = ""
    self.date = Date()

    self.title = ""
    self.situation = ""
    self.thoughts = ""
    self.emotions = ""
    self.physicalSensations = ""
    self.behaviours = ""
    self.analysis = ""
    self.alternative = ""
    self.outcome = ""
}

}

struct Goal: Worksheet {

var mainGoal: String

var notificationActive: Bool
var notificationDate: Date

var obstacles: String
var positiveBehaviours: String

var immediateActions: String

var goalAchieved: Bool

init() {

    self.mainGoal = ""
    self.notificationActive = false
    self.notificationDate = Date()

    self.obstacles = ""
    self.positiveBehaviours = ""

    self.immediateActions = ""
    self.goalAchieved = false
}

}

It seems close, but I get the error of 'Type 'any Worksheet' cannot conform to 'Decodable''

when trying this:

            if let array = vm.readData(of: [any Worksheet](), from: "\(path)_data") {
                let sortedArray = array.sorted(by: {$0.date > $1.date})
                vm.worksheets = sortedArray
            }

Here is the save function for reference:

func saveWorksheetProtocol<T: Worksheet>(for type: [T], to path: String) {
        let directoryURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first
        let documentURL = (directoryURL?.appendingPathComponent(path).appendingPathExtension("json"))!
        let jsonEncoder = JSONEncoder()
        let data = try? jsonEncoder.encode(type)
        do {
            try data?.write(to: documentURL, options: .noFileProtection)
        } catch {
            print("Error...Cannot save data!!!See error: \(error.localizedDescription)")
        }
    }

It works if I use Diary as the parameter, but that defeats the point of trying to make this Generic to Worksheets, not their specific types.

Alternatively, I tried a method that creates a major Struct type of Worksheet, that contains the other types. This actually works nicely, except I have to hold empty data for EVERY type of worksheet, if I want to create an array of only 'Diary' entries for example, and this seems redundant and inefficient:

struct Worksheet: Codable, Identifiable, Hashable {

  var id: String
  var date: Date
  var diary: Diary2
  var goal: Goal2
  var experiment: Experiment2

init() {

    self.id = ""
    self.date = Date()
    self.diary = Diary2()
    self.goal = Goal2()
    self.experiment = Experiment2()

}

}

struct Diary: Codable, Hashable {

var title: String
var situation: String
var thoughts: String
var emotions: String
var physicalSensations: String
var behaviours: String
var analysis: String
var alternative: String
var outcome: String

init() {

    self.title = ""
    self.situation = ""
    self.thoughts = ""
    self.emotions = ""
    self.physicalSensations = ""
    self.behaviours = ""
    self.analysis = ""
    self.alternative = ""
    self.outcome = ""
}

}

struct Goal: Codable, Hashable {

var mainGoal: String

var notificationActive: Bool
var notificationDate: Date

var obstacles: String
var positiveBehaviours: String

var immediateActions: String

var goalAchieved: Bool

init() {

    self.mainGoal = ""
    self.notificationActive = false
    self.notificationDate = Date()

    self.obstacles = ""
    self.positiveBehaviours = ""

    self.immediateActions = ""
    self.goalAchieved = false
}

}

So here I can just find a specific 'Worksheet', sort it, and then later access the values of whichever one it is, i.e. worksheet.diary.title, worksheet.goal.title etc. But this means each entry has redundant values of every other, and I tried making each type optional, but I could not then use them with bindings, as I was getting unresolvable unwrap errors, if the type i.e. 'Diary?' was optional in the Worksheet struct:

                    TextField("", text: $entry.diary!.title, axis: .vertical) <- error would be here, even when checking if diary exist first.
                        .lineLimit(20)
                        .disabled(!editMode)

So I am looking for a way to handle my Worksheet types more efficiently, so that I can reduce repetitive code for functions and views where possible.


问:
ngx-daterangepicker-material sending me back at the start month
I'm using ngx-daterangepicker-material in my project . which look like this

And as you can see the current month is December on left side and on the right side is January.
At this moment everything works fine but when I select no matter what kind of month starting from February till november it sending me back to the first screen with december and january. However the startdate and enddate are updated.

Here I select first march.

I use this Dom to diplay it.

```<code><ngx-daterangepicker-material *ngIf="selected?.startDate && selected?.endDate"
                              [locale]="locale"
                              [linkedCalendars]="true"
                              [minDate]="minDate"
                              [maxDate]="maxDate"
                              [dateLimit]="21"
                              [startDate]="this.selected.startDate"
                              [endDate]="this.selected.endDate"
                              (startDateChanged)="dateStart = $event"
                              (endDateChanged)="dateEnd = $event"
                              (datesUpdated)="chosenDate($event)">
</ngx-daterangepicker-material>
<ngx-daterangepicker-material *ngIf="!selected?.startDate || !selected?.endDate"
                              [locale]="locale"
                              [linkedCalendars]="true"
                              [minDate]="minDate"
                              [maxDate]="maxDate"
                              [dateLimit]="21"
                              [keepCalendarOpeningWithRange]="true"
                              (startDateChanged)="dateStart = $event"
                              (endDateChanged)="dateEnd = $event"
                              (datesUpdated)="chosenDate($event)">
</ngx-daterangepicker-material>
</code>```

and here is my typescript

```<code>export class FormDateRangePeriodPickerComponent {
  startDate: Moment;
  endDate: Moment;
  locale = {
    applyLabel: 'Continuer',
    daysOfWeek: moment.localeData('fr').weekdaysMin(),
    monthNames: moment.localeData('fr').months(),
    firstDay: moment.localeData('fr').firstDayOfWeek()
  };
  positions: ConnectedPosition[];

  @Input() showPicker = false;
  @Input() minDate: Moment;
  @Input() maxDate: Moment;
  @Input() selected: { startDate: Moment | undefined, endDate: Moment | undefined } = {
    startDate: undefined,
    endDate: undefined
  };
  @Input() isInNavbar = false;

  @Output() datesChanged = new EventEmitter<{ startDate: Moment, endDate: Moment }>();
  @Output() nextStep = new EventEmitter<void>();

  constructor() {
    const position: ConnectedPosition = {
      originX: 'start',
      originY: 'bottom',
      overlayX: 'start',
      overlayY: 'top'
    };
    this.positions = [position];
    console.log(this.startDate);
    console.log(this.endDate);
    console.log(this.selected?.startDate && this.selected?.endDate);
    console.log(!this.selected?.startDate || !this.selected?.endDate);
  }

  set dateStart(value: any) {
    this.startDate = value.startDate;
  }

  set dateEnd(value: any) {
    console.log(typeof(this.selected.startDate && this.selected.endDate));
    this.endDate = value.endDate;
    this.datesChanged.emit({startDate: this.startDate, endDate: this.endDate});
  }

  chosenDate(dates: any): void {
    this.showPicker = false;
    this.datesChanged.emit(dates);
    this.nextStep.emit();
  }

  classToApply(): string | string[] {
    return this.isInNavbar ? ['vsk__dropdown-date-picker', 'vsk__dropdown-navbar'] : 'vsk__dropdown-date-picker';
  }
</code>```

I tried to find why he is doing that when trigering the startDate

Body:
I'm using ngx-daterangepicker-material in my project . which look like this

And as you can see the current month is December on left side and on the right side is January.
At this moment everything works fine but when I select no matter what kind of month starting from February till november it sending me back to the first screen with december and january. However the startdate and enddate are updated.

Here I select first march.

I use this Dom to diplay it.

<ngx-daterangepicker-material *ngIf="selected?.startDate && selected?.endDate"
                              [locale]="locale"
                              [linkedCalendars]="true"
                              [minDate]="minDate"
                              [maxDate]="maxDate"
                              [dateLimit]="21"
                              [startDate]="this.selected.startDate"
                              [endDate]="this.selected.endDate"
                              (startDateChanged)="dateStart = $event"
                              (endDateChanged)="dateEnd = $event"
                              (datesUpdated)="chosenDate($event)">
</ngx-daterangepicker-material>
<ngx-daterangepicker-material *ngIf="!selected?.startDate || !selected?.endDate"
                              [locale]="locale"
                              [linkedCalendars]="true"
                              [minDate]="minDate"
                              [maxDate]="maxDate"
                              [dateLimit]="21"
                              [keepCalendarOpeningWithRange]="true"
                              (startDateChanged)="dateStart = $event"
                              (endDateChanged)="dateEnd = $event"
                              (datesUpdated)="chosenDate($event)">
</ngx-daterangepicker-material>

and here is my typescript

export class FormDateRangePeriodPickerComponent {
  startDate: Moment;
  endDate: Moment;
  locale = {
    applyLabel: 'Continuer',
    daysOfWeek: moment.localeData('fr').weekdaysMin(),
    monthNames: moment.localeData('fr').months(),
    firstDay: moment.localeData('fr').firstDayOfWeek()
  };
  positions: ConnectedPosition[];

  @Input() showPicker = false;
  @Input() minDate: Moment;
  @Input() maxDate: Moment;
  @Input() selected: { startDate: Moment | undefined, endDate: Moment | undefined } = {
    startDate: undefined,
    endDate: undefined
  };
  @Input() isInNavbar = false;

  @Output() datesChanged = new EventEmitter<{ startDate: Moment, endDate: Moment }>();
  @Output() nextStep = new EventEmitter<void>();

  constructor() {
    const position: ConnectedPosition = {
      originX: 'start',
      originY: 'bottom',
      overlayX: 'start',
      overlayY: 'top'
    };
    this.positions = [position];
    console.log(this.startDate);
    console.log(this.endDate);
    console.log(this.selected?.startDate && this.selected?.endDate);
    console.log(!this.selected?.startDate || !this.selected?.endDate);
  }

  set dateStart(value: any) {
    this.startDate = value.startDate;
  }

  set dateEnd(value: any) {
    console.log(typeof(this.selected.startDate && this.selected.endDate));
    this.endDate = value.endDate;
    this.datesChanged.emit({startDate: this.startDate, endDate: this.endDate});
  }

  chosenDate(dates: any): void {
    this.showPicker = false;
    this.datesChanged.emit(dates);
    this.nextStep.emit();
  }

  classToApply(): string | string[] {
    return this.isInNavbar ? ['vsk__dropdown-date-picker', 'vsk__dropdown-navbar'] : 'vsk__dropdown-date-picker';
  }

I tried to find why he is doing that when trigering the startDate


问:
WolfSSL Settings.h File shows some error during the project building. it shows Unresolved inclution: "stm32f4xx"
I am still studing about the WolfSSL Library. I'm usng Nucleo-STM32L476RG to run the programm.After generating the code,i try to build the code and then it shows error in settings.h file. The error shows like this
/Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfssl/wolfcrypt/settings.h:1367:22: fatal error: stm32f4xx_hal.h: No such file or directory

I try for solve this in many ways but non of them success. can some one help me to solve this problem

I try to make a TLS connection using WolfSSL. But it shows the error in settings.h file. i use L4 board for my works. but error shows like this
stm32f4xx_hal.h: No such file or directory

I try to comment this two lines because i dont need them

```<code>**        #elif defined(WOLFSSL_STM32F4)
            #include "stm32f4xx_hal.h"**
</code>```

after comment those lines it shows some other errors in the test.h file. it's like missing libraries.
when I try to add those libraries it shows more and more libraries.

below I put the Errors shown in the console panel

these are the errors shown in the consol panel

In file included from ../Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfssl/wolfcrypt/port/st/stsafe.h:25, from ../Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfcrypt/src/port/st/stsafe.c:22: ../Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfssl/wolfcrypt/settings.h:1367:22: fatal error: stm32f4xx_hal.h: No such file or directory 1367 | #include "stm32f4xx_hal.h" | ^~~~~~~~~~~~~~~~~ In file included from ../Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfcrypt/src/port/st/stm32.c:29: ../Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfssl/wolfcrypt/settings.h:1367:22: fatal error: stm32f4xx_hal.h: No such file or directory 1367 | #include "stm32f4xx_hal.h" | ^~~~~~~~~~~~~~~~~ compilation terminated. In file included from ../Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfcrypt/src/port/atmel/atmel.c:26: ../Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfssl/wolfcrypt/settings.h:1367:22: fatal error: stm32f4xx_hal.h: No such file or directory 1367 | #include "stm32f4xx_hal.h" | ^~~~~~~~~~~~~~~~~ compilation terminated. compilation terminated. In file included from ../Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfcrypt/test/test.c:29: ../Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfssl/wolfcrypt/settings.h:1367:22: fatal error: stm32f4xx_hal.h: No such file or directory 1367 | #include "stm32f4xx_hal.h" | ^~~~~~~~~~~~~~~~~ compilation terminated. make: *** [Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfcrypt/src/port/st/subdir.mk:22: Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfcrypt/src/port/st/stsafe.o] Error 1 make: *** Waiting for unfinished jobs.... make: *** [Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfcrypt/src/port/atmel/subdir.mk:19: Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfcrypt/src/port/atmel/atmel.o] Error 1 make: *** [Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfcrypt/test/subdir.mk:19: Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfcrypt/test/test.o] Error 1 make: *** [Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfcrypt/src/port/st/subdir.mk:22: Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfcrypt/src/port/st/stm32.o] Error 1 "make -j4 all" terminated with exit code 2. Build might be incomplete.

Body:
I am still studing about the WolfSSL Library. I'm usng Nucleo-STM32L476RG to run the programm.After generating the code,i try to build the code and then it shows error in settings.h file. The error shows like this
/Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfssl/wolfcrypt/settings.h:1367:22: fatal error: stm32f4xx_hal.h: No such file or directory

I try for solve this in many ways but non of them success. can some one help me to solve this problem

I try to make a TLS connection using WolfSSL. But it shows the error in settings.h file. i use L4 board for my works. but error shows like this
stm32f4xx_hal.h: No such file or directory

I try to comment this two lines because i dont need them

**        #elif defined(WOLFSSL_STM32F4)
            #include "stm32f4xx_hal.h"**

after comment those lines it shows some other errors in the test.h file. it's like missing libraries.
when I try to add those libraries it shows more and more libraries.

below I put the Errors shown in the console panel

these are the errors shown in the consol panel

In file included from ../Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfssl/wolfcrypt/port/st/stsafe.h:25, from ../Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfcrypt/src/port/st/stsafe.c:22: ../Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfssl/wolfcrypt/settings.h:1367:22: fatal error: stm32f4xx_hal.h: No such file or directory 1367 | #include "stm32f4xx_hal.h" | ^~~~~~~~~~~~~~~~~ In file included from ../Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfcrypt/src/port/st/stm32.c:29: ../Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfssl/wolfcrypt/settings.h:1367:22: fatal error: stm32f4xx_hal.h: No such file or directory 1367 | #include "stm32f4xx_hal.h" | ^~~~~~~~~~~~~~~~~ compilation terminated. In file included from ../Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfcrypt/src/port/atmel/atmel.c:26: ../Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfssl/wolfcrypt/settings.h:1367:22: fatal error: stm32f4xx_hal.h: No such file or directory 1367 | #include "stm32f4xx_hal.h" | ^~~~~~~~~~~~~~~~~ compilation terminated. compilation terminated. In file included from ../Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfcrypt/test/test.c:29: ../Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfssl/wolfcrypt/settings.h:1367:22: fatal error: stm32f4xx_hal.h: No such file or directory 1367 | #include "stm32f4xx_hal.h" | ^~~~~~~~~~~~~~~~~ compilation terminated. make: *** [Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfcrypt/src/port/st/subdir.mk:22: Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfcrypt/src/port/st/stsafe.o] Error 1 make: *** Waiting for unfinished jobs.... make: *** [Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfcrypt/src/port/atmel/subdir.mk:19: Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfcrypt/src/port/atmel/atmel.o] Error 1 make: *** [Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfcrypt/test/subdir.mk:19: Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfcrypt/test/test.o] Error 1 make: *** [Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfcrypt/src/port/st/subdir.mk:22: Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfcrypt/src/port/st/stm32.o] Error 1 "make -j4 all" terminated with exit code 2. Build might be incomplete.


问:
Shopware5 with a reverse proxy forwarding issue
I have installed shopware5 in a docker container and made it to go out with a reverse proxy nginx.
After the installation, the main page of the website works, but when I click on any of it's tabs, it forwards to the container directly and changes the address in the URL to the address and the port of the container. Therefore it shows that the website cant be reached.

I am wondering if this could be something related to the nginx or the shopware itself.
Any advises will be greatly appreciated.

this is the configuration of the proxy:

```<code>server {
    listen 443 ssl http2;
#    listen 80 http2;
    server_name domainname.com;

    ssl_certificate       /etc/nginx/certificates/domainname.crt;
    ssl_certificate_key   /etc/nginx/certificates/domainname.key;

    ssl_session_timeout 10m;
    ssl_protocols TLSv1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    ssl_ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS;
    ssl_ecdh_curve secp384r1;

#    root /var/www/html;

    error_log /var/log/nginx/domain-error.log;
    access_log /var/log/nginx/domain-access.log;

    add_header Access-Control-Allow-Origin *;

    location / {
       proxy_pass   http://localhost:8081/;

    }

    }

</code>```

Body:
I have installed shopware5 in a docker container and made it to go out with a reverse proxy nginx.
After the installation, the main page of the website works, but when I click on any of it's tabs, it forwards to the container directly and changes the address in the URL to the address and the port of the container. Therefore it shows that the website cant be reached.

I am wondering if this could be something related to the nginx or the shopware itself.
Any advises will be greatly appreciated.

this is the configuration of the proxy:

server {
    listen 443 ssl http2;
#    listen 80 http2;
    server_name domainname.com;

    ssl_certificate       /etc/nginx/certificates/domainname.crt;
    ssl_certificate_key   /etc/nginx/certificates/domainname.key;

    ssl_session_timeout 10m;
    ssl_protocols TLSv1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    ssl_ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS;
    ssl_ecdh_curve secp384r1;

#    root /var/www/html;

    error_log /var/log/nginx/domain-error.log;
    access_log /var/log/nginx/domain-access.log;

    add_header Access-Control-Allow-Origin *;

    location / {
       proxy_pass   http://localhost:8081/;

    }

    }


问:
GITLAB CI dependency:get does not find pom file cause of TIMESTAMPLE
I deploy maven packages on gitlab artifact. Maven called them xxx-api-model-2.0.2-20221223.095542-17.pom
My mvn dependency:get from docker file in another folder search for xxx-api-model-2.0.2.pom

Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.2.0:get (default-cli) on project xxx-action-batch: Couldn't download artifact: org.eclipse.aether.resolution.DependencyResolutionException: Could not find artifact xxx:xxx-api-model:jar:2.0.2 in gitlab-maven
```
<p>Here is settings file:</p>
```<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                              https://maven.apache.org/xsd/settings-1.0.0.xsd">

  <servers>
    <server>

Body:
I deploy maven packages on gitlab artifact. Maven called them xxx-api-model-2.0.2-20221223.095542-17.pom
My mvn dependency:get from docker file in another folder search for xxx-api-model-2.0.2.pom

Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.2.0:get (default-cli) on project xxx-action-batch: Couldn't download artifact: org.eclipse.aether.resolution.DependencyResolutionException: Could not find artifact xxx:xxx-api-model:jar:2.0.2 in gitlab-maven

Here is settings file:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                              https://maven.apache.org/xsd/settings-1.0.0.xsd">

  <servers>
    <server>


问:
Twincat3 ST variables conversion
I have some complicated array of structures and I want to write it into CSV file. So I need "variable to string" conversion.
Beckhoff as always doesn't care about documentation and their INT_TO_STRING function doesn't work (UNEXPECTED INT_TO_STRING TOKEN when I try to write INT_TO_STRING(20) ).
Moreover their string functions works correctly with only 255 chars.

So I need one of following:

working functions or function blocks or library which allows to convert different types to string

something like sprintf without limitations

some functions to convert between number and ascii char (0x55 is letter 'U') in both directions.

btw. Beckhoff gives us some weird CSV example code, but without data conversion (array has already strings in cells).

Thanks in advance!

I tried to use:
INT_TO_STRING() BYTE_TO_STRING() WHATEVER_TO_STRING()

but it is not working. And there is no clue how many arguments it should have or anything. There is no documentation in Beckhoff information System.

Title: Twincat3 ST variables conversion


问:
TraceError: Proxy object cannot be iterated
the most appropriate soln I found was this one
https://pytorch.org/vision/stable/feature_extraction.html but i end up w/ this error

TraceError: Proxy object cannot be iterated. This can be attempted when the Proxy is used in a loop or as a *args or **kwargs function argument. See the torch.fx docs on pytorch.org for a more detailed explanation of what types of control flow can be traced, and check out the Proxy docstring for help troubleshooting Proxy iteration errors

My Code

```<code>from torchvision.models.feature_extraction import create_feature_extractor
from torchvision.models.detection import fasterrcnn_mobilenet_v3_large_320_fpn

m = fasterrcnn_mobilenet_v3_large_320_fpn()

return_nodes = {
    'layer1': 'layer1'
}

create_feature_extractor(m, return_nodes=return_nodes)
return_nodes
</code>```

Body:
the most appropriate soln I found was this one
https://pytorch.org/vision/stable/feature_extraction.html but i end up w/ this error

TraceError: Proxy object cannot be iterated. This can be attempted when the Proxy is used in a loop or as a *args or **kwargs function argument. See the torch.fx docs on pytorch.org for a more detailed explanation of what types of control flow can be traced, and check out the Proxy docstring for help troubleshooting Proxy iteration errors

My Code

from torchvision.models.feature_extraction import create_feature_extractor
from torchvision.models.detection import fasterrcnn_mobilenet_v3_large_320_fpn

m = fasterrcnn_mobilenet_v3_large_320_fpn()

return_nodes = {
    'layer1': 'layer1'
}

create_feature_extractor(m, return_nodes=return_nodes)
return_nodes


问:
In Javascript, is it possible to communicate to workers while inside while-loop?
I have a recursive calculation, which I handle using a manual call stack.

```<code>var stack = initialListOfTasks();

while (stack.length > 0) {
    var todo = stack.shift();

    performTask(stack, todo);
}
</code>```

The function performTask() adds new tasks to the stack and this works fine.

The individual functions could be done independently of one another, which is why, in attempt to make the code run more quickly, I would like to distribute the tasks in the call stack to a number of workers. The problem is, from the while-loop I use to go through the tasks I don't know how to communicate with workers.

Possibly naively, I tried the following for example.

```<code>var stack = initialListOfTasks();

var n_workers = navigator.hardwareConcurrency;
var n_workers_in_use = 0;

while (stack.length > 0 || n_workers_in_use > 0) {
    if (stack.length > 0 && n_workers_in_use < n_workers) {
        var todo = stack.shift();

        var worker = new Worker("worker.js");
        worker.postMessage(todo);
        n_workers_in_use++;

        worker.onmessage = function(obj) {
            var new_tasks = obj.data;
            stack = stack.concat(new_tasks);

            n_workers_in_use--;
            worker.terminate();
        };
    }
}
</code>```

This creates an infinite loop, because n_workers_in_use is increased, but never decreased because the onmessage function is never triggered. I also tried opening a number of n_workers of workers outside of the while-loop and posting messages to it inside the while-loop, but this does not work either. It is only after I manually exit the while-loop, I can see that that the onmessage function is triggered.

Is there a way to get this onmessage to trigger and change the values of stack and n_workers_in_use from inside the while-loop? Or is there maybe a way of doing this without a while-loop? Help is much appreciated!

Body:
I have a recursive calculation, which I handle using a manual call stack.

var stack = initialListOfTasks();

while (stack.length > 0) {
    var todo = stack.shift();

    performTask(stack, todo);
}

The function performTask() adds new tasks to the stack and this works fine.

The individual functions could be done independently of one another, which is why, in attempt to make the code run more quickly, I would like to distribute the tasks in the call stack to a number of workers. The problem is, from the while-loop I use to go through the tasks I don't know how to communicate with workers.

Possibly naively, I tried the following for example.

var stack = initialListOfTasks();

var n_workers = navigator.hardwareConcurrency;
var n_workers_in_use = 0;

while (stack.length > 0 || n_workers_in_use > 0) {
    if (stack.length > 0 && n_workers_in_use < n_workers) {
        var todo = stack.shift();

        var worker = new Worker("worker.js");
        worker.postMessage(todo);
        n_workers_in_use++;

        worker.onmessage = function(obj) {
            var new_tasks = obj.data;
            stack = stack.concat(new_tasks);

            n_workers_in_use--;
            worker.terminate();
        };
    }
}

This creates an infinite loop, because n_workers_in_use is increased, but never decreased because the onmessage function is never triggered. I also tried opening a number of n_workers of workers outside of the while-loop and posting messages to it inside the while-loop, but this does not work either. It is only after I manually exit the while-loop, I can see that that the onmessage function is triggered.

Is there a way to get this onmessage to trigger and change the values of stack and n_workers_in_use from inside the while-loop? Or is there maybe a way of doing this without a while-loop? Help is much appreciated!


问:
Is there any decrease in time to load a website hosted in AWS amplify if region is changed from location 1 to location 2(all users are from Ioc 2)
I have a website hosted on AWS amplify which has region in USA and I want to change region from USA TO India. Is there any decrease in website load speed(it is slow) if I do so. All my users are located in India.
I am asking this as amplify already has CDN enabled in it.
Thank you.


问:
3D_CNN for stock trend Prediction
I have the data from several Stocks and want to cerate 3D_CNN for trend Prediction(binary classification)
anybody have idea or example for create this model?(the number of layer,polling,con2d,con3d,...)
I want to use keras in python</p>

Title: 3D_CNN for stock trend Prediction


问:
simultaneously api request take higher time in seprate vue.js app with laravel backend

"laravel": "9.x",

"vue": "2.x",

"axios": "^0.27.2"

I am using separate vue.js applications and laravel 9.x, multiple API requests take too much time I don't know why it happens,

case 1:

a get user API call takes 500ms, if I call this API 10 times at the same time response time of each request will be 7s in the browser network tab. whereas a single API call works fine

case 2:

if multiple API requests call the same time it's taking too much time like 7s but if I call each API individually each API take max 500ms, inside postman as well as inside the application network window of the browser

endpoint

http://127.0.0.1:8000/api/services?type=client

 Route::resource('services', ServiceController::class);

code for get services inside the controller

```<code> public function index(Request $request)
    {
        $services = Service::when($request->q, function ($query, $q) {
            return $query->where('name', 'LIKE', "%{$q}%");
        })
            ->when($request->type, function ($query, $type) {
                return $query->where('type', '=', $type);
            })
            ->when($request->sortBy, function ($query, $sortBy) {
                return $query->orderBy($sortBy, request('sortDesc') == 'true' ? 'asc' : 'desc');
            })
            ->when($request->page, function ($query, $page) {
                return $query->offset($page - 1);
            })
            ->paginate($request->perPage);

        return $this->respond([
            'status' => true,
            'message' => 'Services has been Fetched Successfully!',
            'data' => [
                'services' => ServiceResource::collection($services)
            ],
        ]);
    }
</code>```

resource class ServiceResource.php

```<code><?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class ServiceResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
     */
    public function toArray($request)
    {
        return [
            'uuid' => $this->resource->service_uuid,
            'name' => $this->resource->name,
            'type' => $this->resource->type,
            'icon' => $this->resource->icon,
            'image' => $this->resource->image,
            'is_selected' => false,
        ];
    }
}

</code>```

API call from postman

query execution time is 29ms sec for a single API

if I call API at once from the front-end vue.js app then the response time is normal(500ms ),

request payload

request preview

but if I call this API multiple times at once(simultaneously) then its response increases(5 to 7 sec),

in case of multiple API call simultaneously, why does it take (5 to 7) sec or it's an issue related to the front-end app that the question?

Body:
"laravel": "9.x",

"vue": "2.x",

"axios": "^0.27.2"

I am using separate vue.js applications and laravel 9.x, multiple API requests take too much time I don't know why it happens,

case 1:

a get user API call takes 500ms, if I call this API 10 times at the same time response time of each request will be 7s in the browser network tab. whereas a single API call works fine

case 2:

if multiple API requests call the same time it's taking too much time like 7s but if I call each API individually each API take max 500ms, inside postman as well as inside the application network window of the browser

endpoint

http://127.0.0.1:8000/api/services?type=client

 Route::resource('services', ServiceController::class);

code for get services inside the controller

 public function index(Request $request)
    {
        $services = Service::when($request->q, function ($query, $q) {
            return $query->where('name', 'LIKE', "%{$q}%");
        })
            ->when($request->type, function ($query, $type) {
                return $query->where('type', '=', $type);
            })
            ->when($request->sortBy, function ($query, $sortBy) {
                return $query->orderBy($sortBy, request('sortDesc') == 'true' ? 'asc' : 'desc');
            })
            ->when($request->page, function ($query, $page) {
                return $query->offset($page - 1);
            })
            ->paginate($request->perPage);

        return $this->respond([
            'status' => true,
            'message' => 'Services has been Fetched Successfully!',
            'data' => [
                'services' => ServiceResource::collection($services)
            ],
        ]);
    }

resource class ServiceResource.php

<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class ServiceResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
     */
    public function toArray($request)
    {
        return [
            'uuid' => $this->resource->service_uuid,
            'name' => $this->resource->name,
            'type' => $this->resource->type,
            'icon' => $this->resource->icon,
            'image' => $this->resource->image,
            'is_selected' => false,
        ];
    }
}

API call from postman

query execution time is 29ms sec for a single API

if I call API at once from the front-end vue.js app then the response time is normal(500ms ),

request payload

request preview

but if I call this API multiple times at once(simultaneously) then its response increases(5 to 7 sec),

in case of multiple API call simultaneously, why does it take (5 to 7) sec or it's an issue related to the front-end app that the question?