问:
How to customize and change color using props in MUI typography component?
I am trying to customize MUI Typography component.

Currently, if I have to define a div with font-color:white and a span with font-color:red I do it this way.

```<code><Typography variant="h6" component="div" sx={{ color: "white"}}> Hello </Typography>
<Typography variant="h6" component="span" sx={{ color: "red"}}> Hello </Typography>
</code>```

But I want to create a custom component where I need to pass component and color like this:

```<code><Text component='div' color='white'> Hello</Text>
<Text component='span' color='red'> Hello</Text>
</code>```

I tried to achieve using this code:

```<code>import { Typography, styled } from "@mui/material";

export const Span = styled(Typography)((props) => ({
    component: props.component,
    color: props.color,
}));

</code>```

This approach used to work in styled-components but has no clue how to customize the MUI components.

Please guide me.

Body:
I am trying to customize MUI Typography component.

Currently, if I have to define a div with font-color:white and a span with font-color:red I do it this way.

<Typography variant="h6" component="div" sx={{ color: "white"}}> Hello </Typography>
<Typography variant="h6" component="span" sx={{ color: "red"}}> Hello </Typography>

But I want to create a custom component where I need to pass component and color like this:

<Text component='div' color='white'> Hello</Text>
<Text component='span' color='red'> Hello</Text>

I tried to achieve using this code:

import { Typography, styled } from "@mui/material";

export const Span = styled(Typography)((props) => ({
    component: props.component,
    color: props.color,
}));

This approach used to work in styled-components but has no clue how to customize the MUI components.

Please guide me.


来源: stackexchange

问:
Ubuntu: Unable to load dynamic library 'pdo_oci.so'
I'm setting up a docker container with PHP8 and OCI8. can't seem to figure out why i'm getting error

PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_oci.so' (tried: /usr/lib/php8/modules/pdo_oci.so (Error loading shared library /usr/lib/php8/modules/pdo_oci.so: No such file or directory), /usr/lib/php8/modules/pdo_oci.so.so (Error loading shared library /usr/lib/php8/modules/pdo_oci.so.so: No such file or directory)) in Unknown on line 0

is there anyway to check the files inside the docker container?

already unzip the Oracle Instant Client, but im now sure its in the directory.

this is my Dockerfile for reference:

```<code>    FROM composer:2.0 as vendor

COPY composer.json/ /app/composer.json
COPY docker/config/nginx.conf /app/nginx.conf

RUN composer install \
    --ignore-platform-reqs \
    --no-interaction \
    --no-plugins \
    --no-scripts \
    --no-ansi \
    --prefer-dist

FROM php:8.0-fpm-alpine3.13
LABEL  Maintainer="Christian Jay Bayno"

# Install packages
RUN apk --no-cache add php8 \
php8-fpm \
php8-pdo_mysql \
php8-json \
php8-openssl \
php8-curl \
php8-tokenizer \
php8-dom \
php8-dev \
php8-opcache \
nginx \
supervisor \
curl \
git \
tzdata \
g++ \
gcc \
make \
libaio-dev \
libnsl \
gcompat

RUN ln -s /usr/lib/libnsl.so.2 /usr/lib/libnsl.so.1

# Install Instaclient and PDO OCI
RUN mkdir -p /opt/oci

COPY ./docker/oracle/instantclient-basic-19.17.0.0.0.zip /opt/oci
COPY ./docker/oracle/instantclient-sdk-19.17.0.0.0.zip /opt/oci
COPY ./docker/oracle/pdo_oci.zip /opt/oci
RUN cd /opt/oci \
    && unzip instantclient-basic-19.17.0.0.0.zip \
    && unzip instantclient-sdk-19.17.0.0.0.zip \
    && cd instantclient_19_17/ \
    && ln -s /opt/oci/instantclient_19_17/libclntsh.so.19.1 libclntsh.so \
    && ln -s /opt/oci/instantclient_19_17/libocci.so.19.1 libocci.so \
    && ls \
    && cd ../ \
    && unzip pdo_oci.zip \
    && cd pdo_oci \
    && phpize \
    && ./configure --with-pdo-oci=shared,instantclient,/opt/oci/instantclient_19_17 \
    && make \
    && make install \
    && echo "extension=pdo_oci.so" >> /etc/php8/conf.d/pdo_oci.ini \
    && cd /opt/oci \
    && rm *.zip

# Configure Timezone
ENV TZ Asia/Manila

# Configure nginx
COPY docker/config/nginx.conf /etc/nginx/nginx.conf

# Configure PHP-FPM
  COPY docker/config/fpm-pool.conf /etc/php8/php-fpm.d/www.conf
  COPY docker/config/php.ini /etc/php8/conf.d/app.ini

# Configure supervisord
COPY docker/config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf

# Make sure files/folders needed by the processes are accessable when they run under the nobody user
RUN chown -R nobody.nobody /run && \
  chown -R nobody.nobody /var/lib/nginx && \
  chown -R nobody.nobody /var/log/nginx

# Set up document root
RUN mkdir -p /var/www/html

# Switch to use a non-root user from here on
USER nobody

# Add application
WORKDIR /var/www/html
COPY --chown=nobody . /var/www/html/
COPY --chown=nobody --from=vendor /app/vendor/ /var/www/html/vendor/

# Expose the port nginx is reachable on
EXPOSE 8085

# Let supervisord start nginx & php-fpm
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]

# Configure a healthcheck to validate that everything is up&running
HEALTHCHECK --timeout=10s CMD curl --silent --fail http://127.0.0.1:8085/fpm-ping
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I'm setting up a docker container with PHP8 and OCI8. can't seem to figure out why i'm getting error

PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_oci.so' (tried: /usr/lib/php8/modules/pdo_oci.so (Error loading shared library /usr/lib/php8/modules/pdo_oci.so: No such file or directory), /usr/lib/php8/modules/pdo_oci.so.so (Error loading shared library /usr/lib/php8/modules/pdo_oci.so.so: No such file or directory)) in Unknown on line 0

is there anyway to check the files inside the docker container?

already unzip the Oracle Instant Client, but im now sure its in the directory.

this is my Dockerfile for reference:

    FROM composer:2.0 as vendor

COPY composer.json/ /app/composer.json
COPY docker/config/nginx.conf /app/nginx.conf

RUN composer install \
    --ignore-platform-reqs \
    --no-interaction \
    --no-plugins \
    --no-scripts \
    --no-ansi \
    --prefer-dist

FROM php:8.0-fpm-alpine3.13
LABEL  Maintainer="Christian Jay Bayno"

# Install packages
RUN apk --no-cache add php8 \
php8-fpm \
php8-pdo_mysql \
php8-json \
php8-openssl \
php8-curl \
php8-tokenizer \
php8-dom \
php8-dev \
php8-opcache \
nginx \
supervisor \
curl \
git \
tzdata \
g++ \
gcc \
make \
libaio-dev \
libnsl \
gcompat

RUN ln -s /usr/lib/libnsl.so.2 /usr/lib/libnsl.so.1

# Install Instaclient and PDO OCI
RUN mkdir -p /opt/oci

COPY ./docker/oracle/instantclient-basic-19.17.0.0.0.zip /opt/oci
COPY ./docker/oracle/instantclient-sdk-19.17.0.0.0.zip /opt/oci
COPY ./docker/oracle/pdo_oci.zip /opt/oci
RUN cd /opt/oci \
    && unzip instantclient-basic-19.17.0.0.0.zip \
    && unzip instantclient-sdk-19.17.0.0.0.zip \
    && cd instantclient_19_17/ \
    && ln -s /opt/oci/instantclient_19_17/libclntsh.so.19.1 libclntsh.so \
    && ln -s /opt/oci/instantclient_19_17/libocci.so.19.1 libocci.so \
    && ls \
    && cd ../ \
    && unzip pdo_oci.zip \
    && cd pdo_oci \
    && phpize \
    && ./configure --with-pdo-oci=shared,instantclient,/opt/oci/instantclient_19_17 \
    && make \
    && make install \
    && echo "extension=pdo_oci.so" >> /etc/php8/conf.d/pdo_oci.ini \
    && cd /opt/oci \
    && rm *.zip

# Configure Timezone
ENV TZ Asia/Manila

# Configure nginx
COPY docker/config/nginx.conf /etc/nginx/nginx.conf

# Configure PHP-FPM
  COPY docker/config/fpm-pool.conf /etc/php8/php-fpm.d/www.conf
  COPY docker/config/php.ini /etc/php8/conf.d/app.ini

# Configure supervisord
COPY docker/config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf

# Make sure files/folders needed by the processes are accessable when they run under the nobody user
RUN chown -R nobody.nobody /run && \
  chown -R nobody.nobody /var/lib/nginx && \
  chown -R nobody.nobody /var/log/nginx

# Set up document root
RUN mkdir -p /var/www/html

# Switch to use a non-root user from here on
USER nobody

# Add application
WORKDIR /var/www/html
COPY --chown=nobody . /var/www/html/
COPY --chown=nobody --from=vendor /app/vendor/ /var/www/html/vendor/

# Expose the port nginx is reachable on
EXPOSE 8085

# Let supervisord start nginx & php-fpm
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]

# Configure a healthcheck to validate that everything is up&running
HEALTHCHECK --timeout=10s CMD curl --silent --fail http://127.0.0.1:8085/fpm-ping


问:
Combination in java
I tried to make a combination program but I got wrong result in big numbers, why?

```<code>import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        System.out.print("Enter element number: ");
        int n = scanner.nextInt();
        System.out.print("selection number: ");
        int r = scanner.nextInt();

        int minus = n - r;
        long nFactorial = 1;
        long rFactorial = 1;
        long minusFactorial = 1;

        for(int i = 1; i <= n; i++) {
            nFactorial = nFactorial * i;
        }
        for(int i = 1; i <= r; i++) {
            rFactorial = rFactorial * i;
        }
        for(int i = 1; i <= minus; i++) {
            minusFactorial = minusFactorial * i;
        }
        long comb = nFactorial / (rFactorial * minusFactorial);
        System.out.println("C(" + n + "," + r + ") combination: " + comb);
    }
}
</code>```

n number: 50

r number: 5

The wrong result: 0

Could you help me?

Title: Combination in java

Body:
I tried to make a combination program but I got wrong result in big numbers, why?

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        System.out.print("Enter element number: ");
        int n = scanner.nextInt();
        System.out.print("selection number: ");
        int r = scanner.nextInt();

        int minus = n - r;
        long nFactorial = 1;
        long rFactorial = 1;
        long minusFactorial = 1;

        for(int i = 1; i <= n; i++) {
            nFactorial = nFactorial * i;
        }
        for(int i = 1; i <= r; i++) {
            rFactorial = rFactorial * i;
        }
        for(int i = 1; i <= minus; i++) {
            minusFactorial = minusFactorial * i;
        }
        long comb = nFactorial / (rFactorial * minusFactorial);
        System.out.println("C(" + n + "," + r + ") combination: " + comb);
    }
}

n number: 50

r number: 5

The wrong result: 0

Could you help me?


问:
Nextjs13 'Link' Tag issue, Is there configuration required?
I just created a NextJS 13 default application by using the following command.

```<code>npx create-next-app@latest --experimental-app

<Link> is not working.
Unhandled Runtime Error
TypeError: Cannot read properties of undefined (reading 'call')
</code>```

What am I missing? I have not written any code except for

```<code> <>
    <h1 className='text-3xl font-bold underline'>
      Hello my friends
    </h1>

    <Link href='/'>Click Me</Link>
    <Image alt=''></Image>
    </>
</code>```

I maybe missing a step in configuration. No clue.

Body:
I just created a NextJS 13 default application by using the following command.

npx create-next-app@latest --experimental-app

<Link> is not working.
Unhandled Runtime Error
TypeError: Cannot read properties of undefined (reading 'call')

What am I missing? I have not written any code except for

 <>

      Hello my friends

    <Link href='/'>Click Me</Link>
    <Image alt=''></Image>
    </>

I maybe missing a step in configuration. No clue.


问:
Amazon CloudFront not compressing JS files
I have an Amazon CloudFront that initially was not compressing objects. I switched "Compress objects automatically" to "Yes" and invalidated the cache using /*. But still, the objects were not getting compressed. I followed https://stackoverflow.com/a/65423792/7760998 and updated my CORS policy on the S3 bucket and again invalidated the cache but no luck.

Below is the cURL response headers with the Accept-Encoding: gzip header

$ curl -sD - -o /dev/null -H 'Accept-Encoding: gzip' URL.js
HTTP/2 200
content-type: text/javascript
content-length: 2469622
vary: Accept-Encoding
date: Thu, 22 Dec 2022 08:42:57 GMT
cache-control: max-age=0
last-modified: Thu, 22 Dec 2022 07:00:40 GMT
etag: "6b5ba54f857aae09f214d3b6bb988cbc"
server: AmazonS3
x-cache: Miss from cloudfront
via: 1.1 3964202601822e49b477697ad1a0d7e8.cloudfront.net (CloudFront)
x-amz-cf-pop: DEL54-C1
x-amz-cf-id: 1PaR9jhxIgoP3nq8Ut5YDqrV7sQmK98KJRdjMyo3ff9UOTVATTxzKg==
```
<p>Below is the one without</p>
<pre class="lang-bash prettyprint-override"><code>$ curl -sD - -o /dev/null URL.js
HTTP/2 200
content-type: text/javascript
content-length: 2469622
vary: Accept-Encoding
date: Thu, 22 Dec 2022 08:44:30 GMT
cache-control: max-age=0
last-modified: Thu, 22 Dec 2022 07:00:40 GMT
etag: "6b5ba54f857aae09f214d3b6bb988cbc"
server: AmazonS3
x-cache: Miss from cloudfront
via: 1.1 13cacaf041f81d18c39777fbcdf7705c.cloudfront.net (CloudFront)
x-amz-cf-pop: DEL54-C1
x-amz-cf-id: cGqw2Fk7WAnNYn2HcbfkosZMHgAYE-gIZLtkviSjVhkthQI3oxr0ZQ==
</code>```

How can I enable GZIP compression on my JS files?

Solved edit: Thanks to the comment from @Ankush Jain, I was able to resolve the issue. This answer solved it.

Body:
I have an Amazon CloudFront that initially was not compressing objects. I switched "Compress objects automatically" to "Yes" and invalidated the cache using /*. But still, the objects were not getting compressed. I followed https://stackoverflow.com/a/65423792/7760998 and updated my CORS policy on the S3 bucket and again invalidated the cache but no luck.

Below is the cURL response headers with the Accept-Encoding: gzip header

$ curl -sD - -o /dev/null -H 'Accept-Encoding: gzip' URL.js
HTTP/2 200
content-type: text/javascript
content-length: 2469622
vary: Accept-Encoding
date: Thu, 22 Dec 2022 08:42:57 GMT
cache-control: max-age=0
last-modified: Thu, 22 Dec 2022 07:00:40 GMT
etag: "6b5ba54f857aae09f214d3b6bb988cbc"
server: AmazonS3
x-cache: Miss from cloudfront
via: 1.1 3964202601822e49b477697ad1a0d7e8.cloudfront.net (CloudFront)
x-amz-cf-pop: DEL54-C1
x-amz-cf-id: 1PaR9jhxIgoP3nq8Ut5YDqrV7sQmK98KJRdjMyo3ff9UOTVATTxzKg==

Below is the one without

$ curl -sD - -o /dev/null URL.js
HTTP/2 200
content-type: text/javascript
content-length: 2469622
vary: Accept-Encoding
date: Thu, 22 Dec 2022 08:44:30 GMT
cache-control: max-age=0
last-modified: Thu, 22 Dec 2022 07:00:40 GMT
etag: "6b5ba54f857aae09f214d3b6bb988cbc"
server: AmazonS3
x-cache: Miss from cloudfront
via: 1.1 13cacaf041f81d18c39777fbcdf7705c.cloudfront.net (CloudFront)
x-amz-cf-pop: DEL54-C1
x-amz-cf-id: cGqw2Fk7WAnNYn2HcbfkosZMHgAYE-gIZLtkviSjVhkthQI3oxr0ZQ==

How can I enable GZIP compression on my JS files?

Solved edit: Thanks to the comment from @Ankush Jain, I was able to resolve the issue. This answer solved it.


问:
After Effects: How to export H.264 / MP4 / 4:2:0
I need to export an animation from after effects as a H.264 mp4 with a chroma subsampling of 4:2:0. Media encoder is available. Both AE and ME do not seem to give me an option to adjust the chroma subsampling. I read that 4:2:0 should be default, but my exported files always get 'SD (6-1-6)'.</p>


问:
What's the behavior of std::future when libcpr::PostCallback got Timeout/ConnectionTimeout?
For certain reasons I'm trying to use libcpr::PostCallback to send requests, and a customized callback function to parse responses for later use.

Since libcpr::PostCallback use std::future as its return value, so I implemented a thread-safe list to store them, and a class to handle the whole list:

```<code>class FutureList {
 public:
  FutureList();
  ~FutureList();
  std::list<std::future<std::string>>::iterator Begin();
  std::list<std::future<std::string>>::iterator End();

  void Erase(std::list<std::future<std::string>>::iterator& it);
  bool Empty();
  void PushBack(std::future<std::string>&& rvalue);

 private:
  std::mutex list_mtx_;
  std::list<std::future<std::string>> list_;
};

class FutureHandler {
 public:
  FutureHandler();
  ~FutureHandler();

  /*
    some other functions
  */

  void Handle();

 private:
  FutureList future_list_;
};
</code>```

Here's the main logic that how I process the whole list.

```<code>void FutureHandler::Handle() {
  std::future_status status;
  auto it = future_list_.Begin();

  while (it != future_list_.End()) {
    status = it->wait_for(std::chrono::milliseconds(1));
    if (status != std::future_status::ready) {
      ++it;
      continue;
    }

    // Since the response would be parsed by callback function,
    // we only print the plaintext to check if the response is correct.
    // std::cout << "http responses: " << it->get() << std::endl;

    future_list_.Erase(it);
  }
  return;
}
</code>```

Currently I've got correct http responses if the http server is alive, but I'm wondering that what would happened if http server goes down for some reason (which cause libcpr::Timeout/ConnectionTimeout), and what's the behavior of std::future in such situation?

Body:
For certain reasons I'm trying to use libcpr::PostCallback to send requests, and a customized callback function to parse responses for later use.

Since libcpr::PostCallback use std::future as its return value, so I implemented a thread-safe list to store them, and a class to handle the whole list:

class FutureList {
 public:
  FutureList();
  ~FutureList();
  std::list<std::future<std::string>>::iterator Begin();
  std::list<std::future<std::string>>::iterator End();

  void Erase(std::list<std::future<std::string>>::iterator& it);
  bool Empty();
  void PushBack(std::future<std::string>&& rvalue);

 private:
  std::mutex list_mtx_;
  std::list<std::future<std::string>> list_;
};

class FutureHandler {
 public:
  FutureHandler();
  ~FutureHandler();

  /*
    some other functions
  */

  void Handle();

 private:
  FutureList future_list_;
};

Here's the main logic that how I process the whole list.

void FutureHandler::Handle() {
  std::future_status status;
  auto it = future_list_.Begin();

  while (it != future_list_.End()) {
    status = it->wait_for(std::chrono::milliseconds(1));
    if (status != std::future_status::ready) {
      ++it;
      continue;
    }

    // Since the response would be parsed by callback function,
    // we only print the plaintext to check if the response is correct.
    // std::cout << "http responses: " << it->get() << std::endl;

    future_list_.Erase(it);
  }
  return;
}

Currently I've got correct http responses if the http server is alive, but I'm wondering that what would happened if http server goes down for some reason (which cause libcpr::Timeout/ConnectionTimeout), and what's the behavior of std::future in such situation?


问:
System.InvalidCastException: 'Specified cast is not valid.' on my GetString() argument
Hi as i go along with my code i got an error System.InvalidCastException: 'Specified cast is not valid.' of my GetString... What I want is that the Username Combobox should automatically list the registered account username and automatically shows the registered profile... I am using vb.net and ms access as database.... anybody knows how to go about and fix the code error??

//The error is on the line :

```<code>  ComboUsername.Items.Add(dr.GetString(3))
</code>```
```<code>Imports System.Data.OleDb
Imports System.IO

Public Class Form1

    Dim conn As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\ADMIN\source\repos\TrooTeaFinal\Database\Loginform.accdb")
    Dim dr As OleDbDataReader

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        usercomboload()
    End Sub

    Sub usercomboload()
        conn.Open()
        ComboUsername.Items.Clear()
        Dim cmd As New OleDb.OleDbCommand("SELECT * FROM member", conn)
        dr = cmd.ExecuteReader
        While dr.Read
            ComboUsername.Items.Add(dr.GetString(3))
        End While
        dr.Close()

        conn.Close()
    End Sub

    Private Sub ChkBoxShowpass_CheckedChanged(sender As Object, e As EventArgs) Handles ChkBoxShowpass.CheckedChanged
        If ChkBoxShowpass.Checked = True Then
            TxtPassword.UseSystemPasswordChar = True
        Else
            TxtPassword.UseSystemPasswordChar = False
        End If
    End Sub

    Private Sub BtnRegister_Click(sender As Object, e As EventArgs) Handles BtnRegister.Click
        Me.Hide()
        Form2.Show()
    End Sub

End Class

</code>```

Body:
Hi as i go along with my code i got an error System.InvalidCastException: 'Specified cast is not valid.' of my GetString... What I want is that the Username Combobox should automatically list the registered account username and automatically shows the registered profile... I am using vb.net and ms access as database.... anybody knows how to go about and fix the code error??

//The error is on the line :

  ComboUsername.Items.Add(dr.GetString(3))

Imports System.Data.OleDb
Imports System.IO

Public Class Form1

    Dim conn As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\ADMIN\source\repos\TrooTeaFinal\Database\Loginform.accdb")
    Dim dr As OleDbDataReader

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        usercomboload()
    End Sub

    Sub usercomboload()
        conn.Open()
        ComboUsername.Items.Clear()
        Dim cmd As New OleDb.OleDbCommand("SELECT * FROM member", conn)
        dr = cmd.ExecuteReader
        While dr.Read
            ComboUsername.Items.Add(dr.GetString(3))
        End While
        dr.Close()

        conn.Close()
    End Sub

    Private Sub ChkBoxShowpass_CheckedChanged(sender As Object, e As EventArgs) Handles ChkBoxShowpass.CheckedChanged
        If ChkBoxShowpass.Checked = True Then
            TxtPassword.UseSystemPasswordChar = True
        Else
            TxtPassword.UseSystemPasswordChar = False
        End If
    End Sub

    Private Sub BtnRegister_Click(sender As Object, e As EventArgs) Handles BtnRegister.Click
        Me.Hide()
        Form2.Show()
    End Sub

End Class


问:
Opening a file with Pandas that is not a ".csv"
I'm beginner in Python, so sorry if my question is dumb (I didn't found answer online) and non native english speaker (so sorry for poor language).
To treat the results files from test benches I wish to open my files with pandas to make them dataframes.
My benches give two types of files :

".tsv" files that are basically csv with tabulation as separator

".lvm" that are similar to csv (sperator comma)
Here my code :

```<code>import FormChoixMachine
import FormEssais
import pandas as pd

Machine = FormChoixMachine.ChoixMachine()
Chemin_Liste = list(FormEssais.Chemin_Liste_Essais())
DossierEssais = Chemin_Liste[0]
ListeEssais = Chemin_Liste[1]

for Essai in range(len(ListeEssais)):
    if Machine != "Old_TE77":
        Chemin = DossierEssais + "\\" + ListeEssais[Essai] + ".tsv"
        Lecture_Fichier = pd.read_csv(Chemin, delimiter="\t")
    else:
        Chemin = DossierEssais + "\\" + ListeEssais[Essai] + ".lvm"
        Lecture_Fichier = pd.read_csv(Chemin, delimiter=",")
    print(Lecture_Fichier)
</code>```

Depending on the case I have following errors :

```<code>UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 453: invalid start byte
</code>```

or

```<code>FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Daddy\\Desktop\\Démo traitement auto\\Old TE-77\\MyFile.tsv'
</code>```

(I don't know why the "" are doubled...)
Errors occur on the lines

```<code>Lecture_Fichier = pd.read_csv(Chemin, delimiter="\t")
</code>```

or

```<code>Lecture_Fichier = pd.read_csv(Chemin, delimiter=",")
</code>```

Can you please help me to solve my issue ?

I tried to put a repr(Chemin) but it went worse (the "" were tripled)...
I looked for answers on internet without success

Thanks and regards,

Body:
I'm beginner in Python, so sorry if my question is dumb (I didn't found answer online) and non native english speaker (so sorry for poor language).
To treat the results files from test benches I wish to open my files with pandas to make them dataframes.
My benches give two types of files :

".tsv" files that are basically csv with tabulation as separator

".lvm" that are similar to csv (sperator comma)
Here my code :

import FormChoixMachine
import FormEssais
import pandas as pd

Machine = FormChoixMachine.ChoixMachine()
Chemin_Liste = list(FormEssais.Chemin_Liste_Essais())
DossierEssais = Chemin_Liste[0]
ListeEssais = Chemin_Liste[1]

for Essai in range(len(ListeEssais)):
    if Machine != "Old_TE77":
        Chemin = DossierEssais + "\\" + ListeEssais[Essai] + ".tsv"
        Lecture_Fichier = pd.read_csv(Chemin, delimiter="\t")
    else:
        Chemin = DossierEssais + "\\" + ListeEssais[Essai] + ".lvm"
        Lecture_Fichier = pd.read_csv(Chemin, delimiter=",")
    print(Lecture_Fichier)

Depending on the case I have following errors :

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 453: invalid start byte

or

FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Daddy\\Desktop\\Démo traitement auto\\Old TE-77\\MyFile.tsv'

(I don't know why the "" are doubled...)
Errors occur on the lines

Lecture_Fichier = pd.read_csv(Chemin, delimiter="\t")

or

Lecture_Fichier = pd.read_csv(Chemin, delimiter=",")

Can you please help me to solve my issue ?

I tried to put a repr(Chemin) but it went worse (the "" were tripled)...
I looked for answers on internet without success

Thanks and regards,


问:
Java 11 web application deployed in Tomcat 8.5 cause this error at runtime Caused by: java.lang.ClassNotFoundException: Document
I struggled for a week, I try to run my web application WAR file in Apache Tomcat 8.5 with Java 11 but gives the above error.

Can any one gives a solution ?

22-Dec-2022 10:11:40.237 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [C:\Program Files\Apache Software Foundation\Tomcat 8.5\webappssso\lm.war]
java.lang.IllegalStateException: Error starting child
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:757)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:727)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:695)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1016)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1903)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.apache.catalina.LifecycleException: Failed to start component StandardEngine[Catalina].StandardHost[localhost].StandardContext[/lm]]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:753)
... 9 more
Caused by: java.lang.NoClassDefFoundError: Document
at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3166)
at java.base/java.lang.Class.getDeclaredMethods(Class.java:2309)
at org.apache.catalina.util.Introspection.getDeclaredMethods(Introspection.java:133)
at org.apache.catalina.startup.WebAnnotationSet.loadMethodsAnnotation(WebAnnotationSet.java:285)
at org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:138)
at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:69)
at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:328)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:782)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5130)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
... 10 more
Caused by: java.lang.ClassNotFoundException: Document
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1420)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1228)
... 23 more
```


问:
use a useContext, and the map method to condition a result from two firebase tables in the index.js
i have three tables in firebase, lawyer, clients and file.
I want to use the useContext to show all the files where the client's email and the client's mail in the file(dossier) match under the following logic.

```<code>   {expediente.mailClient === client.mail ? (
        <>
          Expediente: {expediente.exp}
          <h1>Cliente: {client.client}</h1>
          <h1>CI: {client.ci}</h1>
          <h1>Estatus: {expediente.status}</h1>
        </>
      ) : (
        "null"
      )}
</code>```

The code show all files(dossier) in the landing page, however I don't know how to use the map method over two tables (file, customers) or if it is the most suitable for this task

index.js
`

```<code>export default function Home() {
  const { expediente, clientes } = useContext(AbgContext);

  return (
    <>
      <div className={styles.wrapper}>
        <Header />
        <Banner />
        <div className={styles.main}>
          <div className={styles.container}>
            <div className={styles.postsList}></div>
            <div className={styles.postsList}>
              {expediente.map((expediente) => (
                <Postcard
                  expediente={expediente.mailClient}
                  key={expediente.id}
                />
              ))}
            </div>
          </div>
        </div>
      </div>
    </>
  );
}
</code>```

and the component where I show the landing page of the client PostCard.js

```<code>useEffect(() => {
    const getAuthordata = async () => {
      setAuthorData(
        (await getDoc(doc(db, "expediente", expediente.data?.autor))).data()
      );
    };
    getAuthordata();
  }, [expediente]);

  return (
    <div>
        <Link href={`/post/${expediente.id}`}>
          <div className={styles.wrapper}>
            <div className={styles.post}>
              <div className={styles.abogadoContainer}>
                <Image
                  src={lugo}
                  className={styles.autorImg}
                  width={40}
                  height={40}
                  alt=""
                />

                <p className={styles.nombreAutor}>{expediente.data?.autor}</p>
                </div>

              <h1 className={styles.title}>{expediente.data?.exp}</h1>
           </div>
         </div>
        </div>
      </Link>

};

export default PostCard;

</code>```

`

I want to send through postCard.js the data of file "Expediente", and client "Cliente" from the method map in index.js and finally filter the data for the client in the landing page

Body:
i have three tables in firebase, lawyer, clients and file.
I want to use the useContext to show all the files where the client's email and the client's mail in the file(dossier) match under the following logic.

   {expediente.mailClient === client.mail ? (
        <>
          Expediente: {expediente.exp}

Cliente: {client.client}

CI: {client.ci}

Estatus: {expediente.status}

        </>
      ) : (
        "null"
      )}

The code show all files(dossier) in the landing page, however I don't know how to use the map method over two tables (file, customers) or if it is the most suitable for this task

index.js
`

export default function Home() {
  const { expediente, clientes } = useContext(AbgContext);

  return (
    <>

        <Banner />

              {expediente.map((expediente) => (
                <Postcard
                  expediente={expediente.mailClient}
                  key={expediente.id}
                />
              ))}

    </>
  );
}

and the component where I show the landing page of the client PostCard.js

useEffect(() => {
    const getAuthordata = async () => {
      setAuthorData(
        (await getDoc(doc(db, "expediente", expediente.data?.autor))).data()
      );
    };
    getAuthordata();
  }, [expediente]);

  return (

        <Link href={`/post/${expediente.id}`}>

                <Image
                  src={lugo}
                  className={styles.autorImg}
                  width={40}
                  height={40}
                  alt=""
                />

{expediente.data?.autor}

{expediente.data?.exp}

      </Link>

};

export default PostCard;

`

I want to send through postCard.js the data of file "Expediente", and client "Cliente" from the method map in index.js and finally filter the data for the client in the landing page


问:
Get webpack error after creating next.js app. How can I fix it?
I'm trying to create nextjs app with

```<code>npx create-next-app@latest
</code>```

on my hosting provider. After that I run

```<code>npm run dev
</code>```

The app seems to be started, but I get following errors:

testh3@vs828:/var/www/testh3/test.gsmcounters.com$ npm run dev

test.gsmcounters.com@0.1.0 dev
next dev

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
Watchpack Error (watcher): Error: EACCES: permission denied, watch '/var/www'
Watchpack Error (initial scan): Error: EACCES: permission denied, scandir '/var/                                                                                www'
Watchpack Error (watcher): Error: EACCES: permission denied, watch '/var/www'
Watchpack Error (initial scan): Error: EACCES: permission denied, scandir '/var/                                                                                www'
Watchpack Error (watcher): Error: EACCES: permission denied, watch '/var/www'
Watchpack Error (initial scan): Error: EACCES: permission denied, scandir '/var/                                                                                www'
Watchpack Error (watcher): Error: EACCES: permission denied, watch '/var/www'
Watchpack Error (initial scan): Error: EACCES: permission denied, scandir '/var/                                                                                www'
event - compiled client and server successfully in 1967 ms (165 modules)
wait  - compiling...
event - compiled successfully in 38 ms (132 modules)
wait  - compiling...
event - compiled successfully in 18 ms (33 modules)
 [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: Unable to snapshot resolve dependencies
 [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: Unable to snapshot resolve dependencies
wait  - compiling / (client and server)...
event - compiled client and server successfully in 1084 ms (194 modules)
 [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: Unable to snapshot resolve dependencies
 [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: Unable to snapshot resolve dependencies

It is unclear for me why webpack trying to look folders, that does not belonges to my app. How can I change that behaviour to fix error. Or maybe this error somehow connected to my provider's environment?

Body:
I'm trying to create nextjs app with

npx create-next-app@latest

on my hosting provider. After that I run

npm run dev

The app seems to be started, but I get following errors:

testh3@vs828:/var/www/testh3/test.gsmcounters.com$ npm run dev

test.gsmcounters.com@0.1.0 dev
next dev

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
Watchpack Error (watcher): Error: EACCES: permission denied, watch '/var/www'
Watchpack Error (initial scan): Error: EACCES: permission denied, scandir '/var/                                                                                www'
Watchpack Error (watcher): Error: EACCES: permission denied, watch '/var/www'
Watchpack Error (initial scan): Error: EACCES: permission denied, scandir '/var/                                                                                www'
Watchpack Error (watcher): Error: EACCES: permission denied, watch '/var/www'
Watchpack Error (initial scan): Error: EACCES: permission denied, scandir '/var/                                                                                www'
Watchpack Error (watcher): Error: EACCES: permission denied, watch '/var/www'
Watchpack Error (initial scan): Error: EACCES: permission denied, scandir '/var/                                                                                www'
event - compiled client and server successfully in 1967 ms (165 modules)
wait  - compiling...
event - compiled successfully in 38 ms (132 modules)
wait  - compiling...
event - compiled successfully in 18 ms (33 modules)
 [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: Unable to snapshot resolve dependencies
 [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: Unable to snapshot resolve dependencies
wait  - compiling / (client and server)...
event - compiled client and server successfully in 1084 ms (194 modules)
 [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: Unable to snapshot resolve dependencies
 [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: Unable to snapshot resolve dependencies

It is unclear for me why webpack trying to look folders, that does not belonges to my app. How can I change that behaviour to fix error. Or maybe this error somehow connected to my provider's environment?


问:
Call a variable inside the nested expression in github actions
I am trying to call the variable like this:

with:

```<code>tags: ${{ inputs.push_tag_to_release && 'op/post:'[env.tag] ||  'op/post:${{ env.tag }}' }}
</code>```

where,
env.tag = 0.13 (value)

but both the ways [env.tag] or ${{ env.tag }} are showing as incorrect/not-supported.

I tried like this,

```<code>tags: ${{ inputs.push_tag_to_release && 'op/post:'[env.tag] ||  'op/post:${{ env.tag }}' }}
</code>```

and the format function as well:

```<code>tags: ${{ inputs.push_tag_to_release && 'op/post:format({0},env.tag)' ||  'op/post:${{ env.tag }}' }}
</code>```

but not working in any way.

Body:
I am trying to call the variable like this:

with:

tags: ${{ inputs.push_tag_to_release && 'op/post:'[env.tag] ||  'op/post:${{ env.tag }}' }}

where,
env.tag = 0.13 (value)

but both the ways [env.tag] or ${{ env.tag }} are showing as incorrect/not-supported.

I tried like this,

tags: ${{ inputs.push_tag_to_release && 'op/post:'[env.tag] ||  'op/post:${{ env.tag }}' }}

and the format function as well:

tags: ${{ inputs.push_tag_to_release && 'op/post:format({0},env.tag)' ||  'op/post:${{ env.tag }}' }}

but not working in any way.


问:
How to abort all promises in angular $q.all when event fired
i trying to abort all promises in $q.all method when some event fired.
this is my code:

```<code>let apiCallsArray: IPromise<any>[] = [
    this.restangular.one('/aTypes').get(),
    this.restangular.one('/boTypes').get(),
    this.restangular.one('/coTypes').get()

];
this.$q.all(apiCallsArray).then((responseArray) => {
    console.log(responseArray);
});

this.EventListenerService.registerObserverCallback(
    EVENTS.ON_NAVIGATE,
    () => {
        ...abort all api calls...
    }
);
</code>```

i tried with $q.defer but not helped.

what can i do?

Body:
i trying to abort all promises in $q.all method when some event fired.
this is my code:

let apiCallsArray: IPromise<any>[] = [
    this.restangular.one('/aTypes').get(),
    this.restangular.one('/boTypes').get(),
    this.restangular.one('/coTypes').get()

];
this.$q.all(apiCallsArray).then((responseArray) => {
    console.log(responseArray);
});

this.EventListenerService.registerObserverCallback(
    EVENTS.ON_NAVIGATE,
    () => {
        ...abort all api calls...
    }
);

i tried with $q.defer but not helped.

what can i do?


问:
VSCode Cloud Code - breakpoints are pointing unexpected file path
I am trying to debug remotely a .NET Core pod on GKE.

Everything work fine, but after starting debugging, breakpoints point different file path from the original source.

Before debugging:

Breakpoint is shown, and both its path and path of source code are same.

While debugging:

But after starts, breakpoint(red dot) disappears, and its path is changed into \src\WebApplication1\Controllers\.

My launch.json:

```<code>{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Attach to Kubernetes Pod (.NET Core)",
            "type": "cloudcode.kubernetes",
            "request": "attach",
            "language": "NETCore",
            "podSelector": {
                "type": "webapp"
            },
            "localRoot": "${workspaceFolder}",
            "remoteRoot": "/app"
        }
    ]
}
</code>```

Body:
I am trying to debug remotely a .NET Core pod on GKE.

Everything work fine, but after starting debugging, breakpoints point different file path from the original source.

Before debugging:

Breakpoint is shown, and both its path and path of source code are same.

While debugging:

But after starts, breakpoint(red dot) disappears, and its path is changed into \src\WebApplication1\Controllers\.

My launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Attach to Kubernetes Pod (.NET Core)",
            "type": "cloudcode.kubernetes",
            "request": "attach",
            "language": "NETCore",
            "podSelector": {
                "type": "webapp"
            },
            "localRoot": "${workspaceFolder}",
            "remoteRoot": "/app"
        }
    ]
}


问:
Trying to access array offset on value of type null
I'm getting a error message from my laravel program that it tries to access an array offset on value of type null while i was trying to code an foreach loop.

i was coding a foreach loop for an absention dashboard that will run trough a row in the database called aanwezigheid (Dutch Language) then i got the error message Trying to access array offset on value of type null i have tried to update composer.json and adding this line

```<code>$len = isset($cOTLdata['char_data']) ? count($cOTLdata['char_data']) : 0;
</code>```

into my code that if found here on stack overflow.
i know that the error comes from the line $aanwezigheid = $row['aanwezigheid'];

My Code:

```<code><?php
    require "dbconnect.php";

    $sql = "SELECT * FROM medewerkers LEFT JOIN aanwezigheid ON medewerkers.ID=aanwezigheid.ID;";
    if($result = $conn-> query($sql)){
        while($row = $result->fetch_assoc()) {
            echo "<tr><td>";
            echo $row['voornaam']." ".$row['achternaam'];
            echo "</td></tr>";
        }
        $aanwezigheid = $row['aanwezigheid'];
        $aanw[] = $aanwezigheid;
        foreach($aanw as $aanwezigheid){
            if($aanwezigheid == 1){
                echo '<img src="image/kruismark.png">"';
            }elseif($aanwezigheid == 0){
                echo '<img src="image/Checkmark.png">"';
            }
        }
    }
        ?>
</code>```

Body:
I'm getting a error message from my laravel program that it tries to access an array offset on value of type null while i was trying to code an foreach loop.

i was coding a foreach loop for an absention dashboard that will run trough a row in the database called aanwezigheid (Dutch Language) then i got the error message Trying to access array offset on value of type null i have tried to update composer.json and adding this line

$len = isset($cOTLdata['char_data']) ? count($cOTLdata['char_data']) : 0;

into my code that if found here on stack overflow.
i know that the error comes from the line $aanwezigheid = $row['aanwezigheid'];

My Code:

<?php
    require "dbconnect.php";

    $sql = "SELECT * FROM medewerkers LEFT JOIN aanwezigheid ON medewerkers.ID=aanwezigheid.ID;";
    if($result = $conn-> query($sql)){
        while($row = $result->fetch_assoc()) {
            echo "
";
            echo $row['voornaam']." ".$row['achternaam'];
            echo "
";
        }
        $aanwezigheid = $row['aanwezigheid'];
        $aanw[] = $aanwezigheid;
        foreach($aanw as $aanwezigheid){
            if($aanwezigheid == 1){
                echo '"';
            }elseif($aanwezigheid == 0){
                echo '"';
            }
        }
    }
        ?>


问:
Django get wrong value from json.loads in POST request
I need to pass a user-input geojson with request to further process the information. The data comes from a textfile and then passed to the views.py in django with a POST request. Before passing to the view I checked the value of the string and that appears to be correct. After passing that to the view, I made a print check and some values inside the JSON are changed in string like:

"{"id": "13871", "type":SOH@ "Feature", "properties": {"lanes": 0, "highway": "pedestrian" etc....."
or
"{"id":"86","type":"FeatureSOHVT","properties":etc......."

The bold strings sometimes appear even inside the values of the dictionary.

The js file:

```<code>        $.ajax({
            type: 'POST',
            url: $('#confImp').data('url'),
            dataType: 'json',
            data: {'streetWeb': JSON.stringify(street_web), 'int_points': JSON.stringify(int_points_loaded), 'csrfmiddlewaretoken': csrftoken,},
            success: function(res){blablabla}
</code>```

The django views.py:

```<code>        elif 'streetWeb' in request.POST:
            print(json.loads(request.POST.get('streetWeb')))
            request.session['Working_area_final'] = json.loads(request.POST.get('streetWeb'))
            print(json.loads(request.POST.get('int_points')))
            request.session['int_points'] = json.loads(request.POST.get('int_points'))
            return JsonResponse({'Risposta': 'Done'})
</code>```

Body:
I need to pass a user-input geojson with request to further process the information. The data comes from a textfile and then passed to the views.py in django with a POST request. Before passing to the view I checked the value of the string and that appears to be correct. After passing that to the view, I made a print check and some values inside the JSON are changed in string like:

"{"id": "13871", "type":SOH@ "Feature", "properties": {"lanes": 0, "highway": "pedestrian" etc....."
or
"{"id":"86","type":"FeatureSOHVT","properties":etc......."

The bold strings sometimes appear even inside the values of the dictionary.

The js file:

        $.ajax({
            type: 'POST',
            url: $('#confImp').data('url'),
            dataType: 'json',
            data: {'streetWeb': JSON.stringify(street_web), 'int_points': JSON.stringify(int_points_loaded), 'csrfmiddlewaretoken': csrftoken,},
            success: function(res){blablabla}

The django views.py:

        elif 'streetWeb' in request.POST:
            print(json.loads(request.POST.get('streetWeb')))
            request.session['Working_area_final'] = json.loads(request.POST.get('streetWeb'))
            print(json.loads(request.POST.get('int_points')))
            request.session['int_points'] = json.loads(request.POST.get('int_points'))
            return JsonResponse({'Risposta': 'Done'})


问:
Can't run .exe file on another computer
I'm trying to figure out why my application will not run on another windows computer. I have tried to run the exe file on multiple other computers where it starts the application up fine, however, when running it on a Teguar running windows 10, the application throws an exception.

It seems like the problem accurs when I try to use Open3D, since when I don't include Open3D the application can run on the computer. However, the program can still run on all other computers with Open3D included just not on the Teguar.

I have tried to run the exe file through "SimpleProgramDebugger" and here I can see what files are called. This is the files from my own computer where the program runs fine.

Here is an image of the files from the Teguar:

And lastly here is the message on I am given when simply running the application:

Hopefully someone can help with this frustrating problem :)

Title: Can't run .exe file on another computer


问:
modal not working correctly in native base

I want when i click the button, opening the modal. But modal is not opening correctly. And it is not readable.

Here is in my modal code :

```<code>
  <Modal
                        isOpen={showModal}
                    >
                        <Modal.Content top="-60" maxWidth={400} height={300}>
                            <Modal.CloseButton />
                            <Modal.Header> bilgiler</Modal.Header>
                            <Modal.Body>
                                <Text>09.08.2001</Text>
                                {/* <Select
                                    minWidth="200"
                                    accessibilityLabel="Choose Service"
                                    placeholder="Son ölçüm tarihi seçiniz.."
                                    _selectedItem={{
                                        bg: "teal.600",
                                        endIcon: <CheckIcon size="5" />
                                    }} mt={1}
                                >

                                </Select>*/}
                                <Text>Adi ve soyadi</Text>
                            </Modal.Body>
                            <Modal.Footer>
                                <Button.Group space={2}>
                                    <Button variant="ghost" colorScheme="blueGray" onPress={() => setShowModal(false)} >
                                        Çıkış
                                    </Button>
                                    <Button onPress={() => setShowModal(false)} >
                                        Kaydet
                                    </Button>
                                </Button.Group>
                            </Modal.Footer>
                        </Modal.Content>
                    </Modal>
</code>```

and pressable code :

```<code><Box flex="1" >

                                        <Pressable left={290} top="-35" onPress={() => setShowModal(true)}>
                                            <Image size={7} source={require('../assets/clock.png')} />
                                        </Pressable>

                                    </Box>
</code>```

I try to change pressable but it not working

Body:
I want when i click the button, opening the modal. But modal is not opening correctly. And it is not readable.

Here is in my modal code :

  <Modal
                        isOpen={showModal}
                    >
                        <Modal.Content top="-60" maxWidth={400} height={300}>
                            <Modal.CloseButton />
                            <Modal.Header> bilgiler</Modal.Header>
                            <Modal.Body>
                                <Text>09.08.2001</Text>
                                {/* <Select
                                    minWidth="200"
                                    accessibilityLabel="Choose Service"
                                    placeholder="Son ölçüm tarihi seçiniz.."
                                    _selectedItem={{
                                        bg: "teal.600",
                                        endIcon: <CheckIcon size="5" />
                                    }} mt={1}
                                >

                                </Select>*/}
                                <Text>Adi ve soyadi</Text>
                            </Modal.Body>
                            <Modal.Footer>
                                <Button.Group space={2}>
                                    <Button variant="ghost" colorScheme="blueGray" onPress={() => setShowModal(false)} >
                                        Çıkış
                                    </Button>
                                    <Button onPress={() => setShowModal(false)} >
                                        Kaydet
                                    </Button>
                                </Button.Group>
                            </Modal.Footer>
                        </Modal.Content>
                    </Modal>

and pressable code :

<Box flex="1" >

                                        <Pressable left={290} top="-35" onPress={() => setShowModal(true)}>
                                            <Image size={7} source={require('../assets/clock.png')} />
                                        </Pressable>

                                    </Box>

I try to change pressable but it not working


问:
How to solve updating a list of contacts depending on user input, 429 error (too many requests)
We have a react frontend, that has a name field, a user will write in the field and a list with search results of their contacts shows up, each time the user writes a character the search is updated. Right now it sends a request with a search query to the server each time a new letter is added in the field and this creates a whole bun ch of requests.

How would you solve this? send the whole list and the let the client to the search? I would prefer not to. Maybe limit the requests in some way? I assume this must be something that every search engine has to handle some way?


问:
Odoo14 tag tree can customize 2 rows of headers?
As the title says, I want to know if the tag tree can be rendered. Can you have this kind of information?

If yes, please show me how to write the code. thank you very much

This is my sample code.

```<code><page name="test_header" string="test header">
    <tree string="My Tree">
        <field name="field1"/>
        <field name="field2"/>
    </tree>
</page>
</code>```

Body:
As the title says, I want to know if the tag tree can be rendered. Can you have this kind of information?

If yes, please show me how to write the code. thank you very much

This is my sample code.

<page name="test_header" string="test header">
    <tree string="My Tree">
        <field name="field1"/>
        <field name="field2"/>
    </tree>
</page>


问:
Reattach plugin to different flutter engine
I have 2 flutter engines (2 activities which inherit from flutter activity) and when second is created and destroyed then my plugin still send data to second engine which is actually destroyed. I get:

```<code>Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++
</code>```

How to reattach plugin to my first activity?

Body:
I have 2 flutter engines (2 activities which inherit from flutter activity) and when second is created and destroyed then my plugin still send data to second engine which is actually destroyed. I get:

Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++

How to reattach plugin to my first activity?


问:
How can I get `stdout` back in a running cell of a reloaded Jupyter notebook?
I run a Jupyter notebook.  One cell contains a control loop of a CPU/memory intensive FEniCS computations.  The loop uses print(i) as a progress indicator (where i is the iteration count).  As there have been other notebooks running in parallel, swapping happened and the frontend of the notebook has been reloaded. That left me with:

the kernel process running (I can see it in the htop output),

the kernel is busy (I requested to execute another cell and I am still waiting, the cell is marked [*]),

the stdio output of the cell is frozen as it has been somewhen before the reloading (37%),

the cell is marked as neither executed nor running ([ ]),

the notebook favicon is "busy" (a hourglass),

the kernel ignoring (?) interrupt requests - it does not stop when I click the stop button (but I am used to such behaviour when I use FEniCS).

From experience I know, that either:

the cell is actually running, the state is there, and I can access it will be accessible after the execution is finished,

the cell has hanged (e.g. kernel is deadlocked performing some kind of busy waiting or so, IDK).

I have interrupted the kernel (with either Jupyter notebook frontend or kill -2 - I had tried both).  The cell was actually running and the control loop was at 98% (no data lost though).  But I still want to know whether there is any way I can get access to stdout stream in cases like this (without interrupting the execution unless it can be resumed exactly where it was interrupted).


问:
Pandas: Problems with dropping values from dataframe with MultiIndex by condition to index
I have problems with dropping values from dataframe with MultiIndex in Python, Pandas. I want to set condition to one of the indexes. However, in the multtindex, df.index.levels[0] prints shorter list of indexes than there really are (only unique values, not values for each row).

```<code>import pandas as pd

index = [int(a//3) for a in list(range(0, 6, 1))]
index2 = list(range(0, 6, 1))
val = list(range(100, 106, 1))

df = pd.DataFrame({'col1': index, 'col2': index2, 'col3': val})
df.set_index(['col1', 'col2'], inplace=True)

print(df)

print(df[df.index.levels[0] == 0])

</code>```

I obtain error:

```<code>    raise ValueError(
ValueError: Item wrong length 2 instead of 6.
</code>```

I also thought about dropping this level from index by .reset_index(drop=False, inplace=True), selecting the correct values and going back with this col to index again - but it seems like a way around the problem...

Body:
I have problems with dropping values from dataframe with MultiIndex in Python, Pandas. I want to set condition to one of the indexes. However, in the multtindex, df.index.levels[0] prints shorter list of indexes than there really are (only unique values, not values for each row).

import pandas as pd

index = [int(a//3) for a in list(range(0, 6, 1))]
index2 = list(range(0, 6, 1))
val = list(range(100, 106, 1))

df = pd.DataFrame({'col1': index, 'col2': index2, 'col3': val})
df.set_index(['col1', 'col2'], inplace=True)

print(df)

print(df[df.index.levels[0] == 0])

I obtain error:

    raise ValueError(
ValueError: Item wrong length 2 instead of 6.

I also thought about dropping this level from index by .reset_index(drop=False, inplace=True), selecting the correct values and going back with this col to index again - but it seems like a way around the problem...


问:
Can we split TSDoc and TS file?
I am wondering, is there a way where we can clear the TS file by moving all TSdoc to separate typings file? Such as:

/lib/FileScanner.ts

```<code>/**
* Map FileID to FileInfoRecord
*/
function FileRecords(): Map<string, FileInfoType> {}
</code>```

and make it like:

/lib/FileScanner.ts

```<code>function FileRecords(): Map<string, FileInfoType> {}
</code>```

/types/FileScanner.d.ts

```<code>/**
* Map FileID to FileInfoRecord
*/
function FileRecords(): Map<string, FileInfoType>;
</code>```

Title: Can we split TSDoc and TS file?

Body:
I am wondering, is there a way where we can clear the TS file by moving all TSdoc to separate typings file? Such as:

/lib/FileScanner.ts

/**
* Map FileID to FileInfoRecord
*/
function FileRecords(): Map<string, FileInfoType> {}

and make it like:

/lib/FileScanner.ts

function FileRecords(): Map<string, FileInfoType> {}

/types/FileScanner.d.ts

/**
* Map FileID to FileInfoRecord
*/
function FileRecords(): Map<string, FileInfoType>;


问:
Keep getting errors with Tensorflow python

import tensorflow as tf
import numpy as np
import random

class ModelClass:
    """ used for getting all the juicy payloads and making them """

    def __init__(self, model=None):
        if not model:
            self.model = tf.keras.Sequential([tf.keras.layers.Embedding(input_dim=256, output_dim=128),
                                              tf.keras.layers.LSTM(128),
                                              tf.keras.layers.Dense(
                                                  1, activation='sigmoid')
                                              ])
            self.model.compile(optimizer='adam',loss='binary_crossentropy', metrics=['accuracy'])

        else:
            self.model = model
    def train(self):
            payload_list = open('./sqli_tester/all.txt', 'r').readlines()
            seeds = np.random.randint(0,high=2**32-1, size=(500, 1), dtype=np.int64)
            labels = [random.choice(payload_list) for _ in range(500)]
            dataset = tf.data.Dataset.from_tensor_slices((seeds, labels))
            train_dataset = dataset.take(80)
            val_dataset = dataset.skip(80)
            print(train_dataset.as_numpy_iterator())
            #inputs = tf.Tensor(1,(), dtype=tf.int64)
            #train_dataset = tf.constant(train_dataset).reshape(-1,1)
            history = self.model.fit(train_dataset, epochs=10, validation_data=val_dataset, validation_split=0.1)
            # self.model.save('model.h5')
            return self.model

if __name__ == '__main__':
    modelc = ModelClass()
    modelc.train()
```

I keep getting the error: Input 0 of layer "lstm" is incompatible with the layer: expected ndim=3, found ndim=2. Full shape received: (1, 128) can anyone help me please? I use the model for other code like predicting data. If it would be possible to get an explanation on why this is happening and how to fix it in the future that would be amazing. Thank you. The warning I get with tensorflow is WARNING:tensorflow:Model was constructed with shape (None, None) for input KerasTensor(type_spec=TensorSpec(shape=(None, None), dtype=tf.float32, name='embedding_input'), name='embedding_input', description="created by layer 'embedding_input'"), but it was called on an input with incompatible shape (1,).

Body:
import tensorflow as tf
import numpy as np
import random

class ModelClass:
    """ used for getting all the juicy payloads and making them """

    def __init__(self, model=None):
        if not model:
            self.model = tf.keras.Sequential([tf.keras.layers.Embedding(input_dim=256, output_dim=128),
                                              tf.keras.layers.LSTM(128),
                                              tf.keras.layers.Dense(
                                                  1, activation='sigmoid')
                                              ])
            self.model.compile(optimizer='adam',loss='binary_crossentropy', metrics=['accuracy'])

        else:
            self.model = model
    def train(self):
            payload_list = open('./sqli_tester/all.txt', 'r').readlines()
            seeds = np.random.randint(0,high=2**32-1, size=(500, 1), dtype=np.int64)
            labels = [random.choice(payload_list) for _ in range(500)]
            dataset = tf.data.Dataset.from_tensor_slices((seeds, labels))
            train_dataset = dataset.take(80)
            val_dataset = dataset.skip(80)
            print(train_dataset.as_numpy_iterator())
            #inputs = tf.Tensor(1,(), dtype=tf.int64)
            #train_dataset = tf.constant(train_dataset).reshape(-1,1)
            history = self.model.fit(train_dataset, epochs=10, validation_data=val_dataset, validation_split=0.1)
            # self.model.save('model.h5')
            return self.model

if __name__ == '__main__':
    modelc = ModelClass()
    modelc.train()

I keep getting the error: Input 0 of layer "lstm" is incompatible with the layer: expected ndim=3, found ndim=2. Full shape received: (1, 128) can anyone help me please? I use the model for other code like predicting data. If it would be possible to get an explanation on why this is happening and how to fix it in the future that would be amazing. Thank you. The warning I get with tensorflow is WARNING:tensorflow:Model was constructed with shape (None, None) for input KerasTensor(type_spec=TensorSpec(shape=(None, None), dtype=tf.float32, name='embedding_input'), name='embedding_input', description="created by layer 'embedding_input'"), but it was called on an input with incompatible shape (1,).


问:
Import a 3D model in native react
I am developing a mobile application with React Native and I would like to import a 3D model in my application. But I can't manage to import the model correctly.

Has anyone had this problem before and managed to solve it? If so, could you share how you did it?

Structure project

error message :

```<code>Unable to resolve "../../../assets/mesh/mesh.mtl" from "src/pages/Details/index.js"
</code>```

Thanks in advance for your help.

Title: Import a 3D model in native react

Body:
I am developing a mobile application with React Native and I would like to import a 3D model in my application. But I can't manage to import the model correctly.

Has anyone had this problem before and managed to solve it? If so, could you share how you did it?

Structure project

error message :

Unable to resolve "../../../assets/mesh/mesh.mtl" from "src/pages/Details/index.js"

Thanks in advance for your help.


问:
Android: show hint before click on SearchView
I need to display a hint in the search box before the user clicks on it, as well as to have the search icon on the right.

In order to place the icon on the right, I used android:layoutDirection="rtl", but there were problems with the hint. If I set app:iconifiedByDefault="false", then the hint always starts to be displayed, but my search icon moves to the left.

my searchView code:

```<code><androidx.appcompat.widget.SearchView
    android:id="@+id/searchView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"

    app:layout_constraintTop_toBottomOf="@id/toolbar"
    android:layout_marginTop="12dp"

    app:searchIcon="@drawable/ic_search_button"
    app:searchHintIcon="@null"

    android:background="@drawable/shape_stroke_yellow"
    app:queryBackground="@drawable/shape_stroke_yellow"

    android:layoutDirection="rtl"
    app:queryHint="@string/find_student"
    >
</androidx.appcompat.widget.SearchView>
</code>```

I saw Android 4.3: Not focus searchView not show hint , but this solution does not suit me, it is desirable to do everything through xml.

In other topics, the hint is solved everywhere by the line app:iconifiedByDefault="false", but then my icon is in the wrong place, so such solutions do not suit me either.

Body:
I need to display a hint in the search box before the user clicks on it, as well as to have the search icon on the right.

In order to place the icon on the right, I used android:layoutDirection="rtl", but there were problems with the hint. If I set app:iconifiedByDefault="false", then the hint always starts to be displayed, but my search icon moves to the left.

my searchView code:

<androidx.appcompat.widget.SearchView
    android:id="@+id/searchView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"

    app:layout_constraintTop_toBottomOf="@id/toolbar"
    android:layout_marginTop="12dp"

    app:searchIcon="@drawable/ic_search_button"
    app:searchHintIcon="@null"

    android:background="@drawable/shape_stroke_yellow"
    app:queryBackground="@drawable/shape_stroke_yellow"

    android:layoutDirection="rtl"
    app:queryHint="@string/find_student"
    >
</androidx.appcompat.widget.SearchView>

I saw Android 4.3: Not focus searchView not show hint , but this solution does not suit me, it is desirable to do everything through xml.

In other topics, the hint is solved everywhere by the line app:iconifiedByDefault="false", but then my icon is in the wrong place, so such solutions do not suit me either.


问:
Dockerfile and Kubernetes Cronjob for running Python Script
I am trying to build a docker image for python script and created CronJob and deployed it to Kubernetes, but i am not able to see any logs . if i deploy it to a pod i am able to see logs. Kindly let me know if i need to make any changes to Cronjob code. Below are the Docker file and Cronjob code

DockerFile:

```<code>from python:3.9-slim-buster

RUN apt-get update && apt-get install build-essential -y
RUN apt install libpq-dev python3-dev -y
RUN pip install --upgrade pip
COPY . /
RUN ls
RUN pip3 install -r ./requirements.txt
RUN mkdir /app/health
RUN chmod +x /app/scripts/main.py
WORKDIR /app
RUN ls
WORKDIR /app/scripts

RUN ls

ENTRYPOINT ["python", "/app/scripts/main.py"]
</code>```

Deployment[CronJob]

```<code>apiVersion: batch/v1
kind: CronJob
metadata:
  name: <cronjob name>
  namespace: <namespace>
spec:
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: <containername>
              image: <imagename>
              imagePullPolicy: Always
              command: ["/bin/sh"]
              args: [python, main.py]
          restartPolicy: OnFailure
  schedule: "59 6 * * *"
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 0
</code>```

Body:
I am trying to build a docker image for python script and created CronJob and deployed it to Kubernetes, but i am not able to see any logs . if i deploy it to a pod i am able to see logs. Kindly let me know if i need to make any changes to Cronjob code. Below are the Docker file and Cronjob code

DockerFile:

from python:3.9-slim-buster

RUN apt-get update && apt-get install build-essential -y
RUN apt install libpq-dev python3-dev -y
RUN pip install --upgrade pip
COPY . /
RUN ls
RUN pip3 install -r ./requirements.txt
RUN mkdir /app/health
RUN chmod +x /app/scripts/main.py
WORKDIR /app
RUN ls
WORKDIR /app/scripts

RUN ls

ENTRYPOINT ["python", "/app/scripts/main.py"]

Deployment[CronJob]

apiVersion: batch/v1
kind: CronJob
metadata:
  name: <cronjob name>
  namespace: <namespace>
spec:
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: <containername>
              image: <imagename>
              imagePullPolicy: Always
              command: ["/bin/sh"]
              args: [python, main.py]
          restartPolicy: OnFailure
  schedule: "59 6 * * *"
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 0


问:
Adapter Error get user by account, in nextjs
[The Error](https://i.stack.imgur.com/qXPhL.png)

schema.prisma

.env File

I want like when I sign in via google in the web app I am creating, I am wishing it to open the list of google accounts to sign In. But when I select the google account the error shows up...


问:
Convert gql-object back to string
I have a user.gql - file with some queries, mutations, inputs etc.
I get content of user.gql, using gql(), then filter an document.definition to find needed a query. After filter

document.definitions
    .filter(item => item.kind === 'OperationDefinition')
    .filter(item => item.operation === 'query')
```
<p>, one request object remains. smth like</p>
<pre class="lang-json prettyprint-override"><code>{
    kind: "OperationDefinition",
    name: {kind: 'Name', value: 'authenticate'},
    operation: "query",
    selectionSet: {...}
    variableDefinitions: [
        ...
    ]
}
</code>```

How to convert it back to string?
In the file this code is written like this

```<code>query authenticate($login: String!, $password: Password!) {
    user(login: $login, password: $password) {
        token,
        name,
        additional
    }
}
</code>```

Title: Convert gql-object back to string

Body:
I have a user.gql - file with some queries, mutations, inputs etc.
I get content of user.gql, using gql(), then filter an document.definition to find needed a query. After filter

document.definitions
    .filter(item => item.kind === 'OperationDefinition')
    .filter(item => item.operation === 'query')

, one request object remains. smth like

{
    kind: "OperationDefinition",
    name: {kind: 'Name', value: 'authenticate'},
    operation: "query",
    selectionSet: {...}
    variableDefinitions: [
        ...
    ]
}

How to convert it back to string?
In the file this code is written like this

query authenticate($login: String!, $password: Password!) {
    user(login: $login, password: $password) {
        token,
        name,
        additional
    }
}


问:
Wordpress Metabox - problem with display value in page template
I am adding a custom metabox for WordPress, I am able to save the value but unable to display the value in a page template.

Code in function.php

```<code>//Custome MetaBox
function custom_metabox() {

    add_meta_box("custom_metabox_01", "Custom Metabox", "custom_metabox_field", "page", "side", "default", null);

}
add_action("admin_init", "custom_metabox");

function custom_metabox_field() {

    wp_nonce_field(basename(__FILE__), "custom_metabox_01_nonce");

    global $post;

    $data = get_post_custom($post->ID);

    $val = isset($data['custom_input']) ? esc_attr($data['custom_input'][0]) : 'no value';

    echo '<input type="text" name="custom_input" id="custom_input" value="'.$val.'" />';

}

function save_detail() {

    global $post;

    if (!isset($_POST["custom_metabox_01_nonce"]) || !wp_verify_nonce($_POST["custom_metabox_01_nonce"], basename(__FILE__))){
        return $post->ID;
    }

    if(!current_user_can("edit_post", $post->ID)){
        return $post->ID;
    }

    if(defined("DOING_AUTOSAVE") && DOING_AUTOSAVE) {
        return $post->ID;
    }

    update_post_meta($post->ID, "custom_input", $_POST["custom_input"]);

}

add_action("save_post", "save_detail");

</code>```

Code in template-parts/content/content-page.php

```<code><div class="metabox">
   <?php
     $custom_post_type = get_post_meta($post->ID, 'custom_input', true);
     echo 'meta box value: ' . $custom_post_type;
   ?>
</div>

</code>```

Also please suggest to me how to implement the same only for "theme-template/default.php( Custom Page Template)"

Thanks in advance.

Body:
I am adding a custom metabox for WordPress, I am able to save the value but unable to display the value in a page template.

Code in function.php

//Custome MetaBox
function custom_metabox() {

    add_meta_box("custom_metabox_01", "Custom Metabox", "custom_metabox_field", "page", "side", "default", null);

}
add_action("admin_init", "custom_metabox");

function custom_metabox_field() {

    wp_nonce_field(basename(__FILE__), "custom_metabox_01_nonce");

    global $post;

    $data = get_post_custom($post->ID);

    $val = isset($data['custom_input']) ? esc_attr($data['custom_input'][0]) : 'no value';

    echo '<input type="text" name="custom_input" id="custom_input" value="'.$val.'" />';

}

function save_detail() {

    global $post;

    if (!isset($_POST["custom_metabox_01_nonce"]) || !wp_verify_nonce($_POST["custom_metabox_01_nonce"], basename(__FILE__))){
        return $post->ID;
    }

    if(!current_user_can("edit_post", $post->ID)){
        return $post->ID;
    }

    if(defined("DOING_AUTOSAVE") && DOING_AUTOSAVE) {
        return $post->ID;
    }

    update_post_meta($post->ID, "custom_input", $_POST["custom_input"]);

}

add_action("save_post", "save_detail");

Code in template-parts/content/content-page.php

   <?php
     $custom_post_type = get_post_meta($post->ID, 'custom_input', true);
     echo 'meta box value: ' . $custom_post_type;
   ?>

Also please suggest to me how to implement the same only for "theme-template/default.php( Custom Page Template)"

Thanks in advance.


问:
How to send Email Notification in HapiJS..?
I am working on a project written with HapiJS. the project is related to the interview process So,
I have to make email notification service in HapiJs whenever the interview will schedule.

when the interview will schedule the interviewer and the candidate will get an email notification.
How I can make this in HapiJs in the best way?

Please someone could help me in this scenario, how I have to proceed and make.
I am new to HapiJs.

Thanks in advance.


问:
Angular Build error coming after pushing the code on azure devops
```<code>Unknown word
2022-12-22T08:28:02.8010375Z   You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser
</code>```

How can I fix this error, this is giving an error after pushing the code on Azure DevOps

Need to fix this error

Body:
Unknown word
2022-12-22T08:28:02.8010375Z   You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser

How can I fix this error, this is giving an error after pushing the code on Azure DevOps

Need to fix this error


问:
Power bi embedded visuals performance. Slow loading
I am developing a webportal where I am using embedded power bi visuals, but they are loading really slow. I have 16 visuals in one pageview and it will take 10-25 seconds for them all to load.

Is this normal? Can I do anything to make it load faster? Is query caching useful? Are there any downsides by using query caching?

This is how I embed my visuals:

```<code>let embedConfiguration = {
                                   accessToken: "@ViewBag.Token",
                                   embedUrl: "@ViewBag.EmbedUrl",
                                   id: "@ViewBag.Id",
                                   pageName: pageName,
                                   tokenType: models.TokenType.Embed,
                                   type: 'visual',
                                   visualName: visualName,
                               };

                               // Get a reference to the HTML element that contains the embedded report.
                               let embedContainer = $('#'+embedContainerName)[0];

                               // Embed the visual.
                               let visual = await powerbi.embed(embedContainer, embedConfiguration);
</code>```

Since I have up to 16 visuals per page I add them all to a list, where I store the page name, visual name, and container name (id of the divs to embed the visual in).
Then I run the list through a for-loop that does the embedding as shown in the code above. This function is async, so it doesn't load 1 by 1 visual.
Are there other ways to do this that will make it load the visuals quicker?

Body:
I am developing a webportal where I am using embedded power bi visuals, but they are loading really slow. I have 16 visuals in one pageview and it will take 10-25 seconds for them all to load.

Is this normal? Can I do anything to make it load faster? Is query caching useful? Are there any downsides by using query caching?

This is how I embed my visuals:

let embedConfiguration = {
                                   accessToken: "@ViewBag.Token",
                                   embedUrl: "@ViewBag.EmbedUrl",
                                   id: "@ViewBag.Id",
                                   pageName: pageName,
                                   tokenType: models.TokenType.Embed,
                                   type: 'visual',
                                   visualName: visualName,
                               };

                               // Get a reference to the HTML element that contains the embedded report.
                               let embedContainer = $('#'+embedContainerName)[0];

                               // Embed the visual.
                               let visual = await powerbi.embed(embedContainer, embedConfiguration);

Since I have up to 16 visuals per page I add them all to a list, where I store the page name, visual name, and container name (id of the divs to embed the visual in).
Then I run the list through a for-loop that does the embedding as shown in the code above. This function is async, so it doesn't load 1 by 1 visual.
Are there other ways to do this that will make it load the visuals quicker?


问:
Passwordless sign in is not working in Firebase
Passwordless sign in is not working in Firebase. Email was sent successfully. But after clicking on the link provided in the email that link redirects to the website with api key, mode etc. But not signing in or saving the email in firebase.
Please help me!!

```<code> const handleContinueWithEmail = async (event: any) => {
    event.preventDefault();
    setSignInLoading(true);

    if (isSignInWithEmailLink(auth, window.location.href)) {
      setEmail(window.localStorage.getItem("emailForSignIn"));
      if (!email) {
        setEmail(window.prompt("Please provide your email for confirmation"));
      }
      signInWithEmailLink(auth, email, window.location.href)
        .then((result) => {
          window.localStorage.removeItem("emailForSignIn");
          // You can access the new user via result.user
          // Additional user info profile not available via:
          // result.additionalUserInfo.profile == null
          // You can check if the user is new or existing:
          // result.additionalUserInfo.isNewUser

          console.log(result.user);
        })
        .catch((error) => {
          // Some error occurred, you can inspect the code: error.code
          // Common errors could be invalid email and invalid or expired OTPs.
          console.log(error);
        });
    } else {
      sendSignInLinkToEmail(auth, email, {
        url: location.origin,
        handleCodeInApp: true,
      })
        .then(() => {
          window.localStorage.setItem("emailForSignIn", email);
          setSignInLoading(false);

          setShowSuccessToast(true);
          setSuccessText(
            "Sign in email has been sent! Check spam folder if not found."
          );

          setTimeout(function () {
            setShowSuccessToast(false);
          }, 6000);
        })
        .catch((error) => {
          const errorCode = error.code;
          const errorMessage = error.message;

          setSignInLoading(false);

          console.error(errorCode, errorMessage);
        });
    }
  };
</code>```

Successfully redirected with API key, mode, and more. But not sign in or saving email on Firebase.

I'm trying to add passwordless sign in using fireabase on my website. But it's not sign in or saving email to firebase user list. So, I need help to solve this problem.

Body:
Passwordless sign in is not working in Firebase. Email was sent successfully. But after clicking on the link provided in the email that link redirects to the website with api key, mode etc. But not signing in or saving the email in firebase.
Please help me!!

 const handleContinueWithEmail = async (event: any) => {
    event.preventDefault();
    setSignInLoading(true);

    if (isSignInWithEmailLink(auth, window.location.href)) {
      setEmail(window.localStorage.getItem("emailForSignIn"));
      if (!email) {
        setEmail(window.prompt("Please provide your email for confirmation"));
      }
      signInWithEmailLink(auth, email, window.location.href)
        .then((result) => {
          window.localStorage.removeItem("emailForSignIn");
          // You can access the new user via result.user
          // Additional user info profile not available via:
          // result.additionalUserInfo.profile == null
          // You can check if the user is new or existing:
          // result.additionalUserInfo.isNewUser

          console.log(result.user);
        })
        .catch((error) => {
          // Some error occurred, you can inspect the code: error.code
          // Common errors could be invalid email and invalid or expired OTPs.
          console.log(error);
        });
    } else {
      sendSignInLinkToEmail(auth, email, {
        url: location.origin,
        handleCodeInApp: true,
      })
        .then(() => {
          window.localStorage.setItem("emailForSignIn", email);
          setSignInLoading(false);

          setShowSuccessToast(true);
          setSuccessText(
            "Sign in email has been sent! Check spam folder if not found."
          );

          setTimeout(function () {
            setShowSuccessToast(false);
          }, 6000);
        })
        .catch((error) => {
          const errorCode = error.code;
          const errorMessage = error.message;

          setSignInLoading(false);

          console.error(errorCode, errorMessage);
        });
    }
  };

Successfully redirected with API key, mode, and more. But not sign in or saving email on Firebase.

I'm trying to add passwordless sign in using fireabase on my website. But it's not sign in or saving email to firebase user list. So, I need help to solve this problem.


问:
How to force Xcode 14 to compile GTK project in C
I would like to force Xcode 14 to compile my simple GTK2 project.

I couldn't find in Google how to add some flags to the compiler.

Could you please give some hints or screenshots?

This what I'd like to achieve is to Run the project using the "play" button or shortcut: CMD + R

I am using a following command to compile my project:

gcc-12 -Wall -g hello.c -o helloworld `pkg-config --cflags gtk+-2.0` `pkg-config --libs gtk+-2.0`

However it also works with clang compiler:

clang-g hello.c -o helloworld `pkg-config --cflags gtk+-2.0` `pkg-config --libs gtk+-2.0`

In addition to that, I'd like also to resolve the problem that Xcode can't see GTK library.

Thank you for any help.


问:
Concatenate DataFrames using Pandas library in Python
I'm trying to concatenate two DataFrames created with pandas.
The first one is obtained from a excel sheet (df) and the second is created after applying some operations with the data from "df".

The code that I've used for is:

pd.concat([df,df2], sort = False, ignore_index = True)
print(df)

The problem is that the output from the concatenation is the following:

```<code>           Bits  Binario
A     0 2 4 8 9      NaN
B     0 2 5 8 9      NaN
C   0 2 4 5 8 9      NaN
D     0 2 6 8 9      NaN
E   0 2 4 6 8 9      NaN
F   0 2 5 6 8 9      NaN
G  02 4 5 6 8 9      NaN
H     0 2 7 8 9      NaN
I   0 2 4 7 8 9      NaN
0           NaN    789.0
1           NaN    805.0
2           NaN    821.0
3           NaN    837.0
4           NaN    853.0
5           NaN    869.0
6           NaN    884.0
7           NaN    901.0
8           NaN    917.0
</code>```

What can I do? I look for the next output:

```<code>          Bits    Binario
A     0 2 4 8 9    789
B     0 2 5 8 9    805
C   0 2 4 5 8 9    821
D     0 2 6 8 9    837
E   0 2 4 6 8 9    853
F   0 2 5 6 8 9    869
G  02 4 5 6 8 9    884
H     0 2 7 8 9    901
I   0 2 4 7 8 9    917
</code>```

Thank you!

Body:
I'm trying to concatenate two DataFrames created with pandas.
The first one is obtained from a excel sheet (df) and the second is created after applying some operations with the data from "df".

The code that I've used for is:

pd.concat([df,df2], sort = False, ignore_index = True)
print(df)

The problem is that the output from the concatenation is the following:

           Bits  Binario
A     0 2 4 8 9      NaN
B     0 2 5 8 9      NaN
C   0 2 4 5 8 9      NaN
D     0 2 6 8 9      NaN
E   0 2 4 6 8 9      NaN
F   0 2 5 6 8 9      NaN
G  02 4 5 6 8 9      NaN
H     0 2 7 8 9      NaN
I   0 2 4 7 8 9      NaN
0           NaN    789.0
1           NaN    805.0
2           NaN    821.0
3           NaN    837.0
4           NaN    853.0
5           NaN    869.0
6           NaN    884.0
7           NaN    901.0
8           NaN    917.0

What can I do? I look for the next output:

          Bits    Binario
A     0 2 4 8 9    789
B     0 2 5 8 9    805
C   0 2 4 5 8 9    821
D     0 2 6 8 9    837
E   0 2 4 6 8 9    853
F   0 2 5 6 8 9    869
G  02 4 5 6 8 9    884
H     0 2 7 8 9    901
I   0 2 4 7 8 9    917

Thank you!


问:
Finding all the dictionary items from a list that matches with part of string within a list
I  have a list of dictionaries in the following format

```<code>name_list = [{"id":1, "name": "john emmanuel"},
             {"id":2, "name": "Nick Edison"},
             {"id":3, "name": "Sor"}]
</code>```

and a list of strings

```<code>string_list = ['i am happy',
               'what is john emmanuel doing',
               'how is nick taking care of everything',
               'the category is sorrow']
</code>```

I am trying to get the list of dictionary if the entire name in dictionary matches with that in the list of strings.

I tried this way:

```<code>name_found = []

for name in name_list:
    if name["name"].lower() in ' '.join(string_list):
        name_found.append(name)
</code>```

Obtained Output

```<code>[{'id': 1, 'name': 'john emmanuel'}, {'id': 3, 'name': 'Sor'}]
</code>```

Expected Output

```<code>[{'id': 1, 'name': 'john emmanuel'}]
</code>```

Body:
I  have a list of dictionaries in the following format

name_list = [{"id":1, "name": "john emmanuel"},
             {"id":2, "name": "Nick Edison"},
             {"id":3, "name": "Sor"}]

and a list of strings

string_list = ['i am happy',
               'what is john emmanuel doing',
               'how is nick taking care of everything',
               'the category is sorrow']

I am trying to get the list of dictionary if the entire name in dictionary matches with that in the list of strings.

I tried this way:

name_found = []

for name in name_list:
    if name["name"].lower() in ' '.join(string_list):
        name_found.append(name)

Obtained Output

[{'id': 1, 'name': 'john emmanuel'}, {'id': 3, 'name': 'Sor'}]

Expected Output

[{'id': 1, 'name': 'john emmanuel'}]


问:
what is the shortest way to remove duplicate data/entries from an Array in Javascipt?
i have an array,
const colors = ['red,'blue','green','yellow','red','blue'];

How should i remove all the duplicate colors in this array ?

I tried various methods , but those were very lengthy. i am expecting a straightforward solution for this problem.


问:
Laravel Application in Nginx Server downloads instead of showing PHP file
I'm aware of the duplicate questions and answers but none of them seem to be working for me.

OS: Ubuntu 20.04

Server: Nginx

Php version: 7.4

cgi.fix_pathinfo value is 0.

php-fpm is also running.

Content of the site config file:

```<code>server {
        listen 80;
        listen [::]:80;

        server_name  [site_url];

        root [site_root_directory];
        index index.php index.html;

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

        location / {

                try_files $uri $uri/ /index.php?$query_string;

        }

        location ~ \.php$ {

                try_files $uri =404;
                fastcgi_index index.php;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;

        }
}
</code>```

But whenever I enter the project directory in the browser, it downloads a file instead of loading the laravel app.

What am I missing here?

Body:
I'm aware of the duplicate questions and answers but none of them seem to be working for me.

OS: Ubuntu 20.04

Server: Nginx

Php version: 7.4

cgi.fix_pathinfo value is 0.

php-fpm is also running.

Content of the site config file:

server {
        listen 80;
        listen [::]:80;

        server_name  [site_url];

        root [site_root_directory];
        index index.php index.html;

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

        location / {

                try_files $uri $uri/ /index.php?$query_string;

        }

        location ~ \.php$ {

                try_files $uri =404;
                fastcgi_index index.php;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;

        }
}

But whenever I enter the project directory in the browser, it downloads a file instead of loading the laravel app.

What am I missing here?