问:
How can i format an input and output LocalDate with SpringBoot?
How can i format an input and output LocalDate using SpringBoot?
I'm using Postman to test my endpoints,but when trying to insert a date I get the error:

Cannot deserialize value of type java.time.LocalDate from String

After researching I found that the @JsonFormat(pattern = "dd-MM-yyyy") annotation solved my problem when inserting the date in the format I need.

```<code>@JsonFormat(pattern = "dd-MM-yyyy")
    private LocalDate receivedDate;
</code>```

But when listing the registered data, the date is still in the "yyyy-MM-dd" pattern, how can I make it so that the output is formatted like this "dd-MM-yyyy" the same as the input?

```<code>{
  "receivedDate": "12-08-2022"
}
</code>```

Body:
How can i format an input and output LocalDate using SpringBoot?
I'm using Postman to test my endpoints,but when trying to insert a date I get the error:

Cannot deserialize value of type java.time.LocalDate from String

After researching I found that the @JsonFormat(pattern = "dd-MM-yyyy") annotation solved my problem when inserting the date in the format I need.

@JsonFormat(pattern = "dd-MM-yyyy")
    private LocalDate receivedDate;

But when listing the registered data, the date is still in the "yyyy-MM-dd" pattern, how can I make it so that the output is formatted like this "dd-MM-yyyy" the same as the input?

{
  "receivedDate": "12-08-2022"
}


来源: stackexchange

问:
If some events with user_id and others only with user_pseudo_id GA4 will be able to build a funnel?
Such a case:

Users come from an external source to my site example.com . At this moment I don't have a permanent user_id, GA sets a user_pseudo_id

Then users log in to auth.example.com and at this moment there is still no me there is no permanent user_id, only user_pseudo_id (I assume the same as in the previous step, because the domain has not changed)

After authorization, there is a redirect to dash.example.com, here I set the persistent user_id for the user and send all events in GA4 with this user_id, but there is also a user_pseudo_id (the same as in the previous steps)

In this case when I'll build a funnel, how GA4 will connect events that do not have a user_id, but only user_pseudo_id, and events that have user_id and user_pseudo_id. Will it be able to understand that these events are from one user to build the funnel correctly. Or does GA divide users after setting user_id (on the step3 in the case)?

I tried to build a funnel (example.com => auth.example.com => dash.example.com), but some of the events in it are lost.

ContentLicense: CC BY-SA 4.0


问:
Neo4j query to get json data from Elastic
I am trying to read my json data from elasticsearch instance. the data contains 200k entries and I can load only upto 10k at a time. I am using APOC and trying to execute pagination scroll, but it doesn't show me any records. No errors are also shown. please help

```<code>// First query: get first chunk of data + the scroll_id for pagination
CALL apoc.es.query('s365-overwatch-v2-dev-manage-services.australiaeast.cloudapp.azure.com','ref','_search','size=1&scroll=5m',null) yield value with value._scroll_id as scrollId, value.hits.hits as hits
// Do something with hits
UNWIND hits as hit
// Here we simply create a document and a relation to a company
MERGE (doc:Document {id: hit._docID, description: hit._source.date})
// Then call for the other docs and use the scrollId value from previous query
// Use a range to count our chunk of data (i.e. i want to get chunks from 2 to 10)
WITH range(2,10,1) as list, scrollId
UNWIND list as count
CALL apoc.es.get("s365-overwatch-v2-dev-manage-services.australiaeast.cloudapp.azure.com","ref","_search",null,{scroll:"5m",scroll_id:scrollId},null) yield value with value._scoll_id as scrollId, value.hits.hits as nextHits
// Again, do something with hits
UNWIND nextHits as hit
MERGE (doc:Document {id: hit._docID, description: hit._source.date})
return scrollId, doc
</code>```

enter image description here
json data url: http://s365-overwatch-v2-dev-manage-services.australiaeast.cloudapp.azure.com:9200/ref/_search/?size=10000

Body:
I am trying to read my json data from elasticsearch instance. the data contains 200k entries and I can load only upto 10k at a time. I am using APOC and trying to execute pagination scroll, but it doesn't show me any records. No errors are also shown. please help

// First query: get first chunk of data + the scroll_id for pagination
CALL apoc.es.query('s365-overwatch-v2-dev-manage-services.australiaeast.cloudapp.azure.com','ref','_search','size=1&scroll=5m',null) yield value with value._scroll_id as scrollId, value.hits.hits as hits
// Do something with hits
UNWIND hits as hit
// Here we simply create a document and a relation to a company
MERGE (doc:Document {id: hit._docID, description: hit._source.date})
// Then call for the other docs and use the scrollId value from previous query
// Use a range to count our chunk of data (i.e. i want to get chunks from 2 to 10)
WITH range(2,10,1) as list, scrollId
UNWIND list as count
CALL apoc.es.get("s365-overwatch-v2-dev-manage-services.australiaeast.cloudapp.azure.com","ref","_search",null,{scroll:"5m",scroll_id:scrollId},null) yield value with value._scoll_id as scrollId, value.hits.hits as nextHits
// Again, do something with hits
UNWIND nextHits as hit
MERGE (doc:Document {id: hit._docID, description: hit._source.date})
return scrollId, doc

enter image description here
json data url: http://s365-overwatch-v2-dev-manage-services.australiaeast.cloudapp.azure.com:9200/ref/_search/?size=10000


问:
Assertion error (org.junit.ComparisonFailure: expected:<[Find Us]> but was:<[]>)
When i inspect element on web page it shows empty instead of "find us" I used this method in Step definition

```<code>String getHeading = base.getHeadingText();
System.out.println(getHeading);
Assert.assertEquals(heading, getHeading);
base.teardown();
</code>```

Getting error in Automation Scripts. Anyone could you please help

Body:
When i inspect element on web page it shows empty instead of "find us" I used this method in Step definition

String getHeading = base.getHeadingText();
System.out.println(getHeading);
Assert.assertEquals(heading, getHeading);
base.teardown();

Getting error in Automation Scripts. Anyone could you please help


问:
GPO MSI Install - Error 1305.Error reading from file
Windows Server 2016

Adobe Reader DC msi

Hi

I'm trying to install Adobe Reader remotely and silently to a set of PCs in a Windows Domain.
I have setup a network share, ABC-Deploy$, containing the Acroread.msi together with a GPO (software install) policy to effect this. So far I have not managed to get it working.

Having spent some time trying to isolate what I thought might be a policy failure, I decided simply to click on the MSI in the shared folder to see if it would install. I did this as an admin user on the server itself i.e. where the shared folder containing the msi resides. After the 'do you want to install' preamble the attempts fail with the following prompt:-

Error 1305.Error reading from file C:\ABC-Deploy$\AcroRdrDC2200320282_en_US\AcroRead.msi.  Verify that the file exists and that you can access it.

Clearly the file does exist as I have just clicked on it. I have researched this ad nauseam looking at share permissions, NTFS permissions, msiexec parms, admin user rights, clearing temporary files, clearing the registry etc all to no avail. I concentrated on permissions since the msiexec.exe runs under SYSTEM and I'm calling it from a domain admin user.

At present, the ABC-Deploy$ folder has the following permissions:-

Share Permissions
Value

Everyone
Full Control

NTFS Permissions
Value

Everyone
Full Control

SYSTEM
Full Control

Local Admins
Full Control

ANONYMOUS LOGON
Read

All PCs (Domain Security Grp)
Read and Execute

sysadmin (Domain Administrator)
Full Control

I have tried many, many permutations of permissions none of which seem to make any difference.

Any ideas how to resolve this anyone?

Thanks


问:
AttributeError 'NoneType' object has no attribute 'outer_context'
I'm building a basic sentiment analysis model using a pretrained elmo model, but the interpreter stops at at the model.fit() line due to the error AttributeError 'NoneType' object has no attribute 'outer_context' in spite of the fact that I am passing my input text to model.fit() as a numpy array

I'm loading elmo locally

```<code>elmo_path = r"C:\Users\name\Downloads\elmo"
elmo_module = hub.KerasLayer(elmo_path)
</code>```

followed by a super basic model definition

```<code>input_text = keras.layers.Input(shape=(), dtype=tf.string)
embeddings = elmo_module(input_text)
dense = keras.layers.Dense(256, activation="relu")(embeddings)
predictions = keras.layers.Dense(1, activation="sigmoid")(dense)
model = keras.Model(inputs=[input_text], outputs=predictions)
</code>```

convert lemmatized training data to numpy array

```<code>X_train_lemmatized = np.asarray(X_train_lemmatized)
</code>```

compile my model

```<code>model.compile(loss="binary_crossentropy", optimizer="adam", metrics=["accuracy"])
</code>```

and then fit it on some lemmatized training data (which has already been converted to a numpy array)

```<code>model.fit(X_train_lemmatized, y_train, epochs=1, batch_size=64)
</code>```

Here is the complete error message. It looks to me like the tape variable isn't being initialised properly?

```<code>    File "C:\Users\name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\keras\engine\training.py", line 1160, in train_function  *
        return step_function(self, iterator)
    File "C:\Users\name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\keras\engine\training.py", line 1146, in step_function  **
        outputs = model.distribute_strategy.run(run_step, args=(data,))
    File "C:\Users\name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\keras\engine\training.py", line 1135, in run_step  **
        outputs = model.train_step(data)
    File "C:\Users\name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\keras\engine\training.py", line 997, in train_step
        self.optimizer.minimize(loss, self.trainable_variables, tape=tape)
    File "C:\Users\name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\keras\optimizers\optimizer_v2\optimizer_v2.py", line 576, in minimize
        grads_and_vars = self._compute_gradients(
    File "C:\Users\name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\keras\optimizers\optimizer_v2\optimizer_v2.py", line 634, in _compute_gradients
        grads_and_vars = self._get_gradients(
    File "C:\Users\name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\keras\optimizers\optimizer_v2\optimizer_v2.py", line 510, in _get_gradients
        grads = tape.gradient(loss, var_list, grad_loss)

    AttributeError: 'NoneType' object has no attribute 'outer_context'
</code>```

Body:
I'm building a basic sentiment analysis model using a pretrained elmo model, but the interpreter stops at at the model.fit() line due to the error AttributeError 'NoneType' object has no attribute 'outer_context' in spite of the fact that I am passing my input text to model.fit() as a numpy array

I'm loading elmo locally

elmo_path = r"C:\Users\name\Downloads\elmo"
elmo_module = hub.KerasLayer(elmo_path)

followed by a super basic model definition

input_text = keras.layers.Input(shape=(), dtype=tf.string)
embeddings = elmo_module(input_text)
dense = keras.layers.Dense(256, activation="relu")(embeddings)
predictions = keras.layers.Dense(1, activation="sigmoid")(dense)
model = keras.Model(inputs=[input_text], outputs=predictions)

convert lemmatized training data to numpy array

X_train_lemmatized = np.asarray(X_train_lemmatized)

compile my model

model.compile(loss="binary_crossentropy", optimizer="adam", metrics=["accuracy"])

and then fit it on some lemmatized training data (which has already been converted to a numpy array)

model.fit(X_train_lemmatized, y_train, epochs=1, batch_size=64)

Here is the complete error message. It looks to me like the tape variable isn't being initialised properly?

    File "C:\Users\name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\keras\engine\training.py", line 1160, in train_function  *
        return step_function(self, iterator)
    File "C:\Users\name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\keras\engine\training.py", line 1146, in step_function  **
        outputs = model.distribute_strategy.run(run_step, args=(data,))
    File "C:\Users\name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\keras\engine\training.py", line 1135, in run_step  **
        outputs = model.train_step(data)
    File "C:\Users\name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\keras\engine\training.py", line 997, in train_step
        self.optimizer.minimize(loss, self.trainable_variables, tape=tape)
    File "C:\Users\name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\keras\optimizers\optimizer_v2\optimizer_v2.py", line 576, in minimize
        grads_and_vars = self._compute_gradients(
    File "C:\Users\name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\keras\optimizers\optimizer_v2\optimizer_v2.py", line 634, in _compute_gradients
        grads_and_vars = self._get_gradients(
    File "C:\Users\name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\keras\optimizers\optimizer_v2\optimizer_v2.py", line 510, in _get_gradients
        grads = tape.gradient(loss, var_list, grad_loss)

    AttributeError: 'NoneType' object has no attribute 'outer_context'


问:
How to install chromedriver with binman package on Mac
I am trying to work with RSelenium and chromedriver on a Mac with an M2 chip. Since one of the last updates the combination of chrome/chromedriver doesn't work anymore. The installed chromedriver version doesn't fit to the installed chrome version. I tried to update chromedriver, but without success. When running

binman::list_versions("chromedriver")

I get

```<code>$mac64_m1
[1] "105.0.5195.19" "105.0.5195.52" "106.0.5249.21"
</code>```

The problem is: I don't know why those versions are installed, where they are installed and how I can update them from within binman or wdman .

I followed the installation guide for chromedriver on Mac here https://www.swtestacademy.com/install-chrome-driver-on-mac/ but that didn't change anything. It also didn't add the installed version to the ones being recognised by binman.

When I am using the search function, I can't find any of the chrome drivers that binman identifies, but I can find the version that I downloaded (and moved to library/bin/).

Does anybody know how I can find the directory in which the binman chromedriver versions are installed? How can I install the latest chromedriver or a specific version with binman or wdman? I also tried

```<code>app_dir("chromedriver", check = TRUE)
</code>```

which doesn't give any results

Best regards

UPDATE:

I found the solution.

Find the binman_chromedriver directory on your MAC. You can use RStudio for that:

```<code>appdir <- binman::app_dir("chromedriver", check = TRUE)
appdir
</code>```

Open up MAC Terminal and go to the binman_chromedriver directory

Within that directory, create a new folder with the name of the chromedriver version you want to install.

```<code>mkdir 108.0.5359.71
</code>```

Go into the new folder

```<code>cd 108.0.5359.71
</code>```

Download the zipped version of chromedriver (copy+paste the link from your browser)

```<code>curl -O https://chromedriver.storage.googleapis.com/108.0.5359.71/chromedriver_mac_arm64.zip
</code>```

Unzip

```<code>unzip chromedriver_mac_arm64.zip
</code>```

go back to RStudio and check the installed versions

```<code>binman::list_versions("chromedriver")
</code>```

I got

```<code>$mac64_m1
[1] "105.0.5195.19" "105.0.5195.52" "106.0.5249.21" "108.0.5359.71"
</code>```

And now RSelenium is running again in RStudio on my MAC (and I learned something about moving trough the Terminal ...).

I am pretty sure this has to be done for every new version of Chrome as long as there is no autoupdate from binman.

Body:
I am trying to work with RSelenium and chromedriver on a Mac with an M2 chip. Since one of the last updates the combination of chrome/chromedriver doesn't work anymore. The installed chromedriver version doesn't fit to the installed chrome version. I tried to update chromedriver, but without success. When running

binman::list_versions("chromedriver")

I get

$mac64_m1
[1] "105.0.5195.19" "105.0.5195.52" "106.0.5249.21"

The problem is: I don't know why those versions are installed, where they are installed and how I can update them from within binman or wdman .

I followed the installation guide for chromedriver on Mac here https://www.swtestacademy.com/install-chrome-driver-on-mac/ but that didn't change anything. It also didn't add the installed version to the ones being recognised by binman.

When I am using the search function, I can't find any of the chrome drivers that binman identifies, but I can find the version that I downloaded (and moved to library/bin/).

Does anybody know how I can find the directory in which the binman chromedriver versions are installed? How can I install the latest chromedriver or a specific version with binman or wdman? I also tried

app_dir("chromedriver", check = TRUE)

which doesn't give any results

Best regards

UPDATE:

I found the solution.

Find the binman_chromedriver directory on your MAC. You can use RStudio for that:

appdir <- binman::app_dir("chromedriver", check = TRUE)
appdir

Open up MAC Terminal and go to the binman_chromedriver directory

Within that directory, create a new folder with the name of the chromedriver version you want to install.

mkdir 108.0.5359.71

Go into the new folder

cd 108.0.5359.71

Download the zipped version of chromedriver (copy+paste the link from your browser)

curl -O https://chromedriver.storage.googleapis.com/108.0.5359.71/chromedriver_mac_arm64.zip

Unzip

unzip chromedriver_mac_arm64.zip

go back to RStudio and check the installed versions

binman::list_versions("chromedriver")

I got

$mac64_m1
[1] "105.0.5195.19" "105.0.5195.52" "106.0.5249.21" "108.0.5359.71"

And now RSelenium is running again in RStudio on my MAC (and I learned something about moving trough the Terminal ...).

I am pretty sure this has to be done for every new version of Chrome as long as there is no autoupdate from binman.


问:
PowerShell for Modifying AD user display name from a specific OU
I need to update the displayname of the AD user. It is already updated to something else . But i want in this format

First Name = Vineet

Last Name = Chaturvedi

Displayname = Vineet.chatturvedi-TA

Please help me

```<code>$displayname = "$firstname.$lastname";
</code>```

Body:
I need to update the displayname of the AD user. It is already updated to something else . But i want in this format

First Name = Vineet

Last Name = Chaturvedi

Displayname = Vineet.chatturvedi-TA

Please help me

$displayname = "$firstname.$lastname";


问:
How to use custom docker image for development via python session in terminal/console or jupyter in AWS?
How to use custom docker image for development via python session in terminal/console or jupyter in AWS? I am able to run Jupyter notebook with preloaded environment in AWS, for example. However, if I want to install other packages, I'd like to maintain it in docker image and use the image to run something in sagemaker or ec2 or other compute services. Any advice would be appreciated.</p>


问:
Google Chrome Window Handle
Problem: How to get Chrome active window handle

Description: After updating Chrome to version 108 it seems that active window handle may change even if you don't switch the chrome windows.Multiple mouse clicks events within same window have different window handles.

I am using System.Diagnostics.Process Handle Property.

Tried using System.Diagnostics.Process Handle Property
Expected to have same handle for all events from specific chrome window.
Expected to have different handles when switching to another chrome window.

Title: Google Chrome Window Handle


问:
How to structure bluetooth threads in android apps
The app I am working on requires the pairing of two devices via bluetooth and then certain actions on one device will trigger a BluetoothEvent which will in turn trigger the other device to have some kind of response.

In more recent android versions, certain bluetooth actions now require bluetooth permission checks, and said permission checks require access to context. I need to create a single instance of the class containing the threads that can then be accessed from several different fragments and activities. (https://developer.android.com/guide/topics/connectivity/bluetooth/connect-bluetooth-devices) the threads are of a similar structure to the ones in this guide.

Previously an instance of this bluetooth threads class could be created in an object, but as this class now requires context access this produces a memory leak. But if the context is not passed to the thread class then Bluetooth permission checks can not be performed. How can I structure this so that An instance of the threads class can be maintained and accessed from different activities whilst also being able to perform the required permission checks?

The permission check warnings in the bluetooth threads class could be surpressed and then the checks performed in the activities/fragments where the bluetooth threads class is referenced.


问:
Best practice for testing a django project
I have a django project with 3 apps. Now, I want to test my project. So I was in dilemma that what should be the best practice for testing a Django project with pytest?

Which approach is preferable ?

Approach 1 :

```<code>└── app_name
    └── tests
        ├── __init__.py
        ├── test_forms.py
        ├── test_models.py
        └── test_views.py
</code>```

Approach 2 :

```<code>└── app_name
    └── tests
        ├── __init__.py
        ├── unit_tests
           ├── __init__.py
           ├── test_views.py
           ├── test_models.py
           ├── test_forms.py
        ├── integration_tests
           ├── __init__.py
           ├── test_views.py
           ├── test_models.py
           ├── test_forms.py
        ├── functional_tests
           ├── __init__.py
           ├── test_views.py
           ├── test_models.py
           ├── test_forms.py
</code>```

Note : We are using pytest here.

What I am expecting is which approach should be followed while testing a django project

Body:
I have a django project with 3 apps. Now, I want to test my project. So I was in dilemma that what should be the best practice for testing a Django project with pytest?

Which approach is preferable ?

Approach 1 :

└── app_name
    └── tests
        ├── __init__.py
        ├── test_forms.py
        ├── test_models.py
        └── test_views.py

Approach 2 :

└── app_name
    └── tests
        ├── __init__.py
        ├── unit_tests
           ├── __init__.py
           ├── test_views.py
           ├── test_models.py
           ├── test_forms.py
        ├── integration_tests
           ├── __init__.py
           ├── test_views.py
           ├── test_models.py
           ├── test_forms.py
        ├── functional_tests
           ├── __init__.py
           ├── test_views.py
           ├── test_models.py
           ├── test_forms.py

Note : We are using pytest here.

What I am expecting is which approach should be followed while testing a django project


问:
missing key in Info.plist of "endpoint security extension" after xcodebuild when build release
hi im working on swift app with extensions. when i build to release in xcode after the pkg is build i see that two keys are missing from end point security extension Info.plist : CFBundleShortVersionString key and CFBundleVersion . and this causing to when i install the pkg the extension wont activated and i get this error:

```<code>sysextd: bundle is missing CFBundleShortVersionString key
</code>```
```<code>"myapp": Activation request failed: Invalid extension configuration in Info.plist and/or entitlements
</code>```

as a workaround i added after build this keys to Info.plist and the extension is activated. do you know what causing that? because i have under extension in my app (network extension) and the Info.plist for that is valid. further more whan i build for debug both Info.plist are valid. what xcode generate for release?

Body:
hi im working on swift app with extensions. when i build to release in xcode after the pkg is build i see that two keys are missing from end point security extension Info.plist : CFBundleShortVersionString key and CFBundleVersion . and this causing to when i install the pkg the extension wont activated and i get this error:

sysextd: bundle is missing CFBundleShortVersionString key

"myapp": Activation request failed: Invalid extension configuration in Info.plist and/or entitlements

as a workaround i added after build this keys to Info.plist and the extension is activated. do you know what causing that? because i have under extension in my app (network extension) and the Info.plist for that is valid. further more whan i build for debug both Info.plist are valid. what xcode generate for release?


问:
Is there a way to get the table data is fetched from?
Is there a way to get the current table data is fetched from?

Maybe easier to give an example:

```<code>Select
       current server       -> Returns "PDBS" or whatever
     , current table(a)     -> Is there something similar that would return "customer"?
     , a.customer_no
     , b.order_no
  from customer a
  left join orders b
    on b.customer_no     = a.customer_no
 where
       customer_no       = 123456
     ;
</code>```

Edit:
The reason I'm asking is that we have a number of tables (20ish) with descriptions for different things with language support. We have 3 test environments and production and I've written a script that identifies discrepancies in the environments.
I have hardcoded the table names and in doing so was curious if there was a way to extract the table names directly...

Body:
Is there a way to get the current table data is fetched from?

Maybe easier to give an example:

Select
       current server       -> Returns "PDBS" or whatever
     , current table(a)     -> Is there something similar that would return "customer"?
     , a.customer_no
     , b.order_no
  from customer a
  left join orders b
    on b.customer_no     = a.customer_no
 where
       customer_no       = 123456
     ;

Edit:
The reason I'm asking is that we have a number of tables (20ish) with descriptions for different things with language support. We have 3 test environments and production and I've written a script that identifies discrepancies in the environments.
I have hardcoded the table names and in doing so was curious if there was a way to extract the table names directly...


问:
Vercel not deploying because of "@"?
I've been seeking for a while, and, maybe it's because of how I made my researches, but nevermind I'll ask it anyway.

I'm working on a react.js/next environnement, then I worked on a library I had to customize, which is in Typescript. No problem to handle that, but when I deployed the final version on Vercel, I had  3 errors.

```<code>./helper/react-gutenberg/dist/blocks/common/audio.js
    13:06:35.878    Module not found: Can't resolve '@mantine/core' in '/vercel/path0/helper/react-gutenberg/dist/blocks/common'
    13:06:35.879
    13:06:35.879    Import trace for requested module:
    13:06:35.880    ./helper/react-gutenberg/dist/blocks/common/audio.js
    13:06:35.880    ./helper/react-gutenberg/dist/blocks/common/index.js
    13:06:35.881    ./helper/react-gutenberg/dist/blocks/index.js
    13:06:35.881    ./helper/react-gutenberg/dist/index.js
    13:06:35.881    ./helper/react-gutenberg/index.js
    13:06:35.881
    13:06:35.881    ./helper/react-gutenberg/dist/blocks/common/audio.js
    13:06:35.881    Module not found: Can't resolve '@material-ui/icons/ArrowRightAlt' in '/vercel/path0/helper/react-gutenberg/dist/blocks/common'
    13:06:35.881
    13:06:35.881    Import trace for requested module:
    13:06:35.881    ./helper/react-gutenberg/dist/blocks/common/audio.js
    13:06:35.881    ./helper/react-gutenberg/dist/blocks/common/index.js
    13:06:35.881    ./helper/react-gutenberg/dist/blocks/index.js
    13:06:35.881    ./helper/react-gutenberg/dist/index.js
    13:06:35.881    ./helper/react-gutenberg/index.js
    13:06:35.881
    13:06:35.882    ./helper/react-gutenberg/dist/blocks/common/audio.js
    13:06:35.882    Module not found: Can't resolve '@mantine/hooks' in '/vercel/path0/helper/react-gutenberg/dist/blocks/common'
</code>```

The point seems to be that there is an "@" in the namespace, and when i build the file with tsc, the js file isn't handling this @ when it requires it. Thanks a lot for your help

I tried to deploy on Vercel but it didn't work at all, failed to compile.

Title: Vercel not deploying because of "@"?

Body:
I've been seeking for a while, and, maybe it's because of how I made my researches, but nevermind I'll ask it anyway.

I'm working on a react.js/next environnement, then I worked on a library I had to customize, which is in Typescript. No problem to handle that, but when I deployed the final version on Vercel, I had  3 errors.

./helper/react-gutenberg/dist/blocks/common/audio.js
    13:06:35.878    Module not found: Can't resolve '@mantine/core' in '/vercel/path0/helper/react-gutenberg/dist/blocks/common'
    13:06:35.879
    13:06:35.879    Import trace for requested module:
    13:06:35.880    ./helper/react-gutenberg/dist/blocks/common/audio.js
    13:06:35.880    ./helper/react-gutenberg/dist/blocks/common/index.js
    13:06:35.881    ./helper/react-gutenberg/dist/blocks/index.js
    13:06:35.881    ./helper/react-gutenberg/dist/index.js
    13:06:35.881    ./helper/react-gutenberg/index.js
    13:06:35.881
    13:06:35.881    ./helper/react-gutenberg/dist/blocks/common/audio.js
    13:06:35.881    Module not found: Can't resolve '@material-ui/icons/ArrowRightAlt' in '/vercel/path0/helper/react-gutenberg/dist/blocks/common'
    13:06:35.881
    13:06:35.881    Import trace for requested module:
    13:06:35.881    ./helper/react-gutenberg/dist/blocks/common/audio.js
    13:06:35.881    ./helper/react-gutenberg/dist/blocks/common/index.js
    13:06:35.881    ./helper/react-gutenberg/dist/blocks/index.js
    13:06:35.881    ./helper/react-gutenberg/dist/index.js
    13:06:35.881    ./helper/react-gutenberg/index.js
    13:06:35.881
    13:06:35.882    ./helper/react-gutenberg/dist/blocks/common/audio.js
    13:06:35.882    Module not found: Can't resolve '@mantine/hooks' in '/vercel/path0/helper/react-gutenberg/dist/blocks/common'

The point seems to be that there is an "@" in the namespace, and when i build the file with tsc, the js file isn't handling this @ when it requires it. Thanks a lot for your help

I tried to deploy on Vercel but it didn't work at all, failed to compile.


问:
How to find the best route
everyone. I have an issue to resolve but not much clue. It was presented to me a travelling salesman problem and there are some criteria to attend. It is needed to find the most lucrative route that would take less time. Eventually, it will be more criteria, but learning to resolving this one will let me do any kind of job like this.

```<code>> glimpse(problem)
Rows: 62
Columns: 5
$ Location_x   <dbl> 27, 20, 29, 26, 22, 23, 22, 24, 25, 23, 30, 27, 21, 22, 21, 24,…
$ Location_y   <dbl> 72, 74, 70, 80, 78, 72, 73, 77, 74, 77, 75, 80, 71, 77, 80, 80,…
$ house_id     <chr> 146, 170, 171, 137, 121, 178, 163, 119, 113, 114, 199, 162, 102…
$ Payment      <dbl> 5378, 7971, 5831, 3303, 6602, 1268, 5371, 1927, 653, 4583, 839,…
$ Days_needed  <dbl> 3, 2, 2, 1, 3, 4, 2, 1, 2, 5, 1, 5, 4, 3, 5, 2, 2, 3, 1, 3, 1, …

> glimpse(workers)
Rows: 8
Columns: 1
$ Professional <chr> "Joe", "Harry", "Jefferson", "Anie", "Donovan", "Jessica", "Leo…
</code>```

I must find a way to move the workers between the houses in a way that profit will come in less time possible. It is the first time that an heuristical (I think it is heuristical) problem comes to me and I'm confused.

Title: How to find the best route

Body:
everyone. I have an issue to resolve but not much clue. It was presented to me a travelling salesman problem and there are some criteria to attend. It is needed to find the most lucrative route that would take less time. Eventually, it will be more criteria, but learning to resolving this one will let me do any kind of job like this.

> glimpse(problem)
Rows: 62
Columns: 5
$ Location_x   <dbl> 27, 20, 29, 26, 22, 23, 22, 24, 25, 23, 30, 27, 21, 22, 21, 24,…
$ Location_y   <dbl> 72, 74, 70, 80, 78, 72, 73, 77, 74, 77, 75, 80, 71, 77, 80, 80,…
$ house_id     <chr> 146, 170, 171, 137, 121, 178, 163, 119, 113, 114, 199, 162, 102…
$ Payment      <dbl> 5378, 7971, 5831, 3303, 6602, 1268, 5371, 1927, 653, 4583, 839,…
$ Days_needed  <dbl> 3, 2, 2, 1, 3, 4, 2, 1, 2, 5, 1, 5, 4, 3, 5, 2, 2, 3, 1, 3, 1, …

> glimpse(workers)
Rows: 8
Columns: 1
$ Professional <chr> "Joe", "Harry", "Jefferson", "Anie", "Donovan", "Jessica", "Leo…

I must find a way to move the workers between the houses in a way that profit will come in less time possible. It is the first time that an heuristical (I think it is heuristical) problem comes to me and I'm confused.


问:
UNPROCESSABLE_ENTITY: COMPLIANCE VIOLATION error using sample code from PayPal Developer
I am currently testing the paypal integration example, I followed the instructions correctly, but the execution of the payment sends me the following error in my browser console :

```<code>
Capture result
Object { name: "UNPROCESSABLE_ENTITY", details: (1) […], message: "The requested action could not be performed, semantically incorrect, or failed business validation.", debug_id: "fc978a79053b1", links: (1) […] }
 {
  "name": "UNPROCESSABLE_ENTITY",
  "details": [
    {
      "issue": "COMPLIANCE_VIOLATION",
      "description": "Transaction cannot be processed due to a possible compliance violation. To get more information about the transaction, call Customer Support."
    }
  ],
  "message": "The requested action could not be performed, semantically incorrect, or failed business validation.",
  "debug_id": "fc978a79053b1",
  "links": [
    {
      "href": "https://developer.paypal.com/docs/api/orders/v2/#error-COMPLIANCE_VIOLATION",
      "rel": "information_link",
      "method": "GET"
    }
  ]
}

</code>```

I tried both standard and advenced integrations, without changing anything, except the .env file,
same result.

I need help to understand where the error comes from and how to solve it.

Thank you for your patience.

Body:
I am currently testing the paypal integration example, I followed the instructions correctly, but the execution of the payment sends me the following error in my browser console :

Capture result
Object { name: "UNPROCESSABLE_ENTITY", details: (1) […], message: "The requested action could not be performed, semantically incorrect, or failed business validation.", debug_id: "fc978a79053b1", links: (1) […] }
 {
  "name": "UNPROCESSABLE_ENTITY",
  "details": [
    {
      "issue": "COMPLIANCE_VIOLATION",
      "description": "Transaction cannot be processed due to a possible compliance violation. To get more information about the transaction, call Customer Support."
    }
  ],
  "message": "The requested action could not be performed, semantically incorrect, or failed business validation.",
  "debug_id": "fc978a79053b1",
  "links": [
    {
      "href": "https://developer.paypal.com/docs/api/orders/v2/#error-COMPLIANCE_VIOLATION",
      "rel": "information_link",
      "method": "GET"
    }
  ]
}

I tried both standard and advenced integrations, without changing anything, except the .env file,
same result.

I need help to understand where the error comes from and how to solve it.

Thank you for your patience.


问:
Is it possible to hide 1 attribute variation but keep the remaining?
We have a woocommerce website that we are looking to sell personalised shirt with Name & Number on the back but the problem is we are only allowing 1 x of each number to be sold i.e. 1x 24 1x 67 right upto 99.

Once that number has been pucharsed it cannot be purchased again.

The other variations will be colour & size.

Website URL - https://andreascartersports.co.uk.185-253-90-137.col.xenace.cloud/product/sigma-football-training-top/#

We have tried multiple plugins and product addons but nothing works.


问:
How to display RTSP stream from IPCamera in webapp
I'm looking for a way to display multiple camerastreams (up to 200 cameras) in a single web application (only a single stream will be visible at each time).

My initial plan was to connect the webapp to the cameras by using an rtsp stream, but this protocol is not supported by most browsers. I have found some sources that it should be possible to display using a thirdparty plugin but for now no luck.

Another idea I had was to deploy a kubernetes cluster with a transcoding service for each camera that converts a rtsp stream into an HLS stream, which is usable in a webapp. But this means defining a hard link between each transcoder pod and each camera.

So my question: Is there an easy way of using rtsp streams in a webapp? Or what do you guys think is a viable way to handle this many cameras in a webapp?

So many thanks!


问:
Three.js texture streches when the width is large

You can see when the width is less the texture fits perfectly and when the wall is long it stretches.

```<code>const wallTex = new THREE.TextureLoader().load(wallTexture);
      wallTex.encoding = THREE.sRGBEncoding;
      wallTex.wrapS = THREE.RepeatWrapping;
      wallTex.wrapT = THREE.RepeatWrapping;
      wallTex.repeat.set(4, 1);
      const wallMaterial = new THREE.MeshBasicMaterial({ map: wallTex, side: THREE.DoubleSide });
</code>```

When I dont set texture.repeat.set(4,1) I get the result as below
Is there a way to add texture irrespective of its width?

```<code>const wallGeometry = new THREE.BufferGeometry();
        const wallVertices = new Float32Array([
          -x1,
          y1,
          0, // vertex 1
          -x1,
          y1,
          10, // vertex 2
          -x2,
          y2,
          0, // vertex 3
          -x2,
          y2,
          10, // vertex 4
        ]);
        // define texture coordinates for wallGeometry
        const wallUvs = new Float32Array([
          0,
          0, // vertex 1
          0,
          1, // vertex 2
          1,
          0, // vertex 3
          1,
          1, // vertex 4
        ]);
        wallGeometry.setAttribute('uv', new THREE.BufferAttribute(wallUvs, 2));
        wallGeometry.setAttribute('position', new THREE.BufferAttribute(wallVertices, 3));
        wallGeometry.setIndex([0, 2, 1, 2, 3, 1]);
        const wall = new THREE.Mesh(wallGeometry, wallMaterial);
        const geo = new THREE.EdgesGeometry(wall.geometry);
        const wireframe = new THREE.LineSegments(geo, lineMaterial);
        wall.add(wireframe);
        wall.castShadow = true;
        wall.receiveShadow = true;
        scene!.add(wall);
</code>```

Body:
You can see when the width is less the texture fits perfectly and when the wall is long it stretches.

const wallTex = new THREE.TextureLoader().load(wallTexture);
      wallTex.encoding = THREE.sRGBEncoding;
      wallTex.wrapS = THREE.RepeatWrapping;
      wallTex.wrapT = THREE.RepeatWrapping;
      wallTex.repeat.set(4, 1);
      const wallMaterial = new THREE.MeshBasicMaterial({ map: wallTex, side: THREE.DoubleSide });

When I dont set texture.repeat.set(4,1) I get the result as below
Is there a way to add texture irrespective of its width?

const wallGeometry = new THREE.BufferGeometry();
        const wallVertices = new Float32Array([
          -x1,
          y1,
          0, // vertex 1
          -x1,
          y1,
          10, // vertex 2
          -x2,
          y2,
          0, // vertex 3
          -x2,
          y2,
          10, // vertex 4
        ]);
        // define texture coordinates for wallGeometry
        const wallUvs = new Float32Array([
          0,
          0, // vertex 1
          0,
          1, // vertex 2
          1,
          0, // vertex 3
          1,
          1, // vertex 4
        ]);
        wallGeometry.setAttribute('uv', new THREE.BufferAttribute(wallUvs, 2));
        wallGeometry.setAttribute('position', new THREE.BufferAttribute(wallVertices, 3));
        wallGeometry.setIndex([0, 2, 1, 2, 3, 1]);
        const wall = new THREE.Mesh(wallGeometry, wallMaterial);
        const geo = new THREE.EdgesGeometry(wall.geometry);
        const wireframe = new THREE.LineSegments(geo, lineMaterial);
        wall.add(wireframe);
        wall.castShadow = true;
        wall.receiveShadow = true;
        scene!.add(wall);


问:
How to await promise inside stream pipe
I am using createReadStream of file module. I have a async operation which is reading from redis/db and based on saved value, I have to increment different counters. This is done inside the stream. The problem is end event is called on stream before the reading and increment operation have been completed.  I have to update the counter based on status store in redis/db.  I have tried using async/await  but nothing work.</p>
```<code>    let fileStream = fs.createReadStream(process.env.FILE_PATH + file_name, { highWaterMark: 1024 * 1024 });
    fileStream.pipe(es.split()).pipe(
        es.mapSync(async function (line) {
            totalCount++;
            let extractData = line.split(",");
            let number = extractData[0];

            if (number) {
                number = number.replace(/['"]+/g, "");

              // HERE IT Check in redis or db
                const status = await checkNumberStatus(number, shortCode);

                tempStatus = status;

                if (status === "unsub") {
                    unprocessCount++;
                } else {
                       // add in redis
                    addToCronJob(number, campaign).then(() => {
                        processCount++;
                    });
                }
            }
        })
    );

    fileStream.on('end',async function (){

        campaign.cron_end_time= new Date();
        campaign.process_count= tempStatus === 'unsub'? processCount: ++processCount;
        campaign.total_count= totalCount;
        campaign.unprocess_count = tempStatus === 'unsub'? ++unprocessCount: unprocessCount;
        await campaign.save();
    })
</code>```

Title: How to await promise inside stream pipe

Body:
I am using createReadStream of file module. I have a async operation which is reading from redis/db and based on saved value, I have to increment different counters. This is done inside the stream. The problem is end event is called on stream before the reading and increment operation have been completed.  I have to update the counter based on status store in redis/db.  I have tried using async/await  but nothing work.

    let fileStream = fs.createReadStream(process.env.FILE_PATH + file_name, { highWaterMark: 1024 * 1024 });
    fileStream.pipe(es.split()).pipe(
        es.mapSync(async function (line) {
            totalCount++;
            let extractData = line.split(",");
            let number = extractData[0];

            if (number) {
                number = number.replace(/['"]+/g, "");

              // HERE IT Check in redis or db
                const status = await checkNumberStatus(number, shortCode);

                tempStatus = status;

                if (status === "unsub") {
                    unprocessCount++;
                } else {
                       // add in redis
                    addToCronJob(number, campaign).then(() => {
                        processCount++;
                    });
                }
            }
        })
    );

    fileStream.on('end',async function (){

        campaign.cron_end_time= new Date();
        campaign.process_count= tempStatus === 'unsub'? processCount: ++processCount;
        campaign.total_count= totalCount;
        campaign.unprocess_count = tempStatus === 'unsub'? ++unprocessCount: unprocessCount;
        await campaign.save();
    })


问:
Add multiple sameday events Calendar in sheets - Script AutoRun
I have a script in google sheets where it will add an event on my calendar based on the date on a column.
The scripts run each day, and to avoid multiple entries of the same calender over the script re-run, I also added a variable on the script to avoid duplicates.

The problem is that I have 2 events on the same day, and it counts as a duplicate, only adds one.
From what I've seen, i need to add the method " getTitle()" so it will read the title (which has different names).
But i'm having troubles setting up the code.
Here is the full code, can you help me figure how it can read my titles and add if not repeated?

```<code>function myFunction() {

var spreadsheet = SpreadsheetApp.getActiveSheet();
var calendarId = spreadsheet.getRange("C1").getValue();
var eventCal = CalendarApp.getCalendarById("MYCALENDARCODE");

var signups = spreadsheet.getRange("A4:G100").getValues();

  for (x=0; x<signups.length; x++){
    if(signups[x][0]){
      var shift = signups[x];
      var startTime = shift[0];
      var endTime = shift[1];
      var title = shift[2];
      var description1 = shift[3];
      var guests1 = shift[4];
      var sendInvites1 = shift[5];

      var daysevent = eventCal.getEventsForDay(startTime);
if (daysevent.length == 0)

      eventCal.createAllDayEvent(title, startTime,

      { description:description1,
        guests:guests1,
        sendInvites: sendInvites1
      }

      );
    }
  }
}
</code>```

I know the solution is around the method  getTitle(), my title is located at column C but i'm having troubles making it not only read the title but register a new event if its not repeated.

This is how it its configured:

The script runs everyday and does not add the same event over and over.
But it also doesn't add the event 2 because its on the same day.
enter image description here

Edit:
The suggested post doesn't help.
I have a script that runs automatically each hour, and i have a variable that prevents to add the same event over and over.
But it also doesnt run with different titles.

Body:
I have a script in google sheets where it will add an event on my calendar based on the date on a column.
The scripts run each day, and to avoid multiple entries of the same calender over the script re-run, I also added a variable on the script to avoid duplicates.

The problem is that I have 2 events on the same day, and it counts as a duplicate, only adds one.
From what I've seen, i need to add the method " getTitle()" so it will read the title (which has different names).
But i'm having troubles setting up the code.
Here is the full code, can you help me figure how it can read my titles and add if not repeated?

function myFunction() {

var spreadsheet = SpreadsheetApp.getActiveSheet();
var calendarId = spreadsheet.getRange("C1").getValue();
var eventCal = CalendarApp.getCalendarById("MYCALENDARCODE");

var signups = spreadsheet.getRange("A4:G100").getValues();

  for (x=0; x<signups.length; x++){
    if(signups[x][0]){
      var shift = signups[x];
      var startTime = shift[0];
      var endTime = shift[1];
      var title = shift[2];
      var description1 = shift[3];
      var guests1 = shift[4];
      var sendInvites1 = shift[5];

      var daysevent = eventCal.getEventsForDay(startTime);
if (daysevent.length == 0)

      eventCal.createAllDayEvent(title, startTime,

      { description:description1,
        guests:guests1,
        sendInvites: sendInvites1
      }

      );
    }
  }
}

I know the solution is around the method  getTitle(), my title is located at column C but i'm having troubles making it not only read the title but register a new event if its not repeated.

This is how it its configured:

The script runs everyday and does not add the same event over and over.
But it also doesn't add the event 2 because its on the same day.
enter image description here

Edit:
The suggested post doesn't help.
I have a script that runs automatically each hour, and i have a variable that prevents to add the same event over and over.
But it also doesnt run with different titles.


问:
Edit Column Data Type from STRING to INTEGER
I am trying to join a number of tables, and I find that the first 8 tables have a column that is INTEGER, whereas the last 4 are STRING, and they will not join.

I have the original CSV files, so can change and reload. I see where it says that BQ does not support changing data types in existing tables.  Help?

I tried changing the CSV column type to number, and reloaded to tables. This did not work.


问:
Multi table report viewer
I have a stored procedure with two parameter who returns 3 tables, In report viewer I can see only first table from SP query, is there a possibility to return all 3 tables from SP query into report?
I'm currently using VS 2010

Thanking you in advanced for your help,
Gogolo

ContentLicense: CC BY-SA 3.0

Title: Multi table report viewer


问:
Identify the retry job in Sidekiq
When a job in Sidekiq fails, it goes into retry queue and it is retried for 25 times, as per https://github.com/mperham/sidekiq/wiki/Error-Handling#automatic-job-retry. So the question is, Is there any way to find whether the job that is currently getting executed, is running for first-time or it is the n'th retry of that job?

Note this job is running separately in a worker.

P.s: I'm new to sidekiq, workers and async jobs, so pardon if the question is not clear or an obvious one.

Title: Identify the retry job in Sidekiq


问:
Why I'm getting HTTP Method is not allowed .Net Core
I'm getting below error in 10 % of my requests on production env.

I've tried also from local and many different browsers and devices (BrowserStack) and I still didn't succeed to reproduce an issue.

```<code>"errors": [
        {
          "status": "405",
          "title": "Method Not Allowed",
          "detail": "HTTP method is not allowed"
       }
]
</code>```

Error that is caught from browser console (Angular)

```<code>"error": "[ProgressEvent]",
"headers": "[ti]",
"message": "Http failure response for https://api.xxxxxx:5000/api/public-web/files: 0 Unknown Error",
"name": "HttpErrorResponse",
"ok": false,
"status": 0,
"statusText": "Unknown Error",
"url": "https://api.xxxxxx:5000/api/public-web/files"
</code>```

POST https://api.xxxxxxx:5000/api/public-web/files/upload

Logs are from Sentry

Stack:

.Net Core 6

Angular 15 - Universal

Server: Windows 2019 → IIS 10

1 ) I've covered CORS just on the IIS with above custom headers in web.config, not on the application side. - DONE

2) I’ve already tried to remove WEBDAV module - DONE

3) Also from IIS side I’ve turned on failed request tracing and logs, and on both sides of logs that request doesn’t even appears. - DONE

Firstly, I was thinking an issue is related to the CORS but although that I had already configured CORS on backend side, I've also added following to all response headers on the server in web-config (IIS) as can be seen down bellow from full web.config file:

```<code><?xml version="1.0" encoding="utf-8"?>
<configuration>
    <location path="." inheritInChildApplications="false">
        <system.webServer>
            <modules>
                <remove name="WebDAVModule"/>
            </modules>
            <httpProtocol>
                <customHeaders>
                    <clear/>
                    <add name="Access-Control-Allow-Origin" value="*"/>
                    <add name="Access-Control-Allow-Methods" value="GET,POST,PATCH,PUT,DELETE,OPTIONS"/>
                    <add name="Access-Control-Allow-Headers" value="*"/>
                </customHeaders>
            </httpProtocol>
            <handlers>
                <remove name="WebDAV"/>
                <add name="aspNetCore" path="*" verb="GET,POST,PATCH,PUT,DELETE" modules="AspNetCoreModuleV2" resourceType="Unspecified" requireAccess="None"/>
            </handlers>
            <aspNetCore processPath="dotnet" arguments=".\xxxx.Api.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess"/>
        </system.webServer>
    </location>
    <system.webServer>
        <tracing>
            <traceFailedRequests>
                <add path="*">
                    <traceAreas>
                        <add provider="ASP" verbosity="Verbose"/>
                        <add provider="ASPNET" areas="Infrastructure,Module,Page,AppServices" verbosity="Verbose"/>
                        <add provider="ISAPI Extension" verbosity="Verbose"/>
                        <add provider="WWW Server" areas="Authentication,Security,Filter,StaticFile,CGI,Compression,Cache,RequestNotifications,Module,FastCGI,WebSocket,ANCM,Rewrite,Cors,iisnode" verbosity="Verbose"/>
                    </traceAreas>
                    <failureDefinitions statusCodes="400-999"/>
                </add>
            </traceFailedRequests>
        </tracing>
    </system.webServer>
</configuration>
</code>```

Route on the .Net Core:

[HttpPost("upload")]
[DisableRequestSizeLimit]
public async Task<IActionResult> Upload(IFormFile file, CancellationToken cancellationToken) {
    var fileDto = await _fileService.UploadApplicationDocument(file, cancellationToken);
    return ResponseObjectStatusCode(new ResponseObject<object>(fileDto));
 }
```

It seems like HTTP Request doesn't reach the server at all…

Body:
I'm getting below error in 10 % of my requests on production env.

I've tried also from local and many different browsers and devices (BrowserStack) and I still didn't succeed to reproduce an issue.

"errors": [
        {
          "status": "405",
          "title": "Method Not Allowed",
          "detail": "HTTP method is not allowed"
       }
]

Error that is caught from browser console (Angular)

"error": "[ProgressEvent]",
"headers": "[ti]",
"message": "Http failure response for https://api.xxxxxx:5000/api/public-web/files: 0 Unknown Error",
"name": "HttpErrorResponse",
"ok": false,
"status": 0,
"statusText": "Unknown Error",
"url": "https://api.xxxxxx:5000/api/public-web/files"

POST https://api.xxxxxxx:5000/api/public-web/files/upload

Logs are from Sentry

Stack:

.Net Core 6

Angular 15 - Universal

Server: Windows 2019 → IIS 10

1 ) I've covered CORS just on the IIS with above custom headers in web.config, not on the application side. - DONE

2) I’ve already tried to remove WEBDAV module - DONE

3) Also from IIS side I’ve turned on failed request tracing and logs, and on both sides of logs that request doesn’t even appears. - DONE

Firstly, I was thinking an issue is related to the CORS but although that I had already configured CORS on backend side, I've also added following to all response headers on the server in web-config (IIS) as can be seen down bellow from full web.config file:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <location path="." inheritInChildApplications="false">
        <system.webServer>
            <modules>
                <remove name="WebDAVModule"/>
            </modules>
            <httpProtocol>
                <customHeaders>
                    <clear/>
                    <add name="Access-Control-Allow-Origin" value="*"/>
                    <add name="Access-Control-Allow-Methods" value="GET,POST,PATCH,PUT,DELETE,OPTIONS"/>
                    <add name="Access-Control-Allow-Headers" value="*"/>
                </customHeaders>
            </httpProtocol>
            <handlers>
                <remove name="WebDAV"/>
                <add name="aspNetCore" path="*" verb="GET,POST,PATCH,PUT,DELETE" modules="AspNetCoreModuleV2" resourceType="Unspecified" requireAccess="None"/>
            </handlers>
            <aspNetCore processPath="dotnet" arguments=".\xxxx.Api.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess"/>
        </system.webServer>
    </location>
    <system.webServer>
        <tracing>
            <traceFailedRequests>
                <add path="*">
                    <traceAreas>
                        <add provider="ASP" verbosity="Verbose"/>
                        <add provider="ASPNET" areas="Infrastructure,Module,Page,AppServices" verbosity="Verbose"/>
                        <add provider="ISAPI Extension" verbosity="Verbose"/>
                        <add provider="WWW Server" areas="Authentication,Security,Filter,StaticFile,CGI,Compression,Cache,RequestNotifications,Module,FastCGI,WebSocket,ANCM,Rewrite,Cors,iisnode" verbosity="Verbose"/>
                    </traceAreas>
                    <failureDefinitions statusCodes="400-999"/>
                </add>
            </traceFailedRequests>
        </tracing>
    </system.webServer>
</configuration>

Route on the .Net Core:

[HttpPost("upload")]
[DisableRequestSizeLimit]
public async Task<IActionResult> Upload(IFormFile file, CancellationToken cancellationToken) {
    var fileDto = await _fileService.UploadApplicationDocument(file, cancellationToken);
    return ResponseObjectStatusCode(new ResponseObject<object>(fileDto));
 }

It seems like HTTP Request doesn't reach the server at all…


问:
Run Javascript Once Per Session
Having a struggle, I have created a Modal Popup for a mail signup however it has become annoying showing everytime on a page load so I am wanting to just show this once per session and no matter how I adjust the script I cannot get this to happen. Please can anyone help?

The code is as follows for the popup:

```<code><script type="text/javascript">
    window.onload = function() {
      OpenBootstrapPopup();
    };

    function OpenBootstrapPopup() {
      $("#simpleModal").modal('show');
    }
  </script>

  <script>
    $('#simpleModal').on('click', 'button.close', function(eventObject) {
      $('#simpleModal').modal('hide');
    });
  </script>
</code>```

I just want the modal popup to show once per session

Title: Run Javascript Once Per Session

Body:
Having a struggle, I have created a Modal Popup for a mail signup however it has become annoying showing everytime on a page load so I am wanting to just show this once per session and no matter how I adjust the script I cannot get this to happen. Please can anyone help?

The code is as follows for the popup:

I just want the modal popup to show once per session


问:
Class wide mock in pytest (for all methods in the whole TestClass)
I am unittesting my new librabry, which is basically database interface. Our apps use it to access our database. that means, I want to test all methods, but I do not want DB commands to be called for real. I only check if they are called with correct arguemnts.

For that purpose, I am mocking the database library. this is the actual code that DOES work:

```<code>import pytest
from unittests.conftest import PyTestConfig as Tconf
from my_lib.influx_interface import InfluxInterface

class TestInfluxInterface:

    def test_connect(self, mocker):
        """
        Create InfluxConnector object and call connect()
        check if __init__() arguments are passed / used correctly
        """
        influx_client = mocker.patch('my_lib.influx_interface.InfluxDBClient', autospec=True)
        test_connector = InfluxInterface(Tconf.test_id)

        # Call connect with no input (influx_client - should be called with no arguemnts
        test_connector.connect()
        influx_client.assert_called_once()

        influx_client.reset_mock()
        # Call connect with custom correct input (influx_client - should be called with custom values
        test_connector.connect(Tconf.custom_conf)
        influx_client.assert_called_once_with(url=Tconf.custom_conf["url"], token=Tconf.custom_conf["token"],
                                              org=Tconf.custom_conf["org"], timeout=Tconf.custom_conf["timeout"],
                                              debug=Tconf.custom_conf["debug"])

        influx_client.reset_mock()
        # Call connect with incorrect input (influx_client - should be called with default values
        test_connector.connect(Tconf.default_conf)
        influx_client.assert_called_once_with(url=Tconf.default_conf["url"], token=Tconf.default_conf["token"],
                                              org=Tconf.default_conf["org"], timeout=Tconf.default_conf["timeout"],
                                              debug=Tconf.default_conf["debug"])
</code>```

Now, what I do next, is to add more methods into TestInfluxInterface class, which will be testing rest of the code. One test method for each method in my library. Thats how I usually do it.

The problem is, that there is a part of the code:

```<code>        influx_client = mocker.patch('my_lib.influx_interface.InfluxDBClient', autospec=True)
        test_connector = InfluxInterface(Tconf.test_id)
</code>```

That will be same for every method. Thus I will be copy-pasting it over and over. As you can already see, thats not good solution.

In unittest, I would do this:

```<code>import unittest
import unittest.mock as mock
from unittests.conftest import PyTestConfig as Tconf
from my_lib.influx_interface import InfluxInterface

@mock.patch('my_lib.influx_interface.InfluxDBClient', autospec=True)
class TestInfluxInterface:

    def setUp(self):
        self.test_connector = InfluxInterface(Tconf.test_id)

    def test_connect(self, influx_client):
        """
        Create InfluxConnector object and call connect()
        check if __init__() arguments are passed / used correctly
        """
        # Call connect with no input (influx_client - should be called with no arguemnts
        self.test_connector.connect()
        influx_client.assert_called_once()
</code>```

Than in each method, I would use self.test_connector to call whatever method I want to test, and check if it called correct influx_client method, with correct parameters.

However, we are moving from unittest to pytest. And while I am wrapping my head around pytest docs, reading stuff here and there, fixtures, mockers, etc..I cannot find out how to do this correctly.

Body:
I am unittesting my new librabry, which is basically database interface. Our apps use it to access our database. that means, I want to test all methods, but I do not want DB commands to be called for real. I only check if they are called with correct arguemnts.

For that purpose, I am mocking the database library. this is the actual code that DOES work:

import pytest
from unittests.conftest import PyTestConfig as Tconf
from my_lib.influx_interface import InfluxInterface

class TestInfluxInterface:

    def test_connect(self, mocker):
        """
        Create InfluxConnector object and call connect()
        check if __init__() arguments are passed / used correctly
        """
        influx_client = mocker.patch('my_lib.influx_interface.InfluxDBClient', autospec=True)
        test_connector = InfluxInterface(Tconf.test_id)

        # Call connect with no input (influx_client - should be called with no arguemnts
        test_connector.connect()
        influx_client.assert_called_once()

        influx_client.reset_mock()
        # Call connect with custom correct input (influx_client - should be called with custom values
        test_connector.connect(Tconf.custom_conf)
        influx_client.assert_called_once_with(url=Tconf.custom_conf["url"], token=Tconf.custom_conf["token"],
                                              org=Tconf.custom_conf["org"], timeout=Tconf.custom_conf["timeout"],
                                              debug=Tconf.custom_conf["debug"])

        influx_client.reset_mock()
        # Call connect with incorrect input (influx_client - should be called with default values
        test_connector.connect(Tconf.default_conf)
        influx_client.assert_called_once_with(url=Tconf.default_conf["url"], token=Tconf.default_conf["token"],
                                              org=Tconf.default_conf["org"], timeout=Tconf.default_conf["timeout"],
                                              debug=Tconf.default_conf["debug"])

Now, what I do next, is to add more methods into TestInfluxInterface class, which will be testing rest of the code. One test method for each method in my library. Thats how I usually do it.

The problem is, that there is a part of the code:

        influx_client = mocker.patch('my_lib.influx_interface.InfluxDBClient', autospec=True)
        test_connector = InfluxInterface(Tconf.test_id)

That will be same for every method. Thus I will be copy-pasting it over and over. As you can already see, thats not good solution.

In unittest, I would do this:

import unittest
import unittest.mock as mock
from unittests.conftest import PyTestConfig as Tconf
from my_lib.influx_interface import InfluxInterface

@mock.patch('my_lib.influx_interface.InfluxDBClient', autospec=True)
class TestInfluxInterface:

    def setUp(self):
        self.test_connector = InfluxInterface(Tconf.test_id)

    def test_connect(self, influx_client):
        """
        Create InfluxConnector object and call connect()
        check if __init__() arguments are passed / used correctly
        """
        # Call connect with no input (influx_client - should be called with no arguemnts
        self.test_connector.connect()
        influx_client.assert_called_once()

Than in each method, I would use self.test_connector to call whatever method I want to test, and check if it called correct influx_client method, with correct parameters.

However, we are moving from unittest to pytest. And while I am wrapping my head around pytest docs, reading stuff here and there, fixtures, mockers, etc..I cannot find out how to do this correctly.


问:
PyQt5 to make subplots (upto 10 graphs) in the same widget
I have developed an UI to read large CSV file and plot. The problem is I can only plot one graph at a time. I need to select upto 10 variable and plot it in the same widget.
My UI should look like this

```<code>import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
from PyQt5 import QtCore, QtGui, QtWidgets
import matplotlib
import matplotlib.pyplot as plt
matplotlib.use('Qt5Agg')
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtWidgets import QFileDialog
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg, NavigationToolbar2QT as Navi
from matplotlib.figure import Figure
import seaborn as sns
import pandas as pd
import sip # can be installed : pip install sip
from datetime import datetime
from PyQt5.QtWidgets import *
from PyQt5 import QtCore, QtGui
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5 import *
import sys

# We require a canvas class
from mpldatacursor import datacursor
class MatplotlibCanvas(FigureCanvasQTAgg):
    def __init__(self,parent=None, dpi = 120):
        fig = Figure(dpi = dpi)
        self.axes = fig.add_subplot(111)
        super(MatplotlibCanvas,self).__init__(fig)
        fig.tight_layout()

class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1440, 1000)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
        self.gridLayout.setObjectName("gridLayout")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.label = QtWidgets.QLabel(self.centralwidget)
        self.label.setObjectName("label")
        self.horizontalLayout.addWidget(self.label)

        self.label_1 = QtWidgets.QLabel(self.centralwidget)
        self.label_1.setObjectName("label_1")

        self.label_2 = QtWidgets.QLabel(self.centralwidget)
        self.label_2.setObjectName("label_2")

        self.label_3 = QtWidgets.QLabel(self.centralwidget)
        self.label_3.setObjectName("label_3")

        self.comboBox = QtWidgets.QComboBox(self.centralwidget)
        self.comboBox.setObjectName("comboBox")
        self.horizontalLayout.addWidget(self.comboBox)

        self.comboBox_1 = QtWidgets.QComboBox(self.centralwidget)
        self.comboBox_1.setObjectName("comboBox_1")

        self.comboBox_2 = QtWidgets.QComboBox(self.centralwidget)
        self.ComboBox_2 = CheckableComboBox()
        self.comboBox_2.setObjectName("comboBox_2")
        self.comboBox_2.setEditable(True)
        #self.comboBox_2.setFocusPolicy( Qt.StrongFocus )
        #self.comboBox_2.lineEdit().setMaxLength(45)
        #self.comboBox_2.setReadOnly(True)
        #self.comboBox_2.textChanged.connect(self.doSomething)

        self.radioButton = QtWidgets.QRadioButton(self.centralwidget)
        self.radioButton.setObjectName("radioButton")

        self.pushButton = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton.setObjectName("pushButton")
        self.horizontalLayout.addWidget(self.pushButton)
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)

        self.horizontalLayout.addItem(spacerItem)
        self.horizontalLayout.addWidget(self.label_1)
        self.horizontalLayout.addWidget(self.comboBox_1)
        self.horizontalLayout.addWidget(self.label_2)
        self.horizontalLayout.addWidget(self.comboBox_2)
        self.horizontalLayout.addWidget(self.label_3)
        self.horizontalLayout.addWidget(self.radioButton)

        self.gridLayout.addLayout(self.horizontalLayout, 0, 0, 1, 1)
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout.addItem(self.spacerItem1)
        self.gridLayout.addLayout(self.verticalLayout, 1, 0, 1, 1)

        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 22))
        self.menubar.setObjectName("menubar")
        self.menuFile = QtWidgets.QMenu(self.menubar)
        self.menuFile.setObjectName("menuFile")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)
        self.actionOpen_csv_file = QtWidgets.QAction(MainWindow)
        self.actionOpen_csv_file.setObjectName("actionOpen_csv_file")
        self.actionExit = QtWidgets.QAction(MainWindow)
        self.actionExit.setObjectName("actionExit")
        self.menuFile.addAction(self.actionOpen_csv_file)
        self.menuFile.addAction(self.actionExit)
        self.menubar.addAction(self.menuFile.menuAction())

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

        self.filename = ''
        self.canv = MatplotlibCanvas(self)
        self.df = []

        self.toolbar = Navi(self.canv,self.centralwidget)
        self.horizontalLayout.addWidget(self.toolbar)

        self.themes = ['bmh', 'classic', 'dark_background', 'fast',
        'fivethirtyeight', 'ggplot', 'grayscale', 'seaborn-bright',
         'seaborn-colorblind', 'seaborn-dark-palette', 'seaborn-dark',
         'seaborn-darkgrid', 'seaborn-deep', 'seaborn-muted', 'seaborn-notebook',
         'seaborn-paper', 'seaborn-pastel', 'seaborn-poster', 'seaborn-talk',
         'seaborn-ticks', 'seaborn-white', 'seaborn-whitegrid', 'seaborn',
         'Solarize_Light2', 'tableau-colorblind10']

        self.comboBox.addItems(self.themes)
        self.comboBox_1.addItems(['Select horizontal axis here'])
        self.comboBox_2.addItems(['Select vertical axis here'])

        self.pushButton.clicked.connect(self.getFile)
        self.comboBox.currentIndexChanged['QString'].connect(self.Update)
        self.comboBox_1.currentIndexChanged['QString'].connect(self.selectXaxis)
        self.comboBox_2.currentIndexChanged['QString'].connect(self.selectYaxis)
        self.actionExit.triggered.connect(MainWindow.close)
        self.actionOpen_csv_file.triggered.connect(self.getFile)
        self.radioButton.clicked.connect(self.vsAll)
        self.dataset={}
        self.x_axis_slt=None
        self.y_axis_slt=None
        self.vsall = False

    def vsAll(self):
        """
        This function will be called upon triggering the radio check button. If set to True, all the columsn in the csv
        will be plotted against the x-axis column. Please note that vs all means versus all, so that whatever value is
        selected as the x-axis, it wont be plotted against itself in this mode. Moreover, the time series data will be
        dedicated for the datetime x-axis and it wont be displayed in the vs all contents.

        """
        if self.vsall==False:
            self.vsall=True
        else:
            self.vsall=False
        self.Update(self.themes[0])

    def selectXaxis(self,value):
        """
        This function will update the plot according to the data of x axis selected from combo box

        """
        self.x_axis_slt=value
        self.Update(self.themes[0])

    def selectYaxis(self,value):
        """
        This function will update the plot according to the data of y axis selected from combo box

        """
        self.y_axis_slt=value
        self.Update(self.themes[0])

    def Update(self,value):

        """
        This function will input the value of theme and accordingly plot the data, if the data is relative, i.e., x verus y-axis
        then the user can assign x and y axis from the combo box. If all data should be plotted in paraller then leave,
        the combo boxes of axis selections to their default starting location.

        """
        plt.clf()
        plt.style.use(value)
        try:
            self.horizontalLayout.removeWidget(self.toolbar)
            self.verticalLayout.removeWidget(self.canv)

            sip.delete(self.toolbar)
            sip.delete(self.canv)
            self.toolbar = None
            self.canv = None
            self.verticalLayout.removeItem(self.spacerItem1)
        except Exception as e:
            print(e)
            pass
        self.canv = MatplotlibCanvas(self)
        self.toolbar = Navi(self.canv,self.centralwidget)

        self.horizontalLayout.addWidget(self.toolbar)
        self.verticalLayout.addWidget(self.canv)

        self.canv.axes.cla()
        ax = self.canv.axes

        try:

            if self.vsall:
                for k,v in self.dataset.items():

                    if k!=self.x_axis_slt and type(v[0])!=datetime:
                        lines = ax.plot(self.dataset[self.x_axis_slt],v,label=k)
                        datacursor(lines)

                legend = ax.legend()
                legend.set_draggable(True)
                ax.set_xlabel(self.x_axis_slt)
                ax.set_ylabel('ALL OTHERS')
                ax.set_title(self.Title)
                #plt.setp(ax.xaxis.get_majorticklabels(), rotation=25)  # uncomment if you want the x-axis to tilt 25 degree

            else:

                lines = ax.plot(self.dataset[self.x_axis_slt],self.dataset[self.y_axis_slt],label=self.y_axis_slt)
                datacursor(lines)
                legend = ax.legend()
                legend.set_draggable(True)
                ax.set_xlabel(self.x_axis_slt)
                ax.set_ylabel(self.y_axis_slt)
                ax.set_title(self.Title)
                #plt.setp(ax.xaxis.get_majorticklabels(), rotation=25)  # uncomment if you want the x-axis to tilt 25 degree

        except Exception as e:
            print(e)
            try:
                lines = self.df.plot(ax = self.canv.axes)
                datacursor(lines)
                legend = ax.legend()
                legend.set_draggable(True)

                ax.set_xlabel('X axis')
                ax.set_ylabel('Y axis')
                ax.set_title(self.Title)
            except Exception as e:
                print(e)
                pass
            pass

        self.canv.draw()

    def getFile(self):
        """ This function will get the address of the csv file location
            also calls a readData function
        """
        try:
            self.filename = QFileDialog.getOpenFileName(filter = "csv (*.csv)")[0]
            self.readData()
        except Exception as e:
            print(e)
            pass

    def getDataset(self,csvfilename):
        """
        This function will convert csv file to a dictionary of dataset, with keys as the columns' names and
        values as values. The datatime format should be one of the standard datatime formats. Before plottting
        we need to convert the string of data time in the csv file values to datatime format.
        """
        df = pd.read_csv(csvfilename,sep=';')
        LIST_OF_X_COLUMNS = ['Time[s]']
        LIST_OF_Y_COLUMNS = df.columns
        dataset={}
        # time_format = "%d/%m/%Y %H:%M:%S"
        # time_format =  "%m/%d/%Y"
        # time_format = "%d/%m/%Y"
        # time_format = "%m-%d-%Y"
        # time_format = "%d-%m-%Y"
        # time_format = "%H:%M:%S"
        # time_format = "%M:%S"
        # time_format = '%d/%m/%Y %H:%M%f'
        #time_format = '%Y-%m-%d %H:%M:%S.%f'

        for col in LIST_OF_Y_COLUMNS:
            dataset[col]  =  df[col].iloc[0:].values
            try:
                dataset[col] = [datetime.strptime(i) for i in df[col].iloc[0:].values]
            except Exception as e:
                pass
                print(e)
        return dataset, LIST_OF_X_COLUMNS, LIST_OF_Y_COLUMNS

    def readData(self):
        """ This function will read the data using pandas and call the update
            function to plot
        """
        import os
        self.dataset={}
        self.x_axis_slt=None
        self.y_axis_slt=None

        base_name = os.path.basename(self.filename)
        self.Title = os.path.splitext(base_name)[0]

        self.dataset, LIST_OF_X_COLUMNS, LIST_OF_Y_COLUMNS = self.getDataset(self.filename)
        chunksize = 10 ** 6
        self.df = pd.read_csv(self.filename,sep=';',chunksize = chunksize)

        self.Update(self.themes[0]) # lets 0th theme be the default : bmh
        self.comboBox_1.clear()
        #self.comboBox_2.clear()

        self.comboBox_2.addItems(['Select vertical axis here'])
        self.comboBox_1.addItems(LIST_OF_X_COLUMNS)
        self.comboBox_2.addItems(LIST_OF_Y_COLUMNS)

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
        self.label.setText(_translate("MainWindow", "Select Theme"))
        self.label_1.setText(_translate("MainWindow", "X-axis"))
        self.label_2.setText(_translate("MainWindow", "Y-axis"))
        self.label_3.setText(_translate("MainWindow", "vs all"))
        self.pushButton.setText(_translate("MainWindow", "Open"))
        self.menuFile.setTitle(_translate("MainWindow", "File"))
        self.actionOpen_csv_file.setText(_translate("MainWindow", "Open csv file"))
        self.actionExit.setText(_translate("MainWindow", "Exit"))

if __name__ == "__main__":
        import sys
        app = QtWidgets.QApplication(sys.argv)
        MainWindow = QtWidgets.QMainWindow()
        ui = Ui_MainWindow()
        ui.setupUi(MainWindow)

        MainWindow.show()
        sys.exit(app.exec_())
</code>```

This is what I have and the output looks like. But, I need to get the output as shown in picture 1.

I'm very new to PyQt5. So, could anyone please help me with this. Thanks in advance.
Output from UI I have develop

Body:
I have developed an UI to read large CSV file and plot. The problem is I can only plot one graph at a time. I need to select upto 10 variable and plot it in the same widget.
My UI should look like this

import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
from PyQt5 import QtCore, QtGui, QtWidgets
import matplotlib
import matplotlib.pyplot as plt
matplotlib.use('Qt5Agg')
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtWidgets import QFileDialog
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg, NavigationToolbar2QT as Navi
from matplotlib.figure import Figure
import seaborn as sns
import pandas as pd
import sip # can be installed : pip install sip
from datetime import datetime
from PyQt5.QtWidgets import *
from PyQt5 import QtCore, QtGui
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5 import *
import sys

# We require a canvas class
from mpldatacursor import datacursor
class MatplotlibCanvas(FigureCanvasQTAgg):
    def __init__(self,parent=None, dpi = 120):
        fig = Figure(dpi = dpi)
        self.axes = fig.add_subplot(111)
        super(MatplotlibCanvas,self).__init__(fig)
        fig.tight_layout()

class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1440, 1000)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
        self.gridLayout.setObjectName("gridLayout")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.label = QtWidgets.QLabel(self.centralwidget)
        self.label.setObjectName("label")
        self.horizontalLayout.addWidget(self.label)

        self.label_1 = QtWidgets.QLabel(self.centralwidget)
        self.label_1.setObjectName("label_1")

        self.label_2 = QtWidgets.QLabel(self.centralwidget)
        self.label_2.setObjectName("label_2")

        self.label_3 = QtWidgets.QLabel(self.centralwidget)
        self.label_3.setObjectName("label_3")

        self.comboBox = QtWidgets.QComboBox(self.centralwidget)
        self.comboBox.setObjectName("comboBox")
        self.horizontalLayout.addWidget(self.comboBox)

        self.comboBox_1 = QtWidgets.QComboBox(self.centralwidget)
        self.comboBox_1.setObjectName("comboBox_1")

        self.comboBox_2 = QtWidgets.QComboBox(self.centralwidget)
        self.ComboBox_2 = CheckableComboBox()
        self.comboBox_2.setObjectName("comboBox_2")
        self.comboBox_2.setEditable(True)
        #self.comboBox_2.setFocusPolicy( Qt.StrongFocus )
        #self.comboBox_2.lineEdit().setMaxLength(45)
        #self.comboBox_2.setReadOnly(True)
        #self.comboBox_2.textChanged.connect(self.doSomething)

        self.radioButton = QtWidgets.QRadioButton(self.centralwidget)
        self.radioButton.setObjectName("radioButton")

        self.pushButton = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton.setObjectName("pushButton")
        self.horizontalLayout.addWidget(self.pushButton)
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)

        self.horizontalLayout.addItem(spacerItem)
        self.horizontalLayout.addWidget(self.label_1)
        self.horizontalLayout.addWidget(self.comboBox_1)
        self.horizontalLayout.addWidget(self.label_2)
        self.horizontalLayout.addWidget(self.comboBox_2)
        self.horizontalLayout.addWidget(self.label_3)
        self.horizontalLayout.addWidget(self.radioButton)

        self.gridLayout.addLayout(self.horizontalLayout, 0, 0, 1, 1)
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout.addItem(self.spacerItem1)
        self.gridLayout.addLayout(self.verticalLayout, 1, 0, 1, 1)

        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 22))
        self.menubar.setObjectName("menubar")
        self.menuFile = QtWidgets.QMenu(self.menubar)
        self.menuFile.setObjectName("menuFile")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)
        self.actionOpen_csv_file = QtWidgets.QAction(MainWindow)
        self.actionOpen_csv_file.setObjectName("actionOpen_csv_file")
        self.actionExit = QtWidgets.QAction(MainWindow)
        self.actionExit.setObjectName("actionExit")
        self.menuFile.addAction(self.actionOpen_csv_file)
        self.menuFile.addAction(self.actionExit)
        self.menubar.addAction(self.menuFile.menuAction())

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

        self.filename = ''
        self.canv = MatplotlibCanvas(self)
        self.df = []

        self.toolbar = Navi(self.canv,self.centralwidget)
        self.horizontalLayout.addWidget(self.toolbar)

        self.themes = ['bmh', 'classic', 'dark_background', 'fast',
        'fivethirtyeight', 'ggplot', 'grayscale', 'seaborn-bright',
         'seaborn-colorblind', 'seaborn-dark-palette', 'seaborn-dark',
         'seaborn-darkgrid', 'seaborn-deep', 'seaborn-muted', 'seaborn-notebook',
         'seaborn-paper', 'seaborn-pastel', 'seaborn-poster', 'seaborn-talk',
         'seaborn-ticks', 'seaborn-white', 'seaborn-whitegrid', 'seaborn',
         'Solarize_Light2', 'tableau-colorblind10']

        self.comboBox.addItems(self.themes)
        self.comboBox_1.addItems(['Select horizontal axis here'])
        self.comboBox_2.addItems(['Select vertical axis here'])

        self.pushButton.clicked.connect(self.getFile)
        self.comboBox.currentIndexChanged['QString'].connect(self.Update)
        self.comboBox_1.currentIndexChanged['QString'].connect(self.selectXaxis)
        self.comboBox_2.currentIndexChanged['QString'].connect(self.selectYaxis)
        self.actionExit.triggered.connect(MainWindow.close)
        self.actionOpen_csv_file.triggered.connect(self.getFile)
        self.radioButton.clicked.connect(self.vsAll)
        self.dataset={}
        self.x_axis_slt=None
        self.y_axis_slt=None
        self.vsall = False

    def vsAll(self):
        """
        This function will be called upon triggering the radio check button. If set to True, all the columsn in the csv
        will be plotted against the x-axis column. Please note that vs all means versus all, so that whatever value is
        selected as the x-axis, it wont be plotted against itself in this mode. Moreover, the time series data will be
        dedicated for the datetime x-axis and it wont be displayed in the vs all contents.

        """
        if self.vsall==False:
            self.vsall=True
        else:
            self.vsall=False
        self.Update(self.themes[0])

    def selectXaxis(self,value):
        """
        This function will update the plot according to the data of x axis selected from combo box

        """
        self.x_axis_slt=value
        self.Update(self.themes[0])

    def selectYaxis(self,value):
        """
        This function will update the plot according to the data of y axis selected from combo box

        """
        self.y_axis_slt=value
        self.Update(self.themes[0])

    def Update(self,value):

        """
        This function will input the value of theme and accordingly plot the data, if the data is relative, i.e., x verus y-axis
        then the user can assign x and y axis from the combo box. If all data should be plotted in paraller then leave,
        the combo boxes of axis selections to their default starting location.

        """
        plt.clf()
        plt.style.use(value)
        try:
            self.horizontalLayout.removeWidget(self.toolbar)
            self.verticalLayout.removeWidget(self.canv)

            sip.delete(self.toolbar)
            sip.delete(self.canv)
            self.toolbar = None
            self.canv = None
            self.verticalLayout.removeItem(self.spacerItem1)
        except Exception as e:
            print(e)
            pass
        self.canv = MatplotlibCanvas(self)
        self.toolbar = Navi(self.canv,self.centralwidget)

        self.horizontalLayout.addWidget(self.toolbar)
        self.verticalLayout.addWidget(self.canv)

        self.canv.axes.cla()
        ax = self.canv.axes

        try:

            if self.vsall:
                for k,v in self.dataset.items():

                    if k!=self.x_axis_slt and type(v[0])!=datetime:
                        lines = ax.plot(self.dataset[self.x_axis_slt],v,label=k)
                        datacursor(lines)

                legend = ax.legend()
                legend.set_draggable(True)
                ax.set_xlabel(self.x_axis_slt)
                ax.set_ylabel('ALL OTHERS')
                ax.set_title(self.Title)
                #plt.setp(ax.xaxis.get_majorticklabels(), rotation=25)  # uncomment if you want the x-axis to tilt 25 degree

            else:

                lines = ax.plot(self.dataset[self.x_axis_slt],self.dataset[self.y_axis_slt],label=self.y_axis_slt)
                datacursor(lines)
                legend = ax.legend()
                legend.set_draggable(True)
                ax.set_xlabel(self.x_axis_slt)
                ax.set_ylabel(self.y_axis_slt)
                ax.set_title(self.Title)
                #plt.setp(ax.xaxis.get_majorticklabels(), rotation=25)  # uncomment if you want the x-axis to tilt 25 degree

        except Exception as e:
            print(e)
            try:
                lines = self.df.plot(ax = self.canv.axes)
                datacursor(lines)
                legend = ax.legend()
                legend.set_draggable(True)

                ax.set_xlabel('X axis')
                ax.set_ylabel('Y axis')
                ax.set_title(self.Title)
            except Exception as e:
                print(e)
                pass
            pass

        self.canv.draw()

    def getFile(self):
        """ This function will get the address of the csv file location
            also calls a readData function
        """
        try:
            self.filename = QFileDialog.getOpenFileName(filter = "csv (*.csv)")[0]
            self.readData()
        except Exception as e:
            print(e)
            pass

    def getDataset(self,csvfilename):
        """
        This function will convert csv file to a dictionary of dataset, with keys as the columns' names and
        values as values. The datatime format should be one of the standard datatime formats. Before plottting
        we need to convert the string of data time in the csv file values to datatime format.
        """
        df = pd.read_csv(csvfilename,sep=';')
        LIST_OF_X_COLUMNS = ['Time[s]']
        LIST_OF_Y_COLUMNS = df.columns
        dataset={}
        # time_format = "%d/%m/%Y %H:%M:%S"
        # time_format =  "%m/%d/%Y"
        # time_format = "%d/%m/%Y"
        # time_format = "%m-%d-%Y"
        # time_format = "%d-%m-%Y"
        # time_format = "%H:%M:%S"
        # time_format = "%M:%S"
        # time_format = '%d/%m/%Y %H:%M%f'
        #time_format = '%Y-%m-%d %H:%M:%S.%f'

        for col in LIST_OF_Y_COLUMNS:
            dataset[col]  =  df[col].iloc[0:].values
            try:
                dataset[col] = [datetime.strptime(i) for i in df[col].iloc[0:].values]
            except Exception as e:
                pass
                print(e)
        return dataset, LIST_OF_X_COLUMNS, LIST_OF_Y_COLUMNS

    def readData(self):
        """ This function will read the data using pandas and call the update
            function to plot
        """
        import os
        self.dataset={}
        self.x_axis_slt=None
        self.y_axis_slt=None

        base_name = os.path.basename(self.filename)
        self.Title = os.path.splitext(base_name)[0]

        self.dataset, LIST_OF_X_COLUMNS, LIST_OF_Y_COLUMNS = self.getDataset(self.filename)
        chunksize = 10 ** 6
        self.df = pd.read_csv(self.filename,sep=';',chunksize = chunksize)

        self.Update(self.themes[0]) # lets 0th theme be the default : bmh
        self.comboBox_1.clear()
        #self.comboBox_2.clear()

        self.comboBox_2.addItems(['Select vertical axis here'])
        self.comboBox_1.addItems(LIST_OF_X_COLUMNS)
        self.comboBox_2.addItems(LIST_OF_Y_COLUMNS)

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
        self.label.setText(_translate("MainWindow", "Select Theme"))
        self.label_1.setText(_translate("MainWindow", "X-axis"))
        self.label_2.setText(_translate("MainWindow", "Y-axis"))
        self.label_3.setText(_translate("MainWindow", "vs all"))
        self.pushButton.setText(_translate("MainWindow", "Open"))
        self.menuFile.setTitle(_translate("MainWindow", "File"))
        self.actionOpen_csv_file.setText(_translate("MainWindow", "Open csv file"))
        self.actionExit.setText(_translate("MainWindow", "Exit"))

if __name__ == "__main__":
        import sys
        app = QtWidgets.QApplication(sys.argv)
        MainWindow = QtWidgets.QMainWindow()
        ui = Ui_MainWindow()
        ui.setupUi(MainWindow)

        MainWindow.show()
        sys.exit(app.exec_())

This is what I have and the output looks like. But, I need to get the output as shown in picture 1.

I'm very new to PyQt5. So, could anyone please help me with this. Thanks in advance.
Output from UI I have develop


问:
Unsupported Gradle version error with Android Studio 2021.3 when creating a new Android Studio Project
I am trying to build a new Android Studio Project as the title says and I am having this error in the Android Studio IDE :

```<code>Unsupported Gradle.
The project uses Gradle version which is incompatible with Android Studio 2021.3.

Possible solution:
 - Open Gradle wrapper settings, upgrade version to 3.0 or newer and reload the project

</code>```

gradle-wrapper.properties

```<code>#Thu Dec 15 13:54:44 EET 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

</code>```

I could not find any solution on the Internet. Please help.

I have tried changing the version to 3.0 but I don't know how to solve this problem and I need to do a project for university in Kotlin, and it does not work.

Body:
I am trying to build a new Android Studio Project as the title says and I am having this error in the Android Studio IDE :

Unsupported Gradle.
The project uses Gradle version which is incompatible with Android Studio 2021.3.

Possible solution:
 - Open Gradle wrapper settings, upgrade version to 3.0 or newer and reload the project

gradle-wrapper.properties

#Thu Dec 15 13:54:44 EET 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

I could not find any solution on the Internet. Please help.

I have tried changing the version to 3.0 but I don't know how to solve this problem and I need to do a project for university in Kotlin, and it does not work.