问:
ESLint: Failed to load config "next/babel"
I'm facing this problem deploying my site on vercel from my Github repo.

Here is my complete vercel log file.

[22:42:45.867] Cloning github.com/hammadsohail/ecommerce_sanity_stripe
(Branch: main, Commit: e24ccfc) [22:42:46.012] Previous build cache
not available [22:42:46.658] Cloning completed: 790.981ms
[22:42:46.946] Running "vercel build" [22:42:47.589] Vercel CLI 28.9.0
[22:42:47.997] Running "install" command: npm install --legacy-peer-deps... [22:43:00.681]  [22:43:00.681] added 331 packages, and audited 332 packages in 12s [22:43:00.681]
[22:43:00.681] 82 packages are looking for funding [22:43:00.682]

run npm fund for details [22:43:00.683]  [22:43:00.683] found 0
vulnerabilities [22:43:00.708] Detected Next.js version: 13.0.6
[22:43:00.713] Detected package-lock.json generated by npm 7+...
[22:43:00.714] Running "npm run build" [22:43:01.111]  [22:43:01.111]
ecommerce@0.1.0 build [22:43:01.111] > next build [22:43:01.111]  [22:43:01.480] info  - Loaded env from /vercel/path0/.env
[22:43:01.665] Attention: Next.js now collects completely anonymous
telemetry regarding usage. [22:43:01.666] This information is used to
shape Next.js' roadmap and prioritize features. [22:43:01.667] You can
learn more, including how to opt-out if you'd not like to participate
in this anonymous program, by visiting the following URL:
[22:43:01.668] https://nextjs.org/telemetry [22:43:01.668]
[22:43:01.956] info  - Linting and checking validity of types...
[22:43:02.455] error - ESLint: Failed to load config "next/babel" to
extend from. Referenced from: /vercel/path0/.eslintrc.json
[22:43:02.463] info  - Creating an optimized production build...
[22:43:02.518] info  - Disabled SWC as replacement for Babel because
of custom Babel configuration ".babelrc"
https://nextjs.org/docs/messages/swc-disabled [22:43:03.248] info  -
Using external babel configuration from /vercel/path0/.babelrc
[22:43:08.424] Failed to compile. [22:43:08.424]  [22:43:08.424]
./components/Navbar.jsx [22:43:08.425] Module not found: Can't resolve
'next/Link' in '/vercel/path0/components' [22:43:08.425]
[22:43:08.425] Import trace for requested module: [22:43:08.425]
./components/Navbar.jsx [22:43:08.425] ./components/index.js
[22:43:08.425]  [22:43:08.426] ./lib/client.js [22:43:08.426] Module
not found: Can't resolve '@sanity/Client' in '/vercel/path0/lib'
[22:43:08.426]  [22:43:08.426] Import trace for requested module:
[22:43:08.426] ./lib/client.js [22:43:08.426]  [22:43:08.426]
[22:43:08.426] > Build failed because of webpack errors [22:43:08.465]
Error: Command "npm run build" exited with 1

Also in my Vscode its giving me

error:error - ESLint: Failed to load config "next/babel" to extend
from. Referenced from: C:\Users\hammad
sohail\Desktop\ecommerce\Ecommerce.eslintrc.json

My packages.json:

```<code>{
  "name": "ecommerce",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@babel/core": "^7.17.9",
    "@sanity/client": "^3.2.0",
    "@sanity/image-url": "^1.0.1",
    "@stripe/stripe-js": "^1.25.0",
    "canvas-confetti": "^1.5.1",
    "next": "12.1.0",
    "next-sanity-image": "^3.2.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-hot-toast": "^2.2.0",
    "react-icons": "^4.3.1",
    "stripe": "^8.209.0"
  },
  "devDependencies": {
    "@babel/preset-react": "^7.18.6",
    "eslint": "8.13.0",
    "eslint-config-next": "12.1.4",
     "next": "13.0.6"
  }
}
</code>```

My .eslintrc:

```<code>  "extends":["next/babel","next/core-web-vitals"]
</code>```

I am trying to deploy my site on vercel. Anyone has this similar issue?

Body:
I'm facing this problem deploying my site on vercel from my Github repo.

Here is my complete vercel log file.

[22:42:45.867] Cloning github.com/hammadsohail/ecommerce_sanity_stripe
(Branch: main, Commit: e24ccfc) [22:42:46.012] Previous build cache
not available [22:42:46.658] Cloning completed: 790.981ms
[22:42:46.946] Running "vercel build" [22:42:47.589] Vercel CLI 28.9.0
[22:42:47.997] Running "install" command: npm install --legacy-peer-deps... [22:43:00.681]  [22:43:00.681] added 331 packages, and audited 332 packages in 12s [22:43:00.681]
[22:43:00.681] 82 packages are looking for funding [22:43:00.682]

run npm fund for details [22:43:00.683]  [22:43:00.683] found 0
vulnerabilities [22:43:00.708] Detected Next.js version: 13.0.6
[22:43:00.713] Detected package-lock.json generated by npm 7+...
[22:43:00.714] Running "npm run build" [22:43:01.111]  [22:43:01.111]
ecommerce@0.1.0 build [22:43:01.111] > next build [22:43:01.111]  [22:43:01.480] info  - Loaded env from /vercel/path0/.env
[22:43:01.665] Attention: Next.js now collects completely anonymous
telemetry regarding usage. [22:43:01.666] This information is used to
shape Next.js' roadmap and prioritize features. [22:43:01.667] You can
learn more, including how to opt-out if you'd not like to participate
in this anonymous program, by visiting the following URL:
[22:43:01.668] https://nextjs.org/telemetry [22:43:01.668]
[22:43:01.956] info  - Linting and checking validity of types...
[22:43:02.455] error - ESLint: Failed to load config "next/babel" to
extend from. Referenced from: /vercel/path0/.eslintrc.json
[22:43:02.463] info  - Creating an optimized production build...
[22:43:02.518] info  - Disabled SWC as replacement for Babel because
of custom Babel configuration ".babelrc"
https://nextjs.org/docs/messages/swc-disabled [22:43:03.248] info  -
Using external babel configuration from /vercel/path0/.babelrc
[22:43:08.424] Failed to compile. [22:43:08.424]  [22:43:08.424]
./components/Navbar.jsx [22:43:08.425] Module not found: Can't resolve
'next/Link' in '/vercel/path0/components' [22:43:08.425]
[22:43:08.425] Import trace for requested module: [22:43:08.425]
./components/Navbar.jsx [22:43:08.425] ./components/index.js
[22:43:08.425]  [22:43:08.426] ./lib/client.js [22:43:08.426] Module
not found: Can't resolve '@sanity/Client' in '/vercel/path0/lib'
[22:43:08.426]  [22:43:08.426] Import trace for requested module:
[22:43:08.426] ./lib/client.js [22:43:08.426]  [22:43:08.426]
[22:43:08.426] > Build failed because of webpack errors [22:43:08.465]
Error: Command "npm run build" exited with 1

Also in my Vscode its giving me

error:error - ESLint: Failed to load config "next/babel" to extend
from. Referenced from: C:\Users\hammad
sohail\Desktop\ecommerce\Ecommerce.eslintrc.json

My packages.json:

{
  "name": "ecommerce",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@babel/core": "^7.17.9",
    "@sanity/client": "^3.2.0",
    "@sanity/image-url": "^1.0.1",
    "@stripe/stripe-js": "^1.25.0",
    "canvas-confetti": "^1.5.1",
    "next": "12.1.0",
    "next-sanity-image": "^3.2.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-hot-toast": "^2.2.0",
    "react-icons": "^4.3.1",
    "stripe": "^8.209.0"
  },
  "devDependencies": {
    "@babel/preset-react": "^7.18.6",
    "eslint": "8.13.0",
    "eslint-config-next": "12.1.4",
     "next": "13.0.6"
  }
}

My .eslintrc:

  "extends":["next/babel","next/core-web-vitals"]

I am trying to deploy my site on vercel. Anyone has this similar issue?


来源: stackexchange

问:
Spring boot application can not connect to postgres in docker
When i try to connect my spring boot application to postgres i have an erro org.postgresql.util.PSQLException: Connection to postgres:5433 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. What is my mistake? Thanks!

docker-compose.yml
`

```<code>version: '2'

services:
  app:
    image: 'docker-spring-boot-postgres:latest'
    build:
      context: .
    container_name: app
    depends_on:
      - postgres
    environment:
      - SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5433/animals
      - SPRING_DATASOURCE_USERNAME=postgres
      - SPRING_DATASOURCE_PASSWORD=s
      - SPRING_JPA_HIBERNATE_DDL_AUTO=update

  postgres:
    image: postgres:latest
    container_name: postgres
    environment:
      POSTGRES_DB: animals
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: darsmeved
    ports:
      - '5433:5432'
    restart: always

</code>```

`

ContentLicense: CC BY-SA 4.0

Body:
When i try to connect my spring boot application to postgres i have an erro org.postgresql.util.PSQLException: Connection to postgres:5433 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. What is my mistake? Thanks!

docker-compose.yml
`

version: '2'

services:
  app:
    image: 'docker-spring-boot-postgres:latest'
    build:
      context: .
    container_name: app
    depends_on:
      - postgres
    environment:
      - SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5433/animals
      - SPRING_DATASOURCE_USERNAME=postgres
      - SPRING_DATASOURCE_PASSWORD=s
      - SPRING_JPA_HIBERNATE_DDL_AUTO=update

  postgres:
    image: postgres:latest
    container_name: postgres
    environment:
      POSTGRES_DB: animals
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: darsmeved
    ports:
      - '5433:5432'
    restart: always

`


问:
How do I convert day of year data to a date without an error?
I have data in one column that is a day of year stored as an integer (1-365). When I try to use as.Date to convert it to a date, I get an error.

From this code:
df$date <- as.Date(df$day, origin = "2021-01-01")

I get this error:

```<code>`Error in df$day : object of type 'closure' is not subsettable`
</code>```

Body:
I have data in one column that is a day of year stored as an integer (1-365). When I try to use as.Date to convert it to a date, I get an error.

From this code:
df$date <- as.Date(df$day, origin = "2021-01-01")

I get this error:

`Error in df$day : object of type 'closure' is not subsettable`


Title: MapBoxGL - why does it flag my source as invalid geoJSON

Body:
I am trying to dynamically add polygons to a MapboxGL map by passing the coordinates into a funciton.  Should be simple enough, but I'm having a tough time with it.  Why does this work...

            map.addSource('zip_code', {
                'type': 'geojson',
                'data':
                {
                    'type':'Feature',
                    'geometry':
                    {
                        'type': 'Polygon',
                        'coordinates': [[[-94.853056,38.956395],[-94.851164,38.956397],[-94.849007,38.955712],[-94.849826,38.954964],[-94.851949,38.954824],[-94.852459,38.953593],[-94.85233,38.94554],[-94.851999,38.944495],[-94.848298,38.941805],[-94.844247,38.941655],[-94.843825,38.942708],[-94.843982,38.950197],[-94.844067,38.959505],[-94.844526,38.960942],[-94.8436,38.96136],[-94.842219,38.963486],[-94.843687,38.963468],[-94.844052,38.964628],[-94.844389,38.972774],[-94.844171,38.974898],[-94.838256,38.974272],[-94.838265,38.976055],[-94.836484,38.976063],[-94.836478,38.978123],[-94.844112,38.978049],[-94.844088,38.981676],[-94.825422,38.981609],[-94.821139,38.981585],[-94.821069,38.985312],[-94.816327,38.985269],[-94.80934,38.985137],[-94.810772,38.981613],[-94.809256,38.979913],[-94.807271,38.975244],[-94.804835,38.975174],[-94.803266,38.976119],[-94.801335,38.974898],[-94.7977,38.975117],[-94.797298,38.974488],[-94.797313,38.970997],[-94.797375,38.955914],[-94.795936,38.955915],[-94.797378,38.954629],[-94.797477,38.94162],[-94.807256,38.941881],[-94.812495,38.942072],[-94.816146,38.942039],[-94.830418,38.941388],[-94.852979,38.941395],[-94.853353,38.956395],[-94.853056,38.956395]]]
                    }
                }
            });

...but this doesn't with an error of: "Input data given to 'xyz' is not a valid GeoJSON object."

    var data = "[[[-94.853056,38.956395],[-94.851164,38.956397],[-94.849007,38.955712],[-94.849826,38.954964],[-94.851949,38.954824],[-94.852459,38.953593],[-94.85233,38.94554],[-94.851999,38.944495],[-94.848298,38.941805],[-94.844247,38.941655],[-94.843825,38.942708],[-94.843982,38.950197],[-94.844067,38.959505],[-94.844526,38.960942],[-94.8436,38.96136],[-94.842219,38.963486],[-94.843687,38.963468],[-94.844052,38.964628],[-94.844389,38.972774],[-94.844171,38.974898],[-94.838256,38.974272],[-94.838265,38.976055],[-94.836484,38.976063],[-94.836478,38.978123],[-94.844112,38.978049],[-94.844088,38.981676],[-94.825422,38.981609],[-94.821139,38.981585],[-94.821069,38.985312],[-94.816327,38.985269],[-94.80934,38.985137],[-94.810772,38.981613],[-94.809256,38.979913],[-94.807271,38.975244],[-94.804835,38.975174],[-94.803266,38.976119],[-94.801335,38.974898],[-94.7977,38.975117],[-94.797298,38.974488],[-94.797313,38.970997],[-94.797375,38.955914],[-94.795936,38.955915],[-94.797378,38.954629],[-94.797477,38.94162],[-94.807256,38.941881],[-94.812495,38.942072],[-94.816146,38.942039],[-94.830418,38.941388],[-94.852979,38.941395],[-94.853353,38.956395],[-94.853056,38.956395]]]";

            map.addSource('zip_code', {
                'type': 'geojson',
                'data':
                {
                    'type':'Feature',
                    'geometry':
                    {
                        'type': 'Polygon',
                        'coordinates': data
                    }
                }
            });

I have tried about everything to dynamically set that source for a variable with no luck.


问:
Using ref without useRef in React Hooks
I was reading through the React docs and I came across how-can-i-measure-a-dom-node

Now over here the example provided is as follows

```<code>function MeasureExample() {
  const [height, setHeight] = useState(0);

  const measuredRef = useCallback(node => {
    if (node !== null) {
      setHeight(node.getBoundingClientRect().height);
    }
  }, []);

  return (
    <>
      <h1 ref={measuredRef}>Hello, world</h1>
      <h2>The above header is {Math.round(height)}px tall</h2>
    </>
  );
}
</code>```

My Question is

How are we getting the ref value without using the useRef hook aren't we suppose to use the useRef hook when we want the instance of a DOM node ?

So what I mean by getting the ref value by useRef is as follows:

const measuredRef = useRef()
then using it as
Hello, world

If the ref provided in the example code is a reference to a function then shouldn't it be named as handleMeasureRef ?

Also there is statement below the code

We didn’t choose useRef in this example because an object ref doesn’t
notify us about changes to the current ref value.

Why it doesn't notify about the changes is it because it doesn't causes a re-render ?

Does that mean using only ref without useRef notifies about changes ?

Title: Using ref without useRef in React Hooks

Body:
I was reading through the React docs and I came across how-can-i-measure-a-dom-node

Now over here the example provided is as follows

function MeasureExample() {
  const [height, setHeight] = useState(0);

  const measuredRef = useCallback(node => {
    if (node !== null) {
      setHeight(node.getBoundingClientRect().height);
    }
  }, []);

  return (
    <>

Hello, world

The above header is {Math.round(height)}px tall

    </>
  );
}

My Question is

How are we getting the ref value without using the useRef hook aren't we suppose to use the useRef hook when we want the instance of a DOM node ?

So what I mean by getting the ref value by useRef is as follows:

const measuredRef = useRef()
then using it as
Hello, world

If the ref provided in the example code is a reference to a function then shouldn't it be named as handleMeasureRef ?

Also there is statement below the code

We didn’t choose useRef in this example because an object ref doesn’t
notify us about changes to the current ref value.

Why it doesn't notify about the changes is it because it doesn't causes a re-render ?

Does that mean using only ref without useRef notifies about changes ?


问:
Deploying Linkerd with FluxCD fails to reconcile the linkerd-control-plane
I have a repository set up on Github that is linked to my Kubernetes cluster with FluxCD.
I have then written a Kustomization that "should" install LinkerD to my cluster. However here is where things have taken a bad turn... I have followed the documentation for installing LinkerD with helm and successfully managed to install linkerd-crds but when it comes to the linkerd-control-plane the reconciliation gets stuck on InProgress.

My LinkerD kustomization consists of the following files:

apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: HelmRepository
metadata:
  name: linkerd
  namespace: linkerd
spec:
  interval: 2m
  url: https://helm.linkerd.io/stable

```
<pre class="lang-yaml prettyprint-override"><code>kind: Secret
apiVersion: v1
metadata:
  name: linkerd-certs
  namespace: linkerd
data:
  ca.crt: ****
  issuer.crt: ****
  issuer.key: ****

</code>```

apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: linkerd-crds
  namespace: linkerd
spec:
  timeout: 3m
  interval: 10m
  releaseName: linkerd
  targetNamespace: linkerd
  storageNamespace: linkerd
  chart:
    spec:
      chart: linkerd-crds
      version: 1.4.0
      sourceRef:
        kind: HelmRepository
        name: linkerd
        namespace: linkerd
      interval: 40m
  values:
    installNamespace: false
  install:
    crds: CreateReplace
  upgrade:
    crds: CreateReplace
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: linkerd-control-plane
  namespace: linkerd
spec:
  timeout: 3m
  interval: 10m
  releaseName: linkerd
  targetNamespace: linkerd
  storageNamespace: linkerd
  chart:
    spec:
      chart: linkerd-control-plane
      version: 1.9.5
      sourceRef:
        kind: HelmRepository
        name: linkerd
        namespace: linkerd
      interval: 40m
      valuesFiles:
        - values.yaml
        - values-ha.yaml
  valuesFrom:
    - kind: Secret
      name: linkerd-certs
      valuesKey: ca.crt
      targetPath: identityTrustAnchorsPEM
    - kind: Secret
      name: linkerd-certs
      valuesKey: issuer.crt
      targetPath: identity.issuer.tls.crtPEM
    - kind: Secret
      name: linkerd-certs
      valuesKey: issuer.key
      targetPath: identity.issuer.tls.keyPEM
  install:
    crds: CreateReplace
  upgrade:
    crds: CreateReplace

```
<pre class="lang-yaml prettyprint-override"><code>kind: Namespace
apiVersion: v1
metadata:
  name: linkerd
  annotations:
    linkerd.io/inject: disabled
  labels:
    linkerd.io/is-control-plane: "true"
    config.linkerd.io/admission-webhooks: disabled
    linkerd.io/control-plane-ns: linkerd
</code>```

I also found that the helm-controller deployment logs the following error every time it tries to reconcile:

Helm install failed: YAML parse error on
linkerd-control-plane/templates/identity.yaml: error converting YAML
to JSON: yaml: control characters are not allowed

Body:
I have a repository set up on Github that is linked to my Kubernetes cluster with FluxCD.
I have then written a Kustomization that "should" install LinkerD to my cluster. However here is where things have taken a bad turn... I have followed the documentation for installing LinkerD with helm and successfully managed to install linkerd-crds but when it comes to the linkerd-control-plane the reconciliation gets stuck on InProgress.

My LinkerD kustomization consists of the following files:

apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: HelmRepository
metadata:
  name: linkerd
  namespace: linkerd
spec:
  interval: 2m
  url: https://helm.linkerd.io/stable

kind: Secret
apiVersion: v1
metadata:
  name: linkerd-certs
  namespace: linkerd
data:
  ca.crt: ****
  issuer.crt: ****
  issuer.key: ****

apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: linkerd-crds
  namespace: linkerd
spec:
  timeout: 3m
  interval: 10m
  releaseName: linkerd
  targetNamespace: linkerd
  storageNamespace: linkerd
  chart:
    spec:
      chart: linkerd-crds
      version: 1.4.0
      sourceRef:
        kind: HelmRepository
        name: linkerd
        namespace: linkerd
      interval: 40m
  values:
    installNamespace: false
  install:
    crds: CreateReplace
  upgrade:
    crds: CreateReplace
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: linkerd-control-plane
  namespace: linkerd
spec:
  timeout: 3m
  interval: 10m
  releaseName: linkerd
  targetNamespace: linkerd
  storageNamespace: linkerd
  chart:
    spec:
      chart: linkerd-control-plane
      version: 1.9.5
      sourceRef:
        kind: HelmRepository
        name: linkerd
        namespace: linkerd
      interval: 40m
      valuesFiles:
        - values.yaml
        - values-ha.yaml
  valuesFrom:
    - kind: Secret
      name: linkerd-certs
      valuesKey: ca.crt
      targetPath: identityTrustAnchorsPEM
    - kind: Secret
      name: linkerd-certs
      valuesKey: issuer.crt
      targetPath: identity.issuer.tls.crtPEM
    - kind: Secret
      name: linkerd-certs
      valuesKey: issuer.key
      targetPath: identity.issuer.tls.keyPEM
  install:
    crds: CreateReplace
  upgrade:
    crds: CreateReplace

kind: Namespace
apiVersion: v1
metadata:
  name: linkerd
  annotations:
    linkerd.io/inject: disabled
  labels:
    linkerd.io/is-control-plane: "true"
    config.linkerd.io/admission-webhooks: disabled
    linkerd.io/control-plane-ns: linkerd

I also found that the helm-controller deployment logs the following error every time it tries to reconcile:

Helm install failed: YAML parse error on
linkerd-control-plane/templates/identity.yaml: error converting YAML
to JSON: yaml: control characters are not allowed


问:
TOMEE minEvictableIdleTimeMillis not closing the connection to IBM I
I have a web app that runs in a TOMEE 1.7.2 server.  This web app has code to make connection to IBM I server to run RPGLE API / SQL Stored procedure.  When it does that, I see two jobs running on IBM I:

```<code>                    Current
Opt  Subsystem/Job  User        Type  CPU %  Function        Status
      QZDASSINIT   SOMEUSER     PJ       .0                   TIMW
      QZRCSRVS     SOMEUSER     PJ       .0                   TIMW
</code>```

In the context.xml, I set both the minEvictableIdleTimeMillis and the timeBetweenEvictionRunsMillis to 30000 (5 mins).  I was expecting those jobs to go away after 5 to 10 mins of idle time, but they don't.  What am I doing wrong here.  Below is the full data source setting in context.xml

```<code>    <Resource
   name="jdbc/mcbell"
   auth="Application"
   type="javax.sql.DataSource"
   factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
   testWhileIdle="true"
   testOnBorrow="true"
   testOnReturn="false"
   timeBetweenEvictionRunsMillis="300000"
   maxActive="50"
   maxIdle="30"
   maxWait="30000"
   removeAbandonedTimeout="1200"
   removeAbandoned="true"
   logAbandoned="true"
   minEvictableIdleTimeMillis="300000"
   driverClassName="com.ibm.as400.access.AS400JDBCDriver"
   url="jdbc:as400://myIBMi;secure=true;naming=system;errors=full;prompt=false;libraries=*LIBL;timeFormat=iso;dateFormat=iso;dateSeparator=-"
   username=""
   password=""
   validationQuery="select * from sysibm/sysdummy1"
   alternateUsernameAllowed="true"
/>
</code>```

Body:
I have a web app that runs in a TOMEE 1.7.2 server.  This web app has code to make connection to IBM I server to run RPGLE API / SQL Stored procedure.  When it does that, I see two jobs running on IBM I:

                    Current
Opt  Subsystem/Job  User        Type  CPU %  Function        Status
      QZDASSINIT   SOMEUSER     PJ       .0                   TIMW
      QZRCSRVS     SOMEUSER     PJ       .0                   TIMW

In the context.xml, I set both the minEvictableIdleTimeMillis and the timeBetweenEvictionRunsMillis to 30000 (5 mins).  I was expecting those jobs to go away after 5 to 10 mins of idle time, but they don't.  What am I doing wrong here.  Below is the full data source setting in context.xml

    <Resource
   name="jdbc/mcbell"
   auth="Application"
   type="javax.sql.DataSource"
   factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
   testWhileIdle="true"
   testOnBorrow="true"
   testOnReturn="false"
   timeBetweenEvictionRunsMillis="300000"
   maxActive="50"
   maxIdle="30"
   maxWait="30000"
   removeAbandonedTimeout="1200"
   removeAbandoned="true"
   logAbandoned="true"
   minEvictableIdleTimeMillis="300000"
   driverClassName="com.ibm.as400.access.AS400JDBCDriver"
   url="jdbc:as400://myIBMi;secure=true;naming=system;errors=full;prompt=false;libraries=*LIBL;timeFormat=iso;dateFormat=iso;dateSeparator=-"
   username=""
   password=""
   validationQuery="select * from sysibm/sysdummy1"
   alternateUsernameAllowed="true"
/>


问:
Import Data Permission Denied
My permission? isn't working. I have MySQL at home, and it works great, this is at work and just got the default developer version downloaded to my Windows pc. When I try to upload a CSV that was converted from an Excel file, it denies it. GR. I've tried so many things to work around. Please help

enter image description here

```<code>12: 10:35 Restoring C: Lab Roster & Preferences. csv
Running: mysql.exe —host=127.0.O.1 —user=svazquez —port=3306 —default-character-set=utf —comments —
database=sarav < Lab Roster & Preferences.csv•
mysql: Error reading fie '<unopen fd>' (OS errno 13 - Perrnission denied)
Operation faied wifr exitcode 1
12: 10:35 Import of C: usershsfreobaldDocuments\Tech Lab Roster & Preferences.csv has fir-ished 1 errors
</code>```

Here is the pic of my error. I might need access to more of my company's server? But I don't even know what access to ask for.

When I tried to just ImportFile, it told me that the "secure_file_priv" was on, so it couldn't complete the task.

Title: Import Data Permission Denied

Body:
My permission? isn't working. I have MySQL at home, and it works great, this is at work and just got the default developer version downloaded to my Windows pc. When I try to upload a CSV that was converted from an Excel file, it denies it. GR. I've tried so many things to work around. Please help

enter image description here

12: 10:35 Restoring C: Lab Roster & Preferences. csv
Running: mysql.exe —host=127.0.O.1 —user=svazquez —port=3306 —default-character-set=utf —comments —
database=sarav < Lab Roster & Preferences.csv•
mysql: Error reading fie '<unopen fd>' (OS errno 13 - Perrnission denied)
Operation faied wifr exitcode 1
12: 10:35 Import of C: usershsfreobaldDocuments\Tech Lab Roster & Preferences.csv has fir-ished 1 errors

Here is the pic of my error. I might need access to more of my company's server? But I don't even know what access to ask for.

When I tried to just ImportFile, it told me that the "secure_file_priv" was on, so it couldn't complete the task.


问:
Using Next.js Catch All (Spread) Routing to Create Multi-Directory URL Structures
I'm trying to create a multi-directory dynamic URL in Next.js.

A rough example of what I'm trying to accomplish is found here: https://codesandbox.io/s/next-js-forked-5scpgb?file=/page/tools/%5B...path%5D.js.

I'm trying to, for example, create a URL route like 'tools/category-title/tool-slug' based on the seed object provided in the example.

I found the https://nextjs.org/docs/routing/dynamic-routes docs, which notes pages/post/[...slug].js matches /post/a, but also /post/a/b, /post/a/b/c and so on.

However, I've been unsuccessful in trying to get this to work.

Any support would be appreciated!

Code from sandbox repo --

```<code>
import React from "react";

const toolSeed = [
  {
  id: 1,
  slug: "tool-slug",
  category: {
    id: 1,
    title: "category-title",
  }
},
  {
    id: 2,
    slug: "tool-slug-2",
    category: {
      id: 2,
      title: "category-title-2",
    },
  }
]

export async function getStaticPaths() {

  const paths = toolSeed.map((tool) => ({
    params: { slug: `${tool.category.title}/${tool.slug}` }, // href={`/${tool.category}/${tool.slug}`}
  }));

  return {
      paths: paths,
      fallback: false // render 404 if no match
  };
}

export async function getStaticProps({ params }) {

  // filter to get the current tool
  const tool = toolSeed.filter((obj) => obj.slug === params.slug);

  return {
    props: { tool },
    revalidate: 900 // this tells Next.js to re-generate the page every 15 minutes
  };
}

// -----------------------------------------------------------------------
// -----------------------------------------------------------------------

export default function Tool ({ tool }) {
  console.log('tool')

  return (
    <></>
  )
};
</code>```

Body:
I'm trying to create a multi-directory dynamic URL in Next.js.

A rough example of what I'm trying to accomplish is found here: https://codesandbox.io/s/next-js-forked-5scpgb?file=/page/tools/%5B...path%5D.js.

I'm trying to, for example, create a URL route like 'tools/category-title/tool-slug' based on the seed object provided in the example.

I found the https://nextjs.org/docs/routing/dynamic-routes docs, which notes pages/post/[...slug].js matches /post/a, but also /post/a/b, /post/a/b/c and so on.

However, I've been unsuccessful in trying to get this to work.

Any support would be appreciated!

Code from sandbox repo --

import React from "react";

const toolSeed = [
  {
  id: 1,
  slug: "tool-slug",
  category: {
    id: 1,
    title: "category-title",
  }
},
  {
    id: 2,
    slug: "tool-slug-2",
    category: {
      id: 2,
      title: "category-title-2",
    },
  }
]

export async function getStaticPaths() {

  const paths = toolSeed.map((tool) => ({
    params: { slug: `${tool.category.title}/${tool.slug}` }, // href={`/${tool.category}/${tool.slug}`}
  }));

  return {
      paths: paths,
      fallback: false // render 404 if no match
  };
}

export async function getStaticProps({ params }) {

  // filter to get the current tool
  const tool = toolSeed.filter((obj) => obj.slug === params.slug);

  return {
    props: { tool },
    revalidate: 900 // this tells Next.js to re-generate the page every 15 minutes
  };
}

// -----------------------------------------------------------------------
// -----------------------------------------------------------------------

export default function Tool ({ tool }) {
  console.log('tool')

  return (
    <></>
  )
};


问:
Buyer Seller Volume Balance between two Pivots
The following code shows the pivot points with tool tip showing the traded volume between two pivots. Another part of code contains select start date and end date to see the buyer and seller volume in number and in percentage. I want to display the buyer volume and seller volume in between two pivots with percentage. Please help me to correct the code., and display message when both buyer and seller volume equals 50:50.

```like so
``
//@version=5
//https://www.tradingview.com/pine-script-docs/en/v5/concepts/Lines_and_boxes.html#modifying-lines
//Code taken from above url and added DGT Pivot code to filter pivot point code
indicator("Only DGT Pivots", "Only DGT Pivots", true)

//New
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Pivot Points High Low - build-in, slight presentation changes
group_tools        = 'Tool Add-Ons'
group_indicators   = 'Indicator Add-Ons'
tooltip_pvt          = 'The Pivot Points High Low indicator aims to predict and determine price changes and potential reversals in the market'

addons    = input.bool(true, '|----------|  Add-Ons On/Off  |----------|', group='Add-Ons')

msmHOffset = input.int(-23, '  Offset : Horizontal', inline='MSM',  group=group_tools)
msmVOffset = input.int(0, 'Vertical', inline='MSM',  group=group_tools) / 10
atrLength = input.int(14   , '  ATR : Length', inline='ATR', group=group_tools)
atrRange  = input.float(2. , 'Mult', step=.1, inline='ATR', group=group_tools)
prmHOffset = input.int(-13, '  Offset : Horizontal', inline='PRM',  group=group_tools) * ta.change(time)
prmVOffset = input.int(-7, 'Vertical', inline='PRM',  group=group_tools) / 10
//isLabel   = input.bool(true, 'Statistical Panel', inline='STAT', group=group_tools, tooltip=tooltip_panel)
//pLabel    = input.int(0    , '', inline='STAT', group=group_tools)
i_textSize = input.string('Small', '', options=['Tiny', 'Small', 'Normal', 'Large'], inline='STAT', group=group_tools)
statPos   = input.string('Top Right', '', options=['Top Left', 'Top Center', 'Top Right', 'Middle Right', 'Bottom Left', 'Bottom Center'], inline='STAT', group=group_tools)

dispPVT   = input.bool(true , 'Pivot Points High Low  ------------------|', group=group_indicators, tooltip=tooltip_pvt)
pvtLength = input.int(20, "  Pivot Points High Low : Left/Right Length", minval=1, group=group_indicators)
pvtPrice  = input(true, "Pivot Points High Low : Display Pivot High/Low Price", group=group_indicators)
pvtChange = input(true, "Pivot Points High Low : Display Pivot High/Low Price Change", group=group_indicators)
pvtVolume = input(true, "Pivot Points High Low : Display Cumulative Volume", group=group_indicators)
pvtText   = input.string('Small', "  Pivot Points High Low : Text Size", options=['Tiny', 'Small', 'Normal'], group=group_indicators)
pvtTextSize = pvtText == 'Small' ? size.small : pvtText == 'Normal' ? size.normal : size.tiny
vwcbLen   = input.int(21     , '  VWCB : Volume MA Length', minval=1, group=group_indicators)
vwcbUpper = input.float(1.618, '  VWCB : Upper Theshold', minval=0.1, step=.1, group=group_indicators)
vwcbLower = input.float(.618 , '  VWCB : Lower Theshold', minval=0.1, step=.1, group=group_indicators)

tooltip_vwap         = 'Volume Weighted Average Price (VWAP) is a technical analysis tool used to measure the average price weighted by volume. VWAP is typically used with intraday charts as a way to determine the general direction of intraday prices. It\'s similar to a moving average in that when price is above VWAP, prices are rising and when price is below VWAP, prices are falling. VWAP is primarily used by technical analysts to identify market trend'
vwapPlot   = input.bool(true, 'Volume Weighted Average Price (VWAP)  -------|', group=group_indicators, tooltip=tooltip_vwap)
//hideonDWM  = input.bool(false, title='⮩ VWAP : Hide VWAP on 1D or Above', group=group_indicators)
//var anchor = input.string(defval='Session', title='  ⮩ VWAP : Anchor Period', options=['Session', 'Week', 'Month', 'Quarter', 'Year', 'Decade', 'Century'], group=group_indicators)
src        = input.source(title='  VWAP : Source', defval=hlc3, group=group_indicators)
offset     = input.int(0, title='  VWAP : Offset', group=group_indicators)

pll = input.int(987, 'Indicator and Historical Pivots', group='Ploting Length')

pvtHigh           = ta.pivothigh(pvtLength, pvtLength)
pvtLow            = ta.pivotlow (pvtLength, pvtLength)
proceed           = not na(pvtHigh) or not na(pvtLow)
//pvtLength = input.int(20, "  Pivot Points High Low : Left/Right Length", minval=1, group=group_indicators)

pvtLengthTemp     = 1
pvtHighTemp       = ta.pivothigh(pvtLengthTemp, pvtLengthTemp)
pvtLowTemp        = ta.pivotlow (pvtLengthTemp, pvtLengthTemp)
proceedTemp       = not na(pvtHighTemp) or not na(pvtLowTemp)

var x1            = 0
var x2            = 0
var x2Temp        = 0

var pvtHigh1      = 0.
var pvtLow1       = 0.
var pvtHigh1Temp  = 0.
var pvtLow1Temp   = 0.

//var pvtLast       = ''

if proceed
    x1 := x2
    x2 := bar_index

if proceedTemp
    x2Temp := bar_index

profileLength = x2 - x1
profileLengthTemp = x2Temp - pvtLengthTemp - x2 + pvtLength

//------------------------------------------------------------------------------
//f_get Tradevolume Erro
//------------------------------------------------------------------------------
// line/label/alert functions

f_drawLineX(_x1, _y1, _x2, _y2, _xloc, _extend, _color, _style, _width) =>
    var id = line.new(_x1, _y1, _x2, _y2, _xloc, _extend, _color, _style, _width)

    if _y1 > 0 and _y2 > 0
        line.set_xy1(id, _x1, _y1)
        line.set_xy2(id, _x2, _y2)
        line.set_color(id, _color)
    else
        line.set_xy1(id, _x1, close)
        line.set_xy2(id, _x2, close)
        line.set_color(id, #ffffff00)

f_drawOnlyLabelX(_x, _y, _text, _xloc, _yloc, _color, _style, _textcolor, _size, _textalign, _tooltip) =>
    label.new(_x, _y, _text, _xloc, _yloc, _color, _style, _textcolor, _size, _textalign, _tooltip)

f_drawLabelX(_x, _y, _text, _xloc, _yloc, _color, _style, _textcolor, _size, _textalign, _tooltip) =>
    var id = label.new(_x, _y, _text, _xloc, _yloc, _color, _style, _textcolor, _size, _textalign, _tooltip)
    label.set_text(id, _text)
    label.set_tooltip(id, _tooltip)

    if _y > 0
        label.set_xy(id, _x, _y)
        label.set_textcolor(id, _textcolor)
    else
        label.set_xy(id, _x, close)
        label.set_textcolor(id, #00000000)

f_crossingLevelX(_price, _level) =>
    (_level > _price and _level < _price[1]) or (_level < _price and _level > _price[1])

f_processPivotLevelX(_show, _x1, _y, _x2, _c, _s, _w, _lb, pivot, _levels, _pos) =>
    if _show
        f_drawLineX(_x1, _y, _x2, _y, xloc.bar_time, extend.none, _c, _s, _w)

        if _levels != 'None' and _lb != ''
            f_drawLabelX(_pos == 'Last Bar' ? timenow : _x2, _y, (_levels == 'Levels' ? _lb : _lb + ' (' + str.tostring(_y, format.mintick) + ')') + (_pos == 'Last Bar' ? '\n\n' : ''), xloc.bar_time, yloc.price, #00000000, label.style_label_left, _c, size.normal, text.align_left, pivot + ' ' + _lb + ' (' + str.tostring(_y, format.mintick) + ')')

    if f_crossingLevelX(close, _y) and _show
        alert(pivot + ' (PVTvX) : ' + syminfo.ticker + ' crossing ' + pivot + ' level ' + _lb + ' level, price ' + str.tostring(_y, format.mintick))

f_getStyle(_style) =>
    _style == 'Solid' ? line.style_solid : _style == 'Dotted' ? line.style_dotted : line.style_dashed

f_getTradedVolume(_len, _calc, _offset) =>
    if _calc
        vol   = 0.
        for x = 0 to _len - 1
            vol += volume[_offset + x]
        vol
//f_get tradevolume erro end
//------------------------------------------------------------------------------
// Volume Weighted Colored Bars by Kıvanç ÖZBİLGİÇ
nzVolume = nz(volume)
volMA = ta.sma(nzVolume, vwcbLen)

B = nzVolume * (close - low) / (high - low)
S = nzVolume * (high - close) / (high - low)

//------------------------------------------------------------------------------
// Pivot Points High Low

var label tempHigh = na
var label tempLow  = na
//pvtLength = input.int(20, "  Pivot Points High Low : Left/Right Length", minval=1, group=group_indicators)
//dispPVT   = input.bool(true , 'Pivot Points High Low  ------------------|', group=group_indicators, tooltip=tooltip_pvt)
if addons and dispPVT
    if not na(pvtHigh)
        tradedVolume = f_getTradedVolume(profileLength, proceed, pvtLength)
        f_drawOnlyLabelX(bar_index[pvtLength], pvtHigh, (pvtPrice ? str.tostring(pvtHigh, format.mintick) :  '') + (pvtChange ? (pvtPrice ? ' ↑ %' : '↑ %') + str.tostring((pvtHigh - pvtLow1) * 100 / pvtLow1 , '#.##') : '') + (pvtVolume and  nzVolume ? (pvtPrice or pvtChange ? '\n' : '') + str.tostring(tradedVolume, format.volume) : ''), xloc.bar_index, yloc.price, chart.fg_color, label.style_label_down, chart.bg_color, (not pvtPrice and not pvtChange and not pvtVolume ? size.tiny : pvtTextSize), text.align_center, 'Pivot High : ' + str.tostring(pvtHigh, format.mintick) + '\n -Price Change : ↑ %' + str.tostring((pvtHigh - pvtLow1) * 100 / pvtLow1 , '#.##') + (nzVolume ? '\n -Traded Volume : ' + str.tostring(tradedVolume, format.volume)  + ' (' + str.tostring(profileLength - 1) + ' bars)\n  *Average Volume/Bar : ' + str.tostring(tradedVolume / (profileLength - 1), format.volume) : '') + '\n\nNumber of bars : ' + str.tostring(profileLength) )
        pvtHigh1 := pvtHigh
        //pvtLast  := 'H'
        label.delete(tempHigh[1])
        if x2 - pvtLength > x2Temp - pvtLengthTemp
            label.delete(tempLow[1])

    if not na(pvtLow)
        tradedVolume = f_getTradedVolume(profileLength, proceed, pvtLength)
        f_drawOnlyLabelX(bar_index[pvtLength], pvtLow , (pvtPrice ? str.tostring(pvtLow , format.mintick) :  '') + (pvtChange ? (pvtPrice ? ' ↓ %' : '↓ %') + str.tostring((pvtHigh1 - pvtLow) * 100 / pvtHigh1, '#.##') : '') + (pvtVolume and  nzVolume ? (pvtPrice or pvtChange ? '\n' : '') + str.tostring(tradedVolume, format.volume) : ''), xloc.bar_index, yloc.price, chart.fg_color, label.style_label_up  , chart.bg_color, (not pvtPrice and not pvtChange and not pvtVolume ? size.tiny : pvtTextSize), text.align_center, 'Pivot Low : '  + str.tostring(pvtLow , format.mintick) + '\n -Price Change : ↓ %' + str.tostring((pvtHigh1 - pvtLow) * 100 / pvtHigh1, '#.##') + (nzVolume ? '\n -Traded Volume : ' + str.tostring(tradedVolume, format.volume) + ' (' + str.tostring(profileLength - 1) + ' bars)\n  *Average Volume/Bar : ' + str.tostring(tradedVolume / (profileLength - 1), format.volume) : '') + '\n\nNumber of bars : ' + str.tostring(profileLength) )
        pvtLow1  := pvtLow
        //pvtLast  := 'L'
        label.delete(tempLow[1])
        if x2 - pvtLength > x2Temp - pvtLengthTemp// ???
            label.delete(tempHigh[1])

    if not na(pvtHighTemp) //and pvtLast  == 'L'
        if pvtHighTemp > pvtHigh1Temp// or pvtHighTemp > pvtHigh1
            label.delete(tempHigh[1])
            tradedVolume = f_getTradedVolume(profileLengthTemp, proceedTemp, pvtLengthTemp)
            tempHigh := label.new(bar_index[pvtLengthTemp], pvtHighTemp, '* ' + (pvtPrice ? str.tostring(pvtHighTemp, format.mintick) :  '') + (pvtChange ? (pvtPrice ? ' ↑ %' : '↑ %') + str.tostring((pvtHighTemp - pvtLow1) * 100 / pvtLow1 , '#.##') : '') + (pvtVolume and  nzVolume ? (pvtPrice or pvtChange ? '\n' : '') + str.tostring(tradedVolume, format.volume) : ''), xloc.bar_index, yloc.price, #284aa9, label.style_label_down, color.white, (not pvtPrice and not pvtChange and not pvtVolume ? size.tiny : pvtTextSize), text.align_center, 'Temporary Pivot High : ' + str.tostring(pvtHighTemp, format.mintick) + '\n -Price Change : ↑ %' + str.tostring((pvtHighTemp - pvtLow1) * 100 / pvtLow1 , '#.##') + (nzVolume ? '\n -Traded Volume : ' + str.tostring(tradedVolume, format.volume)  + ' (' + str.tostring(profileLengthTemp - 1) + ' bars)\n  *Average Volume/Bar : ' + str.tostring(tradedVolume / (profileLengthTemp - 1), format.volume) : '') + '\n\nNumber of bars\n since last confirmed Pivot High/Low : ' + str.tostring(profileLengthTemp) + '\n\nWarning : subject to repaint, not a confirmed Pivot Level or Signal' )
        pvtHigh1Temp := pvtHighTemp

    if high > pvtHigh1Temp
        label.delete(tempHigh[1])

    if not na(pvtLowTemp) //and pvtLast  == 'H'
        if pvtLowTemp < pvtLow1Temp// or pvtLowTemp < pvtLow1
            tradedVolume = f_getTradedVolume(profileLengthTemp, proceedTemp, pvtLengthTemp)
            label.delete(tempLow[1])
            tempLow := label.new(bar_index[pvtLengthTemp], pvtLowTemp, '* ' + (pvtPrice ? str.tostring(pvtLowTemp, format.mintick) :  '') + (pvtChange ? (pvtPrice ? ' ↓ %' : '↓ %') + str.tostring((pvtHigh1 - pvtLowTemp) * 100 / pvtLowTemp , '#.##') : '') + (pvtVolume and  nzVolume ? (pvtPrice or pvtChange ? '\n' : '') + str.tostring(tradedVolume, format.volume) : ''), xloc.bar_index, yloc.price, #284aa9, label.style_label_up, color.white, (not pvtPrice and not pvtChange and not pvtVolume ? size.tiny : pvtTextSize), text.align_center, 'Temporary Pivot Low : ' + str.tostring(pvtLowTemp, format.mintick) + '\n -Price Change : ↓ %' + str.tostring((pvtHigh1 - pvtLowTemp) * 100 / pvtHigh1 , '#.##') + (nzVolume ? '\n -Traded Volume : ' + str.tostring(tradedVolume, format.volume)  + ' (' + str.tostring(profileLengthTemp - 1) + ' bars)\n  *Average Volume/Bar : ' + str.tostring(tradedVolume / (profileLengthTemp - 1), format.volume) : '') + '\n\nNumber of bars\n since last confirmed Pivot High/Low : ' + str.tostring(profileLengthTemp) + '\n\nWarning : subject to repaint, not a confirmed Pivot Level or Signal')
        pvtLow1Temp  := pvtLowTemp

    if low < pvtLow1Temp
        label.delete(tempLow[1])

//*******Start Buying Selling Volume v3 ceevee12312

// Inputs

onlyIntraday = input.bool(true, title='Only show intraday', tooltip='Checking this will make the table disappear on timeframes >= 1D')
showYesterday = input.bool(false, title='Show yesterday\'s volume')
showAvg = input.bool(false, title='Show average')
avgPeriod = input.int(30, title='Average period', minval=0, tooltip='Number of days to consider for average volume')

textColor = input.color(color.white, title='Text Color')
backColor = input.color(color.black, title='Table Color')
//colour customization
BVol = input(title=' BVol Text color', defval=#177245)
//BVol = input(title=' BVol Text color', defval=#ecf018)
SVol = input(title=' SVol Text color', defval=#8B0000)
//SVol = input(title=' SVol Text color', defval=#d6d6d2)
TVol = input(title=' TVol Text color', defval=#FF8C00)
//TVol = input(title=' TVol Text color', defval=#e29aed)

// BUYING VOLUME AND SELLING VOLUME //
BV = high == low ? 0 : volume * (close - low) / (high - low)
SV = high == low ? 0 : volume * (high - close) / (high - low)

DayBuyVolumePercent = 100 * BV / (BV + SV)
DaySellVolumePercent = 100 * SV / (BV + SV)

vi = input(false, title='Volume Index')

vol = volume > 0 ? volume : 1

TP = BV + SV
// RAW Pressure Volume Calculations
BPV = BV / TP * vol
SPV = SV / TP * vol
TPV = BPV + SPV

// Karthik Marar's Pressure Volume Normalized Version (XeL-MOD.)
VN = vol / ta.ema(vol, 20)
BPN = BV / ta.ema(BV, 20) * VN * 100
SPN = SV / ta.ema(SV, 20) * VN * 100
TPN = BPN + SPN

// Conditional Selectors for RAW/Norm
BPc1 = BPV > SPV ? BPV : -math.abs(BPV)
BPc2 = BPN > SPN ? BPN : -math.abs(BPN)
SPc1 = SPV > BPV ? SPV : -math.abs(SPV)
SPc2 = SPN > BPN ? SPN : -math.abs(SPN)
BPcon = vi ? BPc2 : BPc1
SPcon = vi ? SPc2 : SPc1

////////////////////////////////////////////////////////////
// Functions

nocolor=color.new(color.white, transp=100)

f_rows(I) =>
    O = true ? 1 : 0

////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// Calculations

rowNum = 1 + f_rows(showYesterday) + f_rows(showAvg)

var table dvDisplay = table.new(position=position.top_right, columns=1, rows=rowNum)

dVol = request.security(syminfo.tickerid, timeframe='D', expression=str.tostring(volume, format.volume))
ydVol = request.security(syminfo.tickerid, timeframe='D', expression=str.tostring(volume[1], format.volume))
avgVol = request.security(syminfo.tickerid, timeframe='D', expression=str.tostring(ta.sma(volume, avgPeriod)[1], format.volume))

// Calculations

i_startTime = input.time(defval=timestamp('01 DEC 2022 03:45 +0000'), title='Start Time')
i_endTime = input.time(defval=timestamp('10 Dec 2022 09:45 +0000'), title='End Time')
timeCond = time >= i_startTime and time < i_endTime
isPeriod = timeCond

var buyvol = 0.0
var sellvol = 0.0
var candle = 0

if isPeriod
    buyvol += math.abs(nz(BPcon, 0))
    sellvol += math.abs(nz(SPcon, 0))
    candle += 1
    candle

string i_positionr = position.top_center

SwingBuyVolumePercent=100*buyvol/(buyvol+sellvol)
SwingSellVolumePercent=100*sellvol/(buyvol+sellvol)

//string i_positionr = position.top_right

var tblr = table.new(i_positionr, 19, 141, frame_color=#151715, frame_width=1, border_width=2, border_color=color.new(color.white, 100))

if barstate.islast
    table.cell(tblr, 0, 1, 'Buy Volume', text_halign=text.align_center, bgcolor=color.green, text_color=color.white, text_size=size.small)
    table.cell(tblr, 1, 1, 'Sell Volume', text_halign=text.align_center, bgcolor=color.red, text_color=color.white, text_size=size.small)

    table.cell(tblr, 0, 2, str.tostring(buyvol, format.volume), text_halign=text.align_center, bgcolor=color.green, text_color=color.white, text_size=size.small)
    table.cell(tblr, 1, 2, str.tostring(sellvol, format.volume), text_halign=text.align_center, bgcolor=color.red, text_color=color.white, text_size=size.small)

//*******End Buying Selling Volume v3 ceevee12312

//Placing two tables
string i_positioner = position.top_right
var twotable = table.new(i_positionr, 48, 159,frame_color=#151715, frame_width=0, border_width=2, border_color=color.new(color.white, 100))
//var table twotable = table.new(position.bottom_center,columns=1, rows=2)

if barstate.islast
   // table.cell(twotable, 0, 10, 'BVol→ ' + f_get_volume_string(BuyVol) + '(' + f_get_volume_string(BuyVolumePercent) + '%' + ')', text_color=BVol, bgcolor=color.new(#00FF00, 100))
    //table.cell(twotable, 0, 20, 'ydVol→ ' + f_get_volume_string(BuyVol) + '(' + f_get_volume_string(BuyVolumePercent) + '%' + ')', text_color=BVol, bgcolor=color.new(#00FF00, 100))
    table.cell(twotable, 1, 40, 'ToDay Vol: ' + dVol, text_halign=text.align_center, bgcolor=color.black, text_color=color.white)
    table.cell(twotable, 1, 50, 'Yesterday: ' + ydVol, text_halign=text.align_center, bgcolor=color.black, text_color=color.white)
    table.cell(twotable, 1, 60, 'Avg Vol: ' + avgVol, text_halign=text.align_center, bgcolor=color.black, text_color=color.white)
    table.cell(twotable, 0, 70, "SwingBuy Vol", text_halign=text.align_center, bgcolor=color.rgb(7, 165, 42), text_color=color.white, text_size=size.small)
    //table.cell(twotable, Here value 30 moves Buy Vol text to x axis 30 pixels, creating blank space.When it is 0 then x axis start from no space)
    //Say if Buy Vol is 0, 15 then 0 column and 15 rows down. So text won't struck in top row.
    table.cell(twotable, 0, 71, str.tostring(buyvol, format.volume), text_halign=text.align_center, bgcolor=color.rgb(7, 165, 42), text_color=color.white, text_size=size.small)
    // 0, 71 means 0 th column and 71 row

    table.cell(twotable, 1, 70, "SwingSell Vol", text_halign=text.align_center, bgcolor=color.red, text_color=color.white, text_size=size.small)
    table.cell(twotable, 1, 71, str.tostring(sellvol, format.volume), text_halign=text.align_center, bgcolor=color.red, text_color=color.white, text_size=size.small)
   // table.cell(twotable, 0, 72, 'DBuy Perc', text_halign = text.align_center, bgcolor = color.black, text_color = color.white, text_size = size.small)
    //table.cell(twotable, 0, 73, str.tostring(DayBuyVolumePercent,format.volume ) ,   text_halign = text.align_center, bgcolor = color.black, text_color = color.white, text_size = size.small)
    //table.cell(twotable, 2, 72, 'DSell Perc', text_halign = text.align_center, bgcolor = color.black, text_color = color.white, text_size = size.small)
    //table.cell(twotable, 2, 73, str.tostring(DaySellVolumePercent,format.volume ) ,   text_halign = text.align_center, bgcolor = color.black, text_color = color.white, text_size = size.small)

//Display Swing Percentges:
    table.cell(twotable, 1, 74, 'SwingBuy Perc', text_halign = text.align_center, bgcolor = color.black, text_color = color.white, text_size = size.small)
    table.cell(twotable, 2, 74, str.tostring(SwingBuyVolumePercent,format.volume ) ,   text_halign = text.align_center, bgcolor = color.black, text_color = color.white, text_size = size.small)
    table.cell(twotable, 1, 75, 'SwingSell Perc', text_halign = text.align_center, bgcolor = color.black, text_color = color.white, text_size = size.small)
    table.cell(twotable, 2, 75, str.tostring(SwingSellVolumePercent,format.volume ) ,   text_halign = text.align_center, bgcolor = color.black, text_color = color.white, text_size = size.small)
//***********End Daily Volume

//------------------------------------------------------------------------------
//End

`like so`

```

Body:
The following code shows the pivot points with tool tip showing the traded volume between two pivots. Another part of code contains select start date and end date to see the buyer and seller volume in number and in percentage. I want to display the buyer volume and seller volume in between two pivots with percentage. Please help me to correct the code., and display message when both buyer and seller volume equals 50:50.

like so
``
//@version=5
//https://www.tradingview.com/pine-script-docs/en/v5/concepts/Lines_and_boxes.html#modifying-lines
//Code taken from above url and added DGT Pivot code to filter pivot point code
indicator("Only DGT Pivots", "Only DGT Pivots", true)

//New
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Pivot Points High Low - build-in, slight presentation changes
group_tools        = 'Tool Add-Ons'
group_indicators   = 'Indicator Add-Ons'
tooltip_pvt          = 'The Pivot Points High Low indicator aims to predict and determine price changes and potential reversals in the market'

addons    = input.bool(true, '|----------|  Add-Ons On/Off  |----------|', group='Add-Ons')

msmHOffset = input.int(-23, '  Offset : Horizontal', inline='MSM',  group=group_tools)
msmVOffset = input.int(0, 'Vertical', inline='MSM',  group=group_tools) / 10
atrLength = input.int(14   , '  ATR : Length', inline='ATR', group=group_tools)
atrRange  = input.float(2. , 'Mult', step=.1, inline='ATR', group=group_tools)
prmHOffset = input.int(-13, '  Offset : Horizontal', inline='PRM',  group=group_tools) * ta.change(time)
prmVOffset = input.int(-7, 'Vertical', inline='PRM',  group=group_tools) / 10
//isLabel   = input.bool(true, 'Statistical Panel', inline='STAT', group=group_tools, tooltip=tooltip_panel)
//pLabel    = input.int(0    , '', inline='STAT', group=group_tools)
i_textSize = input.string('Small', '', options=['Tiny', 'Small', 'Normal', 'Large'], inline='STAT', group=group_tools)
statPos   = input.string('Top Right', '', options=['Top Left', 'Top Center', 'Top Right', 'Middle Right', 'Bottom Left', 'Bottom Center'], inline='STAT', group=group_tools)

dispPVT   = input.bool(true , 'Pivot Points High Low  ------------------|', group=group_indicators, tooltip=tooltip_pvt)
pvtLength = input.int(20, "  Pivot Points High Low : Left/Right Length", minval=1, group=group_indicators)
pvtPrice  = input(true, "Pivot Points High Low : Display Pivot High/Low Price", group=group_indicators)
pvtChange = input(true, "Pivot Points High Low : Display Pivot High/Low Price Change", group=group_indicators)
pvtVolume = input(true, "Pivot Points High Low : Display Cumulative Volume", group=group_indicators)
pvtText   = input.string('Small', "  Pivot Points High Low : Text Size", options=['Tiny', 'Small', 'Normal'], group=group_indicators)
pvtTextSize = pvtText == 'Small' ? size.small : pvtText == 'Normal' ? size.normal : size.tiny
vwcbLen   = input.int(21     , '  VWCB : Volume MA Length', minval=1, group=group_indicators)
vwcbUpper = input.float(1.618, '  VWCB : Upper Theshold', minval=0.1, step=.1, group=group_indicators)
vwcbLower = input.float(.618 , '  VWCB : Lower Theshold', minval=0.1, step=.1, group=group_indicators)

tooltip_vwap         = 'Volume Weighted Average Price (VWAP) is a technical analysis tool used to measure the average price weighted by volume. VWAP is typically used with intraday charts as a way to determine the general direction of intraday prices. It\'s similar to a moving average in that when price is above VWAP, prices are rising and when price is below VWAP, prices are falling. VWAP is primarily used by technical analysts to identify market trend'
vwapPlot   = input.bool(true, 'Volume Weighted Average Price (VWAP)  -------|', group=group_indicators, tooltip=tooltip_vwap)
//hideonDWM  = input.bool(false, title='⮩ VWAP : Hide VWAP on 1D or Above', group=group_indicators)
//var anchor = input.string(defval='Session', title='  ⮩ VWAP : Anchor Period', options=['Session', 'Week', 'Month', 'Quarter', 'Year', 'Decade', 'Century'], group=group_indicators)
src        = input.source(title='  VWAP : Source', defval=hlc3, group=group_indicators)
offset     = input.int(0, title='  VWAP : Offset', group=group_indicators)

pll = input.int(987, 'Indicator and Historical Pivots', group='Ploting Length')

pvtHigh           = ta.pivothigh(pvtLength, pvtLength)
pvtLow            = ta.pivotlow (pvtLength, pvtLength)
proceed           = not na(pvtHigh) or not na(pvtLow)
//pvtLength = input.int(20, "  Pivot Points High Low : Left/Right Length", minval=1, group=group_indicators)

pvtLengthTemp     = 1
pvtHighTemp       = ta.pivothigh(pvtLengthTemp, pvtLengthTemp)
pvtLowTemp        = ta.pivotlow (pvtLengthTemp, pvtLengthTemp)
proceedTemp       = not na(pvtHighTemp) or not na(pvtLowTemp)

var x1            = 0
var x2            = 0
var x2Temp        = 0

var pvtHigh1      = 0.
var pvtLow1       = 0.
var pvtHigh1Temp  = 0.
var pvtLow1Temp   = 0.

//var pvtLast       = ''

if proceed
    x1 := x2
    x2 := bar_index

if proceedTemp
    x2Temp := bar_index

profileLength = x2 - x1
profileLengthTemp = x2Temp - pvtLengthTemp - x2 + pvtLength

//------------------------------------------------------------------------------
//f_get Tradevolume Erro
//------------------------------------------------------------------------------
// line/label/alert functions

f_drawLineX(_x1, _y1, _x2, _y2, _xloc, _extend, _color, _style, _width) =>
    var id = line.new(_x1, _y1, _x2, _y2, _xloc, _extend, _color, _style, _width)

    if _y1 > 0 and _y2 > 0
        line.set_xy1(id, _x1, _y1)
        line.set_xy2(id, _x2, _y2)
        line.set_color(id, _color)
    else
        line.set_xy1(id, _x1, close)
        line.set_xy2(id, _x2, close)
        line.set_color(id, #ffffff00)

f_drawOnlyLabelX(_x, _y, _text, _xloc, _yloc, _color, _style, _textcolor, _size, _textalign, _tooltip) =>
    label.new(_x, _y, _text, _xloc, _yloc, _color, _style, _textcolor, _size, _textalign, _tooltip)

f_drawLabelX(_x, _y, _text, _xloc, _yloc, _color, _style, _textcolor, _size, _textalign, _tooltip) =>
    var id = label.new(_x, _y, _text, _xloc, _yloc, _color, _style, _textcolor, _size, _textalign, _tooltip)
    label.set_text(id, _text)
    label.set_tooltip(id, _tooltip)

    if _y > 0
        label.set_xy(id, _x, _y)
        label.set_textcolor(id, _textcolor)
    else
        label.set_xy(id, _x, close)
        label.set_textcolor(id, #00000000)

f_crossingLevelX(_price, _level) =>
    (_level > _price and _level < _price[1]) or (_level < _price and _level > _price[1])

f_processPivotLevelX(_show, _x1, _y, _x2, _c, _s, _w, _lb, pivot, _levels, _pos) =>
    if _show
        f_drawLineX(_x1, _y, _x2, _y, xloc.bar_time, extend.none, _c, _s, _w)

        if _levels != 'None' and _lb != ''
            f_drawLabelX(_pos == 'Last Bar' ? timenow : _x2, _y, (_levels == 'Levels' ? _lb : _lb + ' (' + str.tostring(_y, format.mintick) + ')') + (_pos == 'Last Bar' ? '\n\n' : ''), xloc.bar_time, yloc.price, #00000000, label.style_label_left, _c, size.normal, text.align_left, pivot + ' ' + _lb + ' (' + str.tostring(_y, format.mintick) + ')')

    if f_crossingLevelX(close, _y) and _show
        alert(pivot + ' (PVTvX) : ' + syminfo.ticker + ' crossing ' + pivot + ' level ' + _lb + ' level, price ' + str.tostring(_y, format.mintick))

f_getStyle(_style) =>
    _style == 'Solid' ? line.style_solid : _style == 'Dotted' ? line.style_dotted : line.style_dashed

f_getTradedVolume(_len, _calc, _offset) =>
    if _calc
        vol   = 0.
        for x = 0 to _len - 1
            vol += volume[_offset + x]
        vol
//f_get tradevolume erro end
//------------------------------------------------------------------------------
// Volume Weighted Colored Bars by Kıvanç ÖZBİLGİÇ
nzVolume = nz(volume)
volMA = ta.sma(nzVolume, vwcbLen)

B = nzVolume * (close - low) / (high - low)
S = nzVolume * (high - close) / (high - low)

//------------------------------------------------------------------------------
// Pivot Points High Low

var label tempHigh = na
var label tempLow  = na
//pvtLength = input.int(20, "  Pivot Points High Low : Left/Right Length", minval=1, group=group_indicators)
//dispPVT   = input.bool(true , 'Pivot Points High Low  ------------------|', group=group_indicators, tooltip=tooltip_pvt)
if addons and dispPVT
    if not na(pvtHigh)
        tradedVolume = f_getTradedVolume(profileLength, proceed, pvtLength)
        f_drawOnlyLabelX(bar_index[pvtLength], pvtHigh, (pvtPrice ? str.tostring(pvtHigh, format.mintick) :  '') + (pvtChange ? (pvtPrice ? ' ↑ %' : '↑ %') + str.tostring((pvtHigh - pvtLow1) * 100 / pvtLow1 , '#.##') : '') + (pvtVolume and  nzVolume ? (pvtPrice or pvtChange ? '\n' : '') + str.tostring(tradedVolume, format.volume) : ''), xloc.bar_index, yloc.price, chart.fg_color, label.style_label_down, chart.bg_color, (not pvtPrice and not pvtChange and not pvtVolume ? size.tiny : pvtTextSize), text.align_center, 'Pivot High : ' + str.tostring(pvtHigh, format.mintick) + '\n -Price Change : ↑ %' + str.tostring((pvtHigh - pvtLow1) * 100 / pvtLow1 , '#.##') + (nzVolume ? '\n -Traded Volume : ' + str.tostring(tradedVolume, format.volume)  + ' (' + str.tostring(profileLength - 1) + ' bars)\n  *Average Volume/Bar : ' + str.tostring(tradedVolume / (profileLength - 1), format.volume) : '') + '\n\nNumber of bars : ' + str.tostring(profileLength) )
        pvtHigh1 := pvtHigh
        //pvtLast  := 'H'
        label.delete(tempHigh[1])
        if x2 - pvtLength > x2Temp - pvtLengthTemp
            label.delete(tempLow[1])

    if not na(pvtLow)
        tradedVolume = f_getTradedVolume(profileLength, proceed, pvtLength)
        f_drawOnlyLabelX(bar_index[pvtLength], pvtLow , (pvtPrice ? str.tostring(pvtLow , format.mintick) :  '') + (pvtChange ? (pvtPrice ? ' ↓ %' : '↓ %') + str.tostring((pvtHigh1 - pvtLow) * 100 / pvtHigh1, '#.##') : '') + (pvtVolume and  nzVolume ? (pvtPrice or pvtChange ? '\n' : '') + str.tostring(tradedVolume, format.volume) : ''), xloc.bar_index, yloc.price, chart.fg_color, label.style_label_up  , chart.bg_color, (not pvtPrice and not pvtChange and not pvtVolume ? size.tiny : pvtTextSize), text.align_center, 'Pivot Low : '  + str.tostring(pvtLow , format.mintick) + '\n -Price Change : ↓ %' + str.tostring((pvtHigh1 - pvtLow) * 100 / pvtHigh1, '#.##') + (nzVolume ? '\n -Traded Volume : ' + str.tostring(tradedVolume, format.volume) + ' (' + str.tostring(profileLength - 1) + ' bars)\n  *Average Volume/Bar : ' + str.tostring(tradedVolume / (profileLength - 1), format.volume) : '') + '\n\nNumber of bars : ' + str.tostring(profileLength) )
        pvtLow1  := pvtLow
        //pvtLast  := 'L'
        label.delete(tempLow[1])
        if x2 - pvtLength > x2Temp - pvtLengthTemp// ???
            label.delete(tempHigh[1])

    if not na(pvtHighTemp) //and pvtLast  == 'L'
        if pvtHighTemp > pvtHigh1Temp// or pvtHighTemp > pvtHigh1
            label.delete(tempHigh[1])
            tradedVolume = f_getTradedVolume(profileLengthTemp, proceedTemp, pvtLengthTemp)
            tempHigh := label.new(bar_index[pvtLengthTemp], pvtHighTemp, '* ' + (pvtPrice ? str.tostring(pvtHighTemp, format.mintick) :  '') + (pvtChange ? (pvtPrice ? ' ↑ %' : '↑ %') + str.tostring((pvtHighTemp - pvtLow1) * 100 / pvtLow1 , '#.##') : '') + (pvtVolume and  nzVolume ? (pvtPrice or pvtChange ? '\n' : '') + str.tostring(tradedVolume, format.volume) : ''), xloc.bar_index, yloc.price, #284aa9, label.style_label_down, color.white, (not pvtPrice and not pvtChange and not pvtVolume ? size.tiny : pvtTextSize), text.align_center, 'Temporary Pivot High : ' + str.tostring(pvtHighTemp, format.mintick) + '\n -Price Change : ↑ %' + str.tostring((pvtHighTemp - pvtLow1) * 100 / pvtLow1 , '#.##') + (nzVolume ? '\n -Traded Volume : ' + str.tostring(tradedVolume, format.volume)  + ' (' + str.tostring(profileLengthTemp - 1) + ' bars)\n  *Average Volume/Bar : ' + str.tostring(tradedVolume / (profileLengthTemp - 1), format.volume) : '') + '\n\nNumber of bars\n since last confirmed Pivot High/Low : ' + str.tostring(profileLengthTemp) + '\n\nWarning : subject to repaint, not a confirmed Pivot Level or Signal' )
        pvtHigh1Temp := pvtHighTemp

    if high > pvtHigh1Temp
        label.delete(tempHigh[1])

    if not na(pvtLowTemp) //and pvtLast  == 'H'
        if pvtLowTemp < pvtLow1Temp// or pvtLowTemp < pvtLow1
            tradedVolume = f_getTradedVolume(profileLengthTemp, proceedTemp, pvtLengthTemp)
            label.delete(tempLow[1])
            tempLow := label.new(bar_index[pvtLengthTemp], pvtLowTemp, '* ' + (pvtPrice ? str.tostring(pvtLowTemp, format.mintick) :  '') + (pvtChange ? (pvtPrice ? ' ↓ %' : '↓ %') + str.tostring((pvtHigh1 - pvtLowTemp) * 100 / pvtLowTemp , '#.##') : '') + (pvtVolume and  nzVolume ? (pvtPrice or pvtChange ? '\n' : '') + str.tostring(tradedVolume, format.volume) : ''), xloc.bar_index, yloc.price, #284aa9, label.style_label_up, color.white, (not pvtPrice and not pvtChange and not pvtVolume ? size.tiny : pvtTextSize), text.align_center, 'Temporary Pivot Low : ' + str.tostring(pvtLowTemp, format.mintick) + '\n -Price Change : ↓ %' + str.tostring((pvtHigh1 - pvtLowTemp) * 100 / pvtHigh1 , '#.##') + (nzVolume ? '\n -Traded Volume : ' + str.tostring(tradedVolume, format.volume)  + ' (' + str.tostring(profileLengthTemp - 1) + ' bars)\n  *Average Volume/Bar : ' + str.tostring(tradedVolume / (profileLengthTemp - 1), format.volume) : '') + '\n\nNumber of bars\n since last confirmed Pivot High/Low : ' + str.tostring(profileLengthTemp) + '\n\nWarning : subject to repaint, not a confirmed Pivot Level or Signal')
        pvtLow1Temp  := pvtLowTemp

    if low < pvtLow1Temp
        label.delete(tempLow[1])

//*******Start Buying Selling Volume v3 ceevee12312

// Inputs

onlyIntraday = input.bool(true, title='Only show intraday', tooltip='Checking this will make the table disappear on timeframes >= 1D')
showYesterday = input.bool(false, title='Show yesterday\'s volume')
showAvg = input.bool(false, title='Show average')
avgPeriod = input.int(30, title='Average period', minval=0, tooltip='Number of days to consider for average volume')

textColor = input.color(color.white, title='Text Color')
backColor = input.color(color.black, title='Table Color')
//colour customization
BVol = input(title=' BVol Text color', defval=#177245)
//BVol = input(title=' BVol Text color', defval=#ecf018)
SVol = input(title=' SVol Text color', defval=#8B0000)
//SVol = input(title=' SVol Text color', defval=#d6d6d2)
TVol = input(title=' TVol Text color', defval=#FF8C00)
//TVol = input(title=' TVol Text color', defval=#e29aed)

// BUYING VOLUME AND SELLING VOLUME //
BV = high == low ? 0 : volume * (close - low) / (high - low)
SV = high == low ? 0 : volume * (high - close) / (high - low)

DayBuyVolumePercent = 100 * BV / (BV + SV)
DaySellVolumePercent = 100 * SV / (BV + SV)

vi = input(false, title='Volume Index')

vol = volume > 0 ? volume : 1

TP = BV + SV
// RAW Pressure Volume Calculations
BPV = BV / TP * vol
SPV = SV / TP * vol
TPV = BPV + SPV

// Karthik Marar's Pressure Volume Normalized Version (XeL-MOD.)
VN = vol / ta.ema(vol, 20)
BPN = BV / ta.ema(BV, 20) * VN * 100
SPN = SV / ta.ema(SV, 20) * VN * 100
TPN = BPN + SPN

// Conditional Selectors for RAW/Norm
BPc1 = BPV > SPV ? BPV : -math.abs(BPV)
BPc2 = BPN > SPN ? BPN : -math.abs(BPN)
SPc1 = SPV > BPV ? SPV : -math.abs(SPV)
SPc2 = SPN > BPN ? SPN : -math.abs(SPN)
BPcon = vi ? BPc2 : BPc1
SPcon = vi ? SPc2 : SPc1

////////////////////////////////////////////////////////////
// Functions

nocolor=color.new(color.white, transp=100)

f_rows(I) =>
    O = true ? 1 : 0

////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// Calculations

rowNum = 1 + f_rows(showYesterday) + f_rows(showAvg)

var table dvDisplay = table.new(position=position.top_right, columns=1, rows=rowNum)

dVol = request.security(syminfo.tickerid, timeframe='D', expression=str.tostring(volume, format.volume))
ydVol = request.security(syminfo.tickerid, timeframe='D', expression=str.tostring(volume[1], format.volume))
avgVol = request.security(syminfo.tickerid, timeframe='D', expression=str.tostring(ta.sma(volume, avgPeriod)[1], format.volume))

// Calculations

i_startTime = input.time(defval=timestamp('01 DEC 2022 03:45 +0000'), title='Start Time')
i_endTime = input.time(defval=timestamp('10 Dec 2022 09:45 +0000'), title='End Time')
timeCond = time >= i_startTime and time < i_endTime
isPeriod = timeCond

var buyvol = 0.0
var sellvol = 0.0
var candle = 0

if isPeriod
    buyvol += math.abs(nz(BPcon, 0))
    sellvol += math.abs(nz(SPcon, 0))
    candle += 1
    candle

string i_positionr = position.top_center

SwingBuyVolumePercent=100*buyvol/(buyvol+sellvol)
SwingSellVolumePercent=100*sellvol/(buyvol+sellvol)

//string i_positionr = position.top_right

var tblr = table.new(i_positionr, 19, 141, frame_color=#151715, frame_width=1, border_width=2, border_color=color.new(color.white, 100))

if barstate.islast
    table.cell(tblr, 0, 1, 'Buy Volume', text_halign=text.align_center, bgcolor=color.green, text_color=color.white, text_size=size.small)
    table.cell(tblr, 1, 1, 'Sell Volume', text_halign=text.align_center, bgcolor=color.red, text_color=color.white, text_size=size.small)

    table.cell(tblr, 0, 2, str.tostring(buyvol, format.volume), text_halign=text.align_center, bgcolor=color.green, text_color=color.white, text_size=size.small)
    table.cell(tblr, 1, 2, str.tostring(sellvol, format.volume), text_halign=text.align_center, bgcolor=color.red, text_color=color.white, text_size=size.small)

//*******End Buying Selling Volume v3 ceevee12312

//Placing two tables
string i_positioner = position.top_right
var twotable = table.new(i_positionr, 48, 159,frame_color=#151715, frame_width=0, border_width=2, border_color=color.new(color.white, 100))
//var table twotable = table.new(position.bottom_center,columns=1, rows=2)

if barstate.islast
   // table.cell(twotable, 0, 10, 'BVol→ ' + f_get_volume_string(BuyVol) + '(' + f_get_volume_string(BuyVolumePercent) + '%' + ')', text_color=BVol, bgcolor=color.new(#00FF00, 100))
    //table.cell(twotable, 0, 20, 'ydVol→ ' + f_get_volume_string(BuyVol) + '(' + f_get_volume_string(BuyVolumePercent) + '%' + ')', text_color=BVol, bgcolor=color.new(#00FF00, 100))
    table.cell(twotable, 1, 40, 'ToDay Vol: ' + dVol, text_halign=text.align_center, bgcolor=color.black, text_color=color.white)
    table.cell(twotable, 1, 50, 'Yesterday: ' + ydVol, text_halign=text.align_center, bgcolor=color.black, text_color=color.white)
    table.cell(twotable, 1, 60, 'Avg Vol: ' + avgVol, text_halign=text.align_center, bgcolor=color.black, text_color=color.white)
    table.cell(twotable, 0, 70, "SwingBuy Vol", text_halign=text.align_center, bgcolor=color.rgb(7, 165, 42), text_color=color.white, text_size=size.small)
    //table.cell(twotable, Here value 30 moves Buy Vol text to x axis 30 pixels, creating blank space.When it is 0 then x axis start from no space)
    //Say if Buy Vol is 0, 15 then 0 column and 15 rows down. So text won't struck in top row.
    table.cell(twotable, 0, 71, str.tostring(buyvol, format.volume), text_halign=text.align_center, bgcolor=color.rgb(7, 165, 42), text_color=color.white, text_size=size.small)
    // 0, 71 means 0 th column and 71 row

    table.cell(twotable, 1, 70, "SwingSell Vol", text_halign=text.align_center, bgcolor=color.red, text_color=color.white, text_size=size.small)
    table.cell(twotable, 1, 71, str.tostring(sellvol, format.volume), text_halign=text.align_center, bgcolor=color.red, text_color=color.white, text_size=size.small)
   // table.cell(twotable, 0, 72, 'DBuy Perc', text_halign = text.align_center, bgcolor = color.black, text_color = color.white, text_size = size.small)
    //table.cell(twotable, 0, 73, str.tostring(DayBuyVolumePercent,format.volume ) ,   text_halign = text.align_center, bgcolor = color.black, text_color = color.white, text_size = size.small)
    //table.cell(twotable, 2, 72, 'DSell Perc', text_halign = text.align_center, bgcolor = color.black, text_color = color.white, text_size = size.small)
    //table.cell(twotable, 2, 73, str.tostring(DaySellVolumePercent,format.volume ) ,   text_halign = text.align_center, bgcolor = color.black, text_color = color.white, text_size = size.small)

//Display Swing Percentges:
    table.cell(twotable, 1, 74, 'SwingBuy Perc', text_halign = text.align_center, bgcolor = color.black, text_color = color.white, text_size = size.small)
    table.cell(twotable, 2, 74, str.tostring(SwingBuyVolumePercent,format.volume ) ,   text_halign = text.align_center, bgcolor = color.black, text_color = color.white, text_size = size.small)
    table.cell(twotable, 1, 75, 'SwingSell Perc', text_halign = text.align_center, bgcolor = color.black, text_color = color.white, text_size = size.small)
    table.cell(twotable, 2, 75, str.tostring(SwingSellVolumePercent,format.volume ) ,   text_halign = text.align_center, bgcolor = color.black, text_color = color.white, text_size = size.small)
//***********End Daily Volume

//------------------------------------------------------------------------------
//End

`like so`


问:
Poor performance when loading array of SKTexture from Core Data
I have a performance bottleneck when playing a SpriteKit animation in my app. The below code causes my app to have a 1-2s delay when loading the SwiftUI view that contains the animated SpriteKit scene. In the below code, I'm populating my [SKTexture] array for animation using image data stored in Core Data.

I believe I might need to anticipate the user opening certain animations and load them ahead of time in the background so they're ready to play.

for animationFrame in sortedAnimationFrames {
    textures.append(SKTexture(image: UIImage(data: animationFrame.imageData!)!))
```


问:
Implement a pagination class
So my task is:

Implement a pagination class helpful for arranging text on pages and listing content on the given page. The class should take in a text and a positive integer, which indicate how many symbols will be allowed per page (take spaces into account as well).

You need to get the number of whole symbols in the text, get the number of pages that came out and the method that accepts the page number, and return the number of symbols on this page. If the provided number of the page is missing, raise an exception with the message "Invalid index. Page is missing".

Implement searching/filtering pages by using symbols/words and displaying pages with all the symbols on them. If the provided symbols/words are missing, raise an exception with the message "'<symbol/word>' is missing on the pages".

If you're querying by a symbol that appears on many pages or if you are querying by the word that is split in two, return an array of all the occurrences.

Pages indexing starts with 0.

The code must work this way:

```<code>>>> pages = Pagination('Your beautiful text', 5)
>>> pages.page_count
4
>>> pages.item_count
19

>>> pages.count_items_on_page(0)
5
>>> pages.count_items_on_page(3)
4
>>> pages.count_items_on_page(4)
Exception: Invalid index. Page is missing.
>>> pages.find_page('Your')
[0]
>>> pages.find_page('e')
[1, 3]
>>> pages.find_page('beautiful')
[1, 2]
>>> pages.find_page('great')
Exception: 'great' is missing on the pages
>>> pages.display_page(0)
'Your '
</code>```

My starting code is:

```<code>class Pagination:
    def __init__(self, data, items_on_page):
        pass

    def page_count(self):
        pass

    def count_items_on_page(self, page_number):
        pass

    def find_page(self, data):
        pass

    def display_page(self, page_number):
        pass
</code>```

Can you help me please?

Title: Implement a pagination class

Body:
So my task is:

Implement a pagination class helpful for arranging text on pages and listing content on the given page. The class should take in a text and a positive integer, which indicate how many symbols will be allowed per page (take spaces into account as well).

You need to get the number of whole symbols in the text, get the number of pages that came out and the method that accepts the page number, and return the number of symbols on this page. If the provided number of the page is missing, raise an exception with the message "Invalid index. Page is missing".

Implement searching/filtering pages by using symbols/words and displaying pages with all the symbols on them. If the provided symbols/words are missing, raise an exception with the message "'<symbol/word>' is missing on the pages".

If you're querying by a symbol that appears on many pages or if you are querying by the word that is split in two, return an array of all the occurrences.

Pages indexing starts with 0.

The code must work this way:

>>> pages = Pagination('Your beautiful text', 5)
>>> pages.page_count
4
>>> pages.item_count
19

>>> pages.count_items_on_page(0)
5
>>> pages.count_items_on_page(3)
4
>>> pages.count_items_on_page(4)
Exception: Invalid index. Page is missing.
>>> pages.find_page('Your')
[0]
>>> pages.find_page('e')
[1, 3]
>>> pages.find_page('beautiful')
[1, 2]
>>> pages.find_page('great')
Exception: 'great' is missing on the pages
>>> pages.display_page(0)
'Your '

My starting code is:

class Pagination:
    def __init__(self, data, items_on_page):
        pass

    def page_count(self):
        pass

    def count_items_on_page(self, page_number):
        pass

    def find_page(self, data):
        pass

    def display_page(self, page_number):
        pass

Can you help me please?


问:
Conditional validation of an array in yup
I'm struggling to implement conditional validation of an array using yup.

I have the following form:

```<code>enum Status {
 RED = 'Red',
 GREEN = 'Green',
 YELLOW = 'Yellow',
}

interface MyField {
  fieldType: MyFieldType;
  fieldValue: string;
}

enum MyFieldType {
  FIELD_TYPE_1 = '1',
  FIELD_TYPE_2 = '2',
  FIELD_TYPE_3 = '3',
}

const validationSchema = yup.object({
    status: yup.mixed<Status>().required(),
    fields: yup.array().of(yup.mixed<MyField>()).required()
)};
</code>```

My fields field should be an array dependent on the status field, and contain values of specific fieldType.

Expample (pseude-code)

```<code>if (status === Status.RED) {
  fields: [{fieldType: MyFieldType.FIELD_TYPE_1, fieldValue: 'some_string'}]
} else if (status === Status.GREEN) {
  fields: [
    {fieldType: MyFieldType.FIELD_TYPE_2, fieldValue: 'some_string'},
    {fieldType: MyFieldType.FIELD_TYPE_3, fieldValue: 'some_string'}
  ]
} else {
  // some other combination
}
</code>```

I know about when but not sure how to use it correctly for my problem.

This is a skeleton of my solution:

```<code>fields: yup.array().of(yup.mixed<MyField>()).when('status', {
  is: (status: Status) => status === Status.GREEN,
  then: yup.array().of(// no idea how to check if specific MyFieldType is contained inside here and that the corresponding fieldValue is not an empty string )
}
</code>```

Body:
I'm struggling to implement conditional validation of an array using yup.

I have the following form:

enum Status {
 RED = 'Red',
 GREEN = 'Green',
 YELLOW = 'Yellow',
}

interface MyField {
  fieldType: MyFieldType;
  fieldValue: string;
}

enum MyFieldType {
  FIELD_TYPE_1 = '1',
  FIELD_TYPE_2 = '2',
  FIELD_TYPE_3 = '3',
}

const validationSchema = yup.object({
    status: yup.mixed<Status>().required(),
    fields: yup.array().of(yup.mixed<MyField>()).required()
)};

My fields field should be an array dependent on the status field, and contain values of specific fieldType.

Expample (pseude-code)

if (status === Status.RED) {
  fields: [{fieldType: MyFieldType.FIELD_TYPE_1, fieldValue: 'some_string'}]
} else if (status === Status.GREEN) {
  fields: [
    {fieldType: MyFieldType.FIELD_TYPE_2, fieldValue: 'some_string'},
    {fieldType: MyFieldType.FIELD_TYPE_3, fieldValue: 'some_string'}
  ]
} else {
  // some other combination
}

I know about when but not sure how to use it correctly for my problem.

This is a skeleton of my solution:

fields: yup.array().of(yup.mixed<MyField>()).when('status', {
  is: (status: Status) => status === Status.GREEN,
  then: yup.array().of(// no idea how to check if specific MyFieldType is contained inside here and that the corresponding fieldValue is not an empty string )
}


问:
Integrating Auth0 with html landing page
I have a landing page in HTML / javascript with a login button.  I want to authenticate with Auth0 and redirect to a react app.

Is this feasible and can anyone share an example of this as the examples in auth0 seem to assume the same technology is used for both the login and the redirect location.

One thing I am struggling with is understanding how to check the user is logged in when they are redirected to the web app from the landing page and how to check the user info.


问:
Express-validator: How to warn user that a request body field becomes obsolete
so we're retiring a field from request body, we made this field to be optional 1st.
At the same time, how to display the warning to user ?

```<code>  app.patch(
    "/v1/myUrl",
    [
      body("myField").optional()
      ...
    ]
</code>```

i don't want to use .customer(() => console.log),
but hope this can be a message within the response. It might be hard but want to check just in case.

Body:
so we're retiring a field from request body, we made this field to be optional 1st.
At the same time, how to display the warning to user ?

  app.patch(
    "/v1/myUrl",
    [
      body("myField").optional()
      ...
    ]

i don't want to use .customer(() => console.log),
but hope this can be a message within the response. It might be hard but want to check just in case.


问:
Nested list comprehension
Can someone please help me to convert this code (which works well) to nested list comprehension? I'm stuck. Thank you.

```<code>corrected = []
    for misspelled in entries:
        shortest_dist = 1
        shortest_word = ''
        for word in correct_spellings:
            if word[0] == misspelled[0]:
                ng3_misspelled = set(nltk.ngrams(misspelled, n=3))
                ng3_word = set(nltk.ngrams(word, n=3))
                jd = nltk.jaccard_distance(ng3_misspelled, ng3_word)
                if jd < shortest_dist:
                    shortest_dist = jd
                    shortest_word = word
        corrected += [shortest_word]
</code>```

I have tried this but it doesn't work as needed.

```<code>[word for word in correct_spellings
    for misspelled in misspelled_entries
    if word[0] == misspelled[0] and
    min([ nltk.jaccard_distance(set(nltk.ngrams(misspelled, n=3)), set(nltk.ngrams(word, n=3))) ])
]
</code>```

Title: Nested list comprehension

Body:
Can someone please help me to convert this code (which works well) to nested list comprehension? I'm stuck. Thank you.

corrected = []
    for misspelled in entries:
        shortest_dist = 1
        shortest_word = ''
        for word in correct_spellings:
            if word[0] == misspelled[0]:
                ng3_misspelled = set(nltk.ngrams(misspelled, n=3))
                ng3_word = set(nltk.ngrams(word, n=3))
                jd = nltk.jaccard_distance(ng3_misspelled, ng3_word)
                if jd < shortest_dist:
                    shortest_dist = jd
                    shortest_word = word
        corrected += [shortest_word]

I have tried this but it doesn't work as needed.

[word for word in correct_spellings
    for misspelled in misspelled_entries
    if word[0] == misspelled[0] and
    min([ nltk.jaccard_distance(set(nltk.ngrams(misspelled, n=3)), set(nltk.ngrams(word, n=3))) ])
]


问:
Unity C# Optimization - Ship trajectory freezes the editor
I'm trying to create projection of the ship trajectory, but I think it is too resource expensive to be usable since the editor freezes after a couple of seconds.

The trajectory has to take into account a couple of things:

Player's velocity (and input)

Player being attracted by other planets. (I THINK this is included in the velocity vector).

I've tried moving expensive operations outside the function that is called at FixedUpdate, link GetComponent or move to scene, but it still freezes, a little less but freezes.

My best guess is that the physics simulation is too expensive to run on FixedUpdate, but I don't know if there is a better method to call it on.

Here is my current code:

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

public class Player : MonoBehaviour
{
   ...

    [SerializeField] public Rigidbody playerRigidBody;

    // Projection
    private Scene _simulationScene;
    private PhysicsScene _physicsScene;
    [SerializeField]
    private int _maxPhysicsFrameIterations = 10;
    private GameObject _ghostObj;
    [SerializeField]
    private GameObject _markerPrefab;
    private List<GameObject> _markersPool;

    // Input Values
    ...
    private Rigidbody _ghostRigidBody;
    ...

    // Start is called before the first frame update
    void Start()
    {
        playerRigidBody = GetComponent<Rigidbody>();
        currentBoostAmount = maxBoostAmount;

        // Projection
        _markersPool = new List<GameObject>();

        for (int i = 0; i < _maxPhysicsFrameIterations; i++)
        {
            GameObject marker = Instantiate(_markerPrefab);
            _markersPool.Add(marker);
        }

        CreatePhysicsScene();
    }

    private void OnDisable()
    {
        Attractor.players.Remove(this);
        Destroy(_ghostObj);
    }

    // Update is called once per frame
    void FixedUpdate()
    {
        HandleBoosting();
        HandleMovement();

        if (thrust1D != 0 || upDown1D != 0 || strafe1D != 0 || roll1D != 0 || pitchYaw != Vector2.zero)
        {
            SimulateTrajectory();
        }
    }

    void CreatePhysicsScene()
    {
        var scene = SceneManager.GetSceneByName("SimulationScene");
        var isSimulatioSceneValid = scene.IsValid();
        if (isSimulatioSceneValid)
        {
            _simulationScene = scene;
        }

        else
        {
            _simulationScene = SceneManager.CreateScene("SimulationScene", new CreateSceneParameters(LocalPhysicsMode.Physics3D));
        }

        _physicsScene = _simulationScene.GetPhysicsScene();

        _ghostObj = Instantiate(this.gameObject, transform.position, transform.rotation);
        _ghostObj.GetComponent<PlayerInput>().enabled = false;
        _ghostObj.GetComponent<Renderer>().enabled = false;
        _ghostRigidBody = _ghostObj.GetComponent<Rigidbody>();
        SceneManager.MoveGameObjectToScene(_ghostObj, _simulationScene);
    }

    public void SimulateTrajectory()
    {
        Physics.autoSimulation = false;

        _ghostObj.transform.position = transform.position;
        _ghostRigidBody.velocity = playerRigidBody.velocity;

        for (int i = 0; i < _maxPhysicsFrameIterations; i++)
        {
            _physicsScene.Simulate(i + 1 / _maxPhysicsFrameIterations);
            _markersPool[i].transform.position = _ghostObj.transform.position;
        }

        Physics.autoSimulation = true;
    }
}

</code>```

Body:
I'm trying to create projection of the ship trajectory, but I think it is too resource expensive to be usable since the editor freezes after a couple of seconds.

The trajectory has to take into account a couple of things:

Player's velocity (and input)

Player being attracted by other planets. (I THINK this is included in the velocity vector).

I've tried moving expensive operations outside the function that is called at FixedUpdate, link GetComponent or move to scene, but it still freezes, a little less but freezes.

My best guess is that the physics simulation is too expensive to run on FixedUpdate, but I don't know if there is a better method to call it on.

Here is my current code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.SceneManagement;

public class Player : MonoBehaviour
{
   ...

    [SerializeField] public Rigidbody playerRigidBody;

    // Projection
    private Scene _simulationScene;
    private PhysicsScene _physicsScene;
    [SerializeField]
    private int _maxPhysicsFrameIterations = 10;
    private GameObject _ghostObj;
    [SerializeField]
    private GameObject _markerPrefab;
    private List<GameObject> _markersPool;

    // Input Values
    ...
    private Rigidbody _ghostRigidBody;
    ...

    // Start is called before the first frame update
    void Start()
    {
        playerRigidBody = GetComponent<Rigidbody>();
        currentBoostAmount = maxBoostAmount;

        // Projection
        _markersPool = new List<GameObject>();

        for (int i = 0; i < _maxPhysicsFrameIterations; i++)
        {
            GameObject marker = Instantiate(_markerPrefab);
            _markersPool.Add(marker);
        }

        CreatePhysicsScene();
    }

    private void OnDisable()
    {
        Attractor.players.Remove(this);
        Destroy(_ghostObj);
    }

    // Update is called once per frame
    void FixedUpdate()
    {
        HandleBoosting();
        HandleMovement();

        if (thrust1D != 0 || upDown1D != 0 || strafe1D != 0 || roll1D != 0 || pitchYaw != Vector2.zero)
        {
            SimulateTrajectory();
        }
    }

    void CreatePhysicsScene()
    {
        var scene = SceneManager.GetSceneByName("SimulationScene");
        var isSimulatioSceneValid = scene.IsValid();
        if (isSimulatioSceneValid)
        {
            _simulationScene = scene;
        }

        else
        {
            _simulationScene = SceneManager.CreateScene("SimulationScene", new CreateSceneParameters(LocalPhysicsMode.Physics3D));
        }

        _physicsScene = _simulationScene.GetPhysicsScene();

        _ghostObj = Instantiate(this.gameObject, transform.position, transform.rotation);
        _ghostObj.GetComponent<PlayerInput>().enabled = false;
        _ghostObj.GetComponent<Renderer>().enabled = false;
        _ghostRigidBody = _ghostObj.GetComponent<Rigidbody>();
        SceneManager.MoveGameObjectToScene(_ghostObj, _simulationScene);
    }

    public void SimulateTrajectory()
    {
        Physics.autoSimulation = false;

        _ghostObj.transform.position = transform.position;
        _ghostRigidBody.velocity = playerRigidBody.velocity;

        for (int i = 0; i < _maxPhysicsFrameIterations; i++)
        {
            _physicsScene.Simulate(i + 1 / _maxPhysicsFrameIterations);
            _markersPool[i].transform.position = _ghostObj.transform.position;
        }

        Physics.autoSimulation = true;
    }
}


问:
Simple Example to write new Lucene Directory
I am looking for a simple example code which helps me write a new Lucene Directory type. Can somebody share an example?

Thx


问:
How can i change the SCSS variable's values in SCSS?
```<code>$backgroundColor:red;

#deneme{
    width:200px;
    height: 200px;
    background-color: $backgroundColor;
}

@media (max-width:1000px){
    $backgroundColor:green;
    #deneme{
        width: 200px;
        height: 200px;
        background-color: $backgroundColor;
    }
}
</code>```

Hi, I have a code that changes SCSS variable's value and change the color of a div. It works correctly, but when I write it this way,

```<code>$backgroundColor:red;

@media (max-width:1000px){
    $backgroundColor:green;
}

#deneme{
    width: 200px;
    height: 200px;
    background-color: $backgroundColor;
}

</code>```

it doesn't work and the color will be red for all the pixel values. I want to know why, because I want to use this method and  change the variable's value, then import this value in other SCSS files. Could you please help me about how to make this happen? Thanks in advance.

I want to create a SCSS file in my Nextjs project and change the some variable's value according to px value of the screen and then I want to use this variables in different SCSS files. I need some help, thanks in advance.

Body:
$backgroundColor:red;

#deneme{
    width:200px;
    height: 200px;
    background-color: $backgroundColor;
}

@media (max-width:1000px){
    $backgroundColor:green;
    #deneme{
        width: 200px;
        height: 200px;
        background-color: $backgroundColor;
    }
}

Hi, I have a code that changes SCSS variable's value and change the color of a div. It works correctly, but when I write it this way,

$backgroundColor:red;

@media (max-width:1000px){
    $backgroundColor:green;
}

#deneme{
    width: 200px;
    height: 200px;
    background-color: $backgroundColor;
}

it doesn't work and the color will be red for all the pixel values. I want to know why, because I want to use this method and  change the variable's value, then import this value in other SCSS files. Could you please help me about how to make this happen? Thanks in advance.

I want to create a SCSS file in my Nextjs project and change the some variable's value according to px value of the screen and then I want to use this variables in different SCSS files. I need some help, thanks in advance.


问:
Javascript: Remove all utf8 icons in string but preserve chinese chars
Is it possible remove all utf8 icons in string? I want remove utf8 chars in input for firstname and lastname but I don't want remove Chinese, Russian... chars.

Expected behaviour:

```<code>removeUtf8Icons('John'); // output John
removeUtf8Icons('♠John♠'); // output John
removeUtf8Icons('★John★'); // output John
removeUtf8Icons('☂John Doe☂'); // output John Doe
removeUtf8Icons('☎习近平 習近平'); // output 习近平 習近平
removeUtf8Icons('☎алфави́т'); // output алфави́т
</code>```

Here is list of utf8 icons which I want remove:

https://www.w3schools.com/charsets/ref_utf_symbols.asp

Thanks in advance

Body:
Is it possible remove all utf8 icons in string? I want remove utf8 chars in input for firstname and lastname but I don't want remove Chinese, Russian... chars.

Expected behaviour:

removeUtf8Icons('John'); // output John
removeUtf8Icons('♠John♠'); // output John
removeUtf8Icons('★John★'); // output John
removeUtf8Icons('☂John Doe☂'); // output John Doe
removeUtf8Icons('☎习近平 習近平'); // output 习近平 習近平
removeUtf8Icons('☎алфави́т'); // output алфави́т

Here is list of utf8 icons which I want remove:

https://www.w3schools.com/charsets/ref_utf_symbols.asp

Thanks in advance


问:
read UDPv4: Connection reset by peer (WSAECONNRESET) (fd=240,code=10054)
go t  my server up and when loading client get this error. thank you for any help!

server config

port 1194

proto udp

dev tun
auth-nocache

ca "C:\Program Files\OpenVPN\easy-rsa\pki\ca.crt"

cert "C:\Program Files\OpenVPN\easy-rsa\pki\issued\server.crt"

key "C:\Program Files\OpenVPN\easy-rsa\pki\private\server.key"

dh "C:\Program Files\OpenVPN\easy-rsa\pki\dh.pem"

server 10.8.0.0 255.255.255.0

ifconfig-pool-persist ipp.txt

keepalive 10 120

tls-auth "C:\Program Files\OpenVPN\easy-rsa\ta.key" 0 # This file is secret

cipher AES-256-CBC
data-ciphers AES-256-GCM:AES-128-GCM:AES-256-CBC

data-ciphers cipher AES-256-CBC

persist-key

persist-tun

status openvpn-status.log

verb 3

explicit-exit-notify 1

client config

client
dev tun
;dev-node MyTap
;proto tcp
proto udp
remote 174.141.223.114 1194
;remote my-server-2 1194
;remote-random
resolv-retry infinite
nobind
;user nobody
;group nobody
persist-key
persist-tun
;http-proxy-retry # retry on connection failures
;http-proxy [proxy server] [proxy port #]
;mute-replay-warnings
remote-cert-tls server
cipher BF-CBC
comp-lzo
verb 3
;mute 20

log file on startup

MANAGEMENT: CMD 'signal SIGHUP'
2022-12-15 13:33:04 SIGHUP[hard,init_instance] received, process restarting
2022-12-15 13:33:04 MANAGEMENT: >STATE:1671129184,RECONNECTING,init_instance,,,,,
2022-12-15 13:33:04 WARNING: Compression for receiving enabled. Compression has been used in the past to break encryption. Sent packets are not compressed unless "allow-compression yes" is also set.
2022-12-15 13:33:04 DEPRECATED OPTION: --cipher set to 'BF-CBC' but missing in --data-ciphers (AES-256-GCM:AES-128-GCM). OpenVPN ignores --cipher for cipher negotiations.
2022-12-15 13:33:04 Note: '--allow-compression' is not set to 'no', disabling data channel offload.
2022-12-15 13:33:04 OpenVPN 2.6_beta1 [git:release/2.6/e778a6fd26d849dc] Windows-MSVC [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [AEAD] [DCO] built on Dec  2 2022
2022-12-15 13:33:04 Windows version 6.1 (Windows 7), amd64 executable
2022-12-15 13:33:04 library versions: OpenSSL 3.0.7 1 Nov 2022, LZO 2.10
2022-12-15 13:33:04 Restart pause, 5 second(s)
2022-12-15 13:33:09 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
2022-12-15 13:33:09 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
2022-12-15 13:33:09 TCP/UDP: Preserving recently used remote address: [AF_INET]174.141.223.114:1194
2022-12-15 13:33:09 Socket Buffers: R=[8192->8192] S=[8192->8192]
2022-12-15 13:33:09 UDPv4 link local: (not bound)
2022-12-15 13:33:09 UDPv4 link remote: [AF_INET]174.141.223.114:1194
2022-12-15 13:33:09 MANAGEMENT: >STATE:1671129189,WAIT,,,,,,
2022-12-15 13:33:09 read UDPv4: Connection reset by peer (WSAECONNRESET) (fd=240,code=10054)
2022-12-15 13:33:11 read UDPv4: Connection reset by peer (WSAECONNRESET) (fd=240,code=10054)
2022-12-15 13:33:15 read UDPv4: Connection reset by peer (WSAECONNRESET) (fd=240,code=10054)

many thanks

followed the openvpn documentation, bit confusing