问:
Issue with WordPress Subsite URLs
(Sorry for the long post as I'm baffled by many aspects of this issue)

I recently converted my WordPress single-site installation to a multisite network. The former site is now the main site of my network. I'm trying to create multiple subsites for my network but I'm running into unusual issues with the URL.

I have the network setup as a subdomain network. I plan to initially create the subsites as

http://subsite1.maindomain.com

http://subsite2.maindomain.com

But then later map these to

http://www.subsite1.com

http://www.subsite2.com

I'm nowhere close to the domain mapping because even the subdomains are not working properly.

The first issue I encounter upon creating a new subsite...After entering all of the details such as site URL, title, and admin email, I am then presented with a blank white page with no error message. I'm not being redirected to the subsite's dashboard or back to a network page. In order to navigate back, I have to enter my network admin URL directly in my browser in order see the new subsite among my list of sites.

The second issue I encounter is though I set the site URL as "http://subsite1.maindomain.com", when I'm viewing any of my subsites and hover over the Dashboard or Visit link, the URL shows that of my main site, http://www.maindomain.com and not of my subsite. I am able to Edit the subsite and change the basic details but I can't get into the dashboard.

It's important to note that the URLs were working for a brief period of time with subsites that I have since deleted. I would create a new subsite and I would be able to get into the dashboard. But suddenly, with no rhyme or reason, the links started linking to the parent and I lost access to the subsites' dashboards. So then I deleted those subsites using the admin network interface and tried creating new ones but I was never again successful.

I've noticed that with the subsites that I created long ago, WordPress created new database tables for them starting with wp_X (where X was the id of the subsite). Now when I inspect my database, I see no tables that represent any subsites. Perhaps those were tables created by plugins because, as I stated, I was once able to get into my subsites and turn plugins on and off.

Also when I was creating those subsites previously, after adding one I would immediately see the subsite listed under the My Sites dropdown. They no longer appear there.

When I go to edit my subsite, even though I originally entered the URL "http://subsite1.maindomain.com", the URL shows as "://subsite.maindomain.com".This doesn't seem right. And when I try to click "Upgrade Network", I am presented with an issue saying one of the subsite URLs is invalid. I  believe this is because of the "://" at the beginning of the URL. I've tried removing this from the URL and resaving it, but it always saves with it.

Everything in my database looks fine.

wp_blogs looks like

blog_id
site_id
domain
path

1
1
www.maindomain.com
/

15
1
subsite1.maindomain.com
/

no data in blogs_meta

wp_site has only one record

id
domain
path

1
www.maindomain.com
/

wp_sitemeta contains a few thousand records but the site_id column for all of them is 1. The value for siteurl is https://www.maindomain.com/

wp_config.php

```<code>define( 'WP_ALLOW_MULTISITE', true );
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', true);
define( 'DOMAIN_CURRENT_SITE', 'www.maindomain.com' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
</code>```

.htaccess

```<code>RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
</code>```

I thought maybe the issue could be with SSL or DNS, but the URLs should still link and display the correct link when I hover over the Visit or Dashboard links.

I've deactivated most of my plugins network-wide and really don't want to deactivate any more plugins or my main theme as it will cause my main site to be down until they are activated on the site level. In my experience, reactivating my theme once I deactivated doesn't always honor my previous settings. I don't think the issue is a plugin or theme conflict.

Title: Issue with WordPress Subsite URLs

Body:
(Sorry for the long post as I'm baffled by many aspects of this issue)

I recently converted my WordPress single-site installation to a multisite network. The former site is now the main site of my network. I'm trying to create multiple subsites for my network but I'm running into unusual issues with the URL.

I have the network setup as a subdomain network. I plan to initially create the subsites as

http://subsite1.maindomain.com

http://subsite2.maindomain.com

But then later map these to

http://www.subsite1.com

http://www.subsite2.com

I'm nowhere close to the domain mapping because even the subdomains are not working properly.

The first issue I encounter upon creating a new subsite...After entering all of the details such as site URL, title, and admin email, I am then presented with a blank white page with no error message. I'm not being redirected to the subsite's dashboard or back to a network page. In order to navigate back, I have to enter my network admin URL directly in my browser in order see the new subsite among my list of sites.

The second issue I encounter is though I set the site URL as "http://subsite1.maindomain.com", when I'm viewing any of my subsites and hover over the Dashboard or Visit link, the URL shows that of my main site, http://www.maindomain.com and not of my subsite. I am able to Edit the subsite and change the basic details but I can't get into the dashboard.

It's important to note that the URLs were working for a brief period of time with subsites that I have since deleted. I would create a new subsite and I would be able to get into the dashboard. But suddenly, with no rhyme or reason, the links started linking to the parent and I lost access to the subsites' dashboards. So then I deleted those subsites using the admin network interface and tried creating new ones but I was never again successful.

I've noticed that with the subsites that I created long ago, WordPress created new database tables for them starting with wp_X (where X was the id of the subsite). Now when I inspect my database, I see no tables that represent any subsites. Perhaps those were tables created by plugins because, as I stated, I was once able to get into my subsites and turn plugins on and off.

Also when I was creating those subsites previously, after adding one I would immediately see the subsite listed under the My Sites dropdown. They no longer appear there.

When I go to edit my subsite, even though I originally entered the URL "http://subsite1.maindomain.com", the URL shows as "://subsite.maindomain.com".This doesn't seem right. And when I try to click "Upgrade Network", I am presented with an issue saying one of the subsite URLs is invalid. I  believe this is because of the "://" at the beginning of the URL. I've tried removing this from the URL and resaving it, but it always saves with it.

Everything in my database looks fine.

wp_blogs looks like

blog_id
site_id
domain
path

1
1
www.maindomain.com
/

15
1
subsite1.maindomain.com
/

no data in blogs_meta

wp_site has only one record

id
domain
path

1
www.maindomain.com
/

wp_sitemeta contains a few thousand records but the site_id column for all of them is 1. The value for siteurl is https://www.maindomain.com/

wp_config.php

define( 'WP_ALLOW_MULTISITE', true );
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', true);
define( 'DOMAIN_CURRENT_SITE', 'www.maindomain.com' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );

.htaccess

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]

I thought maybe the issue could be with SSL or DNS, but the URLs should still link and display the correct link when I hover over the Visit or Dashboard links.

I've deactivated most of my plugins network-wide and really don't want to deactivate any more plugins or my main theme as it will cause my main site to be down until they are activated on the site level. In my experience, reactivating my theme once I deactivated doesn't always honor my previous settings. I don't think the issue is a plugin or theme conflict.


来源: stackexchange

问:
Sign up page made with node.js, mongoose not working when someone cloned my repo. from github and run on their pc locally
This is the github repo:
https://github.com/gaurav-2-0-0-2/Sign-Up-page-with-authentication

Also when I was deploying, it is showing UnhandledError error

ContentLicense: CC BY-SA 4.0


问:
weird offset with linerenderer and edgecollider
enter code hereHello im trying to make a laser but the collider as a weird offset from the collider. I tried moving some object out of the parent but it didnt changed anything. The only place where it works properly is 0,0,0.

```<code>using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Laser : MonoBehaviour
{
    [SerializeField] public float defDistanceRay = 100;
    public Transform laserFirePoint;
    public LineRenderer m_lineRenderer;
    public Transform m_transform;
    // Start is called before the first frame update
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        ShootLaser();
    }

    void ShootLaser(){
        if(Physics2D.Raycast(m_transform.position, transform.right)){
            RaycastHit2D _hit = Physics2D.Raycast(laserFirePoint.position, transform.right);

            Draw2DRay(laserFirePoint.position, _hit.point);
    }

        else{
            Draw2DRay(laserFirePoint.position, laserFirePoint.transform.right * defDistanceRay);
        }
}

void Draw2DRay(Vector2 startPos, Vector2 endPos) {
    m_lineRenderer.SetPosition(0, startPos);
    m_lineRenderer.SetPosition(1, endPos);
    }

 }
</code>```

This code made it work properly whitout before I added this code:

```<code>using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Laser_collision : MonoBehaviour
{
    public LineRenderer LineRenderer;
    public EdgeCollider2D collider;
    void Update(){
        int pointcount = LineRenderer.positionCount;
        Vector2[] points = new Vector2[pointcount];

        for(int i = 0; i < pointcount; i++){
            points[i] = LineRenderer.GetPosition(i);
        }

        collider.points = points;
    }
}

</code>```

Thank you for your time

Body:
enter code hereHello im trying to make a laser but the collider as a weird offset from the collider. I tried moving some object out of the parent but it didnt changed anything. The only place where it works properly is 0,0,0.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Laser : MonoBehaviour
{
    [SerializeField] public float defDistanceRay = 100;
    public Transform laserFirePoint;
    public LineRenderer m_lineRenderer;
    public Transform m_transform;
    // Start is called before the first frame update
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        ShootLaser();
    }

    void ShootLaser(){
        if(Physics2D.Raycast(m_transform.position, transform.right)){
            RaycastHit2D _hit = Physics2D.Raycast(laserFirePoint.position, transform.right);

            Draw2DRay(laserFirePoint.position, _hit.point);
    }

        else{
            Draw2DRay(laserFirePoint.position, laserFirePoint.transform.right * defDistanceRay);
        }
}

void Draw2DRay(Vector2 startPos, Vector2 endPos) {
    m_lineRenderer.SetPosition(0, startPos);
    m_lineRenderer.SetPosition(1, endPos);
    }

 }

This code made it work properly whitout before I added this code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Laser_collision : MonoBehaviour
{
    public LineRenderer LineRenderer;
    public EdgeCollider2D collider;
    void Update(){
        int pointcount = LineRenderer.positionCount;
        Vector2[] points = new Vector2[pointcount];

        for(int i = 0; i < pointcount; i++){
            points[i] = LineRenderer.GetPosition(i);
        }

        collider.points = points;
    }
}

Thank you for your time


问:
Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files
I am trying to deploy mysql on a multi-node cluster created by Kind on Ubuntu 22.04 machine.

This is my configmap.yaml file:

```<code>
apiVersion: v1
kind: ConfigMap
metadata:
  name: mysql
  labels:
    app: mysql
    app.kubernetes.io/name: mysql
data:
  primary.cnf: |
    # Apply this config only on the primary.
    [mysqld]
    log-bin
  replica.cnf: |
    # Apply this config only on replicas.
    [mysqld]
    super-read-only
</code>```

And the following is the mysql-depl.yaml file:

```<code>apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: mysql
spec:
  selector:
    matchLabels:
      app: mysql
      app.kubernetes.io/name: mysql
  serviceName: mysql
  replicas: 3
  template:
    metadata:
      labels:
        app: mysql
        app.kubernetes.io/name: mysql
    spec:
      initContainers:
      - name: init-mysql
        image: mysql
        command:
        - bash
        - "-c"
        - |
          set -ex
          # Generate mysql server-id from pod ordinal index.
          [[ $HOSTNAME =~ -([0-9]+)$ ]] || exit 1
          ordinal=${BASH_REMATCH[1]}
          echo [mysqld] > /mnt/conf.d/server-id.cnf
          # Add an offset to avoid reserved server-id=0 value.
          echo server-id=$((100 + $ordinal)) >> /mnt/conf.d/server-id.cnf
          # Copy appropriate conf.d files from config-map to emptyDir.
          if [[ $ordinal -eq 0 ]]; then
            cp /mnt/config-map/primary.cnf /mnt/conf.d/
          else
            cp /mnt/config-map/replica.cnf /mnt/conf.d/
          fi
        volumeMounts:
        - name: conf
          mountPath: /mnt/conf.d
        - name: config-map
          mountPath: /mnt/config-map
      - name: clone-mysql
        image: gcr.io/google-samples/xtrabackup:1.0
        command:
        - bash
        - "-c"
        - |
          set -ex
          # Skip the clone if data already exists.
          [[ -d /var/lib/mysql/mysql ]] && exit 0
          # Skip the clone on primary (ordinal index 0).
          [[ `hostname` =~ -([0-9]+)$ ]] || exit 1
          ordinal=${BASH_REMATCH[1]}
          [[ $ordinal -eq 0 ]] && exit 0
          # Clone data from previous peer.
          ncat --recv-only mysql-$(($ordinal-1)).mysql 3307 | xbstream -x -C /var/lib/mysql
          # Prepare the backup.
          xtrabackup --prepare --target-dir=/var/lib/mysql
        volumeMounts:
        - name: data
          mountPath: /var/lib/mysql
          subPath: mysql
        - name: conf
          mountPath: /etc/mysql/conf.d
      containers:
      - name: mysql
        image: mysql
        env:
        - name: MYSQL_ALLOW_EMPTY_PASSWORD
          value: "1"
        ports:
        - name: mysql
          containerPort: 3306
        volumeMounts:
        - name: data
          mountPath: /var/lib/mysql
          subPath: mysql
        - name: conf
          mountPath: /etc/mysql/conf.d
        resources:
          requests:
            cpu: 500m
            memory: 1Gi
        livenessProbe:
          exec:
            command: ["mysqladmin", "ping"]
          initialDelaySeconds: 30
          periodSeconds: 10
          timeoutSeconds: 5
        readinessProbe:
          exec:
            # Check we can execute queries over TCP (skip-networking is off).
            command: ["mysql", "-h", "127.0.0.1", "-e", "SELECT 1"]
          initialDelaySeconds: 5
          periodSeconds: 2
          timeoutSeconds: 1
      - name: xtrabackup
        image: gcr.io/google-samples/xtrabackup:1.0
        ports:
        - name: xtrabackup
          containerPort: 3307
        command:
        - bash
        - "-c"
        - |
          set -ex
          cd /var/lib/mysql

          # Determine binlog position of cloned data, if any.
          if [[ -f xtrabackup_slave_info && "x$(<xtrabackup_slave_info)" != "x" ]]; then
            # XtraBackup already generated a partial "CHANGE MASTER TO" query
            # because we're cloning from an existing replica. (Need to remove the tailing semicolon!)
            cat xtrabackup_slave_info | sed -E 's/;$//g' > change_master_to.sql.in
            # Ignore xtrabackup_binlog_info in this case (it's useless).
            rm -f xtrabackup_slave_info xtrabackup_binlog_info
          elif [[ -f xtrabackup_binlog_info ]]; then
            # We're cloning directly from primary. Parse binlog position.
            [[ `cat xtrabackup_binlog_info` =~ ^(.*?)[[:space:]]+(.*?)$ ]] || exit 1
            rm -f xtrabackup_binlog_info xtrabackup_slave_info
            echo "CHANGE MASTER TO MASTER_LOG_FILE='${BASH_REMATCH[1]}',\
                  MASTER_LOG_POS=${BASH_REMATCH[2]}" > change_master_to.sql.in
          fi

          # Check if we need to complete a clone by starting replication.
          if [[ -f change_master_to.sql.in ]]; then
            echo "Waiting for mysqld to be ready (accepting connections)"
            until mysql -h 127.0.0.1 -e "SELECT 1"; do sleep 1; done

            echo "Initializing replication from clone position"
            mysql -h 127.0.0.1 \
                  -e "$(<change_master_to.sql.in), \
                          MASTER_HOST='mysql-0.mysql', \
                          MASTER_USER='root', \
                          MASTER_PASSWORD='', \
                          MASTER_CONNECT_RETRY=10; \
                        START SLAVE;" || exit 1
            # In case of container restart, attempt this at-most-once.
            mv change_master_to.sql.in change_master_to.sql.orig
          fi

          # Start a server to send backups when requested by peers.
          exec ncat --listen --keep-open --send-only --max-conns=1 3307 -c \
            "xtrabackup --backup --slave-info --stream=xbstream --host=127.0.0.1 --user=root"
        volumeMounts:
        - name: data
          mountPath: /var/lib/mysql
          subPath: mysql
        - name: conf
          mountPath: /etc/mysql/conf.d
        resources:
          requests:
            cpu: 100m
            memory: 100Mi
      volumes:
      - name: conf
        emptyDir: {}
      - name: config-map
        configMap:
          name: mysql
  volumeClaimTemplates:
  - metadata:
      name: data
    spec:
      accessModes: ["ReadWriteOnce"]
      resources:
        requests:
          storage: 10Gi
---
# Headless service for stable DNS entries of StatefulSet members.
apiVersion: v1
kind: Service
metadata:
  name: mysql
  labels:
    app: mysql
    app.kubernetes.io/name: mysql
spec:
  ports:
  - name: mysql
    port: 3306
  clusterIP: None
  selector:
    app: mysql
---
# Client service for connecting to any MySQL instance for reads.
# For writes, you must instead connect to the primary: mysql-0.mysql.
apiVersion: v1
kind: Service
metadata:
  name: mysql-read
  labels:
    app: mysql
    app.kubernetes.io/name: mysql
    readonly: "true"
spec:
  ports:
  - name: mysql
    port: 3306
  selector:
    app: mysql

</code>```

When I apply both the files successfully and I check for pods using kubectl get pods this is the result I see:

```<code>NAME      READY   STATUS             RESTARTS      AGE
mysql-0   1/2     CrashLoopBackOff   9 (52s ago)   20m

</code>```

I use Kind cluster with the following config on Ubuntu 22.04 machine locally:

```<code>kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
</code>```

The describe pod mysql-0 result:

```<code>Name:             mysql-0
Namespace:        default
Priority:         0
Service Account:  default
Node:             kind-worker/172.18.0.3
Start Time:       Fri, 30 Dec 2022 11:34:11 -0800
Labels:           app=mysql
                  app.kubernetes.io/name=mysql
                  controller-revision-hash=mysql-7d8d6f4696
                  statefulset.kubernetes.io/pod-name=mysql-0
Annotations:      <none>
Status:           Running
IP:               10.244.1.3
IPs:
  IP:           10.244.1.3
Controlled By:  StatefulSet/mysql
Init Containers:
  init-mysql:
    Container ID:  containerd://0cb850e677789c328b394905d40eee8cab539847fab784162b25f05dbbce0d31
    Image:         mysql
    Image ID:      docker.io/library/mysql@sha256:3d7ae561cf6095f6aca8eb7830e1d14734227b1fb4748092f2be2cfbccf7d614
    Port:          <none>
    Host Port:     <none>
    Command:
      bash
      -c
      set -ex
      # Generate mysql server-id from pod ordinal index.
      [[ $HOSTNAME =~ -([0-9]+)$ ]] || exit 1
      ordinal=${BASH_REMATCH[1]}
      echo [mysqld] > /mnt/conf.d/server-id.cnf
      # Add an offset to avoid reserved server-id=0 value.
      echo server-id=$((100 + $ordinal)) >> /mnt/conf.d/server-id.cnf
      # Copy appropriate conf.d files from config-map to emptyDir.
      if [[ $ordinal -eq 0 ]]; then
        cp /mnt/config-map/primary.cnf /mnt/conf.d/
      else
        cp /mnt/config-map/replica.cnf /mnt/conf.d/
      fi

    State:          Terminated
      Reason:       Completed
      Exit Code:    0
      Started:      Fri, 30 Dec 2022 11:34:45 -0800
      Finished:     Fri, 30 Dec 2022 11:34:45 -0800
    Ready:          True
    Restart Count:  0
    Environment:    <none>
    Mounts:
      /mnt/conf.d from conf (rw)
      /mnt/config-map from config-map (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-r4j87 (ro)
  clone-mysql:
    Container ID:  containerd://0b0ffb57fca6234b09b033963850a7cc7acdc4150b85652f3eb195aef970ca7f
    Image:         gcr.io/google-samples/xtrabackup:1.0
    Image ID:      sha256:cee14c121daad572f219c0128ea1fdff4b81e7faf714c78b853427af3bda1cf7
    Port:          <none>
    Host Port:     <none>
    Command:
      bash
      -c
      set -ex
      # Skip the clone if data already exists.
      [[ -d /var/lib/mysql/mysql ]] && exit 0
      # Skip the clone on primary (ordinal index 0).
      [[ `hostname` =~ -([0-9]+)$ ]] || exit 1
      ordinal=${BASH_REMATCH[1]}
      [[ $ordinal -eq 0 ]] && exit 0
      # Clone data from previous peer.
      ncat --recv-only mysql-$(($ordinal-1)).mysql 3307 | xbstream -x -C /var/lib/mysql
      # Prepare the backup.
      xtrabackup --prepare --target-dir=/var/lib/mysql

    State:          Terminated
      Reason:       Completed
      Exit Code:    0
      Started:      Fri, 30 Dec 2022 11:35:13 -0800
      Finished:     Fri, 30 Dec 2022 11:35:13 -0800
    Ready:          True
    Restart Count:  0
    Environment:    <none>
    Mounts:
      /etc/mysql/conf.d from conf (rw)
      /var/lib/mysql from data (rw,path="mysql")
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-r4j87 (ro)
Containers:
  mysql:
    Container ID:   containerd://f228587f532100ac6a1685b935877dcfdeb304c30d89542261976f243cbd936b
    Image:          mysql
    Image ID:       docker.io/library/mysql@sha256:3d7ae561cf6095f6aca8eb7830e1d14734227b1fb4748092f2be2cfbccf7d614
    Port:           3306/TCP
    Host Port:      0/TCP
    State:          Waiting
      Reason:       CrashLoopBackOff
    Last State:     Terminated
      Reason:       Error
      Exit Code:    1
      Started:      Fri, 30 Dec 2022 15:18:57 -0800
      Finished:     Fri, 30 Dec 2022 15:18:58 -0800
    Ready:          False
    Restart Count:  47
    Requests:
      cpu:      500m
      memory:   1Gi
    Liveness:   exec [mysqladmin ping] delay=30s timeout=5s period=10s #success=1 #failure=3
    Readiness:  exec [mysql -h 127.0.0.1 -e SELECT 1] delay=5s timeout=1s period=2s #success=1 #failure=3
    Environment:
      MYSQL_ALLOW_EMPTY_PASSWORD:  1
    Mounts:
      /etc/mysql/conf.d from conf (rw)
      /var/lib/mysql from data (rw,path="mysql")
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-r4j87 (ro)
  xtrabackup:
    Container ID:  containerd://9c4b58c109e500e1cc2c68d3f1830cc065e850713b01a724d5a293a21fc21bb5
    Image:         gcr.io/google-samples/xtrabackup:1.0
    Image ID:      sha256:cee14c121daad572f219c0128ea1fdff4b81e7faf714c78b853427af3bda1cf7
    Port:          3307/TCP
    Host Port:     0/TCP
    Command:
      bash
      -c
      set -ex
      cd /var/lib/mysql

      # Determine binlog position of cloned data, if any.
      if [[ -f xtrabackup_slave_info && "x$(<xtrabackup_slave_info)" != "x" ]]; then
        # XtraBackup already generated a partial "CHANGE MASTER TO" query
        # because we're cloning from an existing replica. (Need to remove the tailing semicolon!)
        cat xtrabackup_slave_info | sed -E 's/;$//g' > change_master_to.sql.in
        # Ignore xtrabackup_binlog_info in this case (it's useless).
        rm -f xtrabackup_slave_info xtrabackup_binlog_info
      elif [[ -f xtrabackup_binlog_info ]]; then
        # We're cloning directly from primary. Parse binlog position.
        [[ `cat xtrabackup_binlog_info` =~ ^(.*?)[[:space:]]+(.*?)$ ]] || exit 1
        rm -f xtrabackup_binlog_info xtrabackup_slave_info
        echo "CHANGE MASTER TO MASTER_LOG_FILE='${BASH_REMATCH[1]}',\
              MASTER_LOG_POS=${BASH_REMATCH[2]}" > change_master_to.sql.in
      fi

      # Check if we need to complete a clone by starting replication.
      if [[ -f change_master_to.sql.in ]]; then
        echo "Waiting for mysqld to be ready (accepting connections)"
        until mysql -h 127.0.0.1 -e "SELECT 1"; do sleep 1; done

        echo "Initializing replication from clone position"
        mysql -h 127.0.0.1 \
              -e "$(<change_master_to.sql.in), \
                      MASTER_HOST='mysql-0.mysql', \
                      MASTER_USER='root', \
                      MASTER_PASSWORD='', \
                      MASTER_CONNECT_RETRY=10; \
                    START SLAVE;" || exit 1
        # In case of container restart, attempt this at-most-once.
        mv change_master_to.sql.in change_master_to.sql.orig
      fi

      # Start a server to send backups when requested by peers.
      exec ncat --listen --keep-open --send-only --max-conns=1 3307 -c \
        "xtrabackup --backup --slave-info --stream=xbstream --host=127.0.0.1 --user=root"

    State:          Running
      Started:      Fri, 30 Dec 2022 11:35:46 -0800
    Ready:          True
    Restart Count:  0
    Requests:
      cpu:        100m
      memory:     100Mi
    Environment:  <none>
    Mounts:
      /etc/mysql/conf.d from conf (rw)
      /var/lib/mysql from data (rw,path="mysql")
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-r4j87 (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  data:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  data-mysql-0
    ReadOnly:   false
  conf:
    Type:       EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:
    SizeLimit:  <unset>
  config-map:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      mysql
    Optional:  false
  kube-api-access-r4j87:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
QoS Class:                   Burstable
Node-Selectors:              <none>
Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type     Reason   Age                    From     Message
  ----     ------   ----                   ----     -------
  Warning  BackOff  65s (x987 over 3h43m)  kubelet  Back-off restarting failed container
</code>```

EDIT: This is the result of kubectl logs mysql-0 -c mysql:

```<code>2022-12-31 00:48:16+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.31-1.el8 started.
2022-12-31 00:48:16+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-12-31 00:48:16+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.31-1.el8 started.
2022-12-31T00:48:17.443527Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.31) starting as process 1
2022-12-31T00:48:17.443610Z 0 [ERROR] [MY-010338] [Server] Can't find error-message file '/usr/share/mysql-8.0/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
2022-12-31T00:48:17.507830Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-12-31T00:48:17.637835Z 1 [ERROR] [MY-012960] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files.
2022-12-31T00:48:18.122850Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-12-31T00:48:18.123114Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-12-31T00:48:18.123131Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-12-31T00:48:18.123592Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.31)  MySQL Community Server - GPL.
</code>```

Body:
I am trying to deploy mysql on a multi-node cluster created by Kind on Ubuntu 22.04 machine.

This is my configmap.yaml file:

apiVersion: v1
kind: ConfigMap
metadata:
  name: mysql
  labels:
    app: mysql
    app.kubernetes.io/name: mysql
data:
  primary.cnf: |
    # Apply this config only on the primary.
    [mysqld]
    log-bin
  replica.cnf: |
    # Apply this config only on replicas.
    [mysqld]
    super-read-only

And the following is the mysql-depl.yaml file:

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: mysql
spec:
  selector:
    matchLabels:
      app: mysql
      app.kubernetes.io/name: mysql
  serviceName: mysql
  replicas: 3
  template:
    metadata:
      labels:
        app: mysql
        app.kubernetes.io/name: mysql
    spec:
      initContainers:
      - name: init-mysql
        image: mysql
        command:
        - bash
        - "-c"
        - |
          set -ex
          # Generate mysql server-id from pod ordinal index.
          [[ $HOSTNAME =~ -([0-9]+)$ ]] || exit 1
          ordinal=${BASH_REMATCH[1]}
          echo [mysqld] > /mnt/conf.d/server-id.cnf
          # Add an offset to avoid reserved server-id=0 value.
          echo server-id=$((100 + $ordinal)) >> /mnt/conf.d/server-id.cnf
          # Copy appropriate conf.d files from config-map to emptyDir.
          if [[ $ordinal -eq 0 ]]; then
            cp /mnt/config-map/primary.cnf /mnt/conf.d/
          else
            cp /mnt/config-map/replica.cnf /mnt/conf.d/
          fi
        volumeMounts:
        - name: conf
          mountPath: /mnt/conf.d
        - name: config-map
          mountPath: /mnt/config-map
      - name: clone-mysql
        image: gcr.io/google-samples/xtrabackup:1.0
        command:
        - bash
        - "-c"
        - |
          set -ex
          # Skip the clone if data already exists.
          [[ -d /var/lib/mysql/mysql ]] && exit 0
          # Skip the clone on primary (ordinal index 0).
          [[ `hostname` =~ -([0-9]+)$ ]] || exit 1
          ordinal=${BASH_REMATCH[1]}
          [[ $ordinal -eq 0 ]] && exit 0
          # Clone data from previous peer.
          ncat --recv-only mysql-$(($ordinal-1)).mysql 3307 | xbstream -x -C /var/lib/mysql
          # Prepare the backup.
          xtrabackup --prepare --target-dir=/var/lib/mysql
        volumeMounts:
        - name: data
          mountPath: /var/lib/mysql
          subPath: mysql
        - name: conf
          mountPath: /etc/mysql/conf.d
      containers:
      - name: mysql
        image: mysql
        env:
        - name: MYSQL_ALLOW_EMPTY_PASSWORD
          value: "1"
        ports:
        - name: mysql
          containerPort: 3306
        volumeMounts:
        - name: data
          mountPath: /var/lib/mysql
          subPath: mysql
        - name: conf
          mountPath: /etc/mysql/conf.d
        resources:
          requests:
            cpu: 500m
            memory: 1Gi
        livenessProbe:
          exec:
            command: ["mysqladmin", "ping"]
          initialDelaySeconds: 30
          periodSeconds: 10
          timeoutSeconds: 5
        readinessProbe:
          exec:
            # Check we can execute queries over TCP (skip-networking is off).
            command: ["mysql", "-h", "127.0.0.1", "-e", "SELECT 1"]
          initialDelaySeconds: 5
          periodSeconds: 2
          timeoutSeconds: 1
      - name: xtrabackup
        image: gcr.io/google-samples/xtrabackup:1.0
        ports:
        - name: xtrabackup
          containerPort: 3307
        command:
        - bash
        - "-c"
        - |
          set -ex
          cd /var/lib/mysql

          # Determine binlog position of cloned data, if any.
          if [[ -f xtrabackup_slave_info && "x$(<xtrabackup_slave_info)" != "x" ]]; then
            # XtraBackup already generated a partial "CHANGE MASTER TO" query
            # because we're cloning from an existing replica. (Need to remove the tailing semicolon!)
            cat xtrabackup_slave_info | sed -E 's/;$//g' > change_master_to.sql.in
            # Ignore xtrabackup_binlog_info in this case (it's useless).
            rm -f xtrabackup_slave_info xtrabackup_binlog_info
          elif [[ -f xtrabackup_binlog_info ]]; then
            # We're cloning directly from primary. Parse binlog position.
            [[ `cat xtrabackup_binlog_info` =~ ^(.*?)[[:space:]]+(.*?)$ ]] || exit 1
            rm -f xtrabackup_binlog_info xtrabackup_slave_info
            echo "CHANGE MASTER TO MASTER_LOG_FILE='${BASH_REMATCH[1]}',\
                  MASTER_LOG_POS=${BASH_REMATCH[2]}" > change_master_to.sql.in
          fi

          # Check if we need to complete a clone by starting replication.
          if [[ -f change_master_to.sql.in ]]; then
            echo "Waiting for mysqld to be ready (accepting connections)"
            until mysql -h 127.0.0.1 -e "SELECT 1"; do sleep 1; done

            echo "Initializing replication from clone position"
            mysql -h 127.0.0.1 \
                  -e "$(<change_master_to.sql.in), \
                          MASTER_HOST='mysql-0.mysql', \
                          MASTER_USER='root', \
                          MASTER_PASSWORD='', \
                          MASTER_CONNECT_RETRY=10; \
                        START SLAVE;" || exit 1
            # In case of container restart, attempt this at-most-once.
            mv change_master_to.sql.in change_master_to.sql.orig
          fi

          # Start a server to send backups when requested by peers.
          exec ncat --listen --keep-open --send-only --max-conns=1 3307 -c \
            "xtrabackup --backup --slave-info --stream=xbstream --host=127.0.0.1 --user=root"
        volumeMounts:
        - name: data
          mountPath: /var/lib/mysql
          subPath: mysql
        - name: conf
          mountPath: /etc/mysql/conf.d
        resources:
          requests:
            cpu: 100m
            memory: 100Mi
      volumes:
      - name: conf
        emptyDir: {}
      - name: config-map
        configMap:
          name: mysql
  volumeClaimTemplates:
  - metadata:
      name: data
    spec:
      accessModes: ["ReadWriteOnce"]
      resources:
        requests:
          storage: 10Gi
---
# Headless service for stable DNS entries of StatefulSet members.
apiVersion: v1
kind: Service
metadata:
  name: mysql
  labels:
    app: mysql
    app.kubernetes.io/name: mysql
spec:
  ports:
  - name: mysql
    port: 3306
  clusterIP: None
  selector:
    app: mysql
---
# Client service for connecting to any MySQL instance for reads.
# For writes, you must instead connect to the primary: mysql-0.mysql.
apiVersion: v1
kind: Service
metadata:
  name: mysql-read
  labels:
    app: mysql
    app.kubernetes.io/name: mysql
    readonly: "true"
spec:
  ports:
  - name: mysql
    port: 3306
  selector:
    app: mysql

When I apply both the files successfully and I check for pods using kubectl get pods this is the result I see:

NAME      READY   STATUS             RESTARTS      AGE
mysql-0   1/2     CrashLoopBackOff   9 (52s ago)   20m

I use Kind cluster with the following config on Ubuntu 22.04 machine locally:

kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker

The describe pod mysql-0 result:

Name:             mysql-0
Namespace:        default
Priority:         0
Service Account:  default
Node:             kind-worker/172.18.0.3
Start Time:       Fri, 30 Dec 2022 11:34:11 -0800
Labels:           app=mysql
                  app.kubernetes.io/name=mysql
                  controller-revision-hash=mysql-7d8d6f4696
                  statefulset.kubernetes.io/pod-name=mysql-0
Annotations:      <none>
Status:           Running
IP:               10.244.1.3
IPs:
  IP:           10.244.1.3
Controlled By:  StatefulSet/mysql
Init Containers:
  init-mysql:
    Container ID:  containerd://0cb850e677789c328b394905d40eee8cab539847fab784162b25f05dbbce0d31
    Image:         mysql
    Image ID:      docker.io/library/mysql@sha256:3d7ae561cf6095f6aca8eb7830e1d14734227b1fb4748092f2be2cfbccf7d614
    Port:          <none>
    Host Port:     <none>
    Command:
      bash
      -c
      set -ex
      # Generate mysql server-id from pod ordinal index.
      [[ $HOSTNAME =~ -([0-9]+)$ ]] || exit 1
      ordinal=${BASH_REMATCH[1]}
      echo [mysqld] > /mnt/conf.d/server-id.cnf
      # Add an offset to avoid reserved server-id=0 value.
      echo server-id=$((100 + $ordinal)) >> /mnt/conf.d/server-id.cnf
      # Copy appropriate conf.d files from config-map to emptyDir.
      if [[ $ordinal -eq 0 ]]; then
        cp /mnt/config-map/primary.cnf /mnt/conf.d/
      else
        cp /mnt/config-map/replica.cnf /mnt/conf.d/
      fi

    State:          Terminated
      Reason:       Completed
      Exit Code:    0
      Started:      Fri, 30 Dec 2022 11:34:45 -0800
      Finished:     Fri, 30 Dec 2022 11:34:45 -0800
    Ready:          True
    Restart Count:  0
    Environment:    <none>
    Mounts:
      /mnt/conf.d from conf (rw)
      /mnt/config-map from config-map (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-r4j87 (ro)
  clone-mysql:
    Container ID:  containerd://0b0ffb57fca6234b09b033963850a7cc7acdc4150b85652f3eb195aef970ca7f
    Image:         gcr.io/google-samples/xtrabackup:1.0
    Image ID:      sha256:cee14c121daad572f219c0128ea1fdff4b81e7faf714c78b853427af3bda1cf7
    Port:          <none>
    Host Port:     <none>
    Command:
      bash
      -c
      set -ex
      # Skip the clone if data already exists.
      [[ -d /var/lib/mysql/mysql ]] && exit 0
      # Skip the clone on primary (ordinal index 0).
      [[ `hostname` =~ -([0-9]+)$ ]] || exit 1
      ordinal=${BASH_REMATCH[1]}
      [[ $ordinal -eq 0 ]] && exit 0
      # Clone data from previous peer.
      ncat --recv-only mysql-$(($ordinal-1)).mysql 3307 | xbstream -x -C /var/lib/mysql
      # Prepare the backup.
      xtrabackup --prepare --target-dir=/var/lib/mysql

    State:          Terminated
      Reason:       Completed
      Exit Code:    0
      Started:      Fri, 30 Dec 2022 11:35:13 -0800
      Finished:     Fri, 30 Dec 2022 11:35:13 -0800
    Ready:          True
    Restart Count:  0
    Environment:    <none>
    Mounts:
      /etc/mysql/conf.d from conf (rw)
      /var/lib/mysql from data (rw,path="mysql")
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-r4j87 (ro)
Containers:
  mysql:
    Container ID:   containerd://f228587f532100ac6a1685b935877dcfdeb304c30d89542261976f243cbd936b
    Image:          mysql
    Image ID:       docker.io/library/mysql@sha256:3d7ae561cf6095f6aca8eb7830e1d14734227b1fb4748092f2be2cfbccf7d614
    Port:           3306/TCP
    Host Port:      0/TCP
    State:          Waiting
      Reason:       CrashLoopBackOff
    Last State:     Terminated
      Reason:       Error
      Exit Code:    1
      Started:      Fri, 30 Dec 2022 15:18:57 -0800
      Finished:     Fri, 30 Dec 2022 15:18:58 -0800
    Ready:          False
    Restart Count:  47
    Requests:
      cpu:      500m
      memory:   1Gi
    Liveness:   exec [mysqladmin ping] delay=30s timeout=5s period=10s #success=1 #failure=3
    Readiness:  exec [mysql -h 127.0.0.1 -e SELECT 1] delay=5s timeout=1s period=2s #success=1 #failure=3
    Environment:
      MYSQL_ALLOW_EMPTY_PASSWORD:  1
    Mounts:
      /etc/mysql/conf.d from conf (rw)
      /var/lib/mysql from data (rw,path="mysql")
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-r4j87 (ro)
  xtrabackup:
    Container ID:  containerd://9c4b58c109e500e1cc2c68d3f1830cc065e850713b01a724d5a293a21fc21bb5
    Image:         gcr.io/google-samples/xtrabackup:1.0
    Image ID:      sha256:cee14c121daad572f219c0128ea1fdff4b81e7faf714c78b853427af3bda1cf7
    Port:          3307/TCP
    Host Port:     0/TCP
    Command:
      bash
      -c
      set -ex
      cd /var/lib/mysql

      # Determine binlog position of cloned data, if any.
      if [[ -f xtrabackup_slave_info && "x$(<xtrabackup_slave_info)" != "x" ]]; then
        # XtraBackup already generated a partial "CHANGE MASTER TO" query
        # because we're cloning from an existing replica. (Need to remove the tailing semicolon!)
        cat xtrabackup_slave_info | sed -E 's/;$//g' > change_master_to.sql.in
        # Ignore xtrabackup_binlog_info in this case (it's useless).
        rm -f xtrabackup_slave_info xtrabackup_binlog_info
      elif [[ -f xtrabackup_binlog_info ]]; then
        # We're cloning directly from primary. Parse binlog position.
        [[ `cat xtrabackup_binlog_info` =~ ^(.*?)[[:space:]]+(.*?)$ ]] || exit 1
        rm -f xtrabackup_binlog_info xtrabackup_slave_info
        echo "CHANGE MASTER TO MASTER_LOG_FILE='${BASH_REMATCH[1]}',\
              MASTER_LOG_POS=${BASH_REMATCH[2]}" > change_master_to.sql.in
      fi

      # Check if we need to complete a clone by starting replication.
      if [[ -f change_master_to.sql.in ]]; then
        echo "Waiting for mysqld to be ready (accepting connections)"
        until mysql -h 127.0.0.1 -e "SELECT 1"; do sleep 1; done

        echo "Initializing replication from clone position"
        mysql -h 127.0.0.1 \
              -e "$(<change_master_to.sql.in), \
                      MASTER_HOST='mysql-0.mysql', \
                      MASTER_USER='root', \
                      MASTER_PASSWORD='', \
                      MASTER_CONNECT_RETRY=10; \
                    START SLAVE;" || exit 1
        # In case of container restart, attempt this at-most-once.
        mv change_master_to.sql.in change_master_to.sql.orig
      fi

      # Start a server to send backups when requested by peers.
      exec ncat --listen --keep-open --send-only --max-conns=1 3307 -c \
        "xtrabackup --backup --slave-info --stream=xbstream --host=127.0.0.1 --user=root"

    State:          Running
      Started:      Fri, 30 Dec 2022 11:35:46 -0800
    Ready:          True
    Restart Count:  0
    Requests:
      cpu:        100m
      memory:     100Mi
    Environment:  <none>
    Mounts:
      /etc/mysql/conf.d from conf (rw)
      /var/lib/mysql from data (rw,path="mysql")
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-r4j87 (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  data:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  data-mysql-0
    ReadOnly:   false
  conf:
    Type:       EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:
    SizeLimit:  <unset>
  config-map:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      mysql
    Optional:  false
  kube-api-access-r4j87:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
QoS Class:                   Burstable
Node-Selectors:              <none>
Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type     Reason   Age                    From     Message
  ----     ------   ----                   ----     -------
  Warning  BackOff  65s (x987 over 3h43m)  kubelet  Back-off restarting failed container

EDIT: This is the result of kubectl logs mysql-0 -c mysql:

2022-12-31 00:48:16+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.31-1.el8 started.
2022-12-31 00:48:16+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-12-31 00:48:16+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.31-1.el8 started.
2022-12-31T00:48:17.443527Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.31) starting as process 1
2022-12-31T00:48:17.443610Z 0 [ERROR] [MY-010338] [Server] Can't find error-message file '/usr/share/mysql-8.0/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
2022-12-31T00:48:17.507830Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-12-31T00:48:17.637835Z 1 [ERROR] [MY-012960] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files.
2022-12-31T00:48:18.122850Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-12-31T00:48:18.123114Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-12-31T00:48:18.123131Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-12-31T00:48:18.123592Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.31)  MySQL Community Server - GPL.


问:
RollupError: "default" is not exported by "node_modules/react-infinite-scroller/index.js"
Using v1.2.6 of react-infinite-scroller in a reactjs .tsx bumps into the following build error:

```<code>[!] RollupError: "default" is not exported by "node_modules/react-infinite-scroller/index.js", imported by "src/core/DataTable.tsx".
https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module
src/core/DataTable.tsx (6:7)
6: import InfiniteScroll from 'react-infinite-scroller';
</code>```

What do I miss?

Body:
Using v1.2.6 of react-infinite-scroller in a reactjs .tsx bumps into the following build error:

[!] RollupError: "default" is not exported by "node_modules/react-infinite-scroller/index.js", imported by "src/core/DataTable.tsx".
https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module
src/core/DataTable.tsx (6:7)
6: import InfiniteScroll from 'react-infinite-scroller';

What do I miss?


问:
Bi-LSTM layer arguments
I'm having trouble trying to understand how to implement the following:

```<code>Layer: Bi-LSTM 1
Input: (None,50,25)
Output: (None,50,25)
</code>```

I know that the first argument is units, since the model has a None value, it can be anything? However, for the last two arguments I don't know how I can implement it.

The only other arguments that take numbers are: dropout and recurrent_dropout however, they are floats between 0 and 1.

Can someone please explain how I am supposed to recreate this model?

Title: Bi-LSTM layer arguments

Body:
I'm having trouble trying to understand how to implement the following:

Layer: Bi-LSTM 1
Input: (None,50,25)
Output: (None,50,25)

I know that the first argument is units, since the model has a None value, it can be anything? However, for the last two arguments I don't know how I can implement it.

The only other arguments that take numbers are: dropout and recurrent_dropout however, they are floats between 0 and 1.

Can someone please explain how I am supposed to recreate this model?


问:
Multiple containers sharing the same memory resource
In my project, I'm trying to use the std::pmr allocator and monotonic_buffer_resource. I'm using vector in various classes, and I need to use the same resource in all of them. I created a separate free function that returns the resource pointer and used it while declaring the vectors. Here is the code

```<code>#include <memory_resource>
#include <vector>
#include <array>

std::pmr::monotonic_buffer_resource *getMemoryResource()
{
    static std::array<std::byte, 100000> buffer;
    static std::pmr::monotonic_buffer_resource resource{buffer.data(), buffer.size()};
    return &resource;
}
struct JsonData
{
    std::pmr::vector<int> data{getMemoryResource()};
};
struct XMLData
{
    std::pmr::vector<char> data{getMemoryResource()};
};
</code>```

Is there anything I can do to improve the code, especially getMemoryResource function?

Body:
In my project, I'm trying to use the std::pmr allocator and monotonic_buffer_resource. I'm using vector in various classes, and I need to use the same resource in all of them. I created a separate free function that returns the resource pointer and used it while declaring the vectors. Here is the code

#include <memory_resource>
#include <vector>
#include <array>

std::pmr::monotonic_buffer_resource *getMemoryResource()
{
    static std::array<std::byte, 100000> buffer;
    static std::pmr::monotonic_buffer_resource resource{buffer.data(), buffer.size()};
    return &resource;
}
struct JsonData
{
    std::pmr::vector<int> data{getMemoryResource()};
};
struct XMLData
{
    std::pmr::vector<char> data{getMemoryResource()};
};

Is there anything I can do to improve the code, especially getMemoryResource function?


问:
Problem Publishing RShiny App Warning: Computation failed in `stat_summary_hex()`:
I am having a problem publishing my RShiny App. Whenever I publish it, everything works besides my stat_summary_hex() function within my ggplot. I am not really sure why it is not working, whenever I run it through RStudio it works perfectly fine, but not when I publish it. If I could get help, that would be much appreciated.

I am getting this message: Computation failed in stat_summary_hex():

Here's my code

```<code>library(shiny)
library(dplyr)
library(tidyverse)
library(ggplot2)

allStuff2 = read.csv("appData.csv")
allStuff2$player_name = iconv(allStuff2$player_name,from="UTF-8",to="ASCII//TRANSLIT")
allStuff2 = allStuff2 %>%
  mutate(pitch_type = ifelse(pitch_type == "FF", "Fourseam Fastball", pitch_type),
         pitch_type = ifelse(pitch_type == "SI", "Sinker", pitch_type),
         pitch_type = ifelse(pitch_type == "FC", "Cutter", pitch_type),
         pitch_type = ifelse(pitch_type == "SL", "Slider", pitch_type),
         pitch_type = ifelse(pitch_type == "CU", "Curveball", pitch_type),
         pitch_type = ifelse(pitch_type == "CH", "Changeup", pitch_type)) %>%
  arrange(player_name)

# Define UI for application that draws a histogram
ui <- fluidPage(

  # Application title
  titlePanel("2022 Stuff+ Dashboard"),
  theme = shinythemes::shinytheme("journal"),

  # Sidebar with a slider input for number of bins
  sidebarLayout(
    sidebarPanel(
      selectInput('name',
                  'Select Pitcher:',
                  choices = unique(allStuff2$player_name)),
      selectInput('pitch_type',
                  'Select Pitch Type:',
                  choices = c('Fourseam Fastball', 'Sinker', 'Cutter', 'Slider', 'Curveball', 'Changeup'),
                  selected = 'Fourseam Fastball')),

    # Show a plot of the generated distribution
    mainPanel(
      plotOutput("stuffPlot"),
      tableOutput("table")
    )
  )
)

# Define server logic required to draw a histogram
server <- function(input, output) {

  pitcherAvg = reactive({
    allStuff2 %>%
      filter(player_name == input$name,
             pitch_type == input$pitch_type) %>%
      group_by(pitch_type) %>%
      summarise(velo = mean(release_speed, na.rm = T),
                pfx_x = -mean(pfx_x, na.rm = T),
                pfx_z = mean(pfx_z, na.rm = T),
                rp_x = mean(release_pos_x, na.rm = T),
                rp_z = mean(release_pos_z, na.rm = T),
                p_throws = p_throws[1],
                Stuff. = mean(Stuff., na.rm = T))
  })

 output$stuffPlot = renderPlot({
   ggplot(filter(allStuff2, pitch_type == input$pitch_type,
                 p_throws == pitcherAvg()$p_throws,
                 release_pos_x >= pitcherAvg()$rp_x - 0.5,
                 release_pos_x <= pitcherAvg()$rp_x + 0.5,
                 release_pos_z >= pitcherAvg()$rp_z - 0.5,
                 release_pos_z <= pitcherAvg()$rp_z + 0.5,
                 release_speed >= pitcherAvg()$velo - 1,
                 release_speed <= pitcherAvg()$velo + 1),
          aes(x = -pfx_x, y = pfx_z, z = Stuff.)) +
          stat_summary_hex() +
          scale_fill_gradient2(midpoint = 100, low = "blue", mid = "white", high = "red") +
          geom_point(aes(x=pitcherAvg()$pfx_x, y=pitcherAvg()$pfx_z), colour="black", size = 5) +
          theme_bw() +
          labs(x = 'Horizontal Movement', y = 'Vertical Movement', fill = 'Stuff+',
            title = paste(strsplit(input$name, ", ")[[1]][1], "'s Stuff+ by Location for ", input$pitch_type, sep = ""),
            subtitle = "Based off of Pitchers with Similar Release Point and Velocity (Pitcher's Point of View)",
            caption = 'Email: fran1412@umn.edu') +
          coord_fixed() +
          geom_vline(xintercept = 0) +
          geom_hline(yintercept = 0) +
          xlim(-2.5,2.5) +
          ylim(-2.5,2.5)
  })

  output$table = renderTable({
    allStuff2 %>%
      filter(player_name == input$name,
             pitch_type == input$pitch_type) %>%
      group_by(pitch_type) %>%
      summarise(Velocity = mean(release_speed, na.rm = T),
                `Horiz. Break` = -mean(pfx_x, na.rm = T),
                `Vert. Break` = mean(pfx_z, na.rm = T),
                `Horiz. Release Point` = -mean(release_pos_x, na.rm = T),
                `Vert. Release Point` = mean(release_pos_z, na.rm = T),
                `Stuff+` = as.integer(round(mean(Stuff., na.rm = T), 0))) %>%
      select(-pitch_type)
  })

}

# Run the application
shinyApp(ui = ui, server = server)
</code>```

Here is my dput file:

```<code>structure(list(release_speed = c(85.9, 97.6, 100.5, 98.9, 87.3,
100.7, 100.6, 87.3, 95, 100.7, 101.2, 87.4, 102, 87.2, 103.2,
95.8, 94.3, 93.1, 89, 101, 87.2, 95.8, 101.5, 96.1, 96.2, 85.5,
88.7, 88.4, 87.7, 90.5, 88.2, 87.2, 101.2, 100.6, 96.1, 95, 85,
85.7, 102.3, 96.2, 89.3, 88.3, 91.4, 86.1, 96.5, 101.5, 96.4,
100.7, 84.5, 89.9, 101.1, 94.3, 98.8, 95.7, 95.4, 89.3, 94.7,
98.1, 94.7, 97, 95.7, 98.5, 98.9, 87.6, 90.4, 86.5, 88.4, 88.3,
101.9, 98.9, 100.7, 89, 95.4, 99.6, 102.4, 87.5, 87.2, 88, 87,
95.9, 99.1, 96.5, 91, 85.9, 87.2, 84.8, 87.1, 88, 98.3, 102.1,
86.3, 99.2, 101.9, 100, 84.7, 86.1, 98.2, 102.4, 99.8, 98.8),
    pfx_x = c(0.5, -1.12, -0.79, -0.95, 0.52, -0.89, -1.44, 0.26,
    -1.12, -1, -0.86, 0.2, -0.84, 0.32, -1.2, -1.09, -1.37, -0.54,
    0.25, -1.12, 0.15, -0.77, -0.84, -0.99, -1.38, 0.26, 0.05,
    0.32, 0.2, 0.36, 0.29, 0.01, -1.08, -1, -0.75, -0.67, 0,
    0.27, -0.9, -1.48, 0.33, 0.11, 0.33, 0.22, -0.75, -1.23,
    -1.25, -1.02, 0.27, -0.13, -1.1, -0.51, -0.91, -0.7, -0.84,
    0.23, -1.64, -0.96, -0.76, -1.03, -1.53, -1.24, -1.41, 0.48,
    0.39, 0.09, 0.56, 0.18, -1.08, -0.97, -1.21, 0.5, -1.21,
    -0.89, -1.12, 0.13, 0.16, 0.39, 0.46, -1.1, -0.79, -1.19,
    -0.65, 0.28, 0.23, 0.35, 0.1, 0.34, -0.35, -0.91, 0.02, -0.86,
    -1.02, -0.75, 0.38, 0.08, -1.38, -1.08, -1.02, -1.15), pfx_z = c(-0.63,
    0.06, 1.22, 0.13, -0.45, 1.3, 1.15, -1.16, 0.64, 1.18, 1.08,
    -0.75, 1, -0.59, 1.04, 0.29, 0.25, 0.53, -0.62, 0.97, -0.61,
    0.13, 1.16, 0.32, 0.05, -0.48, -0.4, -0.39, -0.9, -0.42,
    -0.64, -0.59, 1.24, 1.01, 0.1, 0.25, -1.05, -0.51, 1.12,
    0.35, -0.63, -0.52, -0.56, -0.69, 0.22, 0.8, 0.48, 1.18,
    -0.43, -0.34, 1.17, -0.21, 1.07, 0.21, 0.32, -0.49, 0.16,
    1.35, 0.12, 0.43, 0.57, 1.04, 0.42, -0.56, -0.58, -0.82,
    -0.37, -0.48, 0.8, 1, 1.33, -0.7, 0.45, 0.95, 1.37, -0.32,
    -0.57, -0.72, -0.85, 0.3, 1.32, 0.33, 0.51, -0.55, -0.68,
    -0.58, -0.57, -0.49, 0.17, 1.3, -0.5, 1.21, 1.14, 1.28, -0.72,
    -0.42, 0.33, 1.37, 1.24, 0.3), release_pos_x = c(-2.18, -1.97,
    -2.11, -1.72, -1.4, -1.66, -2.19, -1.93, -2.09, -1.89, -1.85,
    -1.95, -1.89, -2.16, -1.73, -2.2, -2.22, -2.45, -2.07, -2.11,
    -2.18, -2.24, -1.85, -2.29, -2.23, -2.16, -2.06, -2.07, -1.77,
    -1.81, -2, -1.85, -1.75, -2.13, -2.14, -2.49, -2.14, -2.05,
    -1.89, -1.79, -1.71, -1.73, -1.82, -2.08, -2.32, -1.76, -2.03,
    -1.93, -2.04, -2.13, -1.97, -2.27, -2.2, -2.1, -2.27, -1.94,
    -1.95, -1.86, -2.27, -2.28, -1.84, -2.21, -2, -1.72, -1.94,
    -1.73, -1.74, -2, -1.82, -1.89, -1.59, -1.83, -2.12, -2.12,
    -1.84, -1.92, -2.13, -1.69, -1.9, -2.12, -2.15, -1.98, -2.63,
    -2.24, -2.02, -1.83, -2.32, -1.96, -1.88, -2.02, -2.29, -2.2,
    -2.15, -2.43, -1.68, -1.92, -2.05, -1.65, -2.12, -1.91),
    release_pos_z = c(6.03, 6.29, 6.13, 6.04, 6.32, 6.24, 6.07,
    6.18, 6.21, 6.07, 6.02, 6.14, 6.17, 6.16, 6.06, 5.95, 6.06,
    5.8, 6, 6.02, 6.09, 6.14, 6.08, 5.93, 6.08, 6.26, 6.08, 6.12,
    6.14, 6.04, 6.41, 6.23, 6.08, 6.11, 5.88, 5.95, 6.28, 6.05,
    6.06, 6.29, 6.27, 6.2, 5.99, 6.23, 6.08, 6.07, 6.09, 6.18,
    6.1, 6.19, 5.97, 5.95, 6.11, 5.99, 6.25, 5.97, 6.02, 6.15,
    6.01, 6.04, 6.18, 6.06, 6.03, 6.2, 5.85, 6.25, 6.07, 6.25,
    6.06, 5.99, 6.28, 6.18, 5.87, 6.15, 6.01, 6.12, 6.2, 6.09,
    6.09, 5.94, 5.99, 6, 5.74, 6.36, 6.04, 6.16, 5.94, 6.2, 6,
    5.96, 6.31, 5.99, 5.96, 6.13, 6.17, 6.21, 6.14, 6.04, 6.05,
    6.21), player_name = c("Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan"), p_throws = c("R", "R", "R", "R", "R", "R",
    "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R",
    "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R",
    "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R",
    "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R",
    "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R",
    "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R",
    "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R",
    "R", "R", "R", "R", "R", "R", "R", "R", "R", "R"), pitch_type = c("CU",
    "CH", "FF", "CH", "CU", "FF", "FF", "CU", "CH", "FF", "FF",
    "CU", "FF", "CU", "FF", "CH", "CH", "SL", "CU", "FF", "CU",
    "CH", "FF", "CH", "CH", "CU", "CU", "CU", "CU", "CU", "CU",
    "CU", "FF", "FF", "CH", "CH", "CU", "CU", "FF", "CH", "CU",
    "CU", "CU", "CU", "CH", "FF", "CH", "FF", "CU", "CU", "FF",
    "CH", "FF", "CH", "CH", "CU", "CH", "FF", "CH", "CH", "CH",
    "FF", "CH", "CU", "CU", "CU", "CU", "CU", "FF", "FF", "FF",
    "CU", "CH", "FF", "FF", "CU", "CU", "CU", "CU", "CH", "FF",
    "CH", "SL", "CU", "CU", "CU", "CU", "CU", "CH", "FF", "CU",
    "FF", "FF", "FF", "CU", "CU", "CH", "FF", "FF", "CH"), Stuff. = c(110.783365414633,
    83.9695389876577, 126.982883382714, 100.773492772016, 122.695393953566,
    119.617766459935, 118.785623163818, 130.831514405023, 61.756262527081,
    96.8279502585635, 99.8866109055696, 129.196132513915, 100.484491385581,
    126.11256167432, 119.411360427872, 99.3219706412825, 114.233606464787,
    85.7119791685036, 130.467610095058, 112.469680863445, 141.219595669374,
    107.42847854836, 108.245236352338, 99.7562461898892, 125.500229256936,
    122.603272894611, 140.858949561694, 127.283168181566, 124.003695368084,
    127.799900621368, 111.05222857869, 123.422997655113, 123.389105069617,
    110.298869169031, 111.024067639178, 94.9843404478164, 150.783474706561,
    126.3180435826, 100.726570873835, 119.565181758901, 122.935086985841,
    141.957127666565, 131.623575183857, 111.648889433675, 79.7759749825627,
    86.5740112525524, 93.0267990053248, 111.314387796175, 121.148229426222,
    146.59561919429, 113.787652486095, 110.791517820695, 84.8826511258123,
    99.281267964766, 95.6569834353375, 139.898066773251, 116.718918712834,
    98.5337807227119, 96.0645681960684, 63.3208562591806, 108.735190496635,
    80.3261641922412, 188.974704795231, 117.766297421377, 129.541840071494,
    134.2787846362, 130.058767183761, 123.568417985415, 84.8628879203198,
    68.4933286167661, 116.547997910403, 123.002208002103, 94.3192200671762,
    85.8888577862371, 141.693480608564, 125.100305847327, 121.625166716099,
    109.272368981841, 107.346832906711, 100.57797732587, 108.425613182612,
    78.6537787345208, 85.6841619149002, 121.150698692734, 131.428503129421,
    113.792479159864, 135.83714795316, 112.501339659899, 88.7429637176584,
    155.705150252501, 137.647519897197, 97.8102480290771, 135.083550736976,
    140.716728877702, 98.6674738226451, 134.137954477671, 169.959982914227,
    141.693480608564, 137.731456338842, 93.4183672266801)), class = "data.frame", row.names = c(NA,
-100L))
</code>```

Body:
I am having a problem publishing my RShiny App. Whenever I publish it, everything works besides my stat_summary_hex() function within my ggplot. I am not really sure why it is not working, whenever I run it through RStudio it works perfectly fine, but not when I publish it. If I could get help, that would be much appreciated.

I am getting this message: Computation failed in stat_summary_hex():

Here's my code

library(shiny)
library(dplyr)
library(tidyverse)
library(ggplot2)

allStuff2 = read.csv("appData.csv")
allStuff2$player_name = iconv(allStuff2$player_name,from="UTF-8",to="ASCII//TRANSLIT")
allStuff2 = allStuff2 %>%
  mutate(pitch_type = ifelse(pitch_type == "FF", "Fourseam Fastball", pitch_type),
         pitch_type = ifelse(pitch_type == "SI", "Sinker", pitch_type),
         pitch_type = ifelse(pitch_type == "FC", "Cutter", pitch_type),
         pitch_type = ifelse(pitch_type == "SL", "Slider", pitch_type),
         pitch_type = ifelse(pitch_type == "CU", "Curveball", pitch_type),
         pitch_type = ifelse(pitch_type == "CH", "Changeup", pitch_type)) %>%
  arrange(player_name)

# Define UI for application that draws a histogram
ui <- fluidPage(

  # Application title
  titlePanel("2022 Stuff+ Dashboard"),
  theme = shinythemes::shinytheme("journal"),

  # Sidebar with a slider input for number of bins
  sidebarLayout(
    sidebarPanel(
      selectInput('name',
                  'Select Pitcher:',
                  choices = unique(allStuff2$player_name)),
      selectInput('pitch_type',
                  'Select Pitch Type:',
                  choices = c('Fourseam Fastball', 'Sinker', 'Cutter', 'Slider', 'Curveball', 'Changeup'),
                  selected = 'Fourseam Fastball')),

    # Show a plot of the generated distribution
    mainPanel(
      plotOutput("stuffPlot"),
      tableOutput("table")
    )
  )
)

# Define server logic required to draw a histogram
server <- function(input, output) {

  pitcherAvg = reactive({
    allStuff2 %>%
      filter(player_name == input$name,
             pitch_type == input$pitch_type) %>%
      group_by(pitch_type) %>%
      summarise(velo = mean(release_speed, na.rm = T),
                pfx_x = -mean(pfx_x, na.rm = T),
                pfx_z = mean(pfx_z, na.rm = T),
                rp_x = mean(release_pos_x, na.rm = T),
                rp_z = mean(release_pos_z, na.rm = T),
                p_throws = p_throws[1],
                Stuff. = mean(Stuff., na.rm = T))
  })

 output$stuffPlot = renderPlot({
   ggplot(filter(allStuff2, pitch_type == input$pitch_type,
                 p_throws == pitcherAvg()$p_throws,
                 release_pos_x >= pitcherAvg()$rp_x - 0.5,
                 release_pos_x <= pitcherAvg()$rp_x + 0.5,
                 release_pos_z >= pitcherAvg()$rp_z - 0.5,
                 release_pos_z <= pitcherAvg()$rp_z + 0.5,
                 release_speed >= pitcherAvg()$velo - 1,
                 release_speed <= pitcherAvg()$velo + 1),
          aes(x = -pfx_x, y = pfx_z, z = Stuff.)) +
          stat_summary_hex() +
          scale_fill_gradient2(midpoint = 100, low = "blue", mid = "white", high = "red") +
          geom_point(aes(x=pitcherAvg()$pfx_x, y=pitcherAvg()$pfx_z), colour="black", size = 5) +
          theme_bw() +
          labs(x = 'Horizontal Movement', y = 'Vertical Movement', fill = 'Stuff+',
            title = paste(strsplit(input$name, ", ")[[1]][1], "'s Stuff+ by Location for ", input$pitch_type, sep = ""),
            subtitle = "Based off of Pitchers with Similar Release Point and Velocity (Pitcher's Point of View)",
            caption = 'Email: fran1412@umn.edu') +
          coord_fixed() +
          geom_vline(xintercept = 0) +
          geom_hline(yintercept = 0) +
          xlim(-2.5,2.5) +
          ylim(-2.5,2.5)
  })

  output$table = renderTable({
    allStuff2 %>%
      filter(player_name == input$name,
             pitch_type == input$pitch_type) %>%
      group_by(pitch_type) %>%
      summarise(Velocity = mean(release_speed, na.rm = T),
                `Horiz. Break` = -mean(pfx_x, na.rm = T),
                `Vert. Break` = mean(pfx_z, na.rm = T),
                `Horiz. Release Point` = -mean(release_pos_x, na.rm = T),
                `Vert. Release Point` = mean(release_pos_z, na.rm = T),
                `Stuff+` = as.integer(round(mean(Stuff., na.rm = T), 0))) %>%
      select(-pitch_type)
  })

}

# Run the application
shinyApp(ui = ui, server = server)

Here is my dput file:

structure(list(release_speed = c(85.9, 97.6, 100.5, 98.9, 87.3,
100.7, 100.6, 87.3, 95, 100.7, 101.2, 87.4, 102, 87.2, 103.2,
95.8, 94.3, 93.1, 89, 101, 87.2, 95.8, 101.5, 96.1, 96.2, 85.5,
88.7, 88.4, 87.7, 90.5, 88.2, 87.2, 101.2, 100.6, 96.1, 95, 85,
85.7, 102.3, 96.2, 89.3, 88.3, 91.4, 86.1, 96.5, 101.5, 96.4,
100.7, 84.5, 89.9, 101.1, 94.3, 98.8, 95.7, 95.4, 89.3, 94.7,
98.1, 94.7, 97, 95.7, 98.5, 98.9, 87.6, 90.4, 86.5, 88.4, 88.3,
101.9, 98.9, 100.7, 89, 95.4, 99.6, 102.4, 87.5, 87.2, 88, 87,
95.9, 99.1, 96.5, 91, 85.9, 87.2, 84.8, 87.1, 88, 98.3, 102.1,
86.3, 99.2, 101.9, 100, 84.7, 86.1, 98.2, 102.4, 99.8, 98.8),
    pfx_x = c(0.5, -1.12, -0.79, -0.95, 0.52, -0.89, -1.44, 0.26,
    -1.12, -1, -0.86, 0.2, -0.84, 0.32, -1.2, -1.09, -1.37, -0.54,
    0.25, -1.12, 0.15, -0.77, -0.84, -0.99, -1.38, 0.26, 0.05,
    0.32, 0.2, 0.36, 0.29, 0.01, -1.08, -1, -0.75, -0.67, 0,
    0.27, -0.9, -1.48, 0.33, 0.11, 0.33, 0.22, -0.75, -1.23,
    -1.25, -1.02, 0.27, -0.13, -1.1, -0.51, -0.91, -0.7, -0.84,
    0.23, -1.64, -0.96, -0.76, -1.03, -1.53, -1.24, -1.41, 0.48,
    0.39, 0.09, 0.56, 0.18, -1.08, -0.97, -1.21, 0.5, -1.21,
    -0.89, -1.12, 0.13, 0.16, 0.39, 0.46, -1.1, -0.79, -1.19,
    -0.65, 0.28, 0.23, 0.35, 0.1, 0.34, -0.35, -0.91, 0.02, -0.86,
    -1.02, -0.75, 0.38, 0.08, -1.38, -1.08, -1.02, -1.15), pfx_z = c(-0.63,
    0.06, 1.22, 0.13, -0.45, 1.3, 1.15, -1.16, 0.64, 1.18, 1.08,
    -0.75, 1, -0.59, 1.04, 0.29, 0.25, 0.53, -0.62, 0.97, -0.61,
    0.13, 1.16, 0.32, 0.05, -0.48, -0.4, -0.39, -0.9, -0.42,
    -0.64, -0.59, 1.24, 1.01, 0.1, 0.25, -1.05, -0.51, 1.12,
    0.35, -0.63, -0.52, -0.56, -0.69, 0.22, 0.8, 0.48, 1.18,
    -0.43, -0.34, 1.17, -0.21, 1.07, 0.21, 0.32, -0.49, 0.16,
    1.35, 0.12, 0.43, 0.57, 1.04, 0.42, -0.56, -0.58, -0.82,
    -0.37, -0.48, 0.8, 1, 1.33, -0.7, 0.45, 0.95, 1.37, -0.32,
    -0.57, -0.72, -0.85, 0.3, 1.32, 0.33, 0.51, -0.55, -0.68,
    -0.58, -0.57, -0.49, 0.17, 1.3, -0.5, 1.21, 1.14, 1.28, -0.72,
    -0.42, 0.33, 1.37, 1.24, 0.3), release_pos_x = c(-2.18, -1.97,
    -2.11, -1.72, -1.4, -1.66, -2.19, -1.93, -2.09, -1.89, -1.85,
    -1.95, -1.89, -2.16, -1.73, -2.2, -2.22, -2.45, -2.07, -2.11,
    -2.18, -2.24, -1.85, -2.29, -2.23, -2.16, -2.06, -2.07, -1.77,
    -1.81, -2, -1.85, -1.75, -2.13, -2.14, -2.49, -2.14, -2.05,
    -1.89, -1.79, -1.71, -1.73, -1.82, -2.08, -2.32, -1.76, -2.03,
    -1.93, -2.04, -2.13, -1.97, -2.27, -2.2, -2.1, -2.27, -1.94,
    -1.95, -1.86, -2.27, -2.28, -1.84, -2.21, -2, -1.72, -1.94,
    -1.73, -1.74, -2, -1.82, -1.89, -1.59, -1.83, -2.12, -2.12,
    -1.84, -1.92, -2.13, -1.69, -1.9, -2.12, -2.15, -1.98, -2.63,
    -2.24, -2.02, -1.83, -2.32, -1.96, -1.88, -2.02, -2.29, -2.2,
    -2.15, -2.43, -1.68, -1.92, -2.05, -1.65, -2.12, -1.91),
    release_pos_z = c(6.03, 6.29, 6.13, 6.04, 6.32, 6.24, 6.07,
    6.18, 6.21, 6.07, 6.02, 6.14, 6.17, 6.16, 6.06, 5.95, 6.06,
    5.8, 6, 6.02, 6.09, 6.14, 6.08, 5.93, 6.08, 6.26, 6.08, 6.12,
    6.14, 6.04, 6.41, 6.23, 6.08, 6.11, 5.88, 5.95, 6.28, 6.05,
    6.06, 6.29, 6.27, 6.2, 5.99, 6.23, 6.08, 6.07, 6.09, 6.18,
    6.1, 6.19, 5.97, 5.95, 6.11, 5.99, 6.25, 5.97, 6.02, 6.15,
    6.01, 6.04, 6.18, 6.06, 6.03, 6.2, 5.85, 6.25, 6.07, 6.25,
    6.06, 5.99, 6.28, 6.18, 5.87, 6.15, 6.01, 6.12, 6.2, 6.09,
    6.09, 5.94, 5.99, 6, 5.74, 6.36, 6.04, 6.16, 5.94, 6.2, 6,
    5.96, 6.31, 5.99, 5.96, 6.13, 6.17, 6.21, 6.14, 6.04, 6.05,
    6.21), player_name = c("Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan", "Duran, Jhoan",
    "Duran, Jhoan"), p_throws = c("R", "R", "R", "R", "R", "R",
    "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R",
    "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R",
    "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R",
    "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R",
    "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R",
    "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R",
    "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R",
    "R", "R", "R", "R", "R", "R", "R", "R", "R", "R"), pitch_type = c("CU",
    "CH", "FF", "CH", "CU", "FF", "FF", "CU", "CH", "FF", "FF",
    "CU", "FF", "CU", "FF", "CH", "CH", "SL", "CU", "FF", "CU",
    "CH", "FF", "CH", "CH", "CU", "CU", "CU", "CU", "CU", "CU",
    "CU", "FF", "FF", "CH", "CH", "CU", "CU", "FF", "CH", "CU",
    "CU", "CU", "CU", "CH", "FF", "CH", "FF", "CU", "CU", "FF",
    "CH", "FF", "CH", "CH", "CU", "CH", "FF", "CH", "CH", "CH",
    "FF", "CH", "CU", "CU", "CU", "CU", "CU", "FF", "FF", "FF",
    "CU", "CH", "FF", "FF", "CU", "CU", "CU", "CU", "CH", "FF",
    "CH", "SL", "CU", "CU", "CU", "CU", "CU", "CH", "FF", "CU",
    "FF", "FF", "FF", "CU", "CU", "CH", "FF", "FF", "CH"), Stuff. = c(110.783365414633,
    83.9695389876577, 126.982883382714, 100.773492772016, 122.695393953566,
    119.617766459935, 118.785623163818, 130.831514405023, 61.756262527081,
    96.8279502585635, 99.8866109055696, 129.196132513915, 100.484491385581,
    126.11256167432, 119.411360427872, 99.3219706412825, 114.233606464787,
    85.7119791685036, 130.467610095058, 112.469680863445, 141.219595669374,
    107.42847854836, 108.245236352338, 99.7562461898892, 125.500229256936,
    122.603272894611, 140.858949561694, 127.283168181566, 124.003695368084,
    127.799900621368, 111.05222857869, 123.422997655113, 123.389105069617,
    110.298869169031, 111.024067639178, 94.9843404478164, 150.783474706561,
    126.3180435826, 100.726570873835, 119.565181758901, 122.935086985841,
    141.957127666565, 131.623575183857, 111.648889433675, 79.7759749825627,
    86.5740112525524, 93.0267990053248, 111.314387796175, 121.148229426222,
    146.59561919429, 113.787652486095, 110.791517820695, 84.8826511258123,
    99.281267964766, 95.6569834353375, 139.898066773251, 116.718918712834,
    98.5337807227119, 96.0645681960684, 63.3208562591806, 108.735190496635,
    80.3261641922412, 188.974704795231, 117.766297421377, 129.541840071494,
    134.2787846362, 130.058767183761, 123.568417985415, 84.8628879203198,
    68.4933286167661, 116.547997910403, 123.002208002103, 94.3192200671762,
    85.8888577862371, 141.693480608564, 125.100305847327, 121.625166716099,
    109.272368981841, 107.346832906711, 100.57797732587, 108.425613182612,
    78.6537787345208, 85.6841619149002, 121.150698692734, 131.428503129421,
    113.792479159864, 135.83714795316, 112.501339659899, 88.7429637176584,
    155.705150252501, 137.647519897197, 97.8102480290771, 135.083550736976,
    140.716728877702, 98.6674738226451, 134.137954477671, 169.959982914227,
    141.693480608564, 137.731456338842, 93.4183672266801)), class = "data.frame", row.names = c(NA,
-100L))


问:
Using Expo's Google authentication integration vs react-native-google-signin
I'm building my first React Native app and I want to have Google signin.

I first went down the path of trying to integrate the library react-native-google-signin - seemed like a promising library! But then very quickly I got mired in problems with my development environment and figuring out Expo development builds. I never quite got it working.

Then I tried Expo's Google authentication integration, and I've gotten that working, at least on web and iOS via Expo. It returns the logged-in user's Google access_token, which I think is all I'm needing (I currently don't need access to any other of the user's Google data).

My main question is: what are the drawbacks or limitations of using Expo's authentication option, or, why would I want to use the react-native-google-signin library despite its much greater added complexity? Is the Expo option going to break when I try to officially turn my app into a native iOS app?


问:
UIViewController not accessible after consumable IAP purchase success
I have a consumable IAP that seems to be working but I cannot seem to access the ViewController after the purchase.

```<code>extension IAPService: SKPaymentTransactionObserver
{
   func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction])
   {
      for transactions in transactions
      {
          print(transactions.transactionState.status(), transactions.payment.productIdentifier)

          if transactions.transactionState.status() == SKPaymentTransactionState.purchased.status()
          {
             if transactions.payment.productIdentifier == IAPProduct.Consumable.rawValue
             {
                print("\n\n\n\n\n\n\nCONSUMABLE")

                let vc = ViewController()
                vc.purchaseTenGold()

                SKPaymentQueue.default().finishTransaction(transactions)
             }
          }
      }
   }
}
</code>```

I've tried to add a green button to see if it can access the viewController but the button won't appear.
I've tried to push the view to the viewController but nothing happens.

```<code>func purchaseTenGold()
{
   DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(1), execute:
   {
       let pButton = UIButton()
        pButton.translatesAutoresizingMaskIntoConstraints = false
        pButton.backgroundColor = .green

        self.view.addSubview(pButton)

        NSLayoutConstraint.activate([
            pButton.centerXAnchor.constraint(equalTo: self.view.centerXAnchor),
            pButton.centerYAnchor.constraint(equalTo: self.view.centerYAnchor),
            pButton.widthAnchor.constraint(equalToConstant: 200),
            pButton.heightAnchor.constraint(equalToConstant: 200),
        ])
       print("\n\n\n\n\n\n\n\n\n\nPURCHASED 10 YEAH????WTF???")
   })
}
</code>```

I just want to add some game coins but can't access the viewController, so I've been trying to add something to the view or make something unhidden that has already loaded to the view but can't access it.

Everything prints out perfectly.

I have another published app where this all works well and I can add the game coins, but this does not work.
The one difference between that app and this one is that with the other one I have a navigation controller with a few view controllers, this app only has the one vc.

Thanks in advance for any help.

Just added this to access the view but I'm still not able to access the viewController to make any changes...

```<code>    let alert = UIAlertController(title: "", message: "YOU SUCCESSFULLY\nCREATED A NEW\nALERT CONTROLLER", preferredStyle: .alert)
    func okAlert(alert: UIAlertAction!)
    {

    }
    alert.addAction(UIAlertAction(title: "OK", style: .default, handler: okAlert))

    let scenes = UIApplication.shared.connectedScenes
    let windowScene = scenes.first as? UIWindowScene
    let window = windowScene?.windows.first
    var rootVC = window?.rootViewController

    if var topController = rootVC
    {
        while let presentedViewController = topController.presentedViewController
        {
            topController = presentedViewController
        }
        rootVC = topController
    }
    rootVC?.present(alert, animated: true, completion: nil)
</code>```

Body:
I have a consumable IAP that seems to be working but I cannot seem to access the ViewController after the purchase.

extension IAPService: SKPaymentTransactionObserver
{
   func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction])
   {
      for transactions in transactions
      {
          print(transactions.transactionState.status(), transactions.payment.productIdentifier)

          if transactions.transactionState.status() == SKPaymentTransactionState.purchased.status()
          {
             if transactions.payment.productIdentifier == IAPProduct.Consumable.rawValue
             {
                print("\n\n\n\n\n\n\nCONSUMABLE")

                let vc = ViewController()
                vc.purchaseTenGold()

                SKPaymentQueue.default().finishTransaction(transactions)
             }
          }
      }
   }
}

I've tried to add a green button to see if it can access the viewController but the button won't appear.
I've tried to push the view to the viewController but nothing happens.

func purchaseTenGold()
{
   DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(1), execute:
   {
       let pButton = UIButton()
        pButton.translatesAutoresizingMaskIntoConstraints = false
        pButton.backgroundColor = .green

        self.view.addSubview(pButton)

        NSLayoutConstraint.activate([
            pButton.centerXAnchor.constraint(equalTo: self.view.centerXAnchor),
            pButton.centerYAnchor.constraint(equalTo: self.view.centerYAnchor),
            pButton.widthAnchor.constraint(equalToConstant: 200),
            pButton.heightAnchor.constraint(equalToConstant: 200),
        ])
       print("\n\n\n\n\n\n\n\n\n\nPURCHASED 10 YEAH????WTF???")
   })
}

I just want to add some game coins but can't access the viewController, so I've been trying to add something to the view or make something unhidden that has already loaded to the view but can't access it.

Everything prints out perfectly.

I have another published app where this all works well and I can add the game coins, but this does not work.
The one difference between that app and this one is that with the other one I have a navigation controller with a few view controllers, this app only has the one vc.

Thanks in advance for any help.

Just added this to access the view but I'm still not able to access the viewController to make any changes...

    let alert = UIAlertController(title: "", message: "YOU SUCCESSFULLY\nCREATED A NEW\nALERT CONTROLLER", preferredStyle: .alert)
    func okAlert(alert: UIAlertAction!)
    {

    }
    alert.addAction(UIAlertAction(title: "OK", style: .default, handler: okAlert))

    let scenes = UIApplication.shared.connectedScenes
    let windowScene = scenes.first as? UIWindowScene
    let window = windowScene?.windows.first
    var rootVC = window?.rootViewController

    if var topController = rootVC
    {
        while let presentedViewController = topController.presentedViewController
        {
            topController = presentedViewController
        }
        rootVC = topController
    }
    rootVC?.present(alert, animated: true, completion: nil)


问:
Selenium Issue with Exec?
I am running a webscraper with selenium to get some data on the NBA.  I have urls to get to the websites for each of the 30 teams, but when I run the code it only gets through a few of the urls and then crashes with the errors below being shown:

```<code>#web scraper
from bs4 import BeautifulSoup
import requests
from selenium import webdriver
import pandas as pd
import os

class NBAScraper:
    def __init__(self):
        #part 1
        url = "https://www.nba.com/teams"
        HTML = requests.get(url)
        soup = BeautifulSoup(HTML.text, 'html.parser')
        text = str(soup.find_all("a", "Anchor_anchor__cSc3P TeamFigureLink_teamFigureLink__uqnNO"))
        ids = []
        for i in range(0, 30):
            hr = text.find("stats")
            ids.append(text[(hr+11):(hr+21)])
            text = text[(hr+22):]
        #part 2

        names = []
        for j in range(0, 30):
            url2 = "https://www.nba.com/stats/team/"+str(ids[j])+"/advanced"
            HTML2 = requests.get(url2)
            soup2 = BeautifulSoup(HTML2.text, 'html.parser')
        ##div class="TeamHeader_name__MmHlP
            name = str(soup2.find("div", "TeamHeader_name__MmHlP"))
            ni = name.find("div>")
            ni2 = name.find("<!")
            name1 = name[(ni+4):ni2]
            name = name[ni2:]
            ni3 = name.find("<div>")
            name = name[(ni3+5):]
            ni4 = name.find("</div>")
            name2 = name[:ni4]
            n = name1 + " " + name2
            names.append(n)
        ##tbody class="Crom_body__UYOcU"
        #part 3
        offrtg = []
        defrtg = []
        reb = []
        tov = []
        efg = []

        for k in range(0, 30):
            self.driver = webdriver.Chrome()
            url3 = "https://www.nba.com/stats/team/"+str(ids[k])+"/advanced"
            self.driver.get(url3)
            rndrhtml = self.driver.page_source
            self.driver.close()
            #self.driver.quit()
            soup3 = BeautifulSoup(rndrhtml, 'html.parser')
            ovrall = str(soup3.find("tbody", "Crom_body__UYOcU").find_all("td"))
            for d in range(0, 13):
                di = ovrall.find("<td>")
                ovrall = ovrall[(di+4):]
                #conditions
                if d == 2:
                    di2 = ovrall.find("</td>")
                    offrtg.append(float(ovrall[:di2]))
                elif d == 3:
                    di2 = ovrall.find("</td>")
                    defrtg.append(float(ovrall[:di2]))
                elif d == 10:
                    di2 = ovrall.find("</td>")
                    reb.append(float(ovrall[:di2]))
                elif d == 11:
                    di2 = ovrall.find("</td>")
                    tov.append(float(ovrall[:di2]))
                elif d == 12:
                    di2 = ovrall.find("</td>")
                    efg.append(float(ovrall[:di2]))

        #writing to excel
        os.remove(r"C:\Users\jackm\OneDrive\Desktop\NBA\NBASTATS.xlsx")
        d = {'Name': names, 'OFFRTG': offrtg, 'DEFRTG': defrtg, 'REB': reb,
             'TOV': tov, 'EFG': efg}
        df = pd.DataFrame(data=d)
        df.to_excel(r"C:\Users\jackm\OneDrive\Desktop\NBA\NBASTATS.xlsx", sheet_name="STATS")

NBAScraper()

</code>```

I tried to play around with the closing and quitting functions for the driver, or put the driver in a separate function and run it outside the class, but none of that worked.  I realized through some testing that even if it's not inside a loop, selenium will throw the error for a url but run it fine the second time.  I tried using implicit waits to solve this but to no avail.

```<code>
Traceback (most recent call last):

  File "C:\Program Files\Spyder\pkgs\spyder_kernels\py3compat.py", line 356, in compat_exec
    exec(code, globals, locals)

  File "c:\users\jackm\spyder\nba.py", line 104, in <module>
    NBAScraper()

  File "c:\users\jackm\spyder\nba.py", line 71, in __init__
    ovrall = str(soup3.find("tbody", "Crom_body__UYOcU").find_all("td"))

AttributeError: 'NoneType' object has no attribute 'find_all'

</code>```

Title: Selenium Issue with Exec?

Body:
I am running a webscraper with selenium to get some data on the NBA.  I have urls to get to the websites for each of the 30 teams, but when I run the code it only gets through a few of the urls and then crashes with the errors below being shown:

#web scraper
from bs4 import BeautifulSoup
import requests
from selenium import webdriver
import pandas as pd
import os

class NBAScraper:
    def __init__(self):
        #part 1
        url = "https://www.nba.com/teams"
        HTML = requests.get(url)
        soup = BeautifulSoup(HTML.text, 'html.parser')
        text = str(soup.find_all("a", "Anchor_anchor__cSc3P TeamFigureLink_teamFigureLink__uqnNO"))
        ids = []
        for i in range(0, 30):
            hr = text.find("stats")
            ids.append(text[(hr+11):(hr+21)])
            text = text[(hr+22):]
        #part 2

        names = []
        for j in range(0, 30):
            url2 = "https://www.nba.com/stats/team/"+str(ids[j])+"/advanced"
            HTML2 = requests.get(url2)
            soup2 = BeautifulSoup(HTML2.text, 'html.parser')
        ##div class="TeamHeader_name__MmHlP
            name = str(soup2.find("div", "TeamHeader_name__MmHlP"))
            ni = name.find("div>")
            ni2 = name.find("<!")
            name1 = name[(ni+4):ni2]
            name = name[ni2:]
            ni3 = name.find("
")
            name = name[(ni3+5):]
            ni4 = name.find("
")
            name2 = name[:ni4]
            n = name1 + " " + name2
            names.append(n)
        ##tbody class="Crom_body__UYOcU"
        #part 3
        offrtg = []
        defrtg = []
        reb = []
        tov = []
        efg = []

        for k in range(0, 30):
            self.driver = webdriver.Chrome()
            url3 = "https://www.nba.com/stats/team/"+str(ids[k])+"/advanced"
            self.driver.get(url3)
            rndrhtml = self.driver.page_source
            self.driver.close()
            #self.driver.quit()
            soup3 = BeautifulSoup(rndrhtml, 'html.parser')
            ovrall = str(soup3.find("tbody", "Crom_body__UYOcU").find_all("td"))
            for d in range(0, 13):
                di = ovrall.find("")
                ovrall = ovrall[(di+4):]
                #conditions
                if d == 2:
                    di2 = ovrall.find("	")
                    offrtg.append(float(ovrall[:di2]))
                elif d == 3:
                    di2 = ovrall.find("	")
                    defrtg.append(float(ovrall[:di2]))
                elif d == 10:
                    di2 = ovrall.find("	")
                    reb.append(float(ovrall[:di2]))
                elif d == 11:
                    di2 = ovrall.find("	")
                    tov.append(float(ovrall[:di2]))
                elif d == 12:
                    di2 = ovrall.find("	")
                    efg.append(float(ovrall[:di2]))

        #writing to excel
        os.remove(r"C:\Users\jackm\OneDrive\Desktop\NBA\NBASTATS.xlsx")
        d = {'Name': names, 'OFFRTG': offrtg, 'DEFRTG': defrtg, 'REB': reb,
             'TOV': tov, 'EFG': efg}
        df = pd.DataFrame(data=d)
        df.to_excel(r"C:\Users\jackm\OneDrive\Desktop\NBA\NBASTATS.xlsx", sheet_name="STATS")

NBAScraper()

I tried to play around with the closing and quitting functions for the driver, or put the driver in a separate function and run it outside the class, but none of that worked.  I realized through some testing that even if it's not inside a loop, selenium will throw the error for a url but run it fine the second time.  I tried using implicit waits to solve this but to no avail.

Traceback (most recent call last):

  File "C:\Program Files\Spyder\pkgs\spyder_kernels\py3compat.py", line 356, in compat_exec
    exec(code, globals, locals)

  File "c:\users\jackm\spyder\nba.py", line 104, in <module>
    NBAScraper()

  File "c:\users\jackm\spyder\nba.py", line 71, in __init__
    ovrall = str(soup3.find("tbody", "Crom_body__UYOcU").find_all("td"))

AttributeError: 'NoneType' object has no attribute 'find_all'


问:
Is there any R package to create the generalized box plot as mentioned in the research paper of (Bruffaerts, et al., 2014)
I have a highly skewed and heavy tailed data. For this reason, instead of using the adjusted boxplot in R (which accounts only for the skewness of the data and not the underlying heaviness of the tail), I wanted to use the generalized boxplot since it accounts for both skewness and heaviness of the tail.

I am unable to try the generalized boxplot since I could not find its R package (if any).

https://sci-hub.hkvisa.net/10.1016/j.spl.2014.08.016


问:
How to define object in Coppelia Sim v4.3.0 using sim.getObject?
I would like to define Object Handler for my cup on the table and my robot joint in Coppelia Sim, but since V 4.3.0, the way to do that has changed. I have already read the documentation but I still cannot understand.
Is there a more understandable literacy for defining Object Handler in Coppelia Sim v4.3.0?

[My Coppelia Sim scene]
[1]: https://i.stack.imgur.com/24jqS.png


问:
Invalid Value for Parameter 'recovery_target_time' in Postgres Database
Wishing you all a Happy and Prosperous New Year!

I am getting below error while restoring postgres database to a specific target time (PITR):

```<code>Invalid value for parameter recovery_target_time in file postgresql.conf
</code>```

And database is not getting restored. I have tried following values for recovery_target_time:

```<code>recovery_target_time = '2022-12-31 12:45:00 UTC'
recovery_target_time = '2022-12-31 12:45:00 UTC+00'
recovery_target_time = '2022-12-31 12:45:00 UTC+00:00'
recovery_target_time = '2022-12-31 12:45:00 Etc/UTC'
recovery_target_time = '2022-12-31 12:45:00.000'
</code>```

But none of the above is working.
What value should be used for recovery_target_time?.
I am using postgresql 14 on Ubuntu 22.04 and trying restore database using pg_basebackup. Timezone is in UTC. Let me know if I need to add more details.

Update: Provided logs

```<code>
2022-12-30 13:32:19.686 UTC [34563] LOG: invalid value for parameter "recovery_target_time": "2022–12–30 12:45:00 UTC+00:00"

</code>```

Body:
Wishing you all a Happy and Prosperous New Year!

I am getting below error while restoring postgres database to a specific target time (PITR):

Invalid value for parameter recovery_target_time in file postgresql.conf

And database is not getting restored. I have tried following values for recovery_target_time:

recovery_target_time = '2022-12-31 12:45:00 UTC'
recovery_target_time = '2022-12-31 12:45:00 UTC+00'
recovery_target_time = '2022-12-31 12:45:00 UTC+00:00'
recovery_target_time = '2022-12-31 12:45:00 Etc/UTC'
recovery_target_time = '2022-12-31 12:45:00.000'

But none of the above is working.
What value should be used for recovery_target_time?.
I am using postgresql 14 on Ubuntu 22.04 and trying restore database using pg_basebackup. Timezone is in UTC. Let me know if I need to add more details.

Update: Provided logs

2022-12-30 13:32:19.686 UTC [34563] LOG: invalid value for parameter "recovery_target_time": "2022–12–30 12:45:00 UTC+00:00"


问:
Simulating button hold doesn't work as expected

#include <windows.h>
#define VK_W 0x57

int main()
{
    keybd_event(VK_W, 0, 0, 0); // Press down the key
    Sleep(3000);
    keybd_event(VK_W, 0, KEYEVENTF_KEYUP, 0); // Release the key
}
```
<p>This code is supposed to hold down a key for 3 seconds, and upon further checking through https://drakeirving.github.io/MultiKeyDisplay/ it does hold it for 3 second, but the default behaviour isn't present. The default behaviour I want is for it to repeatedly send the key when I hold it down (like what happens when I hold it down physically). This doesn't happen here, because when I open Notepad, it doesn't repeat the key.</p>
<p>I even tried simulating scancodes to see if it has an effect, but to no avail.</p>
<pre class="lang-c prettyprint-override"><code>#include <windows.h>
#define VK_W 0x57

int main()
{
    keybd_event(0,
                 MapVirtualKey(VK_W, MAPVK_VK_TO_VSC),
                 KEYEVENTF_SCANCODE | 0,
                 0);
    Sleep(3000);
    keybd_event(0,
                 MapVirtualKey(VK_W, MAPVK_VK_TO_VSC),
                 KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP,
                 0);
}
</code>```

How do I simulate holding the key so that it behaves the same way as when I hold it down physically?

Body:
#include <windows.h>
#define VK_W 0x57

int main()
{
    keybd_event(VK_W, 0, 0, 0); // Press down the key
    Sleep(3000);
    keybd_event(VK_W, 0, KEYEVENTF_KEYUP, 0); // Release the key
}

This code is supposed to hold down a key for 3 seconds, and upon further checking through https://drakeirving.github.io/MultiKeyDisplay/ it does hold it for 3 second, but the default behaviour isn't present. The default behaviour I want is for it to repeatedly send the key when I hold it down (like what happens when I hold it down physically). This doesn't happen here, because when I open Notepad, it doesn't repeat the key.

I even tried simulating scancodes to see if it has an effect, but to no avail.

#include <windows.h>
#define VK_W 0x57

int main()
{
    keybd_event(0,
                 MapVirtualKey(VK_W, MAPVK_VK_TO_VSC),
                 KEYEVENTF_SCANCODE | 0,
                 0);
    Sleep(3000);
    keybd_event(0,
                 MapVirtualKey(VK_W, MAPVK_VK_TO_VSC),
                 KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP,
                 0);
}

How do I simulate holding the key so that it behaves the same way as when I hold it down physically?