问:
Res functions not working after post request fetch (html built in function)
I have this node.js code where I process a post request sent from fetch (ejs)

app.post('/signup', jsonParser, async function(req, res) {

  const email = req.body.email;
  const password = req.body.password;
  console.log(`hello`)

   auth.createUserWithEmailAndPassword(email, password).then(async userCredentials => {

    const user = userCredentials.user
    console.log(user.email)
    await db.collection("users").add({
      createdAt: Date.now(),
      name: req.body.name,
      email: email,
      signupmethod: "email",
    })
      .then((docRef) => {
        console.log("Document written with ID: ", docRef.id);

      })
      .catch((error) => {
        return console.error("Error adding document: ", error);
      });
      res.redirect(`/dashboard`)

  }).catch(error => {
    res.render('signup', {error:error.message})
    return console.log(error.message)

  })

});
```
<p>Res.render and res.redirect are not working for some reason.</p>
<p>Here is the post request code</p>
<pre class="lang-html prettyprint-override"><code>    const data = {
        email: email,
        password: password,
        name:name,
    }
    fetch("/signup", {
  method: "POST",
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify(data)
}).then((response) => {
  console.log(response);
})
</code>```

When I submit the form, the post request sends, and the user is logged in, but nothing happens after that.

Why can't I redirect when the code is successful or render a page when there is an error? is there a problem with res?

Body:
I have this node.js code where I process a post request sent from fetch (ejs)

app.post('/signup', jsonParser, async function(req, res) {

  const email = req.body.email;
  const password = req.body.password;
  console.log(`hello`)

   auth.createUserWithEmailAndPassword(email, password).then(async userCredentials => {

    const user = userCredentials.user
    console.log(user.email)
    await db.collection("users").add({
      createdAt: Date.now(),
      name: req.body.name,
      email: email,
      signupmethod: "email",
    })
      .then((docRef) => {
        console.log("Document written with ID: ", docRef.id);

      })
      .catch((error) => {
        return console.error("Error adding document: ", error);
      });
      res.redirect(`/dashboard`)

  }).catch(error => {
    res.render('signup', {error:error.message})
    return console.log(error.message)

  })

});

Res.render and res.redirect are not working for some reason.

Here is the post request code

    const data = {
        email: email,
        password: password,
        name:name,
    }
    fetch("/signup", {
  method: "POST",
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify(data)
}).then((response) => {
  console.log(response);
})

When I submit the form, the post request sends, and the user is logged in, but nothing happens after that.

Why can't I redirect when the code is successful or render a page when there is an error? is there a problem with res?


来源: stackexchange

问:
Access variable in Jenkins Pipeline Post Action
When I start a job and run a command

```<code>npm run e2e_test,
</code>```

it successfully executed. I set a variable let say REPORT_URL using process.env.REPORT_URL . Now in Jenkins post action I would like to access this variable REPORT_URL.

This url is construed at runtime so it cannot be set before the job. Once the job completed all the stages, it reaches in post section and here if I mention like

```<code>echo "${REPORT_URL}" or echo "${env.REPORT_URL}"

</code>```
```<code>I get an exception MissingProperty-: NO such property: REPORT_URL for class WorkflowScript.

</code>```

I tried to create a variable in .env file with same name but didn't get success.

So I can access a variable in post build in Jenkins pipeline which set in code using process.env.XXXX?

ContentLicense: CC BY-SA 4.0

Body:
When I start a job and run a command

npm run e2e_test,

it successfully executed. I set a variable let say REPORT_URL using process.env.REPORT_URL . Now in Jenkins post action I would like to access this variable REPORT_URL.

This url is construed at runtime so it cannot be set before the job. Once the job completed all the stages, it reaches in post section and here if I mention like

echo "${REPORT_URL}" or echo "${env.REPORT_URL}"

I get an exception MissingProperty-: NO such property: REPORT_URL for class WorkflowScript.

I tried to create a variable in .env file with same name but didn't get success.

So I can access a variable in post build in Jenkins pipeline which set in code using process.env.XXXX?


问:
Type handleChange is not assignable to type
I'm using MaterialUI to generate a TabList. I created the handler:

const handleChange = (event, newValue) => {
    setValue(newValue);
}
```
<p>and am calling it here:</p>
<pre class="lang-html prettyprint-override"><code><TabList aria-label={"toggle product"} onChange={handleChange} textColor={colors.grey[100]}>
     <Tab label={"REVENUE"} value={"revenue"}/>
     <Tab label={"EPS"} value={"eps"} />
</TabList>
</code>```

However, my IDE (WebStorm) is raising this inspection error:

Type handleChange is not assignable to type {(event: React.SyntheticEvent, value: any): void, (event: React.SyntheticEvent, value: any): void, (event: React.SyntheticEvent, value: any): void}

Am I calling the function in correctly?

Body:
I'm using MaterialUI to generate a TabList. I created the handler:

const handleChange = (event, newValue) => {
    setValue(newValue);
}

and am calling it here:

<TabList aria-label={"toggle product"} onChange={handleChange} textColor={colors.grey[100]}>
     <Tab label={"REVENUE"} value={"revenue"}/>
     <Tab label={"EPS"} value={"eps"} />
</TabList>

However, my IDE (WebStorm) is raising this inspection error:

Type handleChange is not assignable to type {(event: React.SyntheticEvent, value: any): void, (event: React.SyntheticEvent, value: any): void, (event: React.SyntheticEvent, value: any): void}

Am I calling the function in correctly?


问:
Extreme Learning Machine installation and usage
I am trying to use this python package https://github.com/5663015/elm. I am using anaconda and jupyter notebook. I am not able to install this package using conda. However, for using the package, in the github they say that I should "Download source code, enter cmd in the project directory, run the following command: import elm". Can someone please let me know how I can do this using anaconda and jupyter notebook.</p>


问:
PyCharm Error Loading Package List:connect timed out
I just downloaded PyCharm a few days ago and wanted to download the pygame package. I'm using Windows 7 with PyCharm 2022.3.2 and python 3.8.10 When I go to the available packages screen it says:

Error loading package list:Connect timed out

Error

I was trying to intsall the pygame package.


问:
Hide an element from a Navigation Container on a specific screen on React Native
My main App is the following

export default function App() {
  return (
    <NavigationContainer>
      <Stack.Navigator>
        <Stack.Screen name="Home" ... />
        <Stack.Screen name="LogIn" ... />
        <Stack.Screen name="Profile" ... />
      </Stack.Navigator>
      <NavBar />
    </NavigationContainer>
  );
}
```

It consists in some screens, and then a bottom navigation bar that is present in all the screens.

My question is, is there a way to hide the NavBar element in a specific screen or to specifically show it without having to manually put it in every screen?
I have tried:

Using the useRoute function to return nothing if the route name was an specific one

Manually putting the NavBar on every single screen (would solve it, but is not very efficient)

Body:
My main App is the following

export default function App() {
  return (
    <NavigationContainer>
      <Stack.Navigator>
        <Stack.Screen name="Home" ... />
        <Stack.Screen name="LogIn" ... />
        <Stack.Screen name="Profile" ... />
      </Stack.Navigator>
      <NavBar />
    </NavigationContainer>
  );
}

It consists in some screens, and then a bottom navigation bar that is present in all the screens.

My question is, is there a way to hide the NavBar element in a specific screen or to specifically show it without having to manually put it in every screen?
I have tried:

Using the useRoute function to return nothing if the route name was an specific one

Manually putting the NavBar on every single screen (would solve it, but is not very efficient)


问:
If this is a custom font, be sure to load it with Font.loadAsync. RCTText
I am kind of new to react native and i have been practicing with some codes but i just encountered an error that i have been trying to solve for days. In my app I'm displaying bottom navigation with some icons and it was working initially until it suddenly stopped loading icons with these errors in the terminal

```<code> ERROR  fontFamily "Material Design Icons" is not a system font and has not been loaded through Font.loadAsync.

- If you intended to use a system font, make sure you typed the name correctly and that it is supported by your device operating system.

- If this is a custom font, be sure to load it with Font.loadAsync.
RCTText
</code>```

I have tried re installing react-native-vector-icons and deleted node-modules all to no avail.

this is where i load the icons

```<code>import MateriaCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons'

render() {
return (
  <Tab.Navigator
  activeColor="green"
  inactiveColor="black"
  barStyle={{ backgroundColor: 'white' }}
  initialRouteName='Home'
  >

  <Tab.Screen name="Home" component={HomeScreen} options={{
    title: 'home',
    tabBarIcon: ({ color, size }) => (
       <MateriaCommunityIcons name='home-outline' color={color} size={26} />
    ),
  }} />

  <Tab.Screen name="Orders" component={OrderScreen} options={{
    hederTitle: 'Orders',
    tabBarIcon: ({ color, size }) => (
       <MateriaCommunityIcons name='cart-arrow-down' color={color} size={26}
/>
    ),
  }} />

<Tab.Screen name="Search" component={SearchScreen} navigation={this.props.navigation} options={{
    hederTitle: 'Search',
    tabBarIcon: ({ color, size }) => (
       <MateriaCommunityIcons name='magnify' color={color} size={26} />
    ),
  }} />

  <Tab.Screen name="Acount" component={AcountScreen} options={{ title:'Account',
    tabBarIcon: ({ color, size }) => (
       <MateriaCommunityIcons name='account-circle-outline' color={color} size={26} />
    ),
  }} />

</Tab.Navigator>
)
  }
}
</code>```

I'm confused because it was working and suddenly stopped and i think i have made some wrong changes.

Body:
I am kind of new to react native and i have been practicing with some codes but i just encountered an error that i have been trying to solve for days. In my app I'm displaying bottom navigation with some icons and it was working initially until it suddenly stopped loading icons with these errors in the terminal

 ERROR  fontFamily "Material Design Icons" is not a system font and has not been loaded through Font.loadAsync.

- If you intended to use a system font, make sure you typed the name correctly and that it is supported by your device operating system.

- If this is a custom font, be sure to load it with Font.loadAsync.
RCTText

I have tried re installing react-native-vector-icons and deleted node-modules all to no avail.

this is where i load the icons

import MateriaCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons'

render() {
return (
  <Tab.Navigator
  activeColor="green"
  inactiveColor="black"
  barStyle={{ backgroundColor: 'white' }}
  initialRouteName='Home'
  >

  <Tab.Screen name="Home" component={HomeScreen} options={{
    title: 'home',
    tabBarIcon: ({ color, size }) => (
       <MateriaCommunityIcons name='home-outline' color={color} size={26} />
    ),
  }} />

  <Tab.Screen name="Orders" component={OrderScreen} options={{
    hederTitle: 'Orders',
    tabBarIcon: ({ color, size }) => (
       <MateriaCommunityIcons name='cart-arrow-down' color={color} size={26}
/>
    ),
  }} />

<Tab.Screen name="Search" component={SearchScreen} navigation={this.props.navigation} options={{
    hederTitle: 'Search',
    tabBarIcon: ({ color, size }) => (
       <MateriaCommunityIcons name='magnify' color={color} size={26} />
    ),
  }} />

  <Tab.Screen name="Acount" component={AcountScreen} options={{ title:'Account',
    tabBarIcon: ({ color, size }) => (
       <MateriaCommunityIcons name='account-circle-outline' color={color} size={26} />
    ),
  }} />

</Tab.Navigator>
)
  }
}

I'm confused because it was working and suddenly stopped and i think i have made some wrong changes.


问:
Why does Python on different computers have different issues with relative imports
I am using python and I created a simple way to write HTML and output the file. I developed this module on 2 computers in which on the main one I could use the following according to the directory tree:

```<code>Pypertext:
   html.py
   widget.py
   htmlHeader.py
   htmlTitle.py
   htmlButton.py
</code>```

This is the folder of the module that can be imported using:

```<code>from pyperclip.htmlHeader import Header
</code>```

although in htmlHeader.py I have the following import:

```<code>from widget import baseWidget
</code>```

This runs fine on my computer but when I go to the secondary computer I get an error and I fixed by:

```<code>from .widget import baseWidget
</code>```

On my main computer I get an error for the attempted relative import and I feel that in the module script it should not have to be a lot of try except statements to make it work.
I use python 3.10

Body:
I am using python and I created a simple way to write HTML and output the file. I developed this module on 2 computers in which on the main one I could use the following according to the directory tree:

Pypertext:
   html.py
   widget.py
   htmlHeader.py
   htmlTitle.py
   htmlButton.py

This is the folder of the module that can be imported using:

from pyperclip.htmlHeader import Header

although in htmlHeader.py I have the following import:

from widget import baseWidget

This runs fine on my computer but when I go to the secondary computer I get an error and I fixed by:

from .widget import baseWidget

On my main computer I get an error for the attempted relative import and I feel that in the module script it should not have to be a lot of try except statements to make it work.
I use python 3.10


问:
How to change the background of input field with text (django form)?
I am building a form so when the button is clicked the function starts. So basically if the condition is True --> green, otherwise if False --> Red

```<code>    function check() {
        let correctAnswer = '{{ correct_answer }}';
        let givenAnswer = document.getElementById('correct_answer').value;
        let exerciseForm = document.getElementById('form');
        let form = document.getElementById('correct_answer');

        if (givenAnswer === correctAnswer) {
            exerciseForm.style.backgroundColor = 'rgb(76, 234, 76)';
            form.style.backgroundColor = 'rgb(76, 234, 76)';
        } else if (givenAnswer != correctAnswer) {
            exerciseForm.style.backgroundColor = 'rgb(245, 69, 69)';
            form.style.backgroundColor = 'rgb(245, 69, 69)';
        }
    };
</code>```

{{ sentence }} {{ form.correct_answer }}

When I don't enter any text it seems to work.

When I fill in some text it doesn't work any more.

Body:
I am building a form so when the button is clicked the function starts. So basically if the condition is True --> green, otherwise if False --> Red

    function check() {
        let correctAnswer = '{{ correct_answer }}';
        let givenAnswer = document.getElementById('correct_answer').value;
        let exerciseForm = document.getElementById('form');
        let form = document.getElementById('correct_answer');

        if (givenAnswer === correctAnswer) {
            exerciseForm.style.backgroundColor = 'rgb(76, 234, 76)';
            form.style.backgroundColor = 'rgb(76, 234, 76)';
        } else if (givenAnswer != correctAnswer) {
            exerciseForm.style.backgroundColor = 'rgb(245, 69, 69)';
            form.style.backgroundColor = 'rgb(245, 69, 69)';
        }
    };

{{ sentence }} {{ form.correct_answer }}

When I don't enter any text it seems to work.

When I fill in some text it doesn't work any more.


问:
How to set a header in Puppeteer and access it using Angular in the newly opened browser?
I try to open a browser and pass a costume header using Puppeteer in the Node.js server:

```<code>const browser = await puppeteer.launch({"headless": false});
const page = await browser.newPage();
await page.setExtraHTTPHeaders({
  'id':id});
await page.goto('http://localhost:4200/PDF');
const pdf = await page.pdf(options);
</code>```

Now I want to use this 'id' header in the opened browser to retrieve data from a database, based on that ID.
An interceptor I used made it possible to access the header only on the page which triggers the Puppeteer
How can I access it in the http://localhost:4200/PDF too?

Body:
I try to open a browser and pass a costume header using Puppeteer in the Node.js server:

const browser = await puppeteer.launch({"headless": false});
const page = await browser.newPage();
await page.setExtraHTTPHeaders({
  'id':id});
await page.goto('http://localhost:4200/PDF');
const pdf = await page.pdf(options);

Now I want to use this 'id' header in the opened browser to retrieve data from a database, based on that ID.
An interceptor I used made it possible to access the header only on the page which triggers the Puppeteer
How can I access it in the http://localhost:4200/PDF too?


问:
a parameter keep being a defualt value even when i give it a real value
```<code>def list_manipulation(a_list,command,location,value=None):
    if value:
        if command == 'add' and location== 'beginning':
            return a_list.insert(0,value)
        elif command == 'add' and location == 'end':
            return a_list.append(value)
    elif command == 'remove'.lower() and location == 'end'.lower():
        return a_list.pop()
    elif command == 'remove'.lower() and location== 'beginning'.lower():
        return a_list.pop(0)

print(list_manipulation([23,2,7], 'add', 'end',23))
</code>```

when i print i always get None even when i give a real value to my 'value' parameter, i tried to change the if but no luck, im going crazy !

Body:
def list_manipulation(a_list,command,location,value=None):
    if value:
        if command == 'add' and location== 'beginning':
            return a_list.insert(0,value)
        elif command == 'add' and location == 'end':
            return a_list.append(value)
    elif command == 'remove'.lower() and location == 'end'.lower():
        return a_list.pop()
    elif command == 'remove'.lower() and location== 'beginning'.lower():
        return a_list.pop(0)

print(list_manipulation([23,2,7], 'add', 'end',23))

when i print i always get None even when i give a real value to my 'value' parameter, i tried to change the if but no luck, im going crazy !


问:
Security and encryption of passwords for multiple login automation using Selenium in Java
I am currently developing a web automation system that helps me know how mutch money I have on different web pages I use. The problem is that I made selenium read a file with all the passwords for each webpage. This is because i am opening one webdriver, loging in a page, getting the data i need and going to the next row of the passwords file. More clearly: it is a for loop that runs over each of the web pages (rows of the file) and for each web page there is a different user and password.

My question is the following: How can I mantain security over my passwords. Encrypting the file has to be a priority since its saved locally and if someone has local access to my computer all my passwords are leaked. Also inside of selenium, I supose thet whenever it reads a password from the file and uses it, it does it without beeing secure, so incercepting processes (I supose this is possible) could also leak passwords. Is there any way of avoiding this threads? I dont mind changing the thought process behind the application if there is no way of having it secure with this way of working.

PD: I still have to develop almost all the application so this part is not implemented. By the time i have to implement it I want to do it safely.


问:
mT5 transformer, how to access encoder to compute cosine similarity
this is my method, my question is how to access the encoder be sending 2 sentences each time? because I have a dataset that contain pairs of sentences, and I need to compute the similarity between each pair.

//anyone could help?

```<code>model = SentenceTransformer('paraphrase-MiniLM-L6-v2')

#Sentences we want to encode. Example:
sentence = ['This framework generates embeddings   for each input sentence']
sentence1 = ['This is an embedding for framework generation']

#Sentences are encoded by calling
embedding = model.encode(sentence)
embedding1 = model.encode(sentence1)
e = np.squeeze(np.asarray(embedding))

e1 = np.squeeze(np.asarray(embedding1))

#calculate Cosine Similarity
cos_sim = dot(e, e1)/(norm(e)*norm(e1))
print(cos_sim)
</code>```

Body:
this is my method, my question is how to access the encoder be sending 2 sentences each time? because I have a dataset that contain pairs of sentences, and I need to compute the similarity between each pair.

//anyone could help?

model = SentenceTransformer('paraphrase-MiniLM-L6-v2')

#Sentences we want to encode. Example:
sentence = ['This framework generates embeddings   for each input sentence']
sentence1 = ['This is an embedding for framework generation']

#Sentences are encoded by calling
embedding = model.encode(sentence)
embedding1 = model.encode(sentence1)
e = np.squeeze(np.asarray(embedding))

e1 = np.squeeze(np.asarray(embedding1))

#calculate Cosine Similarity
cos_sim = dot(e, e1)/(norm(e)*norm(e1))
print(cos_sim)


问:
how to use Property for type mapping in ElasticSearch
Prior to Elasticsearch 8, I would create type mappings for an index like this (using the Java Client API from Kotlin)...

```<code>val mappings_before = mapOf(
        "properties" to mapOf(
                "someKeywordField" to mapOf(
                        "type" to "keyword"
                ),
                "someTextField" to mapOf(
                        "type" to "text"
                ),
                "someLongField" to mapOf(
                        "type" to "long"
                ),
                "someBooleanField" to mapOf(
                        "type" to "boolean"
                ),
        )
)
</code>```

Now, ElasticSearch 8 (I'm using 8.5.3) requires a map of Property objects.

```<code>val mappings_after = mapOf(
        "someKeywordField" to Property.of { p -> p.keyword { x -> x } },
        "someTextField" to Property.of { p -> p.text { x -> x } },
        "someLongField" to Property.of { p -> p.long_ { x -> x } },
        "someBooleanField" to Property.of { p -> p.boolean_ { x -> x } },
)
</code>```

I just get the feeling I'm missing something, because that looks like more boilerplate than should be necessary.

What is the best way to create type mappings now?

Body:
Prior to Elasticsearch 8, I would create type mappings for an index like this (using the Java Client API from Kotlin)...

val mappings_before = mapOf(
        "properties" to mapOf(
                "someKeywordField" to mapOf(
                        "type" to "keyword"
                ),
                "someTextField" to mapOf(
                        "type" to "text"
                ),
                "someLongField" to mapOf(
                        "type" to "long"
                ),
                "someBooleanField" to mapOf(
                        "type" to "boolean"
                ),
        )
)

Now, ElasticSearch 8 (I'm using 8.5.3) requires a map of Property objects.

val mappings_after = mapOf(
        "someKeywordField" to Property.of { p -> p.keyword { x -> x } },
        "someTextField" to Property.of { p -> p.text { x -> x } },
        "someLongField" to Property.of { p -> p.long_ { x -> x } },
        "someBooleanField" to Property.of { p -> p.boolean_ { x -> x } },
)

I just get the feeling I'm missing something, because that looks like more boilerplate than should be necessary.

What is the best way to create type mappings now?


问:
How to run existing webservice of maven Eclipse-project in Intellij
I am new to intelije and I had a maven project in Eclpse which worked fine. I migrated to Itellij, I can build project using maven and run it in Tomcat server 8 and evrythings look fine till I tried to call Webservice using SOAPUI and then i get into the problem , when I call my webservice?wsdl or try to send a request using SOAPUI, I see nothing ! just a white blankpage .... no error , no "page not found" ... nothing ?  ( jax-ws libraries are loaded by maven)
have you any suggestion for me to solve this problem?
I noticed one more thing and that is, when I open my webapp in two diffrent browses , i can only see in the first browser that I opened, and the other browser shows nothig ( again a whit blank page) It seems that I can run the app only once at the same time. but as I used Eclipse I opened the app at the same time in at least 3 diffrent browsers to compare the GUI at the same time!
thanks in advance for your efforts</p>


问:
Do you have to run HLK against every target OS?
Since cross-signing is no longer available, I was going to try this HLK method for the old OSes (WinVista/7/8/8.1, server 2003, 2008, 2008r2, etc.. basically all those in that generation).  Does that mean I have to run against every os in every flavor (x64 / x86), that is a lot of OS installs and nowadays a pain since you can't get an updates.  When first creating it you simply tested on the new OS that was going to be released and had years or two in between.</p>


问:
LDAP API Error: Server is unwilling to perform
I can get list of usernames, unlock users, verify username/password, get days to expire for a password, but I cannot change the frigging password. Why not?</p>
```<code>public function changePassword(string $username, string $current_password, string $password): bool
  {
    $result = false;

    $connection = ldap_connect('ldaps://' . self::HOST . ':' . self::PORT);
    if ($connection) {
      ldap_set_option($connection, LDAP_OPT_PROTOCOL_VERSION, 3);
      ldap_set_option($connection, LDAP_OPT_REFERRALS, 0);
      ldap_set_option(null, LDAP_OPT_DEBUG_LEVEL, 7);
      if (@ldap_bind($connection, "uid=$username,ou=people,dc=bsg.na.baesystems,dc=com", $current_password)) {
        //$userpassword = '{MD5}' . hash('md5', $password);
        $userpassword = '{sha256}' . base64_encode(hash('sha256', $password, true));
        //$userpassword = '{sha384}' . base64_encode(hash('sha384', $password, true));
        $result = @ldap_mod_replace($connection, "uid=$username,ou=people,dc=bsg.na.baesystems.com,dc=com", [
          'userpassword' => $userpassword
        ]);
      }
    }

    if (!$result)
      log_message('error', __METHOD__ . "\n" . ldap_error($connection));

    return $result;
  }
</code>```

Body:
I can get list of usernames, unlock users, verify username/password, get days to expire for a password, but I cannot change the frigging password. Why not?

public function changePassword(string $username, string $current_password, string $password): bool
  {
    $result = false;

    $connection = ldap_connect('ldaps://' . self::HOST . ':' . self::PORT);
    if ($connection) {
      ldap_set_option($connection, LDAP_OPT_PROTOCOL_VERSION, 3);
      ldap_set_option($connection, LDAP_OPT_REFERRALS, 0);
      ldap_set_option(null, LDAP_OPT_DEBUG_LEVEL, 7);
      if (@ldap_bind($connection, "uid=$username,ou=people,dc=bsg.na.baesystems,dc=com", $current_password)) {
        //$userpassword = '{MD5}' . hash('md5', $password);
        $userpassword = '{sha256}' . base64_encode(hash('sha256', $password, true));
        //$userpassword = '{sha384}' . base64_encode(hash('sha384', $password, true));
        $result = @ldap_mod_replace($connection, "uid=$username,ou=people,dc=bsg.na.baesystems.com,dc=com", [
          'userpassword' => $userpassword
        ]);
      }
    }

    if (!$result)
      log_message('error', __METHOD__ . "\n" . ldap_error($connection));

    return $result;
  }


问:
Building Action Based Messaging Extension using Bot Framework and without ngrock
What is the best way to build Teams messaging extension using the bot framework without ngrock. My organization is not even allowing me to use it for testing or development. My web search pointed me to Azure Service Bus, Azure Relay and a dedicated NGINX Linux server with public IP. Just wanted to know what would be the ideal way and the costs associated it if someone has already developed an app?</p>


问:
ValueErroR: rename: embedded null character indst
Anybody have any idea on how to fix the error?
Here is my code:

```<code>import os
key = "12"
path = "C:\\Users\\User\\Desktop\\test"
os.chdir(path)
for a, b, files in os.walk(path):

    for file in files:
        Encoded = ""
        filesize = os.path.getsize(file)
        if filesize > 2000000 and file.split(".")[-1] == "pdf" or file.split(".")[-1] == "docx":
            LenFileName = len(file)
            for index in range(LenFileName):
                char = file[index]
                kelid = key[index % len(key)]
                Encoded += chr(ord(char) ^ ord(kelid))
            os.rename(file,Encoded)
</code>```

The error is following:

```<code>Traceback (most recent call last):
  File "E:\project\python\namecoder\namecoder.py", line 16, in <module>
    os.rename(file,Encoded)
ValueError: rename: embedded null character in dst
</code>```

Body:
Anybody have any idea on how to fix the error?
Here is my code:

import os
key = "12"
path = "C:\\Users\\User\\Desktop\\test"
os.chdir(path)
for a, b, files in os.walk(path):

    for file in files:
        Encoded = ""
        filesize = os.path.getsize(file)
        if filesize > 2000000 and file.split(".")[-1] == "pdf" or file.split(".")[-1] == "docx":
            LenFileName = len(file)
            for index in range(LenFileName):
                char = file[index]
                kelid = key[index % len(key)]
                Encoded += chr(ord(char) ^ ord(kelid))
            os.rename(file,Encoded)

The error is following:

Traceback (most recent call last):
  File "E:\project\python\namecoder\namecoder.py", line 16, in <module>
    os.rename(file,Encoded)
ValueError: rename: embedded null character in dst


问:
Keycloak user registration in UI gives me a Invalid username or password
First I have activated the the user registration on the keycloak admin panel

I try to create a new account with an unique email and username

This shows up after I click register:

In console it is this printed:

```<code>2023-01-06 00:39:50 2023-01-05 23:39:50,440 WARN  [org.keycloak.events] (executor-thread-34) type=REGISTER_ERROR, realmId=keycloak-react-auth, clientId=account-console, userId=null, ipAddress=172.17.0.1, error=invalid_user_credentials, auth_method=openid-connect, auth_type=code, redirect_uri=http://localhost:8080/realms/keycloak-react-auth/account/#/,, code_id=c8dccb6d-1ca4-4f25-b160-9b72d48bffd1, authSessionParentId=c8dccb6d-1ca4-4f25-b160-9b72d48bffd1, authSessionTabId=gY0TRMYd8aw
</code>```

Body:
First I have activated the the user registration on the keycloak admin panel

I try to create a new account with an unique email and username

This shows up after I click register:

In console it is this printed:

2023-01-06 00:39:50 2023-01-05 23:39:50,440 WARN  [org.keycloak.events] (executor-thread-34) type=REGISTER_ERROR, realmId=keycloak-react-auth, clientId=account-console, userId=null, ipAddress=172.17.0.1, error=invalid_user_credentials, auth_method=openid-connect, auth_type=code, redirect_uri=http://localhost:8080/realms/keycloak-react-auth/account/#/,, code_id=c8dccb6d-1ca4-4f25-b160-9b72d48bffd1, authSessionParentId=c8dccb6d-1ca4-4f25-b160-9b72d48bffd1, authSessionTabId=gY0TRMYd8aw


问:
Easiest method on How to integrate a football livescore updates to a Facebook page automatically
Please how do I update football Livescores automatically to my Facebook page.

For e.g when a goal is scored in a particular match. The goal scorer and time will be posted on my Facebook page

I tried using an APi but I couldn't make it work


问:
Error when I try enabling all origins for CORS
I have enabled CORS to allow all origins, however when I try login, it will produce an error stating. I tried '.allowedOriginPatterns("*")''' however same outcome. I am able to individually add each origin pattern however I want to know how to do all.

Messages:1 Access to XMLHttpRequest at 'http://localhost:8080/users' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Code:

```<code>@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**")
                .allowedOriginPatterns(".*")
                .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
                .allowCredentials(true);
    }

}

'''
</code>```

Body:
I have enabled CORS to allow all origins, however when I try login, it will produce an error stating. I tried '.allowedOriginPatterns("*")''' however same outcome. I am able to individually add each origin pattern however I want to know how to do all.

Messages:1 Access to XMLHttpRequest at 'http://localhost:8080/users' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Code:

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**")
                .allowedOriginPatterns(".*")
                .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
                .allowCredentials(true);
    }

}

'''


问:
reauthenticateWithCredential returns "Invalid id_token in IdP response"
I am trying to delete a user account on Firebase.

As long as I am logged in as a user with email/pw - everything is fine, because I can use EmailAuthProvider.credential(email, pw) , but if I am a Google User, it returns "wrong password".

Thats why I tried:

```<code>const oAuthCredential = GoogleAuthProvider.credential(await user.getIdToken(true));
user.reauthenticateWithCredential(oAuthCredential)
</code>```

But that returns "Invalid id_token in IdP response" unfortunately.

user.reauthenticateWithPopup(new GoogleAuthProvider()) on the other hand works, but that destroys the user flow.

I would like to go with either a password from the user or with a refresh token. Is there someone who can help me with that?

Body:
I am trying to delete a user account on Firebase.

As long as I am logged in as a user with email/pw - everything is fine, because I can use EmailAuthProvider.credential(email, pw) , but if I am a Google User, it returns "wrong password".

Thats why I tried:

const oAuthCredential = GoogleAuthProvider.credential(await user.getIdToken(true));
user.reauthenticateWithCredential(oAuthCredential)

But that returns "Invalid id_token in IdP response" unfortunately.

user.reauthenticateWithPopup(new GoogleAuthProvider()) on the other hand works, but that destroys the user flow.

I would like to go with either a password from the user or with a refresh token. Is there someone who can help me with that?


问:
Tradingview Webhooks in R
There is a popular trading program called TradingView that among other things can create alerts when certain conditions are met. I wonder if there is any functionality in R that one can use to process the information of such alerts?

I thought about sending the alerts to an email account and having R read the email, and use different R functions to parse out the message, into the data needed in R. This option although viable suffered from a long delay getting the emails.

I read there is also a capability of having tradingview send the alerts to a webhook, from where R can process the data. This appears are cleaner approach but not yet found any information of such capability in R. Is there any R package that can do this? or a tutorial?

Title: Tradingview Webhooks in R


问:
how to remove dll from visual studio project
I have a large game project in visual studio. There are a bunch of guides online on how to find what dlls your exe loads, such as the visual studio modules tab, and they show that my exe is loading a dll that it shouldn't. How do I find out what code file(s) or setting(s) is causing my project to load that dll so I can fix it? My previous searches only show how to tell WHICH dlls my project loads, and not WHY my project is loading a specific dll.</p>


问:
How to set up MASTER_PORT and MASTER_ADDR in slurm
In torch’s official documentation that talks about DDP, it said to set it as the following:

```<code>def setup(rank, world_size):
    os.environ['MASTER_ADDR'] = 'localhost'
    os.environ['MASTER_PORT'] = '12355'
</code>```

and now I am using slurm to submit sbatch jobs, in this tutorial provided by Princeton University:
https://github.com/PrincetonUniversity/multi_gpu_training/tree/main/02_pytorch_ddp
it has the following setup:

```<code>export MASTER_PORT=$(expr 10000 + $(echo -n $SLURM_JOBID | tail -c 4))
master_addr=$(scontrol show hostnames "$SLURM_JOB_NODELIST" | head -n 1)
export MASTER_ADDR=$master_addr
echo "MASTER_ADDR="$MASTER_ADDR
</code>```

But it seems even if I just keep the master_addr to localhost and master_port to 12355, and then submit it to slurm, it can still run.

Can anyone explain it a little bit more? For example, where does “12355” comes from , can it be random?

Thanks!

Body:
In torch’s official documentation that talks about DDP, it said to set it as the following:

def setup(rank, world_size):
    os.environ['MASTER_ADDR'] = 'localhost'
    os.environ['MASTER_PORT'] = '12355'

and now I am using slurm to submit sbatch jobs, in this tutorial provided by Princeton University:
https://github.com/PrincetonUniversity/multi_gpu_training/tree/main/02_pytorch_ddp
it has the following setup:

export MASTER_PORT=$(expr 10000 + $(echo -n $SLURM_JOBID | tail -c 4))
master_addr=$(scontrol show hostnames "$SLURM_JOB_NODELIST" | head -n 1)
export MASTER_ADDR=$master_addr
echo "MASTER_ADDR="$MASTER_ADDR

But it seems even if I just keep the master_addr to localhost and master_port to 12355, and then submit it to slurm, it can still run.

Can anyone explain it a little bit more? For example, where does “12355” comes from , can it be random?

Thanks!


问:
Search for "this" or "not" with Hibernate Search / Lucene
Is it possible to search for words "this" and "not" with Hibernate Search using Lucene as a search engine?
Today I added in my web catalog of products a product called Shhh This Is Not Milk. The only two words that Lucene accepts are "Shhh" and "Milk" and other 3 words are ignored. If I put "Shhh" as a search word, it can be found and also if I put "Alpro Milk" as a search words, it can be found (one of many). But if I put "This" or "Not" or "This Is" or "This Is Not" or "This Not" or "Not Milk" - I'm getting no results.
I am aware those are special words but how to avoid this behaviour?

While building a search query I use AND operator between search words.

Hibernate is version 5, Spring Boot is version 2.7.7, Java is 18, the database is MySQL.


问:
Bubbling Event from Child Component to the Grand Parent in React
I have a React app with the following structure:

```<code>App -> ProductList -> ProductItemRow
</code>```

The App component is responsible for fetching all the products and then passing it to the ProductList to display. ProductList calls ProductItemRow for each product. ProductItemRow is responsible for displaying each single product on the screen.

The implementation is shown below (The complete app):

```<code>function ProductItemRow(props) {
  const product = props.product

  return (
    <li>{product.title} <button onClick = {() => props.deleteProductItem(product)}>Delete</button></li>
  )
}

function ProductList(props) {

  const products = props.products
  const productItems = products.map(product => {
    return <ProductItemRow key = {product.id} product = {product}
    deleteProductItem = {props.deleteProductItem}
    />
  })

  return (
      <>
      <h1>Product List</h1>
      {productItems}
      </>
  )
}

function App() {

  const [products, setProducts] = useState([])

  const fetchProducts = async () => {
    const response = await fetch('https://api.escuelajs.co/api/v1/products')
    const products = await response.json()
    return products
  }

  const deleteProductItem = (product) => {
    console.log('FOO')
    console.log(product)
  }

  useEffect(() => {

    (async () => {
      const products = await fetchProducts()
    setProducts(products)
    })()

  }, [])

  return (
    <>
      <ProductList products = {products} deleteProductItem = {deleteProductItem} />
    </>
  );
}
</code>```

I want to make my ProductList and ProductItemRow reusable so they don't delete the item. ProductItemRow uses a callback to send it up to the ProductList. The ProductList sends it up to the App component and that is where we can delete it.

As you can see that is quite a bit of callbacks to get it to the grand parent. I am wondering if there is a better way to handle this situation. I can use the global state  but using global state inside the ProductList and ProductItemRow will again make it less reusable component.

Any ideas?

Body:
I have a React app with the following structure:

App -> ProductList -> ProductItemRow

The App component is responsible for fetching all the products and then passing it to the ProductList to display. ProductList calls ProductItemRow for each product. ProductItemRow is responsible for displaying each single product on the screen.

The implementation is shown below (The complete app):

function ProductItemRow(props) {
  const product = props.product

  return (

{product.title} <button onClick = {() => props.deleteProductItem(product)}>Delete</button>

  )
}

function ProductList(props) {

  const products = props.products
  const productItems = products.map(product => {
    return <ProductItemRow key = {product.id} product = {product}
    deleteProductItem = {props.deleteProductItem}
    />
  })

  return (
      <>

Product List

      {productItems}
      </>
  )
}

function App() {

  const [products, setProducts] = useState([])

  const fetchProducts = async () => {
    const response = await fetch('https://api.escuelajs.co/api/v1/products')
    const products = await response.json()
    return products
  }

  const deleteProductItem = (product) => {
    console.log('FOO')
    console.log(product)
  }

  useEffect(() => {

    (async () => {
      const products = await fetchProducts()
    setProducts(products)
    })()

  }, [])

  return (
    <>
      <ProductList products = {products} deleteProductItem = {deleteProductItem} />
    </>
  );
}

I want to make my ProductList and ProductItemRow reusable so they don't delete the item. ProductItemRow uses a callback to send it up to the ProductList. The ProductList sends it up to the App component and that is where we can delete it.

As you can see that is quite a bit of callbacks to get it to the grand parent. I am wondering if there is a better way to handle this situation. I can use the global state  but using global state inside the ProductList and ProductItemRow will again make it less reusable component.

Any ideas?


问:
Vertically aligning variable size text with NeoDynamic ThermalLabel SDK
I'm creating a shipping label with NeoDynamic.SDK.ThermalLabel version 12. I'm trying to print out the following line:

(minus the colored background)

The line has 3 different segments, each one with its own font size. The first 4 digits are defined as 24pt bold, the rest of the digits are 16pt, and the "x" at the end is 16pt bold. As you can see all 3 segments are aligned on the bottom.

My problem is I can't find a way to do the bottom alignment efficiently. The TextItem object from the NeoDynamic library allows horizontal alignment of text, (left/right/center) but it doesn't provide the option to align the text vertically. From experimenting with different sizing (while having the border visible) it seems that the text is always offset from the top (regardless of the object's size) and this offset is proportionate to the font size.

The SDK documentation mentions support for rich text formatting, so I thought I'd stick it all into one text item, and just define font sizes for each segment via rich text markup. But sadly only bold, italic and underline is supported. No variable font size it seems.

Right now the only option I have is to manually adjust the vertical offset of the two TextItem objects, little by little, until the texts are aligned (or close enough). This is a suboptimal solution, because if a request ever comes to change the font type or font sizes, I'll have to do the manual aligning all over again.

Is there a better way to do this? Or at least a formula that would allow me to calculate the correct offset based on the relative font sizes?


问:
Can wasm-pack compile a rust project including C++ code that uses stdlib?
I am trying to compile a rust project into WebAssembly with wasm-pack. One of its dependencies is a rust wrapper around C++ code. This dependency can, on its own, be successfully compiled to WebAssembly with Emscripten. However if I try to compile my project or the dependency itself with wasm-pack I get the following error:

```<code>  running: "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-I" "src" "-Wall" "
-Wextra" "-o" "/home/ahelwer/src/tlaplus/tree-sitter-tlaplus/target/wasm32-unknown-unknown/release/build/tree-sitter-tlaplus-90
d9bfea3134c6dd/out/src/parser.o" "-c" "src/parser.c"
  cargo:warning=In file included from src/parser.c:1:
  cargo:warning=src/tree_sitter/parser.h:10:10: fatal error: 'stdlib.h' file not found
  cargo:warning=#include <stdlib.h>
  cargo:warning=         ^~~~~~~~~~
  cargo:warning=1 error generated.
  exit status: 1
</code>```

So it can't find libc. I know Emscripten includes the ability to link programs against the libc (based on musl) it comes with. Does wasm-pack also have this ability? Do you have to modify the build.rs file of the native dependency in some way?

Body:
I am trying to compile a rust project into WebAssembly with wasm-pack. One of its dependencies is a rust wrapper around C++ code. This dependency can, on its own, be successfully compiled to WebAssembly with Emscripten. However if I try to compile my project or the dependency itself with wasm-pack I get the following error:

  running: "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-I" "src" "-Wall" "
-Wextra" "-o" "/home/ahelwer/src/tlaplus/tree-sitter-tlaplus/target/wasm32-unknown-unknown/release/build/tree-sitter-tlaplus-90
d9bfea3134c6dd/out/src/parser.o" "-c" "src/parser.c"
  cargo:warning=In file included from src/parser.c:1:
  cargo:warning=src/tree_sitter/parser.h:10:10: fatal error: 'stdlib.h' file not found
  cargo:warning=#include <stdlib.h>
  cargo:warning=         ^~~~~~~~~~
  cargo:warning=1 error generated.
  exit status: 1

So it can't find libc. I know Emscripten includes the ability to link programs against the libc (based on musl) it comes with. Does wasm-pack also have this ability? Do you have to modify the build.rs file of the native dependency in some way?


问:
Why the Code Bloat When Doing Arithmetic in C# Generic Class Using IBinaryArithmetic
I'm trying to be clever and use a generic class to perform the same arithmetic function across multiple data types with C# and .NET 7.  I noticed a significant performance hit and, in looking at the generated code, see that the arithmetic operators * and + are replaced by calls instead of using native imul and add instructions.  Can someone enlighten me on why this is happening, and if there is any way around the problem?

Source and disassembly code follow...

C# Source Code

```<code>using System.Numerics;

namespace ConsoleApp27 {

    internal class Program {
        static void Main(string[] args) {
            var UIntInstance = new UIntClass(1, 1, 1);
            var ULongInstance = new ULongClass(1, 1, 1);
            var UInstance = new UClass<ulong>(1, 1, 1);
            UIntInstance.Step();
            ULongInstance.Step();
            UInstance.Step();
        }
    }

    public class UIntClass {
        public uint State;
        public uint Multiplier;
        public uint Increment;
        public UIntClass(uint state, uint multiplier, uint increment) {
            State = state;
            Multiplier = multiplier;
            Increment = increment;
        }
        public void Step() {
            State = State * Multiplier + Increment;
        }
    }

    public class ULongClass {
        public ulong State;
        public ulong Multiplier;
        public ulong Increment;
        public ULongClass(ulong state, ulong multiplier, ulong increment) {
            State = state;
            Multiplier = multiplier;
            Increment = increment;
        }
        public void Step() {
            State = State * Multiplier + Increment;
        }
    }

    public class UClass<T> where T : IBinaryInteger<T> {
        public T State;
        public T Multiplier;
        public T Increment;
        public UClass(T state, T multiplier, T increment) {
            State = state;
            Multiplier = multiplier;
            Increment = increment;
        }
        public void Step() {
            State = State * Multiplier + Increment;
        }
    }

}
</code>```

Disassembly of (guts of) UIntClass Step() function

```<code>00007FFADD1A795D  mov         rax,qword ptr [rbp+10h]
00007FFADD1A7961  mov         eax,dword ptr [rax+8]
00007FFADD1A7964  mov         rdx,qword ptr [rbp+10h]
00007FFADD1A7968  imul        eax,dword ptr [rdx+0Ch]
00007FFADD1A796C  mov         rdx,qword ptr [rbp+10h]
00007FFADD1A7970  add         eax,dword ptr [rdx+10h]
00007FFADD1A7973  mov         rdx,qword ptr [rbp+10h]
00007FFADD1A7977  mov         dword ptr [rdx+8],eax
</code>```

Disassembly of (guts of) ULongClass Step() function

```<code>00007FFADD19902D  mov         rax,qword ptr [rbp+10h]
00007FFADD199031  mov         rax,qword ptr [rax+8]
00007FFADD199035  mov         rdx,qword ptr [rbp+10h]
00007FFADD199039  imul        rax,qword ptr [rdx+10h]
00007FFADD19903E  mov         rdx,qword ptr [rbp+10h]
00007FFADD199042  add         rax,qword ptr [rdx+18h]
00007FFADD199046  mov         rdx,qword ptr [rbp+10h]
00007FFADD19904A  mov         qword ptr [rdx+8],rax
</code>```

Disassembly of (guts of) UClass Step() function

```<code>00007FFADD1C9093  mov         rcx,qword ptr [rbp+10h]
00007FFADD1C9097  mov         qword ptr [rbp-10h],rcx
00007FFADD1C909B  mov         rcx,qword ptr [rbp+10h]
00007FFADD1C909F  mov         rcx,qword ptr [rcx+8]
00007FFADD1C90A3  mov         rdx,qword ptr [rbp+10h]
00007FFADD1C90A7  mov         rdx,qword ptr [rdx+10h]
00007FFADD1C90AB  call        qword ptr [CLRStub[MethodDescPrestub]@00007FFADD183978 (07FFADD183978h)]
00007FFADD1C90B1  mov         qword ptr [rbp-18h],rax
00007FFADD1C90B5  mov         rdx,qword ptr [rbp+10h]
00007FFADD1C90B9  mov         rdx,qword ptr [rdx+18h]
00007FFADD1C90BD  mov         rcx,qword ptr [rbp-18h]
00007FFADD1C90C1  call        qword ptr [CLRStub[MethodDescPrestub]@00007FFADD1835A0 (07FFADD1835A0h)]
00007FFADD1C90C7  mov         qword ptr [rbp-20h],rax
00007FFADD1C90CB  mov         rax,qword ptr [rbp-10h]
00007FFADD1C90CF  mov         rdx,qword ptr [rbp-20h]
00007FFADD1C90D3  mov         qword ptr [rax+8],rdx
</code>```

Body:
I'm trying to be clever and use a generic class to perform the same arithmetic function across multiple data types with C# and .NET 7.  I noticed a significant performance hit and, in looking at the generated code, see that the arithmetic operators * and + are replaced by calls instead of using native imul and add instructions.  Can someone enlighten me on why this is happening, and if there is any way around the problem?

Source and disassembly code follow...

C# Source Code

using System.Numerics;

namespace ConsoleApp27 {

    internal class Program {
        static void Main(string[] args) {
            var UIntInstance = new UIntClass(1, 1, 1);
            var ULongInstance = new ULongClass(1, 1, 1);
            var UInstance = new UClass<ulong>(1, 1, 1);
            UIntInstance.Step();
            ULongInstance.Step();
            UInstance.Step();
        }
    }

    public class UIntClass {
        public uint State;
        public uint Multiplier;
        public uint Increment;
        public UIntClass(uint state, uint multiplier, uint increment) {
            State = state;
            Multiplier = multiplier;
            Increment = increment;
        }
        public void Step() {
            State = State * Multiplier + Increment;
        }
    }

    public class ULongClass {
        public ulong State;
        public ulong Multiplier;
        public ulong Increment;
        public ULongClass(ulong state, ulong multiplier, ulong increment) {
            State = state;
            Multiplier = multiplier;
            Increment = increment;
        }
        public void Step() {
            State = State * Multiplier + Increment;
        }
    }

    public class UClass<T> where T : IBinaryInteger<T> {
        public T State;
        public T Multiplier;
        public T Increment;
        public UClass(T state, T multiplier, T increment) {
            State = state;
            Multiplier = multiplier;
            Increment = increment;
        }
        public void Step() {
            State = State * Multiplier + Increment;
        }
    }

}

Disassembly of (guts of) UIntClass Step() function

00007FFADD1A795D  mov         rax,qword ptr [rbp+10h]
00007FFADD1A7961  mov         eax,dword ptr [rax+8]
00007FFADD1A7964  mov         rdx,qword ptr [rbp+10h]
00007FFADD1A7968  imul        eax,dword ptr [rdx+0Ch]
00007FFADD1A796C  mov         rdx,qword ptr [rbp+10h]
00007FFADD1A7970  add         eax,dword ptr [rdx+10h]
00007FFADD1A7973  mov         rdx,qword ptr [rbp+10h]
00007FFADD1A7977  mov         dword ptr [rdx+8],eax

Disassembly of (guts of) ULongClass Step() function

00007FFADD19902D  mov         rax,qword ptr [rbp+10h]
00007FFADD199031  mov         rax,qword ptr [rax+8]
00007FFADD199035  mov         rdx,qword ptr [rbp+10h]
00007FFADD199039  imul        rax,qword ptr [rdx+10h]
00007FFADD19903E  mov         rdx,qword ptr [rbp+10h]
00007FFADD199042  add         rax,qword ptr [rdx+18h]
00007FFADD199046  mov         rdx,qword ptr [rbp+10h]
00007FFADD19904A  mov         qword ptr [rdx+8],rax

Disassembly of (guts of) UClass Step() function

00007FFADD1C9093  mov         rcx,qword ptr [rbp+10h]
00007FFADD1C9097  mov         qword ptr [rbp-10h],rcx
00007FFADD1C909B  mov         rcx,qword ptr [rbp+10h]
00007FFADD1C909F  mov         rcx,qword ptr [rcx+8]
00007FFADD1C90A3  mov         rdx,qword ptr [rbp+10h]
00007FFADD1C90A7  mov         rdx,qword ptr [rdx+10h]
00007FFADD1C90AB  call        qword ptr [CLRStub[MethodDescPrestub]@00007FFADD183978 (07FFADD183978h)]
00007FFADD1C90B1  mov         qword ptr [rbp-18h],rax
00007FFADD1C90B5  mov         rdx,qword ptr [rbp+10h]
00007FFADD1C90B9  mov         rdx,qword ptr [rdx+18h]
00007FFADD1C90BD  mov         rcx,qword ptr [rbp-18h]
00007FFADD1C90C1  call        qword ptr [CLRStub[MethodDescPrestub]@00007FFADD1835A0 (07FFADD1835A0h)]
00007FFADD1C90C7  mov         qword ptr [rbp-20h],rax
00007FFADD1C90CB  mov         rax,qword ptr [rbp-10h]
00007FFADD1C90CF  mov         rdx,qword ptr [rbp-20h]
00007FFADD1C90D3  mov         qword ptr [rax+8],rdx


问:
Enable HTTP & Binary transport modes in HiveServer2?
I'm using Apache-Spark 3.2.3.
To connect to Hive JDBC, HiveServer2 is configured as http transport mode.

hive-site.xml:

```<code>  <property>
    <name>hive.server2.transport.mode</name>
    <value>http</value>
    <description>
      Expects one of [binary, http].
      Transport mode of HiveServer2.
    </description>
  </property>
  <property>
    <name>hive.server2.thrift.port</name>
    <value>10000</value>
    <description>Port number of HiveServer2 Thrift interface when hive.server2.transport.mode is 'binary'.</description>
  </property>
  <property>
    <name>hive.server2.thrift.http.port</name>
    <value>10001</value>
    <description>Port number of HiveServer2 Thrift interface when hive.server2.transport.mode is 'http'.</description>
  </property>
  <property>
    <name>hive.server2.thrift.http.path</name>
    <value>cliservice</value>
    <description>Path component of URL endpoint when in HTTP mode.</description>
  </property>
</code>```

For Amazon QuickSight, "http" transport mode is failing. I tried ports 10000 and 10001.

If I change transportation mode to binary, QuickSight works with the port 10000. But now the hive jdbc connection fails.

I'M NOT USING CLOUDERA, but it this topic gives a good idea.
https://community.cloudera.com/t5/Support-Questions/hive-Enable-HTTP-Binary-transport-modes-in-HiveServer2/td-p/94401

Is it possible to configure Hive "config group" to allow multiple instances in hive-site.xml manually? or any other idea about how to configure Thrift in Apache-Spark to work with binary and http transportation mode at the same time?

Body:
I'm using Apache-Spark 3.2.3.
To connect to Hive JDBC, HiveServer2 is configured as http transport mode.

hive-site.xml:

  <property>
    <name>hive.server2.transport.mode</name>
    <value>http</value>
    <description>
      Expects one of [binary, http].
      Transport mode of HiveServer2.
    </description>
  </property>
  <property>
    <name>hive.server2.thrift.port</name>
    <value>10000</value>
    <description>Port number of HiveServer2 Thrift interface when hive.server2.transport.mode is 'binary'.</description>
  </property>
  <property>
    <name>hive.server2.thrift.http.port</name>
    <value>10001</value>
    <description>Port number of HiveServer2 Thrift interface when hive.server2.transport.mode is 'http'.</description>
  </property>
  <property>
    <name>hive.server2.thrift.http.path</name>
    <value>cliservice</value>
    <description>Path component of URL endpoint when in HTTP mode.</description>
  </property>

For Amazon QuickSight, "http" transport mode is failing. I tried ports 10000 and 10001.

If I change transportation mode to binary, QuickSight works with the port 10000. But now the hive jdbc connection fails.

I'M NOT USING CLOUDERA, but it this topic gives a good idea.
https://community.cloudera.com/t5/Support-Questions/hive-Enable-HTTP-Binary-transport-modes-in-HiveServer2/td-p/94401

Is it possible to configure Hive "config group" to allow multiple instances in hive-site.xml manually? or any other idea about how to configure Thrift in Apache-Spark to work with binary and http transportation mode at the same time?


问:
TailwindCSS Certain Custom Colors Don't Work
I'm currently using NativeWind for a React Native project and I am having some issues with custom colors rendering in the project. NativeWind is built on top of TailwindCSS so I think the issue is the same as in TailwindCSS.

I have some custom colors in the tailwind.config.js file and most of them render fine in the codebase. However, certain ones don't render.

tailwind.config.js

module.exports = {
  content: [
    "./App.{js,jsx,ts,tsx}",
    "./src/screens/**/*.{js,jsx,ts,tsx}",
    "./src/components/**/*.{js,jsx,ts,tsx}",
    "./src/components/MapComponents/**/*.{js,jsx,ts,tsx}",
    "./src/assets/**/*.{js,jsx,ts,tsx}",
  ],
  theme: {
    extend: {
      fontSize: {
        xs: "11px",
        sm: "12px",
        base: "15px",
        lg: "18px",
        xl: "20px",
        "2xl": "26px",
        "3xl": "32px",
      },
      colors: {
        gray: {
          base: "#e5e7eb",
          dark: "#69686D",
        },
        blue: {
          accent: "#0085ff",
          dark: "#5a49d9",
        },
        red: {
          base: "#FF0000",
        },
        food: {
          inner: "#ffc0c1",
          outer: "#ff6665",
        },
        deal: {
          inner: "#7ba8cc",
          outer: "#277bc0",
        },
        challenge: {
          inner: "#cfc0fe",
          outer: "#7446ae",
        },
        event: {
          inner: "#f09b72",
          outer: "#ea047e",
        },
        music: {
          inner: "#76ba99",
          outer: "#00ffab",
        },
        sport: {
          inner: "#F87070",
          outer: "#FE3E3E",
        },
        outdoors: {
          inner: "#4ABE21",
          outer: "#49AC26",
        },
        business: {
          inner: "#DEEE2B",
          outer: "#CEDD26",
        },
      },
    },
  },
  plugins: [],
};
```

Rendering a View container with bg-blue-accent, it renders the background color of that View to the associated custom color. However, bg-food-outer does not work for some reason. Along with others like deal, challenge, music, etc. I also have the tailwind extension from vscode that shows the css code for the tailwindstyle and in the code base when I type bg-food-outer, it shows the right css color.

I tried doing expo start -c to clear the cache but that doesn't seem to work either. How can I render the rest of the custom colors?

Body:
I'm currently using NativeWind for a React Native project and I am having some issues with custom colors rendering in the project. NativeWind is built on top of TailwindCSS so I think the issue is the same as in TailwindCSS.

I have some custom colors in the tailwind.config.js file and most of them render fine in the codebase. However, certain ones don't render.

tailwind.config.js

module.exports = {
  content: [
    "./App.{js,jsx,ts,tsx}",
    "./src/screens/**/*.{js,jsx,ts,tsx}",
    "./src/components/**/*.{js,jsx,ts,tsx}",
    "./src/components/MapComponents/**/*.{js,jsx,ts,tsx}",
    "./src/assets/**/*.{js,jsx,ts,tsx}",
  ],
  theme: {
    extend: {
      fontSize: {
        xs: "11px",
        sm: "12px",
        base: "15px",
        lg: "18px",
        xl: "20px",
        "2xl": "26px",
        "3xl": "32px",
      },
      colors: {
        gray: {
          base: "#e5e7eb",
          dark: "#69686D",
        },
        blue: {
          accent: "#0085ff",
          dark: "#5a49d9",
        },
        red: {
          base: "#FF0000",
        },
        food: {
          inner: "#ffc0c1",
          outer: "#ff6665",
        },
        deal: {
          inner: "#7ba8cc",
          outer: "#277bc0",
        },
        challenge: {
          inner: "#cfc0fe",
          outer: "#7446ae",
        },
        event: {
          inner: "#f09b72",
          outer: "#ea047e",
        },
        music: {
          inner: "#76ba99",
          outer: "#00ffab",
        },
        sport: {
          inner: "#F87070",
          outer: "#FE3E3E",
        },
        outdoors: {
          inner: "#4ABE21",
          outer: "#49AC26",
        },
        business: {
          inner: "#DEEE2B",
          outer: "#CEDD26",
        },
      },
    },
  },
  plugins: [],
};

Rendering a View container with bg-blue-accent, it renders the background color of that View to the associated custom color. However, bg-food-outer does not work for some reason. Along with others like deal, challenge, music, etc. I also have the tailwind extension from vscode that shows the css code for the tailwindstyle and in the code base when I type bg-food-outer, it shows the right css color.

I tried doing expo start -c to clear the cache but that doesn't seem to work either. How can I render the rest of the custom colors?


问:
Track nth row of repeated value in column (R)
I have a dataframe that looks something like this:

```<code>test <- data.frame(
  ID = c(1001,1001,1002,1002,1003,1003,1003),
  Complete = c(1, 1, 1, 1, 1, 1,1)
)
</code>```

I want to create a column that logs the nth row of each ID in consecutive order. The output should look like this:

```<code>test <- data.frame(
  ID = c(1001,1001,1002,1002,1003,1003,1003),
  Day = c(1,2,1,2,1,2,3),
  Complete = c(1, 1, 1, 1, 1, 1,1)
)
</code>```

How can I do this?

Thank you!

Body:
I have a dataframe that looks something like this:

test <- data.frame(
  ID = c(1001,1001,1002,1002,1003,1003,1003),
  Complete = c(1, 1, 1, 1, 1, 1,1)
)

I want to create a column that logs the nth row of each ID in consecutive order. The output should look like this:

test <- data.frame(
  ID = c(1001,1001,1002,1002,1003,1003,1003),
  Day = c(1,2,1,2,1,2,3),
  Complete = c(1, 1, 1, 1, 1, 1,1)
)

How can I do this?

Thank you!


问:
Edit: Switch cell position in List but also in data array when mixing UIKit and SwiftUI
I have List with an array of TextFields

```<code>struct MyView: View {
@State var options: [DatePollOption] = [DatePollOption(date: ""),DatePollOption(date: "")]
var body: some View{
    List{
        Section{
            ForEach($options) { $option in
                HStack{
                    PickerTextField(
                        placeholder: "GG", date: $option.date)

                }
            }
            .onMove(perform: move)
        }
    }
}

func move(from source: IndexSet, to destination: Int) {
    options.move(fromOffsets: source, toOffset: destination)

}
}
        struct DatePollOption : Identifiable {
            var id: String = UUID().uuidString
            var date : String?
        }

</code>```

I can move cells around but order in options data array always stays the same. How to switch index positions of elements in arrays to always match order in list?

Edit: Im really sorry for wanting help and not providing enough informations...

```<code>        class Helper{
            public var dateChanged : (()-> Void)?
            public var doneButtonTapped: (()-> Void)?

            @objc func dateValueChanged(){
                self.dateChanged?()
            }

        }
        struct PickerTextField : UIViewRepresentable{
            var textField = UITextField()
            @State var datePickerView = UIDatePicker()
            let toolbar = UIToolbar()
            let helper = Helper()

            public var placeholder: String
            @Binding public var date: String?

            @Binding var dates : [DatePollOption]
            var dateFormatterDate : DateFormatter = {
                let dateFormatter = DateFormatter()
                dateFormatter.dateFormat = "dd MMM yyy"
                return dateFormatter
            }()

            func makeUIView(context: Context) -> UITextField {
                self.datePickerView.preferredDatePickerStyle = .wheels
                self.datePickerView.addTarget(self.helper, action: #selector(self.helper.dateValueChanged), for: .valueChanged)

                self.textField.placeholder = self.placeholder
                self.textField.inputView = self.datePickerView
                textField.delegate = context.coordinator

                self.textField.inputAccessoryView = toolbar

                self.helper.dateChanged = {

                    date = dateFormatterDate.string(from: self.datePickerView.date)

                }

                return self.textField
            }
            func makeCoordinator() -> Coordinator {
                return Coordinator(datePicker: $datePickerView, date: $date, textField: textField, toolBar: toolbar)
            }

            func updateUIView(_ uiView: UITextField, context: Context) {
                if let selectedDate = self.date {
                    uiView.text = selectedDate
                }

            }

            class Coordinator: NSObject,UITextFieldDelegate,UIToolbarDelegate{

                @Binding var datePicker : UIDatePicker
                var textField : UITextField
                @Binding public var date: String?
                let toolBar : UIToolbar
                var dateFormatter : DateFormatter = {
                    let dateFormatter = DateFormatter()
                    dateFormatter.dateFormat = "HH:mm"
                    return dateFormatter
                }()
                let helper = Helper()

                init(datePicker: Binding<UIDatePicker>,date: Binding<String?>,textField: UITextField,toolBar: UIToolbar) {

                    self._datePicker = datePicker
                    self._date = date
                    self.textField = textField
                    self.toolBar = toolBar
                    super.init()

                    let doneButton = UIBarButtonItem(title: "Done", style: .done, target: self, action: #selector(doneButtonaction))

                    toolBar.setItems([doneButton], animated: false)

                }

                @objc func doneButtonaction(){
                    if self.date == nil {
                        self.date = dateFormatter.string(from: self.datePicker.date)
                        self.textField.resignFirstResponder()
                        //print(dates.count)
                    }

                    self.textField.resignFirstResponder()
                }
            }

</code>```

The problem is when I change the order of cells inside List and try to edit date it is changing date to different cells to one that was there before change.
I guess I dont communicate well between SwiftUI and UIKit

Body:
I have List with an array of TextFields

struct MyView: View {
@State var options: [DatePollOption] = [DatePollOption(date: ""),DatePollOption(date: "")]
var body: some View{
    List{
        Section{
            ForEach($options) { $option in
                HStack{
                    PickerTextField(
                        placeholder: "GG", date: $option.date)

                }
            }
            .onMove(perform: move)
        }
    }
}

func move(from source: IndexSet, to destination: Int) {
    options.move(fromOffsets: source, toOffset: destination)

}
}
        struct DatePollOption : Identifiable {
            var id: String = UUID().uuidString
            var date : String?
        }

I can move cells around but order in options data array always stays the same. How to switch index positions of elements in arrays to always match order in list?

Edit: Im really sorry for wanting help and not providing enough informations...

        class Helper{
            public var dateChanged : (()-> Void)?
            public var doneButtonTapped: (()-> Void)?

            @objc func dateValueChanged(){
                self.dateChanged?()
            }

        }
        struct PickerTextField : UIViewRepresentable{
            var textField = UITextField()
            @State var datePickerView = UIDatePicker()
            let toolbar = UIToolbar()
            let helper = Helper()

            public var placeholder: String
            @Binding public var date: String?

            @Binding var dates : [DatePollOption]
            var dateFormatterDate : DateFormatter = {
                let dateFormatter = DateFormatter()
                dateFormatter.dateFormat = "dd MMM yyy"
                return dateFormatter
            }()

            func makeUIView(context: Context) -> UITextField {
                self.datePickerView.preferredDatePickerStyle = .wheels
                self.datePickerView.addTarget(self.helper, action: #selector(self.helper.dateValueChanged), for: .valueChanged)

                self.textField.placeholder = self.placeholder
                self.textField.inputView = self.datePickerView
                textField.delegate = context.coordinator

                self.textField.inputAccessoryView = toolbar

                self.helper.dateChanged = {

                    date = dateFormatterDate.string(from: self.datePickerView.date)

                }

                return self.textField
            }
            func makeCoordinator() -> Coordinator {
                return Coordinator(datePicker: $datePickerView, date: $date, textField: textField, toolBar: toolbar)
            }

            func updateUIView(_ uiView: UITextField, context: Context) {
                if let selectedDate = self.date {
                    uiView.text = selectedDate
                }

            }

            class Coordinator: NSObject,UITextFieldDelegate,UIToolbarDelegate{

                @Binding var datePicker : UIDatePicker
                var textField : UITextField
                @Binding public var date: String?
                let toolBar : UIToolbar
                var dateFormatter : DateFormatter = {
                    let dateFormatter = DateFormatter()
                    dateFormatter.dateFormat = "HH:mm"
                    return dateFormatter
                }()
                let helper = Helper()

                init(datePicker: Binding<UIDatePicker>,date: Binding<String?>,textField: UITextField,toolBar: UIToolbar) {

                    self._datePicker = datePicker
                    self._date = date
                    self.textField = textField
                    self.toolBar = toolBar
                    super.init()

                    let doneButton = UIBarButtonItem(title: "Done", style: .done, target: self, action: #selector(doneButtonaction))

                    toolBar.setItems([doneButton], animated: false)

                }

                @objc func doneButtonaction(){
                    if self.date == nil {
                        self.date = dateFormatter.string(from: self.datePicker.date)
                        self.textField.resignFirstResponder()
                        //print(dates.count)
                    }

                    self.textField.resignFirstResponder()
                }
            }

The problem is when I change the order of cells inside List and try to edit date it is changing date to different cells to one that was there before change.
I guess I dont communicate well between SwiftUI and UIKit


问:
Get Text Before image in a PDF using PdfPig
I search to get a string just before a image from a pdf

Example of pdf :

pdfexample

Like the image above :
For the nice picture of a cat 1 i will want to get 'What is image about :' and 'Gps Thing'

For the nice picture of a cat 2 i will want to get 'What is image about 2 :' and 'Gps Thing 2', excluding 'Lot of useless text' (Find by example the last word (GPS before the image 2)

Code used for now :

```<code>public void pdf(pdfselectionned){
    var pdfdoc = IronPdf.PdfDocument.FromFile(pdfselectionned); // Define my selected pdf
    string pdftxt = pdfdoc.ExtractAllText(); // Get all text from the pdf

                try
            {
                using (PdfDocument pdfDocument = PdfDocument.Open(pdfselectionned)) // Extract all image in a folder and named them 1.png,2.png,.....
                {
                    int imageCount = 1;

                    foreach (Page page in pdfDocument.GetPages())
                    {
                        List<XObjectImage> images = page.GetImages().Cast<XObjectImage>().ToList();
                        foreach (XObjectImage image in images)
                        {
                            byte[] imageRawBytes = image.RawBytes.ToArray();

                            using (FileStream stream = new FileStream($"{dir}\\{imageCount}.png", FileMode.Create, FileAccess.Write))
                            using (BinaryWriter writer = new BinaryWriter(stream))
                            {
                                writer.Write(imageRawBytes);
                                writer.Flush();
                            }

                            imageCount++;
                        }
                    }
                }
            }
            catch (Exception)
            {

                throw;
            }
    }
</code>```

Thank a lot if someone find a way to do that :)

(Other topic talk about thing like i want to do but nobody use PdfPig, if a can avoid to use different thin it will be great ^^')

Body:
I search to get a string just before a image from a pdf

Example of pdf :

pdfexample

Like the image above :
For the nice picture of a cat 1 i will want to get 'What is image about :' and 'Gps Thing'

For the nice picture of a cat 2 i will want to get 'What is image about 2 :' and 'Gps Thing 2', excluding 'Lot of useless text' (Find by example the last word (GPS before the image 2)

Code used for now :

public void pdf(pdfselectionned){
    var pdfdoc = IronPdf.PdfDocument.FromFile(pdfselectionned); // Define my selected pdf
    string pdftxt = pdfdoc.ExtractAllText(); // Get all text from the pdf

                try
            {
                using (PdfDocument pdfDocument = PdfDocument.Open(pdfselectionned)) // Extract all image in a folder and named them 1.png,2.png,.....
                {
                    int imageCount = 1;

                    foreach (Page page in pdfDocument.GetPages())
                    {
                        List<XObjectImage> images = page.GetImages().Cast<XObjectImage>().ToList();
                        foreach (XObjectImage image in images)
                        {
                            byte[] imageRawBytes = image.RawBytes.ToArray();

                            using (FileStream stream = new FileStream($"{dir}\\{imageCount}.png", FileMode.Create, FileAccess.Write))
                            using (BinaryWriter writer = new BinaryWriter(stream))
                            {
                                writer.Write(imageRawBytes);
                                writer.Flush();
                            }

                            imageCount++;
                        }
                    }
                }
            }
            catch (Exception)
            {

                throw;
            }
    }

Thank a lot if someone find a way to do that :)

(Other topic talk about thing like i want to do but nobody use PdfPig, if a can avoid to use different thin it will be great ^^')


问:
How do I resolve class not found Error in Java project?
I'm currently working on a small minecraft spigot plugin, which needs to save data. I have chosen to use a .yml file to do so and have programmed both saving and loading the data, however the loading does not work.

this is the Command being run:

```<code>package steckbrief.steckbrief.Commands;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import steckbrief.steckbrief.DataHolderect.DataHolder;

import java.util.ArrayList;

public class getSteckbrief implements CommandExecutor {

@Override
    public boolean onCommand(CommandSender sender, Command command, String label, String [] args){

    DataHolder zw = new DataHolder(new ArrayList<String[]>(), new ArrayList<String>());
    zw.LoadDataHolder(new String[0]);

    if(zw.names.contains(args[0])) { //prüft ob der gefragte Spieler in der VerzeichnisListe "names" existiert
        int index = zw.names.indexOf(args[0]);
        String[] sent = zw.arrays.get(index);
        sender.sendMessage("Steckbrief von: " + args[0]);
        sender.sendMessage("Name: " + sent[0]);
        sender.sendMessage("Beruf: " + sent[1]);
        sender.sendMessage("Alter: " + sent[2]);
        sender.sendMessage("Zusatz: " + sent[3]);
        return true;
    } else {
        sender.sendMessage(args[0] + " ist nicht da, bzw. hat keinen Steckbrief");
        return true;
    }
    }
}

</code>```

this is my DataHolder class (saveDataHolder works fine, i tested with another command)

```<code>package steckbrief.steckbrief.Commands;
import java.util.List;
import org.yaml.snakeyaml.Yaml;
import java.io.FileReader;
import java.io.IOException;
import java.io.FileWriter;

public class DataHolder {
    public List<String> names;
    public List<String[]> arrays;

    public DataHolder(List<String[]> arrays, List<String> names) {
        this.arrays = arrays;
        this.names = names;
    }

    public void LoadDataHolder(String[] args) {
        // Create a new instance of the Yaml class
        Yaml yaml = new Yaml();

        // Read the data from the .yml file
        try (FileReader reader = new FileReader("data.yml")) {
            try {
                DataHolder dataHolder = yaml.load(reader);
                // You can now use the arrays as needed
                this.names = dataHolder.names;
                this.arrays = dataHolder.arrays;
            } catch(Exception e){
                e.printStackTrace();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public void saveDataHolder(String[] args) {
        // Create a new instance of the Yaml class
        Yaml yaml = new Yaml();

        // Create a new DataHolder object to hold the list of arrays
        DataHolder dataHolder = new DataHolder(arrays,names);

        // Save the data to a .yml file
        try (FileWriter writer = new FileWriter("data.yml")) {
            yaml.dump(dataHolder, writer);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
</code>```

but when the loadDataHolder method is run the console gives this Error:

```<code>[01:12:50 INFO]: AnimatingLion issued server command: /Steckbrief animatingLion
[01:12:50 WARN]: Can't construct a java object for tag:yaml.org,2002:steckbrief.steckbrief.Commands.DataHolder; exception=Class not found: steckbrief.steckbrief.Commands.DataHolder
 in 'reader', line 1, column 1:
    !!steckbrief.steckbrief.Commands ...
    ^

[01:12:50 WARN]:        at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:313)

[01:12:50 WARN]:        at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:207)

[01:12:50 WARN]:        at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:196)

[01:12:50 WARN]:        at org.yaml.snakeyaml.constructor.BaseConstructor.constructDocument(BaseConstructor.java:161)

[01:12:50 WARN]:        at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:147)

[01:12:50 WARN]:        at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:524)

[01:12:50 WARN]:        at org.yaml.snakeyaml.Yaml.load(Yaml.java:467)

[01:12:50 WARN]:        at steckbrief.steckbrief.DataHolderect.DataHolder.LoadDataHolder(DataHolder.java:26)

[01:12:50 WARN]:        at steckbrief.steckbrief.Commands.getSteckbrief.onCommand(getSteckbrief.java:17)

[01:12:50 WARN]:        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)

[01:12:50 WARN]:        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141)

[01:12:50 WARN]:        at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:648)

[01:12:50 WARN]:        at net.minecraft.server.v1_12_R1.PlayerConnection.handleCommand(PlayerConnection.java:1401)

[01:12:50 WARN]:        at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1236)

[01:12:50 WARN]:        at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:45)

[01:12:50 WARN]:        at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:1)

[01:12:50 WARN]:        at net.minecraft.server.v1_12_R1.PlayerConnectionUtils$1.run(SourceFile:13)

[01:12:50 WARN]:        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)

[01:12:50 WARN]:        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

[01:12:50 WARN]:        at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46)

[01:12:50 WARN]:        at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:748)

[01:12:50 WARN]:        at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:406)

[01:12:50 WARN]:        at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679)

[01:12:50 WARN]:        at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577)

[01:12:50 WARN]:        at java.base/java.lang.Thread.run(Thread.java:833)

[01:12:50 WARN]: Caused by: org.yaml.snakeyaml.error.YAMLException: Class not found: steckbrief.steckbrief.Commands.DataHolder

[01:12:50 WARN]:        at org.yaml.snakeyaml.constructor.Constructor.getClassForNode(Constructor.java:642)

[01:12:50 WARN]:        at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.getConstructor(Constructor.java:298)

[01:12:50 WARN]:        at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:308)

[01:12:50 WARN]:        ... 24 more
</code>```

As you can see it's a ClassNotFound Exception, however the DataHolder class is inside the Commands package

Also this is the .yml File

```<code>!!steckbrief.steckbrief.Commands.DataHolder
arrays:
- ['chris ', 'inf ', '15 ', 'ich mag hasen ']
names: [AnimatingLion]

</code>```

I have tried updating snakeyaml
I have tried correcting the classpath, although i'm new so idk if i did it right
I have verified, that there is nothing wrong with the .yml file (correct place, syntax and name etc.)
As mentioned I' new and only know the little bits of java i have learned in school (nothing about projects just how to use logic operations) so i'm at the end of my knowledge.
The loadDataHolder is supposed to copy "names" and "arrays" from the .yml file to itself so i can work with it.
sincerely Christian Walter
PS english is not my first language so please excuse any spelling and grammar mistakes.

Body:
I'm currently working on a small minecraft spigot plugin, which needs to save data. I have chosen to use a .yml file to do so and have programmed both saving and loading the data, however the loading does not work.

this is the Command being run:

package steckbrief.steckbrief.Commands;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import steckbrief.steckbrief.DataHolderect.DataHolder;

import java.util.ArrayList;

public class getSteckbrief implements CommandExecutor {

@Override
    public boolean onCommand(CommandSender sender, Command command, String label, String [] args){

    DataHolder zw = new DataHolder(new ArrayList<String[]>(), new ArrayList<String>());
    zw.LoadDataHolder(new String[0]);

    if(zw.names.contains(args[0])) { //prüft ob der gefragte Spieler in der VerzeichnisListe "names" existiert
        int index = zw.names.indexOf(args[0]);
        String[] sent = zw.arrays.get(index);
        sender.sendMessage("Steckbrief von: " + args[0]);
        sender.sendMessage("Name: " + sent[0]);
        sender.sendMessage("Beruf: " + sent[1]);
        sender.sendMessage("Alter: " + sent[2]);
        sender.sendMessage("Zusatz: " + sent[3]);
        return true;
    } else {
        sender.sendMessage(args[0] + " ist nicht da, bzw. hat keinen Steckbrief");
        return true;
    }
    }
}

this is my DataHolder class (saveDataHolder works fine, i tested with another command)

package steckbrief.steckbrief.Commands;
import java.util.List;
import org.yaml.snakeyaml.Yaml;
import java.io.FileReader;
import java.io.IOException;
import java.io.FileWriter;

public class DataHolder {
    public List<String> names;
    public List<String[]> arrays;

    public DataHolder(List<String[]> arrays, List<String> names) {
        this.arrays = arrays;
        this.names = names;
    }

    public void LoadDataHolder(String[] args) {
        // Create a new instance of the Yaml class
        Yaml yaml = new Yaml();

        // Read the data from the .yml file
        try (FileReader reader = new FileReader("data.yml")) {
            try {
                DataHolder dataHolder = yaml.load(reader);
                // You can now use the arrays as needed
                this.names = dataHolder.names;
                this.arrays = dataHolder.arrays;
            } catch(Exception e){
                e.printStackTrace();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public void saveDataHolder(String[] args) {
        // Create a new instance of the Yaml class
        Yaml yaml = new Yaml();

        // Create a new DataHolder object to hold the list of arrays
        DataHolder dataHolder = new DataHolder(arrays,names);

        // Save the data to a .yml file
        try (FileWriter writer = new FileWriter("data.yml")) {
            yaml.dump(dataHolder, writer);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}

but when the loadDataHolder method is run the console gives this Error:

[01:12:50 INFO]: AnimatingLion issued server command: /Steckbrief animatingLion
[01:12:50 WARN]: Can't construct a java object for tag:yaml.org,2002:steckbrief.steckbrief.Commands.DataHolder; exception=Class not found: steckbrief.steckbrief.Commands.DataHolder
 in 'reader', line 1, column 1:
    !!steckbrief.steckbrief.Commands ...
    ^

[01:12:50 WARN]:        at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:313)

[01:12:50 WARN]:        at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:207)

[01:12:50 WARN]:        at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:196)

[01:12:50 WARN]:        at org.yaml.snakeyaml.constructor.BaseConstructor.constructDocument(BaseConstructor.java:161)

[01:12:50 WARN]:        at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:147)

[01:12:50 WARN]:        at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:524)

[01:12:50 WARN]:        at org.yaml.snakeyaml.Yaml.load(Yaml.java:467)

[01:12:50 WARN]:        at steckbrief.steckbrief.DataHolderect.DataHolder.LoadDataHolder(DataHolder.java:26)

[01:12:50 WARN]:        at steckbrief.steckbrief.Commands.getSteckbrief.onCommand(getSteckbrief.java:17)

[01:12:50 WARN]:        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)

[01:12:50 WARN]:        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141)

[01:12:50 WARN]:        at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:648)

[01:12:50 WARN]:        at net.minecraft.server.v1_12_R1.PlayerConnection.handleCommand(PlayerConnection.java:1401)

[01:12:50 WARN]:        at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1236)

[01:12:50 WARN]:        at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:45)

[01:12:50 WARN]:        at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:1)

[01:12:50 WARN]:        at net.minecraft.server.v1_12_R1.PlayerConnectionUtils$1.run(SourceFile:13)

[01:12:50 WARN]:        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)

[01:12:50 WARN]:        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

[01:12:50 WARN]:        at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46)

[01:12:50 WARN]:        at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:748)

[01:12:50 WARN]:        at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:406)

[01:12:50 WARN]:        at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679)

[01:12:50 WARN]:        at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577)

[01:12:50 WARN]:        at java.base/java.lang.Thread.run(Thread.java:833)

[01:12:50 WARN]: Caused by: org.yaml.snakeyaml.error.YAMLException: Class not found: steckbrief.steckbrief.Commands.DataHolder

[01:12:50 WARN]:        at org.yaml.snakeyaml.constructor.Constructor.getClassForNode(Constructor.java:642)

[01:12:50 WARN]:        at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.getConstructor(Constructor.java:298)

[01:12:50 WARN]:        at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:308)

[01:12:50 WARN]:        ... 24 more

As you can see it's a ClassNotFound Exception, however the DataHolder class is inside the Commands package

Also this is the .yml File

!!steckbrief.steckbrief.Commands.DataHolder
arrays:
- ['chris ', 'inf ', '15 ', 'ich mag hasen ']
names: [AnimatingLion]

I have tried updating snakeyaml
I have tried correcting the classpath, although i'm new so idk if i did it right
I have verified, that there is nothing wrong with the .yml file (correct place, syntax and name etc.)
As mentioned I' new and only know the little bits of java i have learned in school (nothing about projects just how to use logic operations) so i'm at the end of my knowledge.
The loadDataHolder is supposed to copy "names" and "arrays" from the .yml file to itself so i can work with it.
sincerely Christian Walter
PS english is not my first language so please excuse any spelling and grammar mistakes.


问:
Update android objectbox from 2.9.1 to newer
I am trying to update android objectbox from V2.3 to newer one.
The newest would be V3.5.0.
But I can't, the MyObjectBox class is not found.

In the latest version, in the documentation, the warning is written:

Restore compatibility for Android projects using Gradle 6.1. The
minimum supported version for Gradle is 6.1 and for the Android Gradle
Plugin 3.4. This should make it easier for older projects to update to
the latest version of ObjectBox.

I did that, the gradle is 6.1 and the plugin 3.4.0.

Trying to go back, from 3.5.0 backwards, I got it in version 2.9.1.
That is, if I put version 2.9.1 it works perfectly. Any version above 2.9.1 the non-ObjectBox class is not found.

Can anyone help me find the problem?

My gradle looks like this:

```<code>buildscript {

    ext.objectboxVersion = '3.5.0'

    repositories {
        mavenCentral()
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.0'
        classpath 'com.google.gms:google-services:4.3.14'
        classpath "io.objectbox:objectbox-gradle-plugin:$objectboxVersion"}
}

allprojects {
    repositories {
        mavenCentral()
        jcenter()
        google()
    }
}
</code>```

And my app checks are:

```<code>compileSdkVersion 31

    defaultConfig {
        applicationId "com.br.mpragueiro"
        minSdkVersion 24
        targetSdkVersion 31
        versionCode 414
        versionName "7.2.1"
        multiDexEnabled true
    }
</code>```

Body:
I am trying to update android objectbox from V2.3 to newer one.
The newest would be V3.5.0.
But I can't, the MyObjectBox class is not found.

In the latest version, in the documentation, the warning is written:

Restore compatibility for Android projects using Gradle 6.1. The
minimum supported version for Gradle is 6.1 and for the Android Gradle
Plugin 3.4. This should make it easier for older projects to update to
the latest version of ObjectBox.

I did that, the gradle is 6.1 and the plugin 3.4.0.

Trying to go back, from 3.5.0 backwards, I got it in version 2.9.1.
That is, if I put version 2.9.1 it works perfectly. Any version above 2.9.1 the non-ObjectBox class is not found.

Can anyone help me find the problem?

My gradle looks like this:

buildscript {

    ext.objectboxVersion = '3.5.0'

    repositories {
        mavenCentral()
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.0'
        classpath 'com.google.gms:google-services:4.3.14'
        classpath "io.objectbox:objectbox-gradle-plugin:$objectboxVersion"}
}

allprojects {
    repositories {
        mavenCentral()
        jcenter()
        google()
    }
}

And my app checks are:

compileSdkVersion 31

    defaultConfig {
        applicationId "com.br.mpragueiro"
        minSdkVersion 24
        targetSdkVersion 31
        versionCode 414
        versionName "7.2.1"
        multiDexEnabled true
    }