问:
Git incorrectly recognising a newly added file as copy of an existing file
Git seems to consider a few newly added files in the repository as copies, and it messes up the diff shown in the PR on bitbucket (as it now shows a fully new file as a changed diff of an existing file).

The git diff command shows it correctly as a new file.

```<code>diff --git a/conf/CMakeLists.txt b/conf/CMakeLists.txt
new file mode 100644
index 0000000000..950acb62bd
--- /dev/null
+++ b/conf/CMakeLists.txt
@@ -0,0 +1,43 @@
+#
+#
+#
<snipped>
</code>```

But git log --find-copies-harder --name-status

shows the status as

```<code>C070    libs/cpr/CMakeLists.txt conf/CMakeLists.txt
</code>```

Which is what seems to cause the bitbucket server to show this file as a diff against another existing file.

Is there a way to avoid this so that the file shows up as a new file, which it actually is?

Body:
Git seems to consider a few newly added files in the repository as copies, and it messes up the diff shown in the PR on bitbucket (as it now shows a fully new file as a changed diff of an existing file).

The git diff command shows it correctly as a new file.

diff --git a/conf/CMakeLists.txt b/conf/CMakeLists.txt
new file mode 100644
index 0000000000..950acb62bd
--- /dev/null
+++ b/conf/CMakeLists.txt
@@ -0,0 +1,43 @@
+#
+#
+#
<snipped>

But git log --find-copies-harder --name-status

shows the status as

C070    libs/cpr/CMakeLists.txt conf/CMakeLists.txt

Which is what seems to cause the bitbucket server to show this file as a diff against another existing file.

Is there a way to avoid this so that the file shows up as a new file, which it actually is?


来源: stackexchange

问:
Filter pandas frame by values that are already grouped on consecutive rows
Consider a dataframe that would look like this :

```<code>Col1   Col2     Col3
ABC    00012    Hey!
A1C    00012    Hello!
AAA    00012    Hello
ABC    00033    Hey!
A1C    00021    Hi!
AAA    00021    Hey...
B3Y    00002    Hi.
A5I    00002    Hey?
EAA    00002    Hey!
</code>```

Column2 values are already packed together (not necessarily sorted by value, but at least packed together on consecutive lines). My goal is to iterate over smaller dataframes that correspond to the lines with the same values of Column2.

One way of doing this would be:

```<code>df = pd.read_csv(myfile, sep = "\t")
keys = pd.unique(df["Col2"])
for key in keys:
    subdf = df[df["Col2"] == key]
    myfunction(subdf) # Do something with the sub-dataframe
</code>```

However, this would be super inefficient, since a filtering on the whole dataframe would take place at each iteration.

QUESTION: How to make that code more efficient and leverage the fact that the values in Column2 are already grouped on consecutive lines?

ContentLicense: CC BY-SA 4.0

Body:
Consider a dataframe that would look like this :

Col1   Col2     Col3
ABC    00012    Hey!
A1C    00012    Hello!
AAA    00012    Hello
ABC    00033    Hey!
A1C    00021    Hi!
AAA    00021    Hey...
B3Y    00002    Hi.
A5I    00002    Hey?
EAA    00002    Hey!

Column2 values are already packed together (not necessarily sorted by value, but at least packed together on consecutive lines). My goal is to iterate over smaller dataframes that correspond to the lines with the same values of Column2.

One way of doing this would be:

df = pd.read_csv(myfile, sep = "\t")
keys = pd.unique(df["Col2"])
for key in keys:
    subdf = df[df["Col2"] == key]
    myfunction(subdf) # Do something with the sub-dataframe

However, this would be super inefficient, since a filtering on the whole dataframe would take place at each iteration.

QUESTION: How to make that code more efficient and leverage the fact that the values in Column2 are already grouped on consecutive lines?


问:
Which encryption algorithms does AWS Amplify use for iOs apps?
I am publishing my mobile app to the app store, it asks what type of encryption algorithm does my application uses and the options are:

Encryption algorithms that are proprietary or not accepted as standard by international standard bodies (IEEE, IETF, ITU, etc.)

Standard encryption algorithms instead of, or in addition to, using or accessing the encryption within Apple's operating system

Both algorithms mentioned above

None of the algorithms mentioned above

I have a very simple applications which only uses AWS Amplify for authentication to process user interactions , none of the sensitive user information is stored and I don't use any HTTPS requests or anything besides AWS.

I am expecting it to be the second option which is Standard encryption algorithms instead of, or in addition to, using or accessing the encryption within Apple's operating system but I am not sure thus why I am asking this question.


问:
can't render data properly inside new head.js next.js 13
I'm working on a project using new Next.js 13 app Dir, I'm trying to render the data from CMS. I'm getting the data works but no dynamic value tags are passed to social share cards (Twitter, Facebook) i think because data get rendered in the client, or is it something else!

So, I'm seeking help to understand how to properly fetch and render the data (SSR) way, and what I do wrong in my code.

'use client'
import { useEffect, useState } from 'react'
import { usePathname } from 'next/navigation'
import DefaultTags from '../../../components/DefaultTags'
import { client } from '../../../utils/contentful'

export async function generateStaticParams() {
  const res = await client.getEntries({
    content_type: 'article',
  })
  return res.items.map((item) => ({
    slug: item.fields.slug,
  }))
}

export default function Head({ params }) {
  const pathname = usePathname()
  const [data, setData] = useState(null)

  useEffect(() => {
    async function getEntry() {
      const response = await client.getEntries({
        content_type: 'article',
        'fields.slug': params.slug,
        include: 10,
      })
      setData(response.items[0])
    }
    getEntry()
  }, [params.slug])

  if (data === null) {
    return undefined
  }

  const { title, category, tags, featuredImg } = data.fields
  const url = `https://example.com${pathname}` || 'https://example.com'

  return (
    <>
      <DefaultTags />
      <title>{`${title} | blog `}</title>
      <meta property="url" content={url} />
      <link rel="canonical" href={url} />
      <meta name="description" content={title} />
      <meta name="keywords" content={tags} />
      <meta name="article:section" content={category} />
      <meta name="twitter:title" content={`${title} | blog `} />
      <meta name="twitter:description" content={title} />
      <meta
        name="twitter:image"
        content={`https:${featuredImg[0].fields.file.url}`}
      />
      <meta name="twitter:image:alt" content={title} data-rh="true" />
      <meta property="og:title" content={`${title} | blog`} />
      <meta property="og:url" content={url} />
      <meta property="og:type" content="article" />
      <meta property="og:description" content={title} />
      <meta
        property="og:image"
        content={`https:${featuredImg[0].fields.file.url}`}
      />
      <meta property="fb:app_id" content="Facebook id" />
    </>
  )
}```


问:
How to implement Transparent Data Encryption(TDE) in postgresql?
Want to implement Transparent Data Encryption(TDE) in PostgreSQL? I got some steps to implement TDE on tablespace but the parameters like keystore_location and tablespace_encryption_algorithm don't exist in postgresql.conf, when I tried to add those parameters it gave an error.

link from where I got the steps:-
https://arctype.com/blog/transparent-data-encryption/#:~:text=Transparent%20Data%20Encryption%2C%20or%20TDE,the%20first%20line%20of%20defense.

If this doesn't work then how to implement TDE with pgcrypto.


问:
Ubuntu22.04 can't connect SQLServer. "SSL Provider: [error:0A000086:SSL routines::certificate verify failed:unable to get local issuer certificate]"
I want to run this on Ubuntu22.04(AzureVM).

```<code><?php
    $dsn = 'sqlsrv:server=hogehoge';
    $user = 'user';
    $password = 'password';

    $dbh = new PDO($dsn, $user, $password);

    $sql = "select * from user";
        foreach ($dbh->query($sql) as $row) {
        echo $row['id'] . ' ' . $row['name'] . "<br>";
        }

    $dbh = null;
?>
</code>```

But I got this error message.

```<code>PHP Fatal error:  Uncaught PDOException: SQLSTATE[08001]: [Microsoft][ODBC Driver 18 for SQL Server]SSL Provider: [error:0A000086:SSL routines::certificate verify failed:unable to get local issuer certificate] in test.php:6
Stack trace:
#0 /var/www/test/test.php(6): PDO->__construct()
#1 {main}
  thrown in test.php on line 6
</code>```

What's happened? I searched for that error message but can't understand how to fix.
My local Windows does have not this problem. Maybe Ubuntu server is bad.

Thank you for your viewing.

Body:
I want to run this on Ubuntu22.04(AzureVM).

<?php
    $dsn = 'sqlsrv:server=hogehoge';
    $user = 'user';
    $password = 'password';

    $dbh = new PDO($dsn, $user, $password);

    $sql = "select * from user";
        foreach ($dbh->query($sql) as $row) {
        echo $row['id'] . ' ' . $row['name'] . "
";
        }

    $dbh = null;
?>

But I got this error message.

PHP Fatal error:  Uncaught PDOException: SQLSTATE[08001]: [Microsoft][ODBC Driver 18 for SQL Server]SSL Provider: [error:0A000086:SSL routines::certificate verify failed:unable to get local issuer certificate] in test.php:6
Stack trace:
#0 /var/www/test/test.php(6): PDO->__construct()
#1 {main}
  thrown in test.php on line 6

What's happened? I searched for that error message but can't understand how to fix.
My local Windows does have not this problem. Maybe Ubuntu server is bad.

Thank you for your viewing.


问:
Not able to install nltk supporting packages and getting noaddrinfo error with nltk.download()
After importing nltk to my system i tried to download the packages using nltk.download()
but its showing the following error.
enter image description here

i have tried changing the proxy but its not working(my laptop is not using any proxy but it is connected to VPN).
I tried to manually download required packages from http://www.nltk.org/nltk_data/ but still not going anywhere.
i also tried
enter image description here

and
i have tried every solution from
error installing nltk supporting packages : nltk.download()
,but the problem remains the same.


问:
How to Store Slack modal information in MongoDB?
I have created a modal in Slack Home Tab. Now it contains some field of user information. I want to store these information in MongoDB when user clicks on Submit Button. Can someone please help me with this code implementation.

The below code is of modal:

```<code>// showing popup
      boltApp.action('open_modal', async ({ ack, body, client }) => {
        // Acknowledge shortcut request
        await ack();

        // created using block kit builder
        try {
            await client.views.open({
              view: {
                "title": {
                  "type": "plain_text",
                  "text": "Information"
                },
                "submit": {
                  "trigger_id":"submission",
                  "type": "plain_text",
                  "text": "Submit"
                },
                "blocks": [
                  {
                    "type": "input",
                    "block-id": "name-block",
                    "element": {
                      "type": "plain_text_input",
                      "action_id": "name-action",
                      "placeholder": {
                        "type": "plain_text",
                        "text": "Please enter your name"
                      }
                    },
                    "label": {
                      "type": "plain_text",
                      "text": "Name"
                    }
                  },
                  {
                    "type": "input",
                    "block-id": "email-block",
                    "element": {
                      "type": "plain_text_input",
                      "action_id": "email-action",
                      "placeholder": {
                        "type": "plain_text",
                        "text": "Please enter your email id"
                      }
                    },
                    "label": {
                      "type": "plain_text",
                      "text": "Email"
                    }
                  },
                  {
                    "type": "input",
                    "block-id": "phone-block",
                    "element": {
                      "type": "plain_text_input",
                      "action_id": "phone-action",
                      "placeholder": {
                        "type": "plain_text",
                        "text": "Please enter your phone number"
                      }
                    },
                    "label": {
                      "type": "plain_text",
                      "text": "Phone Number"
                    }
                  }
                ],
                "type": "modal",
              },
              trigger_id: body.trigger_id,
            });
          }
        catch (error) {
          console.error(error);
        }
      });
</code>```

I want to save the entered information in mongodb

Body:
I have created a modal in Slack Home Tab. Now it contains some field of user information. I want to store these information in MongoDB when user clicks on Submit Button. Can someone please help me with this code implementation.

The below code is of modal:

// showing popup
      boltApp.action('open_modal', async ({ ack, body, client }) => {
        // Acknowledge shortcut request
        await ack();

        // created using block kit builder
        try {
            await client.views.open({
              view: {
                "title": {
                  "type": "plain_text",
                  "text": "Information"
                },
                "submit": {
                  "trigger_id":"submission",
                  "type": "plain_text",
                  "text": "Submit"
                },
                "blocks": [
                  {
                    "type": "input",
                    "block-id": "name-block",
                    "element": {
                      "type": "plain_text_input",
                      "action_id": "name-action",
                      "placeholder": {
                        "type": "plain_text",
                        "text": "Please enter your name"
                      }
                    },
                    "label": {
                      "type": "plain_text",
                      "text": "Name"
                    }
                  },
                  {
                    "type": "input",
                    "block-id": "email-block",
                    "element": {
                      "type": "plain_text_input",
                      "action_id": "email-action",
                      "placeholder": {
                        "type": "plain_text",
                        "text": "Please enter your email id"
                      }
                    },
                    "label": {
                      "type": "plain_text",
                      "text": "Email"
                    }
                  },
                  {
                    "type": "input",
                    "block-id": "phone-block",
                    "element": {
                      "type": "plain_text_input",
                      "action_id": "phone-action",
                      "placeholder": {
                        "type": "plain_text",
                        "text": "Please enter your phone number"
                      }
                    },
                    "label": {
                      "type": "plain_text",
                      "text": "Phone Number"
                    }
                  }
                ],
                "type": "modal",
              },
              trigger_id: body.trigger_id,
            });
          }
        catch (error) {
          console.error(error);
        }
      });

I want to save the entered information in mongodb


问:
I am following testdriven.io Test-Driven Development with FastAPI and Docker. Error in imports 'from main import app'
I am sure the relative path is the cause but not sure how to fix it. This is the error.

```<code>tests/conftest.py:5: in <module>
    from app import main
E   ImportError: cannot import name 'main' from 'app' (/usr/src/app/__init__.py)
</code>```

I am doing things in PyCharm.

Since the app folder is nested within project module I tried 'import project' and then 'from project.app import main'. It says can't find module project. I did add init.py within project folder to make it a module.

Body:
I am sure the relative path is the cause but not sure how to fix it. This is the error.

tests/conftest.py:5: in <module>
    from app import main
E   ImportError: cannot import name 'main' from 'app' (/usr/src/app/__init__.py)

I am doing things in PyCharm.

Since the app folder is nested within project module I tried 'import project' and then 'from project.app import main'. It says can't find module project. I did add init.py within project folder to make it a module.


问:
How to connect AWS amplify with github enterprice repository without github actions?
I'm trying to setup aws amplify for Nextjs App but i'm unable to connect my repository since it's in Github enterprise. I want to try this without Github Actions plugins.

is there way to achieve this ?


问:
How to stop pytest test execution for all the scripts when certain condition occurs?
I am running my python selenium test script in parallel using pytest. I want to stop entire test suit execution if certain condition becomes true in any of the test case? Do we have any functions or methods to do so?

I tried with sys.exit(), pytest.exit(), raising keyboard interrupt exception but all these will only stop current test case and move on to the next test case. I can't use pytest -x or pytest --maxfail=1 since testcase might also fail for some other reasons but not for particular condition which i am expecting to fail.


问:
i'm trying to make sound classification with raspberrypi and when i downloading libraries i got this error
I used this git repository https://github.com/tensorflow/examples/tree/master/lite/examples/sound_classification/raspberry_pi and when i run setup.sh i got this error

ERROR: Command errored out with exit status 1:
command: /home/pi/examples/tflite-env/bin/python3 /tmp/tmp7iinmmi0_in_process.py prepare_metadata_for_build_wheel /tmp/tmptn6e9jqe
cwd: /tmp/pip-install-fql88aww/scipy_b8426ad4982e49d9a082709ebedb7d49
Complete output (75 lines):
The Meson build system
Version: 1.0.0
Source dir: /tmp/pip-install-fql88aww/scipy_b8426ad4982e49d9a082709ebedb7d49
Build dir: /tmp/pip-install-fql88aww/scipy_b8426ad4982e49d9a082709ebedb7d49/.mesonpy-9vacuzda/build
Build type: native build
Project name: SciPy
Project version: 1.10.0
C compiler for the host machine: cc (gcc 10.2.1 "cc (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110")
C linker for the host machine: cc ld.bfd 2.35.2
C++ compiler for the host machine: c++ (gcc 10.2.1 "c++ (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110")
C++ linker for the host machine: c++ ld.bfd 2.35.2
Host machine cpu family: arm
Host machine cpu: armv7l
Compiler for C supports arguments -Wno-unused-but-set-variable: YES
Compiler for C supports arguments -Wno-unused-function: YES
Compiler for C supports arguments -Wno-conversion: YES
Compiler for C supports arguments -Wno-misleading-indentation: YES
Compiler for C supports arguments -Wno-incompatible-pointer-types: YES
Library m found: YES
Fortran compiler for the host machine: gfortran (gcc 10.2.1 "GNU Fortran (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110")
Fortran linker for the host machine: gfortran ld.bfd 2.35.2
Compiler for Fortran supports arguments -Wno-conversion: YES
Checking if "-Wl,--version-script" : links: YES
Program cython found: YES (/tmp/pip-build-env-nzzp7hqs/overlay/bin/cython)
Program python found: YES (/home/pi/examples/tflite-env/bin/python3)
Found pkg-config: /usr/bin/pkg-config (0.29.2)
Program pythran found: YES (/tmp/pip-build-env-nzzp7hqs/overlay/bin/pythran)
Run-time dependency threads found: YES
Library npymath found: YES
Library npyrandom found: YES
Found CMake: /usr/bin/cmake (3.18.4)
Run-time dependency openblas found: NO (tried pkgconfig and cmake)
Run-time dependency openblas found: NO (tried pkgconfig and cmake)

```<code>../../scipy/meson.build:134:0: ERROR: Dependency "OpenBLAS" not found, tried pkgconfig and cmake

A full log can be found at /tmp/pip-install-fql88aww/scipy_b8426ad4982e49d9a082709ebedb7d49/.mesonpy-9vacuzda/build/meson-logs/meson-log.txt
+ meson setup --prefix=/usr /tmp/pip-install-fql88aww/scipy_b8426ad4982e49d9a082709ebedb7d49 /tmp/pip-install-fql88aww/scipy_b8426ad4982e49d9a082709ebedb7d49/.mesonpy-9vacuzda/build --native-file=/tmp/pip-install-fql88aww/scipy_b8426ad4982e49d9a082709ebedb7d49/.mesonpy-native-file.ini -Ddebug=false -Doptimization=2
Traceback (most recent call last):
  File "/tmp/tmp7iinmmi0_in_process.py", line 126, in prepare_metadata_for_build_wheel
    hook = backend.prepare_metadata_for_build_wheel
AttributeError: module 'mesonpy' has no attribute 'prepare_metadata_for_build_wheel'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/tmp7iinmmi0_in_process.py", line 280, in <module>
    main()
  File "/tmp/tmp7iinmmi0_in_process.py", line 263, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
  File "/tmp/tmp7iinmmi0_in_process.py", line 130, in prepare_metadata_for_build_wheel
    return _get_wheel_metadata_from_wheel(backend, metadata_directory,
  File "/tmp/tmp7iinmmi0_in_process.py", line 159, in _get_wheel_metadata_from_wheel
    whl_basename = backend.build_wheel(metadata_directory, config_settings)
  File "/tmp/pip-build-env-nzzp7hqs/overlay/lib/python3.9/site-packages/mesonpy/__init__.py", line 1060, in build_wheel
    with _project(config_settings) as project:
  File "/usr/lib/python3.9/contextlib.py", line 117, in __enter__
    return next(self.gen)
  File "/tmp/pip-build-env-nzzp7hqs/overlay/lib/python3.9/site-packages/mesonpy/__init__.py", line 975, in _project
    with Project.with_temp_working_dir(
  File "/usr/lib/python3.9/contextlib.py", line 117, in __enter__
    return next(self.gen)
  File "/tmp/pip-build-env-nzzp7hqs/overlay/lib/python3.9/site-packages/mesonpy/__init__.py", line 750, in with_temp_working_dir
    yield cls(source_dir, tmpdir, build_dir, meson_args)
  File "/tmp/pip-build-env-nzzp7hqs/overlay/lib/python3.9/site-packages/mesonpy/__init__.py", line 632, in __init__
    self._configure(reconfigure=bool(build_dir) and not native_file_mismatch)
  File "/tmp/pip-build-env-nzzp7hqs/overlay/lib/python3.9/site-packages/mesonpy/__init__.py", line 680, in _configure
    self._meson('setup', *setup_args)
  File "/tmp/pip-build-env-nzzp7hqs/overlay/lib/python3.9/site-packages/mesonpy/__init__.py", line 657, in _meson
    return self._proc('meson', *args)
  File "/tmp/pip-build-env-nzzp7hqs/overlay/lib/python3.9/site-packages/mesonpy/__init__.py", line 652, in _proc
    subprocess.check_call(list(args), env=self._env)
  File "/usr/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['meson', 'setup', '--prefix=/usr', '/tmp/pip-install-fql88aww/scipy_b8426ad4982e49d9a082709ebedb7d49', '/tmp/pip-install-fql88aww/scipy_b8426ad4982e49d9a082709ebedb7d49/.mesonpy-9vacuzda/build', '--native-file=/tmp/pip-install-fql88aww/scipy_b8426ad4982e49d9a082709ebedb7d49/.mesonpy-native-file.ini', '-Ddebug=false', '-Doptimization=2']' returned non-zero exit status 1.
----------------------------------------
</code>```

WARNING: Discarding https://files.pythonhosted.org/packages/d6/bd/2d13a273d95f7b7d9903c906c486040b0aebb85e008f93a5dd0891f21f1f/scipy-1.10.0.tar.gz#sha256=c8b3cbc636a87a89b770c6afc999baa6bcbb01691b5ccbbc1b1791c7c0a07540 (from https://pypi.org/simple/scipy/) (requires-python:<3.12,>=3.8). Command errored out with exit status 1: /home/pi/examples/tflite-env/bin/python3 /tmp/tmp7iinmmi0_in_process.py prepare_metadata_for_build_wheel /tmp/tmptn6e9jqe Check the logs for full command output.

Body:
I used this git repository https://github.com/tensorflow/examples/tree/master/lite/examples/sound_classification/raspberry_pi and when i run setup.sh i got this error

ERROR: Command errored out with exit status 1:
command: /home/pi/examples/tflite-env/bin/python3 /tmp/tmp7iinmmi0_in_process.py prepare_metadata_for_build_wheel /tmp/tmptn6e9jqe
cwd: /tmp/pip-install-fql88aww/scipy_b8426ad4982e49d9a082709ebedb7d49
Complete output (75 lines):
The Meson build system
Version: 1.0.0
Source dir: /tmp/pip-install-fql88aww/scipy_b8426ad4982e49d9a082709ebedb7d49
Build dir: /tmp/pip-install-fql88aww/scipy_b8426ad4982e49d9a082709ebedb7d49/.mesonpy-9vacuzda/build
Build type: native build
Project name: SciPy
Project version: 1.10.0
C compiler for the host machine: cc (gcc 10.2.1 "cc (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110")
C linker for the host machine: cc ld.bfd 2.35.2
C++ compiler for the host machine: c++ (gcc 10.2.1 "c++ (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110")
C++ linker for the host machine: c++ ld.bfd 2.35.2
Host machine cpu family: arm
Host machine cpu: armv7l
Compiler for C supports arguments -Wno-unused-but-set-variable: YES
Compiler for C supports arguments -Wno-unused-function: YES
Compiler for C supports arguments -Wno-conversion: YES
Compiler for C supports arguments -Wno-misleading-indentation: YES
Compiler for C supports arguments -Wno-incompatible-pointer-types: YES
Library m found: YES
Fortran compiler for the host machine: gfortran (gcc 10.2.1 "GNU Fortran (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110")
Fortran linker for the host machine: gfortran ld.bfd 2.35.2
Compiler for Fortran supports arguments -Wno-conversion: YES
Checking if "-Wl,--version-script" : links: YES
Program cython found: YES (/tmp/pip-build-env-nzzp7hqs/overlay/bin/cython)
Program python found: YES (/home/pi/examples/tflite-env/bin/python3)
Found pkg-config: /usr/bin/pkg-config (0.29.2)
Program pythran found: YES (/tmp/pip-build-env-nzzp7hqs/overlay/bin/pythran)
Run-time dependency threads found: YES
Library npymath found: YES
Library npyrandom found: YES
Found CMake: /usr/bin/cmake (3.18.4)
Run-time dependency openblas found: NO (tried pkgconfig and cmake)
Run-time dependency openblas found: NO (tried pkgconfig and cmake)

../../scipy/meson.build:134:0: ERROR: Dependency "OpenBLAS" not found, tried pkgconfig and cmake

A full log can be found at /tmp/pip-install-fql88aww/scipy_b8426ad4982e49d9a082709ebedb7d49/.mesonpy-9vacuzda/build/meson-logs/meson-log.txt
+ meson setup --prefix=/usr /tmp/pip-install-fql88aww/scipy_b8426ad4982e49d9a082709ebedb7d49 /tmp/pip-install-fql88aww/scipy_b8426ad4982e49d9a082709ebedb7d49/.mesonpy-9vacuzda/build --native-file=/tmp/pip-install-fql88aww/scipy_b8426ad4982e49d9a082709ebedb7d49/.mesonpy-native-file.ini -Ddebug=false -Doptimization=2
Traceback (most recent call last):
  File "/tmp/tmp7iinmmi0_in_process.py", line 126, in prepare_metadata_for_build_wheel
    hook = backend.prepare_metadata_for_build_wheel
AttributeError: module 'mesonpy' has no attribute 'prepare_metadata_for_build_wheel'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/tmp7iinmmi0_in_process.py", line 280, in <module>
    main()
  File "/tmp/tmp7iinmmi0_in_process.py", line 263, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
  File "/tmp/tmp7iinmmi0_in_process.py", line 130, in prepare_metadata_for_build_wheel
    return _get_wheel_metadata_from_wheel(backend, metadata_directory,
  File "/tmp/tmp7iinmmi0_in_process.py", line 159, in _get_wheel_metadata_from_wheel
    whl_basename = backend.build_wheel(metadata_directory, config_settings)
  File "/tmp/pip-build-env-nzzp7hqs/overlay/lib/python3.9/site-packages/mesonpy/__init__.py", line 1060, in build_wheel
    with _project(config_settings) as project:
  File "/usr/lib/python3.9/contextlib.py", line 117, in __enter__
    return next(self.gen)
  File "/tmp/pip-build-env-nzzp7hqs/overlay/lib/python3.9/site-packages/mesonpy/__init__.py", line 975, in _project
    with Project.with_temp_working_dir(
  File "/usr/lib/python3.9/contextlib.py", line 117, in __enter__
    return next(self.gen)
  File "/tmp/pip-build-env-nzzp7hqs/overlay/lib/python3.9/site-packages/mesonpy/__init__.py", line 750, in with_temp_working_dir
    yield cls(source_dir, tmpdir, build_dir, meson_args)
  File "/tmp/pip-build-env-nzzp7hqs/overlay/lib/python3.9/site-packages/mesonpy/__init__.py", line 632, in __init__
    self._configure(reconfigure=bool(build_dir) and not native_file_mismatch)
  File "/tmp/pip-build-env-nzzp7hqs/overlay/lib/python3.9/site-packages/mesonpy/__init__.py", line 680, in _configure
    self._meson('setup', *setup_args)
  File "/tmp/pip-build-env-nzzp7hqs/overlay/lib/python3.9/site-packages/mesonpy/__init__.py", line 657, in _meson
    return self._proc('meson', *args)
  File "/tmp/pip-build-env-nzzp7hqs/overlay/lib/python3.9/site-packages/mesonpy/__init__.py", line 652, in _proc
    subprocess.check_call(list(args), env=self._env)
  File "/usr/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['meson', 'setup', '--prefix=/usr', '/tmp/pip-install-fql88aww/scipy_b8426ad4982e49d9a082709ebedb7d49', '/tmp/pip-install-fql88aww/scipy_b8426ad4982e49d9a082709ebedb7d49/.mesonpy-9vacuzda/build', '--native-file=/tmp/pip-install-fql88aww/scipy_b8426ad4982e49d9a082709ebedb7d49/.mesonpy-native-file.ini', '-Ddebug=false', '-Doptimization=2']' returned non-zero exit status 1.
----------------------------------------

WARNING: Discarding https://files.pythonhosted.org/packages/d6/bd/2d13a273d95f7b7d9903c906c486040b0aebb85e008f93a5dd0891f21f1f/scipy-1.10.0.tar.gz#sha256=c8b3cbc636a87a89b770c6afc999baa6bcbb01691b5ccbbc1b1791c7c0a07540 (from https://pypi.org/simple/scipy/) (requires-python:<3.12,>=3.8). Command errored out with exit status 1: /home/pi/examples/tflite-env/bin/python3 /tmp/tmp7iinmmi0_in_process.py prepare_metadata_for_build_wheel /tmp/tmptn6e9jqe Check the logs for full command output.


问:
Karate Mock Static Method call
How do we mock a static method from Karate runner, so that the mocked static method is called instead of the actual static method.

While I agree we should have had testable code without static method call, it is not always possible :)

Can Mockito be used along with Karate feature to mock the static method call? Thanks

Title: Karate Mock Static Method call


问:
How can I handle from time > to time in moment js
I have a requirements where a user can set a time for schedule on certain weekdays between ranges from and to. Issue sometimes, this can span multiple days. For example, <from: 22:00> <to: 05:00>.

I would like to be able to handle this case in moment.

What I thought of doing is breaking it into 2 "cycles" 22 -> 24 AND 24 -> 05 but I'm having issues with the dates. I would ideally not like to store the date because the requirement is recurring on certain weekdays so that means I have to keep the dates updated which is another issue I want to avoid.

currently, I do something like below but it doesn't work. Just handles 22 -> 24 and not the second part

```<code>  const now = moment().utc()
  const scheduledDays = ['1', '2', '3', '4', '5', '6'];

  // handle from > to
  if (from.isAfter(to)) {
    let currentNow = now.format('DD HH');
    let [day, hours] = currentNow.split(' ') as [day: string, hours: number];
    const currentDay = Number(moment().format('DD'));
    hours = Number(day) > currentDay ? 24 : Number(hours);

    if (hours < 24) {
      to = moment().utc().startOf('day').add(1, 'day');
    } else {
      from = moment().utc().startOf('day').add(1, 'day');
      to.add(1, 'day');
      scheduledDays.push(now.day().toString());
    }
  }
</code>```

is there a way to be able to handle this  larger than  case without storing dates? and if I need to store dates, how should I go about updating them so that the schedule runs weekly.

I've been at this for a few days now and can't figure it out at all

Body:
I have a requirements where a user can set a time for schedule on certain weekdays between ranges from and to. Issue sometimes, this can span multiple days. For example, <from: 22:00> <to: 05:00>.

I would like to be able to handle this case in moment.

What I thought of doing is breaking it into 2 "cycles" 22 -> 24 AND 24 -> 05 but I'm having issues with the dates. I would ideally not like to store the date because the requirement is recurring on certain weekdays so that means I have to keep the dates updated which is another issue I want to avoid.

currently, I do something like below but it doesn't work. Just handles 22 -> 24 and not the second part

  const now = moment().utc()
  const scheduledDays = ['1', '2', '3', '4', '5', '6'];

  // handle from > to
  if (from.isAfter(to)) {
    let currentNow = now.format('DD HH');
    let [day, hours] = currentNow.split(' ') as [day: string, hours: number];
    const currentDay = Number(moment().format('DD'));
    hours = Number(day) > currentDay ? 24 : Number(hours);

    if (hours < 24) {
      to = moment().utc().startOf('day').add(1, 'day');
    } else {
      from = moment().utc().startOf('day').add(1, 'day');
      to.add(1, 'day');
      scheduledDays.push(now.day().toString());
    }
  }

is there a way to be able to handle this  larger than  case without storing dates? and if I need to store dates, how should I go about updating them so that the schedule runs weekly.

I've been at this for a few days now and can't figure it out at all


问:
Location Directive giving 403 Nginx Coonfiguration
I have the below Nginx configurations that are working fine:

```<code>      location / {
                root /var/www/html;
                index   index.html index.htm index.nginx-debian.html;
        }
</code>```

However, I am getting a 403 forbidden error when I just add /site to the URL location configuration like below

```<code>        location /site {
                root /var/www/html;
                index   index.html index.htm index.nginx-debian.html;
        }
</code>```

How can I resolve this in Nginx running on ubuntu 2204?

I tried /site/ still getting the same error.

Body:
I have the below Nginx configurations that are working fine:

      location / {
                root /var/www/html;
                index   index.html index.htm index.nginx-debian.html;
        }

However, I am getting a 403 forbidden error when I just add /site to the URL location configuration like below

        location /site {
                root /var/www/html;
                index   index.html index.htm index.nginx-debian.html;
        }

How can I resolve this in Nginx running on ubuntu 2204?

I tried /site/ still getting the same error.


问:
Sendgrid on Rails: How to use Sendgrid for contact us form on rails 7
I just set up my contact from page, then I opted for sendgrid in sending messages, but I noticed it only accepts the verified mail from my sendgrid setup as sender only, if i tried to use other mail it shows an error, this is the set up ;</p>
```<code>config.action_mailer.delivery_method = :smtp
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.action_mailer.raise_delivery_errors = true

ActionMailer::Base.smtp_settings = {
:user_name =>'apikey', # This is the string literal 'apikey', NOT the ID of your API key
:password => 'xxxxxxxxxxx', # This is the secret sendgrid API key which was issued during API key creation
:domain =>   'mydomain.com',
:address =>  'smtp.sendgrid.net',
:port => 587,
:authentication => :plain,
:enable_starttls_auto => true
}

</code>```

Body:
I just set up my contact from page, then I opted for sendgrid in sending messages, but I noticed it only accepts the verified mail from my sendgrid setup as sender only, if i tried to use other mail it shows an error, this is the set up ;

config.action_mailer.delivery_method = :smtp
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.action_mailer.raise_delivery_errors = true

ActionMailer::Base.smtp_settings = {
:user_name =>'apikey', # This is the string literal 'apikey', NOT the ID of your API key
:password => 'xxxxxxxxxxx', # This is the secret sendgrid API key which was issued during API key creation
:domain =>   'mydomain.com',
:address =>  'smtp.sendgrid.net',
:port => 587,
:authentication => :plain,
:enable_starttls_auto => true
}


问:
--enable-use-zoom-for-dsf how to use this argument for Zoom with selenium python? No need alternative solution
1)already I use
driver.execute_script("document.body.style.zoom='55%'")

2)key perform
ActionChains(driver)

3)setting in did not change by selenium
chrome://settings/appearance this method is not working

all methods this tried but did not get proper output.
so I think --enable-use-zoom-for-dsf is a better way to zoom the chrome tab.
but I don't know how to use this argument. if have any idea about that please give me answers

thank you

also used it :(

already I use
driver.execute_script("document.body.style.zoom='55%'")

2)key perform
ActionChains(driver)

3)setting in did not change by selenium


问:
Mocking an method in test cases for groovy code
Mocking an method inside a function
But unable to mock it and it's unable fetch the values it throwing an null value

def withStackLocal(Closure cl) {

def proxyHost = Config(key: 'tools.stack.proxy.host')

def proxyPort =  Config(key: 'tools.stack.proxy.port')

}

@Test

voidshouldPassProxyPort(){

stack.proxyPort

assertEquals('80',":${stack.Config(key:'tools.stack.proxy.port')}")

}


问:
How to change the skintone with OpenGl + mediapipe aar android
i'm using mediapipe aar in android and using opengl to fill the color in particular landmarks (lips).

Problem is its not looking realistic or some good looking.

as of my analysis, TextureFrame applying in the GLSurfaceView with vertex and Fragment shader, and whatever I'm applying polygons(Triangles) in another program(vertex and fragment)

I tried to use mix in fragment shader - not worked.(because camera texture frame in another program(vertex and fragment shader), and the color apply in particular coordinates is in another program)

How can i get the particular pixel(texture or texel) and apply the color mix to achieve some realistic thing.?
or is any other approaches there?

Update :
I'm using Solutions API from Mediapipe
I'm changing the this FaceMeshResultGlRenderer.java Renderer file to do polygons works.

changed drawLandmarks function as below,

```<code> val vertex: FloatArray = FloatArray(connections.size * 4) //connections are array list for my facemesh landmarks in triangle.

    var lastAddedIndex = 0

    for (i in 0 until connections.size) {
        val starts: LandmarkProto.NormalizedLandmark = faceLandmarkList[connections[i].start]
        val ends: LandmarkProto.NormalizedLandmark = faceLandmarkList[connections[i].end]
        vertex[lastAddedIndex++] = starts.x
        vertex[lastAddedIndex++] = starts.y
        vertex[lastAddedIndex++] = ends.x
        vertex[lastAddedIndex++] = ends.y
    }

    val vertexBuffer = ByteBuffer.allocateDirect(vertex.size * 4)
        .order(ByteOrder.nativeOrder())
        .asFloatBuffer()
        .put(vertex)
    vertexBuffer.position(0)

    GLES20.glEnableVertexAttribArray(positionHandle)
    GLES20.glVertexAttribPointer(positionHandle, 2, GLES20.GL_FLOAT, false, 0, vertexBuffer)
    GLES20.glDrawArrays(GLES20.GL_TRIANGLE_FAN, 0, (vertex.size / 2))
</code>```

and my fragment shader and rest of the code is same in above FaceMeshResultGlRenderer.java file

below is my current output.

Body:
i'm using mediapipe aar in android and using opengl to fill the color in particular landmarks (lips).

Problem is its not looking realistic or some good looking.

as of my analysis, TextureFrame applying in the GLSurfaceView with vertex and Fragment shader, and whatever I'm applying polygons(Triangles) in another program(vertex and fragment)

I tried to use mix in fragment shader - not worked.(because camera texture frame in another program(vertex and fragment shader), and the color apply in particular coordinates is in another program)

How can i get the particular pixel(texture or texel) and apply the color mix to achieve some realistic thing.?
or is any other approaches there?

Update :
I'm using Solutions API from Mediapipe
I'm changing the this FaceMeshResultGlRenderer.java Renderer file to do polygons works.

changed drawLandmarks function as below,

 val vertex: FloatArray = FloatArray(connections.size * 4) //connections are array list for my facemesh landmarks in triangle.

    var lastAddedIndex = 0

    for (i in 0 until connections.size) {
        val starts: LandmarkProto.NormalizedLandmark = faceLandmarkList[connections[i].start]
        val ends: LandmarkProto.NormalizedLandmark = faceLandmarkList[connections[i].end]
        vertex[lastAddedIndex++] = starts.x
        vertex[lastAddedIndex++] = starts.y
        vertex[lastAddedIndex++] = ends.x
        vertex[lastAddedIndex++] = ends.y
    }

    val vertexBuffer = ByteBuffer.allocateDirect(vertex.size * 4)
        .order(ByteOrder.nativeOrder())
        .asFloatBuffer()
        .put(vertex)
    vertexBuffer.position(0)

    GLES20.glEnableVertexAttribArray(positionHandle)
    GLES20.glVertexAttribPointer(positionHandle, 2, GLES20.GL_FLOAT, false, 0, vertexBuffer)
    GLES20.glDrawArrays(GLES20.GL_TRIANGLE_FAN, 0, (vertex.size / 2))

and my fragment shader and rest of the code is same in above FaceMeshResultGlRenderer.java file

below is my current output.


问:
flutter upload progress bar while uploading the video
i want to have a circular upload progress bar when the video is being uploaded to the server i am using file picker to get the video from the internal storage my function looks like this

```<code> _getGallery() async {
    FilePickerResult? result =
        await FilePicker.platform.pickFiles(type: FileType.video);
    print('result : $result');
    if (result != null) {
      if (!checkConnection()) {
        return;
      }
      if (subjectController.text == '') {
        warningSnackBar(context, 'Please enter the subject');
        return;
      }
      setState(() {
        videoFile = File(result.files.single.path.toString());
        Navigator.push(
          context,
          MaterialPageRoute(
            builder: (BuildContext builder) => VideoWIllSaveScreen(
                videoFile: videoFile,
                connection_id: connectionID,
                name: connectionName,
                deliver_type: deliver_type,
                subject: subjectController.text,
                videoUrl: ''),
          ),
        );
      });
    } else {
      customSnackBar('Failed to load video', 'Error');
    }
  }
</code>```

I tried to use a bool = isloading and set it false then when video is being uploaded set state as true and make the progress bar apprear

Body:
i want to have a circular upload progress bar when the video is being uploaded to the server i am using file picker to get the video from the internal storage my function looks like this

 _getGallery() async {
    FilePickerResult? result =
        await FilePicker.platform.pickFiles(type: FileType.video);
    print('result : $result');
    if (result != null) {
      if (!checkConnection()) {
        return;
      }
      if (subjectController.text == '') {
        warningSnackBar(context, 'Please enter the subject');
        return;
      }
      setState(() {
        videoFile = File(result.files.single.path.toString());
        Navigator.push(
          context,
          MaterialPageRoute(
            builder: (BuildContext builder) => VideoWIllSaveScreen(
                videoFile: videoFile,
                connection_id: connectionID,
                name: connectionName,
                deliver_type: deliver_type,
                subject: subjectController.text,
                videoUrl: ''),
          ),
        );
      });
    } else {
      customSnackBar('Failed to load video', 'Error');
    }
  }

I tried to use a bool = isloading and set it false then when video is being uploaded set state as true and make the progress bar apprear


问:
Discord.py looping audio
I'm trying to loop an audio but I don't really know how.

```<code>@client.command()
@commands.is_owner()
async def loop(ctx):
    vc = ctx.voice_client
    current_song = queuee[ctx.guild.id][0]
    song_name = songs[ctx.guild.id][0]

    guild_id = ctx.guild.id
    if guild_id not in loop_status:
        loop_status[guild_id] = False

    if not loop_status[guild_id]:
        loop_status[guild_id] = True
        await ctx.send("Looping current song.")
        while loop_status[guild_id]:
            player = discord.FFmpegPCMAudio(queuee[ctx.guild.id][0], **ffmpeg_options)
            vc.play(player)
            await player.after()
</code>```

I've tried a few things and messed around with it but I'm still not sure how to loop the song once it finishes.

One thing to mention is I have a loop that runs when a song finishes playing.

```<code>async def check_queue(ctx):
    if ctx.voice_client.is_connected():
        if queuee[ctx.guild.id]:
            if not ctx.voice_client.is_playing():
                try:
                    queuee[ctx.guild.id].pop(0)
                    songs[ctx.guild.id].pop(0)
                    vc = ctx.voice_client
                    player = discord.FFmpegPCMAudio(queuee[ctx.guild.id][0], **ffmpeg_options)
                    vc.play(player)
                    song = songs[ctx.guild.id][0]
                    await ctx.send(f"Now playing: {song}")
                except:
                    queuee[ctx.guild.id].pop(0)
                    songs[ctx.guild.id].pop(0)
        else:
            await asyncio.sleep(30)
            await vc.disconnect()
    else:
        return
</code>```

This might affect the loop command since when a song finishes playing, It gets rid of the current song from the queue and goes to the next. Please help

Title: Discord.py looping audio

Body:
I'm trying to loop an audio but I don't really know how.

@client.command()
@commands.is_owner()
async def loop(ctx):
    vc = ctx.voice_client
    current_song = queuee[ctx.guild.id][0]
    song_name = songs[ctx.guild.id][0]

    guild_id = ctx.guild.id
    if guild_id not in loop_status:
        loop_status[guild_id] = False

    if not loop_status[guild_id]:
        loop_status[guild_id] = True
        await ctx.send("Looping current song.")
        while loop_status[guild_id]:
            player = discord.FFmpegPCMAudio(queuee[ctx.guild.id][0], **ffmpeg_options)
            vc.play(player)
            await player.after()

I've tried a few things and messed around with it but I'm still not sure how to loop the song once it finishes.

One thing to mention is I have a loop that runs when a song finishes playing.

async def check_queue(ctx):
    if ctx.voice_client.is_connected():
        if queuee[ctx.guild.id]:
            if not ctx.voice_client.is_playing():
                try:
                    queuee[ctx.guild.id].pop(0)
                    songs[ctx.guild.id].pop(0)
                    vc = ctx.voice_client
                    player = discord.FFmpegPCMAudio(queuee[ctx.guild.id][0], **ffmpeg_options)
                    vc.play(player)
                    song = songs[ctx.guild.id][0]
                    await ctx.send(f"Now playing: {song}")
                except:
                    queuee[ctx.guild.id].pop(0)
                    songs[ctx.guild.id].pop(0)
        else:
            await asyncio.sleep(30)
            await vc.disconnect()
    else:
        return

This might affect the loop command since when a song finishes playing, It gets rid of the current song from the queue and goes to the next. Please help


问:
How do I solve problem with useRef of NextJS?
I'm making a SSG page using Nextjs.
I imported model-viewer by write a  tag not  of Next.js.
And I want to activate AR automatically when user enter this page.
So I activateAR() in useEffect() using useRef
but an error happens cause of value 'null' of useRef.

Using  of 'next/link', first error -> refresh? it works.

Using  or type URL directly on the browser, it works without error. Although null is printed on console window at first.

Please shed light on my developer road.

oh this page is SSG with dynamic routing.

```<code>const viewer = useRef<any>(null);

useEffect(()=>{
function loadArFile() {
 viewer.current?.activateAR();
}

 viewer && loadArFile();
}
,[])

<Head>
        <title>argateway</title>
        <script
          type="module"
          src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js"
        />
</Head>

<model-viewer
        ref={viewer} />
</code>```

Body:
I'm making a SSG page using Nextjs.
I imported model-viewer by write a  tag not  of Next.js.
And I want to activate AR automatically when user enter this page.
So I activateAR() in useEffect() using useRef
but an error happens cause of value 'null' of useRef.

Using  of 'next/link', first error -> refresh? it works.

Using  or type URL directly on the browser, it works without error. Although null is printed on console window at first.

Please shed light on my developer road.

oh this page is SSG with dynamic routing.

const viewer = useRef<any>(null);

useEffect(()=>{
function loadArFile() {
 viewer.current?.activateAR();
}

 viewer && loadArFile();
}
,[])

        <title>argateway</title>


问:
Elasticbeanstalk - Laravel Queue Stops Working
My deploy.config file is like below.
First I've used it, it was working fine. But after a while, it stopped working and never worked again. (I rebuild environment and nothing changed)

```<code> option_settings:
  - namespace: aws:elasticbeanstalk:application:environment
    option_name: COMPOSER_HOME
    value: /root

  # Point the app root to the public/ folder.
  - namespace: aws:elasticbeanstalk:container:php:phpini
    option_name: document_root
    value: /public

  # Set here your php.ini `memory_limit` value.
  - namespace: aws:elasticbeanstalk:container:php:phpini
    option_name: memory_limit
    value: 2048M

container_commands:
  00_copy_env_file:
    command: "mv /tmp/.env /var/app/staging/.env"
  01_install_composer_dependencies:
    command: "sudo php -d memory_limit=-1 /usr/bin/composer.phar install --no-dev --no-interaction --prefer-dist --optimize-autoloader"
    cwd: "/var/app/staging"

  04_link_storage_folder:
    command: "php artisan storage:link"
    cwd: "/var/app/staging"

  05_run_migrations:
    command: "php artisan migrate --force"
    cwd: "/var/app/staging"
    leader_only: true

  06_run_migrations:
    command: "php artisan key:generate"
    cwd: "/var/app/staging"

  07_run_migrations:
    command: "php artisan passport:install"
    cwd: "/var/app/staging"

  08_queue_service_restart:
    command: "systemctl restart laravel_worker"
files:
  /opt/elasticbeanstalk/tasks/taillogs.d/laravel-logs.conf:
    content: /var/app/current/storage/logs/laravel.log
    group: root
    mode: "000755"
    owner: root
  /etc/systemd/system/laravel_worker.service:
    mode: "000755"
    owner: root
    group: root
    content: |
      # Laravel queue worker using systemd
      # ----------------------------------
      #
      # /lib/systemd/system/queue.service
      #
      # run this command to enable service:
      # systemctl enable queue.service

      [Unit]
      Description=Laravel queue worker

      [Service]
      User=nginx
      Group=nginx
      Restart=always
      ExecStart=/usr/bin/nohup /usr/bin/php /var/app/current/artisan queue:work --tries=3 --daemon

      [Install]
      WantedBy=multi-user.target
</code>```

On error logs i see these:

```<code>Jan  6 05:48:21 ip-172-31-39-188 systemd: Configuration file /etc/systemd/system/laravel_worker.service is marked executable. Please remove executable permission bits. Proceeding anyway.
Jan  6 05:48:21 ip-172-31-39-188 systemd: Started Laravel queue worker.
Jan  6 05:48:21 ip-172-31-39-188 systemd: Created slice User Slice of root.
Jan  6 05:48:21 ip-172-31-39-188 systemd: Started Session c19 of user root.
Jan  6 05:48:21 ip-172-31-39-188 systemd: Starting The PHP FastCGI Process Manager...
Jan  6 05:48:21 ip-172-31-39-188 nohup: Could not open input file: /var/app/current/artisan
Jan  6 05:48:21 ip-172-31-39-188 systemd: laravel_worker.service: main process exited, code=exited, status=1/FAILURE
Jan  6 05:48:21 ip-172-31-39-188 systemd: Unit laravel_worker.service entered failed state.
Jan  6 05:48:21 ip-172-31-39-188 systemd: laravel_worker.service failed.
Jan  6 05:48:21 ip-172-31-39-188 systemd: Started The PHP FastCGI Process Manager.
Jan  6 05:48:21 ip-172-31-39-188 systemd: Removed slice User Slice of root.
Jan  6 05:48:21 ip-172-31-39-188 systemd: Created slice User Slice of root.
Jan  6 05:48:21 ip-172-31-39-188 systemd: laravel_worker.service holdoff time over, scheduling restart.
Jan  6 05:48:21 ip-172-31-39-188 systemd: Stopped Laravel queue worker.
Jan  6 05:48:21 ip-172-31-39-188 systemd: Started Laravel queue worker.
</code>```

Whats wrong with it? What could be changed, or what?
Everything was working for months, and one day it stopped and never worked with the same configurations.

Body:
My deploy.config file is like below.
First I've used it, it was working fine. But after a while, it stopped working and never worked again. (I rebuild environment and nothing changed)

 option_settings:
  - namespace: aws:elasticbeanstalk:application:environment
    option_name: COMPOSER_HOME
    value: /root

  # Point the app root to the public/ folder.
  - namespace: aws:elasticbeanstalk:container:php:phpini
    option_name: document_root
    value: /public

  # Set here your php.ini `memory_limit` value.
  - namespace: aws:elasticbeanstalk:container:php:phpini
    option_name: memory_limit
    value: 2048M

container_commands:
  00_copy_env_file:
    command: "mv /tmp/.env /var/app/staging/.env"
  01_install_composer_dependencies:
    command: "sudo php -d memory_limit=-1 /usr/bin/composer.phar install --no-dev --no-interaction --prefer-dist --optimize-autoloader"
    cwd: "/var/app/staging"

  04_link_storage_folder:
    command: "php artisan storage:link"
    cwd: "/var/app/staging"

  05_run_migrations:
    command: "php artisan migrate --force"
    cwd: "/var/app/staging"
    leader_only: true

  06_run_migrations:
    command: "php artisan key:generate"
    cwd: "/var/app/staging"

  07_run_migrations:
    command: "php artisan passport:install"
    cwd: "/var/app/staging"

  08_queue_service_restart:
    command: "systemctl restart laravel_worker"
files:
  /opt/elasticbeanstalk/tasks/taillogs.d/laravel-logs.conf:
    content: /var/app/current/storage/logs/laravel.log
    group: root
    mode: "000755"
    owner: root
  /etc/systemd/system/laravel_worker.service:
    mode: "000755"
    owner: root
    group: root
    content: |
      # Laravel queue worker using systemd
      # ----------------------------------
      #
      # /lib/systemd/system/queue.service
      #
      # run this command to enable service:
      # systemctl enable queue.service

      [Unit]
      Description=Laravel queue worker

      [Service]
      User=nginx
      Group=nginx
      Restart=always
      ExecStart=/usr/bin/nohup /usr/bin/php /var/app/current/artisan queue:work --tries=3 --daemon

      [Install]
      WantedBy=multi-user.target

On error logs i see these:

Jan  6 05:48:21 ip-172-31-39-188 systemd: Configuration file /etc/systemd/system/laravel_worker.service is marked executable. Please remove executable permission bits. Proceeding anyway.
Jan  6 05:48:21 ip-172-31-39-188 systemd: Started Laravel queue worker.
Jan  6 05:48:21 ip-172-31-39-188 systemd: Created slice User Slice of root.
Jan  6 05:48:21 ip-172-31-39-188 systemd: Started Session c19 of user root.
Jan  6 05:48:21 ip-172-31-39-188 systemd: Starting The PHP FastCGI Process Manager...
Jan  6 05:48:21 ip-172-31-39-188 nohup: Could not open input file: /var/app/current/artisan
Jan  6 05:48:21 ip-172-31-39-188 systemd: laravel_worker.service: main process exited, code=exited, status=1/FAILURE
Jan  6 05:48:21 ip-172-31-39-188 systemd: Unit laravel_worker.service entered failed state.
Jan  6 05:48:21 ip-172-31-39-188 systemd: laravel_worker.service failed.
Jan  6 05:48:21 ip-172-31-39-188 systemd: Started The PHP FastCGI Process Manager.
Jan  6 05:48:21 ip-172-31-39-188 systemd: Removed slice User Slice of root.
Jan  6 05:48:21 ip-172-31-39-188 systemd: Created slice User Slice of root.
Jan  6 05:48:21 ip-172-31-39-188 systemd: laravel_worker.service holdoff time over, scheduling restart.
Jan  6 05:48:21 ip-172-31-39-188 systemd: Stopped Laravel queue worker.
Jan  6 05:48:21 ip-172-31-39-188 systemd: Started Laravel queue worker.

Whats wrong with it? What could be changed, or what?
Everything was working for months, and one day it stopped and never worked with the same configurations.


问:
How to remove duplicate keys from Map in dart?
I am using Getx for state management in my cart app, When I add a product to cart and move to another page and come back and add that same product it is been added again. Due to this there are same products showing in cart. How do I solve this ?

this is my code :

```<code>  increment(Product product) {
    if (cart.containsKey(product)) {
      cart[product] += 1;

    } else {
      cart[product] = 1;
    }
     Get.snackbar("Product ", "Added",duration :const Duration(milliseconds: 100));
  }
</code>```

Body:
I am using Getx for state management in my cart app, When I add a product to cart and move to another page and come back and add that same product it is been added again. Due to this there are same products showing in cart. How do I solve this ?

this is my code :

  increment(Product product) {
    if (cart.containsKey(product)) {
      cart[product] += 1;

    } else {
      cart[product] = 1;
    }
     Get.snackbar("Product ", "Added",duration :const Duration(milliseconds: 100));
  }


问:
How to use specific runners for different gitlab installations?
I am planning on put some personal work on a repo in gitlab.com.
I also have some repos in a gitlab installation in another server for work.

Now, I would like to use specific runners to enable CI in my repos.

I am learning how to install and register runners but in the registration part it says you have to specify your url and your token,

The thing is that I have two different urls (gitlab.com and the gitlab server from work) and two different tokens

So what do I do in this case?

Do I have to create two runners? How? (which part of the installation method is done only once and which twice?)


问:
same image apper in ReactFileReader in react
I'm trying to upload image using in 'react-file-reader' i have six ReactFileReader in my react js file like this

```<code>   export default function Addphotos() {
        const [url, setUrl] = useState('https://i.imgur.com/ndu6pfe.png');
        const handleFiles = (files) => {
            console.log(files);
            setUrl(files.base64);
        };

        return (
            <form>
                <Grid container spacing={4} align="center" justify="center" direction="row" justifyContent="center">
                    {/* photos Left */}
                    <Grid container spacing={4} align="center" justify="center" direction="row" justifyContent="center" alignItems="center">
                        <Grid item xs={2} sm={2}>
                            <AvatarInput>
                                <img id="LLittle" name="LLittle" src={url} alt="Avatar Placeholder" />
                            </AvatarInput>

                            <ReactFileReader id="LLittle" name="LLittle" fileTypes={['.png', '.jpg']} base64={true} handleFiles={handleFiles}>
                                <IoFingerPrintOutline id="LLittle" name="LLittle" style={{ width: 30, height: 30 }} as={Button} />
                            </ReactFileReader>
                            <InputLabel id="LLittle" name="LLittle" style={{ paddingBottom: 10 }} size="normal">
                                6. L.Little
                            </InputLabel>
                        </Grid>
                        <Grid item xs={2} sm={2}>
                            <AvatarInput>
                                <img id="LLittle" name="LLittle" src={url} alt="Avatar Placeholder" />
                            </AvatarInput>

                            <ReactFileReader id="LIndex" name="LIndex" fileTypes={['.png', '.jpg']} base64={true} handleFiles={handleFiles}>
                                <IoFingerPrintOutline id="LIndex" name="LIndex" style={{ width: 30, height: 30 }} as={Button} />
                            </ReactFileReader>
                            <InputLabel id="LIndex" name="LIndex" style={{ paddingBottom: 10 }} size="normal">
                                7. L.Index
                            </InputLabel>
                        </Grid>
                        <Grid item xs={2} sm={2}>
                            <AvatarInput id="RMiddle" name="RMiddle">
                                <img id="RMiddle" name="RMiddle" src={url} alt="Avatar Placeholder" />
                            </AvatarInput>

                            <ReactFileReader id="RMiddle" name="RMiddle" fileTypes={['.png', '.jpg']} base64={true} handleFiles={handleFiles}>
                                <IoFingerPrintOutline id="RMiddle" name="RMiddle" style={{ width: 30, height: 30 }} as={Button} />
                            </ReactFileReader>
                            <InputLabel id="RMiddle" name="RMiddle" style={{ paddingBottom: 10 }} size="normal">
                                8. R.Middle
                            </InputLabel>
                        </Grid>
                        <Grid item xs={2} sm={2}>
                            <AvatarInput>
                                <img id="RRing" name="RRing" src={url} alt="Avatar Placeholder" />
                            </AvatarInput>

                            <ReactFileReader id="RRing" name="RRing" fileTypes={['.png', '.jpg']} base64={true} handleFiles={handleFiles}>
                                <IoFingerPrintOutline id="RRing" name="RRing" style={{ width: 30, height: 30 }} as={Button} />
                            </ReactFileReader>
                            <InputLabel id="RRing" name="RRing" style={{ paddingBottom: 10 }} size="normal">
                                9. R.Ring
                            </InputLabel>
                        </Grid>
                        <Grid item xs={2} sm={2}>
                            <AvatarInput>
                                <img id="RLittle" name="RLittle" src={url} alt="Avatar Placeholder" />
                            </AvatarInput>

                            <ReactFileReader id="RLittle" name="RLittle" fileTypes={['.png', '.jpg']} base64={true} handleFiles={handleFiles}>
                                <IoFingerPrintOutline id="RLittle" name="RLittle" style={{ width: 30, height: 30 }} as={Button} />
                            </ReactFileReader>
                            <InputLabel id="RLittle" name="RLittle" style={{ paddingBottom: 10 }} size="normal">
                                10. R.Little
                            </InputLabel>
                        </Grid>
                    </Grid>
                </Grid>
            </form>

        );
    }
</code>```

i have import import ReactFileReader from 'react-file-reader'; in the top of the  file and AvatarInput is defined like this

```<code>export const AvatarInput = styled.div`
    margin-bottom: 32px;
    position: relative;
    align-self: center;
    img {
        width: 200px;
        height: 200px;
        object-fit: cover;
        border-radius: 50%;
    }
    .rectangle {
        width: 200px;
        height: 200px;
        border-radius: 50%;
    }
    label {
        right: 23em !important;
        position: absolute;
        width: 48px;
        height: 48px;
        background: #312e38;
        border-radius: 50%;
        right: 0;
        bottom: 0;
        border: 0;
        cursor: pointer;
        transition: background-color 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
        input {
            display: none;
        }
        svg {
            width: 50px;
            height: 50px;
            color: #f4ede8;
        }
        &:hover {
            background: blue;
        }
    }
`;
</code>```

once i click the button and upload image same image appear in all
out will be like this

what i need upload six different image preview

Body:
I'm trying to upload image using in 'react-file-reader' i have six ReactFileReader in my react js file like this

   export default function Addphotos() {
        const [url, setUrl] = useState('https://i.imgur.com/ndu6pfe.png');
        const handleFiles = (files) => {
            console.log(files);
            setUrl(files.base64);
        };

        return (
            <form>
                <Grid container spacing={4} align="center" justify="center" direction="row" justifyContent="center">
                    {/* photos Left */}
                    <Grid container spacing={4} align="center" justify="center" direction="row" justifyContent="center" alignItems="center">
                        <Grid item xs={2} sm={2}>
                            <AvatarInput>

                            </AvatarInput>

                            <ReactFileReader id="LLittle" name="LLittle" fileTypes={['.png', '.jpg']} base64={true} handleFiles={handleFiles}>
                                <IoFingerPrintOutline id="LLittle" name="LLittle" style={{ width: 30, height: 30 }} as={Button} />
                            </ReactFileReader>
                            <InputLabel id="LLittle" name="LLittle" style={{ paddingBottom: 10 }} size="normal">
                                6. L.Little
                            </InputLabel>
                        </Grid>
                        <Grid item xs={2} sm={2}>
                            <AvatarInput>

                            </AvatarInput>

                            <ReactFileReader id="LIndex" name="LIndex" fileTypes={['.png', '.jpg']} base64={true} handleFiles={handleFiles}>
                                <IoFingerPrintOutline id="LIndex" name="LIndex" style={{ width: 30, height: 30 }} as={Button} />
                            </ReactFileReader>
                            <InputLabel id="LIndex" name="LIndex" style={{ paddingBottom: 10 }} size="normal">
                                7. L.Index
                            </InputLabel>
                        </Grid>
                        <Grid item xs={2} sm={2}>
                            <AvatarInput id="RMiddle" name="RMiddle">

                            </AvatarInput>

                            <ReactFileReader id="RMiddle" name="RMiddle" fileTypes={['.png', '.jpg']} base64={true} handleFiles={handleFiles}>
                                <IoFingerPrintOutline id="RMiddle" name="RMiddle" style={{ width: 30, height: 30 }} as={Button} />
                            </ReactFileReader>
                            <InputLabel id="RMiddle" name="RMiddle" style={{ paddingBottom: 10 }} size="normal">
                                8. R.Middle
                            </InputLabel>
                        </Grid>
                        <Grid item xs={2} sm={2}>
                            <AvatarInput>

                            </AvatarInput>

                            <ReactFileReader id="RRing" name="RRing" fileTypes={['.png', '.jpg']} base64={true} handleFiles={handleFiles}>
                                <IoFingerPrintOutline id="RRing" name="RRing" style={{ width: 30, height: 30 }} as={Button} />
                            </ReactFileReader>
                            <InputLabel id="RRing" name="RRing" style={{ paddingBottom: 10 }} size="normal">
                                9. R.Ring
                            </InputLabel>
                        </Grid>
                        <Grid item xs={2} sm={2}>
                            <AvatarInput>

                            </AvatarInput>

                            <ReactFileReader id="RLittle" name="RLittle" fileTypes={['.png', '.jpg']} base64={true} handleFiles={handleFiles}>
                                <IoFingerPrintOutline id="RLittle" name="RLittle" style={{ width: 30, height: 30 }} as={Button} />
                            </ReactFileReader>
                            <InputLabel id="RLittle" name="RLittle" style={{ paddingBottom: 10 }} size="normal">
                                10. R.Little
                            </InputLabel>
                        </Grid>
                    </Grid>
                </Grid>
            </form>

        );
    }

i have import import ReactFileReader from 'react-file-reader'; in the top of the  file and AvatarInput is defined like this

export const AvatarInput = styled.div`
    margin-bottom: 32px;
    position: relative;
    align-self: center;
    img {
        width: 200px;
        height: 200px;
        object-fit: cover;
        border-radius: 50%;
    }
    .rectangle {
        width: 200px;
        height: 200px;
        border-radius: 50%;
    }
    label {
        right: 23em !important;
        position: absolute;
        width: 48px;
        height: 48px;
        background: #312e38;
        border-radius: 50%;
        right: 0;
        bottom: 0;
        border: 0;
        cursor: pointer;
        transition: background-color 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
        input {
            display: none;
        }
        svg {
            width: 50px;
            height: 50px;
            color: #f4ede8;
        }
        &:hover {
            background: blue;
        }
    }
`;

once i click the button and upload image same image appear in all
out will be like this

what i need upload six different image preview


问:
How to convert value to type in Typescript?
I have the following enum defined:

```<code>enum FilterType {
  Number = 'number',
  Text = 'text',
  Other = 'other',
}
</code>```

Then later on I have:

```<code>switch(filterType) {
case FilterType.Number;
  return createFilter(name, filter as Filter<FilterType.Number>);
case FilterType.Text;
  return createFilter(name, filter as Filter<FilterType.Text>);
case FilterType.Other;
  return createFilter(name, filter as Filter<FilterType.Other>);
}
</code>```

I wonder if I can simplify this code block as it is exactly the same except casting filter to different types.

I tried this but apparently it doesn't work as you cannot put value in place of a type.

```<code>return createFilter(name, filter as Filter<filterType>);
</code>```

Body:
I have the following enum defined:

enum FilterType {
  Number = 'number',
  Text = 'text',
  Other = 'other',
}

Then later on I have:

switch(filterType) {
case FilterType.Number;
  return createFilter(name, filter as Filter<FilterType.Number>);
case FilterType.Text;
  return createFilter(name, filter as Filter<FilterType.Text>);
case FilterType.Other;
  return createFilter(name, filter as Filter<FilterType.Other>);
}

I wonder if I can simplify this code block as it is exactly the same except casting filter to different types.

I tried this but apparently it doesn't work as you cannot put value in place of a type.

return createFilter(name, filter as Filter<filterType>);


问:
How to use the `DBA` user to sign in the drainer in the primary master of the nebulagraph database?
I use NebulaGraph to synchronize date between clusters.
In the master cluster, I cannot use the DBA user to perform the sign in drainer service command.

```<code>(uuu_dba@nebula) [basketballplayer]> sign in drainer service(192.168.15.2:9889)
[ERROR (-1008)]: PermissionError: No permission to write space.

Tue, 03 Jan 2023 10:26:33 CST

(uuu_dba@nebula) [basketballplayer]> show roles in basketballplayer
+-----------+-----------+
| Account   | Role Type |
+-----------+-----------+
| "uuu_dba" | "DBA"     |
+-----------+-----------+
</code>```

Can I use the DBA user to register the drainer service in Nebula Graph?

Body:
I use NebulaGraph to synchronize date between clusters.
In the master cluster, I cannot use the DBA user to perform the sign in drainer service command.

(uuu_dba@nebula) [basketballplayer]> sign in drainer service(192.168.15.2:9889)
[ERROR (-1008)]: PermissionError: No permission to write space.

Tue, 03 Jan 2023 10:26:33 CST

(uuu_dba@nebula) [basketballplayer]> show roles in basketballplayer
+-----------+-----------+
| Account   | Role Type |
+-----------+-----------+
| "uuu_dba" | "DBA"     |
+-----------+-----------+

Can I use the DBA user to register the drainer service in Nebula Graph?


问:
How can I Reset git settings to default settings?
As I'm new to git, I have been exploring the git commands. since I am not well aware of how to use git, I have made some changes to the configurations which I don't actually remember of what changes I made, this has caused to pop an error message as -

'fatal: Invalid path 'D:/Sliit': No such file or directory'

I have been trying to reset the commands to initial configuration, but the error message is received every time I tried to do so.

How can I reset the settings to default?

What causes this error message to be shown?


问:
Trying to make network requests from a standalone Apple Watch app
Is Apple Watch not able to make network calls when the app is a standalone app, even though the watch is connected to an iPhone? I'm using the new standalone app target, which does not come with a paired iOS app to which WatchConnectivity requests could be made.

I'm getting "Bad file descriptor" 9 times out of 10, and this is making me think watch apps basically need an iPhone to guarantee some amount of connectivity (my watch doesn't have cellular and I can't connect to public wifi hotspots).

Am I holding this wrong?

Example code snippet to reproduce this:

import Combine
import SwiftUI

var cancellables = Set<AnyCancellable>()

@main
struct NetworkTest_Watch_AppApp: App {

  var body: some Scene {
    WindowGroup {
      Text("Test")
        .task {
          let url = URL(string: "https://google.com")!
          let dataTaskPublisher = URLSession.shared.dataTaskPublisher(for: url)

          dataTaskPublisher
            .retry(3)
            .sink(receiveCompletion: { completion in
              print(completion)
            }, receiveValue: { response in
              print(response)
            })
            .store(in: &cancellables)
        }
    }
  }
}
```
<p>Example log failure:</p>
```2023-01-05 22:48:54.472214-0800 NetworkTest Watch App[809:862165] [scenes] unable to send desiredFidelity:Never response to desiredFidelityAction:<BLSDesiredFidelityAction: 0x16ed9090; info: 0x0; responder: <_BSActionResponder: 0x16ed93e0; active: YES; waiting: NO> clientInvalidated = NO;
clientEncoded = NO;
clientResponded = NO;
reply = <BSMachPortSendOnceRight: 0x16ed9a90; usable: NO; (809:0:send-once xpcCode) from (779:0:send-once take)>;
annulled = YES;>
2023-01-05 22:50:14.457958-0800 NetworkTest Watch App[809:862418] PDTask <42094D6F-56E0-45A9-9F47-53DB66453C9D>.<1> finished with error [9] Error Domain=NSPOSIXErrorDomain Code=9 "Bad file descriptor" UserInfo={_kCFStreamErrorCodeKey=9, NSErrorPeerAddressKey={length = 28, bytes = 0x1c1ef516 00000000 fd746572 6d6e7573 ... cbc268fa 00000000 }, _kCFStreamErrorDomainKey=1, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataPDTask <42094D6F-56E0-45A9-9F47-53DB66453C9D>.<1>",
    "LocalDataTask <42094D6F-56E0-45A9-9F47-53DB66453C9D>.<1>"
), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataPDTask <42094D6F-56E0-45A9-9F47-53DB66453C9D>.<1>}
2023-01-05 22:50:14.459136-0800 NetworkTest Watch App[809:862418] Task <42094D6F-56E0-45A9-9F47-53DB66453C9D>.<1> finished with error [9] Error Domain=NSPOSIXErrorDomain Code=9 "Bad file descriptor" UserInfo={_kCFStreamErrorCodeKey=9, NSErrorPeerAddressKey={length = 28, bytes = 0x1c1ef516 00000000 fd746572 6d6e7573 ... cbc268fa 00000000 }, _kCFStreamErrorDomainKey=1, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <42094D6F-56E0-45A9-9F47-53DB66453C9D>.<1>",
    "LocalDataPDTask <42094D6F-56E0-45A9-9F47-53DB66453C9D>.<1>",
    "LocalDataTask <42094D6F-56E0-45A9-9F47-53DB66453C9D>.<1>"
), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <42094D6F-56E0-45A9-9F47-53DB66453C9D>.<1>}
```

Body:
Is Apple Watch not able to make network calls when the app is a standalone app, even though the watch is connected to an iPhone? I'm using the new standalone app target, which does not come with a paired iOS app to which WatchConnectivity requests could be made.

I'm getting "Bad file descriptor" 9 times out of 10, and this is making me think watch apps basically need an iPhone to guarantee some amount of connectivity (my watch doesn't have cellular and I can't connect to public wifi hotspots).

Am I holding this wrong?

Example code snippet to reproduce this:

import Combine
import SwiftUI

var cancellables = Set<AnyCancellable>()

@main
struct NetworkTest_Watch_AppApp: App {

  var body: some Scene {
    WindowGroup {
      Text("Test")
        .task {
          let url = URL(string: "https://google.com")!
          let dataTaskPublisher = URLSession.shared.dataTaskPublisher(for: url)

          dataTaskPublisher
            .retry(3)
            .sink(receiveCompletion: { completion in
              print(completion)
            }, receiveValue: { response in
              print(response)
            })
            .store(in: &cancellables)
        }
    }
  }
}

Example log failure:

2023-01-05 22:48:54.472214-0800 NetworkTest Watch App[809:862165] [scenes] unable to send desiredFidelity:Never response to desiredFidelityAction:<BLSDesiredFidelityAction: 0x16ed9090; info: 0x0; responder: <_BSActionResponder: 0x16ed93e0; active: YES; waiting: NO> clientInvalidated = NO;
clientEncoded = NO;
clientResponded = NO;
reply = <BSMachPortSendOnceRight: 0x16ed9a90; usable: NO; (809:0:send-once xpcCode) from (779:0:send-once take)>;
annulled = YES;>
2023-01-05 22:50:14.457958-0800 NetworkTest Watch App[809:862418] PDTask <42094D6F-56E0-45A9-9F47-53DB66453C9D>.<1> finished with error [9] Error Domain=NSPOSIXErrorDomain Code=9 "Bad file descriptor" UserInfo={_kCFStreamErrorCodeKey=9, NSErrorPeerAddressKey={length = 28, bytes = 0x1c1ef516 00000000 fd746572 6d6e7573 ... cbc268fa 00000000 }, _kCFStreamErrorDomainKey=1, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataPDTask <42094D6F-56E0-45A9-9F47-53DB66453C9D>.<1>",
    "LocalDataTask <42094D6F-56E0-45A9-9F47-53DB66453C9D>.<1>"
), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataPDTask <42094D6F-56E0-45A9-9F47-53DB66453C9D>.<1>}
2023-01-05 22:50:14.459136-0800 NetworkTest Watch App[809:862418] Task <42094D6F-56E0-45A9-9F47-53DB66453C9D>.<1> finished with error [9] Error Domain=NSPOSIXErrorDomain Code=9 "Bad file descriptor" UserInfo={_kCFStreamErrorCodeKey=9, NSErrorPeerAddressKey={length = 28, bytes = 0x1c1ef516 00000000 fd746572 6d6e7573 ... cbc268fa 00000000 }, _kCFStreamErrorDomainKey=1, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <42094D6F-56E0-45A9-9F47-53DB66453C9D>.<1>",
    "LocalDataPDTask <42094D6F-56E0-45A9-9F47-53DB66453C9D>.<1>",
    "LocalDataTask <42094D6F-56E0-45A9-9F47-53DB66453C9D>.<1>"
), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <42094D6F-56E0-45A9-9F47-53DB66453C9D>.<1>}


问:
How does segment merging in SolrCloud happen on different types of replicas
We have 3 different types of replicas in SolrCloud: NRT, tlog and pull.
When segment merging happens, does it happen independently on all replicas? This would create inconcistencies between segments on replicas however.

Or is the leader first merges the segments and then sends it to its replicas to overwrite the segments?

I want to see if configuring segment merge policy with a combination of tlog and pull replicas can improve query/index performance.

Any insights would be highly appreciated.


问:
Is there a way to add buttons to an InteractiveViewer Class in Flutter?
I am trying to make a custom map that has an image as the background. I need to add buttons on each of the machines and have them line up with the image when the user pinches or moves the Viewer.

```<code>// ignore_for_file: prefer_const_constructors

import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

class MapView extends StatefulWidget {
  const MapView({super.key});

  @override
  State<MapView> createState() => _MapViewState();
}

class _MapViewState extends State<MapView> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Color.fromARGB(255, 32, 26, 49),
      body: SafeArea(
        child: Padding(
          padding: const EdgeInsets.symmetric(vertical: 10),
          child: Center(
            child: InteractiveViewer(
                minScale: 3,
                maxScale: 100.6,
                child: SvgPicture.asset('Assets/roomtest.svg')),
          ),
        ),
      ),
    );
  }
}
</code>```

Current App State : -

I need to add buttons on top of the machines.

like this-

Desired Page with Buttons : -

I tried searching on the internet and watched and read all documentation on the InteractiveViewer class in Flutter. I couldn't find an alternative class and then tried to add buttons however it just wouldn't line up with the image

Body:
I am trying to make a custom map that has an image as the background. I need to add buttons on each of the machines and have them line up with the image when the user pinches or moves the Viewer.

// ignore_for_file: prefer_const_constructors

import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

class MapView extends StatefulWidget {
  const MapView({super.key});

  @override
  State<MapView> createState() => _MapViewState();
}

class _MapViewState extends State<MapView> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Color.fromARGB(255, 32, 26, 49),
      body: SafeArea(
        child: Padding(
          padding: const EdgeInsets.symmetric(vertical: 10),
          child: Center(
            child: InteractiveViewer(
                minScale: 3,
                maxScale: 100.6,
                child: SvgPicture.asset('Assets/roomtest.svg')),
          ),
        ),
      ),
    );
  }
}

Current App State : -

I need to add buttons on top of the machines.

like this-

Desired Page with Buttons : -

I tried searching on the internet and watched and read all documentation on the InteractiveViewer class in Flutter. I couldn't find an alternative class and then tried to add buttons however it just wouldn't line up with the image


问:
How to deliberately slow down a program in Linux?
This may be a bit weird since I'm going backwards (instead of speeding up a program) but there's a reason for this.

Currently, I have used a file watcher called inotifywait that watches the file changes of a running program. Let's say I have this python program:

```<code>import os
os.mkdir('abc')
os.mkdir('abc/def')
os.mkdir('abc/def/ghi')
</code>```

Since the program is too fast, the file watcher cannot catch up with the file events from the program. Furthermore, to test my theory that if I slow down the program, I added loops between each mkdir(). And now, the file watcher can catch up.

```<code>import os
os.mkdir('abc')
for i in range(100000):
  pass
os.mkdir('abc/def')
for i in range(100000):
  pass
os.mkdir('abc/def/ghi')
</code>```

So, is there a way to deliberately slow down a program or a process in Linux?

Limitations:
The program being watched is not modifiable. The example above is just to prove that the file watcher can catch up with the file events if the program is being slowed down.

Body:
This may be a bit weird since I'm going backwards (instead of speeding up a program) but there's a reason for this.

Currently, I have used a file watcher called inotifywait that watches the file changes of a running program. Let's say I have this python program:

import os
os.mkdir('abc')
os.mkdir('abc/def')
os.mkdir('abc/def/ghi')

Since the program is too fast, the file watcher cannot catch up with the file events from the program. Furthermore, to test my theory that if I slow down the program, I added loops between each mkdir(). And now, the file watcher can catch up.

import os
os.mkdir('abc')
for i in range(100000):
  pass
os.mkdir('abc/def')
for i in range(100000):
  pass
os.mkdir('abc/def/ghi')

So, is there a way to deliberately slow down a program or a process in Linux?

Limitations:
The program being watched is not modifiable. The example above is just to prove that the file watcher can catch up with the file events if the program is being slowed down.


问:
How to communicate between order placing system and trade matching system
Order Placing System

A user places an order and the corresponding amount is kept on hold for the order and an order is created. This order is then pushed to some queue to be used by trade matching system. User gets back a reference order id for the order placed in return to the API call.

Trade Matching System

The system feeds on data from the queue generated by order placing system and looks for possible match and if possible to execute, executes them and push to another queue.

User Notification System

The system fetches data from the executed queue and broadcasts it to the user it belonged to. User can also fetch status of the order from the reference id which was shared on first API call

These two systems are right now communicating indirectly via a queue. Now the requirement is, in order placing system, when a user places order, along with order id, we also need to return execution status (i.e. Whether it got executed or not, if yes, rate and fee charged etc).

What should be mode of communication between order placing and trade matching system to make it possible to return execution details in first api call itself ?

Challenges

Matching System being single threaded, we cannot merge it with order engine

Polling and waiting for execution from execution queue, will probably make our order placing API slow

Right now our order placing system and matching system are separate.

Just looking for possible solution and opinion. Please let me know if something is unclear.


问:
How can I solve the error "Failed to parse flash type or unrecognized flash type" on STM32 board?
I tried to run the benchmarking code at here

When I try to flash the binary like st-flash write benchmark-kindi256342.bin 0x8000000, an error occurs as following.

```<code>st-flash 1.7.0-233-gc7bcb52
Failed to parse flash type or unrecognized flash type
2023-01-06T14:53:14 INFO common.c: STM32F4x5_F4x7: 192 KiB SRAM, 8193 KiB flash in at least 16 KiB pages.
file benchmark-kindi256342.bin md5 checksum: 3fa07ff1b92e1f518836528be256b098, stlink checksum: 0x00be4029
2023-01-06T14:53:14 INFO common_flash.c: Attempting to write 98588 (0x1811c) bytes to stm32 address: 134217728 (0x8000000)
EraseFlash - Sector:0x0 Size:0x4000 -> Flash page at 0x8000000 erased (size: 0x4000)
EraseFlash - Sector:0x1 Size:0x4000 -> Flash page at 0x8004000 erased (size: 0x4000)
EraseFlash - Sector:0x2 Size:0x4000 -> Flash page at 0x8008000 erased (size: 0x4000)
EraseFlash - Sector:0x3 Size:0x4000 -> Flash page at 0x800c000 erased (size: 0x4000)
EraseFlash - Sector:0x4 Size:0x10000 -> Flash page at 0x8010000 erased (size: 0x10000)

2023-01-06T14:53:17 INFO flashloader.c: Starting Flash write for F2/F4/F7/L4
2023-01-06T14:53:17 INFO flash_loader.c: Successfully loaded flash loader in sram
2023-01-06T14:53:17 INFO flash_loader.c: Clear DFSR
2023-01-06T14:53:17 INFO flash_loader.c: Clear CFSR
2023-01-06T14:53:17 INFO flash_loader.c: Clear HFSR
2023-01-06T14:53:17 INFO flashloader.c: enabling 32-bit flash writes
2023-01-06T14:53:19 INFO common_flash.c: Starting verification of write complete
2023-01-06T14:53:19 ERROR common_flash.c: Verification of flash failed at offset: 0
stlink_fwrite_flash() == -1
</code>```

The first error is Failed to parse flash type or unrecognized flash type and the second is ERROR common_flash.c: Verification of flash failed at offset: 0.

How can I solve this error?

I use STM32F407G board and linux using VMWare.

I tried
st-flash --connect-under-reset --reset write build/h7a3zi_test.bin 0x08000000,
but it doesn't work.

Also I tried re-plug all the cables and it doesn't work too.

Body:
I tried to run the benchmarking code at here

When I try to flash the binary like st-flash write benchmark-kindi256342.bin 0x8000000, an error occurs as following.

st-flash 1.7.0-233-gc7bcb52
Failed to parse flash type or unrecognized flash type
2023-01-06T14:53:14 INFO common.c: STM32F4x5_F4x7: 192 KiB SRAM, 8193 KiB flash in at least 16 KiB pages.
file benchmark-kindi256342.bin md5 checksum: 3fa07ff1b92e1f518836528be256b098, stlink checksum: 0x00be4029
2023-01-06T14:53:14 INFO common_flash.c: Attempting to write 98588 (0x1811c) bytes to stm32 address: 134217728 (0x8000000)
EraseFlash - Sector:0x0 Size:0x4000 -> Flash page at 0x8000000 erased (size: 0x4000)
EraseFlash - Sector:0x1 Size:0x4000 -> Flash page at 0x8004000 erased (size: 0x4000)
EraseFlash - Sector:0x2 Size:0x4000 -> Flash page at 0x8008000 erased (size: 0x4000)
EraseFlash - Sector:0x3 Size:0x4000 -> Flash page at 0x800c000 erased (size: 0x4000)
EraseFlash - Sector:0x4 Size:0x10000 -> Flash page at 0x8010000 erased (size: 0x10000)

2023-01-06T14:53:17 INFO flashloader.c: Starting Flash write for F2/F4/F7/L4
2023-01-06T14:53:17 INFO flash_loader.c: Successfully loaded flash loader in sram
2023-01-06T14:53:17 INFO flash_loader.c: Clear DFSR
2023-01-06T14:53:17 INFO flash_loader.c: Clear CFSR
2023-01-06T14:53:17 INFO flash_loader.c: Clear HFSR
2023-01-06T14:53:17 INFO flashloader.c: enabling 32-bit flash writes
2023-01-06T14:53:19 INFO common_flash.c: Starting verification of write complete
2023-01-06T14:53:19 ERROR common_flash.c: Verification of flash failed at offset: 0
stlink_fwrite_flash() == -1

The first error is Failed to parse flash type or unrecognized flash type and the second is ERROR common_flash.c: Verification of flash failed at offset: 0.

How can I solve this error?

I use STM32F407G board and linux using VMWare.

I tried
st-flash --connect-under-reset --reset write build/h7a3zi_test.bin 0x08000000,
but it doesn't work.

Also I tried re-plug all the cables and it doesn't work too.


问:
Create sharp css gradient
I want to create a sharp gradient like the picture below with this format -webkit-gradient(linear, 120% -300%, -00% -350%, from(rgb(0, 0, 0)), to(rgba(0, 0, 0, 0))) But I am unable to achieve it.

I know there are lot of css generators available but they are creating css in this format. linear-gradient(167deg, rgba(149,58,141,1) 73%, rgba(149,58,141,0) 82%);

I am trying to achive this gradient. Thanks in advance.

Title: Create sharp css gradient


问:
Unable to get JSON response for post API with alamofire in swift
I have created generic methods in NetworkManager but this serviceCall working only .get method APIs
if i use post method with parameters like below got error

error:

```<code>{
code = "-32700";
meaning = "Undefined array key \"params\"";
message = "Parse error";
}

func testServiceCall(){

let parameters = ["name": "testinggg", "job": "manager"] as [String : Any]

let request = RequestObject(params: parameters, method: .post, path: "https://reqres.in/api/users", isTokenNeed: false, vc: self)
WebService.sharedInstance.serviceCall(UserModel.self, with: request) { (response, error) in
    print("user post response \(response)")

}
}
</code>```

This is NetworkManager Class: here added parameters not working

```<code>class GeneralResponse<T: Codable>: Codable {
    var jsonrpc: String
    var result: T?
    let error: ErrorClass?
}

struct ErrorClass: Codable {
    let code, message, meaning: String?
}

struct RequestObject {

    var params: [String: Any]?
    var method: HTTPMethod
    var path: String
    var isTokenNeed: Bool = false
    var vc: UIViewController?
}

class NetworkManager {

private let decoder: JSONDecoder
static let sharedInstance = NetworkManager()

public init(_ decoder: JSONDecoder = JSONDecoder()) {
    self.decoder = decoder
}

public func serviceCall<T: Codable>(_ objectType: T.Type,

                                    with request: RequestObject,
                                    completion: @escaping  (T?, Error?) -> Void)  {

    AF.request(request.path, method: request.method, parameters: request.params,encoding: JSONEncoding.default, headers: request.isTokenNeed ? ["Authorization" : "Bearer hnjjdshjdsh", "Accept": "application/json"] : ["" : ""])
        .responseJSON { response in

            switch response.result {
            case .success(_):
                do {
                    let data = response.data
                    let responseData  = try self.decoder.decode(T.self, from: data ?? Data())
                    completion(responseData, nil)

                } catch {
                    completion(nil, error)
                    print("in catch \(error.localizedDescription)")
                }
            case .failure(let AFError):
                let error = AFError
                print(error.localizedDescription)
                print("failure error: \(error)")
            }
        }
}
}
</code>```

Body:
I have created generic methods in NetworkManager but this serviceCall working only .get method APIs
if i use post method with parameters like below got error

error:

{
code = "-32700";
meaning = "Undefined array key \"params\"";
message = "Parse error";
}

func testServiceCall(){

let parameters = ["name": "testinggg", "job": "manager"] as [String : Any]

let request = RequestObject(params: parameters, method: .post, path: "https://reqres.in/api/users", isTokenNeed: false, vc: self)
WebService.sharedInstance.serviceCall(UserModel.self, with: request) { (response, error) in
    print("user post response \(response)")

}
}

This is NetworkManager Class: here added parameters not working

class GeneralResponse<T: Codable>: Codable {
    var jsonrpc: String
    var result: T?
    let error: ErrorClass?
}

struct ErrorClass: Codable {
    let code, message, meaning: String?
}

struct RequestObject {

    var params: [String: Any]?
    var method: HTTPMethod
    var path: String
    var isTokenNeed: Bool = false
    var vc: UIViewController?
}

class NetworkManager {

private let decoder: JSONDecoder
static let sharedInstance = NetworkManager()

public init(_ decoder: JSONDecoder = JSONDecoder()) {
    self.decoder = decoder
}

public func serviceCall<T: Codable>(_ objectType: T.Type,

                                    with request: RequestObject,
                                    completion: @escaping  (T?, Error?) -> Void)  {

    AF.request(request.path, method: request.method, parameters: request.params,encoding: JSONEncoding.default, headers: request.isTokenNeed ? ["Authorization" : "Bearer hnjjdshjdsh", "Accept": "application/json"] : ["" : ""])
        .responseJSON { response in

            switch response.result {
            case .success(_):
                do {
                    let data = response.data
                    let responseData  = try self.decoder.decode(T.self, from: data ?? Data())
                    completion(responseData, nil)

                } catch {
                    completion(nil, error)
                    print("in catch \(error.localizedDescription)")
                }
            case .failure(let AFError):
                let error = AFError
                print(error.localizedDescription)
                print("failure error: \(error)")
            }
        }
}
}


问:
How to add options in xbbg API BDP for Bloomberg
In BDP in Excel, I can get 'CBBT, 'BVAL' and can't get 'BMMK'.
enter image description here

ex) CBBT

```<code>@BDP("EI3229347 Corp", "PX_CLEAN_MID", "PCS", "CBBT")
@BDP("EI3229347 Corp", "YLD_YTM_MID", "PCS", "CBBT")
@BDP("EI3229347 Corp", "INT_ACC", "SETTLE_DT", "20221230")
@BDP("EI3229347 Corp", "DUR_MID", "PCS", "CBBT", "SETTLE_DT", "20221230")
@BDP("EI3229347 Corp", "DUR_ADJ_MID", "PCS", "CBBT", "SETTLE_DT", "20221230")
@BDP("EI3229347 Corp", "DUR_ADJ_OAS_MID", "PCS", "CBBT", "SETTLE_DT", "20221230")
@BDP("EI3229347 Corp", "CNVX_MID", "PCS", "CBBT", "SETTLE_DT", "20221230")
</code>```

I have the following code:

```<code>from xbbg import blp

ticker = 'EI3229347 Corp'
fields = [
    'PX_CLEAN_MID'
    , 'YLD_YTM_MID'
    , 'INT_ACC'
    , 'DUR_MID'
    , 'DUR_ADJ_MID'
    , 'DUR_ADJ_OAS_MID'
    , 'CNVX_MID'
]
std_date = '20221230'
# PCS = ['CBBT', 'BMRK', 'BVAL']

df = blp.bdp(
    tickers=ticker
    , flds=fields
    , SETTLE_DT=std_date
)

print(df)
</code>```

It seems to be result in 'CBBT'

which works just fine.

but I hope to get separately 'CBBT, 'BVAL','BMMK'.

```<code>from xbbg import blp

ticker = 'EI3229347 Corp'
fields = [
    'PX_CLEAN_MID'
    , 'YLD_YTM_MID'
    , 'INT_ACC'
    , 'DUR_MID'
    , 'DUR_ADJ_MID'
    , 'DUR_ADJ_OAS_MID'
    , 'CNVX_MID'
]
std_date = '20221230'
PCS = ['CBBT', 'BMRK', 'BVAL']

for p in PCS:
    df = blp.bdp(
        tickers=ticker
        , flds=fields
        , SETTLE_DT=std_date
        , PCS=p
    )

    print(df)
</code>```

It doesn't work, can anybody help me with this

Like Excel, I hope to get 'CBBT, 'BVAL'. How to solve 'PCS'?

Body:
In BDP in Excel, I can get 'CBBT, 'BVAL' and can't get 'BMMK'.
enter image description here

ex) CBBT

@BDP("EI3229347 Corp", "PX_CLEAN_MID", "PCS", "CBBT")
@BDP("EI3229347 Corp", "YLD_YTM_MID", "PCS", "CBBT")
@BDP("EI3229347 Corp", "INT_ACC", "SETTLE_DT", "20221230")
@BDP("EI3229347 Corp", "DUR_MID", "PCS", "CBBT", "SETTLE_DT", "20221230")
@BDP("EI3229347 Corp", "DUR_ADJ_MID", "PCS", "CBBT", "SETTLE_DT", "20221230")
@BDP("EI3229347 Corp", "DUR_ADJ_OAS_MID", "PCS", "CBBT", "SETTLE_DT", "20221230")
@BDP("EI3229347 Corp", "CNVX_MID", "PCS", "CBBT", "SETTLE_DT", "20221230")

I have the following code:

from xbbg import blp

ticker = 'EI3229347 Corp'
fields = [
    'PX_CLEAN_MID'
    , 'YLD_YTM_MID'
    , 'INT_ACC'
    , 'DUR_MID'
    , 'DUR_ADJ_MID'
    , 'DUR_ADJ_OAS_MID'
    , 'CNVX_MID'
]
std_date = '20221230'
# PCS = ['CBBT', 'BMRK', 'BVAL']

df = blp.bdp(
    tickers=ticker
    , flds=fields
    , SETTLE_DT=std_date
)

print(df)

It seems to be result in 'CBBT'

which works just fine.

but I hope to get separately 'CBBT, 'BVAL','BMMK'.

from xbbg import blp

ticker = 'EI3229347 Corp'
fields = [
    'PX_CLEAN_MID'
    , 'YLD_YTM_MID'
    , 'INT_ACC'
    , 'DUR_MID'
    , 'DUR_ADJ_MID'
    , 'DUR_ADJ_OAS_MID'
    , 'CNVX_MID'
]
std_date = '20221230'
PCS = ['CBBT', 'BMRK', 'BVAL']

for p in PCS:
    df = blp.bdp(
        tickers=ticker
        , flds=fields
        , SETTLE_DT=std_date
        , PCS=p
    )

    print(df)

It doesn't work, can anybody help me with this

Like Excel, I hope to get 'CBBT, 'BVAL'. How to solve 'PCS'?