问:
Converting Optim (and it's Objective Faction) to Rcpp
I have a section of code (see below) drawn from a larger model I am working on. This seems to be the bottle neck and I can see optim has been an issue for many others in the past. I know nothing about C++ and I can see this has been a recommended fix using the Rcpp package.

All my attempts to do this have failed so its time to bite the bullet and ask for some help and hopefully someone can help me. My optimisation code is as follows (with dummy data):

```<code>if(!require(TruncatedDistributions)){#_
  install.packages("TruncatedDistributions",
                   repos="http://R-Forge.R-project.org")
}#_____________________________________
library(TruncatedDistributions)

if(!require(Rcpp)){#___________________
  install.packages("Rcpp")
}#_____________________________________
library(Rcpp)

# Inputs

Starting_Values    <- 0.15
labour_wage_elast  <- 0.45
wage               <- 0.15
employment         <- 152000
alpha              <- 1.5
sd                 <- 1.24
rowNum             <- 1
labour_value       <- 2531
max_workers        <- 352000
salary_lower_bound <- 0.01
salary_upper_bound <- 2

CLASSICAL_OPTIMISE_WAGE_EMPLOYEES <- function(Starting_Values,
                                              labour_wage_elast,
                                              wage,
                                              employment,
                                              alpha,
                                              sd,
                                              rowNum,
                                              labour_value,
                                              max_workers,
                                              salary_lower_bound,
                                              salary_upper_bound) {#~~~~~~~~~~~~
  set.seed(rowNum)

  # QL (Quantity of Labour)

  QL = ((Starting_Values[1] - wage) / wage * labour_wage_elast ) * employment + employment

  QL = min(QL, max_workers)

  # Labour Value Function

  value = sum(rtgamma(seq(1:QL),
                      shape = alpha,
                      scale = (Starting_Values[1]  / sd ^ 2),
                      a = salary_lower_bound,
                      b = salary_upper_bound))

  difference  = abs(labour_value - value)

  return(difference)

}#~~~~~~~~~ END of CLASSICAL_OPTIMISE_WAGE_EMPLOYEES  ~~~~~~~~~~~~~~~~~~~~~~~~~~

Estimates   <- optim(Starting_Values, CLASSICAL_OPTIMISE_WAGE_EMPLOYEES,
                     labour_wage_elast  = labour_wage_elast,
                     wage               = wage,
                     employment         = employment,
                     alpha              = alpha,
                     sd                 = sd,
                     rowNum             = rowNum,
                     labour_value       = labour_value,
                     max_workers        = max_workers,
                     salary_lower_bound = salary_lower_bound,
                     salary_upper_bound = salary_upper_bound,
                     method = "L-BFGS-B", lower = 0.001,
                     upper = 2)

last_wage   <- wage

wage        <- Estimates$par[1]

employment  =  ((wage - last_wage) / last_wage) * labour_wage_elast * employment + employment
</code>```

Thank you very much in advance.

EDIT:

I have written the following:

Objective Function (which seems to work ok)

```<code>cppFunction('

//[[Rcpp::depends(Rcpp)]]
//[[Rcpp::depends(TruncatedDistributions)]]

  #include<cmath>
  #include<iostream>
  #include<Rcpp.h>
  #include<algorithm>
  #include<cstdlib>

  //[[Rcpp::export]]

 double classical_optimise_wage_employees(Rcpp::NumericVector Starting_Values,
                                         double labour_wage_elast,
                                         double wage,
                                         double employment,
                                         double alpha,
                                         double sd,
                                         int rowNum,
                                         double labour_value,
                                         double max_workers,
                                         double salary_lower_bound,
                                         double salary_upper_bound) {

  std::srand(rowNum);

  double QL = ((Starting_Values[0] - wage) / wage * labour_wage_elast ) * employment + employment;
  QL = std::min(QL, max_workers);

  Rcpp::Environment pkg = Rcpp::Environment::namespace_env("TruncatedDistributions");

  Rcpp::Function rtgamma_1 = Rcpp::as<Rcpp::Function>(pkg["rtgamma"]);

  NumericVector values = rtgamma_1(QL, alpha, Starting_Values[0] / pow(sd, 2) , salary_lower_bound, salary_upper_bound);

  double value = Rcpp::sum(values);

  return std::abs(labour_value - value);}')

# Calling it in R
classical_optimise_wage_employees(Starting_Values,
                                  labour_wage_elast,
                                  wage,
                                  employment,
                                  alpha,
                                  sd,
                                  rowNum,
                                  labour_value,
                                  max_workers,
                                  salary_lower_bound,
                                  salary_upper_bound)
</code>```

And a function to use the optim function (which for some reason is not working)

```<code>
cppFunction('

#include<Rcpp.h>

  //[[Rcpp::export]]

double solving_function(Rcpp::NumericVector Starting_Values,
                                         double labour_wage_elast,
                                         double wage,
                                         double employment,
                                         double alpha,
                                         double sd,
                                         int rowNum,
                                         double labour_value,
                                         double max_workers,
                                         double salary_lower_bound,
                                         double salary_upper_bound) {

            Rcpp::Environment stats("package:stats");
            Rcpp::Function optim = stats["optim"];

              Rcpp::List opt_results = optim(Rcpp::_["par"]    = Starting_Values,
                                             Rcpp::_["fn"]     = Rcpp::InternalFunction(&classical_optimise_wage_employees),
                                             Rcpp::_["method"] = "L-BFGS-B",
                                             Rcpp::_["labour_wage_elast"]  = labour_wage_elast,
                                             Rcpp::_["wage"]               = wage,
                                             Rcpp::_["employment"]         = employment,
                                             Rcpp::_["alpha"]              = alpha,
                                             Rcpp::_["sd"]                 = sd,
                                             Rcpp::_["rowNum"]             = rowNum,
                                             Rcpp::_["labour_value"]       = labour_value,
                                             Rcpp::_["max_workers"]        = max_workers,
                                             Rcpp::_["salary_lower_bound"] = salary_lower_bound,
                                             Rcpp::_["salary_upper_bound"] = salary_upper_bound,
                                             Rcpp::_["lower"] = 0.001,
                                             Rcpp::_["upper"] = 2);

            return opt_results[0];}')
</code>```

I hope these edits help others to solve this problem. Thank you.

Body:
I have a section of code (see below) drawn from a larger model I am working on. This seems to be the bottle neck and I can see optim has been an issue for many others in the past. I know nothing about C++ and I can see this has been a recommended fix using the Rcpp package.

All my attempts to do this have failed so its time to bite the bullet and ask for some help and hopefully someone can help me. My optimisation code is as follows (with dummy data):

if(!require(TruncatedDistributions)){#_
  install.packages("TruncatedDistributions",
                   repos="http://R-Forge.R-project.org")
}#_____________________________________
library(TruncatedDistributions)

if(!require(Rcpp)){#___________________
  install.packages("Rcpp")
}#_____________________________________
library(Rcpp)

# Inputs

Starting_Values    <- 0.15
labour_wage_elast  <- 0.45
wage               <- 0.15
employment         <- 152000
alpha              <- 1.5
sd                 <- 1.24
rowNum             <- 1
labour_value       <- 2531
max_workers        <- 352000
salary_lower_bound <- 0.01
salary_upper_bound <- 2

CLASSICAL_OPTIMISE_WAGE_EMPLOYEES <- function(Starting_Values,
                                              labour_wage_elast,
                                              wage,
                                              employment,
                                              alpha,
                                              sd,
                                              rowNum,
                                              labour_value,
                                              max_workers,
                                              salary_lower_bound,
                                              salary_upper_bound) {#~~~~~~~~~~~~
  set.seed(rowNum)

  # QL (Quantity of Labour)

  QL = ((Starting_Values[1] - wage) / wage * labour_wage_elast ) * employment + employment

  QL = min(QL, max_workers)

  # Labour Value Function

  value = sum(rtgamma(seq(1:QL),
                      shape = alpha,
                      scale = (Starting_Values[1]  / sd ^ 2),
                      a = salary_lower_bound,
                      b = salary_upper_bound))

  difference  = abs(labour_value - value)

  return(difference)

}#~~~~~~~~~ END of CLASSICAL_OPTIMISE_WAGE_EMPLOYEES  ~~~~~~~~~~~~~~~~~~~~~~~~~~

Estimates   <- optim(Starting_Values, CLASSICAL_OPTIMISE_WAGE_EMPLOYEES,
                     labour_wage_elast  = labour_wage_elast,
                     wage               = wage,
                     employment         = employment,
                     alpha              = alpha,
                     sd                 = sd,
                     rowNum             = rowNum,
                     labour_value       = labour_value,
                     max_workers        = max_workers,
                     salary_lower_bound = salary_lower_bound,
                     salary_upper_bound = salary_upper_bound,
                     method = "L-BFGS-B", lower = 0.001,
                     upper = 2)

last_wage   <- wage

wage        <- Estimates$par[1]

employment  =  ((wage - last_wage) / last_wage) * labour_wage_elast * employment + employment

Thank you very much in advance.

EDIT:

I have written the following:

Objective Function (which seems to work ok)

cppFunction('

//[[Rcpp::depends(Rcpp)]]
//[[Rcpp::depends(TruncatedDistributions)]]

  #include<cmath>
  #include<iostream>
  #include<Rcpp.h>
  #include<algorithm>
  #include<cstdlib>

  //[[Rcpp::export]]

 double classical_optimise_wage_employees(Rcpp::NumericVector Starting_Values,
                                         double labour_wage_elast,
                                         double wage,
                                         double employment,
                                         double alpha,
                                         double sd,
                                         int rowNum,
                                         double labour_value,
                                         double max_workers,
                                         double salary_lower_bound,
                                         double salary_upper_bound) {

  std::srand(rowNum);

  double QL = ((Starting_Values[0] - wage) / wage * labour_wage_elast ) * employment + employment;
  QL = std::min(QL, max_workers);

  Rcpp::Environment pkg = Rcpp::Environment::namespace_env("TruncatedDistributions");

  Rcpp::Function rtgamma_1 = Rcpp::as<Rcpp::Function>(pkg["rtgamma"]);

  NumericVector values = rtgamma_1(QL, alpha, Starting_Values[0] / pow(sd, 2) , salary_lower_bound, salary_upper_bound);

  double value = Rcpp::sum(values);

  return std::abs(labour_value - value);}')

# Calling it in R
classical_optimise_wage_employees(Starting_Values,
                                  labour_wage_elast,
                                  wage,
                                  employment,
                                  alpha,
                                  sd,
                                  rowNum,
                                  labour_value,
                                  max_workers,
                                  salary_lower_bound,
                                  salary_upper_bound)

And a function to use the optim function (which for some reason is not working)

cppFunction('

#include<Rcpp.h>

  //[[Rcpp::export]]

double solving_function(Rcpp::NumericVector Starting_Values,
                                         double labour_wage_elast,
                                         double wage,
                                         double employment,
                                         double alpha,
                                         double sd,
                                         int rowNum,
                                         double labour_value,
                                         double max_workers,
                                         double salary_lower_bound,
                                         double salary_upper_bound) {

            Rcpp::Environment stats("package:stats");
            Rcpp::Function optim = stats["optim"];

              Rcpp::List opt_results = optim(Rcpp::_["par"]    = Starting_Values,
                                             Rcpp::_["fn"]     = Rcpp::InternalFunction(&classical_optimise_wage_employees),
                                             Rcpp::_["method"] = "L-BFGS-B",
                                             Rcpp::_["labour_wage_elast"]  = labour_wage_elast,
                                             Rcpp::_["wage"]               = wage,
                                             Rcpp::_["employment"]         = employment,
                                             Rcpp::_["alpha"]              = alpha,
                                             Rcpp::_["sd"]                 = sd,
                                             Rcpp::_["rowNum"]             = rowNum,
                                             Rcpp::_["labour_value"]       = labour_value,
                                             Rcpp::_["max_workers"]        = max_workers,
                                             Rcpp::_["salary_lower_bound"] = salary_lower_bound,
                                             Rcpp::_["salary_upper_bound"] = salary_upper_bound,
                                             Rcpp::_["lower"] = 0.001,
                                             Rcpp::_["upper"] = 2);

            return opt_results[0];}')

I hope these edits help others to solve this problem. Thank you.


来源: stackexchange

问:
How shall we install kafka rest proxy for an existing kafka server or cluster
How shall we install kafka rest proxy for an existing kafka server or cluster. Also is there any apache kafka rest proxy as well with confluent kafka rest proxy ? Please let me know the steps or some clarity on how shall I go ahead to use both of them or either of them.

It is asking to download the whole confluent platform, please provide those steps as well for rest proxy.

ContentLicense: CC BY-SA 4.0


问:
Docker to see Containers in a Bulk
You see I have one container up;

but there are so many other containers showing up on cmd. I like to see just one row as Docker Desktop. Is there any way to do that ?

```<code>C:\Users\my.user\py projects\apache_airflow>docker container ls
CONTAINER ID   IMAGE                  COMMAND                  CREATED      STATUS                        PORTS                              NAMES
372a6f68dac6   apache/airflow:2.0.2   "/usr/bin/dumb-init …"   2 days ago   Up About a minute             8080/tcp                           apache_airflow_airflow-scheduler_1
7cf50002a4ea   apache/airflow:2.0.2   "/usr/bin/dumb-init …"   2 days ago   Up About a minute             8080/tcp                           apache_airflow_airflow-worker_1
1da18490999d   apache/airflow:2.0.2   "/usr/bin/dumb-init …"   2 days ago   Up About a minute (healthy)   0.0.0.0:8080->8080/tcp             apache_airflow_airflow-webserver_1
2dce2620e44d   apache/airflow:2.0.2   "/usr/bin/dumb-init …"   2 days ago   Up About a minute (healthy)   0.0.0.0:5555->5555/tcp, 8080/tcp   apache_airflow_flower_1
0a1287ef2fd9   postgres:13            "docker-entrypoint.s…"   2 days ago   Up About a minute (healthy)   5432/tcp                           apache_airflow_postgres_1
000587a7e7d0   redis:latest           "docker-entrypoint.s…"   2 days ago   Up About a minute (healthy)   0.0.0.0:6379->6379/tcp             apache_airflow_redis_1
</code>```

Title: Docker to see Containers in a Bulk

Body:
You see I have one container up;

but there are so many other containers showing up on cmd. I like to see just one row as Docker Desktop. Is there any way to do that ?

C:\Users\my.user\py projects\apache_airflow>docker container ls
CONTAINER ID   IMAGE                  COMMAND                  CREATED      STATUS                        PORTS                              NAMES
372a6f68dac6   apache/airflow:2.0.2   "/usr/bin/dumb-init …"   2 days ago   Up About a minute             8080/tcp                           apache_airflow_airflow-scheduler_1
7cf50002a4ea   apache/airflow:2.0.2   "/usr/bin/dumb-init …"   2 days ago   Up About a minute             8080/tcp                           apache_airflow_airflow-worker_1
1da18490999d   apache/airflow:2.0.2   "/usr/bin/dumb-init …"   2 days ago   Up About a minute (healthy)   0.0.0.0:8080->8080/tcp             apache_airflow_airflow-webserver_1
2dce2620e44d   apache/airflow:2.0.2   "/usr/bin/dumb-init …"   2 days ago   Up About a minute (healthy)   0.0.0.0:5555->5555/tcp, 8080/tcp   apache_airflow_flower_1
0a1287ef2fd9   postgres:13            "docker-entrypoint.s…"   2 days ago   Up About a minute (healthy)   5432/tcp                           apache_airflow_postgres_1
000587a7e7d0   redis:latest           "docker-entrypoint.s…"   2 days ago   Up About a minute (healthy)   0.0.0.0:6379->6379/tcp             apache_airflow_redis_1


问:
We are using Facebook login in out application need to know about data deletion policy
Need to know more about data deletion policy, In which case we need to provide data deletion option to user.</p>


问:
While expanding a table row, it changes the expand/collapse icons of all the rows altogether
On click of a table row icon of expand and collapse, it expands/collapses that particular row but it changes expand/collapse icon of all the rows. Kindly provide a solution so that it changes only one icon that is clicked.
Here is the sample code:</p>
```<code>component.ts:

  collapse:boolean =true;

==================
Html:
 <tr *ngFor="let user of users | listFilterCommon: searchTerm | tableFilterCommon: loantype|  slice: (page-1) * pageSize : page * pageSize; index as i">
                                            <!--<th scope="row">{{ (page -1) * pageSize + i + 1 }}</th>-->
                                            <td>
                                                {{ user.borrowerName }}
                                        <tr>
                                            <div class="collapse" id="collapse{{user.id}}">
                                                <p style="font-size:10px;">
                                                   ABC......
                                                </p>
                                            </div>
                                        </tr>
                                        </td>
                                        <td>{{ user.reviewName }}</td>
                                        <td>{{ user.exposure | number }}</td>
                                        <td>{{ user.loantype }}</td>

                                        <td><a (click)="collapse=!collapse" class="btn" data-bs-toggle="collapse" href="#collapse{{user.id}}"
                                                role="button" aria-expanded="false" aria-controls="collapse">
                                                <i  class="bi" [ngClass]="{'bi-plus': collapse, 'bi-dash': !collapse}"></i>

                                            </a>

</code>```

Body:
On click of a table row icon of expand and collapse, it expands/collapses that particular row but it changes expand/collapse icon of all the rows. Kindly provide a solution so that it changes only one icon that is clicked.
Here is the sample code:

component.ts:

  collapse:boolean =true;

==================
Html:

                                                {{ user.borrowerName }}

                                                   ABC......

                                        {{ user.reviewName }}
                                        {{ user.exposure | number }}
                                        {{ user.loantype }}


问:
flutter | Banner image click to open directly in Selected Product in Flutter App how to call api
I have create gridview in Product banner image in app home page
I need to click to open directly in Selected Product how to call api ...

Click to Open directly in Selected Product page

Widget ToSelleingCakes (BuildContext context) {

```<code>return Padding(
  padding: const EdgeInsets.only(right: 0,left: 0),
  child: Column(
    children: [
      Row(
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
        children: [
          Card(
            child: GestureDetector(
              onTap: () {
                Navigator.push(context, MaterialPageRoute(builder: (context) {
                  return TopSellingProducts();
                }));
              },
              child:
              Container(
                height: 115,
                  width: 115,
                  child: Image.network('https://artsify.in/appimages/blackforest.jpg',
                   fit: BoxFit.cover,
                  )
              ),
            ),
          ),

          Card(
            child: GestureDetector(
              onTap: () {
                Navigator.push(context, MaterialPageRoute(builder: (context) {
                  return TopSellingProducts();
                }));
              },
              child:
              Container(
                  height: 115,
                  width: 115,
                  child: Image.network('https://artsify.in/appimages/whiteforest.jpg',
                    fit: BoxFit.cover,
                  )
              ),
            ),
          ),
          Card(
            child: GestureDetector(
              onTap: () {
                Navigator.push(context, MaterialPageRoute(builder: (context) {
                  return TopSellingProducts();
                }));
              },
              child:
              Container(
                  height: 115,
                  width: 115,
                  child: Image.network('https://artsify.in/appimages/redvelevet.jpg',
                    fit: BoxFit.cover,
                  )
              ),
            ),
          ),
        ],
      ),
      Row(
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
        children: [
          Card(
            child: GestureDetector(
              onTap: () {
                Navigator.push(context, MaterialPageRoute(builder: (context) {
                  return TopSellingProducts();
                }));
              },
              child:
              Container(
                  height: 115,
                  width: 115,
                  child: Image.network('https://artsify.in/appimages/blackforest.jpg',
                    fit: BoxFit.cover,
                  )
              ),
            ),
          ),

          Card(
            child: GestureDetector(
              onTap: () {
                Navigator.push(context, MaterialPageRoute(builder: (context) {
                  return TopSellingProducts();
                }));
              },
              child:
              Container(
                  height: 115,
                  width: 115,
                  child: Image.network('https://artsify.in/appimages/whiteforest.jpg',
                    fit: BoxFit.cover,
                  )
              ),
            ),
          ),
          Card(
            child: GestureDetector(
              onTap: () {
                Navigator.push(context, MaterialPageRoute(builder: (context) {
                  return TopSellingProducts();
                }));
              },
              child:
              Container(
                  height: 115,
                  width: 115,
                  child: Image.network('https://artsify.in/appimages/redvelevet.jpg',
                    fit: BoxFit.cover,
                  )
              ),
            ),
          ),

        ],
      ),
    ],
  ),
);
</code>```

}

its our Product image section i need to click to open selected product page ...

Body:
I have create gridview in Product banner image in app home page
I need to click to open directly in Selected Product how to call api ...

Click to Open directly in Selected Product page

Widget ToSelleingCakes (BuildContext context) {

return Padding(
  padding: const EdgeInsets.only(right: 0,left: 0),
  child: Column(
    children: [
      Row(
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
        children: [
          Card(
            child: GestureDetector(
              onTap: () {
                Navigator.push(context, MaterialPageRoute(builder: (context) {
                  return TopSellingProducts();
                }));
              },
              child:
              Container(
                height: 115,
                  width: 115,
                  child: Image.network('https://artsify.in/appimages/blackforest.jpg',
                   fit: BoxFit.cover,
                  )
              ),
            ),
          ),

          Card(
            child: GestureDetector(
              onTap: () {
                Navigator.push(context, MaterialPageRoute(builder: (context) {
                  return TopSellingProducts();
                }));
              },
              child:
              Container(
                  height: 115,
                  width: 115,
                  child: Image.network('https://artsify.in/appimages/whiteforest.jpg',
                    fit: BoxFit.cover,
                  )
              ),
            ),
          ),
          Card(
            child: GestureDetector(
              onTap: () {
                Navigator.push(context, MaterialPageRoute(builder: (context) {
                  return TopSellingProducts();
                }));
              },
              child:
              Container(
                  height: 115,
                  width: 115,
                  child: Image.network('https://artsify.in/appimages/redvelevet.jpg',
                    fit: BoxFit.cover,
                  )
              ),
            ),
          ),
        ],
      ),
      Row(
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
        children: [
          Card(
            child: GestureDetector(
              onTap: () {
                Navigator.push(context, MaterialPageRoute(builder: (context) {
                  return TopSellingProducts();
                }));
              },
              child:
              Container(
                  height: 115,
                  width: 115,
                  child: Image.network('https://artsify.in/appimages/blackforest.jpg',
                    fit: BoxFit.cover,
                  )
              ),
            ),
          ),

          Card(
            child: GestureDetector(
              onTap: () {
                Navigator.push(context, MaterialPageRoute(builder: (context) {
                  return TopSellingProducts();
                }));
              },
              child:
              Container(
                  height: 115,
                  width: 115,
                  child: Image.network('https://artsify.in/appimages/whiteforest.jpg',
                    fit: BoxFit.cover,
                  )
              ),
            ),
          ),
          Card(
            child: GestureDetector(
              onTap: () {
                Navigator.push(context, MaterialPageRoute(builder: (context) {
                  return TopSellingProducts();
                }));
              },
              child:
              Container(
                  height: 115,
                  width: 115,
                  child: Image.network('https://artsify.in/appimages/redvelevet.jpg',
                    fit: BoxFit.cover,
                  )
              ),
            ),
          ),

        ],
      ),
    ],
  ),
);

}

its our Product image section i need to click to open selected product page ...


问:
Attempting to use 100% of flexbox row for content prior to wrapping but instead is causing a nested result
Given the following sample of code:

.my-flex {
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  flex-direction: row;
  justify-content: flex-start;
}

.my-data {
  flex: 1;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="my-flex">
  <div class="my-data">AAAAAAAAAAAA</div>
  <div class="my-data">BBBBBBBBBBBB</div>
  <div class="my-data">CCCCCCCCCCCC</div>
  <div class="my-data">DDDDDDDDDDDD</div>
  <div class="my-data">EEEEEEEEEEEE</div>
  <div class="my-data">FFFFFFFFFFFF</div>
  <div class="my-data">GGGGGGGGGGGG</div>
</div></code>```

It's a little difficult to put in code but going to demonstrate to you the issue that I am experiencing and unsure how to solve.

Assuming the user is entering the above info using a drag n drop feature, when the user gets towards the end of the flex row, that is:

before nesting:

```<code>AAAAAAAAAAAA BBBBBBBBBBBB CCCCCCCCCCCC DDDDDDDDDDDD EEEEEEEEEEEE FFFFFFFFFFFF
</code>```

so now, when the user attempts to drag and drop the G's, the following happens:

```<code>AAAAAAAAAAAA
 BBBBBBBBBBBB CCCCCCCCCCCC DDDDDDDDDDDD EEEEEEEEEEEE FFFFFFFFFFFF GGGGGGGGGGGG
</code>```

which is causing a nested effect, which is not what I expected.

The actual result that I am actually expecting and again unsure how to accomplish is as follows:

```<code>AAAAAAAAAAAA BBBBBBBBBBBB CCCCCCCCCCCC DDDDDDDDDDDD EEEEEEEEEEEE FFFFFFFFFFFF
 GGGGGGGGGGGG
</code>```

That is, I would like to use the whole first row and then jump/wrap onto the next row and so forth.

Body:
Given the following sample of code:

.my-flex {
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  flex-direction: row;
  justify-content: flex-start;
}

.my-data {
  flex: 1;
}

AAAAAAAAAAAA

BBBBBBBBBBBB

CCCCCCCCCCCC

DDDDDDDDDDDD

EEEEEEEEEEEE

FFFFFFFFFFFF

GGGGGGGGGGGG

It's a little difficult to put in code but going to demonstrate to you the issue that I am experiencing and unsure how to solve.

Assuming the user is entering the above info using a drag n drop feature, when the user gets towards the end of the flex row, that is:

before nesting:

AAAAAAAAAAAA BBBBBBBBBBBB CCCCCCCCCCCC DDDDDDDDDDDD EEEEEEEEEEEE FFFFFFFFFFFF

so now, when the user attempts to drag and drop the G's, the following happens:

AAAAAAAAAAAA
 BBBBBBBBBBBB CCCCCCCCCCCC DDDDDDDDDDDD EEEEEEEEEEEE FFFFFFFFFFFF GGGGGGGGGGGG

which is causing a nested effect, which is not what I expected.

The actual result that I am actually expecting and again unsure how to accomplish is as follows:

AAAAAAAAAAAA BBBBBBBBBBBB CCCCCCCCCCCC DDDDDDDDDDDD EEEEEEEEEEEE FFFFFFFFFFFF
 GGGGGGGGGGGG

That is, I would like to use the whole first row and then jump/wrap onto the next row and so forth.


问:
How to set iOS default font (SF) for flutter app (using iOS simulator)
I'm trying to set the default SF font for my app but I always get Roboto font. I tried to use CupertinoApp and .SF Pro Text as fontfamily for the text but I got Roboto font. I also tried to use real iphone device but didnt work.

In this example I got same font type.

```<code>class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});
  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text(
              'Roboto Text',
              style: TextStyle(fontSize: 38, fontFamily: 'Roboto'),
            ),
            const Text(
              'SF Text',
              style: TextStyle(
                fontSize: 38,
                 fontFamily: '.SF UI Text',
              ),
            ),
          ],
        ),
      ),
    );
  }
}
</code>```

Body:
I'm trying to set the default SF font for my app but I always get Roboto font. I tried to use CupertinoApp and .SF Pro Text as fontfamily for the text but I got Roboto font. I also tried to use real iphone device but didnt work.

In this example I got same font type.

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});
  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text(
              'Roboto Text',
              style: TextStyle(fontSize: 38, fontFamily: 'Roboto'),
            ),
            const Text(
              'SF Text',
              style: TextStyle(
                fontSize: 38,
                 fontFamily: '.SF UI Text',
              ),
            ),
          ],
        ),
      ),
    );
  }
}


问:
how to all ssh connection from to ssh jump server
I set a ssh jump server on public and the server can access all my other servers. How can i set all internal client access other servers from the server.

I haven't static server list and static ip list.

How can i set all ssh connection send to ssh jump server on clients?

Best Regards,


问:
How to iterate .pdf conversion in Python using Tabula
I'm new to Python and I have problem, its gonna be great having solution from all of you here.

I have a 23 pages PDF file and I want to convert it to separate .csv file for each page. How could I iterate over the pages in the file name using Tabula?

My current code has a syntax error:

```<code>import numpy as np
import pandas as pd
import tabula as tb

df = tb.read_pdf("Source.pdf", pages = "all")[0]
rg = list(range(1,24,1)) //creating list of pages

//iterate over the pages to create multiple csv file based on the pages
for x in rg :
    tb.convert_into("Source.pdf", x'.csv', output_format = "csv",pages = x, lattice = True)
    print(df)
</code>```

Hope I can learn more and have a solution on my problem.

Thanks in advance

```<code>import numpy as np
import pandas as pd
import tabula as tb

df = tb.read_pdf("Source.pdf", pages = "all")[0]
rg = list(range(1,24,1)) //creating list of pages

//iterate to create multiple csv file based on the pages
for x in rg :
    tb.convert_into("Source.pdf", x'.csv', output_format = "csv",pages = x, lattice = True)
    print(df)
</code>```

Body:
I'm new to Python and I have problem, its gonna be great having solution from all of you here.

I have a 23 pages PDF file and I want to convert it to separate .csv file for each page. How could I iterate over the pages in the file name using Tabula?

My current code has a syntax error:

import numpy as np
import pandas as pd
import tabula as tb

df = tb.read_pdf("Source.pdf", pages = "all")[0]
rg = list(range(1,24,1)) //creating list of pages

//iterate over the pages to create multiple csv file based on the pages
for x in rg :
    tb.convert_into("Source.pdf", x'.csv', output_format = "csv",pages = x, lattice = True)
    print(df)

Hope I can learn more and have a solution on my problem.

Thanks in advance

import numpy as np
import pandas as pd
import tabula as tb

df = tb.read_pdf("Source.pdf", pages = "all")[0]
rg = list(range(1,24,1)) //creating list of pages

//iterate to create multiple csv file based on the pages
for x in rg :
    tb.convert_into("Source.pdf", x'.csv', output_format = "csv",pages = x, lattice = True)
    print(df)


问:
GCP Registry behind HAProxy not working properly
I have configured my GCP docker registry using HA Proxy. Here is my HA Proxy configuration.

```<code>frontend myfrontend
  bind 0.0.0.0:8080
  use_backend maven-repo if { path_beg -i /repository }
  use_backend gcp-repo if { path_beg -i /dev-registry }
  default_backend gcp-repo

backend maven-repo
  server maven-repo mvn01-ashok-dev.net:443 ssl verify none check inter 5s

backend gcp-repo
  server gcp-repo dev-docker.pkg.dev:443 ssl verify none check inter 5s
</code>```

While pulling docker image from through HA Proxy, i am getting following error.

```<code>ashok@ubuntu:~$ docker pull localhost:8080/dev-registry/gateway-cluster-images/nextgen-nativebridge:1.1.0
Error response from daemon: error parsing HTTP 404 response body: invalid character '<' looking for beginning of value: "<!DOCTYPE html>\n<html lang=en>\n  <meta charset=utf-8>\n  <meta name=viewport content=\"initial-scale=1, minimum-scale=1, width=device-width\">\n  <title>Error 404 (Not Found)!!1</title>\n  <style>\n    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}\n  </style>\n  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>\n  <p><b>404.</b> <ins>That’s an error.</ins>\n  <p>The requested URL <code>/v2/dev-registry/gateway-cluster-images/nextgen-nativebridge:1.1.0</code> was not found on this server.  <ins>That’s all we know.</ins>\n"
</code>```

Body:
I have configured my GCP docker registry using HA Proxy. Here is my HA Proxy configuration.

frontend myfrontend
  bind 0.0.0.0:8080
  use_backend maven-repo if { path_beg -i /repository }
  use_backend gcp-repo if { path_beg -i /dev-registry }
  default_backend gcp-repo

backend maven-repo
  server maven-repo mvn01-ashok-dev.net:443 ssl verify none check inter 5s

backend gcp-repo
  server gcp-repo dev-docker.pkg.dev:443 ssl verify none check inter 5s

While pulling docker image from through HA Proxy, i am getting following error.

ashok@ubuntu:~$ docker pull localhost:8080/dev-registry/gateway-cluster-images/nextgen-nativebridge:1.1.0
Error response from daemon: error parsing HTTP 404 response body: invalid character '<' looking for beginning of value: "<!DOCTYPE html>\n\n  <meta charset=utf-8>\n  <meta name=viewport content=\"initial-scale=1, minimum-scale=1, width=device-width\">\n  <title>Error 404 (Not Found)!!1</title>\n  \n  \n
404. That’s an error.\n
The requested URL /v2/dev-registry/gateway-cluster-images/nextgen-nativebridge:1.1.0 was not found on this server.  That’s all we know.\n"


问:
Refit requires Body(BodySerializationMethod.UrlEncoded]) but not required with httpclient
I have encountered an issue with refit that took few hours to work out on why calls using refit would result in 403 forbidden whilst using httpclient is fine.
This happens on some servers but not on others.

To Make it work I had to use [Body(BodySerializationMethod.UrlEncoded)].
Cannot work it out why is required though..

I tried all sorts BodySerializationMethod - and googled to see if someone else had encountered the same issue but could not find anything..

any explanations?


问:
How to add list into api call last array?
I have this code the call an api and get an answer.

I need to perform a call for ever issue_id, and store the issue id with the correct response:

```<code>issues_ids = [10495]

def get_changelog(issue_id: int):
    url = f'{base_url}/{issue_id}/changelog'
    response = requests.request("GET",url,headers=headers,auth=auth)
    return (response.json())

def parse_json(response):
    keylsit = []
    for item in response['values']:
        key = {
            'id': item['id'],
            'items': item['items']
        }
        (keylsit.append(key))
    return keylsit

mainlist = []
for i in issues_ids:
    print(i)
    mainlist.extend(parse_json(get_changelog(i)))
print(mainlist)
</code>```

current print :

```<code>10495
[{'id': '13613', 'items': [{'field': 'Organization text', 'fieldtype': 'custom', 'fieldId': 'customfield_10039', 'from': None, 'fromString': None, 'to': None, 'toString': 'Jabil'}]}]
</code>```

I need to add the 10495 with in this array as a new key

[{issue_id: 10495, 'id': '13613', 'items': [{'field': 'Organization text', 'fieldtype': 'custom', 'fieldId': 'customfield_10039', 'from': None, 'fromString': None, 'to': None, 'toString': 'Jabil'}]}]

I tried different methods such as insert, append...

Body:
I have this code the call an api and get an answer.

I need to perform a call for ever issue_id, and store the issue id with the correct response:

issues_ids = [10495]

def get_changelog(issue_id: int):
    url = f'{base_url}/{issue_id}/changelog'
    response = requests.request("GET",url,headers=headers,auth=auth)
    return (response.json())

def parse_json(response):
    keylsit = []
    for item in response['values']:
        key = {
            'id': item['id'],
            'items': item['items']
        }
        (keylsit.append(key))
    return keylsit

mainlist = []
for i in issues_ids:
    print(i)
    mainlist.extend(parse_json(get_changelog(i)))
print(mainlist)

current print :

10495
[{'id': '13613', 'items': [{'field': 'Organization text', 'fieldtype': 'custom', 'fieldId': 'customfield_10039', 'from': None, 'fromString': None, 'to': None, 'toString': 'Jabil'}]}]

I need to add the 10495 with in this array as a new key

[{issue_id: 10495, 'id': '13613', 'items': [{'field': 'Organization text', 'fieldtype': 'custom', 'fieldId': 'customfield_10039', 'from': None, 'fromString': None, 'to': None, 'toString': 'Jabil'}]}]

I tried different methods such as insert, append...


问:
Windows Desktop application - Block uninstall based on bool value - C#
I have developed an desktop application which contains MSI build. Can we block the application based on bool value from being uninstalled by the user? I tried but it is getting uninstalled.

C# code that blocks the windows desktop application being uninstalled.


问:
Nexus Plugin - Type is not assignable to type OutputScalarConfig
I tried to install an official nexus plugin: Declarative Wrapping plugin. This declarative wrapping plugin add an ability to use 'nullable' property, e.g t.string('optionalField', { nullable: true }). I followed all the steps explained in the documentation, then re-generate the nexus schema with this command below:

"generate:nexus": "ts-node --transpile-only src/api/schema"

the regenerate step succeed, but somehow, it returns an error:

```<code>error TS2345: Argument of type '[{ nullable: boolean; }]' is not assignable to parameter of type '[] | [OutputScalarConfig<"BusinessProfile", "street">]'.
  Type '[{ nullable: boolean; }]' is not assignable to type '[OutputScalarConfig<"BusinessProfile", "street">]'.
    Type '{ nullable: boolean; }' is not assignable to type 'OutputScalarConfig<"BusinessProfile", "street">'.
      Object literal may only specify known properties, and 'nullable' does not exist in type 'OutputScalarConfig<"BusinessProfile", "street">'.

29     t.string('street', { nullable: false });
</code>```

Here is the way I installed the plugin:

```<code>export const schema = makeSchema({
  types,
  plugins: [
    declarativeWrappingPlugin(),
    nullabilityGuardPlugin({
      onGuarded: ({ ctx, info }) => {
        console.error(
          `Error: Saw a null value for non-null field ${info.parentType.name}.${info.fieldName}`
        );
      },
      fallbackValues: {
        String: () => undefined,
        ID: ({ info }) => undefined,
        Boolean: () => undefined,
        Upload: () => undefined
      }
    }),
    nonNullOptionalFieldPlugin()
  ],
  outputs: {
    schema: __dirname + '/../schema.graphql',
    typegen: __dirname + '/generated/nexus.ts'
  },
  contextType: {
    module: require.resolve('../context'),
    export: 'Context'
  },
  sourceTypes: {
    modules: [
      {
        module: '@prisma/client',
        alias: 'prisma'
      }
    ]
  }
}) as unknown as GraphQLSchema;
</code>```

Perhaps, there is something wrong with the way I installed the plugin, or the command I had to generate the nexus schema, or even probably there's a step missed.

Body:
I tried to install an official nexus plugin: Declarative Wrapping plugin. This declarative wrapping plugin add an ability to use 'nullable' property, e.g t.string('optionalField', { nullable: true }). I followed all the steps explained in the documentation, then re-generate the nexus schema with this command below:

"generate:nexus": "ts-node --transpile-only src/api/schema"

the regenerate step succeed, but somehow, it returns an error:

error TS2345: Argument of type '[{ nullable: boolean; }]' is not assignable to parameter of type '[] | [OutputScalarConfig<"BusinessProfile", "street">]'.
  Type '[{ nullable: boolean; }]' is not assignable to type '[OutputScalarConfig<"BusinessProfile", "street">]'.
    Type '{ nullable: boolean; }' is not assignable to type 'OutputScalarConfig<"BusinessProfile", "street">'.
      Object literal may only specify known properties, and 'nullable' does not exist in type 'OutputScalarConfig<"BusinessProfile", "street">'.

29     t.string('street', { nullable: false });

Here is the way I installed the plugin:

export const schema = makeSchema({
  types,
  plugins: [
    declarativeWrappingPlugin(),
    nullabilityGuardPlugin({
      onGuarded: ({ ctx, info }) => {
        console.error(
          `Error: Saw a null value for non-null field ${info.parentType.name}.${info.fieldName}`
        );
      },
      fallbackValues: {
        String: () => undefined,
        ID: ({ info }) => undefined,
        Boolean: () => undefined,
        Upload: () => undefined
      }
    }),
    nonNullOptionalFieldPlugin()
  ],
  outputs: {
    schema: __dirname + '/../schema.graphql',
    typegen: __dirname + '/generated/nexus.ts'
  },
  contextType: {
    module: require.resolve('../context'),
    export: 'Context'
  },
  sourceTypes: {
    modules: [
      {
        module: '@prisma/client',
        alias: 'prisma'
      }
    ]
  }
}) as unknown as GraphQLSchema;

Perhaps, there is something wrong with the way I installed the plugin, or the command I had to generate the nexus schema, or even probably there's a step missed.


问:
Sass not compiling properly to application.css rails 7
I have setup a new rails 7 project with Bootstrap 5.2 and Sass, however when it comes to adding in custom styling (with Sass) Rails appears to not be compiling the Sass styling into app/assets/stylesheets/application.css. I have no errors to go off here and after spending far too long on the problem, decided to start fresh with the following setup instructions - https://railsbytes.com/public/templates/V2Gsg9

I had to remove the @import "bootstrap" code below as this throws a compilation error.

```<code>append_file 'app/assets/stylesheets/application.scss', <<-CODE
@import "bootstrap";
CODE
</code>```

I'm unsure if this is relevant to the issue, however I was having issues with the bootstrap setup, where the JavaScript was not working, and followed the following setup from another stackoverflow https://stackoverflow.com/questions/70907799/bootstrap-5-javascript-functions-not-working-in-rails-7-app which has fixed this issue.

In summary, the only problem I'm now facing is that the css is not compiling. I found a number of other resources related to the same issue, however the setup is slightly different and when I try to run the solutions provided it does not work. I have seen multiple posts suggesting to attempt to run rails assets:precompile, which I did, however it broke all the styling setup and couldn't revert it back for some reason (part of the reason whey I started on a new project).

In addition to the new setup, I also tried this suggestion by "stevec" in the following https://stackoverflow.com/questions/71300845/custom-css-not-working-with-css-bundling-for-rails-7. This works, however it doesn't seem to be the Rails way of doing things. This suggests each stylesheet needs to be added to the app/assets/config/manifest.js and also to the application.html.erb file. To my understanding, each view should have its own style sheet which is then imported into application.css.

I feel I'm close to the solution but am finding it challenging at the moment to understand the documentation on the asset pipeline... Some recommendations suggest to install yarn/npm however I thought that's the benefit/job of importmap so have not gone down that path

Body:
I have setup a new rails 7 project with Bootstrap 5.2 and Sass, however when it comes to adding in custom styling (with Sass) Rails appears to not be compiling the Sass styling into app/assets/stylesheets/application.css. I have no errors to go off here and after spending far too long on the problem, decided to start fresh with the following setup instructions - https://railsbytes.com/public/templates/V2Gsg9

I had to remove the @import "bootstrap" code below as this throws a compilation error.

append_file 'app/assets/stylesheets/application.scss', <<-CODE
@import "bootstrap";
CODE

I'm unsure if this is relevant to the issue, however I was having issues with the bootstrap setup, where the JavaScript was not working, and followed the following setup from another stackoverflow https://stackoverflow.com/questions/70907799/bootstrap-5-javascript-functions-not-working-in-rails-7-app which has fixed this issue.

In summary, the only problem I'm now facing is that the css is not compiling. I found a number of other resources related to the same issue, however the setup is slightly different and when I try to run the solutions provided it does not work. I have seen multiple posts suggesting to attempt to run rails assets:precompile, which I did, however it broke all the styling setup and couldn't revert it back for some reason (part of the reason whey I started on a new project).

In addition to the new setup, I also tried this suggestion by "stevec" in the following https://stackoverflow.com/questions/71300845/custom-css-not-working-with-css-bundling-for-rails-7. This works, however it doesn't seem to be the Rails way of doing things. This suggests each stylesheet needs to be added to the app/assets/config/manifest.js and also to the application.html.erb file. To my understanding, each view should have its own style sheet which is then imported into application.css.

I feel I'm close to the solution but am finding it challenging at the moment to understand the documentation on the asset pipeline... Some recommendations suggest to install yarn/npm however I thought that's the benefit/job of importmap so have not gone down that path


问:
Reading an SQL record and all descendants
What would be the most efficient way to selectively read records from a SQL table, along with all their descendants - i.e., records in other tables with different schemas but of the same database, referencing the starting table via foreign keys?

For example, the following 4 tables have a primary key called id and records in Table A are referenced from the other 3 tables via the column x_id, where x = B, C, or D and x_id is the foreign key pointing to a record of Table X with primary key id.

```<code>Table A: id
Table B: id, a_id
Table C: id, a_id, b_id
Table D: id, a_id, c_id
</code>```

Assuming that somehow the application knows the "graph" of table foreign key dependencies and thus can enumerate all "children" of a record (i.e., all records from other tables directly referencing it via its id), the data can be retrieved via multiple SELECT queries. That, however, becomes very slow for large tables.

Is there any more efficient way of getting the same information?

Body:
What would be the most efficient way to selectively read records from a SQL table, along with all their descendants - i.e., records in other tables with different schemas but of the same database, referencing the starting table via foreign keys?

For example, the following 4 tables have a primary key called id and records in Table A are referenced from the other 3 tables via the column x_id, where x = B, C, or D and x_id is the foreign key pointing to a record of Table X with primary key id.

Table A: id
Table B: id, a_id
Table C: id, a_id, b_id
Table D: id, a_id, c_id

Assuming that somehow the application knows the "graph" of table foreign key dependencies and thus can enumerate all "children" of a record (i.e., all records from other tables directly referencing it via its id), the data can be retrieved via multiple SELECT queries. That, however, becomes very slow for large tables.

Is there any more efficient way of getting the same information?


问:
In SwiftUI, "onHover" does not call back when Path draws non-filled graphics
In SwiftUI, when I use Path to draw a non-filled graphic, for example, draw a hollow rectangle, as follows:

code show as below:

```<code>Path {
        $0.addRect(CGRect(x: 100, y: 100, width: 200, height: 200))
    }.stroke(Color.red,lineWidth: 10).onHover { isHover in
        print(isHover)
    }
</code>```

when I set "onHover", when the mouse moves to the graph, the "onHover" method does not make a callback. Is there a good way to monitor the hover state of Path

Body:
In SwiftUI, when I use Path to draw a non-filled graphic, for example, draw a hollow rectangle, as follows:

code show as below:

Path {
        $0.addRect(CGRect(x: 100, y: 100, width: 200, height: 200))
    }.stroke(Color.red,lineWidth: 10).onHover { isHover in
        print(isHover)
    }

when I set "onHover", when the mouse moves to the graph, the "onHover" method does not make a callback. Is there a good way to monitor the hover state of Path


问:
Access Wamp Mysql from extenral application
I have this code snippet where I am trying to make a connection with a remote database, located on LAN Ip with wamp.

```<code>string myConnectionString = "server=192.9.210.62;port=8088;database=testDB;uid=root;pwd=;";
            MySqlConnection con = new MySqlConnection(myConnectionString);
            con.Open();
            MessageBox.Show("connection open");
            con.Close();
</code>```

But it is failing due to socket exception. here are the error

MySql.Data.MySqlClient.MySqlException: 'Reading from the stream has
failed.'

Then, I search for this problem, and it seems that I have to allow a remote connection to my SQL. But remember I have already put my server online already. There is also bind-address setting that need to be set 0.0.0.0 but i am unable to find it in .ini file.

Body:
I have this code snippet where I am trying to make a connection with a remote database, located on LAN Ip with wamp.

string myConnectionString = "server=192.9.210.62;port=8088;database=testDB;uid=root;pwd=;";
            MySqlConnection con = new MySqlConnection(myConnectionString);
            con.Open();
            MessageBox.Show("connection open");
            con.Close();

But it is failing due to socket exception. here are the error

MySql.Data.MySqlClient.MySqlException: 'Reading from the stream has
failed.'

Then, I search for this problem, and it seems that I have to allow a remote connection to my SQL. But remember I have already put my server online already. There is also bind-address setting that need to be set 0.0.0.0 but i am unable to find it in .ini file.


问:
Could not verify St device error occurs in STM32CubeIDE
I am trying to run Blinky on stm32 bluepill but I am getting error message....."Could not verify ST device! Please verify that the latest version of GDB-server is used for the connection"
I have also edited the stm32f1x.cfg file but the issue is same.
Debug Probe is ST-LINK(OpenOCD).</p>


问:
Select best individuals from generation with DEAP
I am developing a Genetic Algorithm, and am currently trying to not only to generate offspring, but also to take for the next generation the best individuals from the previous generation.

I am implementing the GA in DEAP.

From what I've read from DEAP support pages, the best way to implement this is to use selbest toolbox with the eaMuPlusLambda algorithm.

I have set the code as shown below:

```<code>            toolbox.register("evaluate", oneMaxFitness)
            #toolbox.decorate("evaluate", tools.DeltaPenalty(feasible, 7.0, distance))

            # Tournament selection with tournament size of 2:
            toolbox.register("select", tools.selTournament, tournsize=2)

            #Elitism
            toolbox.register("selbest", tools.selBest)
            # Single-point crossover:
            #toolbox.register("mate", tools.cxOnePoint)
            toolbox.register("mate", tools.cxTwoPoint)

            # Flip-bit mutation:
            # indpb: Independent probability for each attribute to be flipped
            toolbox.register("mutate", tools.mutFlipBit, indpb=5.0/ONE_MAX_LENGTH)

population, logbook = algorithms.eaMuPlusLambda(population, toolbox, SELBEST_SIZE+POPULATION_SIZE, POPULATION_SIZE-SELBEST_SIZE, cxpb=P_CROSSOVER, mutpb=P_MUTATION, ngen=MAX_GENERATIONS, stats=stats, halloffame=hof, verbose=True)
</code>```

Nonetheless, from the results I'm obtaining from different simulations, it seems that the best individual is not passing throughout the generations. Take for example:

gen     nevals  max     avg

0       35      215414  201504

1       20      215237  205786

2       25      215237  211251

3       25      215361  213806

The first generation is the one with the best fitness. The best individual did not pass into the following generations.

Can you please support me in indentifying what is wrong with my code. Thanks

Body:
I am developing a Genetic Algorithm, and am currently trying to not only to generate offspring, but also to take for the next generation the best individuals from the previous generation.

I am implementing the GA in DEAP.

From what I've read from DEAP support pages, the best way to implement this is to use selbest toolbox with the eaMuPlusLambda algorithm.

I have set the code as shown below:

            toolbox.register("evaluate", oneMaxFitness)
            #toolbox.decorate("evaluate", tools.DeltaPenalty(feasible, 7.0, distance))

            # Tournament selection with tournament size of 2:
            toolbox.register("select", tools.selTournament, tournsize=2)

            #Elitism
            toolbox.register("selbest", tools.selBest)
            # Single-point crossover:
            #toolbox.register("mate", tools.cxOnePoint)
            toolbox.register("mate", tools.cxTwoPoint)

            # Flip-bit mutation:
            # indpb: Independent probability for each attribute to be flipped
            toolbox.register("mutate", tools.mutFlipBit, indpb=5.0/ONE_MAX_LENGTH)

population, logbook = algorithms.eaMuPlusLambda(population, toolbox, SELBEST_SIZE+POPULATION_SIZE, POPULATION_SIZE-SELBEST_SIZE, cxpb=P_CROSSOVER, mutpb=P_MUTATION, ngen=MAX_GENERATIONS, stats=stats, halloffame=hof, verbose=True)

Nonetheless, from the results I'm obtaining from different simulations, it seems that the best individual is not passing throughout the generations. Take for example:

gen     nevals  max     avg

0       35      215414  201504

1       20      215237  205786

2       25      215237  211251

3       25      215361  213806

The first generation is the one with the best fitness. The best individual did not pass into the following generations.

Can you please support me in indentifying what is wrong with my code. Thanks


问:
I received nopass on the redhat RHCE test. Although it is not accurate, an error similar to the following occurred

`I received nopass on the redhat RHCE test. Although it is not accurate, an error similar to the following occurred.

```<code> [WARNING]: Unable to parse /etc/ansible/hosts as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
</code>```

[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
[WARNING]: Could not match supplied host pattern, ignoring: [xxx],[xxx],[xxx]~~~

I received Install and configure Possible: 0% because of the above error.
I eventually put the inventory content in the /etc/hosts file and solved the problem.
An hour was wasted in solving the above problem, so I couldn't solve all the problems.
I'm going to try the test again in two weeks. If I don't solve this problem, I'm afraid I'll get the same result.
420 dollars is a lot of money for me, so I need your help.
I definitely inserted the /home/admin/ansible/inventory, /home/admin/ansible.cfg file normally.

###########
/home/username/ansible/inventory
[xxx]
10.10.10.10

/home/admin/ansible/ansible.cfg
inventory = /home/username/ansible/inventory

##This is an example of the file I wrote.
Although it was clearly written in the path presented in the test, the above error was repeated, so the /etc/hosts file was modified and proceeded
I need help`

Body:
`I received nopass on the redhat RHCE test. Although it is not accurate, an error similar to the following occurred.

 [WARNING]: Unable to parse /etc/ansible/hosts as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available

[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
[WARNING]: Could not match supplied host pattern, ignoring: [xxx],[xxx],[xxx]~~~

I received Install and configure Possible: 0% because of the above error.
I eventually put the inventory content in the /etc/hosts file and solved the problem.
An hour was wasted in solving the above problem, so I couldn't solve all the problems.
I'm going to try the test again in two weeks. If I don't solve this problem, I'm afraid I'll get the same result.
420 dollars is a lot of money for me, so I need your help.
I definitely inserted the /home/admin/ansible/inventory, /home/admin/ansible.cfg file normally.

###########
/home/username/ansible/inventory
[xxx]
10.10.10.10

/home/admin/ansible/ansible.cfg
inventory = /home/username/ansible/inventory

##This is an example of the file I wrote.
Although it was clearly written in the path presented in the test, the above error was repeated, so the /etc/hosts file was modified and proceeded
I need help`


问:
Duplicate resources for different flavors in Android Studio
My build.gradle looks like this:

```<code>productFlavors {
    flavor1 { ... }
    flovor2 { ... }
}
sourceSets {
    main {
        java.srcDirs = [ ... ]
        jniLibs.srcDirs = [ ... ]
    }
    flavor1 {
        res.srcDirs 'path to flavor1 res'
        debug.assets.srcDirs 'path to flavor1 debug assets'
        release.assets.srcDirs 'path to flavor1 release assets'
    }
    flavor2 {
        res.srcDirs 'path to flavor2 res'
        debug.assets.srcDirs 'path to flavor2 debug assets'
        release.assets.srcDirs 'path to flavor2 release assets'
    }
}
</code>```

Assets folders for both flavors have the same structure and contain files with the same names.

When trying to build I've got Duplicate resources error for every file I have in assets folder.

Why gradle takes into account assets in a folder, that belongs to another flavor? Any ideas how to fix the issue?

Body:
My build.gradle looks like this:

productFlavors {
    flavor1 { ... }
    flovor2 { ... }
}
sourceSets {
    main {
        java.srcDirs = [ ... ]
        jniLibs.srcDirs = [ ... ]
    }
    flavor1 {
        res.srcDirs 'path to flavor1 res'
        debug.assets.srcDirs 'path to flavor1 debug assets'
        release.assets.srcDirs 'path to flavor1 release assets'
    }
    flavor2 {
        res.srcDirs 'path to flavor2 res'
        debug.assets.srcDirs 'path to flavor2 debug assets'
        release.assets.srcDirs 'path to flavor2 release assets'
    }
}

Assets folders for both flavors have the same structure and contain files with the same names.

When trying to build I've got Duplicate resources error for every file I have in assets folder.

Why gradle takes into account assets in a folder, that belongs to another flavor? Any ideas how to fix the issue?


问:
Kafka AdminClient DEFAULT_API_TIMEOUT_MS_CONFIG property not working as expected
In my java application for kafkaProducer i created Admin and used this to list topics.

```<code>Admin admin1 = Admin.create(properties);
ListTopicsResult listTopicResult = admin1.listTopics();
</code>```

When producer was not able to connect to broker thread get stucks at listTopic step.

To avoid this i have added DEFAULT_API_TIMEOUT_MS_CONFIG property and have set to 2000ms. so after 2s if producer is not able to connect to broker timeout should happen.

```<code>properties.put(AdminClientConfig.DEFAULT_API_TIMEOUT_MS_CONFIG,2000);
</code>```

But this does not work as expected. even DEFAULT_API_TIMEOUT_MS_CONFIG with value 2000ms as property timeout didn't happen and thread was struck.

Is there any other way to achieve timeout or do we need to configure it in any other way?

Also is using AdminClient instead of Admin can have any impact.

Body:
In my java application for kafkaProducer i created Admin and used this to list topics.

Admin admin1 = Admin.create(properties);
ListTopicsResult listTopicResult = admin1.listTopics();

When producer was not able to connect to broker thread get stucks at listTopic step.

To avoid this i have added DEFAULT_API_TIMEOUT_MS_CONFIG property and have set to 2000ms. so after 2s if producer is not able to connect to broker timeout should happen.

properties.put(AdminClientConfig.DEFAULT_API_TIMEOUT_MS_CONFIG,2000);

But this does not work as expected. even DEFAULT_API_TIMEOUT_MS_CONFIG with value 2000ms as property timeout didn't happen and thread was struck.

Is there any other way to achieve timeout or do we need to configure it in any other way?

Also is using AdminClient instead of Admin can have any impact.


问:
Replacing common element in Ternary Operator Expressions in Angular
I'm new to Angular I've the code below and it's working fine but i would like to replace "fieldInfo.fieldLabel | humanReadableText" as it is common in both expressions

```<code>pTooltip="{{displayNewCtrl ? ('Collapse ' + fieldInfo.fieldLabel | humanReadableText) : ('Expand '+ fieldInfo.fieldLabel | humanReadableText)}}"
</code>```

Is there any way to replace common elements in ternary expressions?

Body:
I'm new to Angular I've the code below and it's working fine but i would like to replace "fieldInfo.fieldLabel | humanReadableText" as it is common in both expressions

pTooltip="{{displayNewCtrl ? ('Collapse ' + fieldInfo.fieldLabel | humanReadableText) : ('Expand '+ fieldInfo.fieldLabel | humanReadableText)}}"

Is there any way to replace common elements in ternary expressions?


问:
path.isNotEmpty': a document path must be a non-empty string)
`

im trying to make qrcode app for my flutter application. But this error is always come up everytime i try to click to scanner. The error Can someone tell me what is wrong with my code.
` final String? uid;
_HomePageState(this.uid);
Future _scanQR() async {

```<code>  var qrResult = await BarcodeScanner.scan();
  setState(
    () {
      urlcollections.doc(uid).collection('url').add(
        {
          'url': qrResult.formatNote,
          'time': DateTime.now(),
        },
      );
    },
  );
  Navigator.of(context).pushReplacement(
      MaterialPageRoute(builder: (context) => HistoryPage(uid: uid!)));
}
</code>```

}

Body:
`

im trying to make qrcode app for my flutter application. But this error is always come up everytime i try to click to scanner. The error Can someone tell me what is wrong with my code.
` final String? uid;
_HomePageState(this.uid);
Future _scanQR() async {

  var qrResult = await BarcodeScanner.scan();
  setState(
    () {
      urlcollections.doc(uid).collection('url').add(
        {
          'url': qrResult.formatNote,
          'time': DateTime.now(),
        },
      );
    },
  );
  Navigator.of(context).pushReplacement(
      MaterialPageRoute(builder: (context) => HistoryPage(uid: uid!)));
}

}


问:
rtl multi grid table with react-virtualized
I have an multigrid table in react virtualized and I cant change the style yo rtl .
I tried the props in document didn't work :(
I want my fixed columns to start from right</p>
```<code><AutoSizer>
  {({ height, width }) => (
    <MultiGrid
      style={{ direction: "rtl" }}
      cellRenderer={cellRenderer}
      fixedColumnCount={2}
      fixedRowCount={1}
      height={500}
      rowHeight={40}
      rowCount={heightcount}
      columnCount={headercolumns.length}
      columnWidth={({ index }) => headercolumns[index].width}
      width={width}
      scrollToAlignment="end"
    />
  )}
</AutoSizer>
</code>```

Body:
I have an multigrid table in react virtualized and I cant change the style yo rtl .
I tried the props in document didn't work :(
I want my fixed columns to start from right

<AutoSizer>
  {({ height, width }) => (
    <MultiGrid
      style={{ direction: "rtl" }}
      cellRenderer={cellRenderer}
      fixedColumnCount={2}
      fixedRowCount={1}
      height={500}
      rowHeight={40}
      rowCount={heightcount}
      columnCount={headercolumns.length}
      columnWidth={({ index }) => headercolumns[index].width}
      width={width}
      scrollToAlignment="end"
    />
  )}
</AutoSizer>


问:
S3 presigned url limit file size
I am uploading file to S3 using presigned url from client side, is there anyway I can:

restrict file upload based on file size limit and mimeType

throw error if file name already exists in the bucket folder instead of overwriting.

Note:
I am expecting a no-code solution (eg: configuration at bucket access policy) rather than having additional coding check.

Title: S3 presigned url limit file size


问:
How to Add a shortcut to my program with custom right click menu?
i would like to ask if there is a way to add my program icon on Desktop with custom right click menu like (repair data, server IP configure... and so on )</p>


问:
Wordpress Happyform to save submission as a PDF form

I'm creating a form in WordPress by happyforms. when anyone submits a submission It is saved in PDF form into my google drive, Someone suggestion me to use zapier but I can not understand how to set up the linking form HappyForm->PDF->Google Drive.
please help me!


问:
How to reload configuration in OpenIdDict?
I'm using instrospection (OpenIdDict v3.1.1) and have 1 application which can work in 2 modes:

standalone mode,

proxy mode - current instance (proxy) forwards request to second instance (master).

In my scenario master instance can be unavailable and then proxy doesn't forward requests to master but execute them internally. Because of it I have to change Issuer in validation options. The problem is that changes don't apply on internal work of openIdDict, I tried to do it by change IOptions. It tries to send request to master instance all the time.

Currently I see only one solution of this problem, restart whole application and set proper issuer on the start of the application. The best solution for me it's reloading configuration in runtime without restart.


问:
Merge Jupyter Two or More Notebooks Together to One File error
I am trying to merge my jupyter files via nbmerge command in terminal, but I get below error: I appreciate if anyone can answer me what it is?

```<code>PS C:\Users\daniel\desktop\CSC180\Labs\Until_lab11> nbmerge lab0.ipynb lab1.ipynb lab2.ipynb lab3.ipynb lab4.ipynb lab5.ipynb lab6.ipynb lab7.ipynb lab8.ipynb lab9.ipynb lab10.ipynb lab11.ipynb lab12.ipynb lab13.ipynb lab_special.ipynb > all_lab_in_one.ipynb
</code>```
```<code>Traceback (most recent call last):
  File "C:\Python311\Scripts\nbmerge-script.py", line 33, in <module>
    sys.exit(load_entry_point('nbmerge==0.0.4', 'console_scripts', 'nbmerge')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\nbmerge\__init__.py", line 202, in main
    write_notebook(nb, sys.stdout)
  File "C:\Python311\Lib\site-packages\nbformat\__init__.py", line 200, in write
    fp.write(s)
  File "C:\Python311\Lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode character '\uff0c' in position 805156: character maps to <undefined>
</code>```

I am trying to merge 11 jupyter files together. They are like 3-4 pages each. But I get this error. Any help will be appreciated.

Body:
I am trying to merge my jupyter files via nbmerge command in terminal, but I get below error: I appreciate if anyone can answer me what it is?

PS C:\Users\daniel\desktop\CSC180\Labs\Until_lab11> nbmerge lab0.ipynb lab1.ipynb lab2.ipynb lab3.ipynb lab4.ipynb lab5.ipynb lab6.ipynb lab7.ipynb lab8.ipynb lab9.ipynb lab10.ipynb lab11.ipynb lab12.ipynb lab13.ipynb lab_special.ipynb > all_lab_in_one.ipynb

Traceback (most recent call last):
  File "C:\Python311\Scripts\nbmerge-script.py", line 33, in <module>
    sys.exit(load_entry_point('nbmerge==0.0.4', 'console_scripts', 'nbmerge')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\nbmerge\__init__.py", line 202, in main
    write_notebook(nb, sys.stdout)
  File "C:\Python311\Lib\site-packages\nbformat\__init__.py", line 200, in write
    fp.write(s)
  File "C:\Python311\Lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode character '\uff0c' in position 805156: character maps to <undefined>

I am trying to merge 11 jupyter files together. They are like 3-4 pages each. But I get this error. Any help will be appreciated.


问:
Single Signin For All Subdomain Or Projects?
Hy All Hope All Are Fine. First Of All Sorry For My English And I Am Totally New And didn't Know About Php My Sql Etc, So Lets Start My Questions With Detail I Purchased too many Projects
subdomain1.maindomain
subdomain2.maindomain
subdomain3.maindomain
subdomain4.maindomain
May Be In Future I Will Add More
Now Simply I Want Single Login For All Subdomains, Mean That User Can Signup In One Of Any Domain But Can Login For All Subdomain As Same Signup For any One Of Above Domain. My Sql Database User Is Same But Mysql Database Is Different One From Other Every Subdomain or Domain Has It's Own Database.
Please Tell Me Is It Possible To Login As A One???? Please If It Is Possible Share With Detail Because I Am New.
I Did't Try Any Method</p>


问:
Using Python Code to read excel files in R with openpyxl and reticulate
When trying to manipulate excel files from R it was very challenging from me, as there was no good packages that allowed the user to write values into a specific range in excel.
Instead, I had to opt for a Python package called openpyxl and, using reticulate from R to translate the Python code into R code, I managed to import the workbook into R as a Python workbook.
The problem is that the subsequent code to manipulate the imported workbook in R does not work.

Then, writing the code in R I had to do some changes:

This is the Python code:

```<code>import openpyxl
book = openpyxl.load_workbook(r'C:\Users\...\Test.xlsx')
sheet = book["User_Interface"]
print(sheet["L11"].value)
sheet["L11"] = 20000000
book.save(r'C:\Users\...\Test.xlsx')
</code>```

which translated into R would be:

```<code>library(reticulate)
opel <- import('openpyxl')
book <- opel$load_workbook("C:/Users/.../Test.xlsx")
sheet<- book["User_Interface"]
print(sheet["L11"])

</code>```

print(sheet["L11"]) produces the following output in R:

```<code>> print(sheet["L11"])
<Cell 'User_Interface'.L11>
</code>```

But when trying to print cell "L11" like I did with the Python code, I get an error:

```<code>print(sheet["L11"]).value
Error: unexpected symbol in "print(sheet["L11"]).value"
</code>```

and the same happens when trying to change the value of a cell in R:

```<code>> sheet["L11"]=20000000
Error in sheet["L11"] = 2e+07 : object of type 'environment' is not subsettable
</code>```

I would like to know if there is a guidance to translate the Python code into R code that needs to be used with the R package "reticulate"

Body:
When trying to manipulate excel files from R it was very challenging from me, as there was no good packages that allowed the user to write values into a specific range in excel.
Instead, I had to opt for a Python package called openpyxl and, using reticulate from R to translate the Python code into R code, I managed to import the workbook into R as a Python workbook.
The problem is that the subsequent code to manipulate the imported workbook in R does not work.

Then, writing the code in R I had to do some changes:

This is the Python code:

import openpyxl
book = openpyxl.load_workbook(r'C:\Users\...\Test.xlsx')
sheet = book["User_Interface"]
print(sheet["L11"].value)
sheet["L11"] = 20000000
book.save(r'C:\Users\...\Test.xlsx')

which translated into R would be:

library(reticulate)
opel <- import('openpyxl')
book <- opel$load_workbook("C:/Users/.../Test.xlsx")
sheet<- book["User_Interface"]
print(sheet["L11"])

print(sheet["L11"]) produces the following output in R:

> print(sheet["L11"])
<Cell 'User_Interface'.L11>

But when trying to print cell "L11" like I did with the Python code, I get an error:

print(sheet["L11"]).value
Error: unexpected symbol in "print(sheet["L11"]).value"

and the same happens when trying to change the value of a cell in R:

> sheet["L11"]=20000000
Error in sheet["L11"] = 2e+07 : object of type 'environment' is not subsettable

I would like to know if there is a guidance to translate the Python code into R code that needs to be used with the R package "reticulate"


问:
Numpy: quick check if a tuple index lies within `shape` bounds?
Given a tuple index, is there any short, fast code to see if the index lies "in-bounds" of an array shape?

Some solutions include:

For 2D: (0 <= index[0] < shape[0] and 0 <= index[1] < shape[1])

For any dimensions: all(0 <= i < n for i, n in zip(index, shape))

Also: (np.all(0 <= np.array(index)) and np.all(np.array(index) < shape))

And: ((0 <= np.array(index)) & (np.array(index) < shape)).all()

Solution (1) is fast but hardwired to 2 dimensions.
Although (2),(3),(4) are general, they are slow as they require either generator(s) or the construction of ndarray object(s).

Are there other ideas?

Perhaps there is already a library function (imaginary "np.inshape(index, shape)") to achieve this?


问:
Identify Surge of API Processing Time in Datadog
Hello this is not code related. I just want to ask how to debug the rootcause of a 'heavy procssing time of our APIs'.

Where do I look in Datadog.
Is it Logs dashboard?
Or Events Dashboard?

I want to be able to identify why between 8:00 AM and 8:30 AM, datadog showed a spike in API processing time. Should I check our MongodDB logs?


问:
react-native-svg-chart Yaxis points goig out of range

*Y-axis labels are reformatted value/60 *

Y-axis Max point is at 170 which is going out of graph.
Graph height is not adjusting according to the highest point of the Y-axis value.Also plotted graph for values going upto 200 above which is plotted correctly in range.

```<code><View
  style={{
    height: 250,
    paddingVertical: 10,
    flexDirection: 'row',
  }}>
  <YAxis
    data={props.data}
    yAccessor={({item}) => item?.sleep_n1_time}
    style={{marginBottom: xAxisHeight, width: 40, marginRight: 5}}
    contentInset={verticalContentInset}
    svg={axesSvg}
    formatLabel={(value, idx) => {
      if (props.data.length > 50) {
        return idx % 5 === 0 ? formatTime(value) : '';
      } else if (props.data.length > 20) {
        return idx % 2 === 0 ? formatTime(value) : '';
      } else {
        return formatTime(value);
      }
    }}
  />
  <View style={{flex: 1, marginRight: 10}}>
    <StackedAreaChart
      style={{height: 200, paddingVertical: 16}}
      data={props.data}
      keys={keys}
      contentInset={{...horizontalContentInset, ...verticalContentInset}}
      colors={colors}
      curve={shape.curveNatural}
      showGrid={false}
    />
    <XAxis
      style={{height: xAxisHeight}}
      data={props.data}
      formatLabel={(value, index) => {
        if (props.data.length > 50) {
          return index % 5 === 0 ? props.data[index]?.time : '';
        } else if (props.data.length > 20) {
          return index % 2 === 0 ? props.data[index]?.time : '';
        } else {
          return props.data[index]?.time;
        }
      }}
      contentInset={horizontalContentInset}
      svg={axesXSvg}
    />
  </View>
</View>
</code>```

Body:
*Y-axis labels are reformatted value/60 *

Y-axis Max point is at 170 which is going out of graph.
Graph height is not adjusting according to the highest point of the Y-axis value.Also plotted graph for values going upto 200 above which is plotted correctly in range.

<View
  style={{
    height: 250,
    paddingVertical: 10,
    flexDirection: 'row',
  }}>
  <YAxis
    data={props.data}
    yAccessor={({item}) => item?.sleep_n1_time}
    style={{marginBottom: xAxisHeight, width: 40, marginRight: 5}}
    contentInset={verticalContentInset}
    svg={axesSvg}
    formatLabel={(value, idx) => {
      if (props.data.length > 50) {
        return idx % 5 === 0 ? formatTime(value) : '';
      } else if (props.data.length > 20) {
        return idx % 2 === 0 ? formatTime(value) : '';
      } else {
        return formatTime(value);
      }
    }}
  />
  <View style={{flex: 1, marginRight: 10}}>
    <StackedAreaChart
      style={{height: 200, paddingVertical: 16}}
      data={props.data}
      keys={keys}
      contentInset={{...horizontalContentInset, ...verticalContentInset}}
      colors={colors}
      curve={shape.curveNatural}
      showGrid={false}
    />
    <XAxis
      style={{height: xAxisHeight}}
      data={props.data}
      formatLabel={(value, index) => {
        if (props.data.length > 50) {
          return index % 5 === 0 ? props.data[index]?.time : '';
        } else if (props.data.length > 20) {
          return index % 2 === 0 ? props.data[index]?.time : '';
        } else {
          return props.data[index]?.time;
        }
      }}
      contentInset={horizontalContentInset}
      svg={axesXSvg}
    />
  </View>
</View>


问:
Using cfn-lint in nested stacks
When using cfn-lint in nested stacks, it seems that the parameters of the root stack are not passed over to the child stack, so the check doesn't work properly.

cfn-lint will not find any errors if you enter the wrong parameters in the ROOT stack.

root stack

```<code>Resources:
  VPC:
    Type: AWS::CloudFormation::Stack
    Properties:
      TemplateURL: dir/child.yml
      Parameters:
</code>```

If you put the S3 path in the templateURL, it will not be checked,
Local path returns error W3002.

This stack deploys normally.

Can you help me ?

Title: Using cfn-lint in nested stacks

Body:
When using cfn-lint in nested stacks, it seems that the parameters of the root stack are not passed over to the child stack, so the check doesn't work properly.

cfn-lint will not find any errors if you enter the wrong parameters in the ROOT stack.

root stack

Resources:
  VPC:
    Type: AWS::CloudFormation::Stack
    Properties:
      TemplateURL: dir/child.yml
      Parameters:

If you put the S3 path in the templateURL, it will not be checked,
Local path returns error W3002.

This stack deploys normally.

Can you help me ?


问:
PySpark Glue Error: Remote RPC Client Disassociated
I have a PySpark code running in Glue which fails with error "Remote TPC Client Disassociated.Likely due to containers exceeding thresholds, or network issues". It seems like it's a common issue with Spark and I have gone through a bunch of stack overflow and other forums. I tried tweaking a number of parameters in the Spark config but nothing worked hence posting this here. Would appreciate any inputs. Below are few details about my job, I have played with different values of the spark config for rpc and memory. I tried executor memory of 1g, 20g, 30g, 64g; Driver memory of 20g, 30g, 64g. Please advise.

Glue version: 3.0
Spark versio: 3.1

Spark Config:

```<code>spark= (SparkSession
    .builder
    .appName("jkTestApp")
    .config("spark.sql.sources.partitionOverwriteMode", "dynamic")
    .config("spark.sql.autoBroadcastJoinThreshold","-1")
    .config("spark.rpc.message.maxSize", "512")
    .config("spark.driver.memory","64g")
    .config("spark.executor.memory","1g")
    .config("spark.executor.memoryOverhead","512")
    .config("spark.rpc.numRetries","10")
    .getOrCreate()
     )
</code>```

Body:
I have a PySpark code running in Glue which fails with error "Remote TPC Client Disassociated.Likely due to containers exceeding thresholds, or network issues". It seems like it's a common issue with Spark and I have gone through a bunch of stack overflow and other forums. I tried tweaking a number of parameters in the Spark config but nothing worked hence posting this here. Would appreciate any inputs. Below are few details about my job, I have played with different values of the spark config for rpc and memory. I tried executor memory of 1g, 20g, 30g, 64g; Driver memory of 20g, 30g, 64g. Please advise.

Glue version: 3.0
Spark versio: 3.1

Spark Config:

spark= (SparkSession
    .builder
    .appName("jkTestApp")
    .config("spark.sql.sources.partitionOverwriteMode", "dynamic")
    .config("spark.sql.autoBroadcastJoinThreshold","-1")
    .config("spark.rpc.message.maxSize", "512")
    .config("spark.driver.memory","64g")
    .config("spark.executor.memory","1g")
    .config("spark.executor.memoryOverhead","512")
    .config("spark.rpc.numRetries","10")
    .getOrCreate()
     )


问:
About showing APKs from asset flutter
I want to show the apks from assets folder in my flutter app. Firstly i want to put apks files in asset folder externally then fetch and show those apks in a page. how can i achieve that ?</p>

Title: About showing APKs from asset flutter


问:
How do I fix this error: "Error: Cannot find module './commands/info/status.js'" discordJS
hander "command.js"

const { readdirSync } = require('fs');
const ascii = require('ascii-table');

const client = require('..');
const { dir } = require('console');
const { config } = require('process');
let table = new ascii("Commands");
table.setHeading('Commands', 'Load');

module.exports = (client) => {

    readdirSync('./commands/').forEach(dir => {
        const commands = readdirSync(`./commands/${dir}/`).filter(file => file.endsWith(".js"));
        for(const file of commands) {
            const pull = require(`./commands/${dir}/${file}`);
            if (pull.name) {
                client.commands.set(pull.name, pull);
                slash.push(pull);
                table.addRow(file, "OK");
            }else {
                table.addRow(file, 'Error - Missing a help.name or it is not a string...');
                continue;
            }if(pull.aliases && Array.isArray(pull.aliases)) pull.aliases.forEach(alias => client.aliases.set(alias, pull.name))
        }
    });
    console.log(table.toString());

    readdirSync('./events/').forEach((file) => {
        const events = readdirSync('./events').filter((file) =>
        file.endsWith('.js')
        );
        for (let file of events) {
            let pull = require(`../events/${file}`);
            if(pull.name) {
                client.events.set(pull.name, pull)
            }
        }
        console.log(`${file} Events load`);
    })
}
```
<p>event "messageCreate.js"</p>
<pre class="lang-js prettyprint-override"><code>const { Embed, Collection } = require('discord.js')
const client = require('..');
const config = require('../setting/config.json');
const prefix_bot = config.prefix_bot;

client.on("messageCreste", async (message) => {
    if(message.author.bot) return;
    if(!message.content.startsWith(prefix_bot)) return;
    if(!message.guild) return;
    if(!message.member) message.member = await message.guild.fetchMember(message);
    const args = message.content.slice(prefix_bot.length).trim().split(/ +/g);

    const cmd =  args.shift().toLowerCase();
    if(cmd.length == 0) return;
    let command = client.commands.get(cmd);
    if(!command) command = client.commands.get(client.aliases.get(cmd));
    if(command) command.run(client, message,  args)
});
</code>```

commands "status.js"

const { Embed, Collection } = require('discord.js')
const client = require('..');
const config = require('../setting/config.json');
const prefix_bot = config.prefix_bot;

client.on("messageCreste", async (message) => {
    if(message.author.bot) return;
    if(!message.content.startsWith(prefix_bot)) return;
    if(!message.guild) return;
    if(!message.member) message.member = await message.guild.fetchMember(message);
    const args = message.content.slice(prefix_bot.length).trim().split(/ +/g);

    const cmd =  args.shift().toLowerCase();
    if(cmd.length == 0) return;
    let command = client.commands.get(cmd);
    if(!command) command = client.commands.get(client.aliases.get(cmd));
    if(command) command.run(client, message,  args)
});
```

error

node:internal/modules/cjs/loader:936
throw err;
^

Error: Cannot find module './commands/info/status.js'
Require stack:
C:\Users\satang\Desktop\bot_node_satang\dis3\handler\command.js
C:\Users\satang\Desktop\bot_node_satang\dis3\index.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:94:18)
at C:\Users\satang\Desktop\bot_node_satang\dis3\handler\command.js:15:26
at Array.forEach ()
at module.exports (C:\Users\satang\Desktop\bot_node_satang\dis3\handler\command.js:12:32)
at C:\Users\satang\Desktop\bot_node_satang\dis3\index.js:68:34
at Array.forEach ()
at Object. (C:\Users\satang\Desktop\bot_node_satang\dis3\index.js:67:13) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\Users\satang\Desktop\bot_node_satang\dis3\handler\command.js',
'C:\Users\satang\Desktop\bot_node_satang\dis3\index.js'
]
}

Can anyone find the error?

HELP ME PLESSS

Body:
hander "command.js"

const { readdirSync } = require('fs');
const ascii = require('ascii-table');

const client = require('..');
const { dir } = require('console');
const { config } = require('process');
let table = new ascii("Commands");
table.setHeading('Commands', 'Load');

module.exports = (client) => {

    readdirSync('./commands/').forEach(dir => {
        const commands = readdirSync(`./commands/${dir}/`).filter(file => file.endsWith(".js"));
        for(const file of commands) {
            const pull = require(`./commands/${dir}/${file}`);
            if (pull.name) {
                client.commands.set(pull.name, pull);
                slash.push(pull);
                table.addRow(file, "OK");
            }else {
                table.addRow(file, 'Error - Missing a help.name or it is not a string...');
                continue;
            }if(pull.aliases && Array.isArray(pull.aliases)) pull.aliases.forEach(alias => client.aliases.set(alias, pull.name))
        }
    });
    console.log(table.toString());

    readdirSync('./events/').forEach((file) => {
        const events = readdirSync('./events').filter((file) =>
        file.endsWith('.js')
        );
        for (let file of events) {
            let pull = require(`../events/${file}`);
            if(pull.name) {
                client.events.set(pull.name, pull)
            }
        }
        console.log(`${file} Events load`);
    })
}

event "messageCreate.js"

const { Embed, Collection } = require('discord.js')
const client = require('..');
const config = require('../setting/config.json');
const prefix_bot = config.prefix_bot;

client.on("messageCreste", async (message) => {
    if(message.author.bot) return;
    if(!message.content.startsWith(prefix_bot)) return;
    if(!message.guild) return;
    if(!message.member) message.member = await message.guild.fetchMember(message);
    const args = message.content.slice(prefix_bot.length).trim().split(/ +/g);

    const cmd =  args.shift().toLowerCase();
    if(cmd.length == 0) return;
    let command = client.commands.get(cmd);
    if(!command) command = client.commands.get(client.aliases.get(cmd));
    if(command) command.run(client, message,  args)
});

commands "status.js"

const { Embed, Collection } = require('discord.js')
const client = require('..');
const config = require('../setting/config.json');
const prefix_bot = config.prefix_bot;

client.on("messageCreste", async (message) => {
    if(message.author.bot) return;
    if(!message.content.startsWith(prefix_bot)) return;
    if(!message.guild) return;
    if(!message.member) message.member = await message.guild.fetchMember(message);
    const args = message.content.slice(prefix_bot.length).trim().split(/ +/g);

    const cmd =  args.shift().toLowerCase();
    if(cmd.length == 0) return;
    let command = client.commands.get(cmd);
    if(!command) command = client.commands.get(client.aliases.get(cmd));
    if(command) command.run(client, message,  args)
});

error

node:internal/modules/cjs/loader:936
throw err;
^

Error: Cannot find module './commands/info/status.js'
Require stack:
C:\Users\satang\Desktop\bot_node_satang\dis3\handler\command.js
C:\Users\satang\Desktop\bot_node_satang\dis3\index.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:94:18)
at C:\Users\satang\Desktop\bot_node_satang\dis3\handler\command.js:15:26
at Array.forEach ()
at module.exports (C:\Users\satang\Desktop\bot_node_satang\dis3\handler\command.js:12:32)
at C:\Users\satang\Desktop\bot_node_satang\dis3\index.js:68:34
at Array.forEach ()
at Object. (C:\Users\satang\Desktop\bot_node_satang\dis3\index.js:67:13) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\Users\satang\Desktop\bot_node_satang\dis3\handler\command.js',
'C:\Users\satang\Desktop\bot_node_satang\dis3\index.js'
]
}

Can anyone find the error?

HELP ME PLESSS