问:
Spring Data Cloud Datastore gives unexpected results
I have an entity (named "clusters") on Google Cloud Datastore:

```<code>| Key  | creationDate     | clusterId | nodes                                                        |
|------|------------------|-----------|--------------------------------------------------------------|
| key1 | 1669796764124000 | cluster-1 | [{"name":"master1"}, {"name":"worker1"}, {"name":"worker2"}] |
| key2 | 1669797665953000 | cluster-2 | [{"name":"master1"}, {"name":"worker1"}, {"name":"worker2"}] |
</code>```

When I run the following query on GCP Datastore console:

SELECT creationDate, nodes.name
FROM clusters WHERE clusterId = 'cluster-1'
AND creationDate > [start_date] AND creationDate < [end_date]
ORDER BY creationDate ASC
```
<p>it gives me the correct result like below:</p>
```| Key  | creationDate     | nodes.name |
|------|------------------|------------|
| key1 | 1669796764124000 | master1    |
| key1 | 1669796764124000 | worker1    |
| key1 | 1669796764124000 | worker2    |
```
<p>(I've created proper indexes as well)</p>
<p>But the problem is when I try to implement the same query on Spring Data Cloud Datastore it returns the same count of results but instead of the unique values of "nodes.name" I'm getting same "worker2" value for all rows:</p>
```NodesProjection(id=key1, clusterId=null, creationDate=1669796764124000, nodeName=worker2)
NodesProjection(id=key1, clusterId=null, creationDate=1669796764124000, nodeName=worker2)
NodesProjection(id=key1, clusterId=null, creationDate=1669796764124000, nodeName=worker2)
```
<p>Here are my Entity and Repository classes:</p>
<pre class="lang-java prettyprint-override"><code>import com.google.cloud.spring.data.datastore.core.mapping.Entity;
import com.google.cloud.spring.data.datastore.core.mapping.Field;
import lombok.Data;
import org.springframework.data.annotation.Id;

@Data
@Entity(name = "clusters")
public class NodesProjection {
    @Id
    private String id;
    private String clusterId;
    private Long creationDate;
    @Field(name = "nodes.name")
    private String nodeName;
}
</code>```

import com.google.cloud.spring.data.datastore.repository.DatastoreRepository;
import com.google.cloud.spring.data.datastore.repository.query.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.util.List;

@Repository
public interface ClusterNodesProjectionRepository extends DatastoreRepository<NodesProjection, String> {
    @Query("select creationDate, nodes.name from clusters where clusterId = @cluster_id " +
            "AND creationDate > @start_date " +
            "AND creationDate < @end_date " +
            "ORDER BY creationDate ASC")
    List<NodesProjection> findNodesByClusterIdAndCreationDateInBetween(@Param("cluster_id") String clusterId,
                                                                        @Param("start_date") LocalDateTime startDate,
                                                                        @Param("end_date") LocalDateTime endDate);

}
```

I'm not sure If I have some issues with entity mapping or what, and could not find anything reasonable from the documentation as well.

Body:
I have an entity (named "clusters") on Google Cloud Datastore:

| Key  | creationDate     | clusterId | nodes                                                        |
|------|------------------|-----------|--------------------------------------------------------------|
| key1 | 1669796764124000 | cluster-1 | [{"name":"master1"}, {"name":"worker1"}, {"name":"worker2"}] |
| key2 | 1669797665953000 | cluster-2 | [{"name":"master1"}, {"name":"worker1"}, {"name":"worker2"}] |

When I run the following query on GCP Datastore console:

SELECT creationDate, nodes.name
FROM clusters WHERE clusterId = 'cluster-1'
AND creationDate > [start_date] AND creationDate < [end_date]
ORDER BY creationDate ASC

it gives me the correct result like below:

| Key  | creationDate     | nodes.name |
|------|------------------|------------|
| key1 | 1669796764124000 | master1    |
| key1 | 1669796764124000 | worker1    |
| key1 | 1669796764124000 | worker2    |

(I've created proper indexes as well)

But the problem is when I try to implement the same query on Spring Data Cloud Datastore it returns the same count of results but instead of the unique values of "nodes.name" I'm getting same "worker2" value for all rows:

NodesProjection(id=key1, clusterId=null, creationDate=1669796764124000, nodeName=worker2)
NodesProjection(id=key1, clusterId=null, creationDate=1669796764124000, nodeName=worker2)
NodesProjection(id=key1, clusterId=null, creationDate=1669796764124000, nodeName=worker2)

Here are my Entity and Repository classes:

import com.google.cloud.spring.data.datastore.core.mapping.Entity;
import com.google.cloud.spring.data.datastore.core.mapping.Field;
import lombok.Data;
import org.springframework.data.annotation.Id;

@Data
@Entity(name = "clusters")
public class NodesProjection {
    @Id
    private String id;
    private String clusterId;
    private Long creationDate;
    @Field(name = "nodes.name")
    private String nodeName;
}

import com.google.cloud.spring.data.datastore.repository.DatastoreRepository;
import com.google.cloud.spring.data.datastore.repository.query.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.util.List;

@Repository
public interface ClusterNodesProjectionRepository extends DatastoreRepository<NodesProjection, String> {
    @Query("select creationDate, nodes.name from clusters where clusterId = @cluster_id " +
            "AND creationDate > @start_date " +
            "AND creationDate < @end_date " +
            "ORDER BY creationDate ASC")
    List<NodesProjection> findNodesByClusterIdAndCreationDateInBetween(@Param("cluster_id") String clusterId,
                                                                        @Param("start_date") LocalDateTime startDate,
                                                                        @Param("end_date") LocalDateTime endDate);

}

I'm not sure If I have some issues with entity mapping or what, and could not find anything reasonable from the documentation as well.


来源: stackexchange

问:
Cannot show customer 50x html in Create React App with NGINX build
I am build nginx with CRA as frontend and also have own backend api
I have problem in redirecting to 50x.html when the backend return 50x

I have follow the solution in
nginx is not showing custom 50x error page with php-fpm
and

nginx custom error page 502 with css and image files

My Dockerfile was as below:

```<code>FROM node:18-bullseye-slim as react_build
#also say
WORKDIR /app
#copy the react app to the container
#
COPY package*.json ./
#COPY . /app/
COPY . .

# #prepare the contiainer for building react
RUN npm install --silent
RUN npm install react-scripts@5.0.1 -g --silent
RUN npm run build

#prepare nginx
FROM nginx:1.16.0-alpine

COPY --from=react_build /app/build /usr/share/nginx/html
RUN rm /etc/nginx/conf.d/default.conf
COPY nginx/nginx.conf /etc/nginx/conf.d
COPY nginx/50x.html /usr/share/nginx/html

#fire up nginx
EXPOSE 80
CMD ["nginx","-g","daemon off;"]
</code>```

and my nginx.conf was located in nginx folder in the root of the CRA, it was as shown in below:

```<code>    server {

  listen 80;

  error_page   500 502 503 504  /50x.html;
  location = /50x.html {
    root    /usr/share/nginx/html;
    try_files $uri $uri/ /50x.html = 500 502 503;
  }
  location / {
    root   /usr/share/nginx/html;
    index  index.html index.htm;
    try_files $uri $uri/ /index.html;
  }

}
</code>```

my frontend return this:

```<code>{
"message": "Request failed with status code 500",
"name": "AxiosError",
"stack": "AxiosError: Request failed with status code 500\n    at http://localhost:3001/static/js/main.ae2e2cbe.js:2:430462\n    at XMLHttpRequest.d (http://localhost:3001/static/js/main.ae2e2cbe.js:2:430610)",
"config": {
    "transitional": {
        "silentJSONParsing": true,
        "forcedJSONParsing": true,
        "clarifyTimeoutError": false
    },
    "transformRequest": [
        null
    ],
    "transformResponse": [
        null
    ],
    "timeout": 0,
    "xsrfCookieName": "XSRF-TOKEN",
    "xsrfHeaderName": "X-XSRF-TOKEN",
    "maxContentLength": -1,
    "maxBodyLength": -1,
    "env": {},
    "headers": {
        "Accept": "application/json, text/plain, */*",
        "Authorization": "ApiKey V**********************==",
        "apikey": "V************************==",
        "apikey_id": "Tx5dBYUBFwx4oQ2b15KP"
    },
    "params": {
        "path": "/test/test",
        "size": 10,
        "order": "desc"
    },
    "method": "get",
    "url": "http://192.168.13.251:8000/device/"
},
"code": "ERR_BAD_RESPONSE",
"status": 500
</code>```

}

and i have try:

```<code>    server {
  listen 80;

  location / {
    rewrite ^/viewer(/.*)$ $1 break;
    root   /usr/share/nginx/html;
    index  index.html index.htm;
    try_files $uri $uri/ /index.html;
  }
  error_page   500 502 503 504  /50x.html;
  location = /50x.html {
    root   /usr/share/nginx/html;
  }
}
</code>```

without success, i would appreciate if someone can help,thanks
Jeff

ContentLicense: CC BY-SA 4.0

Body:
I am build nginx with CRA as frontend and also have own backend api
I have problem in redirecting to 50x.html when the backend return 50x

I have follow the solution in
nginx is not showing custom 50x error page with php-fpm
and

nginx custom error page 502 with css and image files

My Dockerfile was as below:

FROM node:18-bullseye-slim as react_build
#also say
WORKDIR /app
#copy the react app to the container
#
COPY package*.json ./
#COPY . /app/
COPY . .

# #prepare the contiainer for building react
RUN npm install --silent
RUN npm install react-scripts@5.0.1 -g --silent
RUN npm run build

#prepare nginx
FROM nginx:1.16.0-alpine

COPY --from=react_build /app/build /usr/share/nginx/html
RUN rm /etc/nginx/conf.d/default.conf
COPY nginx/nginx.conf /etc/nginx/conf.d
COPY nginx/50x.html /usr/share/nginx/html

#fire up nginx
EXPOSE 80
CMD ["nginx","-g","daemon off;"]

and my nginx.conf was located in nginx folder in the root of the CRA, it was as shown in below:

    server {

  listen 80;

  error_page   500 502 503 504  /50x.html;
  location = /50x.html {
    root    /usr/share/nginx/html;
    try_files $uri $uri/ /50x.html = 500 502 503;
  }
  location / {
    root   /usr/share/nginx/html;
    index  index.html index.htm;
    try_files $uri $uri/ /index.html;
  }

}

my frontend return this:

{
"message": "Request failed with status code 500",
"name": "AxiosError",
"stack": "AxiosError: Request failed with status code 500\n    at http://localhost:3001/static/js/main.ae2e2cbe.js:2:430462\n    at XMLHttpRequest.d (http://localhost:3001/static/js/main.ae2e2cbe.js:2:430610)",
"config": {
    "transitional": {
        "silentJSONParsing": true,
        "forcedJSONParsing": true,
        "clarifyTimeoutError": false
    },
    "transformRequest": [
        null
    ],
    "transformResponse": [
        null
    ],
    "timeout": 0,
    "xsrfCookieName": "XSRF-TOKEN",
    "xsrfHeaderName": "X-XSRF-TOKEN",
    "maxContentLength": -1,
    "maxBodyLength": -1,
    "env": {},
    "headers": {
        "Accept": "application/json, text/plain, */*",
        "Authorization": "ApiKey V**********************==",
        "apikey": "V************************==",
        "apikey_id": "Tx5dBYUBFwx4oQ2b15KP"
    },
    "params": {
        "path": "/test/test",
        "size": 10,
        "order": "desc"
    },
    "method": "get",
    "url": "http://192.168.13.251:8000/device/"
},
"code": "ERR_BAD_RESPONSE",
"status": 500

}

and i have try:

    server {
  listen 80;

  location / {
    rewrite ^/viewer(/.*)$ $1 break;
    root   /usr/share/nginx/html;
    index  index.html index.htm;
    try_files $uri $uri/ /index.html;
  }
  error_page   500 502 503 504  /50x.html;
  location = /50x.html {
    root   /usr/share/nginx/html;
  }
}

without success, i would appreciate if someone can help,thanks
Jeff


问:
Google Timeline chart to display 2 rows of same name for a single day
I am trying to create a timeline chart with same start and end date. consider the following code,

```<code>     dataTable.addRows([
      [ 'Minister', 'Geo', new Date(1801, 2, 1), new Date(1801, 2, 10) ],
      [ 'Minister', 'Geo', new Date(1801, 2, 15), new Date(1801, 2, 20) ],
      [ 'Secretary', 'Levi', new Date(1801, 2, 5), new Date(1801, 2, 5)],
      [ 'Secretary', 'James', new Date(1801, 2, 5), new Date(1801, 2, 5)],
      [ 'President', 'George', new Date(1801, 2, 15), new Date(1801, 2, 25) ]
]);

</code>```

I want to show the two time periods [James,Levi] under Secretary in a single row when  start and end date are same. After executing, the color bar belonging to 'James' is visible whereas 'Levi' is not. See the following graph,

For time periods with more than a single day, color bars for both 'James' and 'Levi' are visible. See below,

Setting groupByRowLabel will not work for me as it will affect the entries under 'Minister'

```<code>timeline: {
  groupByRowLabel: false
}
</code>```

Can someone tell why color bar is not visible for single day entries.
TIA

Body:
I am trying to create a timeline chart with same start and end date. consider the following code,

     dataTable.addRows([
      [ 'Minister', 'Geo', new Date(1801, 2, 1), new Date(1801, 2, 10) ],
      [ 'Minister', 'Geo', new Date(1801, 2, 15), new Date(1801, 2, 20) ],
      [ 'Secretary', 'Levi', new Date(1801, 2, 5), new Date(1801, 2, 5)],
      [ 'Secretary', 'James', new Date(1801, 2, 5), new Date(1801, 2, 5)],
      [ 'President', 'George', new Date(1801, 2, 15), new Date(1801, 2, 25) ]
]);

I want to show the two time periods [James,Levi] under Secretary in a single row when  start and end date are same. After executing, the color bar belonging to 'James' is visible whereas 'Levi' is not. See the following graph,

For time periods with more than a single day, color bars for both 'James' and 'Levi' are visible. See below,

Setting groupByRowLabel will not work for me as it will affect the entries under 'Minister'

timeline: {
  groupByRowLabel: false
}

Can someone tell why color bar is not visible for single day entries.
TIA


问:
Caret package not possible to install
I get this error on my Mac when I try to install caret with its dependencies:

```<code>ERROR: failed to lock directory ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library’ for modifying
Try removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-clock’

Warning in install.packages :
  installation of package ‘clock’ had non-zero exit status
* installing *source* package ‘recipes’ ...
**
Paket ‘recipes’ erfolgreich entpackt und MD5 Summen überprüft
**
using staged installation
**
R
**
inst
**
byte-compile and prepare package for lazy loading

Fehler in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
  there is no package called ‘lava’
Ruft auf: <Anonymous> ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Ausführung angehalten
ERROR: lazy loading failed for package ‘recipes’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/recipes’
Warning in install.packages :
  installation of package ‘recipes’ had non-zero exit status
ERROR: dependency ‘recipes’ is not available for package ‘caret’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/caret’
Warning in install.packages :
  installation of package ‘caret’ had non-zero exit status
</code>```

Any ideas what the problem could be?

I already tried to update all R packages but it did not work

Title: Caret package not possible to install

Body:
I get this error on my Mac when I try to install caret with its dependencies:

ERROR: failed to lock directory ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library’ for modifying
Try removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-clock’

Warning in install.packages :
  installation of package ‘clock’ had non-zero exit status
* installing *source* package ‘recipes’ ...
**
Paket ‘recipes’ erfolgreich entpackt und MD5 Summen überprüft
**
using staged installation
**
R
**
inst
**
byte-compile and prepare package for lazy loading

Fehler in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
  there is no package called ‘lava’
Ruft auf: <Anonymous> ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Ausführung angehalten
ERROR: lazy loading failed for package ‘recipes’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/recipes’
Warning in install.packages :
  installation of package ‘recipes’ had non-zero exit status
ERROR: dependency ‘recipes’ is not available for package ‘caret’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/caret’
Warning in install.packages :
  installation of package ‘caret’ had non-zero exit status

Any ideas what the problem could be?

I already tried to update all R packages but it did not work


问:
Missing some CSS stylings after sending the SendGrid dynamic mail
I created a dynamic email template in sendGrid. But the problmen is after sending the email some CSS stylings are missing. What are the best practices for guaranteeing that all CSS stylings (e.g. font size, line-height, font-family) are consistently preserved when sending a dynamic email template created in SendGrid? Are there any specific settings or approaches that need to be considered in order to ensure that the template is rendered properly on various email clients?</p>


问:
Dependencies installation failure in rasa due to Tensor flow
Rasa Open Source version
2.4.3

Rasa SDK version
2.8.5

Python version
3.7.5

Python Library : Tensor flow 2.3.4

What operating system are you using?
Operating System: Ubuntu 18.04.6 LTS
Kernel: Linux 5.4.0-1090-oracle
Architecture: arm64

What happened?
During a fresh install of Tensor flow:

```<code>ERROR: Could not find a version that satisfies the requirement tensor flow-text<2.4,>=2.3; sys_platform != "win32" (from rasa) (from versions: none)
ERROR: No matching distribution found for tensorflow-text<2.4,>=2.3; sys_platform != "win32"
</code>```

It does not work even after upgrading the tensor flow to 2.9.0

Upgraded Tensor flow 2.7 but still is giving an error download latest version

Upgrade pip version from 20 to 22 pip version upgrade

pip debug --verbose is giving me error: enter image description here

Body:
Rasa Open Source version
2.4.3

Rasa SDK version
2.8.5

Python version
3.7.5

Python Library : Tensor flow 2.3.4

What operating system are you using?
Operating System: Ubuntu 18.04.6 LTS
Kernel: Linux 5.4.0-1090-oracle
Architecture: arm64

What happened?
During a fresh install of Tensor flow:

ERROR: Could not find a version that satisfies the requirement tensor flow-text<2.4,>=2.3; sys_platform != "win32" (from rasa) (from versions: none)
ERROR: No matching distribution found for tensorflow-text<2.4,>=2.3; sys_platform != "win32"

It does not work even after upgrading the tensor flow to 2.9.0

Upgraded Tensor flow 2.7 but still is giving an error download latest version

Upgrade pip version from 20 to 22 pip version upgrade

pip debug --verbose is giving me error: enter image description here


问:
How to display random selected month and year instead of current month and year in angular ngbdatepicker?
The $event.next contains current month and current year. But i want to display random year and month. How to get this when the calendar is opened?

this code is working fine when the calendar is selected 2nd time. first time, it shows current month and year and second time, it shows the random year i wanted to select.

```<code>HTML code for displaying minDate is as shown below.

<div class="q-datepicker" style="display: flex;">
                          <input [startDate]="minDate" (navigate)="dateNavigate($event)" (dateSelect)="DateChageValidation($event,'Idea')" style="width:100%;font-weight: bold;font-size: 16px;color: #0024d3 !important;" class="datepicker-input CustomerInfo" [minDate]="{year: minYear, month: 1, day: 1}" [maxDate]="{year: maxYear, month: 12, day: 31}" (change)="Autosaveprojectinformation()" [(value)]="ideaActualDate" [(ngModel)]="ideaActualDate" ngbDatepicker #pmsgate6a="ngbDatepicker" container="body" [showWeekNumbers]="true" [firstDayOfWeek]="1">
                          <em class="far fa-calendar-minus" style="color: #0024d3 !important;padding-top: 6px;padding-bottom: -2px; cursor: pointer;" (click)="pmsgate6a.toggle()"></em>
                        </div>
</code>```
```<code>ts file code for displaying the minDate is as shown below

public dateNavigate($event: NgbDatepickerNavigateEvent) {
    let splitDate = this.ideaPlannedDate.split('-');
    let monthNum = this.getMonthNum(splitDate[1]);
    $event.next.month = monthNum;
    $event.next.year = Number(splitDate[2]);
    this.minDate = {
      year: $event.next.year,
      month: $event.next.month
    };
  }
  public getMonthNum(monthName: string): number {
    switch(monthName) {
      case 'Jan': return 1;
      case 'Feb': return 2;
      case 'Mar': return 3;
      case 'Apr': return 4;
      case 'May': return 5;
      case 'Jun': return 6;
      case 'Jul': return 7;
      case 'Aug': return 8;
      case 'Sep': return 9;
      case 'Oct': return 10;
      case 'Nov': return 11;
      case 'Dec': return 12;
    }
  }

</code>```

Body:
The $event.next contains current month and current year. But i want to display random year and month. How to get this when the calendar is opened?

this code is working fine when the calendar is selected 2nd time. first time, it shows current month and year and second time, it shows the random year i wanted to select.

HTML code for displaying minDate is as shown below.

                          <input [startDate]="minDate" (navigate)="dateNavigate($event)" (dateSelect)="DateChageValidation($event,'Idea')" style="width:100%;font-weight: bold;font-size: 16px;color: #0024d3 !important;" class="datepicker-input CustomerInfo" [minDate]="{year: minYear, month: 1, day: 1}" [maxDate]="{year: maxYear, month: 12, day: 31}" (change)="Autosaveprojectinformation()" [(value)]="ideaActualDate" [(ngModel)]="ideaActualDate" ngbDatepicker #pmsgate6a="ngbDatepicker" container="body" [showWeekNumbers]="true" [firstDayOfWeek]="1">

ts file code for displaying the minDate is as shown below

public dateNavigate($event: NgbDatepickerNavigateEvent) {
    let splitDate = this.ideaPlannedDate.split('-');
    let monthNum = this.getMonthNum(splitDate[1]);
    $event.next.month = monthNum;
    $event.next.year = Number(splitDate[2]);
    this.minDate = {
      year: $event.next.year,
      month: $event.next.month
    };
  }
  public getMonthNum(monthName: string): number {
    switch(monthName) {
      case 'Jan': return 1;
      case 'Feb': return 2;
      case 'Mar': return 3;
      case 'Apr': return 4;
      case 'May': return 5;
      case 'Jun': return 6;
      case 'Jul': return 7;
      case 'Aug': return 8;
      case 'Sep': return 9;
      case 'Oct': return 10;
      case 'Nov': return 11;
      case 'Dec': return 12;
    }
  }


问:
getting e notation values when stacking into a numpy array in python
I am stacking point clouds into one array using np.stack but when i see the result the values are shown  in e notation. if i only stack x and y then the values are not shown in e notation only if i add the z column its shown in e notation

for stacking two values

```<code>import laspy
import numpy as np

las = laspy.read("f:\\lidar\\pointcloud.laz")

arr = np.stack([las.x, las.y], axis=0).transpose((1, 0))
arr

array([[ 368230.825, 5807507.866],
       [ 368231.821, 5807508.151],
       [ 368232.935, 5807508.114],
       ...,
       [ 368496.193, 5807742.345],
       [ 368495.747, 5807741.916],
       [ 368495.412, 5807742.06 ]])
</code>```

values when stacking with z values.

```<code>import laspy
import numpy as np

las = laspy.read("f:\\lidar\\pointcloud.laz")

arr = np.stack([las.x, las.y,las.z], axis=0).transpose((1, 0))
arr

array([[3.68230825e+05, 5.80750787e+06, 3.10790000e+01],
       [3.68231821e+05, 5.80750815e+06, 3.11140000e+01],
       [3.68232935e+05, 5.80750811e+06, 3.11320000e+01],
       ...,
       [3.68496193e+05, 5.80774234e+06, 3.33270000e+01],
       [3.68495747e+05, 5.80774192e+06, 3.29020000e+01],
       [3.68495412e+05, 5.80774206e+06, 3.13750000e+01]])
</code>```

Body:
I am stacking point clouds into one array using np.stack but when i see the result the values are shown  in e notation. if i only stack x and y then the values are not shown in e notation only if i add the z column its shown in e notation

for stacking two values

import laspy
import numpy as np

las = laspy.read("f:\\lidar\\pointcloud.laz")

arr = np.stack([las.x, las.y], axis=0).transpose((1, 0))
arr

array([[ 368230.825, 5807507.866],
       [ 368231.821, 5807508.151],
       [ 368232.935, 5807508.114],
       ...,
       [ 368496.193, 5807742.345],
       [ 368495.747, 5807741.916],
       [ 368495.412, 5807742.06 ]])

values when stacking with z values.

import laspy
import numpy as np

las = laspy.read("f:\\lidar\\pointcloud.laz")

arr = np.stack([las.x, las.y,las.z], axis=0).transpose((1, 0))
arr

array([[3.68230825e+05, 5.80750787e+06, 3.10790000e+01],
       [3.68231821e+05, 5.80750815e+06, 3.11140000e+01],
       [3.68232935e+05, 5.80750811e+06, 3.11320000e+01],
       ...,
       [3.68496193e+05, 5.80774234e+06, 3.33270000e+01],
       [3.68495747e+05, 5.80774192e+06, 3.29020000e+01],
       [3.68495412e+05, 5.80774206e+06, 3.13750000e+01]])


问:
Pre-training BERT - `cls_token_idx`
I am trying to pre-train BERT on a domain specific dataset using the official tensorflow code and I am wondering what does the `cls_token_idx` refer to in this `config.yaml` file:

```<code>model:
    cls_heads: [{activation: tanh, cls_token_idx: 0, dropout_rate: 0.1, inner_dim: 768, name: next_sentence, num_classes: 2}]
    encoder:
      type: bert
      bert:
        ...
</code>```

Searching a little bit in the source code, I found that:

```<code>...
cls_token_idx: The index inside the sequence to pool.
...
if not self.inner_dim:
  x = features
else:
  x = features[:, self.cls_token_idx, :]  # take <CLS> token.
  x = self.dense(x)
</code>```

Is the cls_token_idx referring to the index of [CLS] token in the vocabulary or the index of [CLS] token in the sequence?

For example, let's say we have the following input:

```<code>tokens:  [CLS] ... [SEP] ... [SEP]
input_ids: 2   ...   3   ...   3
</code>```

Should I consider the cls_token_idx (when configuring the .yaml file) 0 (idx in the seq) or 2 (idx in the vocab)?

Thank you!

Title: Pre-training BERT - `cls_token_idx`

Body:
I am trying to pre-train BERT on a domain specific dataset using the official tensorflow code and I am wondering what does the `cls_token_idx` refer to in this `config.yaml` file:

model:
    cls_heads: [{activation: tanh, cls_token_idx: 0, dropout_rate: 0.1, inner_dim: 768, name: next_sentence, num_classes: 2}]
    encoder:
      type: bert
      bert:
        ...

Searching a little bit in the source code, I found that:

...
cls_token_idx: The index inside the sequence to pool.
...
if not self.inner_dim:
  x = features
else:
  x = features[:, self.cls_token_idx, :]  # take <CLS> token.
  x = self.dense(x)

Is the cls_token_idx referring to the index of [CLS] token in the vocabulary or the index of [CLS] token in the sequence?

For example, let's say we have the following input:

tokens:  [CLS] ... [SEP] ... [SEP]
input_ids: 2   ...   3   ...   3

Should I consider the cls_token_idx (when configuring the .yaml file) 0 (idx in the seq) or 2 (idx in the vocab)?

Thank you!


问:
What could be the cause of slow performance in both confirm sale.order and validate stock.picking?
In one of my databases that has more than 10k products and thousands of contacts, sale orders, and inventory transfers, it has a weird slow performance every time the Confirm (action_sale_ok) button is clicked in sale.order, and the same slow performance also happens when processing Validate (button_validate) button in stock.picking.

The issue is that the page takes more than 10 seconds to finish the process while displaying a loading screen that disables the user to do anything.

What could be the cause of this problem?

I tried debugging in many places in stock.picking, and stock.move that relates to button_validate, but found nothing. It seems like it is something that is executed after the validation process that I can't trace to it -- maybe some depend methods.


问:
Spring Boot Redisson not able to read clusterServersConfig
Here is the application.yml I am using for my Spring WebFlux project

redis:
  redisson:
    config: |
      clusterServersConfig:
        idleConnectionTimeout: 10000
        connectTimeout: ${REDISSON_CONNECT_TIMEOUT:20000}
        timeout: ${REDISSON_TIMEOUT:3000}
        retryAttempts: ${REDISSON_RETRY_ATTEMPTS:3}
        retryInterval: ${REDISSON_RETRY_INTERVAL:1500}
        subscriptionConnectionPoolSize: ${REDISSON_SUBSCRIPTION_POOL_SIZE:50}
        slaveConnectionMinimumIdleSize: ${REDISSON_SLAVE_MIN_IDLE_SIZE:24}
        slaveConnectionPoolSize: ${REDISSON_SLAVE_POOL_SIZE:48}
        masterConnectionMinimumIdleSize: ${REDISSON_MASTER_MIN_IDLE_SIZE:24}
        masterConnectionPoolSize: ${REDISSON_MASTER_POOL_SIZE:48}
        nodeAddresses:
          - "rediss://${APPS_REDIS:-}:${APPS_REDIS_PORT:6379}"
        password: ${APPS_REDIS_SECRET:-}
      threads: ${REDISSON_THREADS:16}
      nettyThreads: ${REDISSON_NETTY_THREADS:96}
```
<p>But whenever I am starting the project in my laptop, this error comes up</p>
```Caused by: com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'clusterServersConfig': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
```

I am not sure why it is saying clusterServersConfig is an unrecognized token. In the official doc also, it is mentioned and here is an example of this.

At first I thought it might be because I am running redis locally in my M1 Mac so redis-clusters aren't generated by default. I even tried to enable clusters in redis.conf and run a redis clusters with 3 nodes using redis-cli but still this happens. I have tried almost everything I could think of or search on the net. Any help appreciated :)

Body:
Here is the application.yml I am using for my Spring WebFlux project

redis:
  redisson:
    config: |
      clusterServersConfig:
        idleConnectionTimeout: 10000
        connectTimeout: ${REDISSON_CONNECT_TIMEOUT:20000}
        timeout: ${REDISSON_TIMEOUT:3000}
        retryAttempts: ${REDISSON_RETRY_ATTEMPTS:3}
        retryInterval: ${REDISSON_RETRY_INTERVAL:1500}
        subscriptionConnectionPoolSize: ${REDISSON_SUBSCRIPTION_POOL_SIZE:50}
        slaveConnectionMinimumIdleSize: ${REDISSON_SLAVE_MIN_IDLE_SIZE:24}
        slaveConnectionPoolSize: ${REDISSON_SLAVE_POOL_SIZE:48}
        masterConnectionMinimumIdleSize: ${REDISSON_MASTER_MIN_IDLE_SIZE:24}
        masterConnectionPoolSize: ${REDISSON_MASTER_POOL_SIZE:48}
        nodeAddresses:
          - "rediss://${APPS_REDIS:-}:${APPS_REDIS_PORT:6379}"
        password: ${APPS_REDIS_SECRET:-}
      threads: ${REDISSON_THREADS:16}
      nettyThreads: ${REDISSON_NETTY_THREADS:96}

But whenever I am starting the project in my laptop, this error comes up

Caused by: com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'clusterServersConfig': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')

I am not sure why it is saying clusterServersConfig is an unrecognized token. In the official doc also, it is mentioned and here is an example of this.

At first I thought it might be because I am running redis locally in my M1 Mac so redis-clusters aren't generated by default. I even tried to enable clusters in redis.conf and run a redis clusters with 3 nodes using redis-cli but still this happens. I have tried almost everything I could think of or search on the net. Any help appreciated :)


问:
How to format API response
I'm writing a react app that fetches data from a DynamoDB table using a Lambda function. The function successfully retrieves an array of objects as shown below. I've tested this in the AWS console and in Postman.

[
  {
    "Obj1Key1": {
      "S": "Obj1Value1"
    },
    "Obj1Key2": {
      "S": "Obj1Value2"
    },
    "Obj1Key3": {
      "S": "Obj1Value3"
    },
    "Obj1Key4": {
      "S": "Obj1Value4"
    }
  },
    {
    "Obj2Key1": {
      "S": "Obj2Value1"
    },
    "Obj2Key2": {
      "S": "Obj2Value2"
    },
    "Obj2Key3": {
      "S": "Obj2Value3"
    },
    "Obj2Key4": {
      "S": "Obj2Value4"
    }
  },
      {
    "Obj3Key1": {
      "S": "Obj3Value1"
    },
    "Obj3Key2": {
      "S": "Obj3Value2"
    },
    "Obj3Key3": {
      "S": "Obj3Value3"
    },
    "Obj3Key4": {
      "S": "Obj3Value4"
    }
  }
]```
</div>
</div>
</p>
<p>..and below is the function in the React app that gets the data:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code> ...
 ...
 const [ response , setResponse ]  = useState();
 ...

 async function fetchData() {
    try {
      const body = JSON.stringify({
        etc....
      });

      await fetch("https://url..etc", {
        method: "POST",
        headers: { "Content-Type": "application/json"},
        body: body
      }).then(res => setResponse(res))

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

However When I get the raw response from the React app, and I console log it, my console shows the following

How can I get the array of objects from this response? I tried different combinations of parsing and stringifying but was not able to get the array as an array. Adding .then(res => res.text()). before .then(res => setResponse(res)) gets me the response I'm looking for but as a string. I need to get it as an array.

Thank you

Title: How to format API response

Body:
I'm writing a react app that fetches data from a DynamoDB table using a Lambda function. The function successfully retrieves an array of objects as shown below. I've tested this in the AWS console and in Postman.

[
  {
    "Obj1Key1": {
      "S": "Obj1Value1"
    },
    "Obj1Key2": {
      "S": "Obj1Value2"
    },
    "Obj1Key3": {
      "S": "Obj1Value3"
    },
    "Obj1Key4": {
      "S": "Obj1Value4"
    }
  },
    {
    "Obj2Key1": {
      "S": "Obj2Value1"
    },
    "Obj2Key2": {
      "S": "Obj2Value2"
    },
    "Obj2Key3": {
      "S": "Obj2Value3"
    },
    "Obj2Key4": {
      "S": "Obj2Value4"
    }
  },
      {
    "Obj3Key1": {
      "S": "Obj3Value1"
    },
    "Obj3Key2": {
      "S": "Obj3Value2"
    },
    "Obj3Key3": {
      "S": "Obj3Value3"
    },
    "Obj3Key4": {
      "S": "Obj3Value4"
    }
  }
]

..and below is the function in the React app that gets the data:

 ...
 ...
 const [ response , setResponse ]  = useState();
 ...

 async function fetchData() {
    try {
      const body = JSON.stringify({
        etc....
      });

      await fetch("https://url..etc", {
        method: "POST",
        headers: { "Content-Type": "application/json"},
        body: body
      }).then(res => setResponse(res))

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

However When I get the raw response from the React app, and I console log it, my console shows the following

How can I get the array of objects from this response? I tried different combinations of parsing and stringifying but was not able to get the array as an array. Adding .then(res => res.text()). before .then(res => setResponse(res)) gets me the response I'm looking for but as a string. I need to get it as an array.

Thank you


问:
Are filepaths in the layerdb random for OverlayFS?
I'm trying to understand how the Docker layerdb works and am confused about how Docker stores information in the layerdb.

I created a very simple image with 3 layers

```<code>FROM ubuntu
RUN apt-get update
RUN apt-get install -y python3
</code>```

When I inspect the image I get

```<code> "RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:6515074984c6f8bb1b8a9962c8fb5f310fc85e70b04c88442a3939c026dbfad3",
                "sha256:248dfada031369060fd48c5fa9f8ce888d467651c1a9c01fe97acbc813e4b629",
                "sha256:a339a99118749b8cfd59ee816172d0b5da19bae5bd65e020fd5983357d9123fe"
            ]
        },
</code>```

For the first layer, there is a corresponding directory with the name 6515074984c6f8bb1b8a9962c8fb5f310fc85e70b04c88442a3939c026dbfad3. This makes sense to me, the layer directory has the same name as the hash

For the next layer 248dfada031369060fd48c5fa9f8ce888d467651c1a9c01fe97acbc813e4b629 there is no directory in the layerdb with that name. Instead I find this hash in df3566a26ffeaf9233f0878dde886a70a87fd3ec78b8bd315cb53b2f8aa552fb/diff, why is this directory named completely differently from the hash of the layer? Do these names mean anything? Finally, is the hash found in diff a hash of the raw bytes found in the folder pointed to by the cache id?

Body:
I'm trying to understand how the Docker layerdb works and am confused about how Docker stores information in the layerdb.

I created a very simple image with 3 layers

FROM ubuntu
RUN apt-get update
RUN apt-get install -y python3

When I inspect the image I get

 "RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:6515074984c6f8bb1b8a9962c8fb5f310fc85e70b04c88442a3939c026dbfad3",
                "sha256:248dfada031369060fd48c5fa9f8ce888d467651c1a9c01fe97acbc813e4b629",
                "sha256:a339a99118749b8cfd59ee816172d0b5da19bae5bd65e020fd5983357d9123fe"
            ]
        },

For the first layer, there is a corresponding directory with the name 6515074984c6f8bb1b8a9962c8fb5f310fc85e70b04c88442a3939c026dbfad3. This makes sense to me, the layer directory has the same name as the hash

For the next layer 248dfada031369060fd48c5fa9f8ce888d467651c1a9c01fe97acbc813e4b629 there is no directory in the layerdb with that name. Instead I find this hash in df3566a26ffeaf9233f0878dde886a70a87fd3ec78b8bd315cb53b2f8aa552fb/diff, why is this directory named completely differently from the hash of the layer? Do these names mean anything? Finally, is the hash found in diff a hash of the raw bytes found in the folder pointed to by the cache id?


问:
How to make nb-card scrollable horizontaly
i just want to make nb-card scrollable horizontaly.
This is my css:

```<code>  nb-card {
    height: 100%;
    width: auto;
    overflow-x: auto;

    ...
  }
</code>```

I tried to set width to 3000px but scroll didn't appear.
Nb-card is a top element in used component in my app.
How i can figure it out, because content inside generates automatically (sometimes i have 3 rows, sometimes 30), thats why i can't set constant value of width.

Body:
i just want to make nb-card scrollable horizontaly.
This is my css:

  nb-card {
    height: 100%;
    width: auto;
    overflow-x: auto;

    ...
  }

I tried to set width to 3000px but scroll didn't appear.
Nb-card is a top element in used component in my app.
How i can figure it out, because content inside generates automatically (sometimes i have 3 rows, sometimes 30), thats why i can't set constant value of width.


问:
VS Code: Error while installing 'ROS' extension. Please check the log for more details
I am Installing the ROS extension in vs-code provided by Microsoft. But I am getting the following error

```<code>VS Code: Error while installing 'ROS' extension. Please check the log for more details.
</code>```

'ROS' extension is also not available on 'https://open-vsx.org/' so how I can download this extension?

Body:
I am Installing the ROS extension in vs-code provided by Microsoft. But I am getting the following error

VS Code: Error while installing 'ROS' extension. Please check the log for more details.

'ROS' extension is also not available on 'https://open-vsx.org/' so how I can download this extension?


问:
Permission to "my_github_repository" denied to "username"
I'm trying to upload my work in my github repository. The computer I'm using is shared, another student was using it with his github account, so now here is mu problem:

when I try to push to my repo this message appears:

```<code>$ git push https://github.com/Ruex97/Sprint-1-Tasca-3.git
remote: Permission to Ruex97/Sprint-1-Tasca-3.git denied to his_username.
fatal: unable to access 'https://github.com/Ruex97/Sprint-1-Tasca-3.git/': The requested URL returned error: 403
</code>```

I guess if i change it to my username in git problem should be solved, but i updated user and email and still have the error. Any help?

Body:
I'm trying to upload my work in my github repository. The computer I'm using is shared, another student was using it with his github account, so now here is mu problem:

when I try to push to my repo this message appears:

$ git push https://github.com/Ruex97/Sprint-1-Tasca-3.git
remote: Permission to Ruex97/Sprint-1-Tasca-3.git denied to his_username.
fatal: unable to access 'https://github.com/Ruex97/Sprint-1-Tasca-3.git/': The requested URL returned error: 403

I guess if i change it to my username in git problem should be solved, but i updated user and email and still have the error. Any help?


问:
Laravel Livewire, prevent selection lists from scrolling up on update
I am using Laravel Livewire. I'm intrigued by it's concept, but it's also quite confusing in certain specific situations. I am trying to make a selection list that comes up as a modal like so:

This is the "parent" template:

<x-slot name="breadcrumbs">
    @include('breadcrumbs', [ 'path' => ['roles' => __('messages.roles')]])
</x-slot>

        <x-jet-action-message class="mr-3" on="created">
        {{ __('messages.created_role') }}
        </x-jet-action-message>

{{ __('messages.all_roles_in_system') }}

                    {{ __('messages.add_role') }}

        <livewire:roles.add-role-form />
        <livewire:roles.role-list />

```
<p>The <code>role-list</code> looks like this:</p>
<pre class="lang-php prettyprint-override"><code><div class="mt-8 flex flex-col">
    <div class="-my-2 -mx-4 overflow-x-auto sm:-mx-6 lg:-mx-8">
        <div class="inline-block min-w-full py-2 align-middle md:px-6 lg:px-8">
            <div class="overflow-hidden shadow ring-1 ring-black ring-opacity-5 md:rounded-lg">
                <table class="min-w-full divide-y divide-gray-300">
                    <thead class="bg-gray-50">
                        <tr>
                            <th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">

                                    {{__('messages.name')}}
                                    <span class="invisible ml-2 flex-none rounded text-gray-400 group-hover:visible group-focus:visible">
                                        <svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
                                            <path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"/>
                                        </svg>
                                    </span>

                            </th>
                            <th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6">
                            </th>
                        </tr>
                    </thead>
                    <tbody class="divide-y divide-gray-200 bg-white">
                        @foreach ($roles as $role)
                        <tr class="{{ $role->uuid === $activeRole ? 'bg-joij-green-200' : 'bg-white' }}" wire:key="key-{{ $role->uuid  }}">
                            <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium {{ $role->uuid === $activeRole ? 'text-white' : 'text-gray-900' }} sm:pl-6">{{ $role->name }}</td>
                            <td class="whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6">
                                <button wire:click="toggleActiveRole('{{ $role->uuid }}')" type="button" class="inline-flex items-center rounded-md border border-gray-300 bg-white px-3 py-2 text-sm font-medium leading-4 text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-joij-green-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-30">
                                    <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-3 h-3">
                                        <path stroke-linecap="round" stroke-linejoin="round" d="M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10" />
                                    </svg>
                                </button>
                                <button type="button" class="inline-flex items-center rounded-md border border-gray-300 bg-white px-3 py-2 text-sm font-medium leading-4 text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-joij-green-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-30">
                                    <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-3 h-3">
                                        <path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" />
                                    </svg>
                                </button>
                            </td>
                        </tr>
                        @if ($role->uuid === $activeRole)
                        <tr wire:key="sub-{{ $role->uuid  }}">
                            <td colspan="2" class="relative mb-0 pb-0">
                                <livewire:roles.permission-list wire:key="$role->uuid" :role="$role" />
                            </td>
                        </tr>
                        @endif
                        @endforeach
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
</code>```

And then I have the permission-list:

            Permissions

        @foreach ($role->permissions()->get() as $permission)

            {{ $permission->identifier }}

        @endforeach

                <livewire:roles.permission-dropdown :role="$role" />

```
<p>And then the <code>permission-dropdown</code>:</p>
<pre class="lang-php prettyprint-override"><code><div>
    <button
        type="button" wire:click="togglePermissionList"
        class="relative cursor-default rounded-md border border-gray-300 bg-white py-2 pl-3 pr-10 text-left shadow-sm {{ $showPermissionList ? 'bg-joij-green-500 text-white border-joij-green-500 outline-none ring-1 ring-joij-green-500 ': 'hover:bg-joij-green-100 hover:text-gray-800 ' }}sm:text-sm"
        aria-haspopup="listbox" aria-expanded="true" aria-labelledby="listbox-label">
        <span class="flex items-center">
            <span class="block truncate">{{__('messages.add_permissions')}}</span>
        </span>
        <span class="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2">
            <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
                 stroke="currentColor" class="w-6 h-6">
              <path stroke-linecap="round" stroke-linejoin="round" d="M12 6v12m6-6H6"/>
            </svg>
        </span>
    </button>
    @if ($showPermissionList)
    <div class="fixed top-1/2 left-1/2 -translate-y-1/2 -translate-x-1/2 drop-shadow-md bg-white min-h-[400px] max-h-[650px] ring-1 ring-gray-300 rounded-md w-96 focus:outline-none sm:text-sm">
        <ul wire:key="key-{{ time() }}"
            class="absolute left-0 top-0 right-0 bottom-14 overflow-auto text-base border-b border-opacity-50"
            tabindex="-1">
            @foreach ($permissions as $detailedPermission)
            <li wire:click="toggleSelectPermission('{{ $detailedPermission->uuid }}')"
                wire:key="key-{{ $detailedPermission->uuid }}"
                class="text-gray-900 relative cursor-default select-none py-2 pl-3 pr-9 hover:bg-gray-100 hover:cursor-pointer block"
                role="option"
            >
                <div class="flex items-center">
                    <span class="inline-block h-2 w-2 flex-shrink-0 rounded-full {{ $detailedPermission->selected ? 'bg-joij-green-100' : 'bg-gray-200' }}"
                    aria-hidden="true"></span>
                    <span class="font-normal ml-3 block truncate">{{ $detailedPermission->identifier }}</span>
                </div>
                @if ($detailedPermission->selected)
                <span class="text-joij-green-600 absolute inset-y-0 right-0 flex items-center pr-4">
                    <svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z"
                              clip-rule="evenodd"/>
                    </svg>
                </span>
                @endif
            </li>
            @endforeach
        </ul>
        <button
            type="button"
            wire:click="togglePermissionList"
            class="absolute bottom-2 right-2 cursor-default rounded-md border border-gray-300 bg-white py-2 pl-3 pr-10 text-left shadow-sm bg-joij-green-500 text-white border-joij-green-500 outline-none ring-1 ring-joij-green-500 sm:text-sm"
            aria-haspopup="listbox"
            aria-expanded="true"
            aria-labelledby="listbox-label"
        >
            <span class="flex items-center">
                <span class="block truncate">Close</span>
            </span>
            <span class="absolute inset-y-0 right-0 flex items-center pr-2">
                <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
                </svg>
            </span>
        </button>
    </div>
    @endif
</div>
</code>```

If I click the
. The  wire:click="toggleSelectPermission('{{ $detailedPermission->uuid }}') . Is called to assign this permission to a role. This works! But the list will scroll up on every selection making this into an unusable solution. Is there something I can do to prevent the list from scrolling back up again?

Body:
I am using Laravel Livewire. I'm intrigued by it's concept, but it's also quite confusing in certain specific situations. I am trying to make a selection list that comes up as a modal like so:

This is the "parent" template:

<x-slot name="breadcrumbs">
    @include('breadcrumbs', [ 'path' => ['roles' => __('messages.roles')]])
</x-slot>

        <x-jet-action-message class="mr-3" on="created">
        {{ __('messages.created_role') }}
        </x-jet-action-message>

{{ __('messages.all_roles_in_system') }}

                    {{ __('messages.add_role') }}

        <livewire:roles.add-role-form />
        <livewire:roles.role-list />

The role-list looks like this:

                                    {{__('messages.name')}}

                                        <svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
                                            <path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"/>
                                        </svg>

                        @foreach ($roles as $role)

uuid === $activeRole ? 'bg-joij-green-200' : 'bg-white' }}" wire:key="key-{{ $role->uuid  }}">
                            uuid === $activeRole ? 'text-white' : 'text-gray-900' }} sm:pl-6">{{ $role->name }}

                                <button wire:click="toggleActiveRole('{{ $role->uuid }}')" type="button" class="inline-flex items-center rounded-md border border-gray-300 bg-white px-3 py-2 text-sm font-medium leading-4 text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-joij-green-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-30">
                                    <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-3 h-3">
                                        <path stroke-linecap="round" stroke-linejoin="round" d="M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10" />
                                    </svg>
                                </button>
                                <button type="button" class="inline-flex items-center rounded-md border border-gray-300 bg-white px-3 py-2 text-sm font-medium leading-4 text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-joij-green-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-30">
                                    <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-3 h-3">
                                        <path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" />
                                    </svg>
                                </button>

                        @if ($role->uuid === $activeRole)

uuid  }}">

                                <livewire:roles.permission-list wire:key="$role->uuid" :role="$role" />

                        @endif
                        @endforeach

And then I have the permission-list:

            Permissions

        @foreach ($role->permissions()->get() as $permission)

            {{ $permission->identifier }}

        @endforeach

                <livewire:roles.permission-dropdown :role="$role" />

And then the permission-dropdown:

    <button
        type="button" wire:click="togglePermissionList"
        class="relative cursor-default rounded-md border border-gray-300 bg-white py-2 pl-3 pr-10 text-left shadow-sm {{ $showPermissionList ? 'bg-joij-green-500 text-white border-joij-green-500 outline-none ring-1 ring-joij-green-500 ': 'hover:bg-joij-green-100 hover:text-gray-800 ' }}sm:text-sm"
        aria-haspopup="listbox" aria-expanded="true" aria-labelledby="listbox-label">

            {{__('messages.add_permissions')}}

            <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
                 stroke="currentColor" class="w-6 h-6">
              <path stroke-linecap="round" stroke-linejoin="round" d="M12 6v12m6-6H6"/>
            </svg>

    </button>
    @if ($showPermissionList)

            @foreach ($permissions as $detailedPermission)

uuid }}')"
                wire:key="key-{{ $detailedPermission->uuid }}"
                class="text-gray-900 relative cursor-default select-none py-2 pl-3 pr-9 hover:bg-gray-100 hover:cursor-pointer block"
                role="option"
            >

                    selected ? 'bg-joij-green-100' : 'bg-gray-200' }}"
                    aria-hidden="true">
                    {{ $detailedPermission->identifier }}

                @if ($detailedPermission->selected)

                    <svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z"
                              clip-rule="evenodd"/>
                    </svg>

                @endif

            @endforeach

        <button
            type="button"
            wire:click="togglePermissionList"
            class="absolute bottom-2 right-2 cursor-default rounded-md border border-gray-300 bg-white py-2 pl-3 pr-10 text-left shadow-sm bg-joij-green-500 text-white border-joij-green-500 outline-none ring-1 ring-joij-green-500 sm:text-sm"
            aria-haspopup="listbox"
            aria-expanded="true"
            aria-labelledby="listbox-label"
        >

                Close

                <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
                </svg>

        </button>

    @endif

If I click the
. The  wire:click="toggleSelectPermission('{{ $detailedPermission->uuid }}') . Is called to assign this permission to a role. This works! But the list will scroll up on every selection making this into an unusable solution. Is there something I can do to prevent the list from scrolling back up again?


问:
Add Status With email template
My client asked me to make a module of adding status where he can write/save email templete with it and when he change the status having email template then automatically email sends to the client email.

I have simply make controller and implement email there

```<code>Mail::to($data->email)->cc('info@onlineminibushire.com')->send(new BookingPriceMail($data));
</code>```

with email template.

Title: Add Status With email template

Body:
My client asked me to make a module of adding status where he can write/save email templete with it and when he change the status having email template then automatically email sends to the client email.

I have simply make controller and implement email there

Mail::to($data->email)->cc('info@onlineminibushire.com')->send(new BookingPriceMail($data));

with email template.


问:
Symfony AsciiSlugger remove first special character in a string
I have a question about the string component. I am trying to create a download link using HeaderUtils::makeDisposition. I wanted to remove all special characters from the filename using AsciiSlugger. Unfortunately, if such a character is in the first position, it is removed
If the name contains only special characters, the function returns an empty string.

```<code>$response->headers->set('Content-Disposition',
    HeaderUtils::makeDisposition(
        HeaderUtils::DISPOSITION_ATTACHMENT,
        (new AsciiSlugger('de'))->slug('äffgößdfö')
    )
);
</code>```

And I expected, that from (new AsciiSlugger('de'))->slug('äffgößdfö') I become aeffgoessdfoe not ffgoessdfoe.

Does anyone know how to prevent this behaviour?

Body:
I have a question about the string component. I am trying to create a download link using HeaderUtils::makeDisposition. I wanted to remove all special characters from the filename using AsciiSlugger. Unfortunately, if such a character is in the first position, it is removed
If the name contains only special characters, the function returns an empty string.

$response->headers->set('Content-Disposition',
    HeaderUtils::makeDisposition(
        HeaderUtils::DISPOSITION_ATTACHMENT,
        (new AsciiSlugger('de'))->slug('äffgößdfö')
    )
);

And I expected, that from (new AsciiSlugger('de'))->slug('äffgößdfö') I become aeffgoessdfoe not ffgoessdfoe.

Does anyone know how to prevent this behaviour?


问:
How to increase word-spacing threshold in Tesseract OCR?
I am trying to detect 'words' (code-names) in an image file using pytesseract.

As you can see below, the complete word is not detected and is broken due to spacing. The actual images I want to annotate have many such words and each one has similar kind of spacing issue. I have tried changing the psm and provided custom parameters as suggested in some existing posts, but no luck.

How can I increase the word-spacing threshold in tesseract so that it ignores such spaces?

Here is the code I've written:

```<code>import cv2 as cv
import pytesseract
from pytesseract import Output
import re

custom_config = r'--psm 3 textord_space_size_is_variable=1 tosp_min_sane_kn_sp=3'

img = cv.imread('text-detection.jpg')

img_gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)

a = pytesseract.image_to_data(img_gray, output_type=Output.DICT, config=custom_config)

pattern = '69.'

a_boxes = len(a['text'])

for i in range(a_boxes):
    if re.match(pattern, a['text'][i]):
        (x, y, w, h) = (a['left'][i], a['top'][i], a['width'][i], a['height'][i])
        img = cv.rectangle(img, (x, y), (x + w, y + h), (0, 255, 0), 2)

cv.imwrite('result_image.png', img)
</code>```

Input image:

Output:

Expected output is the word 4"-P6910509-151440Y is marked.

Body:
I am trying to detect 'words' (code-names) in an image file using pytesseract.

As you can see below, the complete word is not detected and is broken due to spacing. The actual images I want to annotate have many such words and each one has similar kind of spacing issue. I have tried changing the psm and provided custom parameters as suggested in some existing posts, but no luck.

How can I increase the word-spacing threshold in tesseract so that it ignores such spaces?

Here is the code I've written:

import cv2 as cv
import pytesseract
from pytesseract import Output
import re

custom_config = r'--psm 3 textord_space_size_is_variable=1 tosp_min_sane_kn_sp=3'

img = cv.imread('text-detection.jpg')

img_gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)

a = pytesseract.image_to_data(img_gray, output_type=Output.DICT, config=custom_config)

pattern = '69.'

a_boxes = len(a['text'])

for i in range(a_boxes):
    if re.match(pattern, a['text'][i]):
        (x, y, w, h) = (a['left'][i], a['top'][i], a['width'][i], a['height'][i])
        img = cv.rectangle(img, (x, y), (x + w, y + h), (0, 255, 0), 2)

cv.imwrite('result_image.png', img)

Input image:

Output:

Expected output is the word 4"-P6910509-151440Y is marked.


问:
How do i display a List<Person> in a jsp
Lets say i have a json file as a such

```<code>{
  "student": [

     {
        "id":"01",
        "name": "Tom",
        "lastname": "Price"
     },

     {
        "id":"02",
        "name": "Nick",
        "lastname": "Thameson"
     }
  ]
}
</code>```

and my perosn class

```<code>public class Person {
    private Integer id;
    private String name;
    private String lastname;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getLastName() {
        return lastname;
    }

    public void setLastName(String lastname) {
        this.lastname = lastname;
    }
}
</code>```

and a class that loads a json file

```<code>public class PersonLoader {

    public List<Persson> getPeople() {
        List<Person> toReturn = null;

        ObjectMapper oMapper = new ObjectMapper();
        try {
            toReturn = oMapper.readValue(ProductLoader.class.getResourceAsStream("/people.json"), new TypeReference<List<Person>>() {});
        } catch (Exception e) {
            e.printStackTrace();
        }

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

How can i display each person on a webpage using a jsp file and a java servlet ?

UPDATE

I asume i try to send the data using the doPost function

Maybe like this

```<code>protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    // TODO Auto-generated method stub

    PersonLoader p1 = new PersonLoader();
    if(p1 == null) {
        doGet(request, response);
    }
    else {
        List<People> people = p1.getPeople();
        request.setAttribute("people", people);
        request.getRequestDispatcher("/home.jsp").forward(request, response);
    }
}
</code>```

But now I try to iterate over the array in my JSP file like so

```<code>    <% List<People> people = request.getAttribute("products");
for(People p: people){%>
    <div class="card" style="width: 18rem">
    <img class="card-img-top" src="..." alt="Card image cap" />
    <div class="card-body">
      <h5 class="card-title">Title</h5>
      <p class="card-text">
        Some quick example text to build on the card title and make up the
        bulk of the card's content.
      </p>
      <a href="#" class="btn btn-primary">Go somewhere</a>
    </div>
  </div>
  <%
}
%>
</code>```

but i get this error

```<code>Type mismatch: cannot convert from Object to
</code>```

List

on line     <% List<People> people = request.getAttribute("people");

Body:
Lets say i have a json file as a such

{
  "student": [

     {
        "id":"01",
        "name": "Tom",
        "lastname": "Price"
     },

     {
        "id":"02",
        "name": "Nick",
        "lastname": "Thameson"
     }
  ]
}

and my perosn class

public class Person {
    private Integer id;
    private String name;
    private String lastname;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getLastName() {
        return lastname;
    }

    public void setLastName(String lastname) {
        this.lastname = lastname;
    }
}

and a class that loads a json file

public class PersonLoader {

    public List<Persson> getPeople() {
        List<Person> toReturn = null;

        ObjectMapper oMapper = new ObjectMapper();
        try {
            toReturn = oMapper.readValue(ProductLoader.class.getResourceAsStream("/people.json"), new TypeReference<List<Person>>() {});
        } catch (Exception e) {
            e.printStackTrace();
        }

        return toReturn;
    }
}

How can i display each person on a webpage using a jsp file and a java servlet ?

UPDATE

I asume i try to send the data using the doPost function

Maybe like this

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    // TODO Auto-generated method stub

    PersonLoader p1 = new PersonLoader();
    if(p1 == null) {
        doGet(request, response);
    }
    else {
        List<People> people = p1.getPeople();
        request.setAttribute("people", people);
        request.getRequestDispatcher("/home.jsp").forward(request, response);
    }
}

But now I try to iterate over the array in my JSP file like so

    <% List<People> people = request.getAttribute("products");
for(People p: people){%>

Title

        Some quick example text to build on the card title and make up the
        bulk of the card's content.

      Go somewhere

  <%
}
%>

but i get this error

Type mismatch: cannot convert from Object to

List

on line     <% List<People> people = request.getAttribute("people");


问:
FastAPI app still process the request though the connection has been disconnected from the client end
I have a FastAPI app that runs on Gunicorn Webserver and the gateway interface is ASGI.

I try to simulate a response that takes a long time in my FastAPI App, and I expect that when I disconnect from the request connection currently under processing (e.g. close the tab), ASGI should abort or terminate the job in Gunicorn worker, while I found out that my FastAPI complete the processing anyway. See the logs below,

```<code>api          | TRACE:    HTTP connection made
api          | TRACE:    ASGI [4] Started scope={'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.0', 'server': None, 'client': None, 'scheme': 'http', 'root_path': '', 'headers': '<...>', 'method': 'GET', 'path': '/long-time', 'raw_path': b'/long-time', 'query_string': b''}
api-proxy    | 172.23.0.1 - - [12/Dec/2022:07:31:46 +0000] "GET /long-time HTTP/1.1" 499 "e9224322f5f65f94a54e4a6ca812ae72" generate 0 bytes in 3.051 "http://localhost:8000/docs" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36" "-
api          | TRACE:    HTTP connection lost
api          | [2022-12-12 15:31:53,295] [INFO] [/router.py:810]: Ready to return
api          | TRACE:    ASGI [4] Receive {'type': 'http.disconnect'}
api          | TRACE:    ASGI [4] Send {'type': 'http.response.start', 'status': 200, 'headers': '<...>'}
api          | TRACE:    ASGI [4] Send {'type': 'http.response.body', 'body': '<4 bytes>'}
api          | TRACE:    ASGI [4] Completed
</code>```
```<code>async def my_func_1():
    """
    my func 1
    """
    await asyncio.sleep(10)

    return "zzzzzzzz"

@api_router.get("long-time")
async def root():
    """
    my home route
    """
    a = await asyncio.gather(my_func_1())

    fastapi_logger.info("Ready to return")

    return a
</code>```

So I wonder if there's any configurable/programmable way to terminate the request processing, or send the response immediately rather than wait till the API endpoint function exits? Thanks.

Body:
I have a FastAPI app that runs on Gunicorn Webserver and the gateway interface is ASGI.

I try to simulate a response that takes a long time in my FastAPI App, and I expect that when I disconnect from the request connection currently under processing (e.g. close the tab), ASGI should abort or terminate the job in Gunicorn worker, while I found out that my FastAPI complete the processing anyway. See the logs below,

api          | TRACE:    HTTP connection made
api          | TRACE:    ASGI [4] Started scope={'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.0', 'server': None, 'client': None, 'scheme': 'http', 'root_path': '', 'headers': '<...>', 'method': 'GET', 'path': '/long-time', 'raw_path': b'/long-time', 'query_string': b''}
api-proxy    | 172.23.0.1 - - [12/Dec/2022:07:31:46 +0000] "GET /long-time HTTP/1.1" 499 "e9224322f5f65f94a54e4a6ca812ae72" generate 0 bytes in 3.051 "http://localhost:8000/docs" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36" "-
api          | TRACE:    HTTP connection lost
api          | [2022-12-12 15:31:53,295] [INFO] [/router.py:810]: Ready to return
api          | TRACE:    ASGI [4] Receive {'type': 'http.disconnect'}
api          | TRACE:    ASGI [4] Send {'type': 'http.response.start', 'status': 200, 'headers': '<...>'}
api          | TRACE:    ASGI [4] Send {'type': 'http.response.body', 'body': '<4 bytes>'}
api          | TRACE:    ASGI [4] Completed

async def my_func_1():
    """
    my func 1
    """
    await asyncio.sleep(10)

    return "zzzzzzzz"

@api_router.get("long-time")
async def root():
    """
    my home route
    """
    a = await asyncio.gather(my_func_1())

    fastapi_logger.info("Ready to return")

    return a

So I wonder if there's any configurable/programmable way to terminate the request processing, or send the response immediately rather than wait till the API endpoint function exits? Thanks.


问:
Import cost data to Google Analytics 4 using APIs
What API should I use to import cost data into Google Analytics 4? On Universal Analytics I used the Management API.

Right now I'm trying to do the same on GA4 via the Admin API but I can't get the dataset id. I didn't find anything about it in the documentation.


问:
What is a proper way to add web server to my TCP server application
I'm at the beginning of my journey with C# and now I have a question and I need your advice on it.

I have a TCP server application on the C# net core, now I want to add a web server to add a REST endpoint to have the ability to take data from the server, like connected clients, etc... My SDK is Microsoft.NET.Sdk, framework: net6.0.

So what is the best way to add this REST endpoint and implement a web server? I guess that I need something like this in the MVC C# application, please clarify is my thought are correct.


问:
is the elastic security good enough as a siem solution?
I'm trying to use the ealstic stack as a SIEM (Security Information and Event Management) solution and came across a lot of issues that I couldn't solve:

1 - with the new elastic 8.5 is the logstach still part of the stack or can I replace it with the elasticsearch ingest pipelines and the elastic agent which push the logs directly to ealsticsearch ?

2 - is the new version of elastic security good enough as a SIEM solution or do i need to integrate another open source security solution ? if so which ones could help me for optimal performance ?

as elastic documentation is a bit complicated if there is any other useful content and resources please share with me


问:
Pandas sparse dataframe multiplication
I have two pandas sparse dataframes, big_sdf and bigger_sdf.

When I try to multiply them:

```<code>result = big_sdf @ bigger_sdf
</code>```

I get an error:

```<code>"numpy.core._exceptions.MemoryError: Unable to allocate 3.6 TiB for an array with shape (160815, 3078149) and data type int64"
</code>```

So I tried to convert these sparse dataframes to SciPy's csr matrices and multiply it, but the conversion doesn't succeed:

```<code>from scipy.sparse import csr_matrix
csr_big = csr_matrix(big_sdf)
csr_bigger = csr_matrix(bigger_sdf)
</code>```

When I run the last row I get an error message:

```<code>"ValueError: unrecognized csr_matrix constructor usage"
</code>```

It only happens for the bigger matrix, the smaller one is converted with success.

Any ideas? Maybe there's a Pandas native method to multiply sparse dataframes which I missed?

Thanks in advance!

Title: Pandas sparse dataframe multiplication

Body:
I have two pandas sparse dataframes, big_sdf and bigger_sdf.

When I try to multiply them:

result = big_sdf @ bigger_sdf

I get an error:

"numpy.core._exceptions.MemoryError: Unable to allocate 3.6 TiB for an array with shape (160815, 3078149) and data type int64"

So I tried to convert these sparse dataframes to SciPy's csr matrices and multiply it, but the conversion doesn't succeed:

from scipy.sparse import csr_matrix
csr_big = csr_matrix(big_sdf)
csr_bigger = csr_matrix(bigger_sdf)

When I run the last row I get an error message:

"ValueError: unrecognized csr_matrix constructor usage"

It only happens for the bigger matrix, the smaller one is converted with success.

Any ideas? Maybe there's a Pandas native method to multiply sparse dataframes which I missed?

Thanks in advance!


问:
I need to append a single row of data that has 'Quantity Sold' cell populated

Data Input Page

Appended Data

Data from rows 5 and 6 have been appended into sheet, but I just want from the row where data is shown (B7)

```<code>function appendSoldData() {

  const ss =SpreadsheetApp.getActiveSpreadsheet();

  // Collect the data.
  const sourceRange = ss.getRangeByName("PlantData");
  const inputRange = ss.getRangeByName("QtySold")
  const sourceVals = sourceRange.getValues().flat();

// Check for row that has quantity sold - this is what i want to append to 'Form responses 1'
const anyPopulatedCell = sourceVals.findIndex(cell => cell =="");
if(anyPopulatedCell !== 1){
}

  // Gather current date time
  const date = new Date();

  const data = [date,...sourceVals];

  //Append the data.
  const destinationSheet = ss.getSheetByName("Form responses 1");
  destinationSheet.appendRow(data);

  // Clear the source sheet rows.
  inputRange.clearContent();

  ss.toast("Sale Added to 'Form responses 1'!");

};
</code>```

Body:
Data Input Page

Appended Data

Data from rows 5 and 6 have been appended into sheet, but I just want from the row where data is shown (B7)

function appendSoldData() {

  const ss =SpreadsheetApp.getActiveSpreadsheet();

  // Collect the data.
  const sourceRange = ss.getRangeByName("PlantData");
  const inputRange = ss.getRangeByName("QtySold")
  const sourceVals = sourceRange.getValues().flat();

// Check for row that has quantity sold - this is what i want to append to 'Form responses 1'
const anyPopulatedCell = sourceVals.findIndex(cell => cell =="");
if(anyPopulatedCell !== 1){
}

  // Gather current date time
  const date = new Date();

  const data = [date,...sourceVals];

  //Append the data.
  const destinationSheet = ss.getSheetByName("Form responses 1");
  destinationSheet.appendRow(data);

  // Clear the source sheet rows.
  inputRange.clearContent();

  ss.toast("Sale Added to 'Form responses 1'!");

};


问:
changing item count in list view not updating in preview
In ListView.seperated there is an itemCount I assumed is the count for the amount that will be displayed, however only the white Container appears but not the data inside, inside the class I am using here has more than 5 objects but I only need to display 5 at first I had put in 4 for itemCount and run the code, now that I put 5 the data from the class is not appearing even though it appeared for the previous 4

Container(
  height: 300,
  child: Container(
    margin: const EdgeInsets.symmetric(vertical: 20.0),
    height: 700.0,
    child: ListView.separated(
      itemCount: 5,
      separatorBuilder: (BuildContext context, int index) =>
          Divider(),
      itemBuilder: (BuildContext context, int index) {
        String word = nameData.getcName(index);
        bool isSaved = nameData.getcFav(index);

        return ListTile(
          tileColor: Colors.white,
          shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.circular(10),
          ),
          leading: SizedBox(
            height: 30,
            width: 60,
            child: Row(
              children: [
                Icon(
                  isSaved ? Icons.favorite : Icons.favorite_border,
                  color: isSaved ? Colors.red : null,
                ),
                IconButton(
                  icon: Image.asset('images/logo.png'),
                  iconSize: 70,
                  onPressed: () {
                    Navigator.of(context).push(
                      MaterialPageRoute(
                        builder: (context) => listviewScreen()),
                    );
                  },
                ),
              ],
            ),
          ),
          title: Text(nameData.getcName(index)),
          trailing: Text(
            nameData.getcDate(index),
          ),
```


问:
how to coding a electron notification by toastxml
```<code>  let notice = new Notification({
    toastXml: `
    <toast>
     <visual>
      <binding template="ToastText01">
        <text id="1">窗口内容</text>
        <text id="2">窗口内容</text>
      </binding>
     </visual>
     <actions>
      <action content="Count up" activationType="protocol" arguments="myapp://contentId=351" />
      <action content="Count down" activationType="protocol" arguments="myapp://params=remindlater&contentId=351" />
     </actions>
    </toast>`
  })
  notice.show()
</code>```

1、The content of the template must start with ToastText
2、when I want to write multiple lines of content, the text must use the same ID, up to three lines
3、

Who can provide a toast xml document of electric notification, or give a case

Body:
  let notice = new Notification({
    toastXml: `
    <toast>
     <visual>
      <binding template="ToastText01">
        <text id="1">窗口内容</text>
        <text id="2">窗口内容</text>
      </binding>
     </visual>
     <actions>
      <action content="Count up" activationType="protocol" arguments="myapp://contentId=351" />
      <action content="Count down" activationType="protocol" arguments="myapp://params=remindlater&contentId=351" />
     </actions>
    </toast>`
  })
  notice.show()

1、The content of the template must start with ToastText
2、when I want to write multiple lines of content, the text must use the same ID, up to three lines
3、

Who can provide a toast xml document of electric notification, or give a case