问:
how to use useReducer handling visibility for 9 comboboxes
I'm trying to get a useReducer to make visible/hide 9 different comboboxes when they click a plus or minus button. I have it working withuseState but a co-worker said to use useReducer instead but I can't figure out how to make it work. The idea behind this is when they click the add button we show the appropiate combobox.  It won't work though.  I don't know what I'm missing.</p>
```<code>const initialState = {
infant1VisibleCombobox: true,
infant2VisibleCombobox: true,
infant3VisibleCombobox: true,
infant4VisibleCombobox: true,
infant5VisibleCombobox: true,
infant6VisibleCombobox: true,
infant7VisibleCombobox: true,
infant8VisibleCombobox: true,
infant9VisibleCombobox: true
};

const reducer = (state: any, action: { type: any }) => {
switch (action.type) {
  case 'add':
    var value = infantTraveler + 1;
    setInfantTraveler(value);

    switch (value) {
      case 1:
        return { infant1VisibleCombobox: !state };
        break;
      case 2:
        return { infant2VisibleCombobox: !state };
        break;
      case 3:
        return { infant3VisibleCombobox: !state };
        break;
      case 4:
        return { infant4VisibleCombobox: !state };
        break;
      case 5:
        return { infant5VisibleCombobox: !state };
        break;
      case 6:
        return { infant6VisibleCombobox: !state };
        break;
      case 7:
        return { infant7VisibleCombobox: !state };
        break;
      case 8:
        return { infant8VisibleCombobox: !state };
        break;
      case 9:
        return { infant9VisibleCombobox: !state };
        break;
    }
    break;
  case 'subtract':
    var value = infantTraveler - 1;
    setInfantTraveler(value);

    switch (value) {
      case 1:
        return { infant1VisibleCombobox: !state };
        break;
      case 2:
        return { infant2VisibleCombobox: !state };
        break;
      case 3:
        return { infant3VisibleCombobox: !state };
        break;
      case 4:
        return { infant4VisibleCombobox: !state };
        break;
      case 5:
        return { infant5VisibleCombobox: !state };
        break;
      case 6:
        return { infant6VisibleCombobox: !state };
        break;
      case 7:
        return { infant7VisibleCombobox: !state };
        break;
      case 8:
        return { infant8VisibleCombobox: !state };
        break;
      case 9:
        return { infant9VisibleCombobox: !state };
        break;
    }
    break;
  default:
    throw new Error();
}
};

const [state, dispatch] = useReducer(reducer, initialState);

<li className="bg-white p-1">
                                <div className="bg-gray3 flex justify-between items-center">
                                  <div>
                                    <p className="font-bold ml-2">Lap Infants</p>
                                    <p className="text-xs ml-2">(Under 2)</p>
                                  </div>
                                  <div className="flex flex-row pb-2 mt-2 mb-1">
                                    <Button
                                      style={minusStyle}
                                      onClick={() => dispatch({ type: 'subtract' })}
                                      disabled={disableInfantMinusButton}
                                    />
                                    <p className="w-[2px] !ml-2 !mr-3">{infantTraveler}</p>
                                    <Button
                                      className="ml-2"
                                      style={plusStyle}
                                      onClick={() => dispatch({ type: 'add' })}
                                      disabled={disableInfantPlusButton}
                                    />
                                  </div>
                                </div>
                                <div className="bg-gray3 flex items-start">
                                  <div className="pb-2 mt-2 pl-2" hidden={infant1VisibleCombobox}>
                                    <Dropdown
                                      value={infant1value}
                                      name="infant1Age"
                                      labelClassName="text-xs"
                                      label="Infant 1 Age"
                                      className="w-[90px] p-1"
                                      options={infantAge}
                                      onChange={handleInfant1Change}
                                    />
                                  </div>
                                  <div className="pb-2 mt-2 pl-16" hidden={infant2VisibleCombobox}>
                                    <Dropdown
                                      value={infant2value}
                                      name="infant2Age"
                                      labelClassName="text-xs"
                                      label="Infant 2 Age"
                                      className="w-[90px] p-1"
                                      options={infantAge}
                                      onChange={handleInfant2Change}
                                    />
                                  </div>
                                  <div className="pb-2 mt-2 pl-16 pr-2" hidden={infant3VisibleCombobox}>
                                    <Dropdown
                                      value={infant3value}
                                      name="infant3Age"
                                      labelClassName="text-xs"
                                      label="Infant 3 Age"
                                      className="w-[90px] p-1"
                                      options={infantAge}
                                      onChange={handleInfant3Change}
                                    />
                                  </div>
                                </div>
                                <div className="bg-gray3 flex items-start">
                                  <div className="pb-2 mt-2 pl-2" hidden={infant4VisibleCombobox}>
                                    <Dropdown
                                      value={infant4value}
                                      name="infant4Age"
                                      labelClassName="text-xs"
                                      label="Infant 4 Age"
                                      className="w-[90px] p-1"
                                      options={infantAge}
                                      onChange={handleInfant4Change}
                                    />
                                  </div>
                                  <div className="pb-2 mt-2 pl-16" hidden={infant5VisibleCombobox}>
                                    <Dropdown
                                      value={infant5value}
                                      name="infant5Age"
                                      labelClassName="text-xs"
                                      label="Infant 5 Age"
                                      className="w-[90px] p-1"
                                      options={infantAge}
                                      onChange={handleInfant5Change}
                                    />
                                  </div>
                                  <div className="pb-2 mt-2 pl-16 pr-2" hidden={infant6VisibleCombobox}>
                                    <Dropdown
                                      value={infant6value}
                                      name="infant6Age"
                                      labelClassName="text-xs"
                                      label="Infant 6 Age"
                                      className="w-[90px] p-1"
                                      options={infantAge}
                                      onChange={handleInfant6Change}
                                    />
                                  </div>
                                </div>
                                <div className="bg-gray3 flex items-start">
                                  <div className="pb-2 mt-2 pl-2" hidden={infant7VisibleCombobox}>
                                    <Dropdown
                                      value={infant7value}
                                      name="infant7Age"
                                      labelClassName="text-xs"
                                      label="Infant 7 Age"
                                      className="w-[90px] p-1"
                                      options={infantAge}
                                      onChange={handleInfant7Change}
                                    />
                                  </div>
                                  <div className="pb-2 mt-2 pl-16" hidden={infant8VisibleCombobox}>
                                    <Dropdown
                                      value={infant8value}
                                      name="infant8Age"
                                      labelClassName="text-xs"
                                      label="Infant 8 Age"
                                      className="w-[90px] p-1"
                                      options={infantAge}
                                      onChange={handleInfant8Change}
                                    />
                                  </div>
                                  <div className="pb-2 mt-2 pr-2 pl-16" hidden={infant9VisibleCombobox}>
                                    <Dropdown
                                      value={infant9value}
                                      name="infant9Age"
                                      labelClassName="text-xs"
                                      label="Infant 9 Age"
                                      className="w-[90px] p-1"
                                      options={infantAge}
                                      onChange={handleInfant9Change}
                                    />
                                  </div>
                                </div>
                              </li>
</code>```

Body:
I'm trying to get a useReducer to make visible/hide 9 different comboboxes when they click a plus or minus button. I have it working withuseState but a co-worker said to use useReducer instead but I can't figure out how to make it work. The idea behind this is when they click the add button we show the appropiate combobox.  It won't work though.  I don't know what I'm missing.

const initialState = {
infant1VisibleCombobox: true,
infant2VisibleCombobox: true,
infant3VisibleCombobox: true,
infant4VisibleCombobox: true,
infant5VisibleCombobox: true,
infant6VisibleCombobox: true,
infant7VisibleCombobox: true,
infant8VisibleCombobox: true,
infant9VisibleCombobox: true
};

const reducer = (state: any, action: { type: any }) => {
switch (action.type) {
  case 'add':
    var value = infantTraveler + 1;
    setInfantTraveler(value);

    switch (value) {
      case 1:
        return { infant1VisibleCombobox: !state };
        break;
      case 2:
        return { infant2VisibleCombobox: !state };
        break;
      case 3:
        return { infant3VisibleCombobox: !state };
        break;
      case 4:
        return { infant4VisibleCombobox: !state };
        break;
      case 5:
        return { infant5VisibleCombobox: !state };
        break;
      case 6:
        return { infant6VisibleCombobox: !state };
        break;
      case 7:
        return { infant7VisibleCombobox: !state };
        break;
      case 8:
        return { infant8VisibleCombobox: !state };
        break;
      case 9:
        return { infant9VisibleCombobox: !state };
        break;
    }
    break;
  case 'subtract':
    var value = infantTraveler - 1;
    setInfantTraveler(value);

    switch (value) {
      case 1:
        return { infant1VisibleCombobox: !state };
        break;
      case 2:
        return { infant2VisibleCombobox: !state };
        break;
      case 3:
        return { infant3VisibleCombobox: !state };
        break;
      case 4:
        return { infant4VisibleCombobox: !state };
        break;
      case 5:
        return { infant5VisibleCombobox: !state };
        break;
      case 6:
        return { infant6VisibleCombobox: !state };
        break;
      case 7:
        return { infant7VisibleCombobox: !state };
        break;
      case 8:
        return { infant8VisibleCombobox: !state };
        break;
      case 9:
        return { infant9VisibleCombobox: !state };
        break;
    }
    break;
  default:
    throw new Error();
}
};

const [state, dispatch] = useReducer(reducer, initialState);

Lap Infants

(Under 2)

                                    <Button
                                      style={minusStyle}
                                      onClick={() => dispatch({ type: 'subtract' })}
                                      disabled={disableInfantMinusButton}
                                    />

{infantTraveler}

                                    <Button
                                      className="ml-2"
                                      style={plusStyle}
                                      onClick={() => dispatch({ type: 'add' })}
                                      disabled={disableInfantPlusButton}
                                    />

                                    <Dropdown
                                      value={infant1value}
                                      name="infant1Age"
                                      labelClassName="text-xs"
                                      label="Infant 1 Age"
                                      className="w-[90px] p-1"
                                      options={infantAge}
                                      onChange={handleInfant1Change}
                                    />

                                    <Dropdown
                                      value={infant2value}
                                      name="infant2Age"
                                      labelClassName="text-xs"
                                      label="Infant 2 Age"
                                      className="w-[90px] p-1"
                                      options={infantAge}
                                      onChange={handleInfant2Change}
                                    />

                                    <Dropdown
                                      value={infant3value}
                                      name="infant3Age"
                                      labelClassName="text-xs"
                                      label="Infant 3 Age"
                                      className="w-[90px] p-1"
                                      options={infantAge}
                                      onChange={handleInfant3Change}
                                    />

                                    <Dropdown
                                      value={infant4value}
                                      name="infant4Age"
                                      labelClassName="text-xs"
                                      label="Infant 4 Age"
                                      className="w-[90px] p-1"
                                      options={infantAge}
                                      onChange={handleInfant4Change}
                                    />

                                    <Dropdown
                                      value={infant5value}
                                      name="infant5Age"
                                      labelClassName="text-xs"
                                      label="Infant 5 Age"
                                      className="w-[90px] p-1"
                                      options={infantAge}
                                      onChange={handleInfant5Change}
                                    />

                                    <Dropdown
                                      value={infant6value}
                                      name="infant6Age"
                                      labelClassName="text-xs"
                                      label="Infant 6 Age"
                                      className="w-[90px] p-1"
                                      options={infantAge}
                                      onChange={handleInfant6Change}
                                    />

                                    <Dropdown
                                      value={infant7value}
                                      name="infant7Age"
                                      labelClassName="text-xs"
                                      label="Infant 7 Age"
                                      className="w-[90px] p-1"
                                      options={infantAge}
                                      onChange={handleInfant7Change}
                                    />

                                    <Dropdown
                                      value={infant8value}
                                      name="infant8Age"
                                      labelClassName="text-xs"
                                      label="Infant 8 Age"
                                      className="w-[90px] p-1"
                                      options={infantAge}
                                      onChange={handleInfant8Change}
                                    />

                                    <Dropdown
                                      value={infant9value}
                                      name="infant9Age"
                                      labelClassName="text-xs"
                                      label="Infant 9 Age"
                                      className="w-[90px] p-1"
                                      options={infantAge}
                                      onChange={handleInfant9Change}
                                    />


来源: stackexchange

问:
how to setup multiple apps on different subdomains using docker compose and 'SteveLTN/https-portal'?
I am using DigitalOcean's droplet to host the apps.

I have different apps that I want to run on different subdomains (sub1.example.com,sub2.example.com, etc).

So far I managed to run just one of them on the main domain (eg: example.com)

The folder structure looks like this:

```<code>-/apps
   -/app1Folder
     docker-compose.yml
     Dockerfile
     -/codeFolder

   -/app2Folder
     docker-compose.yml
     Dockerfile
     -/codeFolder
</code>```

Each Dockerfile looks like this (ofc the appname and 5001 port is different for each app):

```<code>FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app

FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY ["App1.csproj", "."]
RUN dotnet restore "./App1.csproj"
COPY . .
WORKDIR "/src/."
RUN dotnet build "App1.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "App1.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .

ENV ASPNETCORE_URLS http://+:5001
EXPOSE 5001

ENTRYPOINT ["dotnet", "App1.dll"]
</code>```

Each docker-compose.yml file has the following structure:

```<code>version: '1'

services:
  app:
    build:
      context:  ./
      dockerfile: Dockerfile
  https-portal:
    image: steveltn/https-portal:1
    ports:
      - '80:80'
      - '443:443'
    links:
      - app
    restart: always
    environment:
      DOMAINS: 'sub1.example.com -> http://app:5001'
               # for app2 we route to 'sub2.example.com'
      # STAGE: 'production'
</code>```

From what I understood so far, I should have only one docker-compose file that should contain all my configs for both apps that i need to run.

I am not sure how to make the routing work or what should i change to make it work.

I am new to all this and don't exactly know where should i start.

Right now after i ran the first app, and it is working, I get the bellow error when trying to 'docker-compose up' the second one.

I think it has something to do with the fact that I am basically trying to run 2 docker images of https-portal that both expose ports 80 and 443 by default. Even if I change the ports on the second app (app2) it still gives the same error.

I am positive that the DNS is configured corectly and propagated to the host.

Any suggestion is welcomed! Please 'halp'! :)

```<code>Signing certificates from https://acme-staging-v02.api.letsencrypt.org/directory ...
https-portal_1  | Parsing account key...
https-portal_1  | Parsing CSR...
https-portal_1  | Found domains: sub2.example.com
https-portal_1  | Getting directory...
https-portal_1  | Directory found!
https-portal_1  | Registering account...
https-portal_1  | Already registered!
https-portal_1  | Creating new order...
https-portal_1  | Order created!
https-portal_1  | Verifying sub2.example.com...
https-portal_1  | Traceback (most recent call last):
https-portal_1  |   File "/bin/acme_tiny", line 198, in <module>
https-portal_1  |     main(sys.argv[1:])
https-portal_1  |   File "/bin/acme_tiny", line 194, in main
https-portal_1  |     signed_crt = get_crt(args.account_key, args.csr, args.acme_dir, log=LOGGER, CA=args.ca, disable_check=args.disable_check, directory_url=args.directory_url, contact=args.contact)
https-portal_1  |   File "/bin/acme_tiny", line 149, in get_crt
https-portal_1  |     raise ValueError("Challenge did not pass for {0}: {1}".format(domain, authorization))
https-portal_1  | ValueError: Challenge did not pass for sub2.example.com: {u'status': u'invalid', u'challenges': [{u'status': u'invalid', u'validationRecord': [{u'url': u'http://sub2.example.com/.well-known/acme-challenge/neHJEUpiAjxhvk1nicoRnDaT_xOAIXMaG8MxJstPy14', u'hostname': u'sub2.example.com', u'addressUsed': u'143.198.249.45', u'port': u'80', u'addressesResolved': [u'IP_ADDRESS']}], u'url': u'https://acme-staging-v02.api.letsencrypt.org/acme/chall-v3/4917620723/B0GD9Q', u'token': u'neHJEUpiAjxhvk1nicoRnDaT_xOAIXMaG8MxJstPy14', u'error': {u'status': 400, u'type': u'urn:ietf:params:acme:error:connection', u'detail': u'143.198.249.45: Fetching http://sub2.example.com/.well-known/acme-challenge/neHJEUpiAjxhvk1nicoRnDaT_xOAIXMaG8MxJstPy14: Error getting validation data'}, u'validated': u'2023-01-11T19:31:34Z', u'type': u'http-01'}], u'identifier': {u'type': u'dns', u'value': u'sub2.example.com'}, u'expires': u'2023-01-18T19:31:33Z'}
https-portal_1  | ================================================================================
https-portal_1  | Failed to sign sub2.example.com.
https-portal_1  | Make sure you DNS is configured correctly and is propagated to this host
https-portal_1  | machine. Sometimes that takes a while.
https-portal_1  | ================================================================================
https-portal_1  | Failed to obtain certs for sub2.example.com
https-portal_1  | [cont-init.d] 20-setup: exited 1.
https-portal_1  | [cont-finish.d] executing container finish scripts...
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I am using DigitalOcean's droplet to host the apps.

I have different apps that I want to run on different subdomains (sub1.example.com,sub2.example.com, etc).

So far I managed to run just one of them on the main domain (eg: example.com)

The folder structure looks like this:

-/apps
   -/app1Folder
     docker-compose.yml
     Dockerfile
     -/codeFolder

   -/app2Folder
     docker-compose.yml
     Dockerfile
     -/codeFolder

Each Dockerfile looks like this (ofc the appname and 5001 port is different for each app):

FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app

FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY ["App1.csproj", "."]
RUN dotnet restore "./App1.csproj"
COPY . .
WORKDIR "/src/."
RUN dotnet build "App1.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "App1.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .

ENV ASPNETCORE_URLS http://+:5001
EXPOSE 5001

ENTRYPOINT ["dotnet", "App1.dll"]

Each docker-compose.yml file has the following structure:

version: '1'

services:
  app:
    build:
      context:  ./
      dockerfile: Dockerfile
  https-portal:
    image: steveltn/https-portal:1
    ports:
      - '80:80'
      - '443:443'
    links:
      - app
    restart: always
    environment:
      DOMAINS: 'sub1.example.com -> http://app:5001'
               # for app2 we route to 'sub2.example.com'
      # STAGE: 'production'

From what I understood so far, I should have only one docker-compose file that should contain all my configs for both apps that i need to run.

I am not sure how to make the routing work or what should i change to make it work.

I am new to all this and don't exactly know where should i start.

Right now after i ran the first app, and it is working, I get the bellow error when trying to 'docker-compose up' the second one.

I think it has something to do with the fact that I am basically trying to run 2 docker images of https-portal that both expose ports 80 and 443 by default. Even if I change the ports on the second app (app2) it still gives the same error.

I am positive that the DNS is configured corectly and propagated to the host.

Any suggestion is welcomed! Please 'halp'! :)

Signing certificates from https://acme-staging-v02.api.letsencrypt.org/directory ...
https-portal_1  | Parsing account key...
https-portal_1  | Parsing CSR...
https-portal_1  | Found domains: sub2.example.com
https-portal_1  | Getting directory...
https-portal_1  | Directory found!
https-portal_1  | Registering account...
https-portal_1  | Already registered!
https-portal_1  | Creating new order...
https-portal_1  | Order created!
https-portal_1  | Verifying sub2.example.com...
https-portal_1  | Traceback (most recent call last):
https-portal_1  |   File "/bin/acme_tiny", line 198, in <module>
https-portal_1  |     main(sys.argv[1:])
https-portal_1  |   File "/bin/acme_tiny", line 194, in main
https-portal_1  |     signed_crt = get_crt(args.account_key, args.csr, args.acme_dir, log=LOGGER, CA=args.ca, disable_check=args.disable_check, directory_url=args.directory_url, contact=args.contact)
https-portal_1  |   File "/bin/acme_tiny", line 149, in get_crt
https-portal_1  |     raise ValueError("Challenge did not pass for {0}: {1}".format(domain, authorization))
https-portal_1  | ValueError: Challenge did not pass for sub2.example.com: {u'status': u'invalid', u'challenges': [{u'status': u'invalid', u'validationRecord': [{u'url': u'http://sub2.example.com/.well-known/acme-challenge/neHJEUpiAjxhvk1nicoRnDaT_xOAIXMaG8MxJstPy14', u'hostname': u'sub2.example.com', u'addressUsed': u'143.198.249.45', u'port': u'80', u'addressesResolved': [u'IP_ADDRESS']}], u'url': u'https://acme-staging-v02.api.letsencrypt.org/acme/chall-v3/4917620723/B0GD9Q', u'token': u'neHJEUpiAjxhvk1nicoRnDaT_xOAIXMaG8MxJstPy14', u'error': {u'status': 400, u'type': u'urn:ietf:params:acme:error:connection', u'detail': u'143.198.249.45: Fetching http://sub2.example.com/.well-known/acme-challenge/neHJEUpiAjxhvk1nicoRnDaT_xOAIXMaG8MxJstPy14: Error getting validation data'}, u'validated': u'2023-01-11T19:31:34Z', u'type': u'http-01'}], u'identifier': {u'type': u'dns', u'value': u'sub2.example.com'}, u'expires': u'2023-01-18T19:31:33Z'}
https-portal_1  | ================================================================================
https-portal_1  | Failed to sign sub2.example.com.
https-portal_1  | Make sure you DNS is configured correctly and is propagated to this host
https-portal_1  | machine. Sometimes that takes a while.
https-portal_1  | ================================================================================
https-portal_1  | Failed to obtain certs for sub2.example.com
https-portal_1  | [cont-init.d] 20-setup: exited 1.
https-portal_1  | [cont-finish.d] executing container finish scripts...


问:
Include instructor and course name in the YAML header
In the cover page of the term paper I should include some information as instructor’s name, name of the course, and name of the university.

I added the instructor’s name and the course name and into the YAML header, but they are not shown in the PDF. Moreover, I do not exactly know how to include the name of the PDF, I cannot find a list of tags for the YAML header.

If possible, I would like to solve the problem without installing much software and packages, as it increases the cost of reproducing the code on another computer.

Here the YAML header I used:

```<code>---
title: "Cool title"
author: "My Self"
date: "31st February 2023"
instructor: "Dr. Professor"
course: "Econ 101"
output:
  pdf_document:
    latex_engine: xelatex
editor_options:
  chunk_output_type: console
abstract: "This is my abstract, it will be about 100 words"
---
# Introduction #

</code>```

Body:
In the cover page of the term paper I should include some information as instructor’s name, name of the course, and name of the university.

I added the instructor’s name and the course name and into the YAML header, but they are not shown in the PDF. Moreover, I do not exactly know how to include the name of the PDF, I cannot find a list of tags for the YAML header.

If possible, I would like to solve the problem without installing much software and packages, as it increases the cost of reproducing the code on another computer.

Here the YAML header I used:

---
title: "Cool title"
author: "My Self"
date: "31st February 2023"
instructor: "Dr. Professor"
course: "Econ 101"
output:
  pdf_document:
    latex_engine: xelatex
editor_options:
  chunk_output_type: console
abstract: "This is my abstract, it will be about 100 words"
---
# Introduction #


问:
VSCodeVim Extension substitute keybindings
With the VSCodeVim Extension, I'd like to map a keybinding (leader + "p") to a substitute command that wraps the text on the current line with "print(TEXT)", so that e.g.,

```<code>f'The value of `x` is {x}.'
</code>```

Becomes

```<code>print(f'The value of `x` is {x}.')
</code>```

But I'm having trouble defining that key binding in VS Code settings.json. Although the following works as expected, moving the cursor to the top of the file:

```<code>"vim.normalModeKeyBindings": [
    {
      "before": ["<leader>", "g"],
      "commands": [":1"]
    }
]
</code>```

Even this simple substitute command does not work:

```<code>"vim.normalModeKeyBindings": [
    {
      "before": ["<leader>", "p"],
      "commands": [":s/a/A/"]
    }
]
</code>```

Instead, the text :s/a/A/ is entered in the command-mode prompt (I can see it!), but the buffer is functionally back in normal mode, so I can't submit the command. If I re-enter command-mode, the substitute command disappears.

For now I have this inane solution:

```<code>"vim.normalModeKeyBindings": [
    {
      "before": ["<leader>", "p"],
      "after": [":", "s", "/", "^", "/", "p", "r", "i", "n", "t", "(", "/", "<Cr>", ":", "s", "/", "$", "/", ")", "/", "<Cr>"]
    }
]
</code>```

But it's ugly and tedious to code, so I'd like to find a better solution for other implementations of similar keybindings with substitute.

Bonus: If you can help me code a keybinding(s) that will effectively toggle the print statement in and out, that would be amazing. So another submission of (leader + "p") would bring us back to

```<code>f'The value of `x` is {x}.'
</code>```

A hack might be to map (leader + "P") to delete the first 6 and final character of the line.

Body:
With the VSCodeVim Extension, I'd like to map a keybinding (leader + "p") to a substitute command that wraps the text on the current line with "print(TEXT)", so that e.g.,

f'The value of `x` is {x}.'

Becomes

print(f'The value of `x` is {x}.')

But I'm having trouble defining that key binding in VS Code settings.json. Although the following works as expected, moving the cursor to the top of the file:

"vim.normalModeKeyBindings": [
    {
      "before": ["<leader>", "g"],
      "commands": [":1"]
    }
]

Even this simple substitute command does not work:

"vim.normalModeKeyBindings": [
    {
      "before": ["<leader>", "p"],
      "commands": [":s/a/A/"]
    }
]

Instead, the text :s/a/A/ is entered in the command-mode prompt (I can see it!), but the buffer is functionally back in normal mode, so I can't submit the command. If I re-enter command-mode, the substitute command disappears.

For now I have this inane solution:

"vim.normalModeKeyBindings": [
    {
      "before": ["<leader>", "p"],
      "after": [":", "s", "/", "^", "/", "p", "r", "i", "n", "t", "(", "/", "<Cr>", ":", "s", "/", "$", "/", ")", "/", "<Cr>"]
    }
]

But it's ugly and tedious to code, so I'd like to find a better solution for other implementations of similar keybindings with substitute.

Bonus: If you can help me code a keybinding(s) that will effectively toggle the print statement in and out, that would be amazing. So another submission of (leader + "p") would bring us back to

f'The value of `x` is {x}.'

A hack might be to map (leader + "P") to delete the first 6 and final character of the line.


问:
How do I make pycharm recognize a DLL as a valid import
First of all, my python script runs through without any issue. Please see below code and attached pic for pycharm's "Unresolved reference" warning sign, which I'm trying to get rid of.
Do I need to create a wrapper for the DLL for python to recognize it as a valid import module?

from Common.APIs import GeneratorAPI

This pic shows the project folder structure containing the DLLs

This pic shows the warning


问:
Correct way to use NSValueTransformer.BooleanTransformerName without dlopen?
The task is to call NSObject.Bind with a value converter. So, in Swift it may be done as following (see options argument)

```<code>myObj.bind(key,
        toObject: objToBind
        withKeyPath: keyPath
        options: [NSValueTransformerNameBindingOption:
                                 NSNegateBooleanTransformerName])
</code>```

I was able to port this on C# as following (and this works as expected)

```<code>var AppKit_libHandle = Dlfcn.dlopen(Constants.AppKitLibrary, 0);
var bindingOptionKey = Dlfcn.GetStringConstant(AppKit_libHandle,
                                          "NSValueTransformerNameBindingOption");
var negateBooleanTransformerKey = Dlfcn.GetStringConstant(AppKit_libHandle,
                                          "NSNegateBooleanTransformerName");
var options = NSDictionary.FromObjectAndKey(negateBooleanTransformerKey,
                                           bindingOptionKey);
Dlfcn.dlclose(AppKit_libHandle);

myObj.Bind(key, objToBind, keyPath, options);
</code>```

This works as expected, but a dlopen-related stuff looks a little bit wired and not maintenable.

I performed some research and found that Xamarin provides ready-to-use Foundation.NSValueTransformer.BooleanTransformerName constant which can be used as ready-to-use value for negateBooleanTransformerKey.

But I can't find anything for Dlfcn.GetStringConstant(AppKit_libHandle, "NSValueTransformerNameBindingOption");. Am I missing something? Is there a correct way to set up value transformer without low-level tricks?

Body:
The task is to call NSObject.Bind with a value converter. So, in Swift it may be done as following (see options argument)

myObj.bind(key,
        toObject: objToBind
        withKeyPath: keyPath
        options: [NSValueTransformerNameBindingOption:
                                 NSNegateBooleanTransformerName])

I was able to port this on C# as following (and this works as expected)

var AppKit_libHandle = Dlfcn.dlopen(Constants.AppKitLibrary, 0);
var bindingOptionKey = Dlfcn.GetStringConstant(AppKit_libHandle,
                                          "NSValueTransformerNameBindingOption");
var negateBooleanTransformerKey = Dlfcn.GetStringConstant(AppKit_libHandle,
                                          "NSNegateBooleanTransformerName");
var options = NSDictionary.FromObjectAndKey(negateBooleanTransformerKey,
                                           bindingOptionKey);
Dlfcn.dlclose(AppKit_libHandle);

myObj.Bind(key, objToBind, keyPath, options);

This works as expected, but a dlopen-related stuff looks a little bit wired and not maintenable.

I performed some research and found that Xamarin provides ready-to-use Foundation.NSValueTransformer.BooleanTransformerName constant which can be used as ready-to-use value for negateBooleanTransformerKey.

But I can't find anything for Dlfcn.GetStringConstant(AppKit_libHandle, "NSValueTransformerNameBindingOption");. Am I missing something? Is there a correct way to set up value transformer without low-level tricks?


问:
Blurry text with css rotate
I have a problem with a CSS animation. I try to rotate a simple card, but this effect add bluer for every text in the card.
I have a pen here:
https://codepen.io/xdesign/pen/GRBmEJa

I've tried 2 days to figure out what is happening, i've read i think 20 posts with solutions like:

```<code>-webkit-backface-visibility: hidden;
-webkit-transform: translateZ(0) scale(1, 1);
-webkit-transform: translateZ(0);
scale: 1.05
-webkit-perspective: 1000;
-webkit-font-smoothing: antialiased;
</code>```

Absolutely nothing working... I am not expert in design, i am a backend developer, however, i must do some things in design. But i can't figure out, how to remove the blur from text.
I've already read ~20 posts about blurry text.... so if anyone can help me with this i'll really appreciate.

Updated: i want to remove blurry text

Title: Blurry text with css rotate

Body:
I have a problem with a CSS animation. I try to rotate a simple card, but this effect add bluer for every text in the card.
I have a pen here:
https://codepen.io/xdesign/pen/GRBmEJa

I've tried 2 days to figure out what is happening, i've read i think 20 posts with solutions like:

-webkit-backface-visibility: hidden;
-webkit-transform: translateZ(0) scale(1, 1);
-webkit-transform: translateZ(0);
scale: 1.05
-webkit-perspective: 1000;
-webkit-font-smoothing: antialiased;

Absolutely nothing working... I am not expert in design, i am a backend developer, however, i must do some things in design. But i can't figure out, how to remove the blur from text.
I've already read ~20 posts about blurry text.... so if anyone can help me with this i'll really appreciate.

Updated: i want to remove blurry text


问:
Updates.channel is coming as null after setting up expo-updates
In my project I am using expo-sdk:43 along with expo-updates.
I have setup the channel property in eas.json file.

```<code>{
  "cli": {
    "version": ">= 0.52.0"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal",
      "channel":"dev"
    },
    "preview": {
      "android": {
        "buildType": "apk"
      },
      "channel":"preview"
    },
    "production": {}
  },
  "submit": {
    "production": {}
  }
}

</code>```

I have tried to publish my updates through EAS update, but it is not working and the app is not receiving any update. I have tried to do an apk build for the application, and tried to get the output of Updates.Channel and it is outputting as undefined.

```<code>eas build -p android --profile --preview

eas update --branch preview --message "update"
</code>```

But, when I build the app, the build is successful, in the eas logs I can see that it shows that channel property has also been configured.

Can someone please help what might be the possible issue in this case?

I have also tried to do the same steps with an expo-init command (But with expo sdk:47) and minimal app setup and it is working as expected.

Body:
In my project I am using expo-sdk:43 along with expo-updates.
I have setup the channel property in eas.json file.

{
  "cli": {
    "version": ">= 0.52.0"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal",
      "channel":"dev"
    },
    "preview": {
      "android": {
        "buildType": "apk"
      },
      "channel":"preview"
    },
    "production": {}
  },
  "submit": {
    "production": {}
  }
}

I have tried to publish my updates through EAS update, but it is not working and the app is not receiving any update. I have tried to do an apk build for the application, and tried to get the output of Updates.Channel and it is outputting as undefined.

eas build -p android --profile --preview

eas update --branch preview --message "update"

But, when I build the app, the build is successful, in the eas logs I can see that it shows that channel property has also been configured.

Can someone please help what might be the possible issue in this case?

I have also tried to do the same steps with an expo-init command (But with expo sdk:47) and minimal app setup and it is working as expected.


问:
When a button is clicked, the function should be executed, but the page should not be refreshed
I have a problem with my project and I don't know how to solve it.
When the button is clicked the page returns with refresh the button should do the task but the page should not refresh what can I do it

```<code>My view:

    post = Post.objects.get(id=pk)

    liked =False
    if post.like.filter(id=request.user.id).exists():
        post.like.remove(request.user)
        liked = False
    else:
        post.like.add(request.user)
        liked = True

    return redirect(request.META['HTTP_REFERER'])
</code>```

Html

```<code><a style="text-decoration: dashed; color: white;" type="submit" href="{% url 'like' n.pk %}">
    <i style="font-size: x-large;" class="fa-regular fa-heart"></i>
</a>
</code>```

Url

```<code>    path('like/<int:pk>/',LikeView,name="like"),

</code>```

Body:
I have a problem with my project and I don't know how to solve it.
When the button is clicked the page returns with refresh the button should do the task but the page should not refresh what can I do it

My view:

    post = Post.objects.get(id=pk)

    liked =False
    if post.like.filter(id=request.user.id).exists():
        post.like.remove(request.user)
        liked = False
    else:
        post.like.add(request.user)
        liked = True

    return redirect(request.META['HTTP_REFERER'])

Html

Url

    path('like/<int:pk>/',LikeView,name="like"),


问:
Confused on Regex Missing some matches and hitting others
I currently have a regex function that finds all matches of a word within html on a page and replaces that with a string that includes html(essentially places a span around it with a highlight CSS class).

It is working as intended but is missing most matches in some areas and I can't point out why it would miss matches in other areas considering there is no difference in the html. I will bold which word matches it would hit in a scenario and which it wouldn't I would leave italicized.

Lets say the word given that I want matched in the formula is "income"

```<code><p> This is the **income**of your **income** welcome to the **income**</p>

<p> Loren ipsum loren ipsum  Loren ipsum loren ipsum  Loren ipsum loren income  Loren ipsum loren ipsum *income* Loren ipsum loren ipsum  Loren ipsum loren ipsum  Loren ipsum loren ipsum **income**. </p>
</code>```

sometimes it will match with an instance of the word 'income' in one page refresh and others it will not. Very strange.

Here is the listed Regex that I am using below

const regex = new RegExp('<(?!th)[^>]*>[^<]*(\\b' + wordToMatch + '\\b)', 'gi');

Currently its doing what is intended which is

ignoring any inline text within a th tag

capturing only the whole word

capturing more than one instance of the word (but missing some instances)

capturing only text in-between tags

case insensitive

If anyone has any theories I am open to hear them! and yes I know there are better ways than using Regex.

function highlight() {

  var lastSearch = "The income";
  var inputText = $('.component.content');

  if (lastSearch) {
    lastSearch = lastSearch.split(' ');
    for (var index in lastSearch) {
      var MatchedWord = lastSearch[index];
      if (MatchedWord.length > 2 && inputText && inputText.length > 0) {
        var innerHTML = inputText[0].innerHTML;
        var doesTermExist = innerHTML.toLowerCase().indexOf(MatchedWord.toLowerCase());
        if (doesTermExist >= 0) {
          const regex = new RegExp('<(?!th)[^>]*?>[^<]*(\\b' + MatchedWord + '\\b)', 'gi');
          $('.component.content').first().html($('.component.content').first().html().replace(regex,
            function(match, capture) {
              return match.substr(0, match.length - capture.length) + "" + capture + ""
            }));
        }
      }
    }
  }
}

window.addEventListener('DOMContentLoaded', highlight);```
<pre class="snippet-code-css lang-css prettyprint-override"><code>.document-highlight {
  font-weight: 700;
  background-color: yellow;
}</code>```

<!DOCTYPE html>

  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="../JS_Sitecore_ScratchPAge/eroc.css">
  <link/>

  <title>Document</title>

Wet vs. Dry Funding States

              WET FUNDING STATES: Funds are sent on date of Closing or date of disbursement

              Alabama
               Nebraska

               Arkansas
              New Hampshire

               Colorado
              New Jersey

               Connecticut
              New Mexico (purchases)

               Delaware
              New York

               District of Columbia
              North Carolina

               Florida
               North Dakota

               Georgia
              Ohio

               Illinois
              Oklahoma

               Indiana
              Pennsylvania

               Iowa
              Rhode Island

              income income the welcome to the jungle
               Kansas
              South Carolina

               Kentucky
              South Dakota

               Louisiana
              The
              further
              th
              furthe
              Further
              the further
              Tennessee
              Tennessee

              Maine
              Utah

               Maryland
              Texas

               Massachusetts
              Vermont

              Michigan
              Virginia

               Minnesota
               West Virginia

               Mississippi
              Wisconsin

               Missouri
              Wyoming

               Montana

Note that while the Freddie Mac guidance referenced below refers to the selling guide section 5307.1 in relation to securities accounts (stocks, bonds, mutual funds) and depository account (checking/savings), the Fannie Mae guidance is
                  not written in their selling guide. Only a handful of lenders have received permission to use this income source from Fannie Mae, and it can be a useful tool to qualify the borrower both as a main stream of income or as supplemental
                  income to solve for minor DTI restructures. This is separate from the Fannie Mae guidelines surrounding employment-related assets and IRA distributions found in section B3-3.1-09.

Assets as income involves reviewing the balance in the borrowers various asset accounts and using a calculation to determine a monthly income that can be used to qualify the loan.

              DRY FUNDING STATES: Funds are sent when the Wire Team receives a funding request from Title/Escrow

              Alaska
              Nevada

              Arizona
              New Mexico (refinances)

              California
              Oregon
              The Further

              Idaho
              Washington

              Hawaii

```

Body:
I currently have a regex function that finds all matches of a word within html on a page and replaces that with a string that includes html(essentially places a span around it with a highlight CSS class).

It is working as intended but is missing most matches in some areas and I can't point out why it would miss matches in other areas considering there is no difference in the html. I will bold which word matches it would hit in a scenario and which it wouldn't I would leave italicized.

Lets say the word given that I want matched in the formula is "income"

 This is the **income**of your **income** welcome to the **income**

 Loren ipsum loren ipsum  Loren ipsum loren ipsum  Loren ipsum loren income  Loren ipsum loren ipsum *income* Loren ipsum loren ipsum  Loren ipsum loren ipsum  Loren ipsum loren ipsum **income**.

sometimes it will match with an instance of the word 'income' in one page refresh and others it will not. Very strange.

Here is the listed Regex that I am using below

const regex = new RegExp('<(?!th)[^>]*>[^<]*(\\b' + wordToMatch + '\\b)', 'gi');

Currently its doing what is intended which is

ignoring any inline text within a th tag

capturing only the whole word

capturing more than one instance of the word (but missing some instances)

capturing only text in-between tags

case insensitive

If anyone has any theories I am open to hear them! and yes I know there are better ways than using Regex.

function highlight() {

  var lastSearch = "The income";
  var inputText = $('.component.content');

  if (lastSearch) {
    lastSearch = lastSearch.split(' ');
    for (var index in lastSearch) {
      var MatchedWord = lastSearch[index];
      if (MatchedWord.length > 2 && inputText && inputText.length > 0) {
        var innerHTML = inputText[0].innerHTML;
        var doesTermExist = innerHTML.toLowerCase().indexOf(MatchedWord.toLowerCase());
        if (doesTermExist >= 0) {
          const regex = new RegExp('<(?!th)[^>]*?>[^<]*(\\b' + MatchedWord + '\\b)', 'gi');
          $('.component.content').first().html($('.component.content').first().html().replace(regex,
            function(match, capture) {
              return match.substr(0, match.length - capture.length) + "" + capture + ""
            }));
        }
      }
    }
  }
}

window.addEventListener('DOMContentLoaded', highlight);

.document-highlight {
  font-weight: 700;
  background-color: yellow;
}

<!DOCTYPE html>

  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="../JS_Sitecore_ScratchPAge/eroc.css">
  <link/>

  <title>Document</title>

Wet vs. Dry Funding States

              WET FUNDING STATES: Funds are sent on date of Closing or date of disbursement

              Alabama
               Nebraska

               Arkansas
              New Hampshire

               Colorado
              New Jersey

               Connecticut
              New Mexico (purchases)

               Delaware
              New York

               District of Columbia
              North Carolina

               Florida
               North Dakota

               Georgia
              Ohio

               Illinois
              Oklahoma

               Indiana
              Pennsylvania

               Iowa
              Rhode Island

              income income the welcome to the jungle
               Kansas
              South Carolina

               Kentucky
              South Dakota

               Louisiana
              The
              further
              th
              furthe
              Further
              the further
              Tennessee
              Tennessee

              Maine
              Utah

               Maryland
              Texas

               Massachusetts
              Vermont

              Michigan
              Virginia

               Minnesota
               West Virginia

               Mississippi
              Wisconsin

               Missouri
              Wyoming

               Montana

Note that while the Freddie Mac guidance referenced below refers to the selling guide section 5307.1 in relation to securities accounts (stocks, bonds, mutual funds) and depository account (checking/savings), the Fannie Mae guidance is
                  not written in their selling guide. Only a handful of lenders have received permission to use this income source from Fannie Mae, and it can be a useful tool to qualify the borrower both as a main stream of income or as supplemental
                  income to solve for minor DTI restructures. This is separate from the Fannie Mae guidelines surrounding employment-related assets and IRA distributions found in section B3-3.1-09.

Assets as income involves reviewing the balance in the borrowers various asset accounts and using a calculation to determine a monthly income that can be used to qualify the loan.

              DRY FUNDING STATES: Funds are sent when the Wire Team receives a funding request from Title/Escrow

              Alaska
              Nevada

              Arizona
              New Mexico (refinances)

              California
              Oregon
              The Further

              Idaho
              Washington

              Hawaii


问:
sending local notifications ionic/angular cordova app not possible
I have a small app done with ionic angular. It is a simple form register with three fields, userid, password and role. The user has to fill the form and submit to the server. I need this app could also work offline. So I convert it to a pwa app, using the angular service worker feature. The app works Ok, but up to now there is one thing I can't do.
When there is offline, the form data are saved on the device and when online, these data are read and send to the server by the service worker, up to here all is working, but I would want, in this case, to inform the customer that the data were sent to DB. Not possible, try with notification.requestPermission...not working. It is strange, without pwa, I mean a normal app, notification.requestPermission works perfectly, so It is a problem with service worker.
What is wrong?</p>


问:
WP-CLI create a form
I am here because I need your help. I am working on a project with WP-CLI.
For this project, I need to create a form. But is it possible to create a form with WP-CLI. I have seen some plugins to do this like Gravity Forms, Ninja Forms or WPForms but we have to pay to use them.

Is it possible without a plugin? Or is there a plugin to create froms with WP-CLI (free)?

Thanks for your help!

Title: WP-CLI create a form


问:
Favicon not showing on web server but shows on localhost
So I've never heard about this issue before or come across it so I don't know why its happening, I have a normal favicon link that works on localhost, but does not work on an actual server and it doesn't even get the image in the network tab.

Left tab is the localhost, right tab is the actual server on a domain.

Both sites have the exact same code and file structure, but as you can see the actual website doesn't even recognize that the file needs to be fetched. Any ideas why?

I don't think it will provide any extra value but here is the favicon link tag

```<code><link rel="icon" type="image/x-icon" href="favicon.ico">
</code>```

Body:
So I've never heard about this issue before or come across it so I don't know why its happening, I have a normal favicon link that works on localhost, but does not work on an actual server and it doesn't even get the image in the network tab.

Left tab is the localhost, right tab is the actual server on a domain.

Both sites have the exact same code and file structure, but as you can see the actual website doesn't even recognize that the file needs to be fetched. Any ideas why?

I don't think it will provide any extra value but here is the favicon link tag

<link rel="icon" type="image/x-icon" href="favicon.ico">


问:
Counting Shared Libraries (.so) Files
Is there any method to count shared libraries (.so) programmatically. for example example.apk/lib/arm64-v8a/exp.so
i just want to count how much.so files is there in lib folder inside .apk file</p>

Title: Counting Shared Libraries (.so) Files


问:
Draw a contour on the leaf to calculate the area using OpenCV
I am trying to draw a contour on the leaf to calculate the area of the leaf using OpenCV but cv2.findContours() does not draw a contour around the leaf but the other regions.

My Code

```<code>def Contours_Detection(image_path):
    img = cv2.imread(image_path)
    image = cv2.resize(img,(500,500), interpolation = cv2.INTER_AREA)
    lab = cv2.cvtColor(image, cv2.COLOR_BGR2LAB)

    # store the a-channel
    a_channel = lab[:,:,1]

    # Automate threshold using Otsu method
    th = cv2.threshold(a_channel,127,255,cv2.THRESH_BINARY_INV+cv2.THRESH_OTSU)[1]

    # Mask the result with the original image
    masked = cv2.bitwise_and(image, image, mask = th)
    blur = cv2.medianBlur(masked, 7)
    gray = cv2.cvtColor(blur, cv2.COLOR_BGR2GRAY)
    binary = cv2.threshold(gray,125, 255,cv2.THRESH_BINARY+cv2.THRESH_OTSU)[1]
    kernel = cv2.getStructuringElement(cv2.MORPH_RECT, (3,3))
    MORPH_close = cv2.morphologyEx(binary, cv2.MORPH_CLOSE, kernel, iterations=2)
    result = 255 - MORPH_close
    contours, hierarchy = cv2.findContours(result, mode=cv2.RETR_LIST, method=cv2.CHAIN_APPROX_NONE)
    Num_of_contour = len(contours)
    image_copy = image.copy()
    spot_on_org_img = cv2.drawContours(image_copy, contours, -1, (0, 255, 0), thickness=2)
    black_img = np.zeros(image.shape)

    # draw the contours on the black image
    spot_on_black_img = cv2.drawContours(black_img, contours, -1, (0,255,0), 1)
    return spot_on_black_img

image_path = '/content/IMG_3407.jpg'
spot_on_black_img = Contours_Detection(image_path)
cv2_imshow(spot_on_black_img)
</code>```

Input Image

Output Image

Body:
I am trying to draw a contour on the leaf to calculate the area of the leaf using OpenCV but cv2.findContours() does not draw a contour around the leaf but the other regions.

My Code

def Contours_Detection(image_path):
    img = cv2.imread(image_path)
    image = cv2.resize(img,(500,500), interpolation = cv2.INTER_AREA)
    lab = cv2.cvtColor(image, cv2.COLOR_BGR2LAB)

    # store the a-channel
    a_channel = lab[:,:,1]

    # Automate threshold using Otsu method
    th = cv2.threshold(a_channel,127,255,cv2.THRESH_BINARY_INV+cv2.THRESH_OTSU)[1]

    # Mask the result with the original image
    masked = cv2.bitwise_and(image, image, mask = th)
    blur = cv2.medianBlur(masked, 7)
    gray = cv2.cvtColor(blur, cv2.COLOR_BGR2GRAY)
    binary = cv2.threshold(gray,125, 255,cv2.THRESH_BINARY+cv2.THRESH_OTSU)[1]
    kernel = cv2.getStructuringElement(cv2.MORPH_RECT, (3,3))
    MORPH_close = cv2.morphologyEx(binary, cv2.MORPH_CLOSE, kernel, iterations=2)
    result = 255 - MORPH_close
    contours, hierarchy = cv2.findContours(result, mode=cv2.RETR_LIST, method=cv2.CHAIN_APPROX_NONE)
    Num_of_contour = len(contours)
    image_copy = image.copy()
    spot_on_org_img = cv2.drawContours(image_copy, contours, -1, (0, 255, 0), thickness=2)
    black_img = np.zeros(image.shape)

    # draw the contours on the black image
    spot_on_black_img = cv2.drawContours(black_img, contours, -1, (0,255,0), 1)
    return spot_on_black_img

image_path = '/content/IMG_3407.jpg'
spot_on_black_img = Contours_Detection(image_path)
cv2_imshow(spot_on_black_img)

Input Image

Output Image


问:
Can you update the Twilio Flex Agent image via plugin
We are using SSO to set up users for Flex. However, I can not work out how to pull in the user's avatar from Azure.

The only way I can think without having the images public is to create a plugin to set the image from the graph API but I'm not sure how you can set it.

Ideally the plugin should only run on login I guess.


问:
How to resolve the error "npm run build" exited with 1 vercel in vercel while deploy nextjs app?
I am getting this error while trying to deploy my nextjs app. I have tried these solutions but not works for me.

"Build & Development Settings", override the Build command and write CI='' npm run build not works.

CI=false not works

```<code>[00:40:43.944] Cloning github.com/AnoshaJaved123/landing (Branch: main, Commit: ea731c3)
[00:40:44.258] Previous build cache not available
[00:40:44.831] Cloning completed: 887.407ms
[00:40:45.272] Running "vercel build"
[00:40:45.821] Vercel CLI 28.10.3
[00:40:46.180] Installing dependencies...
[00:40:52.830] npm WARN deprecated source-map-resolve@0.6.0: See https://github.com/lydell/source-map-resolve#deprecated
[00:41:02.288]
[00:41:02.288] added 549 packages in 16s
[00:41:02.289]
[00:41:02.289] 109 packages are looking for funding
[00:41:02.289]   run `npm fund` for details
[00:41:02.310] Detected Next.js version: 13.0.4
[00:41:02.315] Detected `package-lock.json` generated by npm 7+...
[00:41:02.316] Running "npm run build"
[00:41:02.652]
[00:41:02.653] > web-builder@0.1.0 build
[00:41:02.653] > next build
[00:41:02.653]
[00:41:02.979] info  - Loaded env from /vercel/path0/.env
[00:41:03.127] Attention: Next.js now collects completely anonymous telemetry regarding usage.
[00:41:03.128] This information is used to shape Next.js' roadmap and prioritize features.
[00:41:03.128] 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:
[00:41:03.128] https://nextjs.org/telemetry
[00:41:03.128]
[00:41:03.260] info  - Linting and checking validity of types...
[00:41:06.141] info  - Creating an optimized production build...
[00:41:32.575] info  - Compiled successfully
[00:41:32.575] info  - Collecting page data...
[00:41:38.362]
[00:41:38.363] > Build optimization failed: found pages without a React Component as default export in
[00:41:38.363] pages/Editor/grapesUtils
[00:41:38.363] pages/templates/grapesUtils
[00:41:38.363]
[00:41:38.363] See https://nextjs.org/docs/messages/page-without-valid-component for more info.
[00:41:38.364]
[00:41:38.417] Error: Command "npm run build" exited with 1
</code>```

Body:
I am getting this error while trying to deploy my nextjs app. I have tried these solutions but not works for me.

"Build & Development Settings", override the Build command and write CI='' npm run build not works.

CI=false not works

[00:40:43.944] Cloning github.com/AnoshaJaved123/landing (Branch: main, Commit: ea731c3)
[00:40:44.258] Previous build cache not available
[00:40:44.831] Cloning completed: 887.407ms
[00:40:45.272] Running "vercel build"
[00:40:45.821] Vercel CLI 28.10.3
[00:40:46.180] Installing dependencies...
[00:40:52.830] npm WARN deprecated source-map-resolve@0.6.0: See https://github.com/lydell/source-map-resolve#deprecated
[00:41:02.288]
[00:41:02.288] added 549 packages in 16s
[00:41:02.289]
[00:41:02.289] 109 packages are looking for funding
[00:41:02.289]   run `npm fund` for details
[00:41:02.310] Detected Next.js version: 13.0.4
[00:41:02.315] Detected `package-lock.json` generated by npm 7+...
[00:41:02.316] Running "npm run build"
[00:41:02.652]
[00:41:02.653] > web-builder@0.1.0 build
[00:41:02.653] > next build
[00:41:02.653]
[00:41:02.979] info  - Loaded env from /vercel/path0/.env
[00:41:03.127] Attention: Next.js now collects completely anonymous telemetry regarding usage.
[00:41:03.128] This information is used to shape Next.js' roadmap and prioritize features.
[00:41:03.128] 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:
[00:41:03.128] https://nextjs.org/telemetry
[00:41:03.128]
[00:41:03.260] info  - Linting and checking validity of types...
[00:41:06.141] info  - Creating an optimized production build...
[00:41:32.575] info  - Compiled successfully
[00:41:32.575] info  - Collecting page data...
[00:41:38.362]
[00:41:38.363] > Build optimization failed: found pages without a React Component as default export in
[00:41:38.363] pages/Editor/grapesUtils
[00:41:38.363] pages/templates/grapesUtils
[00:41:38.363]
[00:41:38.363] See https://nextjs.org/docs/messages/page-without-valid-component for more info.
[00:41:38.364]
[00:41:38.417] Error: Command "npm run build" exited with 1


问:
Postresql; Execute a query against pg_statements, return the result and reset the count
I'm trying to graph the ouput of pg_statements, so we can see min by min the avg, min and max of time taken for transactions.
By default pg_statements appears to just be ever increasing counts.

(Currently stuck on  version 9.2)

so ive been trying variations of the below. Essentially, needing a query or function that will output the result and then do the reset command, so we get a fresh minute of data

```<code>create or replace function query_time()
returns TABLE(avg double precision, max double precision, min double precision)
language plpgsql as $$
begin
    create temporary table temp_table of query_time on commit drop;
    insert into temp_table
         select
            avg(total_time/calls) as avg,
            max(total_time/calls) as max,
            min(total_time/calls) as min
          from pg_stat_statements;
     select pg_stat_statements_reset();
    return query select * from temp_table;
end $$;
</code>```
```<code>WITH myResultSet AS
  ( SELECT
            avg(total_time/calls) as avg,
            max(total_time/calls) as max,
            min(total_time/calls) as min
          from pg_stat_statements
  )

, upd AS
  ( select pg_stat_statements_reset()
  )

SELECT *
FROM myResultSet ;

</code>```

Body:
I'm trying to graph the ouput of pg_statements, so we can see min by min the avg, min and max of time taken for transactions.
By default pg_statements appears to just be ever increasing counts.

(Currently stuck on  version 9.2)

so ive been trying variations of the below. Essentially, needing a query or function that will output the result and then do the reset command, so we get a fresh minute of data

create or replace function query_time()
returns TABLE(avg double precision, max double precision, min double precision)
language plpgsql as $$
begin
    create temporary table temp_table of query_time on commit drop;
    insert into temp_table
         select
            avg(total_time/calls) as avg,
            max(total_time/calls) as max,
            min(total_time/calls) as min
          from pg_stat_statements;
     select pg_stat_statements_reset();
    return query select * from temp_table;
end $$;

WITH myResultSet AS
  ( SELECT
            avg(total_time/calls) as avg,
            max(total_time/calls) as max,
            min(total_time/calls) as min
          from pg_stat_statements
  )

, upd AS
  ( select pg_stat_statements_reset()
  )

SELECT *
FROM myResultSet ;


问:
Discord.py V2 Giveaway Command Not Working
I am making a discord.py giveaway command. It puts the winners into the list 'winners' and then it's supposed to announce them. My issue is that I can print the winners to the terminal but I can't get the bot to mention the winners in the message it sends.

This is the code I am using:

```<code>@commands.hybrid_command(name='startgive')
@commands.has_permissions(administrator=True)
async def startgive(self, ctx: commands.Context, prize: str, duration: str, total_winners: int, *, channel: discord.TextChannel):
    await ctx.send(f"Giveaway created in <#{channel.id}> for {prize}, and will last {duration}.")
    duration_seconds = convert(duration)

    embed = discord.Embed(title = f"{prize} Giveaway!", color = ctx.author.color)
    embed.add_field(name='Ends', value=f"{duration}", inline = False)
    embed.add_field(name = "Hosted by:", value = ctx.author.mention, inline = False)
    embed.add_field(name='Winners', value=f"{total_winners}", inline = False)

    my_msg = await channel.send(embed = embed)
    await my_msg.add_reaction("")

    await asyncio.sleep(duration_seconds)

    new_msg = await channel.fetch_message(my_msg.id)

    users = []
    for reaction in new_msg.reactions:
        if reaction.emoji == '':
            async for user in reaction.users():
                if user != self.bot.user:
                    users.append(user.mention)

    if len(users) < total_winners:
            winners_number = len(users)
    else:
        winners_number = total_winners

    winners = []
    for i in range(winners_number):
        user = random.randint(0, winners_number)
        if users[user] not in winners:
            winners.append(users[user])

    print(', '.join(winners)) #This line is used to simply show that the winners array does hold a value of a user being mentioned

    updatedEmbed = discord.Embed(title = f"{prize} Giveaway!", color = ctx.author.color)
    updatedEmbed.add_field(name = "Hosted by:", value = ctx.author.mention, inline = False)
    updatedEmbed.add_field(name = "Winners:", value = f"{', '.join(winners)}", inline = False)
    updatedEmbed.set_footer(text = f"Ended", inline = False)
    await my_msg.edit(embed=updatedEmbed)

    await channel.send(f"Congratulations! {', '.join(winners)} won {prize}! Thank you for participating.")

def convert(time):
    pos = ["s","m","h","d"]

    time_dict = {"s" : 1, "m" : 60, "h" : 3600 , "d" : 3600*24}

    unit = time[-1]

    if unit not in pos:
        return -1
    try:
        val = int(time[:-1])
    except:
        return -2

    return val * time_dict[unit]
</code>```

Body:
I am making a discord.py giveaway command. It puts the winners into the list 'winners' and then it's supposed to announce them. My issue is that I can print the winners to the terminal but I can't get the bot to mention the winners in the message it sends.

This is the code I am using:

@commands.hybrid_command(name='startgive')
@commands.has_permissions(administrator=True)
async def startgive(self, ctx: commands.Context, prize: str, duration: str, total_winners: int, *, channel: discord.TextChannel):
    await ctx.send(f"Giveaway created in <#{channel.id}> for {prize}, and will last {duration}.")
    duration_seconds = convert(duration)

    embed = discord.Embed(title = f"{prize} Giveaway!", color = ctx.author.color)
    embed.add_field(name='Ends', value=f"{duration}", inline = False)
    embed.add_field(name = "Hosted by:", value = ctx.author.mention, inline = False)
    embed.add_field(name='Winners', value=f"{total_winners}", inline = False)

    my_msg = await channel.send(embed = embed)
    await my_msg.add_reaction("")

    await asyncio.sleep(duration_seconds)

    new_msg = await channel.fetch_message(my_msg.id)

    users = []
    for reaction in new_msg.reactions:
        if reaction.emoji == '':
            async for user in reaction.users():
                if user != self.bot.user:
                    users.append(user.mention)

    if len(users) < total_winners:
            winners_number = len(users)
    else:
        winners_number = total_winners

    winners = []
    for i in range(winners_number):
        user = random.randint(0, winners_number)
        if users[user] not in winners:
            winners.append(users[user])

    print(', '.join(winners)) #This line is used to simply show that the winners array does hold a value of a user being mentioned

    updatedEmbed = discord.Embed(title = f"{prize} Giveaway!", color = ctx.author.color)
    updatedEmbed.add_field(name = "Hosted by:", value = ctx.author.mention, inline = False)
    updatedEmbed.add_field(name = "Winners:", value = f"{', '.join(winners)}", inline = False)
    updatedEmbed.set_footer(text = f"Ended", inline = False)
    await my_msg.edit(embed=updatedEmbed)

    await channel.send(f"Congratulations! {', '.join(winners)} won {prize}! Thank you for participating.")

def convert(time):
    pos = ["s","m","h","d"]

    time_dict = {"s" : 1, "m" : 60, "h" : 3600 , "d" : 3600*24}

    unit = time[-1]

    if unit not in pos:
        return -1
    try:
        val = int(time[:-1])
    except:
        return -2

    return val * time_dict[unit]


问:
Error About React Native Execution (React Native gives unknow error after execution completed)
I was implementing Video Call module on my Project before getting this error. When I run react native project using npx react-native run-android. It gives me unknown errors. I have followed many articles to solve it but my problem is still there.

Error Which I got while execution. When 99% execution successfully completes then it gives me the error.

```<code>    info JS server already running.
    info Installing the app...

    > Configure project :app
    WARNING:The option setting 'android.enableDexingArtifactTransform.desugaring=false' is experimental.
    The current default is 'true'.

    > Configure project :react-native-firebase_app
    :react-native-firebase_app package.json found at C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-firebase\app\package.json
    :react-native-firebase_app:firebase.bom using default value: 30.5.0
    :react-native-firebase_app:play.play-services-auth using default value: 20.3.0
    :react-native-firebase_app package.json found at C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-firebase\app\package.json
    :react-native-firebase_app:version set from package.json: 15.7.0 (15,7,0 - 15007000)
    :react-native-firebase_app:android.compileSdk using custom value: 31
    :react-native-firebase_app:android.targetSdk using custom value: 31
    :react-native-firebase_app:android.minSdk using custom value: 21
    :react-native-firebase_app:reactNativeAndroidDir C:\Users\ZAIIIN\ChatApp\node_modules\react-native\android

    > Configure project :react-native-firebase_auth
    :react-native-firebase_auth package.json found at C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-firebase\auth\package.json
    :react-native-firebase_app package.json found at C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-firebase\app\package.json
    :react-native-firebase_auth:firebase.bom using default value: 30.5.0
    :react-native-firebase_auth package.json found at C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-firebase\auth\package.json
    :react-native-firebase_auth:version set from package.json: 15.7.0 (15,7,0 - 15007000)
    :react-native-firebase_auth:android.compileSdk using custom value: 31
    :react-native-firebase_auth:android.targetSdk using custom value: 31
    :react-native-firebase_auth:android.minSdk using custom value: 21
    :react-native-firebase_auth:reactNativeAndroidDir C:\Users\ZAIIIN\ChatApp\node_modules\react-native\android

    > Configure project :react-native-firebase_firestore
    :react-native-firebase_firestore package.json found at C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-firebase\firestore\package.json
    :react-native-firebase_app package.json found at C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-firebase\app\package.json
    :react-native-firebase_firestore:firebase.bom using default value: 30.5.0
    :react-native-firebase_firestore package.json found at C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-firebase\firestore\package.json
    :react-native-firebase_firestore:version set from package.json: 15.7.0 (15,7,0 - 15007000)
    :react-native-firebase_firestore:android.compileSdk using custom value: 31
    :react-native-firebase_firestore:android.targetSdk using custom value: 31
    :react-native-firebase_firestore:android.minSdk using custom value: 21
    :react-native-firebase_firestore:reactNativeAndroidDir C:\Users\ZAIIIN\ChatApp\node_modules\react-native\android

    > Configure project :react-native-firebase_storage
    :react-native-firebase_storage package.json found at C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-firebase\storage\package.json
    :react-native-firebase_app package.json found at C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-firebase\app\package.json
    :react-native-firebase_storage:firebase.bom using default value: 30.5.0
    :react-native-firebase_storage package.json found at C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-firebase\storage\package.json
    :react-native-firebase_storage:version set from package.json: 15.7.0 (15,7,0 - 15007000)
    :react-native-firebase_storage:android.compileSdk using custom value: 31
    :react-native-firebase_storage:android.targetSdk using custom value: 31
    :react-native-firebase_storage:android.minSdk using custom value: 21
    :react-native-firebase_storage:reactNativeAndroidDir C:\Users\ZAIIIN\ChatApp\node_modules\react-native\android

    > Configure project :react-native-reanimated
    AAR for react-native-reanimated has been found
    C:\Users\ZAIIIN\ChatApp\node_modules\react-native-reanimated\android\react-native-reanimated-70-hermes.aar
    WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 33

    This Android Gradle plugin (7.2.1) was tested up to compileSdk = 32

    This warning can be suppressed by adding
        android.suppressUnsupportedCompileSdk=33
    to this project's gradle.properties

    The build will continue, but you are strongly encouraged to update your project to
    use a newer Android Gradle Plugin that has been tested with compileSdk = 33

    > Task :app:mergeDebugNativeLibs FAILED

    Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

    You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

    See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
    347 actionable tasks: 3 executed, 344 up-to-date

    FAILURE: Build completed with 2 failures.

    1: Task failed with an exception.
    -----------
    * What went wrong:
    Execution failed for task ':app:mergeDebugNativeLibs'.
    > A failure occurred while executing com.android.build.gradle.internal.tasks.MergeNativeLibsTask$MergeNativeLibsTaskWorkAction
       > 2 files found with path 'lib/arm64-v8a/New folder/libjingle_peerconnection_so.so' from inputs:
          - C:\Users\ZAIIIN\.gradle\caches\transforms-3\b259cd2cc3b41e1063fc5003f03931e5\transformed\jetified-libjingle_peerconnection.so\arm64-v8a\New folder\libjingle_peerconnection_so.so
          - C:\Users\ZAIIIN\.gradle\caches\transforms-3\a88d183cc228d5f56d1c5c48beedc372\transformed\jetified-libjingle_peerconnection.so\arm64-v8a\New folder\libjingle_peerconnection_so.so
         If you are using jniLibs and CMake IMPORTED targets, see
         https://developer.android.com/r/tools/jniLibs-vs-imported-targets

    * Try:
    > Run with --stacktrace option to get the stack trace.
    > Run with --info or --debug option to get more log output.
    > Run with --scan to get full insights.
    ==============================================================================

    2: Task failed with an exception.
    -----------
    * What went wrong:
    java.lang.StackOverflowError (no error message)

    * Try:
    > Run with --stacktrace option to get the stack trace.
    > Run with --info or --debug option to get more log output.
    > Run with --scan to get full insights.
    ==============================================================================

    * Get more help at https://help.gradle.org

    BUILD FAILED in 1m 3s

    error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
    Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

    FAILURE: Build completed with 2 failures.

    1: Task failed with an exception.
    -----------
    * What went wrong:
    Execution failed for task ':app:mergeDebugNativeLibs'.
    > A failure occurred while executing com.android.build.gradle.internal.tasks.MergeNativeLibsTask$MergeNativeLibsTaskWorkAction
       > 2 files found with path 'lib/arm64-v8a/New folder/libjingle_peerconnection_so.so' from inputs:
          - C:\Users\ZAIIIN\.gradle\caches\transforms-3\b259cd2cc3b41e1063fc5003f03931e5\transformed\jetified-libjingle_peerconnection.so\arm64-v8a\New folder\libjingle_peerconnection_so.so
          - C:\Users\ZAIIIN\.gradle\caches\transforms-3\a88d183cc228d5f56d1c5c48beedc372\transformed\jetified-libjingle_peerconnection.so\arm64-v8a\New folder\libjingle_peerconnection_so.so
         If you are using jniLibs and CMake IMPORTED targets, see
         https://developer.android.com/r/tools/jniLibs-vs-imported-targets

    * Try:
    > Run with --stacktrace option to get the stack trace.
    > Run with --info or --debug option to get more log output.
    > Run with --scan to get full insights.
    ==============================================================================

    2: Task failed with an exception.
    -----------
    * What went wrong:
    java.lang.StackOverflowError (no error message)

    * Try:
    > Run with --stacktrace option to get the stack trace.
    > Run with --info or --debug option to get more log output.
    > Run with --scan to get full insights.
    ==============================================================================

    * Get more help at https://help.gradle.org

    BUILD FAILED in 1m 3s

        at makeError (C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-community\cli-platform-android\node_modules\execa\in    at C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
        at processTicksAndRejections (node:internal/process/task_queues:96:5)
        at async runOnAllDevices (C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
        at async Command.handleAction (C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-community\cli\build\index.js:142:9)info Run CLI with --verbose flag for more details.
</code>```

Packags

```<code>

     {
          "name": "ChatApp",
          "version": "0.0.1",
          "private": true,
          "scripts": {
            "android": "react-native run-android",
            "ios": "react-native run-ios",
            "start": "react-native start",
            "test": "jest",
            "lint": "eslint ."
          },
          "dependencies": {
            "@react-native-community/masked-view": "^0.1.11",
            "@react-native-community/netinfo": "^9.3.7",
            "@react-native-firebase/app": "^15.7.0",
            "@react-native-firebase/auth": "^15.7.0",
            "@react-native-firebase/firestore": "^15.7.0",
            "@react-native-firebase/storage": "^15.7.0",
            "@react-navigation/bottom-tabs": "^6.4.3",
            "@react-navigation/native": "^6.0.16",
            "@react-navigation/native-stack": "^6.9.4",
            "@reduxjs/toolkit": "^1.9.1",
            "@videosdk.live/react-native-sdk": "^0.0.41",
            "radio-buttons-react-native": "^1.0.4",
            "react": "18.1.0",
            "react-native": "^0.70.6",
            "react-native-flash-message": "^0.3.1",
            "react-native-gesture-handler": "^2.8.0",
            "react-native-gifted-chat": "^1.0.4",
            "react-native-image-picker": "^4.10.2",
            "react-native-incall-manager": "^4.0.1",
            "react-native-popup-menu": "^0.16.1",
            "react-native-push-notification": "^8.1.1",
            "react-native-reanimated": "^2.13.0",
            "react-native-safe-area-context": "^4.4.1",
            "react-native-screens": "^3.18.2",
            "react-native-vector-icons": "^9.2.0",
            "react-native-video": "^5.2.1",
            "react-native-webrtc": "^106.0.1",
            "react-navigation": "^4.4.4",
            "react-redux": "^8.0.5"
          },
          "devDependencies": {
            "@babel/core": "^7.12.9",
            "@babel/runtime": "^7.12.5",
            "@react-native-community/eslint-config": "^2.0.0",
            "babel-jest": "^29.3.1",
            "eslint": "^7.32.0",
            "jest": "^29.3.1",
            "metro-react-native-babel-preset": "0.72.3",
            "react-test-renderer": "18.1.0"
          },
          "jest": {
            "preset": "react-native"
          }
        }
</code>```

Android/App/build.gradle

```<code>    buildToolsVersion = "31.0.0"
    minSdkVersion = 21
    compileSdkVersion = 31
    targetSdkVersion = 31
</code>```

I faced this problem after applying Video Call Module. Please help me to solve this problem. Thank You!!!

Body:
I was implementing Video Call module on my Project before getting this error. When I run react native project using npx react-native run-android. It gives me unknown errors. I have followed many articles to solve it but my problem is still there.

Error Which I got while execution. When 99% execution successfully completes then it gives me the error.

    info JS server already running.
    info Installing the app...

    > Configure project :app
    WARNING:The option setting 'android.enableDexingArtifactTransform.desugaring=false' is experimental.
    The current default is 'true'.

    > Configure project :react-native-firebase_app
    :react-native-firebase_app package.json found at C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-firebase\app\package.json
    :react-native-firebase_app:firebase.bom using default value: 30.5.0
    :react-native-firebase_app:play.play-services-auth using default value: 20.3.0
    :react-native-firebase_app package.json found at C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-firebase\app\package.json
    :react-native-firebase_app:version set from package.json: 15.7.0 (15,7,0 - 15007000)
    :react-native-firebase_app:android.compileSdk using custom value: 31
    :react-native-firebase_app:android.targetSdk using custom value: 31
    :react-native-firebase_app:android.minSdk using custom value: 21
    :react-native-firebase_app:reactNativeAndroidDir C:\Users\ZAIIIN\ChatApp\node_modules\react-native\android

    > Configure project :react-native-firebase_auth
    :react-native-firebase_auth package.json found at C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-firebase\auth\package.json
    :react-native-firebase_app package.json found at C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-firebase\app\package.json
    :react-native-firebase_auth:firebase.bom using default value: 30.5.0
    :react-native-firebase_auth package.json found at C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-firebase\auth\package.json
    :react-native-firebase_auth:version set from package.json: 15.7.0 (15,7,0 - 15007000)
    :react-native-firebase_auth:android.compileSdk using custom value: 31
    :react-native-firebase_auth:android.targetSdk using custom value: 31
    :react-native-firebase_auth:android.minSdk using custom value: 21
    :react-native-firebase_auth:reactNativeAndroidDir C:\Users\ZAIIIN\ChatApp\node_modules\react-native\android

    > Configure project :react-native-firebase_firestore
    :react-native-firebase_firestore package.json found at C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-firebase\firestore\package.json
    :react-native-firebase_app package.json found at C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-firebase\app\package.json
    :react-native-firebase_firestore:firebase.bom using default value: 30.5.0
    :react-native-firebase_firestore package.json found at C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-firebase\firestore\package.json
    :react-native-firebase_firestore:version set from package.json: 15.7.0 (15,7,0 - 15007000)
    :react-native-firebase_firestore:android.compileSdk using custom value: 31
    :react-native-firebase_firestore:android.targetSdk using custom value: 31
    :react-native-firebase_firestore:android.minSdk using custom value: 21
    :react-native-firebase_firestore:reactNativeAndroidDir C:\Users\ZAIIIN\ChatApp\node_modules\react-native\android

    > Configure project :react-native-firebase_storage
    :react-native-firebase_storage package.json found at C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-firebase\storage\package.json
    :react-native-firebase_app package.json found at C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-firebase\app\package.json
    :react-native-firebase_storage:firebase.bom using default value: 30.5.0
    :react-native-firebase_storage package.json found at C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-firebase\storage\package.json
    :react-native-firebase_storage:version set from package.json: 15.7.0 (15,7,0 - 15007000)
    :react-native-firebase_storage:android.compileSdk using custom value: 31
    :react-native-firebase_storage:android.targetSdk using custom value: 31
    :react-native-firebase_storage:android.minSdk using custom value: 21
    :react-native-firebase_storage:reactNativeAndroidDir C:\Users\ZAIIIN\ChatApp\node_modules\react-native\android

    > Configure project :react-native-reanimated
    AAR for react-native-reanimated has been found
    C:\Users\ZAIIIN\ChatApp\node_modules\react-native-reanimated\android\react-native-reanimated-70-hermes.aar
    WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 33

    This Android Gradle plugin (7.2.1) was tested up to compileSdk = 32

    This warning can be suppressed by adding
        android.suppressUnsupportedCompileSdk=33
    to this project's gradle.properties

    The build will continue, but you are strongly encouraged to update your project to
    use a newer Android Gradle Plugin that has been tested with compileSdk = 33

    > Task :app:mergeDebugNativeLibs FAILED

    Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

    You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

    See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
    347 actionable tasks: 3 executed, 344 up-to-date

    FAILURE: Build completed with 2 failures.

    1: Task failed with an exception.
    -----------
    * What went wrong:
    Execution failed for task ':app:mergeDebugNativeLibs'.
    > A failure occurred while executing com.android.build.gradle.internal.tasks.MergeNativeLibsTask$MergeNativeLibsTaskWorkAction
       > 2 files found with path 'lib/arm64-v8a/New folder/libjingle_peerconnection_so.so' from inputs:
          - C:\Users\ZAIIIN\.gradle\caches\transforms-3\b259cd2cc3b41e1063fc5003f03931e5\transformed\jetified-libjingle_peerconnection.so\arm64-v8a\New folder\libjingle_peerconnection_so.so
          - C:\Users\ZAIIIN\.gradle\caches\transforms-3\a88d183cc228d5f56d1c5c48beedc372\transformed\jetified-libjingle_peerconnection.so\arm64-v8a\New folder\libjingle_peerconnection_so.so
         If you are using jniLibs and CMake IMPORTED targets, see
         https://developer.android.com/r/tools/jniLibs-vs-imported-targets

    * Try:
    > Run with --stacktrace option to get the stack trace.
    > Run with --info or --debug option to get more log output.
    > Run with --scan to get full insights.
    ==============================================================================

    2: Task failed with an exception.
    -----------
    * What went wrong:
    java.lang.StackOverflowError (no error message)

    * Try:
    > Run with --stacktrace option to get the stack trace.
    > Run with --info or --debug option to get more log output.
    > Run with --scan to get full insights.
    ==============================================================================

    * Get more help at https://help.gradle.org

    BUILD FAILED in 1m 3s

    error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
    Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

    FAILURE: Build completed with 2 failures.

    1: Task failed with an exception.
    -----------
    * What went wrong:
    Execution failed for task ':app:mergeDebugNativeLibs'.
    > A failure occurred while executing com.android.build.gradle.internal.tasks.MergeNativeLibsTask$MergeNativeLibsTaskWorkAction
       > 2 files found with path 'lib/arm64-v8a/New folder/libjingle_peerconnection_so.so' from inputs:
          - C:\Users\ZAIIIN\.gradle\caches\transforms-3\b259cd2cc3b41e1063fc5003f03931e5\transformed\jetified-libjingle_peerconnection.so\arm64-v8a\New folder\libjingle_peerconnection_so.so
          - C:\Users\ZAIIIN\.gradle\caches\transforms-3\a88d183cc228d5f56d1c5c48beedc372\transformed\jetified-libjingle_peerconnection.so\arm64-v8a\New folder\libjingle_peerconnection_so.so
         If you are using jniLibs and CMake IMPORTED targets, see
         https://developer.android.com/r/tools/jniLibs-vs-imported-targets

    * Try:
    > Run with --stacktrace option to get the stack trace.
    > Run with --info or --debug option to get more log output.
    > Run with --scan to get full insights.
    ==============================================================================

    2: Task failed with an exception.
    -----------
    * What went wrong:
    java.lang.StackOverflowError (no error message)

    * Try:
    > Run with --stacktrace option to get the stack trace.
    > Run with --info or --debug option to get more log output.
    > Run with --scan to get full insights.
    ==============================================================================

    * Get more help at https://help.gradle.org

    BUILD FAILED in 1m 3s

        at makeError (C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-community\cli-platform-android\node_modules\execa\in    at C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
        at processTicksAndRejections (node:internal/process/task_queues:96:5)
        at async runOnAllDevices (C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
        at async Command.handleAction (C:\Users\ZAIIIN\ChatApp\node_modules\@react-native-community\cli\build\index.js:142:9)info Run CLI with --verbose flag for more details.

Packags

     {
          "name": "ChatApp",
          "version": "0.0.1",
          "private": true,
          "scripts": {
            "android": "react-native run-android",
            "ios": "react-native run-ios",
            "start": "react-native start",
            "test": "jest",
            "lint": "eslint ."
          },
          "dependencies": {
            "@react-native-community/masked-view": "^0.1.11",
            "@react-native-community/netinfo": "^9.3.7",
            "@react-native-firebase/app": "^15.7.0",
            "@react-native-firebase/auth": "^15.7.0",
            "@react-native-firebase/firestore": "^15.7.0",
            "@react-native-firebase/storage": "^15.7.0",
            "@react-navigation/bottom-tabs": "^6.4.3",
            "@react-navigation/native": "^6.0.16",
            "@react-navigation/native-stack": "^6.9.4",
            "@reduxjs/toolkit": "^1.9.1",
            "@videosdk.live/react-native-sdk": "^0.0.41",
            "radio-buttons-react-native": "^1.0.4",
            "react": "18.1.0",
            "react-native": "^0.70.6",
            "react-native-flash-message": "^0.3.1",
            "react-native-gesture-handler": "^2.8.0",
            "react-native-gifted-chat": "^1.0.4",
            "react-native-image-picker": "^4.10.2",
            "react-native-incall-manager": "^4.0.1",
            "react-native-popup-menu": "^0.16.1",
            "react-native-push-notification": "^8.1.1",
            "react-native-reanimated": "^2.13.0",
            "react-native-safe-area-context": "^4.4.1",
            "react-native-screens": "^3.18.2",
            "react-native-vector-icons": "^9.2.0",
            "react-native-video": "^5.2.1",
            "react-native-webrtc": "^106.0.1",
            "react-navigation": "^4.4.4",
            "react-redux": "^8.0.5"
          },
          "devDependencies": {
            "@babel/core": "^7.12.9",
            "@babel/runtime": "^7.12.5",
            "@react-native-community/eslint-config": "^2.0.0",
            "babel-jest": "^29.3.1",
            "eslint": "^7.32.0",
            "jest": "^29.3.1",
            "metro-react-native-babel-preset": "0.72.3",
            "react-test-renderer": "18.1.0"
          },
          "jest": {
            "preset": "react-native"
          }
        }

Android/App/build.gradle

    buildToolsVersion = "31.0.0"
    minSdkVersion = 21
    compileSdkVersion = 31
    targetSdkVersion = 31

I faced this problem after applying Video Call Module. Please help me to solve this problem. Thank You!!!


问:
how to read data from AWS Glue Data catalog table (hive metastore )table in AWS Glue
Step 1: I am creating a view table from dataframe

```<code>datasource0.createOrReplaceTempView("act_data_view")
</code>```

Step 2: Creating a permanent table in hive metastore(default database) and copying data from view "act_data_view" to permanent table "act_data_permanent"

```<code>spark.sql("select * from act_data_view").write.saveAsTable("act_data_permanent")
</code>```

I am able to see the newly created "act_data_permanent" table in glue data catalog.
But, when i do the count on the table , the count is showing as 0.

```<code>spark.sql("select count(*) from act_data_permanent")
count=o
</code>```

Any thoughts, on why the data is not copied to "act_data_permanent" table or Am i doing wrong in querying the data from Data catalog. Any leads, would be appreciated . Thanks.!

Body:
Step 1: I am creating a view table from dataframe

datasource0.createOrReplaceTempView("act_data_view")

Step 2: Creating a permanent table in hive metastore(default database) and copying data from view "act_data_view" to permanent table "act_data_permanent"

spark.sql("select * from act_data_view").write.saveAsTable("act_data_permanent")

I am able to see the newly created "act_data_permanent" table in glue data catalog.
But, when i do the count on the table , the count is showing as 0.

spark.sql("select count(*) from act_data_permanent")
count=o

Any thoughts, on why the data is not copied to "act_data_permanent" table or Am i doing wrong in querying the data from Data catalog. Any leads, would be appreciated . Thanks.!