问:
ACI Container hangs during run CPU=0
I am attempting to run a bash script using ACI. Occasionally the container stalls or hangs. CPU activity drops to 0, memory flattens(see below) and network activity drops to ~50bytes but the script never completes. The container never terminates that I can tell. A bash window can be opened on the container. The logs suggest the hang occurs during wget.

Possible clue:
How can I verify my container is using SMB3.0 to connect to my share or is that handled at the host server level and I have to assume ACI uses SMB 3.0 ?

This script:

Dequeues an item from ServiceBus.

Runs an exe to obtain a URL

Performs a wget using the URL; writes the output to a StorageAccount Fileshare.

Exits, terminating the container.

wget is invoked with a 4min timeout. Data is written directly to the share so the run can be retried if it fails and the wget can resume. The timeout command should force wget to end if it hangs. The logs suggest the container hangs at wget.

```<code>timeout 4m wget -c -O "/aci/mnt/$ID/$ID.sra" $URL
</code>```

I have 100 items in queue. I have 5 ACI's running 5 containers each (25 total containers.)
A Logic App checks the Queue and if items are present, runs the containers.
Approximately 95% of the download runs work as expected.

Many of the runs simply hang as far as I can tell at 104GB total downloads.
I am using a Premium Storage Account with a 300GB Fileshare using SMB Multichannel=Enabled

It seems on some of the large files (>3GB) the Container Instance will hang.

A successful run looks somethin like this:

```<code>  PeekLock Message (5min)...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   353    0   353    0     0   1481      0 --:--:-- --:--:-- --:--:--  1476
Wed Dec 28 14:31:41 UTC 2022: prefetch-01-0: ---------- BEGIN RUN ----------
./pipeline.sh: line 80: can't create /aci/mnt/SRR10575111/SRR10575111.txt: nonexistent directory
Wed Dec 28 14:31:41 UTC 2022: prefetch-01-0: vdb-dump [SRR10575111]...
Wed Dec 28 14:31:44 UTC 2022: prefetch-01-0: wget [SRR10575111]...
Wed Dec 28 14:31:44 UTC 2022: prefetch-01-0: URL=https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR10575111/SRR10575111
Connecting to sra-pub-run-odp.s3.amazonaws.com (54.231.131.113:443)
saving to '/aci/mnt/SRR10575111/SRR10575111.sra'
SRR10575111.sra        0% |                                | 12.8M  0:03:39 ETA
SRR10575111.sra        1% |                                | 56.1M  0:01:39 ETA
...
SRR10575111.sra       99% |******************************* | 2830M  0:00:00 ETA
SRR10575111.sra      100% |********************************| 2833M  0:00:00 ETA
'/aci/mnt/SRR10575111/SRR10575111.sra' saved
Wed Dec 28 14:35:42 UTC 2022: prefetch-01-0: wget exit...
Wed Dec 28 14:35:43 UTC 2022: prefetch-01-0: wget Success!
Wed Dec 28 14:35:43 UTC 2022: prefetch-01-0: Delete Message...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Wed Dec 28 14:35:43 UTC 2022: prefetch-01-0: POST to [orchestrator] queue...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   325    0     0  100   325      0   1105 --:--:-- --:--:-- --:--:--  1109
Wed Dec 28 14:35:44 UTC 2022: prefetch-01-0: exit RESULTCODE=0
</code>```

A Hung run looks like this:

```<code>PeekLock Message (5min)...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   352    0   352    0     0   1252      0 --:--:-- --:--:-- --:--:--  1252
Wed Dec 28 14:31:41 UTC 2022: prefetch-01-1: ---------- BEGIN RUN ----------
./pipeline.sh: line 80: can't create /aci/mnt/SRR9164212/SRR9164212.txt: nonexistent directory
Wed Dec 28 14:31:41 UTC 2022: prefetch-01-1: vdb-dump [SRR9164212]...
Wed Dec 28 14:31:44 UTC 2022: prefetch-01-1: wget [SRR9164212]...
Wed Dec 28 14:31:44 UTC 2022: prefetch-01-1: URL=https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR9164212/SRR9164212
Connecting to sra-pub-run-odp.s3.amazonaws.com (52.216.146.75:443)
saving to '/aci/mnt/SRR9164212/SRR9164212.sra'
SRR9164212.sra         0% |                                | 2278k  0:55:44 ETA
SRR9164212.sra         0% |                                | 53.7M  0:04:30 ETA
SRR9164212.sra         1% |                                | 83.9M  0:04:18 ETA
...
SRR9164212.sra        44% |**************                  | 3262M  0:04:55 ETA
SRR9164212.sra        44% |**************                  | 3292M  0:04:52 ETA
SRR9164212.sra        45% |**************                  | 3326M  0:04:47 ETA
</code>```

The container is left in a Running State.
CPU goes to 0; Network activity goes to ~ 50B received/transmitted.

Title: ACI Container hangs during run CPU=0

Body:
I am attempting to run a bash script using ACI. Occasionally the container stalls or hangs. CPU activity drops to 0, memory flattens(see below) and network activity drops to ~50bytes but the script never completes. The container never terminates that I can tell. A bash window can be opened on the container. The logs suggest the hang occurs during wget.

Possible clue:
How can I verify my container is using SMB3.0 to connect to my share or is that handled at the host server level and I have to assume ACI uses SMB 3.0 ?

This script:

Dequeues an item from ServiceBus.

Runs an exe to obtain a URL

Performs a wget using the URL; writes the output to a StorageAccount Fileshare.

Exits, terminating the container.

wget is invoked with a 4min timeout. Data is written directly to the share so the run can be retried if it fails and the wget can resume. The timeout command should force wget to end if it hangs. The logs suggest the container hangs at wget.

timeout 4m wget -c -O "/aci/mnt/$ID/$ID.sra" $URL

I have 100 items in queue. I have 5 ACI's running 5 containers each (25 total containers.)
A Logic App checks the Queue and if items are present, runs the containers.
Approximately 95% of the download runs work as expected.

Many of the runs simply hang as far as I can tell at 104GB total downloads.
I am using a Premium Storage Account with a 300GB Fileshare using SMB Multichannel=Enabled

It seems on some of the large files (>3GB) the Container Instance will hang.

A successful run looks somethin like this:

  PeekLock Message (5min)...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   353    0   353    0     0   1481      0 --:--:-- --:--:-- --:--:--  1476
Wed Dec 28 14:31:41 UTC 2022: prefetch-01-0: ---------- BEGIN RUN ----------
./pipeline.sh: line 80: can't create /aci/mnt/SRR10575111/SRR10575111.txt: nonexistent directory
Wed Dec 28 14:31:41 UTC 2022: prefetch-01-0: vdb-dump [SRR10575111]...
Wed Dec 28 14:31:44 UTC 2022: prefetch-01-0: wget [SRR10575111]...
Wed Dec 28 14:31:44 UTC 2022: prefetch-01-0: URL=https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR10575111/SRR10575111
Connecting to sra-pub-run-odp.s3.amazonaws.com (54.231.131.113:443)
saving to '/aci/mnt/SRR10575111/SRR10575111.sra'
SRR10575111.sra        0% |                                | 12.8M  0:03:39 ETA
SRR10575111.sra        1% |                                | 56.1M  0:01:39 ETA
...
SRR10575111.sra       99% |******************************* | 2830M  0:00:00 ETA
SRR10575111.sra      100% |********************************| 2833M  0:00:00 ETA
'/aci/mnt/SRR10575111/SRR10575111.sra' saved
Wed Dec 28 14:35:42 UTC 2022: prefetch-01-0: wget exit...
Wed Dec 28 14:35:43 UTC 2022: prefetch-01-0: wget Success!
Wed Dec 28 14:35:43 UTC 2022: prefetch-01-0: Delete Message...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Wed Dec 28 14:35:43 UTC 2022: prefetch-01-0: POST to [orchestrator] queue...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   325    0     0  100   325      0   1105 --:--:-- --:--:-- --:--:--  1109
Wed Dec 28 14:35:44 UTC 2022: prefetch-01-0: exit RESULTCODE=0

A Hung run looks like this:

PeekLock Message (5min)...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   352    0   352    0     0   1252      0 --:--:-- --:--:-- --:--:--  1252
Wed Dec 28 14:31:41 UTC 2022: prefetch-01-1: ---------- BEGIN RUN ----------
./pipeline.sh: line 80: can't create /aci/mnt/SRR9164212/SRR9164212.txt: nonexistent directory
Wed Dec 28 14:31:41 UTC 2022: prefetch-01-1: vdb-dump [SRR9164212]...
Wed Dec 28 14:31:44 UTC 2022: prefetch-01-1: wget [SRR9164212]...
Wed Dec 28 14:31:44 UTC 2022: prefetch-01-1: URL=https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR9164212/SRR9164212
Connecting to sra-pub-run-odp.s3.amazonaws.com (52.216.146.75:443)
saving to '/aci/mnt/SRR9164212/SRR9164212.sra'
SRR9164212.sra         0% |                                | 2278k  0:55:44 ETA
SRR9164212.sra         0% |                                | 53.7M  0:04:30 ETA
SRR9164212.sra         1% |                                | 83.9M  0:04:18 ETA
...
SRR9164212.sra        44% |**************                  | 3262M  0:04:55 ETA
SRR9164212.sra        44% |**************                  | 3292M  0:04:52 ETA
SRR9164212.sra        45% |**************                  | 3326M  0:04:47 ETA

The container is left in a Running State.
CPU goes to 0; Network activity goes to ~ 50B received/transmitted.


来源: stackexchange

问:
How to fetch configs for multiple microservices from a central config server in spring boot
I have a config server in github have a structure like this:

```<code>-ms_one
|_application.yml
|_application-dev.yml
-ms_two
|_application.yml
|_application-dev.yml
</code>```

Repo url: My Github Repo

In the project I also follow the same structure:

```<code>-configServer
-ms_one
-ms_two
</code>```

In the application.yml of configServer I have

```<code>spring:
  application:
    name: CONFIGSERVER
  profiles:
    active: dev
  cloud:
    config:
      server:
        git:
          uri: <github repo url>
          clone-on-start: true
          default-label: main
          search-paths: {application}
eureka:
  client:
    fetch-registry: true
    register-with-eureka: true
logging:
  level:
    web: error
</code>```

In the ms-one service I have in application.yml

```<code>spring:
  profiles:
    active: dev
  application:
    name: ms-one
config:
    import: configserver:http://localhost:8003
</code>```

Now, I want the config server to fetch the configuration from the folder with the same name as application name and apply the configuration. The problem is the correct configuration is not being fetched. Please help me doing this

I got the idea of setting spring.cloud.config.server.git.search-paths:{application} from the thread How to point spring-cloud-config server to a git folder inside a git repo

ContentLicense: CC BY-SA 4.0

Body:
I have a config server in github have a structure like this:

-ms_one
|_application.yml
|_application-dev.yml
-ms_two
|_application.yml
|_application-dev.yml

Repo url: My Github Repo

In the project I also follow the same structure:

-configServer
-ms_one
-ms_two

In the application.yml of configServer I have

spring:
  application:
    name: CONFIGSERVER
  profiles:
    active: dev
  cloud:
    config:
      server:
        git:
          uri: <github repo url>
          clone-on-start: true
          default-label: main
          search-paths: {application}
eureka:
  client:
    fetch-registry: true
    register-with-eureka: true
logging:
  level:
    web: error

In the ms-one service I have in application.yml

spring:
  profiles:
    active: dev
  application:
    name: ms-one
config:
    import: configserver:http://localhost:8003

Now, I want the config server to fetch the configuration from the folder with the same name as application name and apply the configuration. The problem is the correct configuration is not being fetched. Please help me doing this

I got the idea of setting spring.cloud.config.server.git.search-paths:{application} from the thread How to point spring-cloud-config server to a git folder inside a git repo


问:
@Service Spring as Managed property of ManagedBean class in jsf is null
I've a webapp using JSF + Spring + Maven + JBoss (java 8).

I've a class ManagedBean with a property ManagedProperty which is a service spring.
In remote debugging I checked that the service is not injected and is null.
No errors in console (or server.log).

java class

```<code>@ManagedBean(name = "userBean")
@SessionScoped
public class UserBean implements Serializable {
...
@ManagedProperty(value = "#{loggedUserSession}")
    private ILoggedUserSession loggedUserSession;

    public String getUserLogin() {
        return loggedUserSession.getUser();
    }

    public ILoggedUserSession getLoggedUserSession() {
        return loggedUserSession;
    }

    public void setLoggedUserSession(ILoggedUserSession loggedUserSession) {
        this.loggedUserSession = loggedUserSession;
    }
...
}
</code>```

service java class

```<code>@Service("loggedUserSession")
@Scope(value = WebApplicationContext.SCOPE_SESSION, proxyMode = ScopedProxyMode.TARGET_CLASS)
public class LoggedUserSessionImpl implements ILoggedUserSession, Serializable {...}
</code>```

pom.xml

```<code>...
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>5.1.4.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>com.sun.faces</groupId>
            <artifactId>jsf-api</artifactId>
            <version>2.2.13</version>
        </dependency>

        <dependency>
            <groupId>org.primefaces</groupId>
            <artifactId>primefaces</artifactId>
            <version>6.2</version>
        </dependency>

        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <version>2.0.SP1</version>
        </dependency>
...
</code>```

web.xml

```<code>    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/applicationContext.xml</param-value>
    </context-param>

</code>```

In the applicationContext.xml i mapped <context:component-scan ... /> and

```<code>    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="location">
            <value>classpath:conf.properties</value>
        </property>
    </bean>
</code>```

I noticed the error at runtime.

I checked in web.xml, faces-config, applicationContext.xml and pom.xml but I didn't find anything strange.

Body:
I've a webapp using JSF + Spring + Maven + JBoss (java 8).

I've a class ManagedBean with a property ManagedProperty which is a service spring.
In remote debugging I checked that the service is not injected and is null.
No errors in console (or server.log).

java class

@ManagedBean(name = "userBean")
@SessionScoped
public class UserBean implements Serializable {
...
@ManagedProperty(value = "#{loggedUserSession}")
    private ILoggedUserSession loggedUserSession;

    public String getUserLogin() {
        return loggedUserSession.getUser();
    }

    public ILoggedUserSession getLoggedUserSession() {
        return loggedUserSession;
    }

    public void setLoggedUserSession(ILoggedUserSession loggedUserSession) {
        this.loggedUserSession = loggedUserSession;
    }
...
}

service java class

@Service("loggedUserSession")
@Scope(value = WebApplicationContext.SCOPE_SESSION, proxyMode = ScopedProxyMode.TARGET_CLASS)
public class LoggedUserSessionImpl implements ILoggedUserSession, Serializable {...}

pom.xml

...
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>5.1.4.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>com.sun.faces</groupId>
            <artifactId>jsf-api</artifactId>
            <version>2.2.13</version>
        </dependency>

        <dependency>
            <groupId>org.primefaces</groupId>
            <artifactId>primefaces</artifactId>
            <version>6.2</version>
        </dependency>

        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <version>2.0.SP1</version>
        </dependency>
...

web.xml

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/applicationContext.xml</param-value>
    </context-param>

In the applicationContext.xml i mapped <context:component-scan ... /> and

    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="location">
            <value>classpath:conf.properties</value>
        </property>
    </bean>

I noticed the error at runtime.

I checked in web.xml, faces-config, applicationContext.xml and pom.xml but I didn't find anything strange.


问:
How to print data from JSON response's using PHP languages
This is my code

```<code>$apiKey = 'xxxxxxxxxxxxxxxxxxxx';
$payload = [
    'code' => $result['paymentInvoice'],
    'amount' => $result['productPrice'],
];

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_FRESH_CONNECT  => true,
    CURLOPT_URL            => 'https://xxxxxxxx/api/merchant/fee-calculator?'.http_build_query($payload),
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HEADER         => false,
    CURLOPT_HTTPHEADER     => ['Authorization: Bearer '.$apiKey],
    CURLOPT_FAILONERROR    => false,
    CURLOPT_IPRESOLVE      => CURL_IPRESOLVE_V4
]);

$response = curl_exec($curl);
$error = curl_error($curl);

curl_close($curl);

echo empty($error) ? $response : $error;

</code>```

and here is the response
{"success":true,"message":"","data":[{"code":"BCAVA","name":"BCA Virtual Account","fee":{"flat":5500,"percent":"0.00","min":null,"max":null},"total_fee":{"merchant":0,"customer":5500}}]}

my question is how to echo the "5500" on total_fee of customer

Body:
This is my code

$apiKey = 'xxxxxxxxxxxxxxxxxxxx';
$payload = [
    'code' => $result['paymentInvoice'],
    'amount' => $result['productPrice'],
];

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_FRESH_CONNECT  => true,
    CURLOPT_URL            => 'https://xxxxxxxx/api/merchant/fee-calculator?'.http_build_query($payload),
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HEADER         => false,
    CURLOPT_HTTPHEADER     => ['Authorization: Bearer '.$apiKey],
    CURLOPT_FAILONERROR    => false,
    CURLOPT_IPRESOLVE      => CURL_IPRESOLVE_V4
]);

$response = curl_exec($curl);
$error = curl_error($curl);

curl_close($curl);

echo empty($error) ? $response : $error;

and here is the response
{"success":true,"message":"","data":[{"code":"BCAVA","name":"BCA Virtual Account","fee":{"flat":5500,"percent":"0.00","min":null,"max":null},"total_fee":{"merchant":0,"customer":5500}}]}

my question is how to echo the "5500" on total_fee of customer


问:
PostgreSQL function lags when passing a date from another table as argument
I created a function that retrieves data from multiple table and insert the result into a new table. I am passing few dates in the where clause to filter the applicable information. The dates are in timestamptz format. The query takes roughly a min to process. However when I make the change in the where clause to pass the date from another table, the query lags a lot. i.e.

My initial argument that doesn't lag is
where timestamp = '2022-01-05 04:00:00+00'

The lag is when I change this where clause to pass this date from another table.
where timestamp = select date_time from table_Test

The date_time in table_test is defined as timestamptz and the value is '2022-01-05 04:00:00+00'.

Any idea why the query lags when I pass the date argument from another table?

Thanks,


问:
where are the helpful utility css classes/variables for angular material?
I am relatively new to using angular material and it has taken a bit more work to use than I have faced using some other css frameworks like PrimeNG, Fomantic/Semantic UI. Most recently I have used PrimeNG which optionally comes with its own suite of utility classes in the form of the primeflex package. It does not appear that material has this (due to them leaving it up to you to decide i suppose) and I am therefore opting to use primeflex WITH angular material components. Is there an existing suite of material css classes that i can use instead, like simple classes that just give flex styles, height: 100%, etc.

My other problem is that I would like to tap into material in order to give my components background/font color styling relative to the current theme but I have not been able to find a 'helper class' that applies the current primary/accent/warn color to an element given the current theme. Any references to documentation are highly appreciated.

I assumed it would look something similar to:

```<code>// my-theme.css

@use '@angular/material' as mat;

.my-primary-text-class {
  color: mat.$primary-text-color
}

</code>```

or something similar?

Body:
I am relatively new to using angular material and it has taken a bit more work to use than I have faced using some other css frameworks like PrimeNG, Fomantic/Semantic UI. Most recently I have used PrimeNG which optionally comes with its own suite of utility classes in the form of the primeflex package. It does not appear that material has this (due to them leaving it up to you to decide i suppose) and I am therefore opting to use primeflex WITH angular material components. Is there an existing suite of material css classes that i can use instead, like simple classes that just give flex styles, height: 100%, etc.

My other problem is that I would like to tap into material in order to give my components background/font color styling relative to the current theme but I have not been able to find a 'helper class' that applies the current primary/accent/warn color to an element given the current theme. Any references to documentation are highly appreciated.

I assumed it would look something similar to:

// my-theme.css

@use '@angular/material' as mat;

.my-primary-text-class {
  color: mat.$primary-text-color
}

or something similar?


问:
Nosql Query find inside array the number that starts with 272 in Studio3T
I have a collection of persons with id, name, birthday_date, address and phone_numbers(it is an array).

(https://i.stack.imgur.com/IMb8p.png)

I want to do a query that finds the persons whose at least on of the phone number starts with 272

i tried this:

```<code>db.Pessoa.find({contatos_telefonicos: /^272/i })
</code>```

but it didn't worked, as you can see there is a person that the number starts with 272:
(https://i.stack.imgur.com/YDbzy.png)

Body:
I have a collection of persons with id, name, birthday_date, address and phone_numbers(it is an array).

(https://i.stack.imgur.com/IMb8p.png)

I want to do a query that finds the persons whose at least on of the phone number starts with 272

i tried this:

db.Pessoa.find({contatos_telefonicos: /^272/i })

but it didn't worked, as you can see there is a person that the number starts with 272:
(https://i.stack.imgur.com/YDbzy.png)


问:
Validate JWT token with com.nimbusds.jose and a public certificate url from Azure AD
I'm using a com.nimbusds.jose implementation in order to validate a token by retrieving the public key which was used to sign the JWT from Microsoft authorization server configuration (property jwks_uri). When I'm trying to validate the token by using the code written below, I'm getting:

com.nimbusds.jose.RemoteKeySourceException: Couldn't retrieve remote JWK set: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.

Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Code:

```<code> try {
        ConfigurableJWTProcessor jwtProcessor = new DefaultJWTProcessor();
        JWKSource keySource = null;
        try {
          ResourceRetriever jwkRetriever = new DefaultResourceRetriever(100000, 100000);
          JWKSetCache jwkSetCache = new DefaultJWKSetCache(1440,
              1430, TimeUnit.MINUTES);
          keySource = new RemoteJWKSet(new URL(
              "https://login.windows.net/36799f34-92fd-4612-8473-80173f2406e8/discovery/v2.0/keys"),jwkRetriever,jwkSetCache);
        } catch (MalformedURLException e) {
          e.printStackTrace();
        }
        JWSAlgorithm expectedJWSAlg = JWSAlgorithm.RS256;
        JWSKeySelector keySelector = new JWSVerificationKeySelector(expectedJWSAlg,keySource);
        jwtProcessor.setJWSKeySelector(keySelector);

        JWTClaimsSet claimsSet = null;
        SecurityContext ctx = null; // optional context parameter, not required here
        try {
          claimsSet = jwtProcessor.process(token, ctx);
        } catch (ParseException e) {
          e.printStackTrace();
        } catch (BadJOSEException e) {
          e.printStackTrace();
        } catch (JOSEException e) {
          e.printStackTrace();
        }
</code>```

I've added the certificates in the truststore. See below the configuration from Spring application.properties file:

```<code>    trust.store=myapp_dev.p12
trust.store.password=changeit
</code>```

What am I doing wrong?

Body:
I'm using a com.nimbusds.jose implementation in order to validate a token by retrieving the public key which was used to sign the JWT from Microsoft authorization server configuration (property jwks_uri). When I'm trying to validate the token by using the code written below, I'm getting:

com.nimbusds.jose.RemoteKeySourceException: Couldn't retrieve remote JWK set: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.

Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Code:

 try {
        ConfigurableJWTProcessor jwtProcessor = new DefaultJWTProcessor();
        JWKSource keySource = null;
        try {
          ResourceRetriever jwkRetriever = new DefaultResourceRetriever(100000, 100000);
          JWKSetCache jwkSetCache = new DefaultJWKSetCache(1440,
              1430, TimeUnit.MINUTES);
          keySource = new RemoteJWKSet(new URL(
              "https://login.windows.net/36799f34-92fd-4612-8473-80173f2406e8/discovery/v2.0/keys"),jwkRetriever,jwkSetCache);
        } catch (MalformedURLException e) {
          e.printStackTrace();
        }
        JWSAlgorithm expectedJWSAlg = JWSAlgorithm.RS256;
        JWSKeySelector keySelector = new JWSVerificationKeySelector(expectedJWSAlg,keySource);
        jwtProcessor.setJWSKeySelector(keySelector);

        JWTClaimsSet claimsSet = null;
        SecurityContext ctx = null; // optional context parameter, not required here
        try {
          claimsSet = jwtProcessor.process(token, ctx);
        } catch (ParseException e) {
          e.printStackTrace();
        } catch (BadJOSEException e) {
          e.printStackTrace();
        } catch (JOSEException e) {
          e.printStackTrace();
        }

I've added the certificates in the truststore. See below the configuration from Spring application.properties file:

    trust.store=myapp_dev.p12
trust.store.password=changeit

What am I doing wrong?


问:
Navigate to folder directly before i can use command in in a command line
I don't know how to search for my problem here.
In the command line i must navigate everytime directly in the folder where the software was installed.
Before I can use the command "java -v" or "flutter doctor" or what ever i must navigate to the java or flutter folder and i don't know why.
Maybe someone of you knows the ONE solution.

I use windows 11. I think it might be due to the environment variables - the environment variables entered are automatically deleted all the time.


问:
Error while installing ROS : gpg: no valid OpenPGP data found
xyz@ubuntu:~$ curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
gpg: no valid OpenPGP data found.

getting this error while installing ROS noetic in ubuntu 20.04.5, arm64, UTM

Tried few steps but didn't worked


问:
Why a component is not splited by lazy load in react?
Im building a Homepage with many sections, every section is loaded with Lazy loading and I render the suspense component when is first pixed is visible in view
but for some reason 1 section is not splited in chunk (I checked in network tab)

I dont understand why

That section is exported as default and was loaded with Lazy loading

const Who = React.lazy(() => import("./modules/views/Who"));
```
<p>This is How I render the section</p>
```

   {!whoInViewOnce
     ?

     : <Suspense fallback={<Box>Loading...</Box>}>
          <Who />
       </Suspense>
    }

```

Body:
Im building a Homepage with many sections, every section is loaded with Lazy loading and I render the suspense component when is first pixed is visible in view
but for some reason 1 section is not splited in chunk (I checked in network tab)

I dont understand why

That section is exported as default and was loaded with Lazy loading

const Who = React.lazy(() => import("./modules/views/Who"));

This is How I render the section

   {!whoInViewOnce
     ?

     : <Suspense fallback={<Box>Loading...</Box>}>
          <Who />
       </Suspense>
    }


问:
psql still exists despite uninstalling
I installed psql on my system without having added any new package sources. Later,I added postgres's package repo following the instructions on their website and ran sudo apt install postgres. I then ran sudo apt remove postgres.

Now, when I run sudo apt remove postgresql again, apt tells me "Unable to locate package postgresql". However, running dpkg -l | grep sql yields (among other things):

```<code>ii  postgresql-14                              14.5-0ubuntu0.22.04.1                      amd64        The World's Most Advanced Open Source Relational Database
ii  postgresql-15                              15.1-1.pgdg22.04+1                         amd64        The World's Most Advanced Open Source Relational Database
ii  postgresql-client-14                       14.5-0ubuntu0.22.04.1                      amd64        front-end programs for PostgreSQL 14
ii  postgresql-client-15                       15.1-1.pgdg22.04+1                         amd64        front-end programs for PostgreSQL 15
ii  postgresql-client-common                   246.pgdg22.04+1                            all          manager for multiple PostgreSQL client versions
ii  postgresql-common                          246.pgdg22.04+1                            all          PostgreSQL database-cluster manager
</code>```

And running psql --version from the command line yields psql (PostgreSQL) 15.1 (Ubuntu 15.1-1.pgdg22.04+1).

Here are some questions, info about any is appreciated:

Why can't apt find the postgresql package even though psql is installed?

What package is psql part of and how do I figure that out? Does psql still exist on my system because it is part of a package that another package I have installed depends on?

I'm just interested in using the most recent LTS version of postgres (15.1 at the time I'm writing this). Do I need the version 14 packages which exist on my systems? If not, how do I remove them?

Edit: After sudo apt removeing postgresql-14 and postgresql-15, psql still exists on my system but gives the following error: psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory. Why does the psql command still work?

Title: psql still exists despite uninstalling

Body:
I installed psql on my system without having added any new package sources. Later,I added postgres's package repo following the instructions on their website and ran sudo apt install postgres. I then ran sudo apt remove postgres.

Now, when I run sudo apt remove postgresql again, apt tells me "Unable to locate package postgresql". However, running dpkg -l | grep sql yields (among other things):

ii  postgresql-14                              14.5-0ubuntu0.22.04.1                      amd64        The World's Most Advanced Open Source Relational Database
ii  postgresql-15                              15.1-1.pgdg22.04+1                         amd64        The World's Most Advanced Open Source Relational Database
ii  postgresql-client-14                       14.5-0ubuntu0.22.04.1                      amd64        front-end programs for PostgreSQL 14
ii  postgresql-client-15                       15.1-1.pgdg22.04+1                         amd64        front-end programs for PostgreSQL 15
ii  postgresql-client-common                   246.pgdg22.04+1                            all          manager for multiple PostgreSQL client versions
ii  postgresql-common                          246.pgdg22.04+1                            all          PostgreSQL database-cluster manager

And running psql --version from the command line yields psql (PostgreSQL) 15.1 (Ubuntu 15.1-1.pgdg22.04+1).

Here are some questions, info about any is appreciated:

Why can't apt find the postgresql package even though psql is installed?

What package is psql part of and how do I figure that out? Does psql still exist on my system because it is part of a package that another package I have installed depends on?

I'm just interested in using the most recent LTS version of postgres (15.1 at the time I'm writing this). Do I need the version 14 packages which exist on my systems? If not, how do I remove them?

Edit: After sudo apt removeing postgresql-14 and postgresql-15, psql still exists on my system but gives the following error: psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory. Why does the psql command still work?


问:
Parallel file reading OpenMP
I would like to develop a simple program that can read different pieces of a file simultaneously.
I'm using C, OpenM and GCC.

I have a file with the following structure:

```<code> --------
| HEADER |
| ARRAY1 |
| TEXT   |
| ARRAY2 |
 --------
</code>```

Keeping in mind that the HEADER and ARRAY1 sections are independent of each other, I would like to understand if I can use a multi-thread strategy to read these first pieces of the file at the same time.

I implemented a very easy test solution.

```<code>#include <stdio.h>
#include <stdlib.h>
#include <omp.h>

typedef unsigned char BYTE;

typedef struct FILEHEADER {
  int x;
  int y;
  int elemNr;
} FileHeader;

static const char *filename = "test_data.bin";

void readFileHeader(FILE *fp, FileHeader *header, int nr)
{
  fread(header, sizeof(int), nr, fp);
}

void readArray1(FILE *fp, int *array1, int n)
{
  fseek(fp, sizeof(FileHeader), SEEK_SET);
  fread(array1, sizeof(int), sizeof(int) * n, fp);
}

int main(int argc, char *argv[]) {

  int thread_count = strtol(argv[1], NULL, 10);
  omp_set_num_threads(thread_count);

  const int n = 10;

  // create the file and write the data inside

  FILE *fp = fopen(filename, "wb");

  FileHeader headerW = {.x = 5, .y = 9, .elemNr = 3};
    BYTE *buffer = (BYTE*)&headerW;
    fwrite(buffer, sizeof(BYTE), sizeof(int) * headerW.elemNr, fp);

  int *array = calloc (n, sizeof(int));
  for (int i = 0; i < n; i++)
    array[i] = i;

  buffer = (BYTE*)array;
  fwrite(buffer, sizeof(BYTE), sizeof(int) * n, fp);

  printf("write section\n");
  printf("\nheader:\n\t");
  printf("x: %d\n\ty: %d\n\telemNr: %d\n", headerW.x, headerW.y, headerW.elemNr);

  printf("\narray:\n");
  for (int i = 0; i < n; i++)
    printf("\tarray[%d]: %d\n", i, array[i]);

  printf("\n");

  free(array);
    fclose(fp);

  // open the file and read the data inside

  FILE *fp1 = fopen(filename, "rb");
  FILE *fp2 = fopen(filename, "rb");

  FileHeader headerR = {.x = 0, .y = 0, .elemNr = 0};
  int *array1 = calloc (n, sizeof(int));

  #pragma omp parallel sections
  {
    #pragma omp section
    readFileHeader(fp1, &headerR, 3);

    #pragma omp section
    readArray1(fp2, array1, n);
  }

  printf("read section\n");
  printf("\nheader:\n\t");
  printf("x: %d\n\ty: %d\n\telemNr: %d\n", headerR.x, headerR.y, headerR.elemNr);

  printf("\narray1:\n");
  for (int i = 0; i < n; i++)
    printf("\tarray1[%d]: %d\n", i, array1[i]);

  // read the other parts of the file and do something

  free(array1);
  fclose(fp2);
  fclose(fp1);

  return 0;
}

</code>```

This solution compiles and works.
However because of its simplicity, I'm not sure if it is really run in parallel.

Anyway, what I'm asking is if the idea behind is correct, in other words, can I safely read different parts of the same file, at the same time, by using a multi-thread strategy?

If the answer were to be no, there is another way to do that by using OpenMp?

Title: Parallel file reading OpenMP

Body:
I would like to develop a simple program that can read different pieces of a file simultaneously.
I'm using C, OpenM and GCC.

I have a file with the following structure:

 --------
| HEADER |
| ARRAY1 |
| TEXT   |
| ARRAY2 |
 --------

Keeping in mind that the HEADER and ARRAY1 sections are independent of each other, I would like to understand if I can use a multi-thread strategy to read these first pieces of the file at the same time.

I implemented a very easy test solution.

#include <stdio.h>
#include <stdlib.h>
#include <omp.h>

typedef unsigned char BYTE;

typedef struct FILEHEADER {
  int x;
  int y;
  int elemNr;
} FileHeader;

static const char *filename = "test_data.bin";

void readFileHeader(FILE *fp, FileHeader *header, int nr)
{
  fread(header, sizeof(int), nr, fp);
}

void readArray1(FILE *fp, int *array1, int n)
{
  fseek(fp, sizeof(FileHeader), SEEK_SET);
  fread(array1, sizeof(int), sizeof(int) * n, fp);
}

int main(int argc, char *argv[]) {

  int thread_count = strtol(argv[1], NULL, 10);
  omp_set_num_threads(thread_count);

  const int n = 10;

  // create the file and write the data inside

  FILE *fp = fopen(filename, "wb");

  FileHeader headerW = {.x = 5, .y = 9, .elemNr = 3};
    BYTE *buffer = (BYTE*)&headerW;
    fwrite(buffer, sizeof(BYTE), sizeof(int) * headerW.elemNr, fp);

  int *array = calloc (n, sizeof(int));
  for (int i = 0; i < n; i++)
    array[i] = i;

  buffer = (BYTE*)array;
  fwrite(buffer, sizeof(BYTE), sizeof(int) * n, fp);

  printf("write section\n");
  printf("\nheader:\n\t");
  printf("x: %d\n\ty: %d\n\telemNr: %d\n", headerW.x, headerW.y, headerW.elemNr);

  printf("\narray:\n");
  for (int i = 0; i < n; i++)
    printf("\tarray[%d]: %d\n", i, array[i]);

  printf("\n");

  free(array);
    fclose(fp);

  // open the file and read the data inside

  FILE *fp1 = fopen(filename, "rb");
  FILE *fp2 = fopen(filename, "rb");

  FileHeader headerR = {.x = 0, .y = 0, .elemNr = 0};
  int *array1 = calloc (n, sizeof(int));

  #pragma omp parallel sections
  {
    #pragma omp section
    readFileHeader(fp1, &headerR, 3);

    #pragma omp section
    readArray1(fp2, array1, n);
  }

  printf("read section\n");
  printf("\nheader:\n\t");
  printf("x: %d\n\ty: %d\n\telemNr: %d\n", headerR.x, headerR.y, headerR.elemNr);

  printf("\narray1:\n");
  for (int i = 0; i < n; i++)
    printf("\tarray1[%d]: %d\n", i, array1[i]);

  // read the other parts of the file and do something

  free(array1);
  fclose(fp2);
  fclose(fp1);

  return 0;
}

This solution compiles and works.
However because of its simplicity, I'm not sure if it is really run in parallel.

Anyway, what I'm asking is if the idea behind is correct, in other words, can I safely read different parts of the same file, at the same time, by using a multi-thread strategy?

If the answer were to be no, there is another way to do that by using OpenMp?


问:
The fastest way to convert types in DataFrame
Hi what is the fastest way to convert string to appropriate types in DataFrame? I would like to make it automatically without specifying which columns should have a given type. Currently I'm using ast.literal_eval() for each cell but it's very slow for big dataframes (I'm using this only for columns whose dtype is object). Are there any faster alternatives?


问:
React Native - FlatList menu not showing other lists on screen
I have a menu at the top of my screen with different categories (cars, minivans, etc.) Each button is supposed to load a corresponding list on screen. I've managed to get the first list to load. But the other buttons (minivans, etc.) won't display the others. I've tried some things, but nothing seems to work. Any help would be greatly appreciated.

const HomeScreen = ({ navigation, isRtl, i18n }) => {

```<code>function tr(key) {
    return i18n.t(`homeScreen.${key}`)
}

const [selectedCategory, setSelectedCategory] = useState(categoriesList[0].category);
const [withDriverSwitch, setWithDriverSwitch] = useState(true);
const [cars, setCars] = useState(availableCarsList);
const [minivans, setMinivans] = useState(availableMinivansList);
const [suvs, setSuvs] = useState(availableSuvList);
const [sedans, setSedans] = useState(availableMinivansList);
const [law, setLaw] = useState(availableLawList);
const [hybrid, setHybrid] = useState(availableHybridList);
const [showSnackBar, setShowSnackBar] = useState(false);
const [snackBarMsg, setSnackBarMsg] = useState('');

return (
    <SafeAreaView style={{ flex: 1, backgroundColor: Colors.bodyBackColor }}>
        <View style={{ flex: 1 }}>
            {/* {addressInfoWithNotificationIcon()} */}
            <FlatList
                ListHeaderComponent={
                    <>
                        {/* {banner()} */}
                        {categoriesInfo()}
                        {availableCarInfo()}
                        {/* {availableSedansInfo()} */}
                    </>
                }
                showsVerticalScrollIndicator={false}
            />
        </View>
        {snackBar()}
    </SafeAreaView>
)

function snackBar() {
    return (
        <Snackbar
            visible={showSnackBar}
            onDismiss={() => setShowSnackBar(false)}
            style={{ elevation: 0.0, backgroundColor: Colors.lightBlackColor }}
        >
            <Text style={{ ...Fonts.whiteColor12Regular, }}>
                {snackBarMsg}
            </Text>
        </Snackbar>
    )
}

function availableCarInfo() {
    return (
        <>
            {availableCars()}
        </>
    )
}

function availableMinivansInfo() {
    return (
        <>
            {availableMinivans()}
        </>
    )
}

function availableSuvsInfo() {
    return (
        <>
            {availableSuvs()}
        </>
    )
}

function availableSedansInfo() {
    return (
        <>
            {availableSedans()}
        </>
    )
}

function availableLawInfo() {
    return (
        <>
            {availableLaw()}
        </>
    )
}

function availableHybridInfo() {
    return (
        <>
            {availableHybrid()}
        </>
    )
}

function availableCars() {
    console.log(availableCars)
    const renderItem = ({ item }) => (
        <TouchableOpacity
            activeOpacity={0.8}
            style={styles.availableCarsWrapStyle}
            onPress={() => navigation.navigate(item.goTo)}
        >
            <Image
                source={item.carImage}
                style={{ height: height / 9.0, width: '100%', resizeMode: 'stretch', }}
            />
            <View style={{ marginVertical: Sizes.fixPadding - 5.0, marginHorizontal: Sizes.fixPadding }}>
                <Text style={{ paddingTop: Sizes.fixPadding - 5.0, lineHeight: 17.0, ...Fonts.primaryColor14Medium }}>
                    {item.carName}
                </Text>
            </View>
        </TouchableOpacity>
    )
    return (
        <View style={{ marginTop: Sizes.fixPadding + 5.0, marginHorizontal: Sizes.fixPadding }}>
            <FlatList
                data={cars}
                keyExtractor={(item) => `${item.id}`}
                renderItem={renderItem}
                scrollEnabled={false}
                numColumns={2}
                showsVerticalScrollIndicator={false}
            />
        </View>
    )
}

function availableMinivans() {
    console.log(availableMinivans)
    const renderItem = ({ item }) => (
        <TouchableOpacity
            activeOpacity={0.8}
            style={styles.availableCarsWrapStyle}
            onPress={() => navigation.navigate(item.goTo)}
        >
            <Image
                source={item.carImage}
                style={{ height: height / 9.0, width: '100%', resizeMode: 'stretch', }}
            />
            <View style={{ marginVertical: Sizes.fixPadding - 5.0, marginHorizontal: Sizes.fixPadding }}>
                <Text style={{ paddingTop: Sizes.fixPadding - 5.0, lineHeight: 17.0, ...Fonts.primaryColor14Medium }}>
                    {item.carName}
                </Text>
            </View>
        </TouchableOpacity>
    )
    return (
        <View style={{ marginTop: Sizes.fixPadding + 5.0, marginHorizontal: Sizes.fixPadding }}>
            <FlatList
                data={minivans}
                keyExtractor={(item) => `${item.id}`}
                renderItem={renderItem}
                scrollEnabled={false}
                numColumns={2}
                showsVerticalScrollIndicator={false}
            />
        </View>
    )
}

function availableSuvs() {
    console.log(availableSuvs)
    const renderItem = ({ item }) => (
        <TouchableOpacity
            activeOpacity={0.8}
            style={styles.availableCarsWrapStyle}
            onPress={() => navigation.navigate(item.goTo)}
        >
            <Image
                source={item.carImage}
                style={{ height: height / 9.0, width: '100%', resizeMode: 'stretch', }}
            />
            <View style={{ marginVertical: Sizes.fixPadding - 5.0, marginHorizontal: Sizes.fixPadding }}>
                <Text style={{ paddingTop: Sizes.fixPadding - 5.0, lineHeight: 17.0, ...Fonts.primaryColor14Medium }}>
                    {item.carName}
                </Text>
            </View>
        </TouchableOpacity>
    )
    return (
        <View style={{ marginTop: Sizes.fixPadding + 5.0, marginHorizontal: Sizes.fixPadding }}>
            <FlatList
                data={suvs}
                keyExtractor={(item) => `${item.id}`}
                renderItem={renderItem}
                scrollEnabled={false}
                numColumns={2}
                showsVerticalScrollIndicator={false}
            />
        </View>
    )
}

function availableSedans() {
    console.log(availableSedans)
    const renderItem = ({ item }) => (
        <TouchableOpacity
            activeOpacity={0.8}
            style={styles.availableCarsWrapStyle}
            onPress={() => navigation.navigate(item.goTo)}
        >
            <Image
                source={item.carImage}
                style={{ height: height / 9.0, width: '100%', resizeMode: 'stretch', }}
            />
            <View style={{ marginVertical: Sizes.fixPadding - 5.0, marginHorizontal: Sizes.fixPadding }}>
                <Text style={{ paddingTop: Sizes.fixPadding - 5.0, lineHeight: 17.0, ...Fonts.primaryColor14Medium }}>
                    {item.carName}
                </Text>
            </View>
        </TouchableOpacity>
    )
    return (
        <View style={{ marginTop: Sizes.fixPadding + 5.0, marginHorizontal: Sizes.fixPadding }}>
            <FlatList
                data={sedans}
                keyExtractor={(item) => `${item.id}`}
                renderItem={renderItem}
                scrollEnabled={false}
                numColumns={2}
                showsVerticalScrollIndicator={false}
            />
        </View>
    )
}

function availableLaw() {
    console.log(availableLaw)
    const renderItem = ({ item }) => (
        <TouchableOpacity
            activeOpacity={0.8}
            style={styles.availableCarsWrapStyle}
            onPress={() => navigation.navigate(item.goTo)}
        >
            <Image
                source={item.carImage}
                style={{ height: height / 9.0, width: '100%', resizeMode: 'stretch', }}
            />
            <View style={{ marginVertical: Sizes.fixPadding - 5.0, marginHorizontal: Sizes.fixPadding }}>
                <Text style={{ paddingTop: Sizes.fixPadding - 5.0, lineHeight: 17.0, ...Fonts.primaryColor14Medium }}>
                    {item.carName}
                </Text>
            </View>
        </TouchableOpacity>
    )
    return (
        <View style={{ marginTop: Sizes.fixPadding + 5.0, marginHorizontal: Sizes.fixPadding }}>
            <FlatList
                data={law}
                keyExtractor={(item) => `${item.id}`}
                renderItem={renderItem}
                scrollEnabled={false}
                numColumns={2}
                showsVerticalScrollIndicator={false}
            />
        </View>
    )
}

function availableHybrid() {
    console.log(availableHybrid)
    const renderItem = ({ item }) => (
        <TouchableOpacity
            activeOpacity={0.8}
            style={styles.availableCarsWrapStyle}
            onPress={() => navigation.navigate(item.goTo)}
        >
            <Image
                source={item.carImage}
                style={{ height: height / 9.0, width: '100%', resizeMode: 'stretch', }}
            />
            <View style={{ marginVertical: Sizes.fixPadding - 5.0, marginHorizontal: Sizes.fixPadding }}>
                <Text style={{ paddingTop: Sizes.fixPadding - 5.0, lineHeight: 17.0, ...Fonts.primaryColor14Medium }}>
                    {item.carName}
                </Text>
            </View>
        </TouchableOpacity>
    )
    return (
        <View style={{ marginTop: Sizes.fixPadding + 5.0, marginHorizontal: Sizes.fixPadding }}>
            <FlatList
                data={hybrid}
                keyExtractor={(item) => `${item.id}`}
                renderItem={renderItem}
                scrollEnabled={false}
                numColumns={2}
                showsVerticalScrollIndicator={false}
            />
        </View>
    )
}

function showCars () {
    return (
        <SafeAreaView style={{ flex: 1, backgroundColor: Colors.bodyBackColor }}>
            <View style={{ flex: 1 }}>
                {/* {addressInfoWithNotificationIcon()} */}
                <FlatList
                    ListHeaderComponent={
                        <>
                            {/* {banner()} */}
                            {categoriesInfo()}
                            {availableCarInfo()}
                        </>
                    }
                    showsVerticalScrollIndicator={false}
                />
            </View>
            {snackBar()}
        </SafeAreaView>
    )
}

function showMinivans () {
    //console.log(showMinivans)
    return (
        <SafeAreaView style={{ flex: 1, backgroundColor: Colors.bodyBackColor }}>
            <View style={{ flex: 1 }}>
                {/* {addressInfoWithNotificationIcon()} */}
                <FlatList
                    ListHeaderComponent={
                        <>
                            {/* {banner()} */}
                            {categoriesInfo()}
                            { availableMinivansInfo() }
                        </>
                    }
                    showsVerticalScrollIndicator={false}
                />
            </View>
            {snackBar()}
        </SafeAreaView>
    )
}

function showSuvs () {
    return (
        <SafeAreaView style={{ flex: 1, backgroundColor: Colors.bodyBackColor }}>
            <View style={{ flex: 1 }}>
                {/* {addressInfoWithNotificationIcon()} */}
                <FlatList
                    ListHeaderComponent={
                        <>
                            {/* {banner()} */}
                            {categoriesInfo()}
                            {availableSuvsInfo()}
                        </>
                    }
                    showsVerticalScrollIndicator={false}
                />
            </View>
            {snackBar()}
        </SafeAreaView>
    )
}

function showSedans () {
    return (
        <SafeAreaView style={{ flex: 1, backgroundColor: Colors.bodyBackColor }}>
            <View style={{ flex: 1 }}>
                {/* {addressInfoWithNotificationIcon()} */}
                <FlatList
                    ListHeaderComponent={
                        <>
                            {/* {banner()} */}
                            {categoriesInfo()}
                            {availableSedansInfo()}
                        </>
                    }
                    showsVerticalScrollIndicator={false}
                />
            </View>
            {snackBar()}
        </SafeAreaView>
    )
}

function showLaw () {
    return (
        <SafeAreaView style={{ flex: 1, backgroundColor: Colors.bodyBackColor }}>
            <View style={{ flex: 1 }}>
                {/* {addressInfoWithNotificationIcon()} */}
                <FlatList
                    ListHeaderComponent={
                        <>
                            {/* {banner()} */}
                            {categoriesInfo()}
                            {availableLawInfo()}
                        </>
                    }
                    showsVerticalScrollIndicator={false}
                />
            </View>
            {snackBar()}
        </SafeAreaView>
    )
}

function showHybrid () {
    return (
        <SafeAreaView style={{ flex: 1, backgroundColor: Colors.bodyBackColor }}>
            <View style={{ flex: 1 }}>
                {/* {addressInfoWithNotificationIcon()} */}
                <FlatList
                    ListHeaderComponent={
                        <>
                            {/* {banner()} */}
                            {categoriesInfo()}
                            {availableHybridInfo()}
                        </>
                    }
                    showsVerticalScrollIndicator={false}
                />
            </View>
            {snackBar()}
        </SafeAreaView>
    )
}

function availableTitle() {
    return (
        <Text style={{ ...Fonts.blackColor16SemiBold, marginBottom: Sizes.fixPadding - 5.0, }}>
            {tr('availableTitle')}
        </Text>
    )
}

function categoriesInfo() {

    //const [currentIndex, setCurrentIndex] = useState(1);

    const renderItem = ({ item }) => (

        <TouchableOpacity
            activeOpacity={0.8}
            onPress={() => { setSelectedCategory(item.category)}}
            style={{
                backgroundColor: selectedCategory == item.category ? Colors.redColor : Colors.whiteColor,
                borderColor: selectedCategory == item.category ? Colors.primaryColor : Colors.bodyBackColor,
                ...styles.categoryWrapStyle,
            }}

        >

            <Text style={selectedCategory == item.category ? { ...Fonts.whiteColor16Medium } : { ...Fonts.grayColor16Medium }}>
                {item.category}
            </Text>
        </TouchableOpacity>
    )
    return (
        <View>
            <FlatList
                horizontal
                data={categoriesList}
                keyExtractor={(item) => `${item.id}`}
                renderItem={renderItem}
                showsHorizontalScrollIndicator={false}
                contentContainerStyle={{ paddingLeft: Sizes.fixPadding * 2.0, paddingRight: Sizes.fixPadding, paddingVertical: Sizes.fixPadding + 7.0 }}
            />
        </View>
    )
}
</code>```

}

```<code>

I've tried so many things at this point that I can't remember.
</code>```

Body:
I have a menu at the top of my screen with different categories (cars, minivans, etc.) Each button is supposed to load a corresponding list on screen. I've managed to get the first list to load. But the other buttons (minivans, etc.) won't display the others. I've tried some things, but nothing seems to work. Any help would be greatly appreciated.

const HomeScreen = ({ navigation, isRtl, i18n }) => {

function tr(key) {
    return i18n.t(`homeScreen.${key}`)
}

const [selectedCategory, setSelectedCategory] = useState(categoriesList[0].category);
const [withDriverSwitch, setWithDriverSwitch] = useState(true);
const [cars, setCars] = useState(availableCarsList);
const [minivans, setMinivans] = useState(availableMinivansList);
const [suvs, setSuvs] = useState(availableSuvList);
const [sedans, setSedans] = useState(availableMinivansList);
const [law, setLaw] = useState(availableLawList);
const [hybrid, setHybrid] = useState(availableHybridList);
const [showSnackBar, setShowSnackBar] = useState(false);
const [snackBarMsg, setSnackBarMsg] = useState('');

return (
    <SafeAreaView style={{ flex: 1, backgroundColor: Colors.bodyBackColor }}>
        <View style={{ flex: 1 }}>
            {/* {addressInfoWithNotificationIcon()} */}
            <FlatList
                ListHeaderComponent={
                    <>
                        {/* {banner()} */}
                        {categoriesInfo()}
                        {availableCarInfo()}
                        {/* {availableSedansInfo()} */}
                    </>
                }
                showsVerticalScrollIndicator={false}
            />
        </View>
        {snackBar()}
    </SafeAreaView>
)

function snackBar() {
    return (
        <Snackbar
            visible={showSnackBar}
            onDismiss={() => setShowSnackBar(false)}
            style={{ elevation: 0.0, backgroundColor: Colors.lightBlackColor }}
        >
            <Text style={{ ...Fonts.whiteColor12Regular, }}>
                {snackBarMsg}
            </Text>
        </Snackbar>
    )
}

function availableCarInfo() {
    return (
        <>
            {availableCars()}
        </>
    )
}

function availableMinivansInfo() {
    return (
        <>
            {availableMinivans()}
        </>
    )
}

function availableSuvsInfo() {
    return (
        <>
            {availableSuvs()}
        </>
    )
}

function availableSedansInfo() {
    return (
        <>
            {availableSedans()}
        </>
    )
}

function availableLawInfo() {
    return (
        <>
            {availableLaw()}
        </>
    )
}

function availableHybridInfo() {
    return (
        <>
            {availableHybrid()}
        </>
    )
}

function availableCars() {
    console.log(availableCars)
    const renderItem = ({ item }) => (
        <TouchableOpacity
            activeOpacity={0.8}
            style={styles.availableCarsWrapStyle}
            onPress={() => navigation.navigate(item.goTo)}
        >
            <Image
                source={item.carImage}
                style={{ height: height / 9.0, width: '100%', resizeMode: 'stretch', }}
            />
            <View style={{ marginVertical: Sizes.fixPadding - 5.0, marginHorizontal: Sizes.fixPadding }}>
                <Text style={{ paddingTop: Sizes.fixPadding - 5.0, lineHeight: 17.0, ...Fonts.primaryColor14Medium }}>
                    {item.carName}
                </Text>
            </View>
        </TouchableOpacity>
    )
    return (
        <View style={{ marginTop: Sizes.fixPadding + 5.0, marginHorizontal: Sizes.fixPadding }}>
            <FlatList
                data={cars}
                keyExtractor={(item) => `${item.id}`}
                renderItem={renderItem}
                scrollEnabled={false}
                numColumns={2}
                showsVerticalScrollIndicator={false}
            />
        </View>
    )
}

function availableMinivans() {
    console.log(availableMinivans)
    const renderItem = ({ item }) => (
        <TouchableOpacity
            activeOpacity={0.8}
            style={styles.availableCarsWrapStyle}
            onPress={() => navigation.navigate(item.goTo)}
        >
            <Image
                source={item.carImage}
                style={{ height: height / 9.0, width: '100%', resizeMode: 'stretch', }}
            />
            <View style={{ marginVertical: Sizes.fixPadding - 5.0, marginHorizontal: Sizes.fixPadding }}>
                <Text style={{ paddingTop: Sizes.fixPadding - 5.0, lineHeight: 17.0, ...Fonts.primaryColor14Medium }}>
                    {item.carName}
                </Text>
            </View>
        </TouchableOpacity>
    )
    return (
        <View style={{ marginTop: Sizes.fixPadding + 5.0, marginHorizontal: Sizes.fixPadding }}>
            <FlatList
                data={minivans}
                keyExtractor={(item) => `${item.id}`}
                renderItem={renderItem}
                scrollEnabled={false}
                numColumns={2}
                showsVerticalScrollIndicator={false}
            />
        </View>
    )
}

function availableSuvs() {
    console.log(availableSuvs)
    const renderItem = ({ item }) => (
        <TouchableOpacity
            activeOpacity={0.8}
            style={styles.availableCarsWrapStyle}
            onPress={() => navigation.navigate(item.goTo)}
        >
            <Image
                source={item.carImage}
                style={{ height: height / 9.0, width: '100%', resizeMode: 'stretch', }}
            />
            <View style={{ marginVertical: Sizes.fixPadding - 5.0, marginHorizontal: Sizes.fixPadding }}>
                <Text style={{ paddingTop: Sizes.fixPadding - 5.0, lineHeight: 17.0, ...Fonts.primaryColor14Medium }}>
                    {item.carName}
                </Text>
            </View>
        </TouchableOpacity>
    )
    return (
        <View style={{ marginTop: Sizes.fixPadding + 5.0, marginHorizontal: Sizes.fixPadding }}>
            <FlatList
                data={suvs}
                keyExtractor={(item) => `${item.id}`}
                renderItem={renderItem}
                scrollEnabled={false}
                numColumns={2}
                showsVerticalScrollIndicator={false}
            />
        </View>
    )
}

function availableSedans() {
    console.log(availableSedans)
    const renderItem = ({ item }) => (
        <TouchableOpacity
            activeOpacity={0.8}
            style={styles.availableCarsWrapStyle}
            onPress={() => navigation.navigate(item.goTo)}
        >
            <Image
                source={item.carImage}
                style={{ height: height / 9.0, width: '100%', resizeMode: 'stretch', }}
            />
            <View style={{ marginVertical: Sizes.fixPadding - 5.0, marginHorizontal: Sizes.fixPadding }}>
                <Text style={{ paddingTop: Sizes.fixPadding - 5.0, lineHeight: 17.0, ...Fonts.primaryColor14Medium }}>
                    {item.carName}
                </Text>
            </View>
        </TouchableOpacity>
    )
    return (
        <View style={{ marginTop: Sizes.fixPadding + 5.0, marginHorizontal: Sizes.fixPadding }}>
            <FlatList
                data={sedans}
                keyExtractor={(item) => `${item.id}`}
                renderItem={renderItem}
                scrollEnabled={false}
                numColumns={2}
                showsVerticalScrollIndicator={false}
            />
        </View>
    )
}

function availableLaw() {
    console.log(availableLaw)
    const renderItem = ({ item }) => (
        <TouchableOpacity
            activeOpacity={0.8}
            style={styles.availableCarsWrapStyle}
            onPress={() => navigation.navigate(item.goTo)}
        >
            <Image
                source={item.carImage}
                style={{ height: height / 9.0, width: '100%', resizeMode: 'stretch', }}
            />
            <View style={{ marginVertical: Sizes.fixPadding - 5.0, marginHorizontal: Sizes.fixPadding }}>
                <Text style={{ paddingTop: Sizes.fixPadding - 5.0, lineHeight: 17.0, ...Fonts.primaryColor14Medium }}>
                    {item.carName}
                </Text>
            </View>
        </TouchableOpacity>
    )
    return (
        <View style={{ marginTop: Sizes.fixPadding + 5.0, marginHorizontal: Sizes.fixPadding }}>
            <FlatList
                data={law}
                keyExtractor={(item) => `${item.id}`}
                renderItem={renderItem}
                scrollEnabled={false}
                numColumns={2}
                showsVerticalScrollIndicator={false}
            />
        </View>
    )
}

function availableHybrid() {
    console.log(availableHybrid)
    const renderItem = ({ item }) => (
        <TouchableOpacity
            activeOpacity={0.8}
            style={styles.availableCarsWrapStyle}
            onPress={() => navigation.navigate(item.goTo)}
        >
            <Image
                source={item.carImage}
                style={{ height: height / 9.0, width: '100%', resizeMode: 'stretch', }}
            />
            <View style={{ marginVertical: Sizes.fixPadding - 5.0, marginHorizontal: Sizes.fixPadding }}>
                <Text style={{ paddingTop: Sizes.fixPadding - 5.0, lineHeight: 17.0, ...Fonts.primaryColor14Medium }}>
                    {item.carName}
                </Text>
            </View>
        </TouchableOpacity>
    )
    return (
        <View style={{ marginTop: Sizes.fixPadding + 5.0, marginHorizontal: Sizes.fixPadding }}>
            <FlatList
                data={hybrid}
                keyExtractor={(item) => `${item.id}`}
                renderItem={renderItem}
                scrollEnabled={false}
                numColumns={2}
                showsVerticalScrollIndicator={false}
            />
        </View>
    )
}

function showCars () {
    return (
        <SafeAreaView style={{ flex: 1, backgroundColor: Colors.bodyBackColor }}>
            <View style={{ flex: 1 }}>
                {/* {addressInfoWithNotificationIcon()} */}
                <FlatList
                    ListHeaderComponent={
                        <>
                            {/* {banner()} */}
                            {categoriesInfo()}
                            {availableCarInfo()}
                        </>
                    }
                    showsVerticalScrollIndicator={false}
                />
            </View>
            {snackBar()}
        </SafeAreaView>
    )
}

function showMinivans () {
    //console.log(showMinivans)
    return (
        <SafeAreaView style={{ flex: 1, backgroundColor: Colors.bodyBackColor }}>
            <View style={{ flex: 1 }}>
                {/* {addressInfoWithNotificationIcon()} */}
                <FlatList
                    ListHeaderComponent={
                        <>
                            {/* {banner()} */}
                            {categoriesInfo()}
                            { availableMinivansInfo() }
                        </>
                    }
                    showsVerticalScrollIndicator={false}
                />
            </View>
            {snackBar()}
        </SafeAreaView>
    )
}

function showSuvs () {
    return (
        <SafeAreaView style={{ flex: 1, backgroundColor: Colors.bodyBackColor }}>
            <View style={{ flex: 1 }}>
                {/* {addressInfoWithNotificationIcon()} */}
                <FlatList
                    ListHeaderComponent={
                        <>
                            {/* {banner()} */}
                            {categoriesInfo()}
                            {availableSuvsInfo()}
                        </>
                    }
                    showsVerticalScrollIndicator={false}
                />
            </View>
            {snackBar()}
        </SafeAreaView>
    )
}

function showSedans () {
    return (
        <SafeAreaView style={{ flex: 1, backgroundColor: Colors.bodyBackColor }}>
            <View style={{ flex: 1 }}>
                {/* {addressInfoWithNotificationIcon()} */}
                <FlatList
                    ListHeaderComponent={
                        <>
                            {/* {banner()} */}
                            {categoriesInfo()}
                            {availableSedansInfo()}
                        </>
                    }
                    showsVerticalScrollIndicator={false}
                />
            </View>
            {snackBar()}
        </SafeAreaView>
    )
}

function showLaw () {
    return (
        <SafeAreaView style={{ flex: 1, backgroundColor: Colors.bodyBackColor }}>
            <View style={{ flex: 1 }}>
                {/* {addressInfoWithNotificationIcon()} */}
                <FlatList
                    ListHeaderComponent={
                        <>
                            {/* {banner()} */}
                            {categoriesInfo()}
                            {availableLawInfo()}
                        </>
                    }
                    showsVerticalScrollIndicator={false}
                />
            </View>
            {snackBar()}
        </SafeAreaView>
    )
}

function showHybrid () {
    return (
        <SafeAreaView style={{ flex: 1, backgroundColor: Colors.bodyBackColor }}>
            <View style={{ flex: 1 }}>
                {/* {addressInfoWithNotificationIcon()} */}
                <FlatList
                    ListHeaderComponent={
                        <>
                            {/* {banner()} */}
                            {categoriesInfo()}
                            {availableHybridInfo()}
                        </>
                    }
                    showsVerticalScrollIndicator={false}
                />
            </View>
            {snackBar()}
        </SafeAreaView>
    )
}

function availableTitle() {
    return (
        <Text style={{ ...Fonts.blackColor16SemiBold, marginBottom: Sizes.fixPadding - 5.0, }}>
            {tr('availableTitle')}
        </Text>
    )
}

function categoriesInfo() {

    //const [currentIndex, setCurrentIndex] = useState(1);

    const renderItem = ({ item }) => (

        <TouchableOpacity
            activeOpacity={0.8}
            onPress={() => { setSelectedCategory(item.category)}}
            style={{
                backgroundColor: selectedCategory == item.category ? Colors.redColor : Colors.whiteColor,
                borderColor: selectedCategory == item.category ? Colors.primaryColor : Colors.bodyBackColor,
                ...styles.categoryWrapStyle,
            }}

        >

            <Text style={selectedCategory == item.category ? { ...Fonts.whiteColor16Medium } : { ...Fonts.grayColor16Medium }}>
                {item.category}
            </Text>
        </TouchableOpacity>
    )
    return (
        <View>
            <FlatList
                horizontal
                data={categoriesList}
                keyExtractor={(item) => `${item.id}`}
                renderItem={renderItem}
                showsHorizontalScrollIndicator={false}
                contentContainerStyle={{ paddingLeft: Sizes.fixPadding * 2.0, paddingRight: Sizes.fixPadding, paddingVertical: Sizes.fixPadding + 7.0 }}
            />
        </View>
    )
}

}

I've tried so many things at this point that I can't remember.


问:
Access VBA for command button
when I debug in the editor I don't get syntax errors, but when I click the button on my form nothing happens. Trying to add 6 months to the field with a click of the button.  Does anyone know if this code is wrong or incomplete?

```<code>Private Sub Ctl6mosBtn_Click()
    EXPIRATIONDATE = [AUTO POLICIES.EFFECTIVE DATE] = DateAdd("m", 6, EXPIRATIONDATE)
End Sub

</code>```

Thanks for you any insight
Frank

I have two fields on my form

1-AUTO POLICIES.EFFECTIVE DATE which is the effective date of a policy.
2-EXPIRATIONDATE which is the expiration date of the policy.

I have a button labeled 6 Mos which when clicked should fill the EXPIRATIONDATE 6 months after the Effective Date. Nothing happens, no errors, fields doesn't fill!

Title: Access VBA for command button

Body:
when I debug in the editor I don't get syntax errors, but when I click the button on my form nothing happens. Trying to add 6 months to the field with a click of the button.  Does anyone know if this code is wrong or incomplete?

Private Sub Ctl6mosBtn_Click()
    EXPIRATIONDATE = [AUTO POLICIES.EFFECTIVE DATE] = DateAdd("m", 6, EXPIRATIONDATE)
End Sub

Thanks for you any insight
Frank

I have two fields on my form

1-AUTO POLICIES.EFFECTIVE DATE which is the effective date of a policy.
2-EXPIRATIONDATE which is the expiration date of the policy.

I have a button labeled 6 Mos which when clicked should fill the EXPIRATIONDATE 6 months after the Effective Date. Nothing happens, no errors, fields doesn't fill!


问:
Highcharts not working correctly with htmlunit-driver
Highcharts charts svg should be rendered using htmlunit-driver same as it is any other browser like chrome, edge, firefox etc

But the charts rendered are too small. Generated svg has a few NaN in the width attributes of couple rect tags. Moreover linearGradient and clipPath tags are all lowercased in the svg.

I have copied my sample project jdoodle. But it is not able to download maven dependencies. Anyways you can check my code for reference and copy the project to your local to run it:

https://www.jdoodle.com/ia/BEk

Brief structure of my example project:

highcharts-export.html (My custom html file to be used by htmlunitt)

highcharts-export.js (My custom js file to be used by htmlunit)

highcharts and highcharts-more js files

HighchartsExport.java the java code which uses selenium and htmlunit to execute the above html/js code to generate highcharts chart.

maven deps:

```<code><dependencies>
  <dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>4.7.2</version>
  </dependency>
  <dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>htmlunit-driver</artifactId>
    <version>4.7.2</version>
  </dependency>
</dependencies>
</code>```

Body:
Highcharts charts svg should be rendered using htmlunit-driver same as it is any other browser like chrome, edge, firefox etc

But the charts rendered are too small. Generated svg has a few NaN in the width attributes of couple rect tags. Moreover linearGradient and clipPath tags are all lowercased in the svg.

I have copied my sample project jdoodle. But it is not able to download maven dependencies. Anyways you can check my code for reference and copy the project to your local to run it:

https://www.jdoodle.com/ia/BEk

Brief structure of my example project:

highcharts-export.html (My custom html file to be used by htmlunitt)

highcharts-export.js (My custom js file to be used by htmlunit)

highcharts and highcharts-more js files

HighchartsExport.java the java code which uses selenium and htmlunit to execute the above html/js code to generate highcharts chart.

maven deps:

<dependencies>
  <dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>4.7.2</version>
  </dependency>
  <dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>htmlunit-driver</artifactId>
    <version>4.7.2</version>
  </dependency>
</dependencies>


问:
printing a message on window after i pressed enter, c using ncurses
I work on a project to implement the WORDLE game in C using ncurses. I have a problem. I need to implement the functionality when I pressed enter before I typed five letters to print on the window a message.
here is my code//
WINDOW *window = newwin(10, 40, 0, 0);</p>
```<code>            // Print a message on the window
            waddstr(window, "Press Enter to continue...");

            // Refresh the window to display the message
            wrefresh(window);
            wrefresh(geam);
            // Wait for the user to press Enter
            getch();

            // Clear the window
            wclear(window);
</code>```

Body:
I work on a project to implement the WORDLE game in C using ncurses. I have a problem. I need to implement the functionality when I pressed enter before I typed five letters to print on the window a message.
here is my code//
WINDOW *window = newwin(10, 40, 0, 0);

            // Print a message on the window
            waddstr(window, "Press Enter to continue...");

            // Refresh the window to display the message
            wrefresh(window);
            wrefresh(geam);
            // Wait for the user to press Enter
            getch();

            // Clear the window
            wclear(window);


问:
C# - Iterate over resources in project
I am trying to iterate over the files in the embedded resource folder. The only way I found is to iterate over them and have the name of the file and its content but I do not want this.

I want to have the file itself so I can copy it as is to a local windows directory.

```<code>ResXResourceReader rsxr = new ResXResourceReader("Resources.resx");

// Iterate through the resources and display the contents to the console.
foreach (DictionaryEntry d in rsxr)
{
    Properties.Resources.ResourceManager.GetString(d.Key.ToString());
    Console.WriteLine(d.Key.ToString() + ":\t" + d.Value.ToString());
}
</code>```

This is the only way I saw in the internet but I need to have an object of the file itself.

Title: C# - Iterate over resources in project

Body:
I am trying to iterate over the files in the embedded resource folder. The only way I found is to iterate over them and have the name of the file and its content but I do not want this.

I want to have the file itself so I can copy it as is to a local windows directory.

ResXResourceReader rsxr = new ResXResourceReader("Resources.resx");

// Iterate through the resources and display the contents to the console.
foreach (DictionaryEntry d in rsxr)
{
    Properties.Resources.ResourceManager.GetString(d.Key.ToString());
    Console.WriteLine(d.Key.ToString() + ":\t" + d.Value.ToString());
}

This is the only way I saw in the internet but I need to have an object of the file itself.


问:
SAP UI5 - Change colour of Input added dynamically from js Controller
I'm new on Fiori and I need help to set colour at inputs that I added dynamically from my controller.
That's my code:

```<code>var ColumnHeader = new sap.m.Column({
            header: new sap.m.Label({
              text: i.toString(),
            }),
            hAlign: "Center",
          });

// that's my input
var cell = new sap.m.Input({
            value: i.toString() + "%",
          });
// I think here I need to add code to change colour

          oColumnListItem.addCell(cell);
          oTable.addColumn(ColumnHeader);
</code>```

Can someone help me?
Best Reguards

Body:
I'm new on Fiori and I need help to set colour at inputs that I added dynamically from my controller.
That's my code:

var ColumnHeader = new sap.m.Column({
            header: new sap.m.Label({
              text: i.toString(),
            }),
            hAlign: "Center",
          });

// that's my input
var cell = new sap.m.Input({
            value: i.toString() + "%",
          });
// I think here I need to add code to change colour

          oColumnListItem.addCell(cell);
          oTable.addColumn(ColumnHeader);

Can someone help me?
Best Reguards


问:
What are my parameters to show a pop up on the map created by folium
I created a map as follows:

```<code>mapaBarrios = folium.Map(
    location=[40.4165000, -3.7025600],
    zoom_start=10
)
mapaBarrios
</code>```

And what I want to do is add a layer so that when you pass the mouse it shows me the area in which it is located.

To do this, the first thing I do is load the geojson that contains these divisions:

```<code>capaDistrito = gpd.read_file('/work/CapaDistritos.geojson')
</code>```

My GeoJson:

```<code>{
    "type": "FeatureCollection",
    "features": [{
            "type": "Feature",
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [-3.693161588084508, 40.40734528723428, 0],
                                                                   ...
                        [-3.693161588084508, 40.40734528723428, 0]
                    ]
                ]
            },
            "properties": {
                "COD_DIS": "1",
                "COD_DIS_TX": "01",
                "NOMBRE": "Centro",
                "DISTRI_MAY": "CENTRO",
                "DISTRI_MT": "CENTRO",
                "Area_m2": 5228246.7414
            }
        },
</code>```

How it shows:

enter image description here

I proceed to add it to the map but I don't know which are my parameters 'properties' and 'nombre'

```<code>popup=folium.Popup(str(capaDistrito\['properties'\]\['nombre'\])
</code>```

I tried to put only 'NAME' and I get all the data when it should show me just one name:

```<code>folium.GeoJson(
    capaDistrito,
    style_function=lambda feature: {
        'fillColor': '#ffff00',
        'color': '#000000',
        'weight': 2,
        'dashArray': '5, 5'
    },
    popup=folium.Popup(str(capaDistrito["NOMBRE"]),
    parse_html=True)
).add_to(mapaBarrios)
mapaBarrios
</code>```

Body:
I created a map as follows:

mapaBarrios = folium.Map(
    location=[40.4165000, -3.7025600],
    zoom_start=10
)
mapaBarrios

And what I want to do is add a layer so that when you pass the mouse it shows me the area in which it is located.

To do this, the first thing I do is load the geojson that contains these divisions:

capaDistrito = gpd.read_file('/work/CapaDistritos.geojson')

My GeoJson:

{
    "type": "FeatureCollection",
    "features": [{
            "type": "Feature",
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [-3.693161588084508, 40.40734528723428, 0],
                                                                   ...
                        [-3.693161588084508, 40.40734528723428, 0]
                    ]
                ]
            },
            "properties": {
                "COD_DIS": "1",
                "COD_DIS_TX": "01",
                "NOMBRE": "Centro",
                "DISTRI_MAY": "CENTRO",
                "DISTRI_MT": "CENTRO",
                "Area_m2": 5228246.7414
            }
        },

How it shows:

enter image description here

I proceed to add it to the map but I don't know which are my parameters 'properties' and 'nombre'

popup=folium.Popup(str(capaDistrito\['properties'\]\['nombre'\])

I tried to put only 'NAME' and I get all the data when it should show me just one name:

folium.GeoJson(
    capaDistrito,
    style_function=lambda feature: {
        'fillColor': '#ffff00',
        'color': '#000000',
        'weight': 2,
        'dashArray': '5, 5'
    },
    popup=folium.Popup(str(capaDistrito["NOMBRE"]),
    parse_html=True)
).add_to(mapaBarrios)
mapaBarrios


问:
Tableau, I have a product list, number of sales and margin. I only want to display products that meet sales and margin criteria
amongst lots of other data , I have product, sales and margin.

I want to create a new worksheet that only displays products from the list that meet sales and margin criteria.

when sales > 100 and the margin is > 15% or < -15%.

I then need to perform further calculations on the data associated to these products.

I can easily filter these out, but I need to create a separate product list that meets these criteria that I can use for the next calculations.

I have tried IF and WHEN statements, but my problem comes from using SUM([SALES]), [MARGIN %] and [PRODUCT] - the sales and margin are aggregated fields, product is a string list.

If no product has more than 100 sales, I expect no results, and likewise if there are products with more than 100 sales BUT the margin falls within -15  15 I expect no results.


问:
How to get selected buttons from form in php
The user needs to select 3 subjects from the list before they can submit. They can select and unselect options. Everything is functioning as supposed to. Except inserting the values of the button into the database after submission. After I select 3 buttons and click submit

I get the errors:

Notice: Undefined index: selectedButton

Notice: Trying to access array offset on value of type null

and it doesn't update subject1, subject2, subject3 values for the user on the db.

Form Element

<form id="myForm" action="" method="post">
    Select your school subjects select 3:

    <button type="button" name="selectedButton" class="redirect-button" value="math" onclick="selectButton(this)">Math</button>
    <button type="button" name="selectedButton" class="redirect-button" value="science" onclick="selectButton(this)">Science</button>
    <button type="button" name="selectedButton" class="redirect-button" value="english" onclick="selectButton(this)">English</button>
    <button type="button" name="selectedButton" class="redirect-button" value="history" onclick="selectButton(this)">History</button>
    <button type="button" name="selectedButton" class="redirect-button" value="adv_math" onclick="selectButton(this)">Advanced Math</button>
    <button type="button" name="selectedButton" class="redirect-button" value="calculus" onclick="selectButton(this)">Calculus</button>
    <button type="button" name="selectedButton" class="redirect-button" value="other" onclick="selectButton(this)">Other</button>

    <button type="submit" class="btn btn-success" disabled>Submit</button>
    Selected: 0/3
</form>
```
<p>PHP</p>
<pre class="lang-php prettyprint-override"><code><?php

include 'config.php';
session_start();
$user_id = $_SESSION['user_id'];
if ($_SERVER['REQUEST_METHOD'] === 'POST') {

    $selectedButtons = $_POST['selectedButton'];
    $subject1 = $selectedButtons[0];
    $subject2 = $selectedButtons[1];
    $subject3 = $selectedButtons[2];

    // Insert the subjects into the database
    mysqli_query($conn, "UPDATE `user_form` SET subject1 = '$subject1', subject2 = '$subject2', subject3='$subject3' WHERE id = '$user_id'") or die('query failed');
}

?>
</code>```

JS

let selectedCount = 0;
const form = document.getElementById("myForm");
const submitButton = form.querySelector('button[type="submit"]');
const selectedCountSpan = document.getElementById("selectedCount");

function selectButton(button) {
  if (button.classList.contains("btn-selected")) {
    // Unselect the button
    button.classList.remove("btn-selected");
    selectedCount--;
  } else if (selectedCount < 3) {
    // Select the button
    button.classList.add("btn-selected");
    selectedCount++;
  }

  // Update the selected count display and enable or disable the submit button
  selectedCountSpan.textContent = selectedCount;
  submitButton.disabled = selectedCount === 0;
}

```
<p>I tried separating the values individually from the array but it seems like the values are all null.</p>
<pre class="lang-php prettyprint-override"><code>$subject1 = $selectedButtons[0];
$subject2 = $selectedButtons[1];
$subject3 = $selectedButtons[2];

</code>```

Body:
The user needs to select 3 subjects from the list before they can submit. They can select and unselect options. Everything is functioning as supposed to. Except inserting the values of the button into the database after submission. After I select 3 buttons and click submit

I get the errors:

Notice: Undefined index: selectedButton

Notice: Trying to access array offset on value of type null

and it doesn't update subject1, subject2, subject3 values for the user on the db.

Form Element

<form id="myForm" action="" method="post">
    Select your school subjects select 3:

    <button type="button" name="selectedButton" class="redirect-button" value="math" onclick="selectButton(this)">Math</button>
    <button type="button" name="selectedButton" class="redirect-button" value="science" onclick="selectButton(this)">Science</button>
    <button type="button" name="selectedButton" class="redirect-button" value="english" onclick="selectButton(this)">English</button>
    <button type="button" name="selectedButton" class="redirect-button" value="history" onclick="selectButton(this)">History</button>
    <button type="button" name="selectedButton" class="redirect-button" value="adv_math" onclick="selectButton(this)">Advanced Math</button>
    <button type="button" name="selectedButton" class="redirect-button" value="calculus" onclick="selectButton(this)">Calculus</button>
    <button type="button" name="selectedButton" class="redirect-button" value="other" onclick="selectButton(this)">Other</button>

    <button type="submit" class="btn btn-success" disabled>Submit</button>
    Selected: 0/3
</form>

PHP

<?php

include 'config.php';
session_start();
$user_id = $_SESSION['user_id'];
if ($_SERVER['REQUEST_METHOD'] === 'POST') {

    $selectedButtons = $_POST['selectedButton'];
    $subject1 = $selectedButtons[0];
    $subject2 = $selectedButtons[1];
    $subject3 = $selectedButtons[2];

    // Insert the subjects into the database
    mysqli_query($conn, "UPDATE `user_form` SET subject1 = '$subject1', subject2 = '$subject2', subject3='$subject3' WHERE id = '$user_id'") or die('query failed');
}

?>

JS

let selectedCount = 0;
const form = document.getElementById("myForm");
const submitButton = form.querySelector('button[type="submit"]');
const selectedCountSpan = document.getElementById("selectedCount");

function selectButton(button) {
  if (button.classList.contains("btn-selected")) {
    // Unselect the button
    button.classList.remove("btn-selected");
    selectedCount--;
  } else if (selectedCount < 3) {
    // Select the button
    button.classList.add("btn-selected");
    selectedCount++;
  }

  // Update the selected count display and enable or disable the submit button
  selectedCountSpan.textContent = selectedCount;
  submitButton.disabled = selectedCount === 0;
}

I tried separating the values individually from the array but it seems like the values are all null.

$subject1 = $selectedButtons[0];
$subject2 = $selectedButtons[1];
$subject3 = $selectedButtons[2];


问:
Passing data between AWS lambda from the step functions using api gateway in nodejs
I have a special use case. I have to call the step function from api gateway using a POST call which is APIGatewayProxyEvent with two tasks, finally I have to aggregate the result and return as a single response.

Task 1 takes the input as APIGatewayProxyEvent as input and call a lambda function L1 and return a result in form of APIGatewayProxyResult

Task 2 takes the input as APIGatewayProxyEvent as input and call a lambda function L2 and return a result in form of APIGatewayProxyResult

But the problem is Task 2 L2 is not working since it is expecting APIGatewayProxyEvent but in turn it gets APIGatewayProxyResult

I have used outputPath resultPath inputPath for manipulating the data but still there is no possible outcome and I am getting a blank response.

I tried all possible outcomes need a help here.


问:
plotly map from json polygon is very slow
I am building a small app in Dash where I want to plot data on a map.
I am loading a geojson file that holds my countries regions delimitation using geopandas.
I made a test dataframe containing random values for some regions.
I am ploting eveything using plotly choropleth_mapbox.
It works but is very slow. When I decide to put data for all regions it can take up to 20 minutes.
Would you have any idea how I can fasten it ? Or would you advise using other libraries than geopandas and plotly ?

code:

```<code>import geopandas
import plotly.express as px

geojson = geopandas.read_file('static/Mapping/Departements.geojson')
df['code'] = [59, 75, 24]
df['value'] = [150, 10, 256]

fig = px.choropleth_mapbox(df, geojson=geojson, locations='code', color='value',
                            color_continuous_scale="Viridis",
                            range_color=(0, 12),
                            mapbox_style="carto-positron",
                            zoom=4, center = {"lat": 48.856614, "lon": 2.3522219},
                            opacity=0.5,
                            labels={'Value':'Test values'}
                          )
</code>```

Body:
I am building a small app in Dash where I want to plot data on a map.
I am loading a geojson file that holds my countries regions delimitation using geopandas.
I made a test dataframe containing random values for some regions.
I am ploting eveything using plotly choropleth_mapbox.
It works but is very slow. When I decide to put data for all regions it can take up to 20 minutes.
Would you have any idea how I can fasten it ? Or would you advise using other libraries than geopandas and plotly ?

code:

import geopandas
import plotly.express as px

geojson = geopandas.read_file('static/Mapping/Departements.geojson')
df['code'] = [59, 75, 24]
df['value'] = [150, 10, 256]

fig = px.choropleth_mapbox(df, geojson=geojson, locations='code', color='value',
                            color_continuous_scale="Viridis",
                            range_color=(0, 12),
                            mapbox_style="carto-positron",
                            zoom=4, center = {"lat": 48.856614, "lon": 2.3522219},
                            opacity=0.5,
                            labels={'Value':'Test values'}
                          )


问:
Extract one band data from Geotiff file and plot colored image based on one band values on folium map
I am new to extracting data from Geotiff files.So this question will sound obvious.I have tiff file which I have got from api.It has 12 bands.This shows definition of what each band contains

What I want

After extenisve searching for days i am only able to do this.
enter image description here
Code which i have tried

```<code> driver=gdal.GetDriverByName('GTiFF')
    driver.Register()
    ds = gdal.Open('...../286d7a11-4abd-449e-856b-79959dfd1396.tif')
    if ds is None:
       print('Could not open')
    geotransform = ds.GetGeoTransform()
    proj = ds.GetProjection()
    cols = ds.RasterXSize
    rows = ds.RasterYSize
    xmin=geotransform[0]
    ymax=geotransform[3]
    xmax=xmin+cols*geotransform[1]
    ymin=ymax+rows*geotransform[5]
    centerx=(xmin+xmax)/2
    centery=(ymin+ymax)/2
    bands = ds.RasterCount
    band10 = ds.GetRasterBand(10)
    array = band10.ReadAsArray()
    map= folium.Map(location=[centery, centerx], zoom_start=7,tiles='openstreetmap')
    image = folium.raster_layers.ImageOverlay(
       dataimage,opacity=0.8, bounds=[[ymin,xmin],[ymax,xmax]]
    )
    image.add_to(map)

    map.fit_bounds(map.get_bounds(), padding=(10, 10))
    return map
</code>```

Body:
I am new to extracting data from Geotiff files.So this question will sound obvious.I have tiff file which I have got from api.It has 12 bands.This shows definition of what each band contains

What I want

After extenisve searching for days i am only able to do this.
enter image description here
Code which i have tried

 driver=gdal.GetDriverByName('GTiFF')
    driver.Register()
    ds = gdal.Open('...../286d7a11-4abd-449e-856b-79959dfd1396.tif')
    if ds is None:
       print('Could not open')
    geotransform = ds.GetGeoTransform()
    proj = ds.GetProjection()
    cols = ds.RasterXSize
    rows = ds.RasterYSize
    xmin=geotransform[0]
    ymax=geotransform[3]
    xmax=xmin+cols*geotransform[1]
    ymin=ymax+rows*geotransform[5]
    centerx=(xmin+xmax)/2
    centery=(ymin+ymax)/2
    bands = ds.RasterCount
    band10 = ds.GetRasterBand(10)
    array = band10.ReadAsArray()
    map= folium.Map(location=[centery, centerx], zoom_start=7,tiles='openstreetmap')
    image = folium.raster_layers.ImageOverlay(
       dataimage,opacity=0.8, bounds=[[ymin,xmin],[ymax,xmax]]
    )
    image.add_to(map)

    map.fit_bounds(map.get_bounds(), padding=(10, 10))
    return map


问:
Connect to On-Prem Network share drive from Azure
I have user credential and folder path such as the following:

User: UserName
Password: Password
FilePath: \website.com\Private\ClientServices\

Using this, I can map this as a network drive on my local windows explorer. However, I have a Logic App in Azure that I would like to access this folder structure. I have tried FileShare but it doesn't seem to be able to pull or push files to this location.

How can I go about doing this?

I tried using FileShare but I can't connect to the On-Prem drive from it. I am unclear how I might actually accomplish this.