问:
Laravel gets 3 tables based on 2 statements
I got 3 tables - Likes, Items, Users.

Likes - id, user_id, item_id. Belong To Items
Items - id, user_id. Belong to Business
Business - id. Has Many Items

I want to sort all likes by auth user.
get the items, and some data from Business Model as well.

What is got right now:

```<code>        $subscriptions = Likes::where([
            'user_id' => $request->user()->id
        ])->with('items')->get();

        foreach ($subscriptions as $subscription) {
            $subscriptions = Items::where(['id' => $subscription->items_id])->with('business:id,logo,name,latitude,longitude')->paginate(10);
        }
        $subscriptions->each(function ($i, $k) {
            $i->business->makeHidden(['items']);
        });
        return $subscriptions;
</code>```

But, right here is override the items and return only the last one.
Im sure there is better way to do it.

The results I want to achieved:

```<code>        {
            "item_id": 653,
            ...Items Data
            "business": {
                "id": 1,
                "logo": "",
                "name": "",
                "latitude": "",
                "longitude": "",
            }
        }
</code>```

Edit:

Solve it but getting eager load from grandfather which I don't need, how can I remove it?

```<code>        $subscriptions = Likes::where([
        'user_id' => $request->user()->id
    ])->with('item.business:id,name,logo,latitude,longitude')->paginate(10);
</code>```

Business getting all items as well which I don't need.

Body:
I got 3 tables - Likes, Items, Users.

Likes - id, user_id, item_id. Belong To Items
Items - id, user_id. Belong to Business
Business - id. Has Many Items

I want to sort all likes by auth user.
get the items, and some data from Business Model as well.

What is got right now:

        $subscriptions = Likes::where([
            'user_id' => $request->user()->id
        ])->with('items')->get();

        foreach ($subscriptions as $subscription) {
            $subscriptions = Items::where(['id' => $subscription->items_id])->with('business:id,logo,name,latitude,longitude')->paginate(10);
        }
        $subscriptions->each(function ($i, $k) {
            $i->business->makeHidden(['items']);
        });
        return $subscriptions;

But, right here is override the items and return only the last one.
Im sure there is better way to do it.

The results I want to achieved:

        {
            "item_id": 653,
            ...Items Data
            "business": {
                "id": 1,
                "logo": "",
                "name": "",
                "latitude": "",
                "longitude": "",
            }
        }

Edit:

Solve it but getting eager load from grandfather which I don't need, how can I remove it?

        $subscriptions = Likes::where([
        'user_id' => $request->user()->id
    ])->with('item.business:id,name,logo,latitude,longitude')->paginate(10);

Business getting all items as well which I don't need.


来源: stackexchange

问:
chat app constantly refreshing messages in ionic 6
I'm trying to add a chat module to my Ionic application. I have a api link. I'm pulling messages from this link. But I don't want to set a timer and listen to the same link all the time. Is there a shorter way? I want to listen to the api link constantly and I want to automatically refresh the messages.

```<code>getMessages() {
    try {
        let url = "https://xxxx/api/xxxx";
        let xheaders = new HttpHeaders();
        xheaders.append('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
        xheaders.append('Accept', 'application/json, text/plain');
        xheaders.append("cache-control", "no-cache");
        xheaders.append("Access-Control-Allow-Origin", "*");
        xheaders.append("Access-Control-Allow-Headers", "Origin, Content-Type, X-Auth-Token, Accept, Authorization, X-Request-With, Access-Control-Request-Method, Access-Control-Request-Headers");
        xheaders.append("Access-Control-Allow-Credentials" , "true");
        xheaders.append("Authorization" , 'Bearer '+ this.Token);
        xheaders.append("Access-Control-Allow-Methods" , "GET, POST, DELETE, PUT, OPTIONS, TRACE, PATCH, CONNECT");
        let body = new HttpParams()
        .set('service', "a")
        .set('serviceType', "b")
        .set('method', "c");
        let sonuc = this.Http.get(url,{headers: xheaders, params: body, responseType:'text'}).pipe(timeout(100000));
        return sonuc;
    }
    catch (e) {
        alert('getMessages:' + e);
    }
  }
</code>```

I want to listen to the link in this function all the time. How can I do it? I couldn't find how to call.

ContentLicense: CC BY-SA 4.0

Body:
I'm trying to add a chat module to my Ionic application. I have a api link. I'm pulling messages from this link. But I don't want to set a timer and listen to the same link all the time. Is there a shorter way? I want to listen to the api link constantly and I want to automatically refresh the messages.

getMessages() {
    try {
        let url = "https://xxxx/api/xxxx";
        let xheaders = new HttpHeaders();
        xheaders.append('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
        xheaders.append('Accept', 'application/json, text/plain');
        xheaders.append("cache-control", "no-cache");
        xheaders.append("Access-Control-Allow-Origin", "*");
        xheaders.append("Access-Control-Allow-Headers", "Origin, Content-Type, X-Auth-Token, Accept, Authorization, X-Request-With, Access-Control-Request-Method, Access-Control-Request-Headers");
        xheaders.append("Access-Control-Allow-Credentials" , "true");
        xheaders.append("Authorization" , 'Bearer '+ this.Token);
        xheaders.append("Access-Control-Allow-Methods" , "GET, POST, DELETE, PUT, OPTIONS, TRACE, PATCH, CONNECT");
        let body = new HttpParams()
        .set('service', "a")
        .set('serviceType', "b")
        .set('method', "c");
        let sonuc = this.Http.get(url,{headers: xheaders, params: body, responseType:'text'}).pipe(timeout(100000));
        return sonuc;
    }
    catch (e) {
        alert('getMessages:' + e);
    }
  }

I want to listen to the link in this function all the time. How can I do it? I couldn't find how to call.


问:
Setuptools doesn't find a package that is installed
I am trying to install a package "editable" for developing. I have already installed all dependencies into my virtualenv, but the installation of the package is failing:

$ . ./venv/bin/activate
$ pip install -e ../../grader_service
Obtaining file:///Users/jason/src/Grader-Service/grader_service
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... error
  error: subprocess-exited-with-error

  × Getting requirements to build editable did not run successfully.
  │ exit code: 1
  ╰─> [21 lines of output]
...
        File "/private/var/folders/0w/khw84_v56_n_h398ssh0b6l00000gn/T/pip-build-env-50lklzpz/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 335, in run_setup
          exec(code, locals())
        File "<string>", line 12, in <module>
        File "/Users/jason/src/Grader-Service/grader_service/grader_service/main.py", line 18, in <module>
          import tornado
      ModuleNotFoundError: No module named 'tornado'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
```
<p>It cannot find <code>tornado</code> although it is clearly installed:</p>
<pre class="lang-none prettyprint-override"><code>$ which python
/Users/jason/src/Grader-Service/examples/dev_environment/venv/bin/python
$ python -c "import tornado"
</code>```

I am using Python 3.10.7 from Homebrew on macOS Ventura 13.0.1 (M1). I think setuptools is running python here in a subprocess, and picking up the wrong interpreter, so it can't find the dependency from the virtualenv. Is there any way to fix this?

I've added some debugging prints to my code, and it seems setuptools is importing my main module with a wrong PYTHONPATH (the venv is not included, but some PEP517 stuff is):

sys.executable: /Users/jason/src/Grader-Service/examples/dev_environment/venv/bin/python
sys.argv: ['setup.py', 'egg_info']
sys.path: ['/Users/jason/src/Grader-Service/grader_service', '/Users/jason/src/Grader-Service/examples/dev_environment/venv/lib/python3.10/site-packages/pip/_vendor/pep517/in_process', '/private/var/folders/0w/khw84_v56_n_h398ssh0b6l00000gn/T/pip-build-env-ab7ntspc/site', '/opt/homebrew/Cellar/python@3.10/3.10.7/Frameworks/Python.framework/Versions/3.10/lib/python310.zip', '/opt/homebrew/Cellar/python@3.10/3.10.7/Frameworks/Python.framework/Versions/3.10/lib/python3.10', '/opt/homebrew/Cellar/python@3.10/3.10.7/Frameworks/Python.framework/Versions/3.10/lib/python3.10/lib-dynload', '/private/var/folders/0w/khw84_v56_n_h398ssh0b6l00000gn/T/pip-build-env-ab7ntspc/overlay/lib/python3.10/site-packages', '/private/var/folders/0w/khw84_v56_n_h398ssh0b6l00000gn/T/pip-build-env-ab7ntspc/normal/lib/python3.10/site-packages']
```

Body:
I am trying to install a package "editable" for developing. I have already installed all dependencies into my virtualenv, but the installation of the package is failing:

$ . ./venv/bin/activate
$ pip install -e ../../grader_service
Obtaining file:///Users/jason/src/Grader-Service/grader_service
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... error
  error: subprocess-exited-with-error

  × Getting requirements to build editable did not run successfully.
  │ exit code: 1
  ╰─> [21 lines of output]
...
        File "/private/var/folders/0w/khw84_v56_n_h398ssh0b6l00000gn/T/pip-build-env-50lklzpz/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 335, in run_setup
          exec(code, locals())
        File "<string>", line 12, in <module>
        File "/Users/jason/src/Grader-Service/grader_service/grader_service/main.py", line 18, in <module>
          import tornado
      ModuleNotFoundError: No module named 'tornado'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

It cannot find tornado although it is clearly installed:

$ which python
/Users/jason/src/Grader-Service/examples/dev_environment/venv/bin/python
$ python -c "import tornado"

I am using Python 3.10.7 from Homebrew on macOS Ventura 13.0.1 (M1). I think setuptools is running python here in a subprocess, and picking up the wrong interpreter, so it can't find the dependency from the virtualenv. Is there any way to fix this?

I've added some debugging prints to my code, and it seems setuptools is importing my main module with a wrong PYTHONPATH (the venv is not included, but some PEP517 stuff is):

sys.executable: /Users/jason/src/Grader-Service/examples/dev_environment/venv/bin/python
sys.argv: ['setup.py', 'egg_info']
sys.path: ['/Users/jason/src/Grader-Service/grader_service', '/Users/jason/src/Grader-Service/examples/dev_environment/venv/lib/python3.10/site-packages/pip/_vendor/pep517/in_process', '/private/var/folders/0w/khw84_v56_n_h398ssh0b6l00000gn/T/pip-build-env-ab7ntspc/site', '/opt/homebrew/Cellar/python@3.10/3.10.7/Frameworks/Python.framework/Versions/3.10/lib/python310.zip', '/opt/homebrew/Cellar/python@3.10/3.10.7/Frameworks/Python.framework/Versions/3.10/lib/python3.10', '/opt/homebrew/Cellar/python@3.10/3.10.7/Frameworks/Python.framework/Versions/3.10/lib/python3.10/lib-dynload', '/private/var/folders/0w/khw84_v56_n_h398ssh0b6l00000gn/T/pip-build-env-ab7ntspc/overlay/lib/python3.10/site-packages', '/private/var/folders/0w/khw84_v56_n_h398ssh0b6l00000gn/T/pip-build-env-ab7ntspc/normal/lib/python3.10/site-packages']


问:
Can we use conventional reinforcement learning algorithms for continuous time Markov Decision Processes like Semi-Markov Decision Processes?
I am actually trying to solve a multi-stage stochastic optimization problem which is defined in continuous time by Reinforcement Learning (RL). In this regard, can I solve my problem using conventional RL algorithms?

I cannot find any instance in which a continuous time Markov Decision Process (MDP) is solved using RL algorithms after searching in a lot of platforms.


问:
How to get Retrofit response code? Not response status
I use API which return response data like:

```<code><response>
  <name>Bad Request</name>
  <message>[4] Request parameter NOT found: sessionId</message>
  <code>4</code>
  <status>400</status>
</response>
</code>```

When i try to get response.code of this retrofit response - i get status = 400
How i can get code = 4 of response?

Body:
I use API which return response data like:

<response>
  <name>Bad Request</name>
  <message>[4] Request parameter NOT found: sessionId</message>
  4
  <status>400</status>
</response>

When i try to get response.code of this retrofit response - i get status = 400
How i can get code = 4 of response?


问:
How to make this function tail-recursive?
Suppose I've got fetchPage API that fetches a page of data and returns a Future, for instance

```<code>case class Page(data: Seq[String], currentPage: Int, hasNext: Boolean)
def fetchPage(pageNum: Int): Future[Page] = ???
</code>```

Now I want to fetch all the pages and print each page:

```<code>import scala.concurrent.ExecutionContext.Implicits.global
def fetchAll(): Unit = {

  def loop(pageNum: Int): Future[Unit] = for {
    page <- fetchPage(pageNum)
    _ = println(s"page = $page")
    _ <- if (page.hasNext) loop(pageNum + 1) else Future.unit
  } yield ()

  loop(1)
}
</code>```

This function fetchAll seems working but it is not tail-recrsive. How to make it tail-recursive ?

Body:
Suppose I've got fetchPage API that fetches a page of data and returns a Future, for instance

case class Page(data: Seq[String], currentPage: Int, hasNext: Boolean)
def fetchPage(pageNum: Int): Future[Page] = ???

Now I want to fetch all the pages and print each page:

import scala.concurrent.ExecutionContext.Implicits.global
def fetchAll(): Unit = {

  def loop(pageNum: Int): Future[Unit] = for {
    page <- fetchPage(pageNum)
    _ = println(s"page = $page")
    _ <- if (page.hasNext) loop(pageNum + 1) else Future.unit
  } yield ()

  loop(1)
}

This function fetchAll seems working but it is not tail-recrsive. How to make it tail-recursive ?


问:
Why is vercel giving me this error message when it runs build?
My code runs perfectly fine with no errors when I do yarn run dev. However, when I try and deploy it to vercel vercel runs the yarn run build command and produces an error in my code.
I've read this question here enter link description here but it still doesn't solve my problem.
here is the error message and index.tsx. Please help, thank you!

Error:

```<code>Error: Export encountered errors on following paths:
        /
    at D:\Programming\web\sonny-portfolio\portfolio-app\node_modules\next\dist\export\index.js:409:19
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Span.traceAsyncFn (D:\Programming\web\sonny-portfolio\portfolio-app\node_modules\next\dist\trace\trace.js:79:20)
    at async D:\Programming\web\sonny-portfolio\portfolio-app\node_modules\next\dist\build\index.js:1345:21
    at async Span.traceAsyncFn (D:\Programming\web\sonny-portfolio\portfolio-app\node_modules\next\dist\trace\trace.js:79:20)
    at async D:\Programming\web\sonny-portfolio\portfolio-app\node_modules\next\dist\build\index.js:1205:17
    at async Span.traceAsyncFn (D:\Programming\web\sonny-portfolio\portfolio-app\node_modules\next\dist\trace\trace.js:79:20)
    at async Object.build [as default] (D:\Programming\web\sonny-portfolio\portfolio-app\node_modules\next\dist\build\index.js:66:29)
</code>```

Index.tsx

```<code>    import Head from 'next/head'
    import Hero from "../components/Hero"
    import About from "../components/About"
    import Experience from "../components/Experience"
    import type { GetStaticProps } from 'next'
    import { Coffee, Milktea, Other } from "../typings"
    import { fetchCoffee } from "../utils/fetchCoffee"
    import { fetchMilktea } from "../utils/fetchMilktea"
    import { fetchOther } from "../utils/fetchOther"

    type Props = {
      coffees: Coffee[],
      milkteas: Milktea[],
      others: Other[]
    }

    export default function Home({coffees, milkteas, others}: Props) {
      return (
        <div className="bg-[#242424] text-white h-screen snap-y snap-mandatory duration-700 overflow-auto z-0 scrollbar-thin scrollbar-track-gray-400/20 scrollbar-thumb-[#F7AB0A]/80 scrollbar-thumb-rounded-full scrollbar-track-rounded-full scroll-smooth">
          <Head>
            <title>Sequoia Cafe</title>
          </Head>

          <section id="hero" className="snap-start">
            <Hero />
          </section>

          <section id="menu" className="snap-end">
            <Experience coffees={coffees} milkteas={milkteas} others={others} />
          </section>

          <section id="about" className="snap-center">
            <About />
          </section>
        </div>
      )
    }

export const getStaticProps: GetStaticProps<Props> = async () => {
  const coffees: Coffee[] = await fetchCoffee()
  const milkteas: Milktea[] = await fetchMilktea()
  const others: Other[] = await fetchOther()
  return {
    props: {
      coffees,
      milkteas,
      others
    },
    revalidate: 120
  }
}
</code>```

Body:
My code runs perfectly fine with no errors when I do yarn run dev. However, when I try and deploy it to vercel vercel runs the yarn run build command and produces an error in my code.
I've read this question here enter link description here but it still doesn't solve my problem.
here is the error message and index.tsx. Please help, thank you!

Error:

Error: Export encountered errors on following paths:
        /
    at D:\Programming\web\sonny-portfolio\portfolio-app\node_modules\next\dist\export\index.js:409:19
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Span.traceAsyncFn (D:\Programming\web\sonny-portfolio\portfolio-app\node_modules\next\dist\trace\trace.js:79:20)
    at async D:\Programming\web\sonny-portfolio\portfolio-app\node_modules\next\dist\build\index.js:1345:21
    at async Span.traceAsyncFn (D:\Programming\web\sonny-portfolio\portfolio-app\node_modules\next\dist\trace\trace.js:79:20)
    at async D:\Programming\web\sonny-portfolio\portfolio-app\node_modules\next\dist\build\index.js:1205:17
    at async Span.traceAsyncFn (D:\Programming\web\sonny-portfolio\portfolio-app\node_modules\next\dist\trace\trace.js:79:20)
    at async Object.build [as default] (D:\Programming\web\sonny-portfolio\portfolio-app\node_modules\next\dist\build\index.js:66:29)

Index.tsx

    import Head from 'next/head'
    import Hero from "../components/Hero"
    import About from "../components/About"
    import Experience from "../components/Experience"
    import type { GetStaticProps } from 'next'
    import { Coffee, Milktea, Other } from "../typings"
    import { fetchCoffee } from "../utils/fetchCoffee"
    import { fetchMilktea } from "../utils/fetchMilktea"
    import { fetchOther } from "../utils/fetchOther"

    type Props = {
      coffees: Coffee[],
      milkteas: Milktea[],
      others: Other[]
    }

    export default function Home({coffees, milkteas, others}: Props) {
      return (

            <title>Sequoia Cafe</title>

            <Hero />

            <Experience coffees={coffees} milkteas={milkteas} others={others} />

            <About />

      )
    }

export const getStaticProps: GetStaticProps<Props> = async () => {
  const coffees: Coffee[] = await fetchCoffee()
  const milkteas: Milktea[] = await fetchMilktea()
  const others: Other[] = await fetchOther()
  return {
    props: {
      coffees,
      milkteas,
      others
    },
    revalidate: 120
  }
}


问:
I am trying to render specific html tags from an imported component from App component using map function, but it renders the whole component
I am trying to render my skill section's skill icons and their names. I have made a Skill component in ReactJs and used the map function in my App component and passed the data from a JSON file of my skills including icons and names, I just want to render 1 section with all of the skills but the map function renders the whole Skills.jsx component and creates a separate section for each skill, Do I need to use forEach loop in Skills.jsx instead of the map in App.jsx??
I've uploaded the related files in this code sandbox :Codesandbox link of the files
Please help!!

```<code>//My Skills.jsx. Do I use a forEach here on the Skill JSON??(Whole thing in the link above pls check //out)
import React from "react";

function Skills(props) {
  return (
    <>
      <section className="skills">
        <div className="card">
          <div className="content">
            <img src={props.icon} alt="Icon" />
            <p>{props.iconName}</p>
          </div>
        </div>
      </section>
    </>
  );
}

export default Skills;
</code>```

I wanna render all my Skill icons and their names in one section instead of each skill in its own separate section.

Body:
I am trying to render my skill section's skill icons and their names. I have made a Skill component in ReactJs and used the map function in my App component and passed the data from a JSON file of my skills including icons and names, I just want to render 1 section with all of the skills but the map function renders the whole Skills.jsx component and creates a separate section for each skill, Do I need to use forEach loop in Skills.jsx instead of the map in App.jsx??
I've uploaded the related files in this code sandbox :Codesandbox link of the files
Please help!!

//My Skills.jsx. Do I use a forEach here on the Skill JSON??(Whole thing in the link above pls check //out)
import React from "react";

function Skills(props) {
  return (
    <>

{props.iconName}

    </>
  );
}

export default Skills;

I wanna render all my Skill icons and their names in one section instead of each skill in its own separate section.


问:
How to stop Trigger Jenkins job on GitHub PUSH to specific branch? in scripted pipeline
I need the code to stop the build from the git trigger and run only on the cron job..</p>


问:
after using DI my websocket connection is crashing (signalR)
after i add DI to my MainHub connection is established and after it crashed.

this is JS:

```<code>const localConnection = new signalR.HubConnectionBuilder()
    .withUrl("/mainhub")
    .configureLogging(signalR.LogLevel.Debug)
    .withAutomaticReconnect([0, 10, 30, 60, 90, 150])
    .build();

async function start() {
    try {
        await connection.start();
        console.log("SIGNALR connected with NANO SERWER");
        await localConnection.start();
        console.log("LOCAL signalR connection established.")
    } catch (err) {
        console.log(err);
        setTimeout(start, 35000);
    }
};
connection.onclose(async () => {
    await start();
});
// Start the connection.
start();
</code>```

and this is my MainHub (not crashing):

```<code>public class MainHub : Hub<IMainHub>
{
    public async Task ConnectionState(string isConnected)
    {
        await Clients.All.ConnectionState(isConnected);

    }
}
</code>```

and this is one which is crashing after connection:

```<code>public class MainHub : Hub<IMainHub>
{
    private readonly ReadingsModel _readings;
    public MainHub(ReadingsModel readings)
    {
        _readings= readings;
    }
    public async Task ConnectionState(string isConnected)
    {
        await Clients.All.ConnectionState(isConnected);

    }
}
</code>```

do you have any ideas why?

Body:
after i add DI to my MainHub connection is established and after it crashed.

this is JS:

const localConnection = new signalR.HubConnectionBuilder()
    .withUrl("/mainhub")
    .configureLogging(signalR.LogLevel.Debug)
    .withAutomaticReconnect([0, 10, 30, 60, 90, 150])
    .build();

async function start() {
    try {
        await connection.start();
        console.log("SIGNALR connected with NANO SERWER");
        await localConnection.start();
        console.log("LOCAL signalR connection established.")
    } catch (err) {
        console.log(err);
        setTimeout(start, 35000);
    }
};
connection.onclose(async () => {
    await start();
});
// Start the connection.
start();

and this is my MainHub (not crashing):

public class MainHub : Hub<IMainHub>
{
    public async Task ConnectionState(string isConnected)
    {
        await Clients.All.ConnectionState(isConnected);

    }
}

and this is one which is crashing after connection:

public class MainHub : Hub<IMainHub>
{
    private readonly ReadingsModel _readings;
    public MainHub(ReadingsModel readings)
    {
        _readings= readings;
    }
    public async Task ConnectionState(string isConnected)
    {
        await Clients.All.ConnectionState(isConnected);

    }
}

do you have any ideas why?


问:
how to move div to left on mouseenter and move back with mouseleave or better solution?
I have team block which I need to animate on "hover". 5 persons inline and when I hover on the first then display content about him over other persons and persons going to opacity 0, when mouse leave block about person disappear then person opacity is 1. The biggest problem is when hovering over other persons. Hover on the second person shows content about but move left to the same position where is person one and the same procedure opacity 0-1. This moving is for all persons except the first one.

one of manyjsfiddle
I was also try something like this.

```<code>$(document).ready(function(){
    $(".person").mouseenter(function(){
        $(".person").not(this).stop(true, true).animate({ left: "-=0" }, "slow");
        $(".person").not($(this)).animate({"opacity":"0"}, "slow");
        $(".person").not($(this)).css("pointer-events","none");
    });
    $(".person").mouseleave(function(){
        $(".person").not(this).stop(true, true).animate({ left: "auto" }, "slow");
        $(".person").not($(this)).animate({"opacity":"1"}, "slow");
        $(".person").not($(this)).css("pointer-events","");
    });
});
</code>```

the biggest problem is animate left, it goes left but without delay and won't go back on mouseleave and pointer events. when hovering it blinks

Body:
I have team block which I need to animate on "hover". 5 persons inline and when I hover on the first then display content about him over other persons and persons going to opacity 0, when mouse leave block about person disappear then person opacity is 1. The biggest problem is when hovering over other persons. Hover on the second person shows content about but move left to the same position where is person one and the same procedure opacity 0-1. This moving is for all persons except the first one.

one of manyjsfiddle
I was also try something like this.

$(document).ready(function(){
    $(".person").mouseenter(function(){
        $(".person").not(this).stop(true, true).animate({ left: "-=0" }, "slow");
        $(".person").not($(this)).animate({"opacity":"0"}, "slow");
        $(".person").not($(this)).css("pointer-events","none");
    });
    $(".person").mouseleave(function(){
        $(".person").not(this).stop(true, true).animate({ left: "auto" }, "slow");
        $(".person").not($(this)).animate({"opacity":"1"}, "slow");
        $(".person").not($(this)).css("pointer-events","");
    });
});

the biggest problem is animate left, it goes left but without delay and won't go back on mouseleave and pointer events. when hovering it blinks


问:
Error in 'SqlQuery' method is not natively supported by your database provider
In function execution calls of dbContext.Database.SqlQuery<T> the following exception:

'The element type 'MyEntity' used in 'SqlQuery' method is not natively supported by your database provider. Either use a supported element type, or use ModelConfigurationBuilder.DefaultTypeMapping to define a mapping for your type.'

Exception details

The source code.

```<code>using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Test
{
    public class Employee
    {
        public int Id { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
    }
    public class EmployeeInfo
    {
        public int EmployeeId { get; set; }
        public string Name { get; set; }
    }

    public class EmployeeDBContext : DbContext
    {
        public DbSet<Employee> Employees { get; set; }
        public EmployeeDBContext() { }
        public EmployeeDBContext(DbContextOptions<EmployeeDBContext> options)
            : base(options) { }

        protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder)
        {
            base.ConfigureConventions(configurationBuilder);

            //Action<TypeMappingConfigurationBuilder<EmployeeInfo>> actionEmployeeInfo = (buildAction) => { };
            //configurationBuilder.DefaultTypeMapping(actionEmployeeInfo);
            //Action<TypeMappingConfigurationBuilder> action = (buildAction) => { };
            //configurationBuilder.DefaultTypeMapping(typeof(EmployeeInfo), action);
            //configurationBuilder.DefaultTypeMapping(typeof(EmployeeInfo));
            configurationBuilder.DefaultTypeMapping<EmployeeInfo>();
        }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            optionsBuilder.UseSqlServer("Data source=localhost;Database=EmployeeDB;User Id=sa;Password=Dev.NET;");
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            modelBuilder.Entity<Employee>(builder => builder.HasKey(x => x.Id));
        }
    }
}
</code>```

The Test code.

```<code>using FluentAssertions;
using Microsoft.EntityFrameworkCore;
using NUnit.Framework;

namespace Test
{
    [TestFixture]
    public class EmployeeTest
    {
        [Test(Description = nameof(Find_Employee_ReturnModel))]
        public void Find_Employee_ReturnModel()
        {
            // Arrange
            var dbContext = new EmployeeDBContext();
            dbContext.Database.EnsureDeleted();
            dbContext!.Database.EnsureCreated();

            var employee = new Employee { FirstName = "Joao", LastName = "Gomes" };
            dbContext.Employees.Add(employee);
            dbContext.SaveChanges();

            // Act
            var employeeInfo = dbContext.Database.SqlQuery<EmployeeInfo>($"SELECT e.Id as EmployeeId, e.FirstName as Name FROM Employee e").ToList();

            // Assert
            employeeInfo.Should().HaveCount(1);
        }
    }
}
</code>```

Added recommended settings to return a type that is not natively supported by the database provider.

DefaultTypeMapping

```<code>protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder)
        {
            base.ConfigureConventions(configurationBuilder);

            //Action<TypeMappingConfigurationBuilder<EmployeeInfo>> actionEmployeeInfo = (buildAction) => { };
            //configurationBuilder.DefaultTypeMapping(actionEmployeeInfo);
            //Action<TypeMappingConfigurationBuilder> action = (buildAction) => { };
            //configurationBuilder.DefaultTypeMapping(typeof(EmployeeInfo), action);
            //configurationBuilder.DefaultTypeMapping(typeof(EmployeeInfo));
            configurationBuilder.DefaultTypeMapping<EmployeeInfo>();
        }
</code>```

Body:
In function execution calls of dbContext.Database.SqlQuery<T> the following exception:

'The element type 'MyEntity' used in 'SqlQuery' method is not natively supported by your database provider. Either use a supported element type, or use ModelConfigurationBuilder.DefaultTypeMapping to define a mapping for your type.'

Exception details

The source code.

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Test
{
    public class Employee
    {
        public int Id { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
    }
    public class EmployeeInfo
    {
        public int EmployeeId { get; set; }
        public string Name { get; set; }
    }

    public class EmployeeDBContext : DbContext
    {
        public DbSet<Employee> Employees { get; set; }
        public EmployeeDBContext() { }
        public EmployeeDBContext(DbContextOptions<EmployeeDBContext> options)
            : base(options) { }

        protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder)
        {
            base.ConfigureConventions(configurationBuilder);

            //Action<TypeMappingConfigurationBuilder<EmployeeInfo>> actionEmployeeInfo = (buildAction) => { };
            //configurationBuilder.DefaultTypeMapping(actionEmployeeInfo);
            //Action<TypeMappingConfigurationBuilder> action = (buildAction) => { };
            //configurationBuilder.DefaultTypeMapping(typeof(EmployeeInfo), action);
            //configurationBuilder.DefaultTypeMapping(typeof(EmployeeInfo));
            configurationBuilder.DefaultTypeMapping<EmployeeInfo>();
        }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            optionsBuilder.UseSqlServer("Data source=localhost;Database=EmployeeDB;User Id=sa;Password=Dev.NET;");
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            modelBuilder.Entity<Employee>(builder => builder.HasKey(x => x.Id));
        }
    }
}

The Test code.

using FluentAssertions;
using Microsoft.EntityFrameworkCore;
using NUnit.Framework;

namespace Test
{
    [TestFixture]
    public class EmployeeTest
    {
        [Test(Description = nameof(Find_Employee_ReturnModel))]
        public void Find_Employee_ReturnModel()
        {
            // Arrange
            var dbContext = new EmployeeDBContext();
            dbContext.Database.EnsureDeleted();
            dbContext!.Database.EnsureCreated();

            var employee = new Employee { FirstName = "Joao", LastName = "Gomes" };
            dbContext.Employees.Add(employee);
            dbContext.SaveChanges();

            // Act
            var employeeInfo = dbContext.Database.SqlQuery<EmployeeInfo>($"SELECT e.Id as EmployeeId, e.FirstName as Name FROM Employee e").ToList();

            // Assert
            employeeInfo.Should().HaveCount(1);
        }
    }
}

Added recommended settings to return a type that is not natively supported by the database provider.

DefaultTypeMapping

protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder)
        {
            base.ConfigureConventions(configurationBuilder);

            //Action<TypeMappingConfigurationBuilder<EmployeeInfo>> actionEmployeeInfo = (buildAction) => { };
            //configurationBuilder.DefaultTypeMapping(actionEmployeeInfo);
            //Action<TypeMappingConfigurationBuilder> action = (buildAction) => { };
            //configurationBuilder.DefaultTypeMapping(typeof(EmployeeInfo), action);
            //configurationBuilder.DefaultTypeMapping(typeof(EmployeeInfo));
            configurationBuilder.DefaultTypeMapping<EmployeeInfo>();
        }


问:
How to use SPARQL update in Jena SDB
I saved the following RDF/XML documents in a triple store(Jena SDB)

```<code><rdf:RDF
xmlns:ex="http://www.example#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xml:base="http://www.test#">

<ex:cat rdf:ID="_101">
   <ex:name>Milk</ex:name>
</ex:cat>
<ex:dog rdf:ID="_2001">
   <ex:name>Lub</ex:name>
</ex:dog>
</rdf:RDF>
</code>```

To

```<code>ex:_101 rdf:type ex:cat
ex:_101 ex:name "Milk"
ex:_201 rdf:type ex:dog
ex:_201 ex:name "Lub"
</code>```

Then I want to change ex:name to ex:aliasname using SPARQL update
Query :

```<code>DELETE { ?s ex:name ?o }
INSERT { ?s ex:aliasname ?o }
WHERE { ?s ex:name ?o }
</code>```

Wish

```<code>ex:_101 rdf:type ex:cat
ex:_101 ex:aliasname "Milk"
ex:_201 rdf:type ex:dog
ex:_201 ex:aliasname "Lub"
</code>```

But I don't know how to apply this.
I'm referring to the following site.
https://www.w3.org/TR/sparql11-update/
https://jena.apache.org/documentation/query/update.html
I'd appreciate any advice or link you give me
Thank you in advance

Title: How to use SPARQL update in Jena SDB

Body:
I saved the following RDF/XML documents in a triple store(Jena SDB)

<rdf:RDF
xmlns:ex="http://www.example#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xml:base="http://www.test#">

<ex:cat rdf:ID="_101">
   <ex:name>Milk</ex:name>
</ex:cat>
<ex:dog rdf:ID="_2001">
   <ex:name>Lub</ex:name>
</ex:dog>
</rdf:RDF>

To

ex:_101 rdf:type ex:cat
ex:_101 ex:name "Milk"
ex:_201 rdf:type ex:dog
ex:_201 ex:name "Lub"

Then I want to change ex:name to ex:aliasname using SPARQL update
Query :

DELETE { ?s ex:name ?o }
INSERT { ?s ex:aliasname ?o }
WHERE { ?s ex:name ?o }

Wish

ex:_101 rdf:type ex:cat
ex:_101 ex:aliasname "Milk"
ex:_201 rdf:type ex:dog
ex:_201 ex:aliasname "Lub"

But I don't know how to apply this.
I'm referring to the following site.
https://www.w3.org/TR/sparql11-update/
https://jena.apache.org/documentation/query/update.html
I'd appreciate any advice or link you give me
Thank you in advance


问:
Running tabs concurrently chrome-php
I'm trying to open 20 concurrent tabs in chrome browser using php and chrome-php library.

Each tab navigates to the URL, evaluates some js code, and gets the data from the page.

```<code>foreach ($urls as $url) {
    $page = $this->browser->createPage();

    $page->navigate($url)->waitForNavigation();
    $page->close();
}
</code>```

If I'm trying to use Spatie\Async\Pool

```<code>$pool = Pool::create();

foreach ($urls as $url) {
    $pool[] = async(function () use ($url) {
      $page = $this->browser->createPage();

      $page->navigate($url)->waitForNavigation();
      // evaluate js code
      $page->close();
    });
}

await($pool);
</code>```

I get this error:

Cannot assign Laravel\SerializableClosure\Serializers\Native to property Symfony\Component\Console\Input\InputArgument::$suggestedValues of type Closure|array

Running sequentially will take a lot of time, is that possible to achieve concurrency?

Title: Running tabs concurrently chrome-php

Body:
I'm trying to open 20 concurrent tabs in chrome browser using php and chrome-php library.

Each tab navigates to the URL, evaluates some js code, and gets the data from the page.

foreach ($urls as $url) {
    $page = $this->browser->createPage();

    $page->navigate($url)->waitForNavigation();
    $page->close();
}

If I'm trying to use Spatie\Async\Pool

$pool = Pool::create();

foreach ($urls as $url) {
    $pool[] = async(function () use ($url) {
      $page = $this->browser->createPage();

      $page->navigate($url)->waitForNavigation();
      // evaluate js code
      $page->close();
    });
}

await($pool);

I get this error:

Cannot assign Laravel\SerializableClosure\Serializers\Native to property Symfony\Component\Console\Input\InputArgument::$suggestedValues of type Closure|array

Running sequentially will take a lot of time, is that possible to achieve concurrency?


问:
Response entity return header in the response
I'm returning a list of error messages using a ResponseEnitiy body method. Altough I'm not sure why it's returning header object on the top of the reponse Ex:

```<code>[
{
    "headers": {},
    "body": {
        "code": 6,
        "description": "Billing account must not be null!.",
        "tcn": "c6fcaa15-bc68-4dc9-87b8-2722ea3e6a20",
        "personId": "1087280192",
        "errorDetails": null,
        "billingAccountsDTO": {
            "billingAccountNumber": "",
            "debtAmount": 1000.0,
            "msisdn": "0554160163",
            "hasProblem": true
        }
    },
    "statusCode": "BAD_REQUEST",
    "statusCodeValue": 400
},
{
    "headers": {},
    "body": {
        "code": 8,
        "description": "Msisnd must not be invalid or null!.",
        "tcn": "c6fcaa15-bc68-4dc9-87b8-2722ea3e6a20",
        "personId": "1087280192",
        "errorDetails": null,
        "billingAccountsDTO": {
            "billingAccountNumber": "STC234562",
            "debtAmount": 0.0,
            "msisdn": "05541x60163",
            "hasProblem": true
        }
    },
    "statusCode": "BAD_REQUEST",
    "statusCodeValue": 400
}
</code>```

]

I want to get rid of the heasers object.
The wierd behavour is that when I'm not returning a list of responses. the headers dissapeare !!!

napshot of the implementation of the response :

```<code>Response buildResponse(String tcn, ResponseCode responseCode, String personId, BillingAccountsDTO billingAccount) {
Response response =
    new Response(responseCode.getCode(), responseCode.getDescription(), tcn, personId, billingAccount,null);
return response;
</code>```

}

```<code>   response = ResponseEntity.status(HttpStatus.BAD_REQUEST)
                .body(buildResponse(tcn, ResponseCode.INVALID_DEBT_AMOUNT, billingAccountDTO.getPersonId(), billingAccountsDTO));
        auditLog.setRequestBody(billingAccountDTO.toString());
        auditLog.setResponseCode(ResponseCode.INVALID_DEBT_AMOUNT.getCode());
        billingAccountsDTO.setHasProblem(true);
        responseList.add(response);
      }
</code>```

Body:
I'm returning a list of error messages using a ResponseEnitiy body method. Altough I'm not sure why it's returning header object on the top of the reponse Ex:

[
{
    "headers": {},
    "body": {
        "code": 6,
        "description": "Billing account must not be null!.",
        "tcn": "c6fcaa15-bc68-4dc9-87b8-2722ea3e6a20",
        "personId": "1087280192",
        "errorDetails": null,
        "billingAccountsDTO": {
            "billingAccountNumber": "",
            "debtAmount": 1000.0,
            "msisdn": "0554160163",
            "hasProblem": true
        }
    },
    "statusCode": "BAD_REQUEST",
    "statusCodeValue": 400
},
{
    "headers": {},
    "body": {
        "code": 8,
        "description": "Msisnd must not be invalid or null!.",
        "tcn": "c6fcaa15-bc68-4dc9-87b8-2722ea3e6a20",
        "personId": "1087280192",
        "errorDetails": null,
        "billingAccountsDTO": {
            "billingAccountNumber": "STC234562",
            "debtAmount": 0.0,
            "msisdn": "05541x60163",
            "hasProblem": true
        }
    },
    "statusCode": "BAD_REQUEST",
    "statusCodeValue": 400
}

]

I want to get rid of the heasers object.
The wierd behavour is that when I'm not returning a list of responses. the headers dissapeare !!!

napshot of the implementation of the response :

Response buildResponse(String tcn, ResponseCode responseCode, String personId, BillingAccountsDTO billingAccount) {
Response response =
    new Response(responseCode.getCode(), responseCode.getDescription(), tcn, personId, billingAccount,null);
return response;

}

   response = ResponseEntity.status(HttpStatus.BAD_REQUEST)
                .body(buildResponse(tcn, ResponseCode.INVALID_DEBT_AMOUNT, billingAccountDTO.getPersonId(), billingAccountsDTO));
        auditLog.setRequestBody(billingAccountDTO.toString());
        auditLog.setResponseCode(ResponseCode.INVALID_DEBT_AMOUNT.getCode());
        billingAccountsDTO.setHasProblem(true);
        responseList.add(response);
      }


问:
QQmlEngine singleton double free
for using a QQmlEngine singleton in multiple qquickwindow , qquickwidget,qquickview,
(if each window create a QQmlEngine, you will have to set plugins path, import qmldir path ,..etc again and again)
i store QQmlEngine singleton into  my ioc container. it's a  std::shared_ptr in template class;

when i exit app.exec();  then error :

```<code>*** Error in `path to my executeable': double free or corruption (out): 0x00000000029df190 ***
======= Backtrace: =========
.
.
.
my ioc container backtrace...
.
.
.
============================
</code>```

my code is:

```<code>{

    auto p_engine = IocContainer::get()->ResolveObject<QQmlEngine>().get();
    QQmlComponent component(p_engine);

    QQuickWindow::setDefaultAlphaBuffer(true);
    auto url = transUrl("qrc:/dv_qmlLib/Window/QmlDebugWindow.qml");
    component.loadUrl(url);
    if ( component.isReady() )
    {
        QEventLoop loop;
        auto a =   component.create();
        qmlDebugWindow* win =  reinterpret_cast<qmlDebugWindow*>(a);
        QObject::connect(win,&QQuickWindow::closing,&loop,[&](auto* p){
            Q_UNUSED(p)
            if(win->isClosed())
                loop.exit();
        });

        if(onWinCreated)
            onWinCreated(win);
        win->setLoadUrl(qmlUrl);

        loop.exec();
        loop.disconnect(win);
        win->deleteLater();
    }
    else
        qWarning() << component.errorString();

}

</code>```

but i don't know where is  the first destroy method called;

print  QQmlEngine::objectOwnerShip indicte it owner is cpp;

i also test QQmlApplicationEngine , it has a same error:double free.

have one meeted this error ?

i want to using a QQmlEninge singleton in my application.  (base on qwidgets, but have some qquickwindow, qquickwidget, and their are using qml library) ,and when app exit , QQmlEngine singleton will not double free;

Title: QQmlEngine singleton double free

Body:
for using a QQmlEngine singleton in multiple qquickwindow , qquickwidget,qquickview,
(if each window create a QQmlEngine, you will have to set plugins path, import qmldir path ,..etc again and again)
i store QQmlEngine singleton into  my ioc container. it's a  std::shared_ptr in template class;

when i exit app.exec();  then error :

*** Error in `path to my executeable': double free or corruption (out): 0x00000000029df190 ***
======= Backtrace: =========
.
.
.
my ioc container backtrace...
.
.
.
============================

my code is:

{

    auto p_engine = IocContainer::get()->ResolveObject<QQmlEngine>().get();
    QQmlComponent component(p_engine);

    QQuickWindow::setDefaultAlphaBuffer(true);
    auto url = transUrl("qrc:/dv_qmlLib/Window/QmlDebugWindow.qml");
    component.loadUrl(url);
    if ( component.isReady() )
    {
        QEventLoop loop;
        auto a =   component.create();
        qmlDebugWindow* win =  reinterpret_cast<qmlDebugWindow*>(a);
        QObject::connect(win,&QQuickWindow::closing,&loop,[&](auto* p){
            Q_UNUSED(p)
            if(win->isClosed())
                loop.exit();
        });

        if(onWinCreated)
            onWinCreated(win);
        win->setLoadUrl(qmlUrl);

        loop.exec();
        loop.disconnect(win);
        win->deleteLater();
    }
    else
        qWarning() << component.errorString();

}

but i don't know where is  the first destroy method called;

print  QQmlEngine::objectOwnerShip indicte it owner is cpp;

i also test QQmlApplicationEngine , it has a same error:double free.

have one meeted this error ?

i want to using a QQmlEninge singleton in my application.  (base on qwidgets, but have some qquickwindow, qquickwidget, and their are using qml library) ,and when app exit , QQmlEngine singleton will not double free;


问:
How to write test case for document.body.classList.add/remove in React useEffect with jest & enzyme
How do I write unit test for following?</p>
```<code> useEffect(() => {
    document.body.classList.add("overflow_hidden");
    return () => {
      document.body.classList.remove("overflow_hidden");
    }
  }, []);
</code>```

Body:
How do I write unit test for following?

 useEffect(() => {
    document.body.classList.add("overflow_hidden");
    return () => {
      document.body.classList.remove("overflow_hidden");
    }
  }, []);


问:
How to get the RsaSecurityKey from Base64 public key in Blazor WebAssembly
I have some client side code that validates a custom JWT, which is signed with RSA private key and using the given Base64 public RSA key for validation. This all works fine in console app and Blazor Server but RSACryptoProvider fails in Blazor WASM.

The questions I have are:

Is there another way than to obtain the signing key from the Base64 public key for token validation?

Is token validation with asymmetric key possible anyway in Blazor WASM?

Some more background:

My code uses .Net 6 standard RSA cryptography via:

var rsa = new RSACryptoServiceProvider();
>>>Previous line throws exception but following lines are included for context<<<

rsa.ImportRSAPublicKey(Convert.FromBase64String(TokenPublicKeyBase64), out _);
new JwtSecurityTokenHandler().ValidateToken(token, new TokenValidationParameters
{
  ...
  IssuerSigningKey = new RsaSecurityKey(rsa),
  ...
}
```

The exception I get when RSACryptoProvider is instantiated is System.PlatformNotSupportedException. This exception is by design but I could not find another standard method to obtain the IssuesSigning key for the token validation.

Edit 1: For clarity, the keys are generated on the server so there is no need to create client-side keypairs.

Body:
I have some client side code that validates a custom JWT, which is signed with RSA private key and using the given Base64 public RSA key for validation. This all works fine in console app and Blazor Server but RSACryptoProvider fails in Blazor WASM.

The questions I have are:

Is there another way than to obtain the signing key from the Base64 public key for token validation?

Is token validation with asymmetric key possible anyway in Blazor WASM?

Some more background:

My code uses .Net 6 standard RSA cryptography via:

var rsa = new RSACryptoServiceProvider();
>>>Previous line throws exception but following lines are included for context<<<

rsa.ImportRSAPublicKey(Convert.FromBase64String(TokenPublicKeyBase64), out _);
new JwtSecurityTokenHandler().ValidateToken(token, new TokenValidationParameters
{
  ...
  IssuerSigningKey = new RsaSecurityKey(rsa),
  ...
}

The exception I get when RSACryptoProvider is instantiated is System.PlatformNotSupportedException. This exception is by design but I could not find another standard method to obtain the IssuesSigning key for the token validation.

Edit 1: For clarity, the keys are generated on the server so there is no need to create client-side keypairs.


问:
How to generate auto increment count field using Mongodb Schema
I have a database related to the interview process which consists of multiple fields.
basically, there are 5 APIs

POST - (Candidate info) - for entering candidate data

PATCH - for updating candidate info

PATCH - (for Short Listing and reviewing) - updates in existing candidate

PATCH - (for Scheduling the candidate interview) - entering the interview field which is an array object.

GET Method

I want auto increment for the count field under Interview Round Count
whenever the PATCH Method is updated for the same candidate (data updated successfully)
How can I do that in Mongodb

Complete Schema:

```<code>    const mongoose = require('mongoose');
    const mongoosePaginate = require('mongoose-paginate-v2');
    const { Schema } = mongoose;
    const { EMAIL } = require('../../config/patterns.js');

    const InterviewSchema = new Schema(
      {
        firstName: {
          type: String,
          required: true,
          trim: true,
          maxlength: 30,
        },
        lastName: {
          type: String,
          trim: true,
          maxlength: 30,
        },
        email: {
          type: String,
          required: true,
          trim: true,
          match: EMAIL,
        },
        gender: {
          type: String,
          required: true,
          enum: ['male', 'female', 'other'],
        },
        contactNumber: {
          type: Number,
          unique: true,
          required: true,
        },
        alternateContactNumber: {
          type: Number,
        },
        resume: {
          type: String,
          required: true,
        },
        designation: {
          type: String,
          required: true,
          enum: ['trainee', 'se', 'sse', 'tl', 'systemEngineer'],
        },
        profile: {
          type: String,
          required: true,
          enum: [
            'react',
            'reactNative',
            'node',
            'fullstack',
            'php',
            'ios',
            'android',
            'python',
          ],
        },
        experience: {
          years: {
            type: Number,
            required: true,
          },
          months: {
            type: Number,
            required: true,
          },
        },
        ctc: {
          current: {
            type: Number,
            required: [true, 'In LPA'],
          },
          expected: {
            type: Number,
            required: [true, 'In LPA'],
          },
          offered: {
            type: Number,
            required: [true, 'In LPA'],
          },
        },
        noticePeriod: {
          type: Number,
          default: 0,
        },
        referrer: {
          type: {
            type: String,
            enum: ['consultant', 'employee', 'website', 'social'],
          },
          name: {
            type: String,
            trim: true,
            required: true,
          },
        },
        status: {
          type: String,
          enum: [
            'shortlisting',
            'shortlisted',
            'interviewing',
            'selected',
            'rejected',
            'onHold',
            'denied',
            'offerSent',
            'joined',
            'cancel',
          ],
        },

 // Shortling the Candidate - PATCH Method

    reviewer: {
      name: {
        type: String,
        trim: true,
        required: true,
      },
      email: {
        type: String,
        trim: true,
        required: true,
      },
      id: {
        type: Number,
        required: true,
      },
    },
    date: {
      type: Date,
      default: Date.now,
    },

// Scheduling the interview (this can be repeated no.of times for the interview round)
// represented in Array object

    interview: [
      {
        interviewerName: {
          type: String,
          trim: true,
        },
        date: {
          type: Date,
          default: Date.now,
        },
        mode: {
          type: String,
          enum: ['telephonic', 'video', 'f2f'],
          default: 'telephonic',
        },
        meeting: {
          link: {
            type: String,
            trim: true,
          },
          platform: {
            type: String,
            trim: true,
          },
        },

        round: {
          count: {         // want auto-increment count
            type: Number,
          },
          type: {
            type: String,
            enum: ['written', 'technical', 'hr'],
          },
        },

        interviewStatus: {
          type: String,
          enum: ['rejected', 'onHold', 'selected', 'schedule'],
        },

        feedback: {
          technical: {
            type: Number,
            required: true,
            min: 1,
            max: 5,
          },
          logical: {
            type: Number,
            required: true,
            min: 1,
            max: 5,
          },
          communication: {
            type: Number,
            required: true,
            min: 1,
            max: 5,
          },
          comment: {
            type: String,
            min: 10,
            max: 200,
          },
        },

        recommendation: {
          type: String,
          enum: ['yes', 'no'],
        },
      },
    ],
  },
  {
    timestamps: true,
  },
);

InterviewSchema.plugin(mongoosePaginate);
const InterviewProcess = mongoose.model('interviewprocess', InterviewSchema);
module.exports = InterviewProcess;
</code>```

Body:
I have a database related to the interview process which consists of multiple fields.
basically, there are 5 APIs

POST - (Candidate info) - for entering candidate data

PATCH - for updating candidate info

PATCH - (for Short Listing and reviewing) - updates in existing candidate

PATCH - (for Scheduling the candidate interview) - entering the interview field which is an array object.

GET Method

I want auto increment for the count field under Interview Round Count
whenever the PATCH Method is updated for the same candidate (data updated successfully)
How can I do that in Mongodb

Complete Schema:

    const mongoose = require('mongoose');
    const mongoosePaginate = require('mongoose-paginate-v2');
    const { Schema } = mongoose;
    const { EMAIL } = require('../../config/patterns.js');

    const InterviewSchema = new Schema(
      {
        firstName: {
          type: String,
          required: true,
          trim: true,
          maxlength: 30,
        },
        lastName: {
          type: String,
          trim: true,
          maxlength: 30,
        },
        email: {
          type: String,
          required: true,
          trim: true,
          match: EMAIL,
        },
        gender: {
          type: String,
          required: true,
          enum: ['male', 'female', 'other'],
        },
        contactNumber: {
          type: Number,
          unique: true,
          required: true,
        },
        alternateContactNumber: {
          type: Number,
        },
        resume: {
          type: String,
          required: true,
        },
        designation: {
          type: String,
          required: true,
          enum: ['trainee', 'se', 'sse', 'tl', 'systemEngineer'],
        },
        profile: {
          type: String,
          required: true,
          enum: [
            'react',
            'reactNative',
            'node',
            'fullstack',
            'php',
            'ios',
            'android',
            'python',
          ],
        },
        experience: {
          years: {
            type: Number,
            required: true,
          },
          months: {
            type: Number,
            required: true,
          },
        },
        ctc: {
          current: {
            type: Number,
            required: [true, 'In LPA'],
          },
          expected: {
            type: Number,
            required: [true, 'In LPA'],
          },
          offered: {
            type: Number,
            required: [true, 'In LPA'],
          },
        },
        noticePeriod: {
          type: Number,
          default: 0,
        },
        referrer: {
          type: {
            type: String,
            enum: ['consultant', 'employee', 'website', 'social'],
          },
          name: {
            type: String,
            trim: true,
            required: true,
          },
        },
        status: {
          type: String,
          enum: [
            'shortlisting',
            'shortlisted',
            'interviewing',
            'selected',
            'rejected',
            'onHold',
            'denied',
            'offerSent',
            'joined',
            'cancel',
          ],
        },

 // Shortling the Candidate - PATCH Method

    reviewer: {
      name: {
        type: String,
        trim: true,
        required: true,
      },
      email: {
        type: String,
        trim: true,
        required: true,
      },
      id: {
        type: Number,
        required: true,
      },
    },
    date: {
      type: Date,
      default: Date.now,
    },

// Scheduling the interview (this can be repeated no.of times for the interview round)
// represented in Array object

    interview: [
      {
        interviewerName: {
          type: String,
          trim: true,
        },
        date: {
          type: Date,
          default: Date.now,
        },
        mode: {
          type: String,
          enum: ['telephonic', 'video', 'f2f'],
          default: 'telephonic',
        },
        meeting: {
          link: {
            type: String,
            trim: true,
          },
          platform: {
            type: String,
            trim: true,
          },
        },

        round: {
          count: {         // want auto-increment count
            type: Number,
          },
          type: {
            type: String,
            enum: ['written', 'technical', 'hr'],
          },
        },

        interviewStatus: {
          type: String,
          enum: ['rejected', 'onHold', 'selected', 'schedule'],
        },

        feedback: {
          technical: {
            type: Number,
            required: true,
            min: 1,
            max: 5,
          },
          logical: {
            type: Number,
            required: true,
            min: 1,
            max: 5,
          },
          communication: {
            type: Number,
            required: true,
            min: 1,
            max: 5,
          },
          comment: {
            type: String,
            min: 10,
            max: 200,
          },
        },

        recommendation: {
          type: String,
          enum: ['yes', 'no'],
        },
      },
    ],
  },
  {
    timestamps: true,
  },
);

InterviewSchema.plugin(mongoosePaginate);
const InterviewProcess = mongoose.model('interviewprocess', InterviewSchema);
module.exports = InterviewProcess;


问:
How to fix this stroke issue of vectorGrid plugin of Leaflet?
I have relatively large geojson data to output, so I used vectorgrid plugin to convert geojson to vector tiles.
I have used mouseover and mouseout events to add some level of interactivity (change the stroke styling)

Here is the output with L.geoJson method directly
without using the plugin.

Here is the output achieved by using the plugin

The stroke is not uniform on all borders, if a border is shared with multiple polygons only one polygon retains the stroke.
And the other thing is, even though the styling parameter is identical in both the cases, vectorgrid fill looks dull as if opacity is lowered. I couldn't find any reference to this issues online.


问:
How to interpretate rcrimeanalysis
I know english till certain level and also tryied translator, but it didn't was clear, then, I need some help to interpretate what is a Net Difference Raster. I'm exploring rcrimeanalysis package, and here's my code.

```<code>library(rcrimeanalysis)
library(tidyverse)

data("crimes")

narcotics <- subset(crimes, crimes$primary_type == "NARCOTICS")

interval <- kde_int_comp(narcotics,
                         start1="1/1/2017",
                         end1="3/1/2017",
                         start2="1/1/2018",
                         end2="3/1/2018")

interval

crime_samp <- head(crimes, n = 1000)
out <- near_repeat_analysis(data = crime_samp,
                            tz = "America/Chicago",
                            epsg = "32616")
near_repeat_eval(data = crime_samp,
                 tz = "America/Chicago",
                 epsg = "32616")
</code>```

kde_int_comp() plots a Difference Network Raster, but how do I read this map, the more blue, more crime intesified in that area? And there are regions that crime didn't happenned after the year passed and the net difference plots does not marks it. I'm confused.

And for last, I couldn't also understand the return of near_repeat_eval(). It gives Distance and Time, and it looks like parameters to use somewhere else.

Title: How to interpretate rcrimeanalysis

Body:
I know english till certain level and also tryied translator, but it didn't was clear, then, I need some help to interpretate what is a Net Difference Raster. I'm exploring rcrimeanalysis package, and here's my code.

library(rcrimeanalysis)
library(tidyverse)

data("crimes")

narcotics <- subset(crimes, crimes$primary_type == "NARCOTICS")

interval <- kde_int_comp(narcotics,
                         start1="1/1/2017",
                         end1="3/1/2017",
                         start2="1/1/2018",
                         end2="3/1/2018")

interval

crime_samp <- head(crimes, n = 1000)
out <- near_repeat_analysis(data = crime_samp,
                            tz = "America/Chicago",
                            epsg = "32616")
near_repeat_eval(data = crime_samp,
                 tz = "America/Chicago",
                 epsg = "32616")

kde_int_comp() plots a Difference Network Raster, but how do I read this map, the more blue, more crime intesified in that area? And there are regions that crime didn't happenned after the year passed and the net difference plots does not marks it. I'm confused.

And for last, I couldn't also understand the return of near_repeat_eval(). It gives Distance and Time, and it looks like parameters to use somewhere else.


问:
Is it possible to combine ScrollSpy with a progress bar?
I'm trying to create a course page, which consists of a content area and a sidebar.

Sidebar has a link (scroll to div anchor) and an .svg that should animate depending on scroll depth.

Sidebar:

```<code><ul class="dropdown-menu">
    <li>
        <a class="dropdown-item" href="#why-data-is-needed">
            <svg class="progress-svg" x="0px" y="0px" width="36px" height="36px" viewBox="0 0 36 36">
                <circle class="progress-svg__circleOutline" fill="none" stroke-width="1" cx="18" cy="18" r="17" stroke-dashoffset="100"></circle>
                <circle class="progress-svg__circle" fill="none" stroke-width="2" cx="18" cy="18" r="16" stroke-dasharray="100" stroke-dashoffset="0"></circle>
            </svg>
            Why data is needed in digital learning design
        </a>
    </li>
    <li>
        <a class="dropdown-item" href="#data-story">
            <svg class="progress-svg" x="0px" y="0px" width="36px" height="36px" viewBox="0 0 36 36">
                <circle class="progress-svg__circleOutline" fill="none" stroke-width="1" cx="18" cy="18" r="17" stroke-dashoffset="100"></circle>
                <circle class="progress-svg__circle" fill="none" stroke-width="2" cx="18" cy="18" r="16" stroke-dasharray="100" stroke-dashoffset="0"></circle>
            </svg>
            Data: A story full of surprises
        </a>
    </li>
</ul>
</code>```

I would like to animate the circle's dashoffset according to the scroll value of the recent onscreen div. (from 0 to 100)

I've tried

```<code>window.addEventListener('DOMContentLoaded', () => {

  const observer = new IntersectionObserver(entries => {
    entries.forEach(entry => {
      const id = entry.target.getAttribute('id');
      if (entry.intersectionRatio > 0) {
        $( '.dropdown-menu li a[href="#' + id + '"]' ).addClass( 'active' );
      }
      console.log(entry.intersectionRatio);
    });
  });

  // Track all sections that have an `id` applied
  document.querySelectorAll('div[id]').forEach((section) => {
    observer.observe(section);
  });

});
</code>```

It does add active states to anchors, but seems like IntersectionObserver isn't what I need for this task.

Body:
I'm trying to create a course page, which consists of a content area and a sidebar.

Sidebar has a link (scroll to div anchor) and an .svg that should animate depending on scroll depth.

Sidebar:

            <svg class="progress-svg" x="0px" y="0px" width="36px" height="36px" viewBox="0 0 36 36">
                <circle class="progress-svg__circleOutline" fill="none" stroke-width="1" cx="18" cy="18" r="17" stroke-dashoffset="100"></circle>
                <circle class="progress-svg__circle" fill="none" stroke-width="2" cx="18" cy="18" r="16" stroke-dasharray="100" stroke-dashoffset="0"></circle>
            </svg>
            Why data is needed in digital learning design

            <svg class="progress-svg" x="0px" y="0px" width="36px" height="36px" viewBox="0 0 36 36">
                <circle class="progress-svg__circleOutline" fill="none" stroke-width="1" cx="18" cy="18" r="17" stroke-dashoffset="100"></circle>
                <circle class="progress-svg__circle" fill="none" stroke-width="2" cx="18" cy="18" r="16" stroke-dasharray="100" stroke-dashoffset="0"></circle>
            </svg>
            Data: A story full of surprises

I would like to animate the circle's dashoffset according to the scroll value of the recent onscreen div. (from 0 to 100)

I've tried

window.addEventListener('DOMContentLoaded', () => {

  const observer = new IntersectionObserver(entries => {
    entries.forEach(entry => {
      const id = entry.target.getAttribute('id');
      if (entry.intersectionRatio > 0) {
        $( '.dropdown-menu li a[href="#' + id + '"]' ).addClass( 'active' );
      }
      console.log(entry.intersectionRatio);
    });
  });

  // Track all sections that have an `id` applied
  document.querySelectorAll('div[id]').forEach((section) => {
    observer.observe(section);
  });

});

It does add active states to anchors, but seems like IntersectionObserver isn't what I need for this task.


问:
TRPC v10 how to achieve pathnames with dash in routes
In TRPCv9 the way we defined routes was something like this

```<code>const appRouter = trpc.router()
  .query('greeting', {
    input: z.string(),
    resolve({ input }) {
      return `hello ${input}!`;
    },
  });
</code>```

Now in TRPCv10, as stated in the migration from v9 to v10 docs portion, we have

```<code>const appRouter = router({
  greeting: publicProcedure
    .input(z.string())
    .query(({ input }) => `hello ${input}!`),
});
</code>```

Given their example, I assume for a dashed delimited pathname we have to do something similar to the code below. However, this approach turns to be a little bit ugly when calling the trpc endpoint from the FE side.

```<code>// server-side
const registerUser = router({
  ["register-user"]: procedure
    .input(registerUserInputSchema)
    .mutation(async ({ ctx, input }) => {
      ....
    },
  });

// fe-side

function RegisterPage() {
  const { handleSubmit, register } = useForm();
  // See Appendix why we have users. here
  const {} = trpc["users"]["register-user"].useMutation();

  return (
    <>
      <form action=""></form>
      <Link href="/login">Login</Link>
    </>
  );
}

</code>```

Nevertheless, is there a way to achieve cleaner code using V10?

Appendix

We have a prefix of users. when we call the register-user route because we have merged the user router in the app router like so

```<code>import { router } from "../trpc";
import { userRouter } from "./user.router";

export const appRouter = router({
  ["users"]: userRouter,
});

export type AppRouter = typeof appRouter;

</code>```

Body:
In TRPCv9 the way we defined routes was something like this

const appRouter = trpc.router()
  .query('greeting', {
    input: z.string(),
    resolve({ input }) {
      return `hello ${input}!`;
    },
  });

Now in TRPCv10, as stated in the migration from v9 to v10 docs portion, we have

const appRouter = router({
  greeting: publicProcedure
    .input(z.string())
    .query(({ input }) => `hello ${input}!`),
});

Given their example, I assume for a dashed delimited pathname we have to do something similar to the code below. However, this approach turns to be a little bit ugly when calling the trpc endpoint from the FE side.

// server-side
const registerUser = router({
  ["register-user"]: procedure
    .input(registerUserInputSchema)
    .mutation(async ({ ctx, input }) => {
      ....
    },
  });

// fe-side

function RegisterPage() {
  const { handleSubmit, register } = useForm();
  // See Appendix why we have users. here
  const {} = trpc["users"]["register-user"].useMutation();

  return (
    <>
      <form action=""></form>
      <Link href="/login">Login</Link>
    </>
  );
}

Nevertheless, is there a way to achieve cleaner code using V10?

Appendix

We have a prefix of users. when we call the register-user route because we have merged the user router in the app router like so

import { router } from "../trpc";
import { userRouter } from "./user.router";

export const appRouter = router({
  ["users"]: userRouter,
});

export type AppRouter = typeof appRouter;


问:
Search on the basis of two fields from database if both are true then get result otherwise not display result if any one is false, using symfony php
I am using doctrine db to fecth the data from database, I have the database who has some info like city, state and the vehicle Types that company has, I have two filters for search based on state and based on vehicle types, they both are working fine, I want to merge these two filters, only those companies should display who is in the searched state and have the searched vehicle type..

search based on city and state

```<code>         $fromCity_arr = explode(', ', $fromCity);
         $whereStr = '';
         foreach($fromCity_arr as $fromCity_el){
         if(!empty($whereStr)){$whereStr .= " OR ";}
         $whereStr .= "state  LIKE '%".$fromCity_el."%'";
       }
</code>```

search based on vehicle types

```<code>       $vehicleTypeName = $this->vehicleCategory->getName();
       $vehicleCat = explode(',', $vehicleTypeName);
       $vehicleType = '';
       foreach($vehicleCat as $vehicle_cat){
         if(!empty($vehicleType)){$vehicleType .= " OR ";}
         $vehicleType .= "vehicle_types Like '%".$vehicle_cat."%'";
       }

</code>```

The query to search both of these in single row of data

```<code>    $sql = "SELECT * FROM vendor_info WHERE  $vehicleType AND $whereStr";
    $em = $this->getDoctrine()->getManager();
    $stmt = $em->getConnection()->prepare($sql);
    $stmt->execute();
    $company = $stmt->fetchAll();
</code>```

The result of this filter by using dump

Current Result
Now by using this filter All the companies in the searched state are comming and all the companies that have searched vehicle types are coming,

Expected Results
only those companies who have the specific search vehicle types and are present in the searched state should be propogate,

Body:
I am using doctrine db to fecth the data from database, I have the database who has some info like city, state and the vehicle Types that company has, I have two filters for search based on state and based on vehicle types, they both are working fine, I want to merge these two filters, only those companies should display who is in the searched state and have the searched vehicle type..

search based on city and state

         $fromCity_arr = explode(', ', $fromCity);
         $whereStr = '';
         foreach($fromCity_arr as $fromCity_el){
         if(!empty($whereStr)){$whereStr .= " OR ";}
         $whereStr .= "state  LIKE '%".$fromCity_el."%'";
       }

search based on vehicle types

       $vehicleTypeName = $this->vehicleCategory->getName();
       $vehicleCat = explode(',', $vehicleTypeName);
       $vehicleType = '';
       foreach($vehicleCat as $vehicle_cat){
         if(!empty($vehicleType)){$vehicleType .= " OR ";}
         $vehicleType .= "vehicle_types Like '%".$vehicle_cat."%'";
       }

The query to search both of these in single row of data

    $sql = "SELECT * FROM vendor_info WHERE  $vehicleType AND $whereStr";
    $em = $this->getDoctrine()->getManager();
    $stmt = $em->getConnection()->prepare($sql);
    $stmt->execute();
    $company = $stmt->fetchAll();

The result of this filter by using dump

Current Result
Now by using this filter All the companies in the searched state are comming and all the companies that have searched vehicle types are coming,

Expected Results
only those companies who have the specific search vehicle types and are present in the searched state should be propogate,


问:
When calling a function in Return() I get Warning: Functions are not valid as a React child
I'm using the following statement in my return like this:

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

export default function App() {

  function GetFormConfigurationArray(event) {
    console.log('Blaaaah');
  }

  return (
    <div>
      { document.onreadystatechange = () => {GetFormConfigurationArray()}}
    </div>
  );
}
</code>```

It works. Calls the function and runs the code successfully, but I'm also getting this warning:

```<code>Warning: Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.
    at div
    at App
</code>```

What's it's really trying to tell me and what's the right way to make this call?

Body:
I'm using the following statement in my return like this:

import React from "react";

export default function App() {

  function GetFormConfigurationArray(event) {
    console.log('Blaaaah');
  }

  return (

      { document.onreadystatechange = () => {GetFormConfigurationArray()}}

  );
}

It works. Calls the function and runs the code successfully, but I'm also getting this warning:

Warning: Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.
    at div
    at App

What's it's really trying to tell me and what's the right way to make this call?


问:
Uncaught TypeError: Cannot read properties of undefined (Reading '***')
I am new to javascript, react, etc and have been trying to learn by following some youtube videos.
I'm looking for a little support on an issue that I have come up against after following a Youtube video.

Please give me patience. Any assistance will be appreciated. I'm half expecting a few sarcastic responses, so please be kind.

In short, I was following this video:

https://www.youtube.com/watch?v=UvH70UkbyfE

I got all the way through the video and receive no errors in visual studio. However, when I open on my local host I get lots of these errors:

Uncaught TypeError: Cannot read properties of undefined (Reading '***')
```
<p>My code is below:</p>
<p><strong>App.JS file:</strong></p>
```import "./App.css";
import Form from "./Components/Form";

function App() {
  return (

      <Form />

  );
}

export default App;
```
<p><strong>Form.Js File (held in a components folder in the app project folder</strong></p>
```import React from "react";
import "../App.css";
import {useForm} from "react-hook-form";
import { yupResolver } from "@hookform/resolvers/yup";
import * as yup from "yup";

const schema = yup.object().shape({
    Name: yup.string().required(),
    AddressLine1: yup.string().required(),
    AddressLine2: yup.string().required(),
    AddressLine3: yup.string().required(),
    AddressLine4: yup.string().required(),
    City: yup.string().required(),
    StateProvinceCounty: yup.string().required(),
    Postcode: yup.string().required(),
    Country: yup.string().required(),

})

function Form() {
    const {register, handleSubmit, errors} = useForm({
        resolver: yupResolver(schema)});

const submitForm = (data) =>{
    console.log(data);
};

    return (

 Details

            <form onSubmit={handleSubmit(submitForm)}>
                    <input type="text"
                    name="Name"
                    placeholder=" Name"
                    ref={register}/>

{errors.Name?.message}

                    <input
                        type="text"
                        name="AddressLine1"
                        placeholder="AddressLine1"
                        ref={register}
                    />

{errors.AddressLine1?.message}

                    <input
                        type="text"
                        name="AddressLine2"
                        placeholder="AddressLine2"
                        ref={register}
                    />

{errors.AddressLine2?.message}

                    <input
                        type="text"
                        name="AddressLine3"
                        placeholder="AddressLine3"
                        ref={register}
                    />

{errors.AddressLine3?.message}

                    <input
                        type="text"
                        name="AddressLine4"
                        placeholder="AddressLine4"
                        ref={register
                    }/>

{errors.AddressLine4?.message}

                    <input
                        type="text"
                        name="City"
                        placeholder="City"
                        ref={register}
                    />

{errors.City?.message}

                    <input
                        type="text"
                        name="StateProvinceCounty"
                        placeholder="City"
                        ref={register}
                    />

{errors.StateProvinceCounty?.message}

                    <input
                        type="text"
                        name="Postcode"
                        placeholder="City"
                        ref={register}
                    />

{errors.Postcode?.message}

                    <input
                        type="text"
                        name="Country"
                        placeholder="City"
                        ref={register}
                    />

{errors.Country?.message}

                </form>

    );

}

export default Form;
```
<p><strong>Index.Js File</strong></p>
```import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
import reportWebVitals from "./reportWebVitals";

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<App />
);
reportWebVitals();
```

Can anyone assist in why i get the issue?

.................................................................

Body:
I am new to javascript, react, etc and have been trying to learn by following some youtube videos.
I'm looking for a little support on an issue that I have come up against after following a Youtube video.

Please give me patience. Any assistance will be appreciated. I'm half expecting a few sarcastic responses, so please be kind.

In short, I was following this video:

https://www.youtube.com/watch?v=UvH70UkbyfE

I got all the way through the video and receive no errors in visual studio. However, when I open on my local host I get lots of these errors:

Uncaught TypeError: Cannot read properties of undefined (Reading '***')

My code is below:

App.JS file:

import "./App.css";
import Form from "./Components/Form";

function App() {
  return (

      <Form />

  );
}

export default App;

Form.Js File (held in a components folder in the app project folder

import React from "react";
import "../App.css";
import {useForm} from "react-hook-form";
import { yupResolver } from "@hookform/resolvers/yup";
import * as yup from "yup";

const schema = yup.object().shape({
    Name: yup.string().required(),
    AddressLine1: yup.string().required(),
    AddressLine2: yup.string().required(),
    AddressLine3: yup.string().required(),
    AddressLine4: yup.string().required(),
    City: yup.string().required(),
    StateProvinceCounty: yup.string().required(),
    Postcode: yup.string().required(),
    Country: yup.string().required(),

})

function Form() {
    const {register, handleSubmit, errors} = useForm({
        resolver: yupResolver(schema)});

const submitForm = (data) =>{
    console.log(data);
};

    return (

 Details

            <form onSubmit={handleSubmit(submitForm)}>
                    <input type="text"
                    name="Name"
                    placeholder=" Name"
                    ref={register}/>

{errors.Name?.message}

                    <input
                        type="text"
                        name="AddressLine1"
                        placeholder="AddressLine1"
                        ref={register}
                    />

{errors.AddressLine1?.message}

                    <input
                        type="text"
                        name="AddressLine2"
                        placeholder="AddressLine2"
                        ref={register}
                    />

{errors.AddressLine2?.message}

                    <input
                        type="text"
                        name="AddressLine3"
                        placeholder="AddressLine3"
                        ref={register}
                    />

{errors.AddressLine3?.message}

                    <input
                        type="text"
                        name="AddressLine4"
                        placeholder="AddressLine4"
                        ref={register
                    }/>

{errors.AddressLine4?.message}

                    <input
                        type="text"
                        name="City"
                        placeholder="City"
                        ref={register}
                    />

{errors.City?.message}

                    <input
                        type="text"
                        name="StateProvinceCounty"
                        placeholder="City"
                        ref={register}
                    />

{errors.StateProvinceCounty?.message}

                    <input
                        type="text"
                        name="Postcode"
                        placeholder="City"
                        ref={register}
                    />

{errors.Postcode?.message}

                    <input
                        type="text"
                        name="Country"
                        placeholder="City"
                        ref={register}
                    />

{errors.Country?.message}

                </form>

    );

}

export default Form;

Index.Js File

import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
import reportWebVitals from "./reportWebVitals";

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<App />
);
reportWebVitals();

Can anyone assist in why i get the issue?

.................................................................


问:
installing obdé library
i am trying to use obd library in python for my project; however when instaling it; i get the following problem:

```<code>PS C:\Users\DELL\Documents\OBD\project2> pip install "obd==0.7.1"
Could not import runpy module
Traceback (most recent call last):
  File "<frozen runpy>", line 15, in <module>
  File "<frozen importlib.util>", line 14, in <module>
  File "C:\Users\DELL\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 6, in <module>
    from collections import deque
ImportError: cannot import name 'deque' from 'collections' (C:\Users\DELL\AppData\Local\Programs\Python\Python311\Lib\collections\__init__.py)
PS C:\Users\DELL\Documents\OBD\project2>

</code>```

ps: python version : 3.11.1
obd version : 0.7.1

i want to install obd library and try a simple code with it

Title: installing obdé library

Body:
i am trying to use obd library in python for my project; however when instaling it; i get the following problem:

PS C:\Users\DELL\Documents\OBD\project2> pip install "obd==0.7.1"
Could not import runpy module
Traceback (most recent call last):
  File "<frozen runpy>", line 15, in <module>
  File "<frozen importlib.util>", line 14, in <module>
  File "C:\Users\DELL\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 6, in <module>
    from collections import deque
ImportError: cannot import name 'deque' from 'collections' (C:\Users\DELL\AppData\Local\Programs\Python\Python311\Lib\collections\__init__.py)
PS C:\Users\DELL\Documents\OBD\project2>

ps: python version : 3.11.1
obd version : 0.7.1

i want to install obd library and try a simple code with it


问:
Use ffplay to output video to framebuffer
What would the command be to play a video (.avi/MPEG4) to the FrameBuffer using ffplay?
Device is an i.MX6ULL running Linux.</p>