问:
try except under loop in python selenium for find element
I am facing a strange issue where my python code takes one minute to complete a loop when i used it under try except statement. The try block contains a driver.find_element which raises exception when it is not found and in the except block i am decrementing the loop count. Could you help me on reducing the looping time as the loops are faster in any programming language.

My code is below

def get_element_by_loop(self,elem_name,prefix,suffix,start_no,end_no):

```<code>    '''
    This function will get the loop of the element in parm1 with the given prefix and end_no\n
    parm1 is elem tag name in the id of element
    parm2 is prefix of loop count
    parm3 is start of loop count
    parm4 is end of loop count
    '''

    retry = end_no
    btn_no = start_no
    while retry>0:
        print(f"retry {retry} button no {btn_no}")
        try:
            elem_no = f"//{elem_name}[@id='{prefix}{btn_no}{suffix}']"
            print(btn_no)
            print(datetime.now())
            if self.checkelembyxpath(elem_no):
                print(elem_no)
                elem = self.driver.find_element(By.XPATH, elem_no)
                retry = 0
                return elem
            else:
                raise Exception("Element not found")
        except:
            btn_no+=1
            retry-=1
</code>```

output
retry 49 button no 11
11
2023-01-06 12:21:53.116641
[29724:3240:0106/122208.282:ERROR:component_installer.cc(153)] Move failed.: The system cannot find the path specified. (0x3)
[29724:3240:0106/122217.878:ERROR:component_installer.cc(153)] Move failed.: The system cannot find the path specified. (0x3)
[29724:3240:0106/122231.926:ERROR:component_installer.cc(153)] Move failed.: The system cannot find the path specified. (0x3)
[29724:3240:0106/122250.540:ERROR:component_installer.cc(153)] Move failed.: The system cannot find the path specified. (0x3)
retry 48 button no 12
12
2023-01-06 12:22:53.187822
[29724:3240:0106/122313.441:ERROR:component_installer.cc(153)] Move failed.: The system cannot find the path specified. (0x3)
[29724:3240:0106/122340.717:ERROR:component_installer.cc(153)] Move failed.: The system cannot find the path specified. (0x3)
retry 47 button no 13
13
2023-01-06 12:23:53.199986
[29724:3240:0106/122412.320:ERROR:component_installer.cc(153)] Move failed.: The system cannot find the path specified. (0x3)
[29724:3240:0106/122448.497:ERROR:component_installer.cc(153)] Move failed.: The system cannot find the path specified. (0x3)
retry 46 button no 14
14
2023-01-06 12:24:53.256596
[29724:3240:0106/122529.520:ERROR:component_installer.cc(153)] Move failed.: The system cannot find the path specified. (0x3)
retry 45 button no 15
15
2023-01-06 12:25:53.305041
[29724:3240:0106/122614.308:ERROR:component_installer.cc(153)] Move failed.: The system cannot find the path specified. (0x3)
retry 44 button no 16
16
2023-01-06 12:26:53.376777

Body:
I am facing a strange issue where my python code takes one minute to complete a loop when i used it under try except statement. The try block contains a driver.find_element which raises exception when it is not found and in the except block i am decrementing the loop count. Could you help me on reducing the looping time as the loops are faster in any programming language.

My code is below

def get_element_by_loop(self,elem_name,prefix,suffix,start_no,end_no):

    '''
    This function will get the loop of the element in parm1 with the given prefix and end_no\n
    parm1 is elem tag name in the id of element
    parm2 is prefix of loop count
    parm3 is start of loop count
    parm4 is end of loop count
    '''

    retry = end_no
    btn_no = start_no
    while retry>0:
        print(f"retry {retry} button no {btn_no}")
        try:
            elem_no = f"//{elem_name}[@id='{prefix}{btn_no}{suffix}']"
            print(btn_no)
            print(datetime.now())
            if self.checkelembyxpath(elem_no):
                print(elem_no)
                elem = self.driver.find_element(By.XPATH, elem_no)
                retry = 0
                return elem
            else:
                raise Exception("Element not found")
        except:
            btn_no+=1
            retry-=1

output
retry 49 button no 11
11
2023-01-06 12:21:53.116641
[29724:3240:0106/122208.282:ERROR:component_installer.cc(153)] Move failed.: The system cannot find the path specified. (0x3)
[29724:3240:0106/122217.878:ERROR:component_installer.cc(153)] Move failed.: The system cannot find the path specified. (0x3)
[29724:3240:0106/122231.926:ERROR:component_installer.cc(153)] Move failed.: The system cannot find the path specified. (0x3)
[29724:3240:0106/122250.540:ERROR:component_installer.cc(153)] Move failed.: The system cannot find the path specified. (0x3)
retry 48 button no 12
12
2023-01-06 12:22:53.187822
[29724:3240:0106/122313.441:ERROR:component_installer.cc(153)] Move failed.: The system cannot find the path specified. (0x3)
[29724:3240:0106/122340.717:ERROR:component_installer.cc(153)] Move failed.: The system cannot find the path specified. (0x3)
retry 47 button no 13
13
2023-01-06 12:23:53.199986
[29724:3240:0106/122412.320:ERROR:component_installer.cc(153)] Move failed.: The system cannot find the path specified. (0x3)
[29724:3240:0106/122448.497:ERROR:component_installer.cc(153)] Move failed.: The system cannot find the path specified. (0x3)
retry 46 button no 14
14
2023-01-06 12:24:53.256596
[29724:3240:0106/122529.520:ERROR:component_installer.cc(153)] Move failed.: The system cannot find the path specified. (0x3)
retry 45 button no 15
15
2023-01-06 12:25:53.305041
[29724:3240:0106/122614.308:ERROR:component_installer.cc(153)] Move failed.: The system cannot find the path specified. (0x3)
retry 44 button no 16
16
2023-01-06 12:26:53.376777


来源: stackexchange

问:
Replace a placholder in a file with git commit short sha
I have in a file a placeholder GitHash and want to replace this with the git commit short sha hash and use sed for example.

This should be done in a pipeline job in GitLab.

So I wrote following into my .gitlab-ci.yml file:

```<code>set-revesion:
  image: registry.gitlab.com/gitlab-org/release-cli:latest
  stage: Set
  script:
    - apk update
    - apk add zip # Because it is a .odt which needs to be unpacked
    - mkdir MyFile
    - unzip MyFile.odt -d unpack
    - cd unpack
    - sed -e 's|GitHash|${$CI_COMMIT_SHORT_SHA}|g' -i content.xml
    - sed -e 's|GitHash|${$CI_COMMIT_SHORT_SHA}|g' -i styles.xml
    - zip -r ../MyFile/MyFile.odt .
  artifacts:
    when: always
    paths:
      - Specification/
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I have in a file a placeholder GitHash and want to replace this with the git commit short sha hash and use sed for example.

This should be done in a pipeline job in GitLab.

So I wrote following into my .gitlab-ci.yml file:

set-revesion:
  image: registry.gitlab.com/gitlab-org/release-cli:latest
  stage: Set
  script:
    - apk update
    - apk add zip # Because it is a .odt which needs to be unpacked
    - mkdir MyFile
    - unzip MyFile.odt -d unpack
    - cd unpack
    - sed -e 's|GitHash|${$CI_COMMIT_SHORT_SHA}|g' -i content.xml
    - sed -e 's|GitHash|${$CI_COMMIT_SHORT_SHA}|g' -i styles.xml
    - zip -r ../MyFile/MyFile.odt .
  artifacts:
    when: always
    paths:
      - Specification/


问:
String using pmr null memory resource
I am learning about the null_memory_resource and tried using it in a simple example. I set it as the default memory resource with set_default_resource and attempted to initialize a std::vector, but received a std::bad_alloc exception because the vector was trying to allocate memory using the null_memory_resource, which does not actually allocate any memory but throws an exception.

Now I am experimenting with a std::string and found that if the string size is below 16, no exception is thrown, but if the size is above 16, an exception is thrown. Any specific reason for this behavior?

The code snippet:

```<code>#include <iostream>
#include <memory_resource>
#include <string>
#include <vector>
#include <unistd.h>

int main()
{
  std::pmr::memory_resource* default_resource = std::pmr::null_memory_resource();

  std::pmr::set_default_resource(default_resource);

  try
  {
    std::pmr::vector<std::uint8_t> data{1};
  }catch(std::bad_alloc e)
  {
    std::cerr << "bad_alloc is thrown vector" << std::endl;
  }

  // No exception here if the size is below 16
  std::pmr::string str1 {"abcdefghi"};
  std::cerr << str1 << " Length:" << str1.size() << std::endl;

  try
  {
      // Exception here if the size is  >= 16
    std::pmr::string str2 {"abcdefghijklmnop"};
  }catch(std::bad_alloc e)
  {
    std::cerr << "bad_alloc is thrown string" << std::endl;
  }
  return 0;

}
</code>```

Output:

```<code>bad_alloc is thrown vector
abcdefghi Length:9
bad_alloc is thrown string
</code>```

online compiler:
https://godbolt.org/z/147ceMc7n

Edit1: Thanks for the info about SSO; now I understand the behavior of the program. But is there any way to avoid the SSO completely?

Title: String using pmr null memory resource

Body:
I am learning about the null_memory_resource and tried using it in a simple example. I set it as the default memory resource with set_default_resource and attempted to initialize a std::vector, but received a std::bad_alloc exception because the vector was trying to allocate memory using the null_memory_resource, which does not actually allocate any memory but throws an exception.

Now I am experimenting with a std::string and found that if the string size is below 16, no exception is thrown, but if the size is above 16, an exception is thrown. Any specific reason for this behavior?

The code snippet:

#include <iostream>
#include <memory_resource>
#include <string>
#include <vector>
#include <unistd.h>

int main()
{
  std::pmr::memory_resource* default_resource = std::pmr::null_memory_resource();

  std::pmr::set_default_resource(default_resource);

  try
  {
    std::pmr::vector<std::uint8_t> data{1};
  }catch(std::bad_alloc e)
  {
    std::cerr << "bad_alloc is thrown vector" << std::endl;
  }

  // No exception here if the size is below 16
  std::pmr::string str1 {"abcdefghi"};
  std::cerr << str1 << " Length:" << str1.size() << std::endl;

  try
  {
      // Exception here if the size is  >= 16
    std::pmr::string str2 {"abcdefghijklmnop"};
  }catch(std::bad_alloc e)
  {
    std::cerr << "bad_alloc is thrown string" << std::endl;
  }
  return 0;

}

Output:

bad_alloc is thrown vector
abcdefghi Length:9
bad_alloc is thrown string

online compiler:
https://godbolt.org/z/147ceMc7n

Edit1: Thanks for the info about SSO; now I understand the behavior of the program. But is there any way to avoid the SSO completely?


问:
When i put NavBar in my react 18 app appd didnt work
When I putting NavBar cope pasted from react-bootstrap site me app crashes with this in browser console
My app.js

```<code>import AppRouter from "./components/AppRouter";
import Container from 'react-bootstrap/Container';
import Nav from 'react-bootstrap/Nav';
import Navbar from 'react-bootstrap/Navbar';
import { NavItem } from "react-bootstrap";

function App() {
  return (
    <><Navbar inverse fluid>

      <Navbar.Header>
        <Navbar.Brand>
          <a href="#">Brand</a>
        </Navbar.Brand>
        <Navbar.Toggle />
      </Navbar.Header>

      <Navbar.Collapse>
        <Nav pullRight>
          <NavItem eventKey={1} href="#">Hello</NavItem>
          <NavItem eventKey={2} href="#">World</NavItem>
        </Nav>
      </Navbar.Collapse>

    </Navbar>
      <div>
        <>
          <AppRouter />
        </>
      </div></>
  );
}

export default App;
</code>```

what i get in console enter image description here

i tryed to serch about this problem in the inertetn but seem onley i have it

Body:
When I putting NavBar cope pasted from react-bootstrap site me app crashes with this in browser console
My app.js

import AppRouter from "./components/AppRouter";
import Container from 'react-bootstrap/Container';
import Nav from 'react-bootstrap/Nav';
import Navbar from 'react-bootstrap/Navbar';
import { NavItem } from "react-bootstrap";

function App() {
  return (
    <><Navbar inverse fluid>

      <Navbar.Header>
        <Navbar.Brand>
          Brand
        </Navbar.Brand>
        <Navbar.Toggle />
      </Navbar.Header>

      <Navbar.Collapse>

          <NavItem eventKey={1} href="#">Hello</NavItem>
          <NavItem eventKey={2} href="#">World</NavItem>

      </Navbar.Collapse>

    </Navbar>

        <>
          <AppRouter />
        </>

</>
  );
}

export default App;

what i get in console enter image description here

i tryed to serch about this problem in the inertetn but seem onley i have it


问:
Implications of keycloak database migration from H2 DB to Postgresql
I have an assignment to upgrade Keycloak database from embedded H2 DB to PostgreSQL.

Can anyone suggest following the steps or procedure?


问:
when will `hdfs dfs -appendToFile - $remote_file` flush buffer?
If I use hdfs dfs -appendToFile - hdfs://nn.example.com/hadoop/hadoopfile to open a stdin. When will the local buffer flush to remote?

Is it depend on buffer size or time elapsed?

Thanks!


问:
Using a JS bundler with a dummy entry point just for bundling purposes
I have a legacy Java app using JS inside JSPs. We statically import JS dependencies from filesystem into our JSP files, some of them are old JS dependencies, some of them are newer and use the import/export JS feature.

For the module-based dependencies I'd like to bundle them. Most if not all bundlers I am familiar with, like webpack/esbuild uses an entry point to analyze the usage of dependencies and then bundles all dependencies and all app code used from entry-point onwards and puts them all in one big file

My JSP page spit JS code like so

```<code><script type="module">
   // do some stuff...
   import { RFB } from 'rfb.js' // dozen of js files
                                // referenced, that is why
                                // i want to bundle them
                                // into just one js file...
   // do some stuff with RFB
</script>
</code>```

Then in the a dummy entrypoint I'd like to do that same import in a separate esbuild project for the purpose of bundling the module in one js file.

The idea is to use a dummy entry point that imports the elements I know I use in my JSP application and use that project (webpack/esbuild) for the purpose of using its bundling functionality. However, the bundle usually has this format

```<code>1. (() => {
2. // - Dependencies 1, 2, N goes here
3. // - import/export statements removed.
4. //
5. // - entry-point code
6. // - app code
7. })();
</code>```

Of course if I import this file into my JSP file I can't access the dependencies. I was thinking of doing one of these 2 things:

I could add in the entry-point something like: window.ClassIAmInterested = ClassIAmInterested then that class will be available in the global scope of my JSP page.

I could remove the lines 1 and 7 of the bundle and then everything would be available in the global scope.

And although either of the 2 options might work I don't fully understand the implications of doing it. I know I am trying to use the bundlers in a way they are not designed, since I explicitly want to use the entry point as a dummy code that will just import whatever I know I use in my JSP pages. So I need clarity regarding if what I am trying to do is ok or if there is a better way of doing it.

Body:
I have a legacy Java app using JS inside JSPs. We statically import JS dependencies from filesystem into our JSP files, some of them are old JS dependencies, some of them are newer and use the import/export JS feature.

For the module-based dependencies I'd like to bundle them. Most if not all bundlers I am familiar with, like webpack/esbuild uses an entry point to analyze the usage of dependencies and then bundles all dependencies and all app code used from entry-point onwards and puts them all in one big file

My JSP page spit JS code like so

Then in the a dummy entrypoint I'd like to do that same import in a separate esbuild project for the purpose of bundling the module in one js file.

The idea is to use a dummy entry point that imports the elements I know I use in my JSP application and use that project (webpack/esbuild) for the purpose of using its bundling functionality. However, the bundle usually has this format

1. (() => {
2. // - Dependencies 1, 2, N goes here
3. // - import/export statements removed.
4. //
5. // - entry-point code
6. // - app code
7. })();

Of course if I import this file into my JSP file I can't access the dependencies. I was thinking of doing one of these 2 things:

I could add in the entry-point something like: window.ClassIAmInterested = ClassIAmInterested then that class will be available in the global scope of my JSP page.

I could remove the lines 1 and 7 of the bundle and then everything would be available in the global scope.

And although either of the 2 options might work I don't fully understand the implications of doing it. I know I am trying to use the bundlers in a way they are not designed, since I explicitly want to use the entry point as a dummy code that will just import whatever I know I use in my JSP pages. So I need clarity regarding if what I am trying to do is ok or if there is a better way of doing it.


问:
Dataframe merging and "unmerge column" indentification
I have this problem, where there are two pandas dataframes which both has inaccurate value

```<code>df1 = pd.DataFrame({'F_Name': ['Alice', 'Bob', 'Charlie', 'Dave'], 'L_Name': ['Smith', 'Sharma', 'Puth', 'Bautista'], 'Age':[15, 24, 32, 40]})
df2 = pd.DataFrame({'F_Name': ['Charlie', 'David', 'Eve', 'Alice'], 'L_Name': ['Puth', 'Bautista', 'Angeline', 'Wonderland'], 'Age':[32,19,21,16]})
</code>```

How can I do an outer merge for both of the dataframe and identify the value of that did not merged with each other

I have try using normal outer join

```<code>df_merge = pd.merge(df1, df2, how='outer' , on =['F_Name', 'L_Name', 'Age']
</code>```

but it will only combine the data frame into single dataframe

The dataframe that I am expecting after merging should be something like this:

enter image description here

Any Idea how to achieve this? Thanks

Body:
I have this problem, where there are two pandas dataframes which both has inaccurate value

df1 = pd.DataFrame({'F_Name': ['Alice', 'Bob', 'Charlie', 'Dave'], 'L_Name': ['Smith', 'Sharma', 'Puth', 'Bautista'], 'Age':[15, 24, 32, 40]})
df2 = pd.DataFrame({'F_Name': ['Charlie', 'David', 'Eve', 'Alice'], 'L_Name': ['Puth', 'Bautista', 'Angeline', 'Wonderland'], 'Age':[32,19,21,16]})

How can I do an outer merge for both of the dataframe and identify the value of that did not merged with each other

I have try using normal outer join

df_merge = pd.merge(df1, df2, how='outer' , on =['F_Name', 'L_Name', 'Age']

but it will only combine the data frame into single dataframe

The dataframe that I am expecting after merging should be something like this:

enter image description here

Any Idea how to achieve this? Thanks


问:
Problems with navigating to component and call event handler at the same time (SOLVED)
I'm having problems with a form in a React component. When submitting the form with the submit button, I'd like to navigate to another component (by calling the onStepChange function inside the onClick event handler). At the same time I'd like the onSubmitAnswer event handler to be called (to check if the answer submitted is correct or wrong).
This is the whole component:

import React, { useState } from 'react';

export const Answering = ({ onStepChange }) => {
  const [userAnswer, setUserAnswer] = useState('');

  const onSubmitAnswer = (event) => {
    event.preventDefault();
    // * Correct answer, at the moment hardcoded
    const correctAnswer = 'Vienna, Austria';
    if (userAnswer === correctAnswer) {
      console.log('Correct answer')
    } else {
      console.log('Wrong answer')
    }
  };

  return (
    <form onSubmit={onSubmitAnswer}>

We are headed to:

          <select
            className="select"
            id="selectInput"
            value={userAnswer}
            onChange={(event) => {
              setUserAnswer(event.target.value)
            }}>
            <option value="">The city is:</option>
            <option value="Vienna, Austria">Vienna, Austria</option>
            <option value="Helsinki, Finland">Helsinki, Finland</option>
            <option value="Oslo, Norway">Oslo, Norway</option>
          </select>

        <button
          className="button"
          onClick={() => {
            onStepChange();
          }}>
          Submit
        </button>

    </form>
  );
};```
</div>
</div>

When I do like this I get the warning "Form submission canceled because the form is not connected" in console and can't see the console logs, but I do navigate to the other component. However, if I change the button to this instead and don't call the onStepChange function:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code><button type="submit" className="button">
          Submit
</button></code>```

...I get the console logs, but of course then I don't navigate to the other component.

What can I do to both navigate to another component and call the onSubmitAnswer event handler? Thankful for any tips!

EDIT: Solved it by calling the onStepChange function inside the onSubmitAnswer handler instead of calling it with onClick.

Body:
I'm having problems with a form in a React component. When submitting the form with the submit button, I'd like to navigate to another component (by calling the onStepChange function inside the onClick event handler). At the same time I'd like the onSubmitAnswer event handler to be called (to check if the answer submitted is correct or wrong).
This is the whole component:

import React, { useState } from 'react';

export const Answering = ({ onStepChange }) => {
  const [userAnswer, setUserAnswer] = useState('');

  const onSubmitAnswer = (event) => {
    event.preventDefault();
    // * Correct answer, at the moment hardcoded
    const correctAnswer = 'Vienna, Austria';
    if (userAnswer === correctAnswer) {
      console.log('Correct answer')
    } else {
      console.log('Wrong answer')
    }
  };

  return (
    <form onSubmit={onSubmitAnswer}>

We are headed to:

          <select
            className="select"
            id="selectInput"
            value={userAnswer}
            onChange={(event) => {
              setUserAnswer(event.target.value)
            }}>
            <option value="">The city is:</option>
            <option value="Vienna, Austria">Vienna, Austria</option>
            <option value="Helsinki, Finland">Helsinki, Finland</option>
            <option value="Oslo, Norway">Oslo, Norway</option>
          </select>

        <button
          className="button"
          onClick={() => {
            onStepChange();
          }}>
          Submit
        </button>

    </form>
  );
};

When I do like this I get the warning "Form submission canceled because the form is not connected" in console and can't see the console logs, but I do navigate to the other component. However, if I change the button to this instead and don't call the onStepChange function:

<button type="submit" className="button">
          Submit
</button>

...I get the console logs, but of course then I don't navigate to the other component.

What can I do to both navigate to another component and call the onSubmitAnswer event handler? Thankful for any tips!

EDIT: Solved it by calling the onStepChange function inside the onSubmitAnswer handler instead of calling it with onClick.


问:
Read all variables only defined in specific cmake file
I'm cross-compiling Android using ExternalProject, but when I pass CMAKE_TOOLCHAIN_FILE as CMAKE_ARGS, the linker fails. However, when I define cross-compile variables manually (e.g., -DCMAKE_SYSTEM_NAME="Android" ...) it links well.

It is unsafe to define variables manually, so I want to pass the values that are ONLY defined in Android toolchain file provided with android-sdk , but I don't know what variables are defined.

I want something like below code:

```<code># Toolchain file is defined in CMAKE_TOOLCHAIN_FILE when using Android-NDK
get_file_property(result FILE "${CMAKE_TOOLCHAIN_FILE}" VARIABLES)

# parse ${result} to ${parsed_result} (e.g., -DVAR=VAR...)

ExternalProject_Add(
  ...

  CMAKE_ARGS ${parsed_result}
  ...
)
</code>```

Body:
I'm cross-compiling Android using ExternalProject, but when I pass CMAKE_TOOLCHAIN_FILE as CMAKE_ARGS, the linker fails. However, when I define cross-compile variables manually (e.g., -DCMAKE_SYSTEM_NAME="Android" ...) it links well.

It is unsafe to define variables manually, so I want to pass the values that are ONLY defined in Android toolchain file provided with android-sdk , but I don't know what variables are defined.

I want something like below code:

# Toolchain file is defined in CMAKE_TOOLCHAIN_FILE when using Android-NDK
get_file_property(result FILE "${CMAKE_TOOLCHAIN_FILE}" VARIABLES)

# parse ${result} to ${parsed_result} (e.g., -DVAR=VAR...)

ExternalProject_Add(
  ...

  CMAKE_ARGS ${parsed_result}
  ...
)


问:
Update value for all client on specific page on server variable change Express
I want to update an html element when a server value change to all users on a specific page, because i want to make an events page and I want to automatically update when a new event is posted.

Nothing for the moment cause I got no idea on how to do this kind of stuff


问:
Can websocket be used in https
My websocket connection is working completely fine in http.But the message is not showing in https.Can anyone give me a better solution

.I am getting like this.

Title: Can websocket be used in https


问:
pulsar-admin sink localrun failure: ClientCnx Failed to authenticate the client. (tls auth enabled)
command:

```<code>bin/pulsar-admin sinks localrun -a connectors/pulsar-io-mongo-2.10.2.nar --tenant public --namespace default --inputs up-20wt --name mongo-sink --sink-config-file work/config.json --parallelism 1
</code>```

log:

```<code>2023-01-06T14:56:27,441+0800 [pulsar-client-io-1-2] WARN  org.apache.pulsar.client.impl.ConnectionPool - [[id: 0xb0292161, L:/127.0.0.1:57408 - R:localhost/127.0.0.1:6650]] Connection handshake failed: org.apache.pulsar.client.api.PulsarClientException$AuthenticationException: Unable to authenticate

ERROR org.apache.pulsar.client.impl.ClientCnx - [id: 0xb0292161, L:/127.0.0.1:57408 ! R:localhost/127.0.0.1:6650] Failed to authenticate the client
INFO  org.apache.pulsar.client.impl.PulsarClientImpl - Client closing. URL: pulsar://localhost:6650
</code>```

The deployment uses tls mutual auth: https://pulsar.apache.org/docs/2.10.x/security-tls-authentication

Both client.conf and broker.conf have enabled tls and related key files are setup correspondently.

And most importantly, my pulsar client(c++) can connect to the pulsar+ssl broker and pub message successfully.

so:
why the mongo-io-sink created with pulsar-admin connect to the 6650 broker binary data port instead of the ssl 6651 port?

how to fix this sink creating issue?

Body:
command:

bin/pulsar-admin sinks localrun -a connectors/pulsar-io-mongo-2.10.2.nar --tenant public --namespace default --inputs up-20wt --name mongo-sink --sink-config-file work/config.json --parallelism 1

log:

2023-01-06T14:56:27,441+0800 [pulsar-client-io-1-2] WARN  org.apache.pulsar.client.impl.ConnectionPool - [[id: 0xb0292161, L:/127.0.0.1:57408 - R:localhost/127.0.0.1:6650]] Connection handshake failed: org.apache.pulsar.client.api.PulsarClientException$AuthenticationException: Unable to authenticate

ERROR org.apache.pulsar.client.impl.ClientCnx - [id: 0xb0292161, L:/127.0.0.1:57408 ! R:localhost/127.0.0.1:6650] Failed to authenticate the client
INFO  org.apache.pulsar.client.impl.PulsarClientImpl - Client closing. URL: pulsar://localhost:6650

The deployment uses tls mutual auth: https://pulsar.apache.org/docs/2.10.x/security-tls-authentication

Both client.conf and broker.conf have enabled tls and related key files are setup correspondently.

And most importantly, my pulsar client(c++) can connect to the pulsar+ssl broker and pub message successfully.

so:
why the mongo-io-sink created with pulsar-admin connect to the 6650 broker binary data port instead of the ssl 6651 port?

how to fix this sink creating issue?


问:
Content is overflowing
I have created a home page when I try to open it in mobile view the content is overflowing what might be the reason

I think I have done mistake in padding. Can anyone tell me how to solve this problem.

Title: Content is overflowing


问:
Pyqt Qtimer.singleshot in QEventloop
```<code>@QtCore.pyqtSlot()
    def startVideo(self):
        global image

        run_video = True
        while run_video:
            ret, image = self.camera.read()
            color_swapped_image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)

            qt_image1 = QtGui.QImage(color_swapped_image.data,
                                    self.width,
                                    self.height,
                                    color_swapped_image.strides[0],
                                    QtGui.QImage.Format_RGB888)
            self.VideoSignal1.emit(qt_image1)

            if self.flag:
                img_gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
                img_canny = cv2.Canny(img_gray, 50, 100)

                qt_image2 = QtGui.QImage(img_canny.data,
                                         self.width,
                                         self.height,
                                         img_canny.strides[0],
                                         QtGui.QImage.Format_Grayscale8)

                self.VideoSignal2.emit(qt_image2)

            loop = QtCore.QEventLoop()
            QtCore.QTimer.singleShot(25, loop.quit) #25 ms
            loop.exec_()
</code>```

How this can be work about loop?

When the loop in while: do the singleshot 25ms until loop.quit,

Then what is the loop.exec??

I can't understand loop and singleshot in this code.

Title: Pyqt Qtimer.singleshot in QEventloop

Body:
@QtCore.pyqtSlot()
    def startVideo(self):
        global image

        run_video = True
        while run_video:
            ret, image = self.camera.read()
            color_swapped_image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)

            qt_image1 = QtGui.QImage(color_swapped_image.data,
                                    self.width,
                                    self.height,
                                    color_swapped_image.strides[0],
                                    QtGui.QImage.Format_RGB888)
            self.VideoSignal1.emit(qt_image1)

            if self.flag:
                img_gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
                img_canny = cv2.Canny(img_gray, 50, 100)

                qt_image2 = QtGui.QImage(img_canny.data,
                                         self.width,
                                         self.height,
                                         img_canny.strides[0],
                                         QtGui.QImage.Format_Grayscale8)

                self.VideoSignal2.emit(qt_image2)

            loop = QtCore.QEventLoop()
            QtCore.QTimer.singleShot(25, loop.quit) #25 ms
            loop.exec_()

How this can be work about loop?

When the loop in while: do the singleshot 25ms until loop.quit,

Then what is the loop.exec??

I can't understand loop and singleshot in this code.


问:
Rotating a Axe Model in Roblox
So, For Context im trying to emulate kind of like throwing an axe, when you throw an axe it spins and spins and spins vertically.However, I got the spinning part right but the axis that is at, is not right the axe it should be facing vertically not facing you, i will post a gyazo link just so u can see how it spins right now. https://gyazo.com/99eaa8c1b5b3ce22205148509e115b14

Ive tried a couple things, ive tweend it, i thought that would work, as tweening it i can do it infinitley, But the result was it being still. I also tried pivoting it, But because of my courtine. Sometimes it wouldnt even go through
Heres The roblox code

local function ZodiacMove(plr,Mouse)
    local TestingCourotine = coroutine.create(function(Handle)
        while true do RunService.Stepped:Wait()
            print(Handle)

            Handle.CFrame = Handle.CFrame * CFrame.Angles(0,0,math.rad(10))
            if Handle.Parent == nil then break end
        end
        print('the axe has vanished :sob:')
    end)
    local ZodiacProjectile = game:GetService("ReplicatedStorage").Axe:Clone()
    local Handle = ZodiacProjectile:FindFirstChild("Blade")["Blade Tip"]
    print(Handle)
    local ZodiacProjectilePivot = ZodiacProjectile:GetPivot()
    ZodiacProjectile:PivotTo(ZodiacProjectilePivot * CFrame.new(math.rad(10),0,0))
    coroutine.resume(TestingCourotine,Handle)
    ---TweenInfoGoals.CFrame = Handle.CFrame * CFrame.Angles(0,0,math.rad(360))
    --local ZodiacProjectileTween = TweenService:Create(Handle, tweenInfo,TweenInfoGoals)
    --ZodiacProjectileTween:Play()
    local OverParams = OverlapParams.new()
    OverParams.FilterType = Enum.RaycastFilterType.Blacklist
    OverParams.FilterDescendantsInstances = {workspace.Baseplate, plr.Character, plr.Character:GetChildren()}
    local HumanoidRootPart = plr.Character:WaitForChild("HumanoidRootPart")
    local BV = Instance.new("BodyVelocity")
    BV.Parent =  Handle
    ZodiacProjectile.Parent = HumanoidRootPart
    BV.Velocity = HumanoidRootPart.CFrame.LookVector * 100
    BV.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
    ZodiacProjectile:PivotTo( HumanoidRootPart.CFrame * CFrame.new(0, 0, -1))
    Debris:AddItem(ZodiacProjectile,2)
end```
</code>```

Title: Rotating a Axe Model in Roblox


问:
How to make form state invalid when using setError in react-hook form
I am using react-hook form and my field type is a custom component which returns me an error. Now I cannot write the rules in validate function as I am getting the error in a callback from my component. I have used setError method to explicitly set the error. However my form state is still valid and I cannot prevent form submission. I want to disable submit button if an error is returned from my component.

I have read in the react-hook form docs that the isValid property of the form is only derived by the validation result from your input registration rules or schema result. I want to set the isValid property to false when I receive an error in my callback. Any ideas on this. Thanks.

Here is my code:

```<code> const setLogoError = () => {
  defaultValues.setError('logo', { type: 'custom', message: 'custom message' });
 }
</code>```

Body:
I am using react-hook form and my field type is a custom component which returns me an error. Now I cannot write the rules in validate function as I am getting the error in a callback from my component. I have used setError method to explicitly set the error. However my form state is still valid and I cannot prevent form submission. I want to disable submit button if an error is returned from my component.

I have read in the react-hook form docs that the isValid property of the form is only derived by the validation result from your input registration rules or schema result. I want to set the isValid property to false when I receive an error in my callback. Any ideas on this. Thanks.

Here is my code:

 const setLogoError = () => {
  defaultValues.setError('logo', { type: 'custom', message: 'custom message' });
 }


问:
To change the folder path in VBA code to execute
I am working on a code which Moves the files after matching the file name into the folders accordingly "moveMatchedFilesInAppropriateFolders"

In order to run this code it is required that the Excel sheet should be saved in the same folder where the files and folders are available e.g. Folders and Files are saved in Drive E:\Archive. Therefore it is also important that the excel sheet should also be saved in the same folder (E:\Archive.

However i do not want to save the excel sheet in the same folder where the files and folders are placed and i wanted to save the excel sheet in some other Drive (e.g. Drive G). Is there any possibility where if i saved this excel sheet in other Drive and just give the path to it the code should run and not give error.

```<code>Sub moveMatchedFilesInAppropriateFolders()
    Dim sh As Worksheet, lastR As Long, filesPath As String, fileName As String, foldersRoot As String, FolderPath As String
    Dim arr, boolNotFound As Boolean, i As Long

    Set sh = ActiveSheet
    lastR = sh.Range("A" & sh.Rows.Count).End(xlUp).Row

    arr = sh.Range("A2:A" & lastR).Value2
    foldersRoot = ThisWorkbook.Path & "\" 'use here the root folder for folders
    filesPath = "G:\!Archive Management\2023\"   'use here the path where the files can be found
    Set FSO = CreateObject("Scripting.FileSystemObject") 'to check if file exists

    For i = 1 To UBound(arr)
        boolNotFound = False
        If Dir(foldersRoot & arr(i, 1), vbDirectory) <> "" Then
            FolderPath = foldersRoot & arr(i, 1) & "\"
        Else
            MsgBox arr(i, 1) & " folder could not be found!" & vbCrLf & _
                           "Please, note and correct it after copying the matching ones and run the code again!"
            boolNotFound = True
        End If
        If Not boolNotFound Then
                fileName = Dir(filesPath & arr(i, 1) & "*.*")

                Do While fileName <> ""
                If Not FSO.FileExists(FolderPath & fileName) Then 'move/copy only if it does not exist in destination fld
                    'uncomment the way you need (moving or copying):
                    Name filesPath & fileName As FolderPath & fileName    'the file is moved
                    'FileCopy filesPath & fileName, folderPath & fileName   'the file is copied
                End If
                fileName = Dir
            Loop
         End If
    Next i
End Sub
</code>```

Body:
I am working on a code which Moves the files after matching the file name into the folders accordingly "moveMatchedFilesInAppropriateFolders"

In order to run this code it is required that the Excel sheet should be saved in the same folder where the files and folders are available e.g. Folders and Files are saved in Drive E:\Archive. Therefore it is also important that the excel sheet should also be saved in the same folder (E:\Archive.

However i do not want to save the excel sheet in the same folder where the files and folders are placed and i wanted to save the excel sheet in some other Drive (e.g. Drive G). Is there any possibility where if i saved this excel sheet in other Drive and just give the path to it the code should run and not give error.

Sub moveMatchedFilesInAppropriateFolders()
    Dim sh As Worksheet, lastR As Long, filesPath As String, fileName As String, foldersRoot As String, FolderPath As String
    Dim arr, boolNotFound As Boolean, i As Long

    Set sh = ActiveSheet
    lastR = sh.Range("A" & sh.Rows.Count).End(xlUp).Row

    arr = sh.Range("A2:A" & lastR).Value2
    foldersRoot = ThisWorkbook.Path & "\" 'use here the root folder for folders
    filesPath = "G:\!Archive Management\2023\"   'use here the path where the files can be found
    Set FSO = CreateObject("Scripting.FileSystemObject") 'to check if file exists

    For i = 1 To UBound(arr)
        boolNotFound = False
        If Dir(foldersRoot & arr(i, 1), vbDirectory) <> "" Then
            FolderPath = foldersRoot & arr(i, 1) & "\"
        Else
            MsgBox arr(i, 1) & " folder could not be found!" & vbCrLf & _
                           "Please, note and correct it after copying the matching ones and run the code again!"
            boolNotFound = True
        End If
        If Not boolNotFound Then
                fileName = Dir(filesPath & arr(i, 1) & "*.*")

                Do While fileName <> ""
                If Not FSO.FileExists(FolderPath & fileName) Then 'move/copy only if it does not exist in destination fld
                    'uncomment the way you need (moving or copying):
                    Name filesPath & fileName As FolderPath & fileName    'the file is moved
                    'FileCopy filesPath & fileName, folderPath & fileName   'the file is copied
                End If
                fileName = Dir
            Loop
         End If
    Next i
End Sub


问:
unable to implement Formatter2 in xtext lsp
configured formatter in mwe2

```<code>formatter = {
                generateStub = true
                generateXtendStub = true
            }
</code>```

binding it in AbstractTableRuleDslRuntimeModule also

```<code>public Class<? extends IFormatter2> bindIFormatter2() {
        return TableRuleDslFormatter.class;
    }
</code>```

trying to call formatter method using serializer functionality

```<code>serializer.serialize(ruleModel,SaveOptions.newBuilder().format().getOptions());
</code>```

after all config and implementation serializer is using onewhitespaceformatter instead of xtext formatter
check this image

How can i switch default formatter to my xtext formatter

Body:
configured formatter in mwe2

formatter = {
                generateStub = true
                generateXtendStub = true
            }

binding it in AbstractTableRuleDslRuntimeModule also

public Class<? extends IFormatter2> bindIFormatter2() {
        return TableRuleDslFormatter.class;
    }

trying to call formatter method using serializer functionality

serializer.serialize(ruleModel,SaveOptions.newBuilder().format().getOptions());

after all config and implementation serializer is using onewhitespaceformatter instead of xtext formatter
check this image

How can i switch default formatter to my xtext formatter


问:
deploy Masonite framework on windows IIS
I have struggled to deploy Python Masonite build web app on windows IIS. Does anyone here has done that before. Do you might to share the guides online for me to reference?

I tried to follow Djagon and Flask framework deployment approach but it could not work.


问:
How to send multiple fields in the "word_similarity" PostgreSQL function
[See image here]

I have two fields in the table respectively name and note. Now I want to search words using the name and note both simultaneously.  Here I have called the CriteriaBuilder function using the "word_similarity" key (I guess this 'word_similarity' is one internal function that works). Here you can see I passed the name field and got the result successfully.
But I want to search both fields simultaneously.
So how do I pass both fields (name and note) and get a search result? I am a new learner.
I would greatly appreciate all your suggestions.

I have tried to send multiple words like
cb.function("word_similarity", Double::class.java, root.get("name"), root.get("note"), cb.literal(s))

But not working.


问:
I want to integrate the avatar feature just like the snap chat with fully customizable options like shoes etc I have to do it in flutter Application?
I want to integrate the 3d avatar just like the snap chat in my flutter mobile application any method to do so ?

i have seen and tried readyplayer.me to integrate but it dont have feature to change the shoes and tshirts separately.
enter image description here


问:
Proxy error: Could not proxy request /api/chat from localhost:3000 to http://127.0.0.1:5000
I am facing issues in proxying request from localhost:3000 to http://127.0.0.1:5000. I have tried numerous amount of ways in typing the proxy as http://localhost:5000 or http://127.0.0.1:5000/ but the same error is being repeated.

This is the above screenshot where Uncaught (in promise) error is occurring.
Please help me in resolving this issue as to what should be done in getting the proper response while proxying. I just want to see the data in the console but Uncaught error is appearing due to failure in proxy request.

Thanks
Ankan

I want to see the output of a data in the console. But instead, I am seeing Uncaught error which is appearing due to proxy failure.


问:
Chartjs 4 migration for angular
Hi I'm using chartjs v3 with a lot of plugins like label, zoom,...

I import it like this

```<code> import {
  BarController,
  Chart,
  LineController,
  registerables,
  ScatterController,
} from 'chart.js';
Chart.register(...registerables);
</code>```

or

```<code>import Chart from 'chart.js/auto';
</code>```

But now I want to upgrade to v4 using this guide: https://www.chartjs.org/docs/latest/migration/v4-migration.html

After installing and ng serve, I got some errors like below, so I want to ask which is the correct way to import the new chartjs 4 and fix these issue

```<code>Type '"sankey"' is not assignable to type 'keyof ChartTypeRegistry'.

196         type: 'sankey',
</code>```
```<code> Property 'bar' does not exist on type 'ChartTypeRegistry'.

46     barWithLine: ChartTypeRegistry['bar'];
</code>```
```<code> interface Chart<TType extends keyof ChartTypeRegistry = keyof ChartTypeRegistry, TData = DistributiveArray<ChartTypeRegistry[TType]['defaultDataPoint']>, TLabel = unknown> {
</code>```
```<code>node_modules/chartjs-plugin-zoom/types/index.d.ts:21:13 - error TS2428: All declarations of 'Chart' must have identical type parameters.
</code>```

I tried to find some guide on google but not found, may be this chartjs 4 is new and not a lot of people having issue with it, I want a complete guide to migrate from v3 to v4 of it

Title: Chartjs 4 migration for angular

Body:
Hi I'm using chartjs v3 with a lot of plugins like label, zoom,...

I import it like this

 import {
  BarController,
  Chart,
  LineController,
  registerables,
  ScatterController,
} from 'chart.js';
Chart.register(...registerables);

or

import Chart from 'chart.js/auto';

But now I want to upgrade to v4 using this guide: https://www.chartjs.org/docs/latest/migration/v4-migration.html

After installing and ng serve, I got some errors like below, so I want to ask which is the correct way to import the new chartjs 4 and fix these issue

Type '"sankey"' is not assignable to type 'keyof ChartTypeRegistry'.

196         type: 'sankey',

 Property 'bar' does not exist on type 'ChartTypeRegistry'.

46     barWithLine: ChartTypeRegistry['bar'];

 interface Chart<TType extends keyof ChartTypeRegistry = keyof ChartTypeRegistry, TData = DistributiveArray<ChartTypeRegistry[TType]['defaultDataPoint']>, TLabel = unknown> {

node_modules/chartjs-plugin-zoom/types/index.d.ts:21:13 - error TS2428: All declarations of 'Chart' must have identical type parameters.

I tried to find some guide on google but not found, may be this chartjs 4 is new and not a lot of people having issue with it, I want a complete guide to migrate from v3 to v4 of it


问:
Why is android giving an error app is crashing frequently when I haven't experienced any crashes?
I recently deployed my react native app and android is giving me the error "Keep your phone running smoothly. App is crashing frequently. Put it in deep sleep to keep your phone running smoothly". Because of this error my app has stopped showing all fcm notifications and this error only shows up when I am trying to send notifications to the app. Is there any way to debug this error? I have not been experiencing any significant crashes. Any help would be appreciated. Thanks in advance!</p>


问:
Corda Transaction - unable to save linked states
I would like to ask if it is possible to save (to be produced by transaction) more states that are linked to each other.

Let's assume following case (it is simplified to be more readable):

States:

```<code>ParentState {
...
}

ChildState {
  LinkedPointer<ParentState> parent;
}
</code>```

Flow:

```<code>parent = new ParentState(...)
child = new ChildState(...)
child.setParent(new LinearPointer<>(parent.getLinearId(), RestrictedSecurity.class))

TransactionBuilder txBuilder = new TransactionBuilder(notary)
             .addCommand(new ParentContract.Commands.Create(), Arrays.asList(getOurIdentity().getOwningKey()));

txBuilder.addOutputState(parent);
txBuilder.addOutputState(child);

txBuilder.verify(getServiceHub());

SignedTransaction signedTransaction = getServiceHub().signInitialTransaction(transactionBuilder);

List<FlowSession> allSessions = new ArrayList<>();
for (AbstractParty party : participants) {
  if (!party.equals(getOurIdentity())) {
    allSessions.add(initiateFlow(party));
  }
}

subFlow(new FinalityFlow(signedTransaction, allSessions, StatesToRecord.ALL_VISIBLE));
</code>```

This case allways throws
The LinearState with ID 44afa7dd-10a9-408d-a44f-03a7a3d9dbb8 is unknown to this node or it has been exited from the ledger.
But both states are in same transaction so it should be known (exception is thrown on "master" node that initialized flow). May I ask if someone solved this problem or it is necessary to create states without links?

Thank you in advance, Jan.

I tried save states without links or linked but in separate transactions but it is not intended usecase.

Body:
I would like to ask if it is possible to save (to be produced by transaction) more states that are linked to each other.

Let's assume following case (it is simplified to be more readable):

States:

ParentState {
...
}

ChildState {
  LinkedPointer<ParentState> parent;
}

Flow:

parent = new ParentState(...)
child = new ChildState(...)
child.setParent(new LinearPointer<>(parent.getLinearId(), RestrictedSecurity.class))

TransactionBuilder txBuilder = new TransactionBuilder(notary)
             .addCommand(new ParentContract.Commands.Create(), Arrays.asList(getOurIdentity().getOwningKey()));

txBuilder.addOutputState(parent);
txBuilder.addOutputState(child);

txBuilder.verify(getServiceHub());

SignedTransaction signedTransaction = getServiceHub().signInitialTransaction(transactionBuilder);

List<FlowSession> allSessions = new ArrayList<>();
for (AbstractParty party : participants) {
  if (!party.equals(getOurIdentity())) {
    allSessions.add(initiateFlow(party));
  }
}

subFlow(new FinalityFlow(signedTransaction, allSessions, StatesToRecord.ALL_VISIBLE));

This case allways throws
The LinearState with ID 44afa7dd-10a9-408d-a44f-03a7a3d9dbb8 is unknown to this node or it has been exited from the ledger.
But both states are in same transaction so it should be known (exception is thrown on "master" node that initialized flow). May I ask if someone solved this problem or it is necessary to create states without links?

Thank you in advance, Jan.

I tried save states without links or linked but in separate transactions but it is not intended usecase.


问:
not able to compile the gradle project
build.gradle:

I am trying to compile this gradle project in order to get a pom.xml out of it.
But not able to generate one.

here is the link for build.gradle:
https://github.com/satyamsah/opensearch-security-mirror/blob/main/build.gradle

error:

```<code>23:09 $ gradle build -x test

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/kusatyam/workspace/opensearch-security-mirror/build.gradle' line: 171

* What went wrong:
A problem occurred evaluating root project 'opensearch-security'.
> No signature of method: build_5wndr8gj5a0mvad7gm9rg9qz4.publishing() is applicable for argument types: (build_5wndr8gj5a0mvad7gm9rg9qz4$_run_closure9) values: [build_5wndr8gj5a0mvad7gm9rg9qz4$_run_closure9@67677da5]

</code>```

Can somone help me with what could be issue?

Title: not able to compile the gradle project

Body:
build.gradle:

I am trying to compile this gradle project in order to get a pom.xml out of it.
But not able to generate one.

here is the link for build.gradle:
https://github.com/satyamsah/opensearch-security-mirror/blob/main/build.gradle

error:

23:09 $ gradle build -x test

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/kusatyam/workspace/opensearch-security-mirror/build.gradle' line: 171

* What went wrong:
A problem occurred evaluating root project 'opensearch-security'.
> No signature of method: build_5wndr8gj5a0mvad7gm9rg9qz4.publishing() is applicable for argument types: (build_5wndr8gj5a0mvad7gm9rg9qz4$_run_closure9) values: [build_5wndr8gj5a0mvad7gm9rg9qz4$_run_closure9@67677da5]

Can somone help me with what could be issue?


问:
RangeError [BitFieldInvalid]: Invalid bitfield flag or number: Guild

const Discord = require('discord.js');

const client = new Discord.Client({
  intents: ['Guild', 'GuildMembers', 'GuildMessages'],
});
```

How can I fix it?

RangeError [BitFieldInvalid]: Invalid bitfield flag or number: Guild.
at IntentsBitField.resolve (C:\Users\Yuri Adamo\Desktop\botDiscord\node_modules\discord.js\src\util\BitField.js:168:11)
at C:\Users\Yuri Adamo\Desktop\botDiscord\node_modules\discord.js\src\util\BitField.js:163:54
at Array.map ()
at IntentsBitField.resolve (C:\Users\Yuri Adamo\Desktop\botDiscord\node_modules\discord.js\src\util\BitField.js:163:40)
at new BitField (C:\Users\Yuri Adamo\Desktop\botDiscord\node_modules\discord.js\src\util\BitField.js:33:38)
at new IntentsBitField (C:\Users\Yuri Adamo\Desktop\botDiscord\node_modules\discord.js\src\util\IntentsBitField.js:9:1)
at Client._validateOptions (C:\Users\Yuri Adamo\Desktop\botDiscord\node_modules\discord.js\src\client\Client.js:491:25)
at new Client (C:\Users\Yuri Adamo\Desktop\botDiscord\node_modules\discord.js\src\client\Client.js:78:10)
at Object. (C:\Users\Yuri Adamo\Desktop\botDiscord\index.js:4:16)
at Module._compile (node:internal/modules/cjs/loader:1159:14) {   code: 'BitFieldInvalid' }

Body:
const Discord = require('discord.js');

const client = new Discord.Client({
  intents: ['Guild', 'GuildMembers', 'GuildMessages'],
});

How can I fix it?

RangeError [BitFieldInvalid]: Invalid bitfield flag or number: Guild.
at IntentsBitField.resolve (C:\Users\Yuri Adamo\Desktop\botDiscord\node_modules\discord.js\src\util\BitField.js:168:11)
at C:\Users\Yuri Adamo\Desktop\botDiscord\node_modules\discord.js\src\util\BitField.js:163:54
at Array.map ()
at IntentsBitField.resolve (C:\Users\Yuri Adamo\Desktop\botDiscord\node_modules\discord.js\src\util\BitField.js:163:40)
at new BitField (C:\Users\Yuri Adamo\Desktop\botDiscord\node_modules\discord.js\src\util\BitField.js:33:38)
at new IntentsBitField (C:\Users\Yuri Adamo\Desktop\botDiscord\node_modules\discord.js\src\util\IntentsBitField.js:9:1)
at Client._validateOptions (C:\Users\Yuri Adamo\Desktop\botDiscord\node_modules\discord.js\src\client\Client.js:491:25)
at new Client (C:\Users\Yuri Adamo\Desktop\botDiscord\node_modules\discord.js\src\client\Client.js:78:10)
at Object. (C:\Users\Yuri Adamo\Desktop\botDiscord\index.js:4:16)
at Module._compile (node:internal/modules/cjs/loader:1159:14) {   code: 'BitFieldInvalid' }


问:
How to get local git directory information using Octokit.js?
Is it possible to open local git folder with Octokit.js and get git information for it?

Thank you!


问:
HOw to call function inside function from jenkins shared library in jenkins
I have a  x.groovy and a y.groovy file in jenkins shared library under vars.
I need to use the output of a function in x.groovy as an input to a function y.groovy.

x.groovy looks somethins like this :

```<code>void testM(String msg) {
    int paddingLen = 100
    String bottomLine = '└'.padRight(paddingLen, '─') + '┘\n'
    String topLine = '┌'.padRight(paddingLen, '─') + '┐\n'

    String pM = topLine +
                     "|"+ msg.padRight(200) + "|\n" +
                     bottomLine

    printf(pM)
}
</code>```
```<code>def display(message) {
   loadColors()
   echo "${GREEN}[INFO] - $message ${NC}"
}
</code>```

In the jenkinsfile I need to use it as  display.testM("print something here").

How shall I do it.Please advice

Body:
I have a  x.groovy and a y.groovy file in jenkins shared library under vars.
I need to use the output of a function in x.groovy as an input to a function y.groovy.

x.groovy looks somethins like this :

void testM(String msg) {
    int paddingLen = 100
    String bottomLine = '└'.padRight(paddingLen, '─') + '┘\n'
    String topLine = '┌'.padRight(paddingLen, '─') + '┐\n'

    String pM = topLine +
                     "|"+ msg.padRight(200) + "|\n" +
                     bottomLine

    printf(pM)
}

def display(message) {
   loadColors()
   echo "${GREEN}[INFO] - $message ${NC}"
}

In the jenkinsfile I need to use it as  display.testM("print something here").

How shall I do it.Please advice


问:
How to query the time difference statistics (duration for each state) in the elasticsearch?
The example data in the elasticsearch as following:

```<code>{name: 'device1', state: true, 'time': '2022-02-19 12:00:00'}
{name: 'device1', state: true, 'time': '2022-02-19 13:00:00'}
{name: 'device1', state: false, 'time': '2022-02-19 16:00:00'}
{name: 'device1', state: true, 'time': '2022-02-19 17:00:00'}
{name: 'device1', state: false, 'time': '2022-02-19 18:00:00'}
{name: 'device1', state: true, 'time': '2022-02-19 21:00:00'}
</code>```

I would like to get the result as following:

```<code>true: { duration: 5, percent: 55% } (from 4 hours + 1 hours)
false: { duration: 4, percent: 45% } (from 1 hours + 3 hours)
</code>```

Is it possible using the aggregations in the elasticsearch to get the results? I found maybe that scripted_metric could solve this problem, but I cannot write out the whole script to solve it. Anyone can help me with it?

Body:
The example data in the elasticsearch as following:

{name: 'device1', state: true, 'time': '2022-02-19 12:00:00'}
{name: 'device1', state: true, 'time': '2022-02-19 13:00:00'}
{name: 'device1', state: false, 'time': '2022-02-19 16:00:00'}
{name: 'device1', state: true, 'time': '2022-02-19 17:00:00'}
{name: 'device1', state: false, 'time': '2022-02-19 18:00:00'}
{name: 'device1', state: true, 'time': '2022-02-19 21:00:00'}

I would like to get the result as following:

true: { duration: 5, percent: 55% } (from 4 hours + 1 hours)
false: { duration: 4, percent: 45% } (from 1 hours + 3 hours)

Is it possible using the aggregations in the elasticsearch to get the results? I found maybe that scripted_metric could solve this problem, but I cannot write out the whole script to solve it. Anyone can help me with it?


问:
I get the predicted token as ` े` , using transformers on wikitext. What am I doing wrong?
I was trying to solve this problem

We’re going to use the wikitext (link) dataset with the distilbert-base-cased (link) model checkpoint.

Start by loading the wikitext-2-raw-v1 version of that dataset, and take the 11th example (index 10) of the train split.
We’ll tokenize this using the appropriate tokenizer, and we’ll mask the sixth token (index 5) the sequence.

When using the distilbert-base-cased checkpoint to unmask that (sixth token, index 5) token, what is the most probable predicted token (please provide the decoded token, and not the ID)?

and I coded the solution as

```<code>import torch
import transformers
import nlp

# Load the Wikitext-2 dataset
dataset = nlp.load_dataset('wikitext', 'wikitext-2-raw-v1')

# Get the 11th example (index 10) of the train split
example = dataset['train'][10]

# Load the DistilBERT model and tokenizer
model = transformers.DistilBertModel.from_pretrained('distilbert-base-cased')
tokenizer = transformers.DistilBertTokenizer.from_pretrained('distilbert-base-cased')

# Tokenize the example
input_ids = tokenizer.encode(example['text'], return_tensors='pt')

# Mask the sixth token (index 5) in the sequence
masked_input_ids = input_ids.clone()
masked_input_ids[:, 5] = tokenizer.mask_token_id

# Use the model to predict the most probable token for the masked token
output = model(masked_input_ids)[0]
prediction_scores, prediction_indexes = output[:, 5, :].max(dim=-1)
# prediction_scores, prediction_indexes = output[:, 5, :].max(dim=-1)

# Decode the predicted token ID to obtain the actual token
predicted_token = tokenizer.decode(prediction_indexes, skip_special_tokens=True)

# Replace the masked token with the predicted token in the input sequence
decoded_input_ids = input_ids.squeeze().tolist()
decoded_input_ids[5] = prediction_indexes.item()
decoded_input = tokenizer.decode(decoded_input_ids, skip_special_tokens=True)

print(f'Input: {example["text"]}')
print(f'Predicted token: {predicted_token}')
print(f'Decoded input: {decoded_input}')
</code>```

The output I get is

Predicted token: े
Decoded input: The game’s े system, the BliTZ system, is carried over directly from Valkyira Chronicles. During missions, players select each unit using a top @ - @ down perspective of the

What am I doing wrong here?

Body:
I was trying to solve this problem

We’re going to use the wikitext (link) dataset with the distilbert-base-cased (link) model checkpoint.

Start by loading the wikitext-2-raw-v1 version of that dataset, and take the 11th example (index 10) of the train split.
We’ll tokenize this using the appropriate tokenizer, and we’ll mask the sixth token (index 5) the sequence.

When using the distilbert-base-cased checkpoint to unmask that (sixth token, index 5) token, what is the most probable predicted token (please provide the decoded token, and not the ID)?

and I coded the solution as

import torch
import transformers
import nlp

# Load the Wikitext-2 dataset
dataset = nlp.load_dataset('wikitext', 'wikitext-2-raw-v1')

# Get the 11th example (index 10) of the train split
example = dataset['train'][10]

# Load the DistilBERT model and tokenizer
model = transformers.DistilBertModel.from_pretrained('distilbert-base-cased')
tokenizer = transformers.DistilBertTokenizer.from_pretrained('distilbert-base-cased')

# Tokenize the example
input_ids = tokenizer.encode(example['text'], return_tensors='pt')

# Mask the sixth token (index 5) in the sequence
masked_input_ids = input_ids.clone()
masked_input_ids[:, 5] = tokenizer.mask_token_id

# Use the model to predict the most probable token for the masked token
output = model(masked_input_ids)[0]
prediction_scores, prediction_indexes = output[:, 5, :].max(dim=-1)
# prediction_scores, prediction_indexes = output[:, 5, :].max(dim=-1)

# Decode the predicted token ID to obtain the actual token
predicted_token = tokenizer.decode(prediction_indexes, skip_special_tokens=True)

# Replace the masked token with the predicted token in the input sequence
decoded_input_ids = input_ids.squeeze().tolist()
decoded_input_ids[5] = prediction_indexes.item()
decoded_input = tokenizer.decode(decoded_input_ids, skip_special_tokens=True)

print(f'Input: {example["text"]}')
print(f'Predicted token: {predicted_token}')
print(f'Decoded input: {decoded_input}')

The output I get is

Predicted token: े
Decoded input: The game’s े system, the BliTZ system, is carried over directly from Valkyira Chronicles. During missions, players select each unit using a top @ - @ down perspective of the

What am I doing wrong here?


问:
AndroidJavaException: java.lang.ClassNotFoundException: com.unity3d.plugin.downloader.UnityDownloaderService
I'm trying to run a Unity game on the Android Studio emulator, but I'm receiving the error below whenever I run it (either from building an apk from the Unity editor and running or from the play store):

AndroidJavaException: java.lang.ClassNotFoundException: com.unity3d.plugin.downloader.UnityDownloaderService java.lang.ClassNotFoundException: com.unity3d.plugin.downloader.UnityDownloaderService at java.lang.Class.classForName(Native Method) at java.lang.Class.forName(Class.java:454) at com.unity3d.player.UnityPlayer.nativeRender(Native Method) at com.unity3d.player.UnityPlayer.access$300(Unknown Source:0) at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20) Caused by: java.lang.ClassNotFoundException: Didn't find class "com.unity3d.plugin.downloader.UnityDownloaderService" on path: DexPathList[[zip file "/data/app/~~PUPwYH3sTLZDgAXgKGYUmA==/com.todo.todo-QL3yqTG5AR994UyegPPCZA==/base.apk"],nativeLibraryDirectories=[/data/app/~~PUPwYH3sTLZDgAXgKGYUmA==/com.todo.todo-QL3

I'm not sure what's wrong here since it works for other people. Any ideas?


问:
Load data from one Snowflake Database into other within same account cluster
Can you suggest an approach to load data from one Snowflake(SF) database into another SF database within same cluster?

I have to -

Do data transformation, incremental load while loading into destination SF table

Schedule the load like ETL job

Thanks,
Nikhil


问:
Submit button does not go to other page
I got a problem with my login page.

```<code><?php
session_start();
error_reporting(0);
include("include/config.php");
if(isset($_SESSION['captcha_code']) && isset($_POST['submit']))
{

    if ($_SESSION['captcha_code'] == $_POST['captcha']) {
    $ret=mysqli_query($con,"SELECT * FROM users WHERE email='".$_POST['email']."' and password='".md5($_POST['password'])."'");
    $num=mysqli_fetch_array($ret);

    if(mysqli_num_rows($ret) > 0) {

        echo "<script>alert('Successfully Registered. You can login now');
         window.location.href ='dashboard.php';</script>";
    }
    } else {
        // CAPTCHA code is incorrect, show an error message and allow the user to try again
        $_SESSION['errmsg']="Invalid email, password or CAPTCHA code";
        $extra="user-login.php";
        $host  = $_SERVER['HTTP_HOST'];
        $uri  = rtrim(dirname($_SERVER['PHP_SELF']),'/\\');
        header("location:http://$host$uri/$extra");
    }

        exit();

    }

?>

<html>
<div class="form-group">
    <span class="input-icon">
    <input type="text" class="form-control" name="email" placeholder="Email">
    <i class="fa fa-user"></i> </span>
</div>
<div class="form-group form-actions">
    <span class="input-icon">
    <input type="password" class="form-control password" name="password" placeholder="Password">
    <i class="fa fa-lock"></i>
    </span><a href="forgot-password.php">
    Forgot Password ?
    </a>
</div>
<div class="form-actions">
    <div class="form-group form-actions">
    <img src="captcha.php" alt="Captcha Code" id="captchaImg">
    <a href="javasript: void(0);" onclick="refreshCaptcha();"><i class="fa fa-fresh"></i></a>
    <input type="text" class="form-control" name="captcha" id = "captcha_code" placeholder="Enter above captcha">
</div>
</div>

<div class="form-actions">
    <button type="submit" class="btn btn-primary pull-right" name="submit">Login <i class="fa fa-arrow-circle-right"></i>
    </button>
</div>
</html>
</code>```

This page from my login.php. When the user clicks the submit button, the user is supposed to go to dashboard.php. In my case, it only generated a script alert but stayed on the login page. This happens when users insert a valid email, password, and captcha. I hope I can get a solution for this code. Thank you and sorry for my English.

Title: Submit button does not go to other page

Body:
I got a problem with my login page.

<?php
session_start();
error_reporting(0);
include("include/config.php");
if(isset($_SESSION['captcha_code']) && isset($_POST['submit']))
{

    if ($_SESSION['captcha_code'] == $_POST['captcha']) {
    $ret=mysqli_query($con,"SELECT * FROM users WHERE email='".$_POST['email']."' and password='".md5($_POST['password'])."'");
    $num=mysqli_fetch_array($ret);

    if(mysqli_num_rows($ret) > 0) {

        echo "";
    }
    } else {
        // CAPTCHA code is incorrect, show an error message and allow the user to try again
        $_SESSION['errmsg']="Invalid email, password or CAPTCHA code";
        $extra="user-login.php";
        $host  = $_SERVER['HTTP_HOST'];
        $uri  = rtrim(dirname($_SERVER['PHP_SELF']),'/\\');
        header("location:http://$host$uri/$extra");
    }

        exit();

    }

?>

    <input type="text" class="form-control" name="email" placeholder="Email">

    <input type="password" class="form-control password" name="password" placeholder="Password">

    Forgot Password ?

    <input type="text" class="form-control" name="captcha" id = "captcha_code" placeholder="Enter above captcha">

    <button type="submit" class="btn btn-primary pull-right" name="submit">Login
    </button>

This page from my login.php. When the user clicks the submit button, the user is supposed to go to dashboard.php. In my case, it only generated a script alert but stayed on the login page. This happens when users insert a valid email, password, and captcha. I hope I can get a solution for this code. Thank you and sorry for my English.


问:
Python buildozer, ValueError
Good afternoon! I'm asking for help, I can't figure out python buildozer for a day, I've already prepared everything, and at the final stage, when the "buildozer android debug" command is entered into the terminal, it gives such an error at the end. Can anyone tell me what to do about it and how to fix it?

Here is the error itself:

```<code>Traceback (most recent call last):
  File "/usr/local/bin/buildozer", line 11, in <module>
    load_entry_point('buildozer==0.40.dev0', 'console_scripts', 'buildozer')()
  File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/scripts/client.py", line 13, in main
    Buildozer().run_command(sys.argv[1:])
  File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/__init__.py", line 1071, in run_command
    self.target.run_commands(args)
  File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/target.py", line 92, in run_commands
    func(args)
  File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/target.py", line 102, in cmd_debug
    self.buildozer.prepare_for_build()
  File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/__init__.py", line 178, in prepare_for_build
    self.target.install_platform()
  File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/targets/android.py", line 666, in install_platform
    self._install_android_ndk()
  File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/targets/android.py", line 459, in _install_android_ndk
    cwd=self.buildozer.global_platform_dir)
  File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/__init__.py", line 699, in download
    urlretrieve(url, filename, report_hook)
  File "/usr/lib/python3.6/urllib/request.py", line 1826, in retrieve
    block = fp.read(bs)
  File "/usr/lib/python3.6/tempfile.py", line 624, in func_wrapper
    return func(*args, **kwargs)
ValueError: read of closed file
</code>```

I tried to find an answer to this question, but so far without success.

Title: Python buildozer, ValueError

Body:
Good afternoon! I'm asking for help, I can't figure out python buildozer for a day, I've already prepared everything, and at the final stage, when the "buildozer android debug" command is entered into the terminal, it gives such an error at the end. Can anyone tell me what to do about it and how to fix it?

Here is the error itself:

Traceback (most recent call last):
  File "/usr/local/bin/buildozer", line 11, in <module>
    load_entry_point('buildozer==0.40.dev0', 'console_scripts', 'buildozer')()
  File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/scripts/client.py", line 13, in main
    Buildozer().run_command(sys.argv[1:])
  File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/__init__.py", line 1071, in run_command
    self.target.run_commands(args)
  File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/target.py", line 92, in run_commands
    func(args)
  File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/target.py", line 102, in cmd_debug
    self.buildozer.prepare_for_build()
  File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/__init__.py", line 178, in prepare_for_build
    self.target.install_platform()
  File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/targets/android.py", line 666, in install_platform
    self._install_android_ndk()
  File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/targets/android.py", line 459, in _install_android_ndk
    cwd=self.buildozer.global_platform_dir)
  File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/__init__.py", line 699, in download
    urlretrieve(url, filename, report_hook)
  File "/usr/lib/python3.6/urllib/request.py", line 1826, in retrieve
    block = fp.read(bs)
  File "/usr/lib/python3.6/tempfile.py", line 624, in func_wrapper
    return func(*args, **kwargs)
ValueError: read of closed file

I tried to find an answer to this question, but so far without success.


问:
How to populate an array variable in pinia from a vue component at mount
I have a vue3 app with a pinia store. When a vue component loads it reads a json object. I want this to be fed into an array in pinia. When trying (in options API)

```<code>mounted: {
      Object.keys(this.myjson).map(function (v) {
      this.filters[v] = [];
   });
},
// after having
  computed: {
  ...mapWritableState(useSearchStore, ["filters"]),
  },

</code>```

I get an error [Vue warn]: Slot "default" invoked outside of the render function and the array in pinia stay empty.

What is the correct way to populate data in pinia from a component at mount?

Body:
I have a vue3 app with a pinia store. When a vue component loads it reads a json object. I want this to be fed into an array in pinia. When trying (in options API)

mounted: {
      Object.keys(this.myjson).map(function (v) {
      this.filters[v] = [];
   });
},
// after having
  computed: {
  ...mapWritableState(useSearchStore, ["filters"]),
  },

I get an error [Vue warn]: Slot "default" invoked outside of the render function and the array in pinia stay empty.

What is the correct way to populate data in pinia from a component at mount?


问:
marketplace.therange.co.uk Checking if the site connection is secure
this the api of marketplacetherange.zendesk
postman output when I try to use authenticate api
when i change the host (https://marketplace.therange.co.uk) it gives the 400 bad request cloudflare
when i try this on browser it gives 404

I want to run this api


问:
How to Add an Filter to this Excel sheet with this Criteria?
I have this Dataset

Now, In this Dataset, I want to Add a Filter where as we can see there are same or little different names for the same product, so we want to add a filter which if we chose LOSARTAN will show all the values in Product relating to that LOSARTAN, same for the other Products too. Basically, a Filter where we filter all the products which have similar names, if we choose one name in filter we will be able to see all the different names used for that Specific Product.

Thank you!


问:
Cannot resolve module in typescript monorepo
As part of a project I'm working on, I've had to transform a typescript project into a monorepo. As a result however, I've been having issues with imports.

In the /src directory of one of the projects, imports are made by doing the following:
import x from server/y/z. However, the location of these folders is /server/src/y/z. Ideally, typescript would know where to resolve the modules, however it cannot find them.

This package also needs to import from other packages, but those packages also have /src in their directories whilst every relative import does not have that.

Whilst I am aware that I could go through and replace/fix each relative directory, the size of the monorepo makes this approach extremely time consuming.

tsconfig for /server package:

```<code>{
  "extends": "../../tsconfig.json",
  "composite": true,
  "compilerOptions": {
    "outDir": "./dist/",
    "baseUrl": "."
  },
  "include": ["./**/*.ts"],
  "paths": {
    "server/*": ["./src/*"]
  }
}
</code>```

root tsconfig:

```<code>{
  "$schema": "https://json.schemastore.org/tsconfig",
  "display": "Node 16",
  "exclude": ["node_modules", "**/*/dist", "**/*.test.ts"],
  "compilerOptions": {
    "outDir": ".", // prevents this tsconfig from compiling any files
    "noEmit": true,
    // Specify the base directory and workspace paths to allow importing
    // workspace packages as npm dependencies.
    "baseUrl": ".",
    "paths": {
      "*": ["./packages/*"],
    },
    "lib": ["es2021"],
    "module": "commonjs",
    "target": "es2021",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true,

  }
}
</code>```

Things I have attempted:

Adding paths to attempt mappings

Adding references back to its own package

None of these changes managed to resolve the modules that were in these particular packages. The only time I managed to get a solution was by manually changing the relative import.

Along with my VSCode linter telling me that it cannot resolve the modules, esbuild cannot bundle the files together.

Body:
As part of a project I'm working on, I've had to transform a typescript project into a monorepo. As a result however, I've been having issues with imports.

In the /src directory of one of the projects, imports are made by doing the following:
import x from server/y/z. However, the location of these folders is /server/src/y/z. Ideally, typescript would know where to resolve the modules, however it cannot find them.

This package also needs to import from other packages, but those packages also have /src in their directories whilst every relative import does not have that.

Whilst I am aware that I could go through and replace/fix each relative directory, the size of the monorepo makes this approach extremely time consuming.

tsconfig for /server package:

{
  "extends": "../../tsconfig.json",
  "composite": true,
  "compilerOptions": {
    "outDir": "./dist/",
    "baseUrl": "."
  },
  "include": ["./**/*.ts"],
  "paths": {
    "server/*": ["./src/*"]
  }
}

root tsconfig:

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "display": "Node 16",
  "exclude": ["node_modules", "**/*/dist", "**/*.test.ts"],
  "compilerOptions": {
    "outDir": ".", // prevents this tsconfig from compiling any files
    "noEmit": true,
    // Specify the base directory and workspace paths to allow importing
    // workspace packages as npm dependencies.
    "baseUrl": ".",
    "paths": {
      "*": ["./packages/*"],
    },
    "lib": ["es2021"],
    "module": "commonjs",
    "target": "es2021",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true,

  }
}

Things I have attempted:

Adding paths to attempt mappings

Adding references back to its own package

None of these changes managed to resolve the modules that were in these particular packages. The only time I managed to get a solution was by manually changing the relative import.

Along with my VSCode linter telling me that it cannot resolve the modules, esbuild cannot bundle the files together.


问:
Get maximal value per Azure Data Explorer table from tables with same schema
I have multiple tables with telemetry Metric_1, Metric_2, Metric_3 and all those tables have the same schema (e.g. they contain Timestamp column). I'd like to get the most recent timestamp per table.
I found possibility of using union wildcard, but query

```<code>union Metric_*
|summarize Max= max(Timestamp)
</code>```

never actually finished.

Query

```<code>Metric_1
|top 1 by Timestamp
</code>```

takes no time. But even summarize on a single table takes forever (I killed it after 2 minutes)

```<code>Metric_1
|summarize Max= max(Timestamp)
</code>```

Can you explain the time difference and suggest how to accomplish what I need? The outcome should be

```<code>Table    | MaxTimestamp
Metric_1 | Date1
Metric_2 | Date2
Metric_3 | Date3
</code>```

Body:
I have multiple tables with telemetry Metric_1, Metric_2, Metric_3 and all those tables have the same schema (e.g. they contain Timestamp column). I'd like to get the most recent timestamp per table.
I found possibility of using union wildcard, but query

union Metric_*
|summarize Max= max(Timestamp)

never actually finished.

Query

Metric_1
|top 1 by Timestamp

takes no time. But even summarize on a single table takes forever (I killed it after 2 minutes)

Metric_1
|summarize Max= max(Timestamp)

Can you explain the time difference and suggest how to accomplish what I need? The outcome should be

Table    | MaxTimestamp
Metric_1 | Date1
Metric_2 | Date2
Metric_3 | Date3


问:
How to customize ngx-datatable header checkbox behavior
I have made a ngx-datatable with 20 rows paginated by size 10 that introduce behavior like this.

select 10 rows in page(1)

header checkbox is checked

selected count in footer is 10

select 12 rows, 10 rows in page(1), 2 rows in page(2)

header checkbox in page(2) is checked.

selected count in all pages is correctly 12.

Expected behavior

select 10 rows in page(1)

header checkbox is checked

selected count in footer is 10

select 12 rows, 10 rows in page(1), 2 rows in page(2)

header checkbox in new page is un-checked if all checkbox in the same page is not all checked.

selected count in all pages is correctly 12.

I want to know if there are any property I can look up that can fix this issue as I can't find any on their page.

I tried

making the property selected empty array =[] to un-checked the header checkbox in new page.

while it do un-checked the checkbox, it also wipe of any selected object in page(1). Not the behavior I want.

turning the property [selectAllRowsOnPage]="true"

this also un-checked the header checkbox, but just like scenario 1, this also un-check all selected object in page(1). Not the behavior I want.

Additional info - I use [headerCheckboxable]="true" to check all box in the table.


问:
C# why use a local variable to hold a member variable before calling its methods when thinking about thread-safe?
I was reading the source code of ConcurrentQueue:

```<code>public void Enqueue(T item)
{
    SpinWait spin = new SpinWait();
    while (true)
    {
        // Why use a local variable to hold a member variable?
        // If we call m_tail.TryAppend() directly, is there any risk if
        // another thread was tring to change the value of m_tail while calling?
        Segment tail = m_tail;
        if (tail.TryAppend(item))
            return;
        spin.SpinOnce();
    }
}
</code>```

I want to know the reason.

Body:
I was reading the source code of ConcurrentQueue:

public void Enqueue(T item)
{
    SpinWait spin = new SpinWait();
    while (true)
    {
        // Why use a local variable to hold a member variable?
        // If we call m_tail.TryAppend() directly, is there any risk if
        // another thread was tring to change the value of m_tail while calling?
        Segment tail = m_tail;
        if (tail.TryAppend(item))
            return;
        spin.SpinOnce();
    }
}

I want to know the reason.


问:
Casing of ../App does not match the underlying filesystem import/no-unresolved
I am creating an eslint file inside react native project. While running eslint the following error occurs.  Also, used the fix command, but still, the issue.

```<code>**

/Users/mac/Desktop/superproject/__tests__/App-test.js
  4:17  error  Casing of ../App does not match the underlying filesystem  import/no-unresolved

**

</code>```

Getting the result while giving    import App from '../App.tsx';     for the below file, but instead of that need to solve it by using the eslint config file because if so I may need to add .tsx for every file import.

```<code>import 'react-native';
import React from 'react';
import renderer from 'react-test-renderer';
import App from '../App';

it('renders correctly', () => {
  renderer.create(<App />);
});

</code>```

I am providing the eslint config file:

```<code>{
  "env": {
    "browser": true,
    "react-native/react-native": true,
    "es2021": true,
    "jest":true
  },
  "extends": [
    "eslint:recommended",
    "plugin:  /recommended",
    "plugin:@typescript-eslint/recommended",
    "prettier",
    "airbnb"
  ],
  "overrides": [],

  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "ecmaFeatures": {
      "jsx": true
    },
    "ecmaVersion": "6",
    "sourceType": "module"
  },
  "plugins": ["react", "react-native", "@typescript-eslint", "prettier"],
  "rules": {
    "react-native/no-unused-styles": 2,
    "react-native/split-platform-components": 2,
    "react-native/no-inline-styles": 2,
    "react-native/no-color-literals": 2,
    "react-native/no-raw-text": 2,
    "prettier/prettier": ["error"],
    "react-native/sort-styles": ["error", "asc", { "ignoreClassNames": false, "ignoreStyleProperties": false }],
    "react/jsx-filename-extension": [1, { "extensions": [".tsx", ".jsx", ".js", ".ts",".json"] }],
    "import/extensions": [
      "error",
      "ignorePackages",
      {
        "":"never",
        "json":"never",
        "js": "never",
        "jsx": "never",
        "ts": "never",
        "tsx": "never"
      }
   ]
  },
  "settings": {
    "react": {
      "version": "detect"
    }
  }
}
</code>```

please help to resolve.

Body:
I am creating an eslint file inside react native project. While running eslint the following error occurs.  Also, used the fix command, but still, the issue.

**

/Users/mac/Desktop/superproject/__tests__/App-test.js
  4:17  error  Casing of ../App does not match the underlying filesystem  import/no-unresolved

**

Getting the result while giving    import App from '../App.tsx';     for the below file, but instead of that need to solve it by using the eslint config file because if so I may need to add .tsx for every file import.

import 'react-native';
import React from 'react';
import renderer from 'react-test-renderer';
import App from '../App';

it('renders correctly', () => {
  renderer.create(<App />);
});

I am providing the eslint config file:

{
  "env": {
    "browser": true,
    "react-native/react-native": true,
    "es2021": true,
    "jest":true
  },
  "extends": [
    "eslint:recommended",
    "plugin:  /recommended",
    "plugin:@typescript-eslint/recommended",
    "prettier",
    "airbnb"
  ],
  "overrides": [],

  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "ecmaFeatures": {
      "jsx": true
    },
    "ecmaVersion": "6",
    "sourceType": "module"
  },
  "plugins": ["react", "react-native", "@typescript-eslint", "prettier"],
  "rules": {
    "react-native/no-unused-styles": 2,
    "react-native/split-platform-components": 2,
    "react-native/no-inline-styles": 2,
    "react-native/no-color-literals": 2,
    "react-native/no-raw-text": 2,
    "prettier/prettier": ["error"],
    "react-native/sort-styles": ["error", "asc", { "ignoreClassNames": false, "ignoreStyleProperties": false }],
    "react/jsx-filename-extension": [1, { "extensions": [".tsx", ".jsx", ".js", ".ts",".json"] }],
    "import/extensions": [
      "error",
      "ignorePackages",
      {
        "":"never",
        "json":"never",
        "js": "never",
        "jsx": "never",
        "ts": "never",
        "tsx": "never"
      }
   ]
  },
  "settings": {
    "react": {
      "version": "detect"
    }
  }
}

please help to resolve.


问:
Neomutt pager macro not executing
I have the following folder-hook with a macro in my Neomutt config:

```<code>folder-hook my-folder 'macro index,pager A <tag-thread><tag-prefix><clear-flag>N<tag-prefix><save-message>=Archive/`date +"%Y"`<enter>'
</code>```

This works in the index menu, but not in pager. When pressing "A" in pager I get the following message "Key is not bound". Can anyone tell me why it's not working?

Title: Neomutt pager macro not executing

Body:
I have the following folder-hook with a macro in my Neomutt config:

folder-hook my-folder 'macro index,pager A <tag-thread><tag-prefix><clear-flag>N<tag-prefix><save-message>=Archive/`date +"%Y"`<enter>'

This works in the index menu, but not in pager. When pressing "A" in pager I get the following message "Key is not bound". Can anyone tell me why it's not working?


问:
If one categorical and continuous feature have relation with each other, is it ok to do ordinal encoding?
Area vs sales price

In the above graph, we can see that there is some relationship exits between area and sales price.
is it ok to do label encoding for the area column.

like data["area"]=data["area"].replace({"T nagar":1,"anna nagar 2"})

I tried to do encoding for the area column, but confused what encoding technique to use like whether should i go for label encoding or one hot encoding.


问:
Method call: Attempted to call method on null context object?
My Stack Trace Log

```<code>org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "instrucor.getInstructorId()" (template: "views/update" - line 39, col 14)
    at org.thymeleaf.spring6.expression.SPELVariableExpressionEvaluator.evaluate(SPELVariableExpressionEvaluator.java:292) ~[thymeleaf-spring6-3.1.0.RELEASE.jar:3.1.0.RELEASE]
    at org.thymeleaf.standard.expression.VariableExpression.executeVariableExpression(VariableExpression.java:166) ~[thymeleaf-3.1.0.RELEASE.jar:3.1.0.RELEASE]
    at org.thymeleaf.standard.expression.SimpleExpression.executeSimple(SimpleExpression.java:66) ~[thymeleaf-3.1.0.RELEASE.jar:3.1.0.RELEASE]
    at org.thymeleaf.standard.expression.Expression.execute(Expression.java:109) ~[thymeleaf-3.1.0.RELEASE.jar:3.1.0.RELEASE]
6-3.1.0.RELEASE.jar:3.1.0.RELEASE]
    ... 64 common frames omitted

2023-01-06T09:29:51.435+02:00 ERROR 18336 --- [nio-8071-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "instrucor.getInstructorId()" (template: "views/update" - line 39, col 14)] with root cause

org.springframework.expression.spel.SpelEvaluationException: EL1011E: Method call: Attempted to call method getInstructorId() on null context object
    at org.springframework.expression.spel.ast.MethodReference.throwIfNotNullSafe(MethodReference.java:154) ~[spring-expression-6.0.2.jar:6.0.2]
</code>```

I check my spring version 3.00 and thymeleaf version 3.1.

My  Html + thymeleaf

```<code><div class="mb-3 mt-3">
   <label class ="form-label"> Instructor: </label>
   <select th:field="${course.instructor}" name="instructor" class="form-select">

    <option th:each="instructor:${listInstructor}" th:text="${instructor.getfirstName()} + ' ' +${instructor.getlastName()}"
             th:value="${instrucor.getInstructorId()}"> </option>
   </select>
   </div>
</code>```

In mySql i have Instructor

Also my Controller

```<code>@GetMapping ("/update")
    public String updateCourse (Model model, Long courseId) {
        Course course = courseService.loadCourseBycourseId(courseId);
        List <Instructor> instructors = instructorService.fetchInstrucotr();
        model.addAttribute("course", course);
        model.addAttribute("listInstructor", instructors);
        return "views/update";
    }

    @PostMapping ("/save")
    public String saveCourse (Course course) {
        courseService.createOrUpdateCourse(course);
        return "redirect:/courses/index";
    }
</code>```

Without this instructor fields in html, ma page loaded without problem

Body:
My Stack Trace Log

org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "instrucor.getInstructorId()" (template: "views/update" - line 39, col 14)
    at org.thymeleaf.spring6.expression.SPELVariableExpressionEvaluator.evaluate(SPELVariableExpressionEvaluator.java:292) ~[thymeleaf-spring6-3.1.0.RELEASE.jar:3.1.0.RELEASE]
    at org.thymeleaf.standard.expression.VariableExpression.executeVariableExpression(VariableExpression.java:166) ~[thymeleaf-3.1.0.RELEASE.jar:3.1.0.RELEASE]
    at org.thymeleaf.standard.expression.SimpleExpression.executeSimple(SimpleExpression.java:66) ~[thymeleaf-3.1.0.RELEASE.jar:3.1.0.RELEASE]
    at org.thymeleaf.standard.expression.Expression.execute(Expression.java:109) ~[thymeleaf-3.1.0.RELEASE.jar:3.1.0.RELEASE]
6-3.1.0.RELEASE.jar:3.1.0.RELEASE]
    ... 64 common frames omitted

2023-01-06T09:29:51.435+02:00 ERROR 18336 --- [nio-8071-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "instrucor.getInstructorId()" (template: "views/update" - line 39, col 14)] with root cause

org.springframework.expression.spel.SpelEvaluationException: EL1011E: Method call: Attempted to call method getInstructorId() on null context object
    at org.springframework.expression.spel.ast.MethodReference.throwIfNotNullSafe(MethodReference.java:154) ~[spring-expression-6.0.2.jar:6.0.2]

I check my spring version 3.00 and thymeleaf version 3.1.

My  Html + thymeleaf

    Instructor:
   <select th:field="${course.instructor}" name="instructor" class="form-select">

    <option th:each="instructor:${listInstructor}" th:text="${instructor.getfirstName()} + ' ' +${instructor.getlastName()}"
             th:value="${instrucor.getInstructorId()}"> </option>
   </select>

In mySql i have Instructor

Also my Controller

@GetMapping ("/update")
    public String updateCourse (Model model, Long courseId) {
        Course course = courseService.loadCourseBycourseId(courseId);
        List <Instructor> instructors = instructorService.fetchInstrucotr();
        model.addAttribute("course", course);
        model.addAttribute("listInstructor", instructors);
        return "views/update";
    }

    @PostMapping ("/save")
    public String saveCourse (Course course) {
        courseService.createOrUpdateCourse(course);
        return "redirect:/courses/index";
    }

Without this instructor fields in html, ma page loaded without problem


问:
Failed custom build command using Cargo when including reqwest with rustls-tls in redhat 6

in my Cargo.toml

reqwest = { version = "0.10", default-features = false, features = ["blocking", "json", "rustls-tls"] }
```
<ol start="2">
<li>my rust version is 1.59 matched the glibc 2.15 in redhat 6
when I run cargo check , the errors below:</li>
</ol>
<pre class="lang-none prettyprint-override"><code>Checking http-body v0.3.1
Checking unicode-normalization v0.1.22
error: failed to run custom build command for ring v0.16.20

Caused by:
process didn't exit successfully: /root/reqtest/target/debug/build/ring-4494a7af260ba106/build-script-build (exit status: 101)
--- stdout
OPT_LEVEL = Some("0")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
cargo:rerun-if-env-changed=CC_x86_64-unknown-linux-gnu
CC_x86_64-unknown-linux-gnu = None
cargo:rerun-if-env-changed=CC_x86_64_unknown_linux_gnu
CC_x86_64_unknown_linux_gnu = None
cargo:rerun-if-env-changed=HOST_CC
HOST_CC = None`your text`
cargo:rerun-if-env-changed=CC
CC = None
</code>```

How could I use reqwest with rustls-tls via Rust 1.59 in redhat 6 ?

Body:
in my Cargo.toml

reqwest = { version = "0.10", default-features = false, features = ["blocking", "json", "rustls-tls"] }

my rust version is 1.59 matched the glibc 2.15 in redhat 6
when I run cargo check , the errors below:

Checking http-body v0.3.1
Checking unicode-normalization v0.1.22
error: failed to run custom build command for ring v0.16.20

Caused by:
process didn't exit successfully: /root/reqtest/target/debug/build/ring-4494a7af260ba106/build-script-build (exit status: 101)
--- stdout
OPT_LEVEL = Some("0")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
cargo:rerun-if-env-changed=CC_x86_64-unknown-linux-gnu
CC_x86_64-unknown-linux-gnu = None
cargo:rerun-if-env-changed=CC_x86_64_unknown_linux_gnu
CC_x86_64_unknown_linux_gnu = None
cargo:rerun-if-env-changed=HOST_CC
HOST_CC = None`your text`
cargo:rerun-if-env-changed=CC
CC = None

How could I use reqwest with rustls-tls via Rust 1.59 in redhat 6 ?


问:
What is '_' in Nginx server name?
what is this mean in nginx server?

```<code>server{
    listen 80;
    listen [::]:80;

    server_name _;

    location / {

    }
}
</code>```

is this mean nginx listen 80 from every server?

please let me know

Title: What is '_' in Nginx server name?

Body:
what is this mean in nginx server?

server{
    listen 80;
    listen [::]:80;

    server_name _;

    location / {

    }
}

is this mean nginx listen 80 from every server?

please let me know


问:
404 error in react project I published with caprover
When we publish a react project on caprover, it gives 404 error when refreshing the page. my caprover nginx settings are default. My dockerfile is like this</p>
```<code>WORKDIR /app
COPY . .
RUN yarn install
RUN yarn build

ENV NODE_ENV production

EXPOSE 3000
CMD [ "npx", "serve", "build" ]
</code>```

Body:
When we publish a react project on caprover, it gives 404 error when refreshing the page. my caprover nginx settings are default. My dockerfile is like this

WORKDIR /app
COPY . .
RUN yarn install
RUN yarn build

ENV NODE_ENV production

EXPOSE 3000
CMD [ "npx", "serve", "build" ]


问:
When I run my code I get a green screen with multiple small balls that says Fps counter. My picture's don't show up

import os.path

import random

import blue as blue

import pygame

import pygame.display

import pygame.image

from pygame import surface

from pygame.examples.go_over_there import screen

surface.fill(blue)

DISLPLAY_BLIT = screen.blit("Treasure_Chest_set.png", (100, 150))

pygame.font.init()

pygame.mixer.init()

pygame.display.init()

pygame.init()

pygame.display.set_mode()

width = 400

height = 400

screen.set_caption('/Treasure_chest_game')

image = pygame.image.load("/Treasure_chest_pics", "Treasure_Chest_set.png")

coins by selecting randomly from chest, and make function for one coin at a time

class Lucky_number:

pass

def deal_coins(current_hand, current_play, current_coin=5, ):

coin = random.randint(1, 5, 26)

return current_hand, current_coin

noinspection PyUnreachableCode

def computer_out_put(game_values, winner_vaules):

if Lucky_number != '25':

return "Gold_coin_winner"

noinspection PyUnreachableCode

def fuction(Adding_values_game_logic):

silver_coin = random.randit(1, 6)

return "player_score"

noinspection PyUnreachableCode

def fcuntion(five_coins_Game_math, five_silver_coins=player_score):

vars("25 = winner")

vars(">25 = loser")

vars("<25 = loser")

your textstaus = True

while (staus):

while running:

for event in pygame.event.get():

if event.type == pygame.QUIT:

running = False

i tried every method I can find to load the images. I though the files were being corrupted in a the directory but then it started to show no error and i get a green screen that says ball cound