问:
Serial.read() fall into error after some times
I'm trying to read RFID cards with an RFID card reader plugged in USB on my raspi 3b+

Here is my code

```<code>ser = serial.Serial('/dev/tty1', 115200)
    while True:
        incomingByte = ser.read(10)
        print(incomingByte.decode())
        ser.flushInput()

    ser.close()
</code>```

When I scan a card, here is the output

```<code>0002429021
</code>```

Which is what I expect. But after some time (few seconds) I have the following error message

```<code>line 45, in main
    incomingByte = ser.read(10)
  File "/usr/local/lib/python3.9/dist-packages/serial/serialposix.py", line 595, in read
    raise SerialException(
serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
</code>```

So I've looked around and tried many things:

run raspi-config and under interfaces turn on serial, turn off console

Edit /boot/config.txt and add the line enable_uart=1

In /boot/cmdline.txt remove the references to console

Disabled getty sudo systemctl stop serial-getty@USB0.service

I've tried alternate codes:

**1/ with try...except
**

```<code>try:
   incomingByte = ser.read(10)
   print(incomingByte.decode())
   ser.flushInput()
except Exception:
   pass
</code>```

==> I can read 1 card then the program get stuck (no errors but no more scan possible, prompt is stuck)

2/ with inwaiting() + try...except

```<code>while True:
  while (ser.inWaiting()>0):
     try:
       incomingByte = ser.read(10)
       print(incomingByte.decode())
       ser.flushInput()
  except (OSError, serial.serialutil.SerialException):
       print("No data this time")

ser.close()
</code>```

It outputs

```<code>No data this time
002429021
</code>```

then the following error

```<code>line 549, in in_waiting
    s = fcntl.ioctl(self.fd, TIOCINQ, TIOCM_zero_str)
OSError: [Errno 5] Input/output error

</code>```

Note:
One of the main difference I see with many other people with similar code is that my rfid card reader is reachable on /dev/tty1 where I usually see /dev/ttyS1 or /dev/ttyAMA0 or /dev/ttyUSB0 or /dev/ttyACM0

I don't really know what's the difference between all of that but maybe it has an impact.

Thanks in advance for your help :)

Body:
I'm trying to read RFID cards with an RFID card reader plugged in USB on my raspi 3b+

Here is my code

ser = serial.Serial('/dev/tty1', 115200)
    while True:
        incomingByte = ser.read(10)
        print(incomingByte.decode())
        ser.flushInput()

    ser.close()

When I scan a card, here is the output

0002429021

Which is what I expect. But after some time (few seconds) I have the following error message

line 45, in main
    incomingByte = ser.read(10)
  File "/usr/local/lib/python3.9/dist-packages/serial/serialposix.py", line 595, in read
    raise SerialException(
serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

So I've looked around and tried many things:

run raspi-config and under interfaces turn on serial, turn off console

Edit /boot/config.txt and add the line enable_uart=1

In /boot/cmdline.txt remove the references to console

Disabled getty sudo systemctl stop serial-getty@USB0.service

I've tried alternate codes:

**1/ with try...except
**

try:
   incomingByte = ser.read(10)
   print(incomingByte.decode())
   ser.flushInput()
except Exception:
   pass

==> I can read 1 card then the program get stuck (no errors but no more scan possible, prompt is stuck)

2/ with inwaiting() + try...except

while True:
  while (ser.inWaiting()>0):
     try:
       incomingByte = ser.read(10)
       print(incomingByte.decode())
       ser.flushInput()
  except (OSError, serial.serialutil.SerialException):
       print("No data this time")

ser.close()

It outputs

No data this time
002429021

then the following error

line 549, in in_waiting
    s = fcntl.ioctl(self.fd, TIOCINQ, TIOCM_zero_str)
OSError: [Errno 5] Input/output error

Note:
One of the main difference I see with many other people with similar code is that my rfid card reader is reachable on /dev/tty1 where I usually see /dev/ttyS1 or /dev/ttyAMA0 or /dev/ttyUSB0 or /dev/ttyACM0

I don't really know what's the difference between all of that but maybe it has an impact.

Thanks in advance for your help :)


来源: stackexchange

问:
Output friends list to json (include ID) with Mogli
I'd like to convert the friends list to json (include both names and id's).

Here is what I have... But it results in only a list of names.

```<code>@client = Mogli::Client.new(session[:at])
@app  = Mogli::Application.find(ENV["FACEBOOK_APP_ID"], @client)
@user = Mogli::User.find("me", @client)

@user.friends.to_json
</code>```

How do I also include the users ID?

ContentLicense: CC BY-SA 3.0

Body:
I'd like to convert the friends list to json (include both names and id's).

Here is what I have... But it results in only a list of names.

@client = Mogli::Client.new(session[:at])
@app  = Mogli::Application.find(ENV["FACEBOOK_APP_ID"], @client)
@user = Mogli::User.find("me", @client)

@user.friends.to_json

How do I also include the users ID?


问:
"warning: implicit declaration of function 'strdup'" when configuring binutils
```<code>../../../binutils-2.37/bfd/doc/chew.c:1349:32: warning: implicit declaration of function ‘strdup’; did you mean ‘strcmp’? [-Wimplicit-function-declaration]
 1349 |   dict_type *new_d = newentry (strdup (name));
      |                                ^~~~~~
      |                                strcmp
../../../binutils-2.37/bfd/doc/chew.c:1349:32: warning: passing argument 1 of ‘newentry’ makes pointer from integer without a cast [-Wint-conversion]
 1349 |   dict_type *new_d = newentry (strdup (name));
      |                                ^~~~~~~~~~~~~
      |                                |
      |                                int
../../../binutils-2.37/bfd/doc/chew.c:1315:12: note: expected ‘char *’ but argument is of type ‘int’
 1315 |      char *word;
      |            ^~~~
</code>```

These are the errors I get when configuring binutils, I am quite confused by this because usually warnings don't automatically stop the process.
Let me know if I should send the full log.

ContentLicense: CC BY-SA 4.0

Body:
../../../binutils-2.37/bfd/doc/chew.c:1349:32: warning: implicit declaration of function ‘strdup’; did you mean ‘strcmp’? [-Wimplicit-function-declaration]
 1349 |   dict_type *new_d = newentry (strdup (name));
      |                                ^~~~~~
      |                                strcmp
../../../binutils-2.37/bfd/doc/chew.c:1349:32: warning: passing argument 1 of ‘newentry’ makes pointer from integer without a cast [-Wint-conversion]
 1349 |   dict_type *new_d = newentry (strdup (name));
      |                                ^~~~~~~~~~~~~
      |                                |
      |                                int
../../../binutils-2.37/bfd/doc/chew.c:1315:12: note: expected ‘char *’ but argument is of type ‘int’
 1315 |      char *word;
      |            ^~~~

These are the errors I get when configuring binutils, I am quite confused by this because usually warnings don't automatically stop the process.
Let me know if I should send the full log.


问:
BrowserModule has already been loaded. Angular13
`I checked my code a lot, I didn't use the browser module twice.

Does anyone know where the problem is?
enter image description here

```<code>import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { HttpClientModule } from "@angular/common/http";

import { AppComponent } from './app.component';
import { HeaderComponent } from 'src/app/header/header.component';
import { CoreModule } from 'src/app/core.module';
import { SharedModule } from 'src/app/shared/shared.module';
import { FormsModule } from '@angular/forms';

@NgModule({
  declarations: [
    AppComponent,
    HeaderComponent
  ],
  imports: [
    FormsModule,
    BrowserModule,
    AppRoutingModule,
    HttpClientModule,

    CoreModule,
    SharedModule,

  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
</code>```

Body:
`I checked my code a lot, I didn't use the browser module twice.

Does anyone know where the problem is?
enter image description here

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { HttpClientModule } from "@angular/common/http";

import { AppComponent } from './app.component';
import { HeaderComponent } from 'src/app/header/header.component';
import { CoreModule } from 'src/app/core.module';
import { SharedModule } from 'src/app/shared/shared.module';
import { FormsModule } from '@angular/forms';

@NgModule({
  declarations: [
    AppComponent,
    HeaderComponent
  ],
  imports: [
    FormsModule,
    BrowserModule,
    AppRoutingModule,
    HttpClientModule,

    CoreModule,
    SharedModule,

  ],
  bootstrap: [AppComponent]
})
export class AppModule { }


问:
How do I make Kingfisher KFImage "reload" or "refresh" a view when the locally cached image has been updated?
I have a KFImage in my view that downloads from a URL, caches and displays an image.

```<code>                       KFImage(source: kfSource)
                            .onAppear {
                                if let uarl = URL(string: animal.picFileReference) {
                                    kfSource = Source.network(ImageResource(downloadURL: uarl))
                                }
</code>```

Then my user has the option to pick a new image with a PhotosPicker:

```<code>             PhotosPicker(selection: $selectedItem,
                                         matching: .images,
                                         photoLibrary: .shared()) {
                                Text("\(Image(systemName: "camera"))")
                                    .font(.title2)
                            }.onChange(of: selectedItem) { newItem in
                                Task {
                                     if let data = try? await newItem?.loadTransferable(type: Data.self) {
                                         selectedImageData = data
                                         saveAnimalPic()
                                     }
                                 }
                            }
</code>```

which I store as Data (selectedImageData) and use it to create a new RawImageDataProvider. This allows me to run the new image through Kingfisher filters.

```<code>        let size = CGSize(width: 300, height: 300)
        let processor = DownsamplingImageProcessor(size: size) |> BlackWhiteProcessor()
        let rawDP = RawImageDataProvider(data: selectedImageData!, cacheKey: "tmp-img")
        KingfisherManager.shared.retrieveImage(with: Source.provider(rawDP), options: [.processor(processor)]) { result in
            switch result {
                case .success(let value):
                    let cache = ImageCache.default
                    cache.store(value.image, forKey: animal.picFileReference) //store new image in cache so changing source below has new one
                    cache.removeImage(forKey: "tmp-img", processorIdentifier: processor.identifier) //remove temp "new and processed" image
</code>```

Then I update the original KFImage cache with the new image, but I have no idea how to make KFImage "reload" so the new image will show. The HACK I'm using right now is to create new temp source and set the KFImage source to that one then back again:

```<code>                    let rdp = RawImageDataProvider(data: value.image.pngData()!, cacheKey: "tmp-ani-pic") //create new source for KFImage
                    kfSource = Source.provider(rdp) //update source to force refresh KFImage
                    cache.removeImage(forKey: "tmp-ani-pic") //remove tmp image for updating source
</code>```

....but this seems wrong. I feel like there is a better approach. How can I tell KFImage that the image in the cache is new and needs to be reloaded without toggling the source?

Body:
I have a KFImage in my view that downloads from a URL, caches and displays an image.

                       KFImage(source: kfSource)
                            .onAppear {
                                if let uarl = URL(string: animal.picFileReference) {
                                    kfSource = Source.network(ImageResource(downloadURL: uarl))
                                }

Then my user has the option to pick a new image with a PhotosPicker:

             PhotosPicker(selection: $selectedItem,
                                         matching: .images,
                                         photoLibrary: .shared()) {
                                Text("\(Image(systemName: "camera"))")
                                    .font(.title2)
                            }.onChange(of: selectedItem) { newItem in
                                Task {
                                     if let data = try? await newItem?.loadTransferable(type: Data.self) {
                                         selectedImageData = data
                                         saveAnimalPic()
                                     }
                                 }
                            }

which I store as Data (selectedImageData) and use it to create a new RawImageDataProvider. This allows me to run the new image through Kingfisher filters.

        let size = CGSize(width: 300, height: 300)
        let processor = DownsamplingImageProcessor(size: size) |> BlackWhiteProcessor()
        let rawDP = RawImageDataProvider(data: selectedImageData!, cacheKey: "tmp-img")
        KingfisherManager.shared.retrieveImage(with: Source.provider(rawDP), options: [.processor(processor)]) { result in
            switch result {
                case .success(let value):
                    let cache = ImageCache.default
                    cache.store(value.image, forKey: animal.picFileReference) //store new image in cache so changing source below has new one
                    cache.removeImage(forKey: "tmp-img", processorIdentifier: processor.identifier) //remove temp "new and processed" image

Then I update the original KFImage cache with the new image, but I have no idea how to make KFImage "reload" so the new image will show. The HACK I'm using right now is to create new temp source and set the KFImage source to that one then back again:

                    let rdp = RawImageDataProvider(data: value.image.pngData()!, cacheKey: "tmp-ani-pic") //create new source for KFImage
                    kfSource = Source.provider(rdp) //update source to force refresh KFImage
                    cache.removeImage(forKey: "tmp-ani-pic") //remove tmp image for updating source

....but this seems wrong. I feel like there is a better approach. How can I tell KFImage that the image in the cache is new and needs to be reloaded without toggling the source?


问:
Group values by rows in javascript
I am trying to create a choropleth map with d3.js(v6).  I am able to show the map however no data is encoded. I am having trouble grouping the data by row.  My csv file looks like this:

```<code>code, location, date, cases
AFG, Afghanistan,2010, 10000
AFG, Afghanistan,2011, 30000
AFG, Afghanistan,2012, 60000
ALB, Albania,2010, 1000
ALB, Albania,2011, 3000
ALB, Albania,2012, 6000
ALG, ALgeria,2010, 4000
ALG, ALgeria,2011, 7000
ALG, ALgeria,2012, 16000...
</code>```

I am trying to group the rows so I would get one value for each location using the following code but it doesn't seem to work.

```<code>Promise.all([
d3.json("https://raw.githubusercontent.com/holtzy/D3-graph-gallery/master/DATA/world.geojson"),
d3.csv("data.csv", function(d) {
  let datagroup = d3.group(data, d => d.location);
    datagroup.set(d.location, +d.cases)
})]).then(function(loadData){
    let topo = loadData[0]
// Draw the map
  svg1.append("g")
    .selectAll("path")
    .data(topo.features)
    .enter()
    .append("path")
      // draw each country
      .attr("d", d3.geoPath()
        .projection(projection)
      )
      // set the color of each country
      .attr("fill", function (d) {
        d.total = data.get(d.id) || 0;
        return colorScale(d.total);
      })

</code>```

I would appreciate it if someone could take a look and point out my mistake. Thanks a lot!

Title: Group values by rows in javascript

Body:
I am trying to create a choropleth map with d3.js(v6).  I am able to show the map however no data is encoded. I am having trouble grouping the data by row.  My csv file looks like this:

code, location, date, cases
AFG, Afghanistan,2010, 10000
AFG, Afghanistan,2011, 30000
AFG, Afghanistan,2012, 60000
ALB, Albania,2010, 1000
ALB, Albania,2011, 3000
ALB, Albania,2012, 6000
ALG, ALgeria,2010, 4000
ALG, ALgeria,2011, 7000
ALG, ALgeria,2012, 16000...

I am trying to group the rows so I would get one value for each location using the following code but it doesn't seem to work.

Promise.all([
d3.json("https://raw.githubusercontent.com/holtzy/D3-graph-gallery/master/DATA/world.geojson"),
d3.csv("data.csv", function(d) {
  let datagroup = d3.group(data, d => d.location);
    datagroup.set(d.location, +d.cases)
})]).then(function(loadData){
    let topo = loadData[0]
// Draw the map
  svg1.append("g")
    .selectAll("path")
    .data(topo.features)
    .enter()
    .append("path")
      // draw each country
      .attr("d", d3.geoPath()
        .projection(projection)
      )
      // set the color of each country
      .attr("fill", function (d) {
        d.total = data.get(d.id) || 0;
        return colorScale(d.total);
      })

I would appreciate it if someone could take a look and point out my mistake. Thanks a lot!


问:
Got HTTPConnectionPool when I request(post) to kserve example model with python SDK
I runed code case1, case2 in local space with vscode, not Notebooks of kubeflow censtral dashboard.

I'd like to know what I'm missing.

prepared:

added user

```<code>    - email: my_name@gmail.com
      hash: 1234          # Actually, hash value
      userID: "myuserid"
      username: myusername
</code>```

added namespace

```<code>$ kubectl apply -f profile.yaml
</code>```
```<code>apiVersion: kubeflow.org/v1beta1
kind: Profile
metadata:
  name: exam-namespace
spec:
  owner:
    kind: User
    name: my_name@gmail.com
  resourceQuotaSpec: {}
</code>```

served model

kubeflow Central Dashboard - Models - +NEW MODEL SERVER

```<code>apiVersion: "serving.kserve.io/v1beta1"
kind: "InferenceService"
metadata:
  annotations:
    isdecar.istio.is/inject: "false"
  name: "sklearn-iris"
spec:
  predictor:
    sklearn:
      image: "kserve/sklearnserver:v0.9.0"
      storageUri: "gs://kfserving-examples/models/sklearn/1.0/model"
</code>```

what i did with python sdk

case 1.

using kfp.Client()

import kfp
import requests

HOST = "http://localhost:8080"
NAME_SPACE = "exam-namespace"
USER_NAME = "my_name@gmail.com"
USER_PS = '1234'

session = requests.Session()
response = session.get(HOST)

headers = {
        "Content-Type": "application/x-www-form-urlencoded",
}

data = {"login": USER_NAME, "password": USER_PS}
session.post(response.url, headers=headers, data=data)
session_cookie = session.cookies.get_dict()["authservice_session"]

# access kubeflow dashboard
client = kfp.Client(
    host=f"{HOST}/pipeline",
    namespace=f"{NAME_SPACE}",
    cookies=f"authservice_session={session_cookie}")

session_cookie = session.cookies.get_dict()
sklear_iris_input = dict(instances = [
        [6.8, 2.8, 4.8, 1.4],
        [6.0, 3.4, 4.5, 1.6]
    ])

headers = {'Host': "http://sklearn-iris.project-pipeline.example.com"}
res = session.post(f"{HOST}/v1/models/v1/models/sklearn-iris:predict",
                   headers = headers,
                   cookies = session_cookie,
                   data = json.dumps(sklear_iris_input))
print(f"res.json : {res.json}")
```
<p>and, got this..</p>
```HTTPSConnectionPool(host='127.0.0.1', port=8080):
Max retries exceeded with url: /v1/models/v1/models/sklearn-iris:predict (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1131)')))
```
<h4>case 2.</h4>
<p>using <code>KServeClient()</code></p>
<pre class="lang-py prettyprint-override"><code>import requests
import json

from kserve import utils, KServeClient

NAME_SPACE = "exam-namespace"
SERVICE_NAME = "sklearn-iris"

kserve = KServeClient()
isvc_resp = kserve.get(SERVICE_NAME, namespace = NAME_SPACE)

# http://sklearn-iris.exam-namespace.svc.cluster.local/v1/models/sklearn-iris:predict
isvc_url = isvc_resp['status']['address']['url']

sklear_iris_input = dict(instances = [
        [6.8, 2.8, 4.8, 1.4],
        [6.0, 3.4, 4.5, 1.6]
    ])

response = requests.post(isvc_url, json = json.dumps(sklear_iris_input))
print(response.text)
</code>```

and, got this..

```<code>HTTPConnectionPool(host='sklearn-iris-test2.project-pipeline.svc.cluster.local', port=80):
Max retries exceeded with url: /v1/models/sklearn-iris-test2:predict (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fe70aa8e9a0>: Failed to establish a new connection: [Errno -2] Name or service not known'))
</code>```

After adding a new user to dex and creating a namespace via profile.yaml, do I need to add specific information to the AuthorizationPolicy?

I installed kubernetes and kubeflow on this desktop and port-forwarded through istio-ingressgate. And I ran the code case1,case2 in locally, is there any problem with setting host to localhost:8080?

If the above two questions don't have anything I need to do, how should the HTTPConnectionPool be resolved?

Body:
I runed code case1, case2 in local space with vscode, not Notebooks of kubeflow censtral dashboard.

I'd like to know what I'm missing.

prepared:

added user

    - email: my_name@gmail.com
      hash: 1234          # Actually, hash value
      userID: "myuserid"
      username: myusername

added namespace

$ kubectl apply -f profile.yaml

apiVersion: kubeflow.org/v1beta1
kind: Profile
metadata:
  name: exam-namespace
spec:
  owner:
    kind: User
    name: my_name@gmail.com
  resourceQuotaSpec: {}

served model

kubeflow Central Dashboard - Models - +NEW MODEL SERVER

apiVersion: "serving.kserve.io/v1beta1"
kind: "InferenceService"
metadata:
  annotations:
    isdecar.istio.is/inject: "false"
  name: "sklearn-iris"
spec:
  predictor:
    sklearn:
      image: "kserve/sklearnserver:v0.9.0"
      storageUri: "gs://kfserving-examples/models/sklearn/1.0/model"

what i did with python sdk

case 1.

using kfp.Client()

import kfp
import requests

HOST = "http://localhost:8080"
NAME_SPACE = "exam-namespace"
USER_NAME = "my_name@gmail.com"
USER_PS = '1234'

session = requests.Session()
response = session.get(HOST)

headers = {
        "Content-Type": "application/x-www-form-urlencoded",
}

data = {"login": USER_NAME, "password": USER_PS}
session.post(response.url, headers=headers, data=data)
session_cookie = session.cookies.get_dict()["authservice_session"]

# access kubeflow dashboard
client = kfp.Client(
    host=f"{HOST}/pipeline",
    namespace=f"{NAME_SPACE}",
    cookies=f"authservice_session={session_cookie}")

session_cookie = session.cookies.get_dict()
sklear_iris_input = dict(instances = [
        [6.8, 2.8, 4.8, 1.4],
        [6.0, 3.4, 4.5, 1.6]
    ])

headers = {'Host': "http://sklearn-iris.project-pipeline.example.com"}
res = session.post(f"{HOST}/v1/models/v1/models/sklearn-iris:predict",
                   headers = headers,
                   cookies = session_cookie,
                   data = json.dumps(sklear_iris_input))
print(f"res.json : {res.json}")

and, got this..

HTTPSConnectionPool(host='127.0.0.1', port=8080):
Max retries exceeded with url: /v1/models/v1/models/sklearn-iris:predict (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1131)')))

case 2.

using KServeClient()

import requests
import json

from kserve import utils, KServeClient

NAME_SPACE = "exam-namespace"
SERVICE_NAME = "sklearn-iris"

kserve = KServeClient()
isvc_resp = kserve.get(SERVICE_NAME, namespace = NAME_SPACE)

# http://sklearn-iris.exam-namespace.svc.cluster.local/v1/models/sklearn-iris:predict
isvc_url = isvc_resp['status']['address']['url']

sklear_iris_input = dict(instances = [
        [6.8, 2.8, 4.8, 1.4],
        [6.0, 3.4, 4.5, 1.6]
    ])

response = requests.post(isvc_url, json = json.dumps(sklear_iris_input))
print(response.text)

and, got this..

HTTPConnectionPool(host='sklearn-iris-test2.project-pipeline.svc.cluster.local', port=80):
Max retries exceeded with url: /v1/models/sklearn-iris-test2:predict (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fe70aa8e9a0>: Failed to establish a new connection: [Errno -2] Name or service not known'))

After adding a new user to dex and creating a namespace via profile.yaml, do I need to add specific information to the AuthorizationPolicy?

I installed kubernetes and kubeflow on this desktop and port-forwarded through istio-ingressgate. And I ran the code case1,case2 in locally, is there any problem with setting host to localhost:8080?

If the above two questions don't have anything I need to do, how should the HTTPConnectionPool be resolved?


问:
JSONata sum by quantity and display grouped by part
I just start with JSONata and I am really struggling to get my head around that syntax, can I ask you for help in understanding this example.

I have a list which consist of 2 other lists.

```<code>[
  [
    {
      "part": "1300350",
      "quantity": 334.93272
    }
  ],
  [
    {
      "part": "3305355",
      "quantity": 20643
    },
    {
      "part": "3305355",
      "quantity": 1389
    },
    {
      "part": "3305355",
      "quantity": 11894
    },
    {
      "part": "3305355",
      "quantity": 12570
    },
    {
      "part": "3305355",
      "quantity": 16904
    },
    {
      "part": "3305355",
      "quantity": 4136
    }
  ]
]
</code>```

What I would like to achieve is to get the output as a sum for given part number, so:

```<code>[
   {
       "part": "1300350",
       "total_qty": 334.93272
   },
   {
       "part": "3305355",
       "total_qty": 67536
   }
]

</code>```

Also do you know if there are some good training platforms for JSONata with some exercises and examples so one can get comfortable to use this language for querying data?

Body:
I just start with JSONata and I am really struggling to get my head around that syntax, can I ask you for help in understanding this example.

I have a list which consist of 2 other lists.

[
  [
    {
      "part": "1300350",
      "quantity": 334.93272
    }
  ],
  [
    {
      "part": "3305355",
      "quantity": 20643
    },
    {
      "part": "3305355",
      "quantity": 1389
    },
    {
      "part": "3305355",
      "quantity": 11894
    },
    {
      "part": "3305355",
      "quantity": 12570
    },
    {
      "part": "3305355",
      "quantity": 16904
    },
    {
      "part": "3305355",
      "quantity": 4136
    }
  ]
]

What I would like to achieve is to get the output as a sum for given part number, so:

[
   {
       "part": "1300350",
       "total_qty": 334.93272
   },
   {
       "part": "3305355",
       "total_qty": 67536
   }
]

Also do you know if there are some good training platforms for JSONata with some exercises and examples so one can get comfortable to use this language for querying data?


问:
Sign-in with Google button in a microservice-based architecture
I have a microservice-based application that implements a dedicated user authentication and authorization service. This service has two API endpoints to login with Google: GET signin and POST callback. If GET signin is called, it will challenge the user by redirecting them to Google login, and after they sign in to Google, Google calls the POST callback API. The POST callback will sign in the user using the ID and access token it receives from Google, creates a local user, and returns its DTO.

I am trying to implement the Sign in with Google button in the UI. I am following Google's documentation on creating this button. Here is what I have so far.

```<code><html>
  <body>
      <script src="https://accounts.google.com/gsi/client" async defer></script>
      <script>
        window.onload = function () {
          google.accounts.id.initialize({
            client_id: "...",
            login_uri: "https://localhost:1234/signin",
            ux_mode: "redirect"
          });
          google.accounts.id.renderButton(
            document.getElementById("buttonDiv"),
            { theme: "outline", size: "large", click_listener: onClickHandler }
          );

          function onClickHandler(){
            window.location.replace("https://localhost:1234/signin")
          }

          google.accounts.id.prompt();
        }
    </script>
    <div id="buttonDiv"></div>
  </body>
</html>
</code>```

This setup works, but not as expected.

The interaction I expect compared to what happens:

User clicks on the Login with Google button;

[expect] A pop-up opens and redirects to https://localhost:1234/signin. [happens] full-page redirect to https://localhost:1234/signin;

https://localhost:1234/signin redirects to Google login;

After the user sign in, https://localhost:1234/callback is called, which will sign in the user and redirects to the page where the Sign in with Google button was clicked.

I expect the redirect to happen in the pop-up, so the callback redirect happens in the pop-up, and user does not experience a full-page refresh. However, using the above code, two full-page refreshes happen: (a) redirect to the login endpoint, then to Google, (b) Google to the callback, then to the page where the login button was clicked.

Body:
I have a microservice-based application that implements a dedicated user authentication and authorization service. This service has two API endpoints to login with Google: GET signin and POST callback. If GET signin is called, it will challenge the user by redirecting them to Google login, and after they sign in to Google, Google calls the POST callback API. The POST callback will sign in the user using the ID and access token it receives from Google, creates a local user, and returns its DTO.

I am trying to implement the Sign in with Google button in the UI. I am following Google's documentation on creating this button. Here is what I have so far.

This setup works, but not as expected.

The interaction I expect compared to what happens:

User clicks on the Login with Google button;

[expect] A pop-up opens and redirects to https://localhost:1234/signin. [happens] full-page redirect to https://localhost:1234/signin;

https://localhost:1234/signin redirects to Google login;

After the user sign in, https://localhost:1234/callback is called, which will sign in the user and redirects to the page where the Sign in with Google button was clicked.

I expect the redirect to happen in the pop-up, so the callback redirect happens in the pop-up, and user does not experience a full-page refresh. However, using the above code, two full-page refreshes happen: (a) redirect to the login endpoint, then to Google, (b) Google to the callback, then to the page where the login button was clicked.


问:
Matplotlib stackplot error formatting Y array: Operands could not be broadcast together
I am trying to plot a stacked line graph to show the distribution of different categories per day, over time:

```<code>dates = [datetime.date(2023, 1, 1), datetime.date(2023, 1, 1), .. ]
instance_data = [80.0739, 0.9492, 0.9492], [46.2961, 0.0, 0.0], .. ]
ax.stackplot(dates, instance_data, labels=labels)
</code>```

But am getting the following error due to a mismatch in the shapes of the arrays dates and instance_data:

ValueError: operands could not be broadcast together with shapes (95,) (3,)

How would I be able to resolve this? The data I am processing comes in the format:

List of tuples

Each tuple contains: date, instance type, value 1, value 2, value

```<code>[(datetime.date(2023, 1, 1), 'c5d.18xlarge', Decimal('0.0000'), Decimal('0.0000'), Decimal('310.3294')), (datetime.date(2023, 1, 1), 'c5d.2xlarge', Decimal('28.7031'), Decimal('0.0000'), Decimal('24.5456')), (datetime.date(2023, 1, 1), 'c5d.4xlarge', Decimal('18.9289'), Decimal('0.0000'), Decimal('3.4653')), (datetime.date(2023, 1, 1), 'c5d.9xlarge', Decimal('6.8633'), Decimal('0.0000'), Decimal('198.9642')), (datetime.date(2023, 1, 1), 'm5d.2xlarge', Decimal('21.3989'), Decimal('0.0000'), Decimal('0.0000')), (datetime.date(2023, 1, 1), 'm5d.4xlarge', Decimal('11.9900'), Decimal('0.0000'), Decimal('0.0000')), (datetime.date(2023, 1, 2), 'c5d.18xlarge', Decimal('0.3150'), Decimal('0.0000'), Decimal('10.6647')), ... ]
</code>```

I tried changing the shape of the dates list to match that of the instance_data list (95, 3):

```<code># datetime.object is arbitrary for this example
dates = [[datetime.object, datetime.object, datetime.object] for i in range(len(instance_data))]

but then got the error:

`TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''`
</code>```

Body:
I am trying to plot a stacked line graph to show the distribution of different categories per day, over time:

dates = [datetime.date(2023, 1, 1), datetime.date(2023, 1, 1), .. ]
instance_data = [80.0739, 0.9492, 0.9492], [46.2961, 0.0, 0.0], .. ]
ax.stackplot(dates, instance_data, labels=labels)

But am getting the following error due to a mismatch in the shapes of the arrays dates and instance_data:

ValueError: operands could not be broadcast together with shapes (95,) (3,)

How would I be able to resolve this? The data I am processing comes in the format:

List of tuples

Each tuple contains: date, instance type, value 1, value 2, value

[(datetime.date(2023, 1, 1), 'c5d.18xlarge', Decimal('0.0000'), Decimal('0.0000'), Decimal('310.3294')), (datetime.date(2023, 1, 1), 'c5d.2xlarge', Decimal('28.7031'), Decimal('0.0000'), Decimal('24.5456')), (datetime.date(2023, 1, 1), 'c5d.4xlarge', Decimal('18.9289'), Decimal('0.0000'), Decimal('3.4653')), (datetime.date(2023, 1, 1), 'c5d.9xlarge', Decimal('6.8633'), Decimal('0.0000'), Decimal('198.9642')), (datetime.date(2023, 1, 1), 'm5d.2xlarge', Decimal('21.3989'), Decimal('0.0000'), Decimal('0.0000')), (datetime.date(2023, 1, 1), 'm5d.4xlarge', Decimal('11.9900'), Decimal('0.0000'), Decimal('0.0000')), (datetime.date(2023, 1, 2), 'c5d.18xlarge', Decimal('0.3150'), Decimal('0.0000'), Decimal('10.6647')), ... ]

I tried changing the shape of the dates list to match that of the instance_data list (95, 3):

# datetime.object is arbitrary for this example
dates = [[datetime.object, datetime.object, datetime.object] for i in range(len(instance_data))]

but then got the error:

`TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''`


问:
Kivy app crashes on Android when loading a video
I have created an app that uses a button to open a new screen that plays a video using kivy VideoPlayer. The app works fine on windows but when I run on Android, the app crashes when trying to open the screen where the video will be playing. Below is the logcat output right after the the crash. I could use help interpreting the log to determine what might be causing the crash.

```01-09 20:38:33.731  1564  1733 I python  : [ERROR  ] [Image       ] Error loading <Extra/Pics and Vids/Videos/db_shoulder_press.mp4>
01-09 20:38:33.788  1248 32081 D SemWifiUsabilityStatsMonitor: onWifiUsabilityStats - seqNum 21663, isSameBssidAndFreq true
01-09 20:38:33.789  1248  2120 D ConnectivityService: notifyType CALLBACK_CAP_CHANGED for [221 WIFI]
01-09 20:38:33.791  1248  2181 I SemWifiLinkQualityMonitor: Link Qos Query: 0.040 ms / 201.599 Mbps (866 / 0.030 / 1.009)
01-09 20:38:33.791  1248  2157 D SemWifiSwitchForIndividualAppsService: stopTCPMonitoring : already stopped
01-09 20:38:33.791  1248  2157 I WifiConnectivityMonitor.NCC: sNetworkCallback(oCC) FULL : 221[ Transports: WIFI Capabilities: NOT_METERED&INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN&VALIDATED&NOT_ROAMING&FOREGROUND&NOT_CONGESTED&NOT_SUSPENDED&NOT_VCN_MANAGED LinkUpBandwidth>=22390Kbps LinkDnBandwidth>=47711Kbps TransportInfo: <SSID: <unknown ssid>, BSSID: 02:00:00:00:00:00, MAC: 02:00:00:00:00:00, IP: /10.0.0.50, Security type: 2, Supplicant state: COMPLETED, Wi-Fi standard: 5, RSSI: -47, Link speed: 866Mbps, Tx Link speed: 866Mbps, Max Supported Tx Link speed: 866Mbps, Rx Link speed: 650Mbps, Max Supported Rx Link speed: 866Mbps, Frequency: 5240MHz, Net ID: -1, Metered hint: false, score: 60, isUsable: true, CarrierMerged: false, SubscriptionId: -1, IsPrimary: 1, Trusted: true, Restricted: false, Ephemeral: false, OEM paid: false, OEM private: false, OSU AP: false, FQDN: <none>, Provider friendly name: <none>, Requesting package name: <none><none>MLO Information: , AP MLD Address: <none>, AP MLO Link Id: <none>, AP MLO Affiliated links: <none>> SignalStrength: -47 AdminUids: [1000] SSID: "The Holy Grail" UnderlyingNetworks: Null]
01-09 20:38:33.791  1248  2157 I WifiConnectivityMonitor.NCC: sNetworkCallback(oCC) (true/false)
01-09 20:38:33.793  1248  2197 I WifiConnectivityMonitor: current mode : 1
01-09 20:38:33.793  1248  2197 D OpenNetworkQos[4.00]: updateBssidNoInternet: mBssidNoInternet = false
01-09 20:38:33.793  1248  2197 D OpenNetworkQos[4.00]: getOpenNetworkQosNoInternetStatus: false
01-09 20:38:33.793  1248  2197 D OpenNetworkQos[4.00]: getOpenNetworkQosScores: 26 26 26
01-09 20:38:33.793  1248  2197 D SettingsProvider: isChangeAllowed() : name = wifi_wcm_qos_sharing_score_summary
01-09 20:38:33.794  5977  6939 I HBD     : g onCapabilitiesChanged network : 221 current network state : wifi
01-09 20:38:33.794  1248  2197 I WifiProfileShare: network QoS data was changed (internet), updateQoSData networkType: true, qosData: false
01-09 20:38:33.794  1248  3480 V WifiProfileShare.Caster: update wips network, size: 0
01-09 20:38:33.794  1248  3480 D WifiProfileShare: nearby scanning settings run
01-09 20:38:33.794  1248  3480 D WifiProfileShare: network score provider settings enabled
01-09 20:38:33.794  1248  3480 D OpenNetworkQos[4.00]: getOpenNetworkQosScores: 26 26 26
01-09 20:38:33.794  1248  3480 D OpenNetworkQos[4.00]: getOpenNetworkQosNoInternetStatus: false
01-09 20:38:33.794  1248  3480 I WifiProfileShare.Caster: current network type: 0, score: [26, 26, 26]
01-09 20:38:33.795  1248  3480 V WifiProfileShare.Cache: update network score bc:5b:d5:fb:f2:74
01-09 20:38:33.795  1248  3480 D WifiProfileShare.ScanMatcher: getMcfDataList size:2
01-09 20:38:33.795  1248  3480 I WifiProfileShare.Caster: qos data was updated , before:type:QOS, pBssid:a0:27:c8, qosData:7c after:type:QOS, pBssid:a0:27:c8, qosData:7c
01-09 20:38:33.797  2398  2478 D NetworkController.WifiSignalController: notifyListener: visible=true, connected=true, inetCondition=1, isDefault=true, wifiTestReported=true, receivedInetCondition=-1, hideDuringMobileSwitching=false
01-09 20:38:33.797 26542 26556 I ChimeraSrvcProxy: NullBinder for android.net.action.RECOMMEND_NETWORKS triggering remote TransactionTooLargeException due to Service without Chimera impl
01-09 20:38:33.798 26542 26556 W .gms.persistent: Large reply transaction of 1056768 bytes, interface descriptor , code 1
01-09 20:38:33.799  1248  3480 I [MCFSDK_android_1.2.4010]_4_b: isNetworkEnabled - type : 1 ret : true
01-09 20:38:33.799  1248  3480 D WifiProfileShare.McfCast: -ME--- mIsNetworkEnabled :true
01-09 20:38:33.799  1248  3480 D WifiProfileShare.McfCast: updateQoSData ignored, same contents
01-09 20:38:33.799  1248  3480 D WifiProfileShare.MCF: success update QosData !
01-09 20:38:33.800  2379  3295 I LocationAccessPolicy: checkLocationPermission - callingUid: 10457, callingPid: 4066, resultForFine: DENIED_HARD
01-09 20:38:33.800  1248  3480 I [MCFSDK_android_1.2.4010]_4_b: isNetworkEnabled - type : 1 ret : true
01-09 20:38:33.800  1248  3480 D WifiProfileShare.McfCast: -ME--- mIsNetworkEnabled :true
01-09 20:38:33.800  1248  3480 D WifiProfileShare.McfCast: -ME--- updatePasswordDate pwdData size:2
01-09 20:38:33.801  2379  3295 I LocationAccessPolicy: checkLocationPermission - callingUid: 10457, callingPid: 4066, resultForCoarse: DENIED_HARD
01-09 20:38:33.801  2398  2478 D Tile.WifiTile: handleUpdateState isTransient=false transientEnabling =false cb.isTransient=false state.state = 2 mStateBeforeClick.value =false enabled =true
01-09 20:38:33.854  1564  2290 I AAudio  : AAudioStreamBuilder_openStream() called ----------------------------------------
01-09 20:38:33.854  1564  2290 I AudioStreamBuilder: rate   =  48000, channels  = 2, channelMask = 0x80000003, format   = 1, sharing = SH, dir = OUTPUT
01-09 20:38:33.854  1564  2290 I AudioStreamBuilder: device =      0, sessionId = -1, perfMode = 10, callback: OFF with frames = 0
01-09 20:38:33.854  1564  2290 I AudioStreamBuilder: usage  =      0, contentType = 0, inputPreset = 0, allowedCapturePolicy = 0
01-09 20:38:33.854  1564  2290 I AudioStreamBuilder: privacy sensitive = false, opPackageName = (null), attributionTag = (null)
01-09 20:38:33.856  1564  2290 D AudioStreamBuilder: build() MMAP not used because AAUDIO_PERFORMANCE_MODE_LOW_LATENCY not requested.
01-09 20:38:33.856  1564  2290 D ercise.com.yhwh: PlayerBase::PlayerBase()
01-09 20:38:33.856  1564  2290 D AudioStreamTrack: open(), request notificationFrames = 0, frameCount = 0
01-09 20:38:33.856  1105  1786 D AudioFlinger: ro.audio.silent is ignored since no output device is set
01-09 20:38:33.856  1105  1769 D AudioFlinger: ro.audio.silent is ignored since no output device is set
01-09 20:38:33.858  1105  1800 D AudioFlinger: ro.audio.silent is ignored since no output device is set
01-09 20:38:33.858  1105  1788 D AudioFlinger: ro.audio.silent is ignored since no output device is set
01-09 20:38:33.859  1105  1801 D AudioFlinger: ro.audio.silent is ignored since no output device is set
01-09 20:38:33.862  1105  4395 V APM_AudioPolicyManager: getOutputForAttrInt() attributes={ Content type: AUDIO_CONTENT_TYPE_MUSIC Usage: AUDIO_USAGE_MEDIA Source: AUDIO_SOURCE_DEFAULT Flags: 0x400 Tags:  } stream=AUDIO_STREAM_MUSIC session 35713 selectedDeviceId 0
01-09 20:38:33.862  1105  4395 I APM_AudioPolicyManager: selectOutputFlags: remove ULL flag for dolby
01-09 20:38:33.862  1105  4395 V APM_AudioPolicyManager: getOutputForAttrInt() device {AUDIO_DEVICE_OUT_SPEAKER, @:}, sampling rate 48000, format 0x1, channel mask 0x3, flags 0x8 stream AUDIO_STREAM_MUSIC
01-09 20:38:33.862  1105  4395 V APM_AudioPolicyManager: selectOutput new bestOutput 13 criteria 0 100 0 0 0 0 4 2
01-09 20:38:33.862  1105  4395 V APM_AudioPolicyManager: selectOutput new bestOutput 21 criteria 0 100 0 0 0 1 2 0
01-09 20:38:33.862  1105  4395 V APM_AudioPolicyManager: getOutputForAttrInt returns output 21 selectedDeviceId 3
01-09 20:38:33.862  1105  4395 V APM_AudioPolicyManager: getOutputForAttr() returns output 21 requestedPortId 0 selectedDeviceId 3 for port ID 4205
01-09 20:38:33.863  1105  4395 I AudioFlinger: nonSecFlag 0, secFlag 0, outputFlags 8
01-09 20:38:33.863  1105  4395 D AudioFlinger: Client defaulted notificationFrames to 1282 for frameCount 3848
01-09 20:38:33.863  1564  1733 F libc    : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 1733 (SDLThread), pid 1564 (SDLActivity)
01-09 20:38:33.865  1105  4395 D AF::TrackHandle: OpPlayAudio: track:3434 usage:1 not muted
01-09 20:38:33.866  1105  4395 I AF::Track: setMixerOutConfig expectKey 202
01-09 20:38:33.866  1105  4395 I AF::Track: setMixerOutConfig select, mixer out f 5, s 48000, thread out f 4, s 48000
01-09 20:38:33.877  1564  2290 D AudioTrack: setVolume(1.000000, 1.000000) pid : 1564
01-09 20:38:33.877  1564  2290 D AAudioStream: setState(s#1) from 0 to 2
01-09 20:38:33.879  1564  2290 I AAudio  : AAudioStreamBuilder_openStream() returns 0 = AAUDIO_OK for s#1 ----------------
01-09 20:38:33.879  1564  2290 D AAudio  : AAudioStream_requestStart(s#1) called --------------
01-09 20:38:33.879  1564  2290 D AAudioStream: setState(s#1) from 2 to 3
01-09 20:38:33.879  1105  4395 I AF::Track: setMixerOutConfig expectKey 202
01-09 20:38:33.879  1105  4395 I AF::Track: setMixerOutConfig select, mixer out f 5, s 48000, thread out f 4, s 48000
01-09 20:38:33.879  1105  4395 I AudioPolicyEffectException: MySpaceHandler::checkDetachCondition media 1, ring 0, mp 0
01-09 20:38:33.879  1105  4395 I AudioPolicyEffectException: MySpace detach value 1
01-09 20:38:33.879  1105  4395 V APM_AudioPolicyManager: startOutput portId 4205
01-09 20:38:33.879  1105  4395 V APM_AudioPolicyManager: startOutput() output 21, stream 3, session 35713
01-09 20:38:33.879  1105  4395 V APM_AudioPolicyManager: setBeaconMute(1) mBeaconMuteRefCount=26 mBeaconPlayingRefCount=0
01-09 20:38:33.879  1105  4395 V APM_AudioPolicyManager: selectOutputForMusicEffects activeOnly 1 output 21 flags 0x00000008
01-09 20:38:33.879  1105  4395 W AudioFlinger: moveEffectChain_l() effect chain for session 0 not on source thread 0xb4000079bd440850
01-09 20:38:33.879  1105  4395 V APM_AudioPolicyManager: selectOutputForMusicEffects selected output 21
01-09 20:38:33.879  1105  4395 V APM_AudioPolicyManager: getNewOutputDevices selected devices {AUDIO_DEVICE_OUT_SPEAKER, @:}
01-09 20:38:33.879  1105  4395 V APM_AudioPolicyManager: setOutputDevices device {AUDIO_DEVICE_OUT_SPEAKER, @:} delayMs 0
01-09 20:38:33.879  1105  4395 V APM_AudioPolicyManager: setOutputDevices() prevDevice {AUDIO_DEVICE_OUT_SPEAKER, @:}
01-09 20:38:33.879  1105  4395 V APM_AudioPolicyManager: setOutputDevices: suppressing checkDeviceMuteStrategies
01-09 20:38:33.879  1105  4395 V APM_AudioPolicyManager: setOutputDevices setting same device {AUDIO_DEVICE_OUT_SPEAKER, @:} or null device, force=0, patch handle=4134
01-09 20:38:33.879  1105  4395 V APM_AudioPolicyManager: computeVolume: stream 3, index 7, volume 0.050119, deviceTypes 0x2
01-09 20:38:33.879  1105  4395 V APM_AudioPolicyManager: computeVolume: stream 3, index 8, volume 0.070795, deviceTypes 0x2
01-09 20:38:33.881   989  1812 V sec_audio_hw: sec_dev_set_parameters : l_stream_music_active=true
01-09 20:38:33.881   989  1812 D audio_hw_primary: adev_set_parameters: enter: l_stream_music_active=true
01-09 20:38:33.881   989  1812 D audio_hw_hfp: hfp_set_parameters: enter
01-09 20:38:33.881   989  1812 V audio_hw_sec: sec_set_parameters: enter: l_stream_music_active=true
01-09 20:38:33.881   989  1812 D AudioSAEffectOffload: update offload effect: VM,0,0,0,0,2,0
01-09 20:38:33.881   989  1812 D audio_hw_extn: audio_extn_fm_set_parameters: Enter
01-09 20:38:33.881   989  1812 D audio_hw_primary: adev_set_parameters: exit with code(0)
01-09 20:38:33.881   989  1048 I Audio_a2dpsink_hw: adev_set_parameters: kevpairs=[l_stream_music_active=true]
01-09 20:38:33.882  1105  4395 I AudioFlinger: updateStageIndex new -2108
01-09 20:38:33.882  1105  1781 D DlbEffectContext: setParam() received parameter EFFECT_PARAM_SEEK
01-09 20:38:33.882  1105  1781 D DlbEffectContext: handleSeek(end crossfading for seeking operation)
01-09 20:38:33.882  1105  1781 D DlbCrossfadeProcess: setEnabled transitioning from FADE_TO_BYPASS state to FADE_TO_ACTIVE
01-09 20:38:33.882  1105  1781 D DlbEffectContext: transformExternalGain() volume:0xCD494 fVol:0.050119 extVal:-416
01-09 20:38:33.882  1105  1781 D DlbEffectContext: transformExternalGain() volume:0x1000000 fVol:1.000000 extVal:0
01-09 20:38:33.882  1105  1781 D DlbEndpointParamCache: commitChangedParams()
01-09 20:38:33.882  1105  1781 D DlbEndpointParamCache: commit() Applying parameters for device 0x40000000
01-09 20:38:33.882  1105  1781 D DlbDap2Process: setParam(preg = #1[0])
01-09 20:38:33.882  1105  1781 D DlbDap2Process: setSystemGain(vol = 0)
01-09 20:38:33.882  1105  1781 D DlbDap2Process: setParam(svol = #1[-416])
01-09 20:38:33.882  1105  1781 D DlbEndpointParamCache: doCommit() Committed 2 parameters out of 15.
01-09 20:38:33.882  1105  1781 D DlbEndpointParamCache: commit() Overriding parameters for current device 0x00000002
01-09 20:38:33.882  1105  1781 D DlbEndpointParamCache: doCommit() Committed 0 parameters out of 56.
01-09 20:38:33.882  1105  1781 I AudioSAEffectSecPlus: command EFFECT_CMD_SET_VOLUME left = 0.050119, right =0.050119
01-09 20:38:33.882  1564  2290 D AAudio  : AAudioStream_requestStart(s#1) returned 0 ---------
01-09 20:38:33.882  1564  2315 D AudioStreamLegacy: onAudioDeviceUpdate(deviceId = 3)
01-09 20:38:33.883  1105  1781 D DlbCrossfadeProcess: process transitioning from FADE_TO_ACTIVE state to DAP_ACTIVE
01-09 20:38:33.883  1105  1781 I SoundAlive_Interface a64: [ 2 ][ 48000 ]FlushBuffers()
01-09 20:38:33.883   989 28053 D audio_hw_primary: start_output_stream: enter: stream(0xea58c970)usecase(0: deep-buffer-playback) devices(0x2) is_haptic_usecase(0)
01-09 20:38:33.884   989 28053 D audio_hw_primary: select_devices for use case (deep-buffer-playback)
01-09 20:38:33.884   989 28053 I sm8250_platform: platform_check_and_set_codec_backend_cfg:becf: afe: bitwidth 24, samplerate 48000 channels 2, backend_idx 0 usecase = 0 device (speaker)
01-09 20:38:33.884   989 28053 D sm8250_platform: platform_split_snd_device: snd_device(2) num devices(1) new_snd_devices(0)
01-09 20:38:33.884   989 28053 I sm8250_platform: platform_check_and_set_codec_backend_cfg: new_snd_devices[0] is 2
01-09 20:38:33.884   989 28053 I sm8250_platform: platform_check_codec_backend_cfg:becf: afe: bitwidth 24, samplerate 48000 channels 2, backend_idx 0 usecase = 0 device (speaker)
01-09 20:38:33.884   989 28053 D sm8250_platform: platform_check_codec_backend_cfg:becf: updated afe: bitwidth 24, samplerate 48000 channels 2,backend_idx 0 usecase = 0 device (speaker)
01-09 20:38:33.884   989 28053 D sm8250_platform: platform_check_codec_backend_cfg:becf: afe: playback on codec device not supporting native playback set default Sample Rate(48k)
01-09 20:38:33.884   989 28053 I sm8250_platform: platform_check_codec_backend_cfg:becf: afe: Codec selected backend: 0 updated bit width: 24 and sample rate: 48000
01-09 20:38:33.884   989 28053 D audio_hw_primary: check_usecases_codec_backend:becf: force routing 1
01-09 20:38:33.884   989 28053 E sm8250_platform: platform_check_backends_match: Invalid snd_device =
01-09 20:38:33.884   989 28053 D audio_hw_primary: check_usecases_codec_backend:becf: (81) check_usecases curr device: speaker, usecase device: backends match 0
01-09 20:38:33.884   989 28053 D audio_hw_primary: check_usecases_codec_backend:becf: check_usecases num.of Usecases to switch 0
01-09 20:38:33.884   989 28053 D hardware_info: hw_info_append_hw_type : device_name = speaker
01-09 20:38:33.884   989 28053 V audio_hw_sec: sec_dsm_spkr_prot_control_tx_topology() enable:1, dsm_is_enabled:0
01-09 20:38:33.884   989 28053 D hardware_info: hw_info_append_hw_type : device_name = vi-feedback
01-09 20:38:33.884   989 28053 D audio_hw_primary: enable_snd_device: snd_device(299: vi-feedback)
01-09 20:38:33.884   989 28053 D sm8250_platform: platform_get_island_cfg_on_device:island cfg status on snd_device = (vi-feedback 0)
01-09 20:38:33.884   989 28053 I soundtrigger: audio_extn_sound_trigger_update_device_status: device 0x12b of type 1 for Event 1, with Raise=0
01-09 20:38:33.884   989 28053 D audio_route: Apply path: vi-feedback
01-09 20:38:33.884   989 28053 D soundtrigger: audio_extn_sound_trigger_update_stream_status: uc_info->id 79 of type 1 for Event 3, with Raise=0
01-09 20:38:33.884   989 28053 D audio_hw_utils: audio_extn_utils_send_app_type_cfg: usecase->in_snd_device vi-feedback
01-09 20:38:33.884   989 28053 E voice   : voice_is_in_call_rec_stream: input stream is NULL
01-09 20:38:33.884   989 28053 D sm8250_platform: platform_split_snd_device: snd_device(299) num devices(0) new_snd_devices(0)
01-09 20:38:33.884   989 28053 E voice   : voice_is_in_call_rec_stream: input stream is NULL
01-09 20:38:33.884   989 28053 I audio_hw_utils: send_app_type_cfg_for_device default app_type 69938, acdb_dev_id 102, sample_rate 48000, snd_device_be_idx 56
01-09 20:38:33.885   989 28053 D sm8250_platform: platform_split_snd_device: snd_device(299) num devices(1) new_snd_devices(0)
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> send_audio_cal, acdb_id = 102, path = 1, app id = 0x11132, sample rate = 48000, afe_sample_rate = 48000
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> send_asm_topology
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_STREAM_TOPOLOGY_ID
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> send_adm_topology
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_COMMON_TOPOLOGY_ID
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> send_audtable
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_INSTANCE_COMMON_TABLE_SIZE
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_INSTANCE_COMMON_TABLE
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> AUDIO_SET_AUDPROC_CAL cal_type[11] acdb_id[102] app_type[69938]
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_PERSISTENT_AUDPROC_INSTANCE_COMMON_TABLE_SIZE
01-09 20:38:33.885   989 28053 D android.hardware.audio.service: [Data Manager]-> No data found
01-09 20:38:33.885   989 28053 D ACDB-LOADER: Error: ACDB_CMD_GET_PERSISTENT_AUDPROC_INSTANCE_COMMON_TABLE_SIZE returned -18
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> send_audproc_persist_table -18
01-09 20:38:33.885   989 28053 D ACDB-LOADER: Error: Invalid Audproc persist size = -18
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_INSTANCE_STREAM_TABLE_SIZE
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> send_audstrmtable
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_INSTANCE_STREAM_TABLE
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> audstrm_cal->cal_type.cal_data.cal_size = 20
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> send_afe_topology
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AFE_TOPOLOGY_ID
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> GET_AFE_TOPOLOGY_ID for adcd_id 102, Topology Id 112fb
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> send_afe_cal
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AFE_INSTANCE_COMMON_TABLE_SIZE
01-09 20:38:33.885   989 28053 D android.hardware.audio.service: Failed to fetch the lookup information of the device 00000066
01-09 20:38:33.885   989 28053 D ACDB-LOADER: Error: ACDB_CMD_GET_AFE_INSTANCE_COMMON_TABLE_SIZE Returned = -19
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AFE_INSTANCE_COMMON_TABLE
01-09 20:38:33.885   989 28053 D android.hardware.audio.service: Failed to fetch the lookup information of the device 00000066
01-09 20:38:33.885   989 28053 D ACDB-LOADER: Error: ACDB AFE returned = -19
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> AUDIO_SET_AFE_CAL cal_type[17] acdb_id[102]
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> send_hw_delay : acdb_id = 102 path = 1
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> ACDB_AVSYNC_INFO: ACDB_CMD_GET_DEVICE_PROPERTY
01-09 20:38:33.885   989 28053 D audio_hw_primary: enable_audio_route: apply mixer and update path: spkr-vi-feedback
01-09 20:38:33.885   989 28053 D audio_route: Apply path: spkr-vi-feedback
01-09 20:38:33.885   989 28053 D AudioSAEffectOffload: update offload effect: VM,0,0,0,0,2,0
01-09 20:38:33.886  1248  2143 D AS.SoundAliveHelper: notify dvfs state : 2, screen : true
01-09 20:38:33.886  1248  1248 D AudioPlayerStateMonitor: Found a new active media playback. AudioPlaybackConfiguration piid:28015 deviceId:3 type:AAudio u/pid:10266/1564 state:started attr:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0x0 tags= bundle=null sessionId:-1
01-09 20:38:33.890 31579 31622 I SAContentProvider:  getType() : screen on is true
01-09 20:38:33.895  5977  5977 I HBD     : g onCapabilityChanged  setNetworkState currentNetworkState : wifi
01-09 20:38:33.896  1248  1248 I GestureDetector: handleMessage TAP
01-09 20:38:33.896  1248  1546 I GestureDetector: handleMessage TAP
01-09 20:38:33.905   989 28053 V audio_hw_sec: sec_dsm_spkr_prot_control_tx_topology() dsm enabled (c:0 d:1 m:0)
01-09 20:38:33.905   989 28053 D audio_hw_primary: enable_snd_device: snd_device(2: dual-speaker)
01-09 20:38:33.905   989 28053 D sm8250_platform: platform_get_island_cfg_on_device:island cfg status on snd_device = (speaker 0)
01-09 20:38:33.905   989 28053 I soundtrigger: audio_extn_sound_trigger_update_device_status: device 0x2 of type 0 for Event 1, with Raise=0
01-09 20:38:33.905   989 28053 D audio_route: Apply path: dual-speaker
01-09 20:38:33.910   989 28053 I audio_hw_utils: set_app_type_cfg app_type_cfg->app_type 69940 -> 69941 sample_rate 48000, bit_width 24
01-09 20:38:33.910   989 28053 I audio_hw_utils: set_app_type_cfg app_type_cfg->app_type 69941, app_type_cfg->sample_rate 48000, app_type_cfg->bit_width 24
01-09 20:38:33.910   989 28053 E soundtrigger: audio_extn_sound_trigger_update_stream_status: invalid input device 0x0, for event 3
01-09 20:38:33.910   989 28053 D soundtrigger: audio_extn_sound_trigger_update_stream_status: uc_info->id 0 of type 0 for Event 3, with Raise=0
01-09 20:38:33.910   989 28053 D audio_hw_utils: audio_extn_utils_send_app_type_cfg: usecase->out_snd_device speaker
01-09 20:38:33.910   989 28053 D sm8250_platform: platform_split_snd_device: snd_device(2) num devices(0) new_snd_devices(0)
01-09 20:38:33.910   989 28053 I audio_hw_utils: send_app_type_cfg_for_device PLAYBACK app_type 69941, acdb_dev_id 13, sample_rate 48000, snd_device_be_idx 55
01-09 20:38:33.910   989 28053 D sm8250_platform: platform_split_snd_device: snd_device(2) num devices(1) new_snd_devices(0)
01-09 20:38:33.910   989 28053 D ACDB-LOADER: ACDB -> send_audio_cal, acdb_id = 13, path = 0, app id = 0x11135, sample rate = 48000, afe_sample_rate = 48000
01-09 20:38:33.910   989 28053 D ACDB-LOADER: ACDB -> send_asm_topology
01-09 20:38:33.910   989 28053 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_STREAM_TOPOLOGY_ID
01-09 20:38:33.910   989 28053 D ACDB-LOADER: ACDB -> send_adm_topology
01-09 20:38:33.910   989 28053 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_COMMON_TOPOLOGY_ID
01-09 20:38:33.910   989 28053 D ACDB-LOADER: ACDB -> send_audtable
01-09 20:38:33.910   989 28053 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_INSTANCE_COMMON_TABLE_SIZE
01-09 20:38:33.910   989 28053 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_INSTANCE_COMMON_TABLE
01-09 20:38:33.910   989 28053 D ACDB-LOADER: ACDB -> AUDIO_SET_AUDPROC_CAL cal_type[11] acdb_id[13]
```

I have tried clearing the app cache on android which seemed to work at first but has since stopped preventing the crash.

Body:
I have created an app that uses a button to open a new screen that plays a video using kivy VideoPlayer. The app works fine on windows but when I run on Android, the app crashes when trying to open the screen where the video will be playing. Below is the logcat output right after the the crash. I could use help interpreting the log to determine what might be causing the crash.

01-09 20:38:33.731  1564  1733 I python  : [ERROR  ] [Image       ] Error loading <Extra/Pics and Vids/Videos/db_shoulder_press.mp4>
01-09 20:38:33.788  1248 32081 D SemWifiUsabilityStatsMonitor: onWifiUsabilityStats - seqNum 21663, isSameBssidAndFreq true
01-09 20:38:33.789  1248  2120 D ConnectivityService: notifyType CALLBACK_CAP_CHANGED for [221 WIFI]
01-09 20:38:33.791  1248  2181 I SemWifiLinkQualityMonitor: Link Qos Query: 0.040 ms / 201.599 Mbps (866 / 0.030 / 1.009)
01-09 20:38:33.791  1248  2157 D SemWifiSwitchForIndividualAppsService: stopTCPMonitoring : already stopped
01-09 20:38:33.791  1248  2157 I WifiConnectivityMonitor.NCC: sNetworkCallback(oCC) FULL : 221[ Transports: WIFI Capabilities: NOT_METERED&INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN&VALIDATED&NOT_ROAMING&FOREGROUND&NOT_CONGESTED&NOT_SUSPENDED&NOT_VCN_MANAGED LinkUpBandwidth>=22390Kbps LinkDnBandwidth>=47711Kbps TransportInfo: <SSID: <unknown ssid>, BSSID: 02:00:00:00:00:00, MAC: 02:00:00:00:00:00, IP: /10.0.0.50, Security type: 2, Supplicant state: COMPLETED, Wi-Fi standard: 5, RSSI: -47, Link speed: 866Mbps, Tx Link speed: 866Mbps, Max Supported Tx Link speed: 866Mbps, Rx Link speed: 650Mbps, Max Supported Rx Link speed: 866Mbps, Frequency: 5240MHz, Net ID: -1, Metered hint: false, score: 60, isUsable: true, CarrierMerged: false, SubscriptionId: -1, IsPrimary: 1, Trusted: true, Restricted: false, Ephemeral: false, OEM paid: false, OEM private: false, OSU AP: false, FQDN: <none>, Provider friendly name: <none>, Requesting package name: <none><none>MLO Information: , AP MLD Address: <none>, AP MLO Link Id: <none>, AP MLO Affiliated links: <none>> SignalStrength: -47 AdminUids: [1000] SSID: "The Holy Grail" UnderlyingNetworks: Null]
01-09 20:38:33.791  1248  2157 I WifiConnectivityMonitor.NCC: sNetworkCallback(oCC) (true/false)
01-09 20:38:33.793  1248  2197 I WifiConnectivityMonitor: current mode : 1
01-09 20:38:33.793  1248  2197 D OpenNetworkQos[4.00]: updateBssidNoInternet: mBssidNoInternet = false
01-09 20:38:33.793  1248  2197 D OpenNetworkQos[4.00]: getOpenNetworkQosNoInternetStatus: false
01-09 20:38:33.793  1248  2197 D OpenNetworkQos[4.00]: getOpenNetworkQosScores: 26 26 26
01-09 20:38:33.793  1248  2197 D SettingsProvider: isChangeAllowed() : name = wifi_wcm_qos_sharing_score_summary
01-09 20:38:33.794  5977  6939 I HBD     : g onCapabilitiesChanged network : 221 current network state : wifi
01-09 20:38:33.794  1248  2197 I WifiProfileShare: network QoS data was changed (internet), updateQoSData networkType: true, qosData: false
01-09 20:38:33.794  1248  3480 V WifiProfileShare.Caster: update wips network, size: 0
01-09 20:38:33.794  1248  3480 D WifiProfileShare: nearby scanning settings run
01-09 20:38:33.794  1248  3480 D WifiProfileShare: network score provider settings enabled
01-09 20:38:33.794  1248  3480 D OpenNetworkQos[4.00]: getOpenNetworkQosScores: 26 26 26
01-09 20:38:33.794  1248  3480 D OpenNetworkQos[4.00]: getOpenNetworkQosNoInternetStatus: false
01-09 20:38:33.794  1248  3480 I WifiProfileShare.Caster: current network type: 0, score: [26, 26, 26]
01-09 20:38:33.795  1248  3480 V WifiProfileShare.Cache: update network score bc:5b:d5:fb:f2:74
01-09 20:38:33.795  1248  3480 D WifiProfileShare.ScanMatcher: getMcfDataList size:2
01-09 20:38:33.795  1248  3480 I WifiProfileShare.Caster: qos data was updated , before:type:QOS, pBssid:a0:27:c8, qosData:7c after:type:QOS, pBssid:a0:27:c8, qosData:7c
01-09 20:38:33.797  2398  2478 D NetworkController.WifiSignalController: notifyListener: visible=true, connected=true, inetCondition=1, isDefault=true, wifiTestReported=true, receivedInetCondition=-1, hideDuringMobileSwitching=false
01-09 20:38:33.797 26542 26556 I ChimeraSrvcProxy: NullBinder for android.net.action.RECOMMEND_NETWORKS triggering remote TransactionTooLargeException due to Service without Chimera impl
01-09 20:38:33.798 26542 26556 W .gms.persistent: Large reply transaction of 1056768 bytes, interface descriptor , code 1
01-09 20:38:33.799  1248  3480 I [MCFSDK_android_1.2.4010]_4_b: isNetworkEnabled - type : 1 ret : true
01-09 20:38:33.799  1248  3480 D WifiProfileShare.McfCast: -ME--- mIsNetworkEnabled :true
01-09 20:38:33.799  1248  3480 D WifiProfileShare.McfCast: updateQoSData ignored, same contents
01-09 20:38:33.799  1248  3480 D WifiProfileShare.MCF: success update QosData !
01-09 20:38:33.800  2379  3295 I LocationAccessPolicy: checkLocationPermission - callingUid: 10457, callingPid: 4066, resultForFine: DENIED_HARD
01-09 20:38:33.800  1248  3480 I [MCFSDK_android_1.2.4010]_4_b: isNetworkEnabled - type : 1 ret : true
01-09 20:38:33.800  1248  3480 D WifiProfileShare.McfCast: -ME--- mIsNetworkEnabled :true
01-09 20:38:33.800  1248  3480 D WifiProfileShare.McfCast: -ME--- updatePasswordDate pwdData size:2
01-09 20:38:33.801  2379  3295 I LocationAccessPolicy: checkLocationPermission - callingUid: 10457, callingPid: 4066, resultForCoarse: DENIED_HARD
01-09 20:38:33.801  2398  2478 D Tile.WifiTile: handleUpdateState isTransient=false transientEnabling =false cb.isTransient=false state.state = 2 mStateBeforeClick.value =false enabled =true
01-09 20:38:33.854  1564  2290 I AAudio  : AAudioStreamBuilder_openStream() called ----------------------------------------
01-09 20:38:33.854  1564  2290 I AudioStreamBuilder: rate   =  48000, channels  = 2, channelMask = 0x80000003, format   = 1, sharing = SH, dir = OUTPUT
01-09 20:38:33.854  1564  2290 I AudioStreamBuilder: device =      0, sessionId = -1, perfMode = 10, callback: OFF with frames = 0
01-09 20:38:33.854  1564  2290 I AudioStreamBuilder: usage  =      0, contentType = 0, inputPreset = 0, allowedCapturePolicy = 0
01-09 20:38:33.854  1564  2290 I AudioStreamBuilder: privacy sensitive = false, opPackageName = (null), attributionTag = (null)
01-09 20:38:33.856  1564  2290 D AudioStreamBuilder: build() MMAP not used because AAUDIO_PERFORMANCE_MODE_LOW_LATENCY not requested.
01-09 20:38:33.856  1564  2290 D ercise.com.yhwh: PlayerBase::PlayerBase()
01-09 20:38:33.856  1564  2290 D AudioStreamTrack: open(), request notificationFrames = 0, frameCount = 0
01-09 20:38:33.856  1105  1786 D AudioFlinger: ro.audio.silent is ignored since no output device is set
01-09 20:38:33.856  1105  1769 D AudioFlinger: ro.audio.silent is ignored since no output device is set
01-09 20:38:33.858  1105  1800 D AudioFlinger: ro.audio.silent is ignored since no output device is set
01-09 20:38:33.858  1105  1788 D AudioFlinger: ro.audio.silent is ignored since no output device is set
01-09 20:38:33.859  1105  1801 D AudioFlinger: ro.audio.silent is ignored since no output device is set
01-09 20:38:33.862  1105  4395 V APM_AudioPolicyManager: getOutputForAttrInt() attributes={ Content type: AUDIO_CONTENT_TYPE_MUSIC Usage: AUDIO_USAGE_MEDIA Source: AUDIO_SOURCE_DEFAULT Flags: 0x400 Tags:  } stream=AUDIO_STREAM_MUSIC session 35713 selectedDeviceId 0
01-09 20:38:33.862  1105  4395 I APM_AudioPolicyManager: selectOutputFlags: remove ULL flag for dolby
01-09 20:38:33.862  1105  4395 V APM_AudioPolicyManager: getOutputForAttrInt() device {AUDIO_DEVICE_OUT_SPEAKER, @:}, sampling rate 48000, format 0x1, channel mask 0x3, flags 0x8 stream AUDIO_STREAM_MUSIC
01-09 20:38:33.862  1105  4395 V APM_AudioPolicyManager: selectOutput new bestOutput 13 criteria 0 100 0 0 0 0 4 2
01-09 20:38:33.862  1105  4395 V APM_AudioPolicyManager: selectOutput new bestOutput 21 criteria 0 100 0 0 0 1 2 0
01-09 20:38:33.862  1105  4395 V APM_AudioPolicyManager: getOutputForAttrInt returns output 21 selectedDeviceId 3
01-09 20:38:33.862  1105  4395 V APM_AudioPolicyManager: getOutputForAttr() returns output 21 requestedPortId 0 selectedDeviceId 3 for port ID 4205
01-09 20:38:33.863  1105  4395 I AudioFlinger: nonSecFlag 0, secFlag 0, outputFlags 8
01-09 20:38:33.863  1105  4395 D AudioFlinger: Client defaulted notificationFrames to 1282 for frameCount 3848
01-09 20:38:33.863  1564  1733 F libc    : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 1733 (SDLThread), pid 1564 (SDLActivity)
01-09 20:38:33.865  1105  4395 D AF::TrackHandle: OpPlayAudio: track:3434 usage:1 not muted
01-09 20:38:33.866  1105  4395 I AF::Track: setMixerOutConfig expectKey 202
01-09 20:38:33.866  1105  4395 I AF::Track: setMixerOutConfig select, mixer out f 5, s 48000, thread out f 4, s 48000
01-09 20:38:33.877  1564  2290 D AudioTrack: setVolume(1.000000, 1.000000) pid : 1564
01-09 20:38:33.877  1564  2290 D AAudioStream: setState(s#1) from 0 to 2
01-09 20:38:33.879  1564  2290 I AAudio  : AAudioStreamBuilder_openStream() returns 0 = AAUDIO_OK for s#1 ----------------
01-09 20:38:33.879  1564  2290 D AAudio  : AAudioStream_requestStart(s#1) called --------------
01-09 20:38:33.879  1564  2290 D AAudioStream: setState(s#1) from 2 to 3
01-09 20:38:33.879  1105  4395 I AF::Track: setMixerOutConfig expectKey 202
01-09 20:38:33.879  1105  4395 I AF::Track: setMixerOutConfig select, mixer out f 5, s 48000, thread out f 4, s 48000
01-09 20:38:33.879  1105  4395 I AudioPolicyEffectException: MySpaceHandler::checkDetachCondition media 1, ring 0, mp 0
01-09 20:38:33.879  1105  4395 I AudioPolicyEffectException: MySpace detach value 1
01-09 20:38:33.879  1105  4395 V APM_AudioPolicyManager: startOutput portId 4205
01-09 20:38:33.879  1105  4395 V APM_AudioPolicyManager: startOutput() output 21, stream 3, session 35713
01-09 20:38:33.879  1105  4395 V APM_AudioPolicyManager: setBeaconMute(1) mBeaconMuteRefCount=26 mBeaconPlayingRefCount=0
01-09 20:38:33.879  1105  4395 V APM_AudioPolicyManager: selectOutputForMusicEffects activeOnly 1 output 21 flags 0x00000008
01-09 20:38:33.879  1105  4395 W AudioFlinger: moveEffectChain_l() effect chain for session 0 not on source thread 0xb4000079bd440850
01-09 20:38:33.879  1105  4395 V APM_AudioPolicyManager: selectOutputForMusicEffects selected output 21
01-09 20:38:33.879  1105  4395 V APM_AudioPolicyManager: getNewOutputDevices selected devices {AUDIO_DEVICE_OUT_SPEAKER, @:}
01-09 20:38:33.879  1105  4395 V APM_AudioPolicyManager: setOutputDevices device {AUDIO_DEVICE_OUT_SPEAKER, @:} delayMs 0
01-09 20:38:33.879  1105  4395 V APM_AudioPolicyManager: setOutputDevices() prevDevice {AUDIO_DEVICE_OUT_SPEAKER, @:}
01-09 20:38:33.879  1105  4395 V APM_AudioPolicyManager: setOutputDevices: suppressing checkDeviceMuteStrategies
01-09 20:38:33.879  1105  4395 V APM_AudioPolicyManager: setOutputDevices setting same device {AUDIO_DEVICE_OUT_SPEAKER, @:} or null device, force=0, patch handle=4134
01-09 20:38:33.879  1105  4395 V APM_AudioPolicyManager: computeVolume: stream 3, index 7, volume 0.050119, deviceTypes 0x2
01-09 20:38:33.879  1105  4395 V APM_AudioPolicyManager: computeVolume: stream 3, index 8, volume 0.070795, deviceTypes 0x2
01-09 20:38:33.881   989  1812 V sec_audio_hw: sec_dev_set_parameters : l_stream_music_active=true
01-09 20:38:33.881   989  1812 D audio_hw_primary: adev_set_parameters: enter: l_stream_music_active=true
01-09 20:38:33.881   989  1812 D audio_hw_hfp: hfp_set_parameters: enter
01-09 20:38:33.881   989  1812 V audio_hw_sec: sec_set_parameters: enter: l_stream_music_active=true
01-09 20:38:33.881   989  1812 D AudioSAEffectOffload: update offload effect: VM,0,0,0,0,2,0
01-09 20:38:33.881   989  1812 D audio_hw_extn: audio_extn_fm_set_parameters: Enter
01-09 20:38:33.881   989  1812 D audio_hw_primary: adev_set_parameters: exit with code(0)
01-09 20:38:33.881   989  1048 I Audio_a2dpsink_hw: adev_set_parameters: kevpairs=[l_stream_music_active=true]
01-09 20:38:33.882  1105  4395 I AudioFlinger: updateStageIndex new -2108
01-09 20:38:33.882  1105  1781 D DlbEffectContext: setParam() received parameter EFFECT_PARAM_SEEK
01-09 20:38:33.882  1105  1781 D DlbEffectContext: handleSeek(end crossfading for seeking operation)
01-09 20:38:33.882  1105  1781 D DlbCrossfadeProcess: setEnabled transitioning from FADE_TO_BYPASS state to FADE_TO_ACTIVE
01-09 20:38:33.882  1105  1781 D DlbEffectContext: transformExternalGain() volume:0xCD494 fVol:0.050119 extVal:-416
01-09 20:38:33.882  1105  1781 D DlbEffectContext: transformExternalGain() volume:0x1000000 fVol:1.000000 extVal:0
01-09 20:38:33.882  1105  1781 D DlbEndpointParamCache: commitChangedParams()
01-09 20:38:33.882  1105  1781 D DlbEndpointParamCache: commit() Applying parameters for device 0x40000000
01-09 20:38:33.882  1105  1781 D DlbDap2Process: setParam(preg = #1[0])
01-09 20:38:33.882  1105  1781 D DlbDap2Process: setSystemGain(vol = 0)
01-09 20:38:33.882  1105  1781 D DlbDap2Process: setParam(svol = #1[-416])
01-09 20:38:33.882  1105  1781 D DlbEndpointParamCache: doCommit() Committed 2 parameters out of 15.
01-09 20:38:33.882  1105  1781 D DlbEndpointParamCache: commit() Overriding parameters for current device 0x00000002
01-09 20:38:33.882  1105  1781 D DlbEndpointParamCache: doCommit() Committed 0 parameters out of 56.
01-09 20:38:33.882  1105  1781 I AudioSAEffectSecPlus: command EFFECT_CMD_SET_VOLUME left = 0.050119, right =0.050119
01-09 20:38:33.882  1564  2290 D AAudio  : AAudioStream_requestStart(s#1) returned 0 ---------
01-09 20:38:33.882  1564  2315 D AudioStreamLegacy: onAudioDeviceUpdate(deviceId = 3)
01-09 20:38:33.883  1105  1781 D DlbCrossfadeProcess: process transitioning from FADE_TO_ACTIVE state to DAP_ACTIVE
01-09 20:38:33.883  1105  1781 I SoundAlive_Interface a64: [ 2 ][ 48000 ]FlushBuffers()
01-09 20:38:33.883   989 28053 D audio_hw_primary: start_output_stream: enter: stream(0xea58c970)usecase(0: deep-buffer-playback) devices(0x2) is_haptic_usecase(0)
01-09 20:38:33.884   989 28053 D audio_hw_primary: select_devices for use case (deep-buffer-playback)
01-09 20:38:33.884   989 28053 I sm8250_platform: platform_check_and_set_codec_backend_cfg:becf: afe: bitwidth 24, samplerate 48000 channels 2, backend_idx 0 usecase = 0 device (speaker)
01-09 20:38:33.884   989 28053 D sm8250_platform: platform_split_snd_device: snd_device(2) num devices(1) new_snd_devices(0)
01-09 20:38:33.884   989 28053 I sm8250_platform: platform_check_and_set_codec_backend_cfg: new_snd_devices[0] is 2
01-09 20:38:33.884   989 28053 I sm8250_platform: platform_check_codec_backend_cfg:becf: afe: bitwidth 24, samplerate 48000 channels 2, backend_idx 0 usecase = 0 device (speaker)
01-09 20:38:33.884   989 28053 D sm8250_platform: platform_check_codec_backend_cfg:becf: updated afe: bitwidth 24, samplerate 48000 channels 2,backend_idx 0 usecase = 0 device (speaker)
01-09 20:38:33.884   989 28053 D sm8250_platform: platform_check_codec_backend_cfg:becf: afe: playback on codec device not supporting native playback set default Sample Rate(48k)
01-09 20:38:33.884   989 28053 I sm8250_platform: platform_check_codec_backend_cfg:becf: afe: Codec selected backend: 0 updated bit width: 24 and sample rate: 48000
01-09 20:38:33.884   989 28053 D audio_hw_primary: check_usecases_codec_backend:becf: force routing 1
01-09 20:38:33.884   989 28053 E sm8250_platform: platform_check_backends_match: Invalid snd_device =
01-09 20:38:33.884   989 28053 D audio_hw_primary: check_usecases_codec_backend:becf: (81) check_usecases curr device: speaker, usecase device: backends match 0
01-09 20:38:33.884   989 28053 D audio_hw_primary: check_usecases_codec_backend:becf: check_usecases num.of Usecases to switch 0
01-09 20:38:33.884   989 28053 D hardware_info: hw_info_append_hw_type : device_name = speaker
01-09 20:38:33.884   989 28053 V audio_hw_sec: sec_dsm_spkr_prot_control_tx_topology() enable:1, dsm_is_enabled:0
01-09 20:38:33.884   989 28053 D hardware_info: hw_info_append_hw_type : device_name = vi-feedback
01-09 20:38:33.884   989 28053 D audio_hw_primary: enable_snd_device: snd_device(299: vi-feedback)
01-09 20:38:33.884   989 28053 D sm8250_platform: platform_get_island_cfg_on_device:island cfg status on snd_device = (vi-feedback 0)
01-09 20:38:33.884   989 28053 I soundtrigger: audio_extn_sound_trigger_update_device_status: device 0x12b of type 1 for Event 1, with Raise=0
01-09 20:38:33.884   989 28053 D audio_route: Apply path: vi-feedback
01-09 20:38:33.884   989 28053 D soundtrigger: audio_extn_sound_trigger_update_stream_status: uc_info->id 79 of type 1 for Event 3, with Raise=0
01-09 20:38:33.884   989 28053 D audio_hw_utils: audio_extn_utils_send_app_type_cfg: usecase->in_snd_device vi-feedback
01-09 20:38:33.884   989 28053 E voice   : voice_is_in_call_rec_stream: input stream is NULL
01-09 20:38:33.884   989 28053 D sm8250_platform: platform_split_snd_device: snd_device(299) num devices(0) new_snd_devices(0)
01-09 20:38:33.884   989 28053 E voice   : voice_is_in_call_rec_stream: input stream is NULL
01-09 20:38:33.884   989 28053 I audio_hw_utils: send_app_type_cfg_for_device default app_type 69938, acdb_dev_id 102, sample_rate 48000, snd_device_be_idx 56
01-09 20:38:33.885   989 28053 D sm8250_platform: platform_split_snd_device: snd_device(299) num devices(1) new_snd_devices(0)
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> send_audio_cal, acdb_id = 102, path = 1, app id = 0x11132, sample rate = 48000, afe_sample_rate = 48000
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> send_asm_topology
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_STREAM_TOPOLOGY_ID
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> send_adm_topology
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_COMMON_TOPOLOGY_ID
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> send_audtable
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_INSTANCE_COMMON_TABLE_SIZE
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_INSTANCE_COMMON_TABLE
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> AUDIO_SET_AUDPROC_CAL cal_type[11] acdb_id[102] app_type[69938]
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_PERSISTENT_AUDPROC_INSTANCE_COMMON_TABLE_SIZE
01-09 20:38:33.885   989 28053 D android.hardware.audio.service: [Data Manager]-> No data found
01-09 20:38:33.885   989 28053 D ACDB-LOADER: Error: ACDB_CMD_GET_PERSISTENT_AUDPROC_INSTANCE_COMMON_TABLE_SIZE returned -18
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> send_audproc_persist_table -18
01-09 20:38:33.885   989 28053 D ACDB-LOADER: Error: Invalid Audproc persist size = -18
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_INSTANCE_STREAM_TABLE_SIZE
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> send_audstrmtable
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_INSTANCE_STREAM_TABLE
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> audstrm_cal->cal_type.cal_data.cal_size = 20
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> send_afe_topology
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AFE_TOPOLOGY_ID
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> GET_AFE_TOPOLOGY_ID for adcd_id 102, Topology Id 112fb
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> send_afe_cal
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AFE_INSTANCE_COMMON_TABLE_SIZE
01-09 20:38:33.885   989 28053 D android.hardware.audio.service: Failed to fetch the lookup information of the device 00000066
01-09 20:38:33.885   989 28053 D ACDB-LOADER: Error: ACDB_CMD_GET_AFE_INSTANCE_COMMON_TABLE_SIZE Returned = -19
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AFE_INSTANCE_COMMON_TABLE
01-09 20:38:33.885   989 28053 D android.hardware.audio.service: Failed to fetch the lookup information of the device 00000066
01-09 20:38:33.885   989 28053 D ACDB-LOADER: Error: ACDB AFE returned = -19
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> AUDIO_SET_AFE_CAL cal_type[17] acdb_id[102]
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> send_hw_delay : acdb_id = 102 path = 1
01-09 20:38:33.885   989 28053 D ACDB-LOADER: ACDB -> ACDB_AVSYNC_INFO: ACDB_CMD_GET_DEVICE_PROPERTY
01-09 20:38:33.885   989 28053 D audio_hw_primary: enable_audio_route: apply mixer and update path: spkr-vi-feedback
01-09 20:38:33.885   989 28053 D audio_route: Apply path: spkr-vi-feedback
01-09 20:38:33.885   989 28053 D AudioSAEffectOffload: update offload effect: VM,0,0,0,0,2,0
01-09 20:38:33.886  1248  2143 D AS.SoundAliveHelper: notify dvfs state : 2, screen : true
01-09 20:38:33.886  1248  1248 D AudioPlayerStateMonitor: Found a new active media playback. AudioPlaybackConfiguration piid:28015 deviceId:3 type:AAudio u/pid:10266/1564 state:started attr:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0x0 tags= bundle=null sessionId:-1
01-09 20:38:33.890 31579 31622 I SAContentProvider:  getType() : screen on is true
01-09 20:38:33.895  5977  5977 I HBD     : g onCapabilityChanged  setNetworkState currentNetworkState : wifi
01-09 20:38:33.896  1248  1248 I GestureDetector: handleMessage TAP
01-09 20:38:33.896  1248  1546 I GestureDetector: handleMessage TAP
01-09 20:38:33.905   989 28053 V audio_hw_sec: sec_dsm_spkr_prot_control_tx_topology() dsm enabled (c:0 d:1 m:0)
01-09 20:38:33.905   989 28053 D audio_hw_primary: enable_snd_device: snd_device(2: dual-speaker)
01-09 20:38:33.905   989 28053 D sm8250_platform: platform_get_island_cfg_on_device:island cfg status on snd_device = (speaker 0)
01-09 20:38:33.905   989 28053 I soundtrigger: audio_extn_sound_trigger_update_device_status: device 0x2 of type 0 for Event 1, with Raise=0
01-09 20:38:33.905   989 28053 D audio_route: Apply path: dual-speaker
01-09 20:38:33.910   989 28053 I audio_hw_utils: set_app_type_cfg app_type_cfg->app_type 69940 -> 69941 sample_rate 48000, bit_width 24
01-09 20:38:33.910   989 28053 I audio_hw_utils: set_app_type_cfg app_type_cfg->app_type 69941, app_type_cfg->sample_rate 48000, app_type_cfg->bit_width 24
01-09 20:38:33.910   989 28053 E soundtrigger: audio_extn_sound_trigger_update_stream_status: invalid input device 0x0, for event 3
01-09 20:38:33.910   989 28053 D soundtrigger: audio_extn_sound_trigger_update_stream_status: uc_info->id 0 of type 0 for Event 3, with Raise=0
01-09 20:38:33.910   989 28053 D audio_hw_utils: audio_extn_utils_send_app_type_cfg: usecase->out_snd_device speaker
01-09 20:38:33.910   989 28053 D sm8250_platform: platform_split_snd_device: snd_device(2) num devices(0) new_snd_devices(0)
01-09 20:38:33.910   989 28053 I audio_hw_utils: send_app_type_cfg_for_device PLAYBACK app_type 69941, acdb_dev_id 13, sample_rate 48000, snd_device_be_idx 55
01-09 20:38:33.910   989 28053 D sm8250_platform: platform_split_snd_device: snd_device(2) num devices(1) new_snd_devices(0)
01-09 20:38:33.910   989 28053 D ACDB-LOADER: ACDB -> send_audio_cal, acdb_id = 13, path = 0, app id = 0x11135, sample rate = 48000, afe_sample_rate = 48000
01-09 20:38:33.910   989 28053 D ACDB-LOADER: ACDB -> send_asm_topology
01-09 20:38:33.910   989 28053 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_STREAM_TOPOLOGY_ID
01-09 20:38:33.910   989 28053 D ACDB-LOADER: ACDB -> send_adm_topology
01-09 20:38:33.910   989 28053 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_COMMON_TOPOLOGY_ID
01-09 20:38:33.910   989 28053 D ACDB-LOADER: ACDB -> send_audtable
01-09 20:38:33.910   989 28053 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_INSTANCE_COMMON_TABLE_SIZE
01-09 20:38:33.910   989 28053 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_INSTANCE_COMMON_TABLE
01-09 20:38:33.910   989 28053 D ACDB-LOADER: ACDB -> AUDIO_SET_AUDPROC_CAL cal_type[11] acdb_id[13]

I have tried clearing the app cache on android which seemed to work at first but has since stopped preventing the crash.


问:
How do I extrude a face of a mesh in Unity
I would like to see an example on how to proceduraly extrude a face of a mesh,parts of a mesh face (if it's tesselated) using Unity Meshes API and C# Scripting.

```<code>private static Mesh Testp(Mesh mesh)
{
List<Vector3> vertices = new List<Vector3>(mesh.vertices.ToArray());
List<Vector3> normals = new List<Vector3>(mesh.normals.ToArray());
List<int> triangles = new List<int>(mesh.triangles);

for (var i = 0; i < mesh.triangles.Length / 3; i += 3)
{
var faceNormal = CalculateFaceNormal(normals, triangles, i);
if (Math.Abs(Vector3.Dot(Vector3.forward, faceNormal) - (-1f)) < 0.0001f)
{
triangles.Add(vertices.Count);
triangles.Add(vertices.Count+1);
triangles.Add(vertices.Count+2);

vertices.Add(vertices[triangles[i]] + faceNormal * 1f);
vertices.Add(vertices[triangles[i+1]] + faceNormal * 1f);
vertices.Add(vertices[triangles[i+2]] + faceNormal * 1f);

normals.Add(faceNormal);
normals.Add(faceNormal);
normals.Add(faceNormal);
}
}

mesh.Clear();
mesh.vertices = vertices.ToArray();
mesh.normals = normals.ToArray();
mesh.triangles = triangles.ToArray();
return mesh;
}
</code>```

this is what I've tried so far, but this doesnt really extrude a face, it just creates a new face offseted by a value.

Body:
I would like to see an example on how to proceduraly extrude a face of a mesh,parts of a mesh face (if it's tesselated) using Unity Meshes API and C# Scripting.

private static Mesh Testp(Mesh mesh)
{
List<Vector3> vertices = new List<Vector3>(mesh.vertices.ToArray());
List<Vector3> normals = new List<Vector3>(mesh.normals.ToArray());
List<int> triangles = new List<int>(mesh.triangles);

for (var i = 0; i < mesh.triangles.Length / 3; i += 3)
{
var faceNormal = CalculateFaceNormal(normals, triangles, i);
if (Math.Abs(Vector3.Dot(Vector3.forward, faceNormal) - (-1f)) < 0.0001f)
{
triangles.Add(vertices.Count);
triangles.Add(vertices.Count+1);
triangles.Add(vertices.Count+2);

vertices.Add(vertices[triangles[i]] + faceNormal * 1f);
vertices.Add(vertices[triangles[i+1]] + faceNormal * 1f);
vertices.Add(vertices[triangles[i+2]] + faceNormal * 1f);

normals.Add(faceNormal);
normals.Add(faceNormal);
normals.Add(faceNormal);
}
}

mesh.Clear();
mesh.vertices = vertices.ToArray();
mesh.normals = normals.ToArray();
mesh.triangles = triangles.ToArray();
return mesh;
}

this is what I've tried so far, but this doesnt really extrude a face, it just creates a new face offseted by a value.


问:
Why does running the whole file cause an error but line by line works?
I want to click a hover menu option using selenium. When i run the whole file, it encounters an error stating "element is not attached to page document", but when I run the specific section that setups the proper location and that hovers (line 28-41) line by line, it has no probems hovering then clicking the desired link.

```<code>from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions as EC
from webdriver_manager.chrome import ChromeDriverManager

url = "https://usmon.com/db/index.jsp"
username = "000"
password = "000"

#Sets correct path for selinium to find chrome if chrome not in default location
options = webdriver.ChromeOptions()
options.binary_location = r"C:\Program Files\Google\Chrome Beta\Application\chrome.exe"
chrome_driver_binary = r"C:\Users\karln\.wdm\drivers\chromedriver\win32\108.0.5359\chromedriver.exe"
driver = webdriver.Chrome(chrome_driver_binary, chrome_options=options)

#launch URL
start = driver.get(url)

driver.find_element_by_id("username").send_keys(username)
driver.find_element_by_id("password").send_keys(password)

#Used xpath because element did not have a class or ID. To find xpath in chrome, inspect element, then copy html line in inspect tool, and you'll get options for which type to copy, and you can click on xpath
driver.find_element_by_xpath('//*[@id="primary-home-area"]/div[1]/div/div[2]/div[2]/form/table/tbody/tr[4]/td[2]/button').click()

#Switching view to San Antonio or it wont find my cases
#chg_vw = driver.find_element_by_xpath('//*[@id="main_Child_web_id"]').click()
san_an = driver.find_element_by_xpath('//*[@id="main_Child_web_id"]/option[1]').click()

#Identifying element to hover over
pt_records = driver.find_element_by_xpath('//*[@id="main_ui"]/li[1]/a/span[1]')

#Hover over element
hover = ActionChains(driver)
hover.move_to_element(pt_records).perform()

#Identify element to click in hover menu and click it
cl_cases = driver.find_element_by_xpath('//*[@id="main_ui"]/li[1]/ul/li[4]/a')
hover.move_to_element(cl_cases).click().perform()

</code>```

I have tried to add an implicit wait times, since that was I saw recommended multiple times but to avail.

Body:
I want to click a hover menu option using selenium. When i run the whole file, it encounters an error stating "element is not attached to page document", but when I run the specific section that setups the proper location and that hovers (line 28-41) line by line, it has no probems hovering then clicking the desired link.

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions as EC
from webdriver_manager.chrome import ChromeDriverManager

url = "https://usmon.com/db/index.jsp"
username = "000"
password = "000"

#Sets correct path for selinium to find chrome if chrome not in default location
options = webdriver.ChromeOptions()
options.binary_location = r"C:\Program Files\Google\Chrome Beta\Application\chrome.exe"
chrome_driver_binary = r"C:\Users\karln\.wdm\drivers\chromedriver\win32\108.0.5359\chromedriver.exe"
driver = webdriver.Chrome(chrome_driver_binary, chrome_options=options)

#launch URL
start = driver.get(url)

driver.find_element_by_id("username").send_keys(username)
driver.find_element_by_id("password").send_keys(password)

#Used xpath because element did not have a class or ID. To find xpath in chrome, inspect element, then copy html line in inspect tool, and you'll get options for which type to copy, and you can click on xpath
driver.find_element_by_xpath('//*[@id="primary-home-area"]/div[1]/div/div[2]/div[2]/form/table/tbody/tr[4]/td[2]/button').click()

#Switching view to San Antonio or it wont find my cases
#chg_vw = driver.find_element_by_xpath('//*[@id="main_Child_web_id"]').click()
san_an = driver.find_element_by_xpath('//*[@id="main_Child_web_id"]/option[1]').click()

#Identifying element to hover over
pt_records = driver.find_element_by_xpath('//*[@id="main_ui"]/li[1]/a/span[1]')

#Hover over element
hover = ActionChains(driver)
hover.move_to_element(pt_records).perform()

#Identify element to click in hover menu and click it
cl_cases = driver.find_element_by_xpath('//*[@id="main_ui"]/li[1]/ul/li[4]/a')
hover.move_to_element(cl_cases).click().perform()

I have tried to add an implicit wait times, since that was I saw recommended multiple times but to avail.


问:
Make table head fixed, when scrolling through rows
So am trying to make the table header fixed when scrolling through the rows in a Material-UI table in a React application. Am failing to achieve it

```<code>import React, { useRef } from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Table from '@material-ui/core/Table';
import TableBody from '@material-ui/core/TableBody';
import TableCell from '@material-ui/core/TableCell';
import TableContainer from '@material-ui/core/TableContainer';
import TableHead from '@material-ui/core/TableHead';
import TableRow from '@material-ui/core/TableRow';
import Paper from '@material-ui/core/Paper';
import {useLayoutEffect} from 'react'

const useStyles = makeStyles({
  table: {
    minWidth: 650,
  },
});

function FixedHeaderTable({ data }) {
  const classes = useStyles();
  const headerRef = useRef(null);

  useLayoutEffect(() => {
    const header = headerRef.current;
    const table = header.parentElement;
    table.style.overflow = 'auto';
    table.style.display = 'block';
    header.style.position = 'sticky';
    header.style.top = '0';
  }, [headerRef]);

  return (
    <TableContainer component={Paper}>
      <Table className={classes.table} aria-label="fixed header table">
        <TableHead ref={headerRef}>
          <TableRow>
            <TableCell>Header 1</TableCell>
            <TableCell align="right">Header 2</TableCell>
            <TableCell align="right">Header 3</TableCell>
            <TableCell align="right">Header 4</TableCell>
          </TableRow>
        </TableHead>
        <TableBody>
          {data.map(row => (
            <TableRow key={row.name}>
              <TableCell component="th" scope="row">
                {row.name}
              </TableCell>
              <TableCell align="right">{row.value1}</TableCell>
              <TableCell align="right">{row.value2}</TableCell>
              <TableCell align="right">{row.value3}</TableCell>
            </TableRow>
          ))}
        </TableBody>
      </Table>
    </TableContainer>
  );
}

export default FixedHeaderTable;

</code>```

And here is how am calling it in the app.js file

```<code>import React from 'react';
import './App.css';
import FixedHeaderTable from './FixedHeaderTable';

const data = [
  { name: 'Row 1', value1: 1, value2: 2, value3: 3 },
  { name: 'Row 2', value1: 4, value2: 5, value3: 6 },
  { name: 'Row 3', value1: 7, value2: 8, value3: 9 },
  { name: 'Row 4', value1: 10, value2: 11, value3: 12 },
  { name: 'Row 5', value1: 13, value2: 14, value3: 15 },
  { name: 'Row 6', value1: 16, value2: 17, value3: 18 },
  { name: 'Row 7', value1: 19, value2: 20, value3: 21 },
  { name: 'Row 8', value1: 22, value2: 23, value3: 24 },
  { name: 'Row 9', value1: 25, value2: 26, value3: 27 },
  { name: 'Row 10', value1: 28, value2: 29, value3: 30 },
  { name: 'Row 11', value1: 31, value2: 32, value3: 33 },
  { name: 'Row 12', value1: 34, value2: 35, value3: 36 },
  { name: 'Row 13', value1: 37, value2: 38, value3: 39 },
  { name: 'Row 14', value1: 40, value2: 41, value3: 42 },
  { name: 'Row 15', value1: 43, value2: 44, value3: 45 },
  { name: 'Row 16', value1: 46, value2: 47, value3: 48 },
  { name: 'Row 17', value1: 49, value2: 50, value3: 51 },
  { name: 'Row 18', value1: 52, value2: 53, value3: 54 },
  { name: 'Row 19', value1: 55, value2: 56, value3: 57 },
  { name: 'Row 20', value1: 58, value2: 59, value3: 60 },
  { name: 'Row 21', value1: 61, value2: 62, value3: 63 },
]

function App() {
  return (
    <div className="App">
      <FixedHeaderTable data={data} />
    </div>
  );
}

export default App;

</code>```

In this example, useLayoutEffect is used to set styles on the table and table header elements after the initial render. The headerRef is used to store a reference to the table header element, so that it can be accessed and modified in the layout effect. The table.style.overflow property is set to auto to enable scrolling, and the table.style.display property is set to block to ensure that the table is a block-level element. The header.style.position property is set to sticky, and the header.style.top property is set to 0, which makes the header fixed at the top of the table as the table is scrolled.

It is important to note that useLayoutEffect

Body:
So am trying to make the table header fixed when scrolling through the rows in a Material-UI table in a React application. Am failing to achieve it

import React, { useRef } from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Table from '@material-ui/core/Table';
import TableBody from '@material-ui/core/TableBody';
import TableCell from '@material-ui/core/TableCell';
import TableContainer from '@material-ui/core/TableContainer';
import TableHead from '@material-ui/core/TableHead';
import TableRow from '@material-ui/core/TableRow';
import Paper from '@material-ui/core/Paper';
import {useLayoutEffect} from 'react'

const useStyles = makeStyles({
  table: {
    minWidth: 650,
  },
});

function FixedHeaderTable({ data }) {
  const classes = useStyles();
  const headerRef = useRef(null);

  useLayoutEffect(() => {
    const header = headerRef.current;
    const table = header.parentElement;
    table.style.overflow = 'auto';
    table.style.display = 'block';
    header.style.position = 'sticky';
    header.style.top = '0';
  }, [headerRef]);

  return (
    <TableContainer component={Paper}>

        <TableHead ref={headerRef}>
          <TableRow>
            <TableCell>Header 1</TableCell>
            <TableCell align="right">Header 2</TableCell>
            <TableCell align="right">Header 3</TableCell>
            <TableCell align="right">Header 4</TableCell>
          </TableRow>
        </TableHead>
        <TableBody>
          {data.map(row => (
            <TableRow key={row.name}>
              <TableCell component="th" scope="row">
                {row.name}
              </TableCell>
              <TableCell align="right">{row.value1}</TableCell>
              <TableCell align="right">{row.value2}</TableCell>
              <TableCell align="right">{row.value3}</TableCell>
            </TableRow>
          ))}
        </TableBody>

    </TableContainer>
  );
}

export default FixedHeaderTable;

And here is how am calling it in the app.js file

import React from 'react';
import './App.css';
import FixedHeaderTable from './FixedHeaderTable';

const data = [
  { name: 'Row 1', value1: 1, value2: 2, value3: 3 },
  { name: 'Row 2', value1: 4, value2: 5, value3: 6 },
  { name: 'Row 3', value1: 7, value2: 8, value3: 9 },
  { name: 'Row 4', value1: 10, value2: 11, value3: 12 },
  { name: 'Row 5', value1: 13, value2: 14, value3: 15 },
  { name: 'Row 6', value1: 16, value2: 17, value3: 18 },
  { name: 'Row 7', value1: 19, value2: 20, value3: 21 },
  { name: 'Row 8', value1: 22, value2: 23, value3: 24 },
  { name: 'Row 9', value1: 25, value2: 26, value3: 27 },
  { name: 'Row 10', value1: 28, value2: 29, value3: 30 },
  { name: 'Row 11', value1: 31, value2: 32, value3: 33 },
  { name: 'Row 12', value1: 34, value2: 35, value3: 36 },
  { name: 'Row 13', value1: 37, value2: 38, value3: 39 },
  { name: 'Row 14', value1: 40, value2: 41, value3: 42 },
  { name: 'Row 15', value1: 43, value2: 44, value3: 45 },
  { name: 'Row 16', value1: 46, value2: 47, value3: 48 },
  { name: 'Row 17', value1: 49, value2: 50, value3: 51 },
  { name: 'Row 18', value1: 52, value2: 53, value3: 54 },
  { name: 'Row 19', value1: 55, value2: 56, value3: 57 },
  { name: 'Row 20', value1: 58, value2: 59, value3: 60 },
  { name: 'Row 21', value1: 61, value2: 62, value3: 63 },
]

function App() {
  return (

      <FixedHeaderTable data={data} />

  );
}

export default App;

In this example, useLayoutEffect is used to set styles on the table and table header elements after the initial render. The headerRef is used to store a reference to the table header element, so that it can be accessed and modified in the layout effect. The table.style.overflow property is set to auto to enable scrolling, and the table.style.display property is set to block to ensure that the table is a block-level element. The header.style.position property is set to sticky, and the header.style.top property is set to 0, which makes the header fixed at the top of the table as the table is scrolled.

It is important to note that useLayoutEffect


问:
Use Matplotlib to plot 100% Stacked bar from Excel data
I can plot a 100% stacked bar from Excel. is it possible to achieve the same with matplotlib ?

```<code>import pandas as pd
import matplotlib.pyplot as plt

data = [
        [0.4 , 0.3 , 0.2 , 0.1],
        [0.5 , 0.3 , 0.6 , 0.1],
        [0.1 , 0.4 , 0.2 , 0.8],

]

columns = ["A","B","C","D" ]

df = pd.DataFrame(data=data , columns=columns , index = ["Empty" , "Wrong" , "Correct"] )

df.plot(kind="barh" , stacked=True )

plt.ylabel("Percentages")

plt.show()

print (df)
</code>```

Body:
I can plot a 100% stacked bar from Excel. is it possible to achieve the same with matplotlib ?

import pandas as pd
import matplotlib.pyplot as plt

data = [
        [0.4 , 0.3 , 0.2 , 0.1],
        [0.5 , 0.3 , 0.6 , 0.1],
        [0.1 , 0.4 , 0.2 , 0.8],

]

columns = ["A","B","C","D" ]

df = pd.DataFrame(data=data , columns=columns , index = ["Empty" , "Wrong" , "Correct"] )

df.plot(kind="barh" , stacked=True )

plt.ylabel("Percentages")

plt.show()

print (df)