问:
Flutter Google signin using auth0 without the universal login of auth0
I am using auth0 to authenticate users to my flutter app, but auth0 provides their universal login.  But I don't want to use their universal login want to use my flutter UI instead.

I tried setting up a node server, and after that, I created a user using email and password. But now I want to add google sign in too. But without using auth0 universal login UI.

I want a sign-in with a Google button, and when I press it, it will show the Google sign-in popup and store that data into the auth0 without a password. How can I do that?


来源: stackexchange

问:
Arabic Text Classification usin CNN using Colab
I get this Error:
this is part a code:

```<code>macronum=sorted(set(dataset['targe']))
macro_to_id=dict((note,number)for number,note in enumerate[macronum])
dataset['targe']=dataset['targe'].apply(fun)

pandas/_libs/index_class_helper.pxi in pandas._libs.index.Int64Engine._check_type()

pandas/_libs/index_class_helper.pxi in pandas._libs.index.Int64Engine._check_type()

KeyError: 'targe'

The above exception was the direct cause of the following exception:

KeyError                                  Traceback (most recent call last)
/usr/local/lib/python3.8/dist-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance)
   3361                 return self._engine.get_loc(casted_key)
   3362             except KeyError as err:
-> 3363                 raise KeyError(key) from err
 3364
   3365         if is_scalar(key) and isna(key) and not self.hasnans:

KeyError: 'targe'
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I get this Error:
this is part a code:

macronum=sorted(set(dataset['targe']))
macro_to_id=dict((note,number)for number,note in enumerate[macronum])
dataset['targe']=dataset['targe'].apply(fun)

pandas/_libs/index_class_helper.pxi in pandas._libs.index.Int64Engine._check_type()

pandas/_libs/index_class_helper.pxi in pandas._libs.index.Int64Engine._check_type()

KeyError: 'targe'

The above exception was the direct cause of the following exception:

KeyError                                  Traceback (most recent call last)
/usr/local/lib/python3.8/dist-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance)
   3361                 return self._engine.get_loc(casted_key)
   3362             except KeyError as err:
-> 3363                 raise KeyError(key) from err
 3364
   3365         if is_scalar(key) and isna(key) and not self.hasnans:

KeyError: 'targe'


问:
Problem concatenating strings and variables for task scheduler
Based on this question, single quotes are for literals and double quotes are for pre-processing like variables.

in my situation, I need to do both at the same time. I want the variable to be processed and still have single/double quotes around it.

this is part of the process creating a scheduled task using PowerShell and where I have problem with:

```<code>$action = New-ScheduledTaskAction -Execute "pwsh.exe" -Argument "-noexit -command "cmdlet -parameter1 '$($Variable1)' -parameter2 '$($Variable2)'""
</code>```

I want it to appear like this in the arguments section of task scheduler GUI:

```<code>-noexit -command "cmdlet -parameter1 'string1' -parameter2 'string2'"
</code>```

which then, the final form that PowerShell 7.x will get should be this:

```<code>cmdlet -parameter1 'string1' -parameter2 'string2'
</code>```

how can I do this? this is way harder than regex for me.
I've tried lots of combination of single and double quotes on them, but none worked so far. my problem with task scheduler is that it does say it accepts scripts but not PowerShell, have to change it to be compatible with CMD (correct me if I'm wrong).

Body:
Based on this question, single quotes are for literals and double quotes are for pre-processing like variables.

in my situation, I need to do both at the same time. I want the variable to be processed and still have single/double quotes around it.

this is part of the process creating a scheduled task using PowerShell and where I have problem with:

$action = New-ScheduledTaskAction -Execute "pwsh.exe" -Argument "-noexit -command "cmdlet -parameter1 '$($Variable1)' -parameter2 '$($Variable2)'""

I want it to appear like this in the arguments section of task scheduler GUI:

-noexit -command "cmdlet -parameter1 'string1' -parameter2 'string2'"

which then, the final form that PowerShell 7.x will get should be this:

cmdlet -parameter1 'string1' -parameter2 'string2'

how can I do this? this is way harder than regex for me.
I've tried lots of combination of single and double quotes on them, but none worked so far. my problem with task scheduler is that it does say it accepts scripts but not PowerShell, have to change it to be compatible with CMD (correct me if I'm wrong).


问:
ExoPlayer is getting 403 response from server
ExoPlayer is getting 403 response from the server.

But when I am playing the same HLS playlist link with MX-Player then is it playing perfectly.

Code

Here is the code I have used in my android-app:

DataSource.Factory dataSourceFactory = new DefaultHttpDataSource.Factory()
  .setUserAgent(context.getString(R.string.user_agent))
  .setKeepPostFor302Redirects(true)
  .setAllowCrossProtocolRedirects(true);

MediaItem mediaItem = new MediaItem.Builder()
  .setMimeType(MimeTypes.APPLICATION_M3U8)
  .setUri(videoUri)
  .build();

MediaSource hlsMediaSource = new HlsMediaSource.Factory(dataSourceFactory)
  .setAllowChunklessPreparation(true)
  .createMediaSource(mediaItem);

player.setMediaSource(hlsMediaSource);
```

How can I resolve this issue in my ExoPlayer app?

Body:
ExoPlayer is getting 403 response from the server.

But when I am playing the same HLS playlist link with MX-Player then is it playing perfectly.

Code

Here is the code I have used in my android-app:

DataSource.Factory dataSourceFactory = new DefaultHttpDataSource.Factory()
  .setUserAgent(context.getString(R.string.user_agent))
  .setKeepPostFor302Redirects(true)
  .setAllowCrossProtocolRedirects(true);

MediaItem mediaItem = new MediaItem.Builder()
  .setMimeType(MimeTypes.APPLICATION_M3U8)
  .setUri(videoUri)
  .build();

MediaSource hlsMediaSource = new HlsMediaSource.Factory(dataSourceFactory)
  .setAllowChunklessPreparation(true)
  .createMediaSource(mediaItem);

player.setMediaSource(hlsMediaSource);

How can I resolve this issue in my ExoPlayer app?


问:
How to get theorem environment in bookdown slidy? It seems to have been removed?
In bookdown v0.24, it was possible to do

```<code>```{theorem}
my theorem
```
</code>```

to get a theorem environment in bookdown::slidy_presentation2 file.

This was removed in v0.25. The new way to do environments in bookdown

```<code>::: {.theorem}
my theorem
:::
</code>```

works for html documents, but not slides. Is this a bug, or is there a reason this was removed from slides? How can I make a theorem environment in slidy now.

As far as I can tell, it now seems impossible to make presentation slides in R Markdown using html (as opposed to beamer) with in-built theorem environments.

Body:
In bookdown v0.24, it was possible to do

```{theorem}
my theorem
```

to get a theorem environment in bookdown::slidy_presentation2 file.

This was removed in v0.25. The new way to do environments in bookdown

::: {.theorem}
my theorem
:::

works for html documents, but not slides. Is this a bug, or is there a reason this was removed from slides? How can I make a theorem environment in slidy now.

As far as I can tell, it now seems impossible to make presentation slides in R Markdown using html (as opposed to beamer) with in-built theorem environments.


问:
What's the last stable version of CDI/Weld we can use with latest Payara 4.x Server?
I use Payara Server 4.1.2.174 #badassfish (build 192) with default CDI/Weld 2.4.5 (Final),
but I know there is newest versions of CDI/Weld. Is there a reliable new version of CDI/Weld
to work with Payara 4.x?

The default version of CDI/Weld has many problems with deployment.


问:
Laravel app on shared hosting failed to load app.css and app.js
First I deployed a laravel 9 app to shared hosting using FileZilla.

What I did is I put the entire local app that I got it running in my localhost inside public_html in the server.

Before moving the entire local app inside the servers public_html directory I run the following commands:

composer install

npm run build

php artisan migrate

then inside the server using FileZilla I moved the .htaccess file and the index.php file from the public folder of the app to one level up so that both files are directly inside the public_html directory.

After that I modified the index.php file content to interact with the app's folders from its new location which is the /public_html directory instead of being inside /public_html/public.

With doing that I now can access my app's content just by visiting the my_domain directly instead of having to go to my_domain/public to get the app's content.

However, when I visit my_domain/register to register a new account I get the app loaded but without css and js.

When I inspect the page using my chrome browser I see in the network tab that the files:

client, app.css and app.js failed to load through the network.

For example the inspection gives me the information that the app requested app.css through
http://[::1]:5173/resources/css/app.css but it failed to get it, however when I visit https://my_domain/resources/css/app.css I can get the file and its content is showed in the browser.


问:
Unable to make POST request HTTPS server via axios in NuxtJS
When in NuxtJS, I am trying to make a POST request to a HTTPS server via axios and I have it deployed via Vercel. It is not getting the content from the POST request.

Current Code:

```<code><script>
import LoadingWheel from '@/components/LoadingWheel.vue'
export default {
    components: { LoadingWheel },
    data() {
        return {
            form: {
                question: '',
                submitCounter: 0
            },
            answer: null,
            loading: false,
            typedAnswer: '',
            urls: null
        }
    },
    created() {
        setInterval(() => {
            this.form.submitCounter = 0
        }, 3600000)
    },
    methods: {
        resetForm() {
            this.form.question = ''
            this.answer = null
            this.loading = false
            this.typedAnswer = ''
            this.urls = null
        },
        async submitForm() {
            this.form.submitCounter++
            this.loading = true
            try {
                const { data } = await this.$axios.post(
                    'https://internet-ml-backend.paas.thamognya.com/api/nlp/no-context/question-answering/',
                    {
                        question: this.form.question
                    }
                )
                this.tmpquestion = this.form.question
                this.resetForm()
                this.answer = data.response.answer
                const typingInterval = setInterval(() => {
                    this.typedAnswer +=
                        this.answer[this.typedAnswer.length] || ''
                    if (this.typedAnswer.length === this.answer.length) {
                        clearInterval(typingInterval)
                    }
                }, 150)
                this.urls = data.resources
            } catch (error) {
                // console.error(error)
            }
        }
    }
}
</script>
</code>```

It works locally (i.e running both backend and frontend locally) and additionally I can make POST requests to the server. Generally it should make the POST request and then finish the loading screen and then show / print the answer to the screen.

logs that come up after I make the POST request: CORS header 'Access-Control-Allow-Origin' missing and then NS_ERROR_DOM_BAD_URI.

Body:
When in NuxtJS, I am trying to make a POST request to a HTTPS server via axios and I have it deployed via Vercel. It is not getting the content from the POST request.

Current Code:

It works locally (i.e running both backend and frontend locally) and additionally I can make POST requests to the server. Generally it should make the POST request and then finish the loading screen and then show / print the answer to the screen.

logs that come up after I make the POST request: CORS header 'Access-Control-Allow-Origin' missing and then NS_ERROR_DOM_BAD_URI.


问:
serve Static Files and Media Files of Django app in Production using NGINX
The project works correctly, but I get a 404 error when reading static files!

my settings.py:

```<code>STATIC_URL = 'static/'
STATIC_ROOT = '/home/static'
MEDIA_URL = 'media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
</code>```

nginx.conf:

```<code>user www-data;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;

events {
    worker_connections 1024;
}

http {
    include /etc/nginx/mime.types;
    default_type application/octet-stream;
    access_log /var/log/nginx/access.log;

    upstream main {
        server 127.0.0.1:8000;
    }

    server {
        listen 80;
        server_name localhost;
        charset utf-8;
        location /static/ {
            alias /home/static;
        }
        location / {
            proxy_pass http://main;
        }
    }
}
</code>```

I`m not using gunicorn. are my settings wrong?

Body:
The project works correctly, but I get a 404 error when reading static files!

my settings.py:

STATIC_URL = 'static/'
STATIC_ROOT = '/home/static'
MEDIA_URL = 'media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')

nginx.conf:

user www-data;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;

events {
    worker_connections 1024;
}

http {
    include /etc/nginx/mime.types;
    default_type application/octet-stream;
    access_log /var/log/nginx/access.log;

    upstream main {
        server 127.0.0.1:8000;
    }

    server {
        listen 80;
        server_name localhost;
        charset utf-8;
        location /static/ {
            alias /home/static;
        }
        location / {
            proxy_pass http://main;
        }
    }
}

I`m not using gunicorn. are my settings wrong?


问:
Wiremock sends IFormFile in the body
```<code>[HttpPost]
public async Task<ActionResult<MyResponse>> Post([FromRoute] MyRequest request, CancellationToken cancellationToken = default)
{
       ...
}
public class MyRequest
{
   [FromForm]
   public IFormFile File { get; set; }

   [FromRoute(Name = "userId")]
   public string UserId{ get; set; }
}

[Test]
public async Task UploadCarOK()
{
   var stream = new MemoryStream();
   var writer = new StreamWriter(stream);
   writer.Write("abc");
   writer.Flush();
   stream.Position = 0;

   IFormFile file = new FormFile(stream, 0, stream.Length, "abc", "filename.pdf");
   var userId = "123";
   var server = WireMockServer.Start(8090);
   server.Given(Request.Create()
         .WithPath($"/api/cars/{userId}")
         .WithBody(file))
      .RespondWith(new MyResponse());
   ...
}
</code>```

When running test I'm getting File (IFormFile) as null.  Using
wiremock how can I post [FromForm] property to the endpoint (above
example sends userId properly but IFormFile file is null).

Title: Wiremock sends IFormFile in the body

Body:
[HttpPost]
public async Task<ActionResult<MyResponse>> Post([FromRoute] MyRequest request, CancellationToken cancellationToken = default)
{
       ...
}
public class MyRequest
{
   [FromForm]
   public IFormFile File { get; set; }

   [FromRoute(Name = "userId")]
   public string UserId{ get; set; }
}

[Test]
public async Task UploadCarOK()
{
   var stream = new MemoryStream();
   var writer = new StreamWriter(stream);
   writer.Write("abc");
   writer.Flush();
   stream.Position = 0;

   IFormFile file = new FormFile(stream, 0, stream.Length, "abc", "filename.pdf");
   var userId = "123";
   var server = WireMockServer.Start(8090);
   server.Given(Request.Create()
         .WithPath($"/api/cars/{userId}")
         .WithBody(file))
      .RespondWith(new MyResponse());
   ...
}

When running test I'm getting File (IFormFile) as null.  Using
wiremock how can I post [FromForm] property to the endpoint (above
example sends userId properly but IFormFile file is null).


问:
Align Stars in Table including Boarder using HTML
I am creating a table only with HTML but would like to add spacing between my skills and stars so that the starts alingns with each other?

```<code><table border="1">
    <tr>
        <td>Management⭐⭐⭐⭐</td><td>OSHE Act⭐⭐⭐</td>
    </tr>
    <tr>
        <td>Accounting⭐⭐⭐</td><td>Marketing⭐⭐⭐⭐⭐</td>
    </tr>
</table>
</code>```

I want it like this but incliding the border showed above

enter image description here

Body:
I am creating a table only with HTML but would like to add spacing between my skills and stars so that the starts alingns with each other?

        Management⭐⭐⭐⭐	OSHE Act⭐⭐⭐

        Accounting⭐⭐⭐	Marketing⭐⭐⭐⭐⭐

I want it like this but incliding the border showed above

enter image description here


问:
AWS Amplify DataStore.Query Reachability - Notifying reachability issue for Android
In my React Native Expo project, I am fetching data using DataStore.query to my amplify backend.

For iOS, I get:

```<code>iOS Bundling complete 53ms
 LOG  [INFO] 49:57.609 Reachability - subscribing to reachability in React Native
 LOG  [INFO] 50:58.504 Reachability - Notifying reachability change true
</code>```

However for Android, I get:

```<code>Android Bundling complete 73ms
 LOG  [INFO] 50:58.358 Reachability - subscribing to reachability in React Native
 LOG  [INFO] 51:58.380 Reachability - Notifying reachability change false
</code>```

The Notifying reachability for android is false, which means it fails to fetch any data from the backend. For iOS it works just fine

Anyone had a similar issue?

Body:
In my React Native Expo project, I am fetching data using DataStore.query to my amplify backend.

For iOS, I get:

iOS Bundling complete 53ms
 LOG  [INFO] 49:57.609 Reachability - subscribing to reachability in React Native
 LOG  [INFO] 50:58.504 Reachability - Notifying reachability change true

However for Android, I get:

Android Bundling complete 73ms
 LOG  [INFO] 50:58.358 Reachability - subscribing to reachability in React Native
 LOG  [INFO] 51:58.380 Reachability - Notifying reachability change false

The Notifying reachability for android is false, which means it fails to fetch any data from the backend. For iOS it works just fine

Anyone had a similar issue?


问:
Problem with .htacces RewriteRule because of name ambiguity
I have the following index.php file in root:

<?php
$error_encountered = false;
$page_to_show = "";

if (isset($_GET['page'])) {
    $page = $_GET['page'];
    if ($page == "article") {
        if (!isset($_GET['id'])) {
            $error_encountered = true;
            http_response_code(404);
            exit;
        }
        else {
            $id = $_GET['id'];
            $page_to_show = "article/article_show.php";
        }
    }
    else if ($page == "article-edit") {
        if (!isset($_GET['id'])) {
            $error_encountered = true;
            http_response_code(404);
            exit;
        }
        else {
            $id = $_GET['id'];
            $page_to_show = "article-edit/article_edit.php";
        }
    }
    else if ($page == "articles-list") {
        $page_to_show = "article-list/article_list.php";
    }
    else {
        $error_encountered = true;
        http_response_code(404);
        exit;
    }
}
else {
    $error_encountered = true;
}
if (!$error_encountered) {
    include "templates/header.php";
    include $page_to_show;
    include "templates/footer.php";
}

?>
```
<p>I want to access article-list at the url ./articles
So I have the following .htacces file:</p>
```RewriteEngine On
RewriteBase /~number/cms/

RewriteRule ^articles$ ?page=articles-list [L]

RewriteRule ^article/([0-9]+)$ index.php?page=article&id=$1 [L]

RewriteRule ^article-edit/([0-9]+)$ index.php?page=article-edit&id=$1 [L]

```

I tried it, but when I type:
./cms/articles
it somehow redirects me to ./cms/articles/?page=articles

How could this happen?

The interesting thing is that when I try the RewriteRule ^articles ?page=articles-list [L] without the $ and I try to access for example ./cms/articles1212 it works...

Could there be an error because of global variables, or filenames?

Body:
I have the following index.php file in root:

<?php
$error_encountered = false;
$page_to_show = "";

if (isset($_GET['page'])) {
    $page = $_GET['page'];
    if ($page == "article") {
        if (!isset($_GET['id'])) {
            $error_encountered = true;
            http_response_code(404);
            exit;
        }
        else {
            $id = $_GET['id'];
            $page_to_show = "article/article_show.php";
        }
    }
    else if ($page == "article-edit") {
        if (!isset($_GET['id'])) {
            $error_encountered = true;
            http_response_code(404);
            exit;
        }
        else {
            $id = $_GET['id'];
            $page_to_show = "article-edit/article_edit.php";
        }
    }
    else if ($page == "articles-list") {
        $page_to_show = "article-list/article_list.php";
    }
    else {
        $error_encountered = true;
        http_response_code(404);
        exit;
    }
}
else {
    $error_encountered = true;
}
if (!$error_encountered) {
    include "templates/header.php";
    include $page_to_show;
    include "templates/footer.php";
}

?>

I want to access article-list at the url ./articles
So I have the following .htacces file:

RewriteEngine On
RewriteBase /~number/cms/

RewriteRule ^articles$ ?page=articles-list [L]

RewriteRule ^article/([0-9]+)$ index.php?page=article&id=$1 [L]

RewriteRule ^article-edit/([0-9]+)$ index.php?page=article-edit&id=$1 [L]

I tried it, but when I type:
./cms/articles
it somehow redirects me to ./cms/articles/?page=articles

How could this happen?

The interesting thing is that when I try the RewriteRule ^articles ?page=articles-list [L] without the $ and I try to access for example ./cms/articles1212 it works...

Could there be an error because of global variables, or filenames?


问:
Get any document version (including current) via Sharepoint REST API with a single URL
I want to get the metadata and file of many documents via REST API. The documents are stored in a document library. Requesting metadata and file can not be done transactionally via one REST request. So I request the metadata for document at a timestamp A, which returns me a specific version id (for example 512). Then some operations are applied locally on metadata. After that, I want to download the file for the given document version id in one single request. I don't know, if the document has been changed at the server since timestamp A and the timestamp, when I want to download the file. According to my observations, I can not download the file via (1)...

<host,site>/GetFileByServerRelativeUrl('<file-relative-url>')/$value

..., because this would only returns the file of the current document version at the server, which could be changed since timestamp A.

Via (2)...

<host,site>/GetFileByServerRelativeUrl('<file-relative-url>')/versions(<version id>)/$value

...I get the file of a specific document version. But according to my observation, this URL is only for requesting files of historical document version ids. If I try to get the file of current document version via Request (2) with <version id>=512 and 512 is still the current document version at the server, null is returned.

Does somebody know, if there is a URL, which I can use to download the file for any document version (historical and current) like

<host,site>/GetFileByServerRelativeUrl('<file-relative-url>')/versionsIncludingCurrent(<version id>)/$value

Sure, I can check, if the document version 512 is still the current version, and then decide, if I download it via Request (1) or (2). But that means, that I have to call the server again to check this - for one document, it's no problem. If there a thousands or millions of documents, the performance could decreases signifcantly. So I want to avoid such additional calls.

Thank you in advance


问:
Django - Storing user info sessions vs database
In my django website I have a login system which uses sessions to keep the user logged in across all pages. I would like to store recently viewed items for users if they are logged in or browsing as a guest user. When a user is logged in I would like the user to see their recently viewed items even when they access my website on another device.

I understand that if a user is browsing as a guest recently viewed items would be stored locally in the browser.

Would i need to store recently viewed items in a database if a user is logged in so that the recently viewed items associated with the current user id can be accessed and displayed on other devices. Or is there a way to achieve this with the use of sessions?

example of request.session dict

```<code>{
    "user_id":-1, # (-1), flag value when no user is logged in (browsing as guest)
    "recently-viewed":['sw0001a','sw0036a',...],
    "login_attempts":2,
}
</code>```

concept of SQL table storing recently viewed items (if necessary)

```<code>CREATE TABLE recently_viewed (
    entry_id INTEGER PRIMARY KEY NOT NULL AUTOINCREMENT,
    item_id VARCHAR NOT NULL REFERENCES App_item (item_id),
    user_id INTEGER NOT NULL REFERENCES App_user (user_id),
    view_date DATE NOT NULL
);
</code>```

Body:
In my django website I have a login system which uses sessions to keep the user logged in across all pages. I would like to store recently viewed items for users if they are logged in or browsing as a guest user. When a user is logged in I would like the user to see their recently viewed items even when they access my website on another device.

I understand that if a user is browsing as a guest recently viewed items would be stored locally in the browser.

Would i need to store recently viewed items in a database if a user is logged in so that the recently viewed items associated with the current user id can be accessed and displayed on other devices. Or is there a way to achieve this with the use of sessions?

example of request.session dict

{
    "user_id":-1, # (-1), flag value when no user is logged in (browsing as guest)
    "recently-viewed":['sw0001a','sw0036a',...],
    "login_attempts":2,
}

concept of SQL table storing recently viewed items (if necessary)

CREATE TABLE recently_viewed (
    entry_id INTEGER PRIMARY KEY NOT NULL AUTOINCREMENT,
    item_id VARCHAR NOT NULL REFERENCES App_item (item_id),
    user_id INTEGER NOT NULL REFERENCES App_user (user_id),
    view_date DATE NOT NULL
);


问:
How to trigger a pipeline once the code is meged and approved in gitlab?
How do we trigger a pipeline in gitlab once the PR is merged and approved.
Below is my code:

```<code>contactcreate-tst2-19:
  stage: deploy
  script:
    - 'curl --request POST --form token=<token> --form ref=19.0 --form variables[ENVIRONMENT]=TST2 https://vcs.build.livevox.net/api/v4/<id>/trigger/pipeline'
  rules:
    - if: $CI_MERGE_REQUEST_APPROVED
      changes:
        - 'contact/contact-create/TST2/config.json'
</code>```

anothe rule for below comment question

```<code>rules:
    - if: $CI_MERGE_REQUEST_APPROVED
      changes:
        - 'scripter/TST2/scripterTestData.json'
        - 'scripter/.gitlab-scripter.yml'
      when: manual
</code>```

Body:
How do we trigger a pipeline in gitlab once the PR is merged and approved.
Below is my code:

contactcreate-tst2-19:
  stage: deploy
  script:
    - 'curl --request POST --form token=<token> --form ref=19.0 --form variables[ENVIRONMENT]=TST2 https://vcs.build.livevox.net/api/v4/<id>/trigger/pipeline'
  rules:
    - if: $CI_MERGE_REQUEST_APPROVED
      changes:
        - 'contact/contact-create/TST2/config.json'

anothe rule for below comment question

rules:
    - if: $CI_MERGE_REQUEST_APPROVED
      changes:
        - 'scripter/TST2/scripterTestData.json'
        - 'scripter/.gitlab-scripter.yml'
      when: manual


问:
.NET Portability analyser tool reports as not compatible for Array.Reverse() API in net standard 2.0
I have created a .NET core 2.0 project and added the below code

```<code>  public static void Main()
   {
      int nMonths = DateTimeFormatInfo.CurrentInfo.Calendar.GetMonthsInYear(DateTime.Now.Year);
      int[][] months = new int[nMonths][];

      Array.Reverse(months);

      }
   }

</code>```

output from portability analyser

complete code is available here

When i ran the Portability analyser tool to check the compatibility with .Net standard 2.0 ,tool gives report as not compatible for Array.Reverse(months); i.e. Jagged array example which is given in Microsoft net standard-2.0 API documentation. since in my current .net core 2.0 project i have used byte[] for some requirement and portability analyser tool report gives as not compatible with .NET standard 2.0 compatibility , i am confused about the result from Portability analyser and the Microsoft API document.

With the below changes, the .NET portability analyser doesn't give any issues

```<code>private static readonly byte[] beginTime = { 0x01, 0x9e, 0xba, 0xda, 0xd3, 0x2e, 0x30, 0x50 };
 Array dataArray = beginTime;
 Array.Reverse(dataArray);
 beginTime =(byte[])dataArray;
</code>```

Body:
I have created a .NET core 2.0 project and added the below code

  public static void Main()
   {
      int nMonths = DateTimeFormatInfo.CurrentInfo.Calendar.GetMonthsInYear(DateTime.Now.Year);
      int[][] months = new int[nMonths][];

      Array.Reverse(months);

      }
   }

output from portability analyser

complete code is available here

When i ran the Portability analyser tool to check the compatibility with .Net standard 2.0 ,tool gives report as not compatible for Array.Reverse(months); i.e. Jagged array example which is given in Microsoft net standard-2.0 API documentation. since in my current .net core 2.0 project i have used byte[] for some requirement and portability analyser tool report gives as not compatible with .NET standard 2.0 compatibility , i am confused about the result from Portability analyser and the Microsoft API document.

With the below changes, the .NET portability analyser doesn't give any issues

private static readonly byte[] beginTime = { 0x01, 0x9e, 0xba, 0xda, 0xd3, 0x2e, 0x30, 0x50 };
 Array dataArray = beginTime;
 Array.Reverse(dataArray);
 beginTime =(byte[])dataArray;


问:
.dockerVolume() of WebdriverManager causes (Connection reset) error on Linux-VM
I run my tests in docker by using webdrivermanager. I need to upload some files into the running docker. So, I will be able to use those files in my tests. I used .dockerVolume() like:

```<code>WebDriverManager wdm = WebDriverManager.chromedriver().browserInDocker().enableVnc().enableRecording().dockerVolumes("/home/GitHub/e2e-test:/home/selenium");
driver = wdm.create();
</code>```

It is working well on my local well. But I need to run the tests on a GCP VM instance: Debian GNU/Linux 11

It was working well on the VM without using .dockerVolume() like:

```<code>WebDriverManager wdm = WebDriverManager.chromedriver().browserInDocker().enableVnc().enableRecording();
driver = wdm.create();
</code>```

So, briefly, It is working on my local with and without .dockerVolume(). However, it is not working on the VM with .dockerVolume().

I keep getting the error below:

io.github.bonigarcia.wdm.config.WebDriverManagerException: There was an error creating WebDriver object for Chrome
at io.github.bonigarcia.wdm.WebDriverManager.instantiateDriver(WebDriverManager.java:1775)
at io.github.bonigarcia.wdm.WebDriverManager.create(WebDriverManager.java:425)
at e2e.toolset.WebDriverTool.setDriver(WebDriverTool.java:13)

How can I solve this issue?

Logs in details:

[INFO] ------------------------------------------------------- [INFO]
T E S T S [INFO]
------------------------------------------------------- [INFO] Running e2e.TestRunner

@regression Scenario: DataScout Login                      #
src/test/resources/features/DataScout.feature:4 2023-02-16 11:49:29
[main] DEBUG i.g.b.wdm.cache.ResolutionCache.checkValidity(156) -
Removing resolution chrome-container-latest=106.0 from cache (expired
on Thu Oct 20 09:53:59 UTC 2022) 2023-02-16 11:49:29 [main] DEBUG
i.g.b.wdm.docker.DockerHubService.listTags(60) - Getting browser image
list from Docker Hub 2023-02-16 11:49:29 [main] TRACE
i.g.b.wdm.docker.DockerHubService.listTags(73) - Sending request to
https://hub.docker.com/v2/repositories/selenoid/vnc/tags?page=1&page_size=1024
2023-02-16 11:49:30 [main] TRACE
i.g.b.wdm.docker.DockerHubService.listTags(73) - Sending request to
https://hub.docker.com/v2/repositories/selenoid/vnc/tags?page=2&page_size=1024
2023-02-16 11:49:30 [main] TRACE
i.g.b.wdm.docker.DockerHubService.listTags(73) - Sending request to
https://hub.docker.com/v2/repositories/selenoid/vnc/tags?page=3&page_size=1024
2023-02-16 11:49:31 [main] DEBUG
i.g.b.wdm.docker.DockerService.getImageVersionFromDockerHub(471) - The
latest version of Chrome in Docker Hub is 110.0 2023-02-16 11:49:31
[main] TRACE i.g.b.wdm.docker.DockerService.getDockerImage(517) -
Docker image: selenoid/vnc:chrome_110.0 2023-02-16 11:49:31 [main]
INFO  i.g.b.wdm.docker.DockerService.pullImageIfNecessary(330) -
Pulling Docker image selenoid/vnc:chrome_110.0 (this might take some
time, but only the first time) 2023-02-16 11:49:32 [main] TRACE
i.g.b.wdm.docker.DockerService.pullImageIfNecessary(336) - Docker
image selenoid/vnc:chrome_110.0 pulled 2023-02-16 11:49:32 [main]
DEBUG
i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(119)

Storing resolution chrome-container-latest=110.0 in cache (valid until 12:49:32 16/02/2023 UTC) 2023-02-16 11:49:32 [main] TRACE
i.g.bonigarcia.wdm.config.Config.getDockerMemSizeBytes(1142) - The
memory size 256m is equivalent to 268435456 bytes) 2023-02-16 11:49:32
[main] TRACE
i.g.bonigarcia.wdm.config.Config.getDockerMemSizeBytes(1142) - The
memory size 128m is equivalent to 134217728 bytes) 2023-02-16 11:49:32
[main] TRACE i.g.b.wdm.docker.DockerService.startBrowserContainer(638)

Using custom volumes: [/home/furkan_yavuz/e2e-tests/src/test/resources/testData:/home/selenium]
2023-02-16 11:49:32 [main] INFO
i.g.b.wdm.docker.DockerService.startContainer(177) - Starting Docker
container selenoid/vnc:chrome_110.0 2023-02-16 11:49:32 [main] TRACE
i.g.b.wdm.docker.DockerService.startContainer(190) - Adding sysadmin
capability 2023-02-16 11:49:32 [main] TRACE
i.g.b.wdm.docker.DockerService.startContainer(196) - Using shm size:
268435456 2023-02-16 11:49:32 [main] TRACE
i.g.b.wdm.docker.DockerService.startContainer(202) - Using network:
bridge 2023-02-16 11:49:32 [main] TRACE
i.g.b.wdm.docker.DockerService.startContainer(207) - Using exposed
ports: [4444, 5900] 2023-02-16 11:49:32 [main] TRACE
i.g.b.wdm.docker.DockerService.startContainer(216) - Using binds:
[/home/furkan_yavuz/e2e-tests/src/test/resources/testData:/home/selenium:rw]
2023-02-16 11:49:32 [main] TRACE
i.g.b.wdm.docker.DockerService.startContainer(222) - Using mounts:
[Mount(type=TMPFS, source=null, target=/tmp, readOnly=null,
bindOptions=null, volumeOptions=null,
tmpfsOptions=TmpfsOptions(sizeBytes=134217728, mode=null))] 2023-02-16
11:49:32 [main] TRACE
i.g.b.wdm.docker.DockerService.startContainer(228) - Using envs:
[TZ=Etc/UTC, LANG=EN, SCREEN_RESOLUTION=1280x1080x24, ENABLE_VNC=true,
DRIVER_ARGS=--whitelisted-ips= --allowed-origins=*] 2023-02-16
11:49:33 [main] TRACE i.g.b.wdm.docker.DockerService.getBindPort(294)

Port list {5900/tcp=[Lcom.github.dockerjava.api.model.Ports$Binding;@217bf99e,
4444/tcp=[Lcom.github.dockerjava.api.model.Ports$Binding;@6807a356} --
Exposed port 4444/tcp = [0.0.0.0:49197, :::49197] 2023-02-16 11:49:33
[main] TRACE i.g.b.wdm.docker.DockerService.startBrowserContainer(693)

Browser remote URL http://localhost:49197/ 2023-02-16 11:49:33 [main] TRACE i.g.b.wdm.docker.DockerService.getBindPort(294) - Port
list
{5900/tcp=[Lcom.github.dockerjava.api.model.Ports$Binding;@d675f9f,
4444/tcp=[Lcom.github.dockerjava.api.model.Ports$Binding;@58af5076} --
Exposed port 5900/tcp = [0.0.0.0:49196, :::49196] 2023-02-16 11:49:33
[main] DEBUG i.g.b.wdm.docker.DockerService.startBrowserContainer(700)

VNC server URL: vnc://localhost:49196/ 2023-02-16 11:49:33 [main] TRACE i.g.bonigarcia.wdm.WebDriverManager.createDockerWebDriver(1893)

The Selenium Serverl URL is http://localhost:49197/ 2023-02-16 11:49:33 [main] DEBUG
i.g.b.wdm.webdriver.WebDriverCreator.createRemoteWebDriver(77) -
Creating WebDriver object for chrome at http://localhost:49197/ with
Capabilities {browserName: chrome, goog:chromeOptions: {args:
[--disable-gpu], extensions: []}} 2023-02-16 11:49:34 [main] TRACE
i.g.b.wdm.webdriver.WebDriverCreator.createRemoteWebDriver(92) -
SocketException creating WebDriver object (Connection reset)
2023-02-16 11:49:35 [main] TRACE
i.g.b.wdm.webdriver.WebDriverCreator.createRemoteWebDriver(86) -
Requesting http://localhost:49197/ (the response code is 404) Feb 16,
2023 11:49:35 AM
org.openqa.selenium.remote.tracing.opentelemetry.OpenTelemetryTracer
createTracer INFO: Using OpenTelemetry for tracing 2023-02-16 11:49:36
[main] TRACE
i.g.b.wdm.webdriver.WebDriverCreator.createRemoteWebDriver(92) -
SessionNotCreatedException creating WebDriver object (Could not start
a new session. Response code 500. Message: unknown error: Chrome
failed to start: crashed.   (unknown error: DevToolsActivePort file
doesn't exist)   (The process started from chrome location
/usr/bin/google-chrome is no longer running, so ChromeDriver is
assuming that Chrome has crashed.)  Host info: host: 'selenium-tests',
ip: '10.156.0.4' Build info: version: '4.6.0', revision: '79f1c02ae20'
System info: os.name: 'Linux', os.arch: 'amd64', os.version:
'5.10.0-18-cloud-amd64', java.version: '17.0.6' Driver info:
org.openqa.selenium.remote.RemoteWebDriver Command: [null, newSession
{capabilities=[Capabilities {browserName: chrome, goog:chromeOptions:
{args: [--disable-gpu], extensions: []}}],
desiredCapabilities=Capabilities {browserName: chrome,
goog:chromeOptions: {args: [--disable-gpu], extensions: []}}}]
Capabilities {}) 2023-02-16 11:49:37 [main] TRACE
i.g.b.wdm.webdriver.WebDriverCreator.createRemoteWebDriver(86) -
Requesting http://localhost:49197/ (the response code is 404)
2023-02-16 11:49:37 [main] TRACE
i.g.b.wdm.webdriver.WebDriverCreator.createRemoteWebDriver(92) -
SessionNotCreatedException creating WebDriver object (Could not start
a new session. Response code 500. Message: unknown error: Chrome
failed to start: crashed.   (unknown error: DevToolsActivePort file
doesn't exist)   (The process started from chrome location
/usr/bin/google-chrome is no longer running, so ChromeDriver is
assuming that Chrome has crashed.)  Host info: host: 'selenium-tests',
ip: '10.156.0.4' Build info: version: '4.6.0', revision: '79f1c02ae20'
System info: os.name: 'Linux', os.arch: 'amd64', os.version:
'5.10.0-18-cloud-amd64', java.version: '17.0.6' Driver info:
org.openqa.selenium.remote.RemoteWebDriver Command: [null, newSession
{capabilities=[Capabilities {browserName: chrome, goog:chromeOptions:
{args: [--disable-gpu], extensions: []}}],
desiredCapabilities=Capabilities {browserName: chrome,
goog:chromeOptions: {args: [--disable-gpu], extensions: []}}}]
Capabilities {}) 2023-02-16 11:49:38 [main] TRACE
i.g.b.wdm.webdriver.WebDriverCreator.createRemoteWebDriver(86) -
Requesting http://localhost:49197/ (the response code is 404)
2023-02-16 11:49:38 [main] TRACE
i.g.b.wdm.webdriver.WebDriverCreator.createRemoteWebDriver(92) -
SessionNotCreatedException creating WebDriver object (Could not start
a new session. Response code 500. Message: unknown error: Chrome
failed to start: crashed.   (unknown error: DevToolsActivePort file
doesn't exist)   (The process started from chrome location
/usr/bin/google-chrome is no longer running, so ChromeDriver is
assuming that Chrome has crashed.)  Host info: host: 'selenium-tests',
ip: '10.156.0.4' Build info: version: '4.6.0', revision: '79f1c02ae20'
System info: os.name: 'Linux', os.arch: 'amd64', os.version:
'5.10.0-18-cloud-amd64', java.version: '17.0.6' Driver info:
org.openqa.selenium.remote.RemoteWebDriver Command: [null, newSession
{capabilities=[Capabilities {browserName: chrome, goog:chromeOptions:
{args: [--disable-gpu], extensions: []}}],
desiredCapabilities=Capabilities {browserName: chrome,
goog:chromeOptions: {args: [--disable-gpu], extensions: []}}}]
Capabilities {}) 2023-02-16 11:49:39 [main] TRACE
i.g.b.wdm.webdriver.WebDriverCreator.createRemoteWebDriver(86) -
Requesting http://localhost:49197/ (the response code is 404)
2023-02-16 11:49:39 [main] TRACE
i.g.b.wdm.webdriver.WebDriverCreator.createRemoteWebDriver(92) -
SessionNotCreatedException creating WebDriver object (Could not start
a new session. Response code 500. Message: unknown error: Chrome
failed to start: crashed.   (unknown error: DevToolsActivePort file
doesn't exist)   (The process started from chrome location
/usr/bin/google-chrome is no longer running, so ChromeDriver is
assuming that Chrome has crashed.)  Host info: host: 'selenium-tests',
ip: '10.156.0.4' Build info: version: '4.6.0', revision: '79f1c02ae20'
System info: os.name: 'Linux', os.arch: 'amd64', os.version:
'5.10.0-18-cloud-amd64', java.version: '17.0.6' Driver info:
org.openqa.selenium.remote.RemoteWebDriver Command: [null, newSession
{capabilities=[Capabilities {browserName: chrome, goog:chromeOptions:
{args: [--disable-gpu], extensions: []}}],
desiredCapabilities=Capabilities {browserName: chrome,
goog:chromeOptions: {args: [--disable-gpu], extensions: []}}}]
Capabilities {}) 2023-02-16 11:49:40 [main] TRACE
i.g.b.wdm.webdriver.WebDriverCreator.createRemoteWebDriver(86) -
Requesting http://localhost:49197/ (the response code is 404)
2023-02-16 11:49:41 [main] TRACE
i.g.b.wdm.webdriver.WebDriverCreator.createRemoteWebDriver(92) -
SessionNotCreatedException creating WebDriver object (Could not start
a new session. Response code 500. Message: unknown error: Chrome
failed to start: crashed.   (unknown error: DevToolsActivePort file
doesn't exist)   (The process started from chrome location
/usr/bin/google-chrome is no longer running, so ChromeDriver is
assuming that Chrome has crashed.)  Host info: host: 'selenium-tests',
ip: '10.156.0.4' Build info: version: '4.6.0', revision: '79f1c02ae20'
System info: os.name: 'Linux', os.arch: 'amd64', os.version:
'5.10.0-18-cloud-amd64', java.version: '17.0.6' Driver info:
org.openqa.selenium.remote.RemoteWebDriver Command: [null, newSession
{capabilities=[Capabilities {browserName: chrome, goog:chromeOptions:
{args: [--disable-gpu], extensions: []}}],
desiredCapabilities=Capabilities {browserName: chrome,
goog:chromeOptions: {args: [--disable-gpu], extensions: []}}}]

Related Github issue link: https://github.com/bonigarcia/webdrivermanager/issues/996

Body:
I run my tests in docker by using webdrivermanager. I need to upload some files into the running docker. So, I will be able to use those files in my tests. I used .dockerVolume() like:

WebDriverManager wdm = WebDriverManager.chromedriver().browserInDocker().enableVnc().enableRecording().dockerVolumes("/home/GitHub/e2e-test:/home/selenium");
driver = wdm.create();

It is working well on my local well. But I need to run the tests on a GCP VM instance: Debian GNU/Linux 11

It was working well on the VM without using .dockerVolume() like:

WebDriverManager wdm = WebDriverManager.chromedriver().browserInDocker().enableVnc().enableRecording();
driver = wdm.create();

So, briefly, It is working on my local with and without .dockerVolume(). However, it is not working on the VM with .dockerVolume().

I keep getting the error below:

io.github.bonigarcia.wdm.config.WebDriverManagerException: There was an error creating WebDriver object for Chrome
at io.github.bonigarcia.wdm.WebDriverManager.instantiateDriver(WebDriverManager.java:1775)
at io.github.bonigarcia.wdm.WebDriverManager.create(WebDriverManager.java:425)
at e2e.toolset.WebDriverTool.setDriver(WebDriverTool.java:13)

How can I solve this issue?

Logs in details:

[INFO] ------------------------------------------------------- [INFO]
T E S T S [INFO]
------------------------------------------------------- [INFO] Running e2e.TestRunner

@regression Scenario: DataScout Login                      #
src/test/resources/features/DataScout.feature:4 2023-02-16 11:49:29
[main] DEBUG i.g.b.wdm.cache.ResolutionCache.checkValidity(156) -
Removing resolution chrome-container-latest=106.0 from cache (expired
on Thu Oct 20 09:53:59 UTC 2022) 2023-02-16 11:49:29 [main] DEBUG
i.g.b.wdm.docker.DockerHubService.listTags(60) - Getting browser image
list from Docker Hub 2023-02-16 11:49:29 [main] TRACE
i.g.b.wdm.docker.DockerHubService.listTags(73) - Sending request to
https://hub.docker.com/v2/repositories/selenoid/vnc/tags?page=1&page_size=1024
2023-02-16 11:49:30 [main] TRACE
i.g.b.wdm.docker.DockerHubService.listTags(73) - Sending request to
https://hub.docker.com/v2/repositories/selenoid/vnc/tags?page=2&page_size=1024
2023-02-16 11:49:30 [main] TRACE
i.g.b.wdm.docker.DockerHubService.listTags(73) - Sending request to
https://hub.docker.com/v2/repositories/selenoid/vnc/tags?page=3&page_size=1024
2023-02-16 11:49:31 [main] DEBUG
i.g.b.wdm.docker.DockerService.getImageVersionFromDockerHub(471) - The
latest version of Chrome in Docker Hub is 110.0 2023-02-16 11:49:31
[main] TRACE i.g.b.wdm.docker.DockerService.getDockerImage(517) -
Docker image: selenoid/vnc:chrome_110.0 2023-02-16 11:49:31 [main]
INFO  i.g.b.wdm.docker.DockerService.pullImageIfNecessary(330) -
Pulling Docker image selenoid/vnc:chrome_110.0 (this might take some
time, but only the first time) 2023-02-16 11:49:32 [main] TRACE
i.g.b.wdm.docker.DockerService.pullImageIfNecessary(336) - Docker
image selenoid/vnc:chrome_110.0 pulled 2023-02-16 11:49:32 [main]
DEBUG
i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(119)

Storing resolution chrome-container-latest=110.0 in cache (valid until 12:49:32 16/02/2023 UTC) 2023-02-16 11:49:32 [main] TRACE
i.g.bonigarcia.wdm.config.Config.getDockerMemSizeBytes(1142) - The
memory size 256m is equivalent to 268435456 bytes) 2023-02-16 11:49:32
[main] TRACE
i.g.bonigarcia.wdm.config.Config.getDockerMemSizeBytes(1142) - The
memory size 128m is equivalent to 134217728 bytes) 2023-02-16 11:49:32
[main] TRACE i.g.b.wdm.docker.DockerService.startBrowserContainer(638)

Using custom volumes: [/home/furkan_yavuz/e2e-tests/src/test/resources/testData:/home/selenium]
2023-02-16 11:49:32 [main] INFO
i.g.b.wdm.docker.DockerService.startContainer(177) - Starting Docker
container selenoid/vnc:chrome_110.0 2023-02-16 11:49:32 [main] TRACE
i.g.b.wdm.docker.DockerService.startContainer(190) - Adding sysadmin
capability 2023-02-16 11:49:32 [main] TRACE
i.g.b.wdm.docker.DockerService.startContainer(196) - Using shm size:
268435456 2023-02-16 11:49:32 [main] TRACE
i.g.b.wdm.docker.DockerService.startContainer(202) - Using network:
bridge 2023-02-16 11:49:32 [main] TRACE
i.g.b.wdm.docker.DockerService.startContainer(207) - Using exposed
ports: [4444, 5900] 2023-02-16 11:49:32 [main] TRACE
i.g.b.wdm.docker.DockerService.startContainer(216) - Using binds:
[/home/furkan_yavuz/e2e-tests/src/test/resources/testData:/home/selenium:rw]
2023-02-16 11:49:32 [main] TRACE
i.g.b.wdm.docker.DockerService.startContainer(222) - Using mounts:
[Mount(type=TMPFS, source=null, target=/tmp, readOnly=null,
bindOptions=null, volumeOptions=null,
tmpfsOptions=TmpfsOptions(sizeBytes=134217728, mode=null))] 2023-02-16
11:49:32 [main] TRACE
i.g.b.wdm.docker.DockerService.startContainer(228) - Using envs:
[TZ=Etc/UTC, LANG=EN, SCREEN_RESOLUTION=1280x1080x24, ENABLE_VNC=true,
DRIVER_ARGS=--whitelisted-ips= --allowed-origins=*] 2023-02-16
11:49:33 [main] TRACE i.g.b.wdm.docker.DockerService.getBindPort(294)

Port list {5900/tcp=[Lcom.github.dockerjava.api.model.Ports$Binding;@217bf99e,
4444/tcp=[Lcom.github.dockerjava.api.model.Ports$Binding;@6807a356} --
Exposed port 4444/tcp = [0.0.0.0:49197, :::49197] 2023-02-16 11:49:33
[main] TRACE i.g.b.wdm.docker.DockerService.startBrowserContainer(693)

Browser remote URL http://localhost:49197/ 2023-02-16 11:49:33 [main] TRACE i.g.b.wdm.docker.DockerService.getBindPort(294) - Port
list
{5900/tcp=[Lcom.github.dockerjava.api.model.Ports$Binding;@d675f9f,
4444/tcp=[Lcom.github.dockerjava.api.model.Ports$Binding;@58af5076} --
Exposed port 5900/tcp = [0.0.0.0:49196, :::49196] 2023-02-16 11:49:33
[main] DEBUG i.g.b.wdm.docker.DockerService.startBrowserContainer(700)

VNC server URL: vnc://localhost:49196/ 2023-02-16 11:49:33 [main] TRACE i.g.bonigarcia.wdm.WebDriverManager.createDockerWebDriver(1893)

The Selenium Serverl URL is http://localhost:49197/ 2023-02-16 11:49:33 [main] DEBUG
i.g.b.wdm.webdriver.WebDriverCreator.createRemoteWebDriver(77) -
Creating WebDriver object for chrome at http://localhost:49197/ with
Capabilities {browserName: chrome, goog:chromeOptions: {args:
[--disable-gpu], extensions: []}} 2023-02-16 11:49:34 [main] TRACE
i.g.b.wdm.webdriver.WebDriverCreator.createRemoteWebDriver(92) -
SocketException creating WebDriver object (Connection reset)
2023-02-16 11:49:35 [main] TRACE
i.g.b.wdm.webdriver.WebDriverCreator.createRemoteWebDriver(86) -
Requesting http://localhost:49197/ (the response code is 404) Feb 16,
2023 11:49:35 AM
org.openqa.selenium.remote.tracing.opentelemetry.OpenTelemetryTracer
createTracer INFO: Using OpenTelemetry for tracing 2023-02-16 11:49:36
[main] TRACE
i.g.b.wdm.webdriver.WebDriverCreator.createRemoteWebDriver(92) -
SessionNotCreatedException creating WebDriver object (Could not start
a new session. Response code 500. Message: unknown error: Chrome
failed to start: crashed.   (unknown error: DevToolsActivePort file
doesn't exist)   (The process started from chrome location
/usr/bin/google-chrome is no longer running, so ChromeDriver is
assuming that Chrome has crashed.)  Host info: host: 'selenium-tests',
ip: '10.156.0.4' Build info: version: '4.6.0', revision: '79f1c02ae20'
System info: os.name: 'Linux', os.arch: 'amd64', os.version:
'5.10.0-18-cloud-amd64', java.version: '17.0.6' Driver info:
org.openqa.selenium.remote.RemoteWebDriver Command: [null, newSession
{capabilities=[Capabilities {browserName: chrome, goog:chromeOptions:
{args: [--disable-gpu], extensions: []}}],
desiredCapabilities=Capabilities {browserName: chrome,
goog:chromeOptions: {args: [--disable-gpu], extensions: []}}}]
Capabilities {}) 2023-02-16 11:49:37 [main] TRACE
i.g.b.wdm.webdriver.WebDriverCreator.createRemoteWebDriver(86) -
Requesting http://localhost:49197/ (the response code is 404)
2023-02-16 11:49:37 [main] TRACE
i.g.b.wdm.webdriver.WebDriverCreator.createRemoteWebDriver(92) -
SessionNotCreatedException creating WebDriver object (Could not start
a new session. Response code 500. Message: unknown error: Chrome
failed to start: crashed.   (unknown error: DevToolsActivePort file
doesn't exist)   (The process started from chrome location
/usr/bin/google-chrome is no longer running, so ChromeDriver is
assuming that Chrome has crashed.)  Host info: host: 'selenium-tests',
ip: '10.156.0.4' Build info: version: '4.6.0', revision: '79f1c02ae20'
System info: os.name: 'Linux', os.arch: 'amd64', os.version:
'5.10.0-18-cloud-amd64', java.version: '17.0.6' Driver info:
org.openqa.selenium.remote.RemoteWebDriver Command: [null, newSession
{capabilities=[Capabilities {browserName: chrome, goog:chromeOptions:
{args: [--disable-gpu], extensions: []}}],
desiredCapabilities=Capabilities {browserName: chrome,
goog:chromeOptions: {args: [--disable-gpu], extensions: []}}}]
Capabilities {}) 2023-02-16 11:49:38 [main] TRACE
i.g.b.wdm.webdriver.WebDriverCreator.createRemoteWebDriver(86) -
Requesting http://localhost:49197/ (the response code is 404)
2023-02-16 11:49:38 [main] TRACE
i.g.b.wdm.webdriver.WebDriverCreator.createRemoteWebDriver(92) -
SessionNotCreatedException creating WebDriver object (Could not start
a new session. Response code 500. Message: unknown error: Chrome
failed to start: crashed.   (unknown error: DevToolsActivePort file
doesn't exist)   (The process started from chrome location
/usr/bin/google-chrome is no longer running, so ChromeDriver is
assuming that Chrome has crashed.)  Host info: host: 'selenium-tests',
ip: '10.156.0.4' Build info: version: '4.6.0', revision: '79f1c02ae20'
System info: os.name: 'Linux', os.arch: 'amd64', os.version:
'5.10.0-18-cloud-amd64', java.version: '17.0.6' Driver info:
org.openqa.selenium.remote.RemoteWebDriver Command: [null, newSession
{capabilities=[Capabilities {browserName: chrome, goog:chromeOptions:
{args: [--disable-gpu], extensions: []}}],
desiredCapabilities=Capabilities {browserName: chrome,
goog:chromeOptions: {args: [--disable-gpu], extensions: []}}}]
Capabilities {}) 2023-02-16 11:49:39 [main] TRACE
i.g.b.wdm.webdriver.WebDriverCreator.createRemoteWebDriver(86) -
Requesting http://localhost:49197/ (the response code is 404)
2023-02-16 11:49:39 [main] TRACE
i.g.b.wdm.webdriver.WebDriverCreator.createRemoteWebDriver(92) -
SessionNotCreatedException creating WebDriver object (Could not start
a new session. Response code 500. Message: unknown error: Chrome
failed to start: crashed.   (unknown error: DevToolsActivePort file
doesn't exist)   (The process started from chrome location
/usr/bin/google-chrome is no longer running, so ChromeDriver is
assuming that Chrome has crashed.)  Host info: host: 'selenium-tests',
ip: '10.156.0.4' Build info: version: '4.6.0', revision: '79f1c02ae20'
System info: os.name: 'Linux', os.arch: 'amd64', os.version:
'5.10.0-18-cloud-amd64', java.version: '17.0.6' Driver info:
org.openqa.selenium.remote.RemoteWebDriver Command: [null, newSession
{capabilities=[Capabilities {browserName: chrome, goog:chromeOptions:
{args: [--disable-gpu], extensions: []}}],
desiredCapabilities=Capabilities {browserName: chrome,
goog:chromeOptions: {args: [--disable-gpu], extensions: []}}}]
Capabilities {}) 2023-02-16 11:49:40 [main] TRACE
i.g.b.wdm.webdriver.WebDriverCreator.createRemoteWebDriver(86) -
Requesting http://localhost:49197/ (the response code is 404)
2023-02-16 11:49:41 [main] TRACE
i.g.b.wdm.webdriver.WebDriverCreator.createRemoteWebDriver(92) -
SessionNotCreatedException creating WebDriver object (Could not start
a new session. Response code 500. Message: unknown error: Chrome
failed to start: crashed.   (unknown error: DevToolsActivePort file
doesn't exist)   (The process started from chrome location
/usr/bin/google-chrome is no longer running, so ChromeDriver is
assuming that Chrome has crashed.)  Host info: host: 'selenium-tests',
ip: '10.156.0.4' Build info: version: '4.6.0', revision: '79f1c02ae20'
System info: os.name: 'Linux', os.arch: 'amd64', os.version:
'5.10.0-18-cloud-amd64', java.version: '17.0.6' Driver info:
org.openqa.selenium.remote.RemoteWebDriver Command: [null, newSession
{capabilities=[Capabilities {browserName: chrome, goog:chromeOptions:
{args: [--disable-gpu], extensions: []}}],
desiredCapabilities=Capabilities {browserName: chrome,
goog:chromeOptions: {args: [--disable-gpu], extensions: []}}}]

Related Github issue link: https://github.com/bonigarcia/webdrivermanager/issues/996


问:
Does BNB Beacon Chain (Government chain) support smart contracts?
I've recently been doing some research about BNB chain. I can see that they have 03 components [1]:

BNB Beacon Chain - The staking and governance layer of BNB ecosystem.

BNB Smart Chain (BSC) - An EVM compatible blockchain

ZkBNB

But I'm not sure if BNB Beacon Chain supports smart contracts or not? As I can see many types of tokens/assets on that chain [2], but I can't find the token's address, only owner address (who initially issued the token) is available.

If BNB Beacon Chain is available to deploy smart contracts, which are some references/tutorials/demo sources?

Thanks for help!

References:

[1] https://docs.bnbchain.org/docs/overview#what-is-build-n-build-bnb-chain

[2] https://explorer.bnbchain.org/assets/bep2

I tried to read several docs, check the block explorer, ask on BNB official telegram but I couldn't really figure it out.


问:
Multiple Bootstrap dropdowns in table, move dropdown content outside the container
I had issues using bootstrap dropdowns in
, it was cut and behaved weirdly. I've found a way to move the dropdown menu out of the table with this example, but I'm not sure how to handle multiple dropdowns, as it is used per each table row:

```<code><table>
    @foreach(...){
    <tr>
        <td>
            <div class="dropdown">
               <button data-bs-toggle="dropdown" data-bs-auto-close="true" data-bs-offset="0,2" aria-expanded="false">See review</button>
               <div class="dropdown-menu" role="menu">/*some menu items*/</div>
            </div>
        </td>
    </tr>
  }
</table>
</code>```

Here is the JS:

```<code>var dropdownMenu:any;
    $('.dropdown').on('show.bs.dropdown', function (e:any) {
        dropdownMenu = $(this).find('.dropdown-menu');
        $('body').append(dropdownMenu.detach());
        dropdownMenu.css('display', 'block');
        dropdownMenu.position({
            'my': 'right top',
            'at': 'right bottom',
            'of': $(e.relatedTarget)
        });
    });

    $(".dropdown").on('hide.bs.dropdown', function (e: any) {
        if (dropdownMenu != undefined) {
            $(e.currentTarget).append(dropdownMenu.detach());
            dropdownMenu.hide();
        }
    });
</code>```

It works fine if you open each dropdown and click outside, but if you open one dropdown and then click on another right after (like click See review in one row and then click See review in another row right after), it closes all the dropdowns and the previously opened one's DOM remains in body.

Body:
I had issues using bootstrap dropdowns in
, it was cut and behaved weirdly. I've found a way to move the dropdown menu out of the table with this example, but I'm not sure how to handle multiple dropdowns, as it is used per each table row:

    @foreach(...){

               <button data-bs-toggle="dropdown" data-bs-auto-close="true" data-bs-offset="0,2" aria-expanded="false">See review</button>

/*some menu items*/

  }

Here is the JS:

var dropdownMenu:any;
    $('.dropdown').on('show.bs.dropdown', function (e:any) {
        dropdownMenu = $(this).find('.dropdown-menu');
        $('body').append(dropdownMenu.detach());
        dropdownMenu.css('display', 'block');
        dropdownMenu.position({
            'my': 'right top',
            'at': 'right bottom',
            'of': $(e.relatedTarget)
        });
    });

    $(".dropdown").on('hide.bs.dropdown', function (e: any) {
        if (dropdownMenu != undefined) {
            $(e.currentTarget).append(dropdownMenu.detach());
            dropdownMenu.hide();
        }
    });

It works fine if you open each dropdown and click outside, but if you open one dropdown and then click on another right after (like click See review in one row and then click See review in another row right after), it closes all the dropdowns and the previously opened one's DOM remains in body.


问:
Many devices are connected with Bluetooth but want to find a printer mac id among them
I am using a bluetooth adapter to get connected devices and get a list of all connected devices, the list has a mobile, Bluetooth speaker, printer, and more but I want to find a printer mac id</p>
```<code>var buletoothAdapter = BluetoothAdapter.getDefaultAdapter();
val pairedDevices: Set<BluetoothDevice> = buletoothAdapter.bondedDevices
pairedDevices.forEach { device -> Log.e("mac", deviceHardwareAddress)// MAC address
    }
</code>```

Body:
I am using a bluetooth adapter to get connected devices and get a list of all connected devices, the list has a mobile, Bluetooth speaker, printer, and more but I want to find a printer mac id

var buletoothAdapter = BluetoothAdapter.getDefaultAdapter();
val pairedDevices: Set<BluetoothDevice> = buletoothAdapter.bondedDevices
pairedDevices.forEach { device -> Log.e("mac", deviceHardwareAddress)// MAC address
    }


问:
Ball with realistic bouncing behavior have random inconsistencies, gets stuck with certain but random input values
In the program you can enter the value for velocity and value for angle. The ball bounces 20% less each bounce with the variable "cor". When values such as 63 45; 60 45; 59 45 is entered the ball behaves as it should. Every velocity-value ending with 2 or 7 between 42 and 112 will results with the ball not bouncing once; gets stuck in the floor.

I have no idea how js fiddle works so i just put stuff here maybe works :)
https://jsfiddle.net/yfw8grut/1/

```<code><script async src="//jsfiddle.net/Arvid_Westberg/uo3mLen4/2/embed/js,html,css,result/dark/"></script>
</code>```

document.getElementById("ball").style.top = document.getElementById("container").offsetHeight - 50 + "px"; //make ball be at correct position from start

let gravity = -9.8; // gravitational acceleration (m/s^2)
let velocity = 0; // initial velocity (m/s)
let angle = 0; // angle of projection (degrees)

// get input from user
let velocityInput = document.querySelector('#velocity-input');
let angleInput = document.querySelector('#angle-input');

// function to calculate the aerodynamic trajectory of the ball
function calculateTrajectory() {
  // get velocity and angle from user input
  velocity = parseFloat(velocityInput.value);
  angle = parseFloat(angleInput.value);

  // convert angle from degrees to radians
  let angleRad = angle * (Math.PI / -180);

  // calculate initial x and y components of velocity
  let vx = velocity * Math.cos(angleRad);
  let vy = velocity * Math.sin(angleRad);

  // get container dimensions
  let container = document.querySelector('#container');
  let containerHeight = container.offsetHeight;

  // set initial position of ball at bottom of container
  let x = 0;
  let y = containerHeight - 51; // 50 is the height of the ball element
  let t = 0;

  // set time interval (dt) and iteration limit (real speed of ball)
  let dt = 0.08;
  let limit = 1000;

  // set coefficient of restitution (COR)
  let cor = 0.8;

  function animate() {
    // update position and time
    x = x + vx * dt;
    y = y + vy * dt;
    t = t + dt;

    // update y-velocity due to gravity
    vy = vy - gravity * dt;

    // reverse y-velocity and reduce velocity if ball hits the ground
    if (y >= containerHeight - 50) {
      vy = -vy * cor;
    }

    if (x >= container.offsetWidth - 50 || x <= 0) {
      vx = -vx;
    }

    if (Math.abs(vy) < 0.2) {
      vx = vx * 0.96;
    }

    if (Math.abs(vx) < 1.75) {
      return;
    }

    // update ball's position on page
    let ball = document.querySelector('#ball');
    ball.style.left = `${x}px`;
    ball.style.top = `${y}px`;

    // request next frame of animation
    requestAnimationFrame(animate);
  }

  // start animation
  requestAnimationFrame(animate);
}

// get button and add event listener
let button = document.querySelector('#calculate-button');
button.addEventListener('click', calculateTrajectory);```
<pre class="snippet-code-css lang-css prettyprint-override"><code>#container {
  position: relative;
  width: 500px;
  height: 500px;
  background-color: lightgray;
}

#ball {
  position: absolute;
  width: 50px;
  height: 50px;
  background-color: red;
  border-radius: 50%;
}</code>```

<!DOCTYPE html>

  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />

  Velocity:
  <input type="number" id="velocity-input" value="50">
  Angle:
  <input type="number" id="angle-input" value="45">
  <button id="calculate-button">Calculate Trajectory</button>

    Good values: 63 45; 60 45; 59 45
 Bad values: every velocity-value ending with 2 or 7 between 42 and 112

```

Body:
In the program you can enter the value for velocity and value for angle. The ball bounces 20% less each bounce with the variable "cor". When values such as 63 45; 60 45; 59 45 is entered the ball behaves as it should. Every velocity-value ending with 2 or 7 between 42 and 112 will results with the ball not bouncing once; gets stuck in the floor.

I have no idea how js fiddle works so i just put stuff here maybe works :)
https://jsfiddle.net/yfw8grut/1/

document.getElementById("ball").style.top = document.getElementById("container").offsetHeight - 50 + "px"; //make ball be at correct position from start

let gravity = -9.8; // gravitational acceleration (m/s^2)
let velocity = 0; // initial velocity (m/s)
let angle = 0; // angle of projection (degrees)

// get input from user
let velocityInput = document.querySelector('#velocity-input');
let angleInput = document.querySelector('#angle-input');

// function to calculate the aerodynamic trajectory of the ball
function calculateTrajectory() {
  // get velocity and angle from user input
  velocity = parseFloat(velocityInput.value);
  angle = parseFloat(angleInput.value);

  // convert angle from degrees to radians
  let angleRad = angle * (Math.PI / -180);

  // calculate initial x and y components of velocity
  let vx = velocity * Math.cos(angleRad);
  let vy = velocity * Math.sin(angleRad);

  // get container dimensions
  let container = document.querySelector('#container');
  let containerHeight = container.offsetHeight;

  // set initial position of ball at bottom of container
  let x = 0;
  let y = containerHeight - 51; // 50 is the height of the ball element
  let t = 0;

  // set time interval (dt) and iteration limit (real speed of ball)
  let dt = 0.08;
  let limit = 1000;

  // set coefficient of restitution (COR)
  let cor = 0.8;

  function animate() {
    // update position and time
    x = x + vx * dt;
    y = y + vy * dt;
    t = t + dt;

    // update y-velocity due to gravity
    vy = vy - gravity * dt;

    // reverse y-velocity and reduce velocity if ball hits the ground
    if (y >= containerHeight - 50) {
      vy = -vy * cor;
    }

    if (x >= container.offsetWidth - 50 || x <= 0) {
      vx = -vx;
    }

    if (Math.abs(vy) < 0.2) {
      vx = vx * 0.96;
    }

    if (Math.abs(vx) < 1.75) {
      return;
    }

    // update ball's position on page
    let ball = document.querySelector('#ball');
    ball.style.left = `${x}px`;
    ball.style.top = `${y}px`;

    // request next frame of animation
    requestAnimationFrame(animate);
  }

  // start animation
  requestAnimationFrame(animate);
}

// get button and add event listener
let button = document.querySelector('#calculate-button');
button.addEventListener('click', calculateTrajectory);

#container {
  position: relative;
  width: 500px;
  height: 500px;
  background-color: lightgray;
}

#ball {
  position: absolute;
  width: 50px;
  height: 50px;
  background-color: red;
  border-radius: 50%;
}

<!DOCTYPE html>

  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />

  Velocity:
  <input type="number" id="velocity-input" value="50">
  Angle:
  <input type="number" id="angle-input" value="45">
  <button id="calculate-button">Calculate Trajectory</button>

    Good values: 63 45; 60 45; 59 45
 Bad values: every velocity-value ending with 2 or 7 between 42 and 112


问:
how to switch between tab control automatically if i press a button in tabcontrol1 using vector canoe panel designer
I want to create a Panel using canoe which mimic actual infotainment display.
for eg: If I click on settings option on Infotainment Display , I would see list of availability options automatically.
The same way i would want to check in Panel of vector CANoe

I tried using tab control with capl script behind , but it didn't work


问:
DirectX12 Video Encoding: output buffer population
I'm attempting to implement DX12 video encoding.

To date I've been using the ffmpeg library so am not very clued up on very low level data.

I'm using the simplest possible encoding I can think of, with GOP size of 1 and H264

I am struggling with the first part of defining the output structure D3D12_VIDEO_ENCODER_ENCODEFRAME_OUTPUT_ARGUMENTS, namely setting up the resource pBuffer in D3D12_VIDEO_ENCODER_COMPRESSED_BITSTREAM:

```<code>typedef struct D3D12_VIDEO_ENCODER_COMPRESSED_BITSTREAM {
  ID3D12Resource *pBuffer;
  UINT64         FrameStartOffset;
} D3D12_VIDEO_ENCODER_COMPRESSED_BITSTREAM;
</code>```

Regards pBuffer, the docs say:

"A pointer to a ID3D12Resource containing the compressed bitstream buffer".

So I guess I create a buffer at least the size of the input frame  + room for header data, and make it writeable - seems like it should be straightforward, but am I missing something? Should it be multi-planar for example, or be some multiple of input frame size?

Then:

"The output bitstream is expected to contain the subregion headers, but not the picture, sequence, video or other headers. The host is responsible for coding those headers and generating the complete bitstream."

what do these subregion headers look like? I am showing my lack of encoding knowledge here in general, is there a resource somewhere explaining how to calculate them? (or have I misread this, and this is saying the output will contain them)

do I just write them by copying into mapped memory and setting the FrameStartOffset to point after the header data?

I'm currently streaming AVPackets from ffmpeg using libdatachannel, how would the content of the output (without my adding extra headers) compare to an AVPacket->data?

Body:
I'm attempting to implement DX12 video encoding.

To date I've been using the ffmpeg library so am not very clued up on very low level data.

I'm using the simplest possible encoding I can think of, with GOP size of 1 and H264

I am struggling with the first part of defining the output structure D3D12_VIDEO_ENCODER_ENCODEFRAME_OUTPUT_ARGUMENTS, namely setting up the resource pBuffer in D3D12_VIDEO_ENCODER_COMPRESSED_BITSTREAM:

typedef struct D3D12_VIDEO_ENCODER_COMPRESSED_BITSTREAM {
  ID3D12Resource *pBuffer;
  UINT64         FrameStartOffset;
} D3D12_VIDEO_ENCODER_COMPRESSED_BITSTREAM;

Regards pBuffer, the docs say:

"A pointer to a ID3D12Resource containing the compressed bitstream buffer".

So I guess I create a buffer at least the size of the input frame  + room for header data, and make it writeable - seems like it should be straightforward, but am I missing something? Should it be multi-planar for example, or be some multiple of input frame size?

Then:

"The output bitstream is expected to contain the subregion headers, but not the picture, sequence, video or other headers. The host is responsible for coding those headers and generating the complete bitstream."

what do these subregion headers look like? I am showing my lack of encoding knowledge here in general, is there a resource somewhere explaining how to calculate them? (or have I misread this, and this is saying the output will contain them)

do I just write them by copying into mapped memory and setting the FrameStartOffset to point after the header data?

I'm currently streaming AVPackets from ffmpeg using libdatachannel, how would the content of the output (without my adding extra headers) compare to an AVPacket->data?


问:
Vue error telling me variable value is undefined but the image displays correctly so why then the error
I get data from a back end and I load the data inside the onBeforeMount hook like so:

```<code>onBeforeMount(async () => {
    const res = await axios.get("api/v1/posts/replies/" + replyID + "/");
    reply.value = res.data;
    post.value = reply.value.post;
});
</code>```

In the template I have this image to represent a user:

```<code><router-link
    v-if="reply.profile.photo"
    :to="{ path: '/user/' + post.user }"
>
    <div class="userImage">
        <img
            class="userImg"
            :src="'http://127.0.0.1:8000' + reply.profile.photo"
        />
    </div>
</router-link>
</code>```

In the console I have this error pointing to the line :src="‘http://127.0.0.1:8000’ + reply.profile.photo:

Uncaught (in promise) TypeError: $setup.reply.profile is undefined

How am I then supposed to load the data so these errors do not appear? Best of all with the error the user picture displays correctly. I have refreshed many times cleared cache but still the error remains and the picture displays.

Can someone tell me why is this happening please?

Body:
I get data from a back end and I load the data inside the onBeforeMount hook like so:

onBeforeMount(async () => {
    const res = await axios.get("api/v1/posts/replies/" + replyID + "/");
    reply.value = res.data;
    post.value = reply.value.post;
});

In the template I have this image to represent a user:

<router-link
    v-if="reply.profile.photo"
    :to="{ path: '/user/' + post.user }"
>

</router-link>

In the console I have this error pointing to the line :src="‘http://127.0.0.1:8000’ + reply.profile.photo:

Uncaught (in promise) TypeError: $setup.reply.profile is undefined

How am I then supposed to load the data so these errors do not appear? Best of all with the error the user picture displays correctly. I have refreshed many times cleared cache but still the error remains and the picture displays.

Can someone tell me why is this happening please?


问:
Must i push my dotenv file that contains only my mongodb connection string
I have created a simple task manager app that helps the user to perform all the crud operations using mongodb. I want to deploy it using render just , But render gives me error saying undefined connection string. And i guess it is because i did not push my env file along to gihub. Is there any way to set a default connection string or i should push my mongodb connection string

I deployed it without the env file on render and it gives me this

error: MongooseError: The uri parameter to openUri() must be a string, got "undefined". Make sure the first parameter to mongoose.connect() or mongoose.createConnection() is a string.

And below is mine db connection function

```<code>const start = async ()=>{
    try {
        await dbConnect(process.env.MONGO_URI)
        app.listen(port , ()=>{
            console.log(`listening at port ${port} `)
        })

    } catch (error) {
        console.log(error)
    }
 }
</code>```

Body:
I have created a simple task manager app that helps the user to perform all the crud operations using mongodb. I want to deploy it using render just , But render gives me error saying undefined connection string. And i guess it is because i did not push my env file along to gihub. Is there any way to set a default connection string or i should push my mongodb connection string

I deployed it without the env file on render and it gives me this

error: MongooseError: The uri parameter to openUri() must be a string, got "undefined". Make sure the first parameter to mongoose.connect() or mongoose.createConnection() is a string.

And below is mine db connection function

const start = async ()=>{
    try {
        await dbConnect(process.env.MONGO_URI)
        app.listen(port , ()=>{
            console.log(`listening at port ${port} `)
        })

    } catch (error) {
        console.log(error)
    }
 }


问:
How to generate dates in Postgresql based on a start_date and day of week
I'm trying to generate dates that comes after a certain start_date with the interval of a variable day/s of week.

If the start_date is 2023-01-01 and the days of the week are [2,3,5] or ['tue','thu','sat'], then it should generate the following:

```<code>2023-01-03
2023-01-05
2023-01-07
</code>```

I tried running

```<code>with dates as
(
    select
        s.a AS dates,
        extract (dow from s.a)::integer dw
    from
        'some-table' as st,
        generate_series(start_date::timestamp, start_date::date + 365) s(a)
    where
        st.id = 'some-value'
)
select *
from dates
where dw in (2,5)
limit 10
</code>```

Is there a better way to do this?

EDIT: Corrected the sample values

Body:
I'm trying to generate dates that comes after a certain start_date with the interval of a variable day/s of week.

If the start_date is 2023-01-01 and the days of the week are [2,3,5] or ['tue','thu','sat'], then it should generate the following:

2023-01-03
2023-01-05
2023-01-07

I tried running

with dates as
(
    select
        s.a AS dates,
        extract (dow from s.a)::integer dw
    from
        'some-table' as st,
        generate_series(start_date::timestamp, start_date::date + 365) s(a)
    where
        st.id = 'some-value'
)
select *
from dates
where dw in (2,5)
limit 10

Is there a better way to do this?

EDIT: Corrected the sample values


问:
How can I manage schedulers in spring-boot from database?
I have an spring-boot app in kubernetes with some schedulers, I would like to be able to set the cron value of the schedulers with no need of re-compiling the project, is this possible?

I currently have the cron values defined in the properties file, but this way I can't solve this problem.

thanks for your help!!


问:
ECONNRESET: error for nodejs api. locally running
I have 2 node servers running locally. I'm calling 100s of api at time from node-server1 to node-server2.
For some of api it throwing error. but interesting thing is at logs in node-server2 it request executed.

```<code>"errno": -54,
"code": "ECONNRESET",
"syscall": "connect",
"address": "127.0.0.1",
</code>```

I'm not getting exact reason of failure. I tried increasing timeout but it didn't worked.

Body:
I have 2 node servers running locally. I'm calling 100s of api at time from node-server1 to node-server2.
For some of api it throwing error. but interesting thing is at logs in node-server2 it request executed.

"errno": -54,
"code": "ECONNRESET",
"syscall": "connect",
"address": "127.0.0.1",

I'm not getting exact reason of failure. I tried increasing timeout but it didn't worked.


问:
Can't invoke gke endpoint directly using cloud scheduler
Can google cloud scheduler invoke a GKE service endpoint directly bypassing google cloud function?

I wanted to invoke a GKE service endpoint. So , I made a cloud scheduler giving the url of that end-point. But status of my scheduler remains failed. When I check logs , I get

"status":"UNKNOWN", "targetType":"HTTP"


问:
Why is \\? being added to my site physical path in IIS?
In IIS, I have set my site's physical path to J:\MyFolder\MySite.

When I try to load the site in my browser, I get this error message: IIS site error.
Notice that
\\?
has been prepended to my path for the Config File setting (red)

Further to this, if I select the site in IIS and try to access an IIS feature, for example the "Default Document" feature, I get this error popup: IIS feature error popup.
Again you can see the
\\?
was added.

Can anybody please advise why this is appearing, where it is set (and how I remove it), and any insight into how I can get my site to load?

INFO OF NOTE

IIS Version 1607

OS Version Windows Server 2016 Datacentre

I have other sites running successfully, set up in an identical manner, also within /MyFolder/. I am confident the web.config file itself is not corrupt.

WHAT I'VE TRIED

I've tried restarting the site in IIS. I've tried deleting the site in IIS and adding it again. The physical path is absolutely correct. I have compared my web.config file to another site that works to see if there's anything fundamentally different, and there appears to not be.

WHAT I EXPECT

I expect the site to load as normal.

I was surprised to not be able to find any answer to a previous question referencing
\\?
so I feel posting my own question is the only way forward.

Thankyou in advance for any light you can shine on this.


问:
Segmentation fault error while trying to read elements into array - Assembly x86 AT-T syntax
I try to read several elements from the keyboard, given as input into an array that i have the address loaded into the %edi register. I get a segmentation fault error as soon as i type the first input.
The "nodes" variable is previously read using also scanf and i checked and the value of it it's correct. The temp variable is a .space type and i thought about using it to store the data into the array, sequencially. Thanks</p>
```<code>set_array:

cmp nodes, %ecx
je array_sum

pushl $temp
pushl $format
call scanf
popl %ebx
popl %ebx

movl temp, %ebx -> i think here is the problem but i don't know why
movl %ebx, (%edi, %ecx, 4)

inc %ecx
jmp set_array
</code>```

Body:
I try to read several elements from the keyboard, given as input into an array that i have the address loaded into the %edi register. I get a segmentation fault error as soon as i type the first input.
The "nodes" variable is previously read using also scanf and i checked and the value of it it's correct. The temp variable is a .space type and i thought about using it to store the data into the array, sequencially. Thanks

set_array:

cmp nodes, %ecx
je array_sum

pushl $temp
pushl $format
call scanf
popl %ebx
popl %ebx

movl temp, %ebx -> i think here is the problem but i don't know why
movl %ebx, (%edi, %ecx, 4)

inc %ecx
jmp set_array


问:
NodeJs Sequelize, Set Associations With Additional Layer
I am trying to develope a NodeJs project with layered architecture,

When i try to set associations additional layer system give me an error.

Example;

This is my sequelize UserModel file;

```<code>"use strict";
const {
    sequelizeConnection,
    DataTypes,
    Model,
} = require('../../../config/database');

module.exports = () => {
    class UserModel extends Model {
        static associate(models) {
            this.hasMany(models.TodoModel, {
                foreignKey: 'userId',
                as: 'todos',
            });
        }
    }

    UserModel.init(
        {
            name: DataTypes.STRING,
            email: DataTypes.STRING,
            password: DataTypes.STRING,
            deletedAt: DataTypes.DATE,
        },
        {
            sequelize: sequelizeConnection,
            paranoid: true,
            modelName: 'User',
        }
    );

    return UserModel;
};
</code>```

I have a service layer for business logic codes. I am calling this layer from my controller;

```<code>const {serviceResponse} = require('../../core/ServiceResponse');
const IUserService = require('../../interfaces/IUserService');
const UserModel = require('../../models/sequelize/user')();
const bcrypt = require('bcrypt');
const PersonalAccessTokenService = require('./PersonalAccessTokenService');

// const UserRelations = require('../../relations/UserRelations');
/*
UserRelations for define associations but not working;

in UserRelations (Codes);

    class UserRelations {
        constructor() {
            this.UserModel = require('../models/sequelize/user')();
            this.TodoModel = require('../models/sequelize/todo')();
        }

        setRelations() {
            this.UserModel.associate({
                TodoModel: this.TodoModel,
            });

            return this.UserModel;
        }
    }

module.exports = new UserRelations;

When i call this file from my service layer, system give me this error:

**Error: Association with alias "todos" does not exist on User**

*/

class UserService extends IUserService {
    constructor() {
        super();

        /*
        When i use this code, system not working!

        UserRelations.setRelations();

        */

        /*
        When i use this code at here, system working successfully!

        UserModel.associate({
            TodoModel: this.TodoModel,
        });

        */
    }

    async todos(
        userId
    ) {
        let user = await UserModel.findByPk(userId, {
            include: [
                'todos'
            ],
        });
        if (user != null) {
            return serviceResponse(
                true,
                'User todos',
                user,
                200
            );
        } else {
            return serviceResponse(
                false,
                'User not found',
                null,
                404
            );
        }
    }
}

module.exports = new UserService();
</code>```

In summary, it works when you write the same code directly in the Service layer, but does not work when you call the new layer from the service layer by moving it to another layer. I do not know why. How can i solve this?

NOTE:
You can check out the other details of the layered architecture I use here: @Rampesna/node-core

Body:
I am trying to develope a NodeJs project with layered architecture,

When i try to set associations additional layer system give me an error.

Example;

This is my sequelize UserModel file;

"use strict";
const {
    sequelizeConnection,
    DataTypes,
    Model,
} = require('../../../config/database');

module.exports = () => {
    class UserModel extends Model {
        static associate(models) {
            this.hasMany(models.TodoModel, {
                foreignKey: 'userId',
                as: 'todos',
            });
        }
    }

    UserModel.init(
        {
            name: DataTypes.STRING,
            email: DataTypes.STRING,
            password: DataTypes.STRING,
            deletedAt: DataTypes.DATE,
        },
        {
            sequelize: sequelizeConnection,
            paranoid: true,
            modelName: 'User',
        }
    );

    return UserModel;
};

I have a service layer for business logic codes. I am calling this layer from my controller;

const {serviceResponse} = require('../../core/ServiceResponse');
const IUserService = require('../../interfaces/IUserService');
const UserModel = require('../../models/sequelize/user')();
const bcrypt = require('bcrypt');
const PersonalAccessTokenService = require('./PersonalAccessTokenService');

// const UserRelations = require('../../relations/UserRelations');
/*
UserRelations for define associations but not working;

in UserRelations (Codes);

    class UserRelations {
        constructor() {
            this.UserModel = require('../models/sequelize/user')();
            this.TodoModel = require('../models/sequelize/todo')();
        }

        setRelations() {
            this.UserModel.associate({
                TodoModel: this.TodoModel,
            });

            return this.UserModel;
        }
    }

module.exports = new UserRelations;

When i call this file from my service layer, system give me this error:

**Error: Association with alias "todos" does not exist on User**

*/

class UserService extends IUserService {
    constructor() {
        super();

        /*
        When i use this code, system not working!

        UserRelations.setRelations();

        */

        /*
        When i use this code at here, system working successfully!

        UserModel.associate({
            TodoModel: this.TodoModel,
        });

        */
    }

    async todos(
        userId
    ) {
        let user = await UserModel.findByPk(userId, {
            include: [
                'todos'
            ],
        });
        if (user != null) {
            return serviceResponse(
                true,
                'User todos',
                user,
                200
            );
        } else {
            return serviceResponse(
                false,
                'User not found',
                null,
                404
            );
        }
    }
}

module.exports = new UserService();

In summary, it works when you write the same code directly in the Service layer, but does not work when you call the new layer from the service layer by moving it to another layer. I do not know why. How can i solve this?

NOTE:
You can check out the other details of the layered architecture I use here: @Rampesna/node-core


问:
Can I configure mime type globally in spring mvc
Can I configure mime type globally in spring mvc ?

I don't want to check mime type in every request url and restrict to upload file( undefined mime type)


问:
Much url rewrite setting
I have set a rewriting rule of a URL address containing two parameters. In the rewrite URL I have the code ^/([^/]+)/([^/]+) and the rewritten URL contains the {R:1} and {R:2} of the URL  to be rewritten.
Vodderi that in the rewritten URL there was not the first parameter /([^/]+). Can anyone tell me how not to read it?

I eliminated all /([^/]+) but it doesn't work, I tried to replace + with - but it doesn't work, of course there will be a parameter that excludes its reading, but I can't figure it out.

Title: Much url rewrite setting


问:
Not able to scrub sensitive data on sentry
I want to scrub password field coming anywhere from the xhr requests but it is not getting scrubbed on sentry platform.

I have integrated sentry to one of my NextJS application and I have also disabled default data scrubbing both globally (from all projects) and specifically for that project as well which sentry provides by default. I have used advanced data scrubbing for the same under Settings > Security & Privacy globally. I'm also doing the same for the token field using the same steps and it is working fine but it is not working for the password field using the same steps as well.

It looks to me that it is treating password as a string and not an object field. Not sure if that's the case also since I'm sending it in the body to the api, so should get logged as an  object field on the sentry. Also, please let me know what can be done in this case also

Please find below the screenshots for the same


问:
I am trying to run ruby on rails app with bin/dev command but it is giving me error
I am trying to run ruby on rails app with bin/dev`` command but is gives an error saying

unset is not recognized as an internal or external command as shown below

I tried to run bin/dev command from cmd but it si not running


问:
PHP json encode and Node.js decode utf8mb4_unicode_ci strings
On my server, the database is encode in utf8mb4_unicode_ci
I'm writing an API to serve data in JSON.
The PHP function json_encode only accepts utf8.

I'm not able to build the full chain:

strings encoded in utf8mb4_unicode_ci => utf8 => json => API => JavaScript => strings encoded in utf8mb4_unicode_ci

For example,  $str = "Linéaire ";

From utf8mb4_unicode_ci to utf8 I already try the PHP functions utf8_encode(str) and
mb_convert_encoding($str, 'UTF-8', 'Windows-1252') that return respectively:

"Lin\u00c3\u00a9aire \u00f0\u009f\u0098\u0080"

"Lin\u00c3\u00a9aire \u00f0\u0178\u02dc\u20ac"

Both functions do not return the same result. I don't know which one to choose.
Furthermore, I don't know how to unescape the string on client side  in JavaScript.


问:
Why is "this" undefined when hooking abstract methods using Frida?
it's two days that I am having a problem hooking and calling getPackageInfo using Frida.
I have wrote this code:

```<code>Java.perform(()=>{
    const jPM=Java.use('android.app.ApplicationPackageManager');
    const getPkgInfo=jPM.getPackageInfo.overload('java.lang.String','int');

    getPkgInfo.implementation=(pname,f)=>{
        console.log("Called => getPackageInfo (Flag="+f+", Pkg="+pname+")");
        return getPkgInfo(this,pname,f);
    }
});
</code>```

At the line that calls getPkgInfo (return getPkgInfo(this,pname,f);) i get this error:

```<code>Called => getPackageInfo (Flag=0, Pkg=test.app)
{"type":"error","description":"TypeError: cannot read property '$getHandle' of undefined","stack":"TypeError: cannot read property '$getHandle' of undefined
    at value (frida/node_modules/frida-java-bridge/lib/class-factory.js:1052)
    at e (frida/node_modules/frida-java-bridge/lib/class-factory.js:585)
    at <anonymous> (/script.js:42)
    at apply (native)
    at ne (frida/node_modules/frida-java-bridge/lib/class-factory.js:619)
    at <anonymous> (frida/node_modules/frida-java-bridge/lib/class-factory.js:597)","fileName":"frida/node_modules/frida-java-bridge/lib/class-factory.js","lineNumber":1052,"columnNumber":1}
</code>```

So the method is hooked, because i can see the Called => getPackageInfo (Flag=0, Pkg=test.app) string, but i can't call the original method.

This happens only when i try hooking methods that are normally called using the abstract variant (in this case android.content.pm.PackageManager.getPackageInfo, but i have also tried hooking getPackageManager).

I have made different versions of this code, for example one that calls the function in this way: this.getPackageInfo.overload('java.lang.String','int').call(this,pname,f); and i get an error saying that "this" is undefined, so i think that it is the problem.

I have tried this script on different apps and devices but i always get the same result.

I am using Frida Inject.

Please help me.

Body:
it's two days that I am having a problem hooking and calling getPackageInfo using Frida.
I have wrote this code:

Java.perform(()=>{
    const jPM=Java.use('android.app.ApplicationPackageManager');
    const getPkgInfo=jPM.getPackageInfo.overload('java.lang.String','int');

    getPkgInfo.implementation=(pname,f)=>{
        console.log("Called => getPackageInfo (Flag="+f+", Pkg="+pname+")");
        return getPkgInfo(this,pname,f);
    }
});

At the line that calls getPkgInfo (return getPkgInfo(this,pname,f);) i get this error:

Called => getPackageInfo (Flag=0, Pkg=test.app)
{"type":"error","description":"TypeError: cannot read property '$getHandle' of undefined","stack":"TypeError: cannot read property '$getHandle' of undefined
    at value (frida/node_modules/frida-java-bridge/lib/class-factory.js:1052)
    at e (frida/node_modules/frida-java-bridge/lib/class-factory.js:585)
    at <anonymous> (/script.js:42)
    at apply (native)
    at ne (frida/node_modules/frida-java-bridge/lib/class-factory.js:619)
    at <anonymous> (frida/node_modules/frida-java-bridge/lib/class-factory.js:597)","fileName":"frida/node_modules/frida-java-bridge/lib/class-factory.js","lineNumber":1052,"columnNumber":1}

So the method is hooked, because i can see the Called => getPackageInfo (Flag=0, Pkg=test.app) string, but i can't call the original method.

This happens only when i try hooking methods that are normally called using the abstract variant (in this case android.content.pm.PackageManager.getPackageInfo, but i have also tried hooking getPackageManager).

I have made different versions of this code, for example one that calls the function in this way: this.getPackageInfo.overload('java.lang.String','int').call(this,pname,f); and i get an error saying that "this" is undefined, so i think that it is the problem.

I have tried this script on different apps and devices but i always get the same result.

I am using Frida Inject.

Please help me.


问:
Laravel validation rule based on other element array element
I am trying to validate an array element based on other element of array. I am avoid using function validator.

```<code>$rules['prods.*.prod_category'] = [
            'starts_with:1234',
            'required_if:prods.*.type,regular',
            'min:16',
            'max:16',
        ];
</code>```

I expect to validate an element of array in validator based on another. Laravel ignores it.

Body:
I am trying to validate an array element based on other element of array. I am avoid using function validator.

$rules['prods.*.prod_category'] = [
            'starts_with:1234',
            'required_if:prods.*.type,regular',
            'min:16',
            'max:16',
        ];

I expect to validate an element of array in validator based on another. Laravel ignores it.