问:
Intellij - New Module from existing Sources : nothing happen
I am using . I have created an emty project with jdk 17 and I have downloaded a project from spring initialzr, I have tried to import it inside my project but nothing appear after clicking of File -> New -> Module from existing source.

Windows 11, JDK 17.

Intellij version :

```<code>IntelliJ IDEA 2022.2.4 (Ultimate Edition)
Build #IU-222.4459.24, built on November 22, 2022
Licensed to khalid tounoussi
Subscription is active until September 27, 2023.
For educational use only.
Runtime version: 17.0.5+7-b469.71 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 2016M
Cores: 8
Non-Bundled Plugins:
    com.tabnine.TabNine (0.8.7)
    com.jinsihou.react.snippets (1.1.1)
    org.intellij.plugins.junitgen (2.0.12)
    com.poratu.idea.plugins.tomcat (4.3.8)
    com.jetbrains.jax.ws (222.4459.16)
    com.intellij.spring.batch (222.4459.16)
    com.github.setial (4.0.2)
    GrepConsole (12.15.211.6693.1)
    com.intellij.lang.jsgraphql (3.3.0)
    com.yiycf.plugins.mavenDependencyHelper (2.5)
    com.haulmont.jpab (2022.5.2-222)
    MavenRunHelper (4.23.222.2964.0)

Kotlin: 222-1.7.10-release-334-IJ4459.24
</code>```

I have tried to open first the project in intellj ( the project that I have download it from spring initliazr ) and it works fine.
I have excluded windows defender from analysing all the folders of the project.

If I use spring initialzr for building projects in intellj, it works fine.

Body:
I am using . I have created an emty project with jdk 17 and I have downloaded a project from spring initialzr, I have tried to import it inside my project but nothing appear after clicking of File -> New -> Module from existing source.

Windows 11, JDK 17.

Intellij version :

IntelliJ IDEA 2022.2.4 (Ultimate Edition)
Build #IU-222.4459.24, built on November 22, 2022
Licensed to khalid tounoussi
Subscription is active until September 27, 2023.
For educational use only.
Runtime version: 17.0.5+7-b469.71 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 2016M
Cores: 8
Non-Bundled Plugins:
    com.tabnine.TabNine (0.8.7)
    com.jinsihou.react.snippets (1.1.1)
    org.intellij.plugins.junitgen (2.0.12)
    com.poratu.idea.plugins.tomcat (4.3.8)
    com.jetbrains.jax.ws (222.4459.16)
    com.intellij.spring.batch (222.4459.16)
    com.github.setial (4.0.2)
    GrepConsole (12.15.211.6693.1)
    com.intellij.lang.jsgraphql (3.3.0)
    com.yiycf.plugins.mavenDependencyHelper (2.5)
    com.haulmont.jpab (2022.5.2-222)
    MavenRunHelper (4.23.222.2964.0)

Kotlin: 222-1.7.10-release-334-IJ4459.24

I have tried to open first the project in intellj ( the project that I have download it from spring initliazr ) and it works fine.
I have excluded windows defender from analysing all the folders of the project.

If I use spring initialzr for building projects in intellj, it works fine.


来源: stackexchange

问:
How to duplicate, reuse, and dispose of dynamically generated addressable objects
How do I load an addressable AssetReference dynamically, like a crate or something, via LoadAssetAsync and then reuse it throughout my game without calling LoadAssetAsync again?

I am generating a series of square platforms that are addressable objects. When each platform is spawned, it generates its own set of addressable objects to populate the platform. The objects for each platform are assigned to an array of AssetReferences via the inspector. Using the code below, I am able to loop through the array and generate the objects for the platform. My problem is that when the next platform tries to generate its objects via LoadAssetAsync I get the error

Attempting to load AssetReference that has already been loaded.

I get that the objects have already been loaded, so doing it again makes no sense. How can I access the addressables, test that they are in the scene, and duplicate them as prefabs for future platforms?

I think this is probably simple, and I am just missing something basic, but I can't figure it out.

```<code>using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;

public class SquareObjectsDistributor : MonoBehaviour
{
    public SquareObject[] SquareObjectArray;

    [System.Serializable]
    public class SquareObject {
        public string sqObject;
        public AssetReference sqObjectReference;
        public Vector3 sqObjectPosition;
        public Vector3 sqObjectRotation;
    }

    public void DistributeObjects(int whichSquare) {
        for(int i = 0; i < SquareObjectArray.Length; i++)
        {
            InstantiateSquareObjects(whichSquare, i);
        }
    }

    void InstantiateSquareObjects(int whichSquare, int whichObject) {
        Debug.Log("Object_" + whichSquare + "_" + whichObject);
        SquareObjectArray[whichObject].sqObjectReference.LoadAssetAsync<GameObject>().Completed +=
            (asyncOperationHandle) => {
                if(asyncOperationHandle.Status == AsyncOperationStatus.Succeeded) {
                    GameObject newObject = Instantiate(asyncOperationHandle.Result, SquareObjectArray[whichObject].sqObjectPosition, Quaternion.Euler(SquareObjectArray[whichObject].sqObjectRotation)) as GameObject;
                    newObject.name = "Object_" + whichSquare + "_" + whichObject;
                } else {
                    Debug.Log("Failed to load");
                }
        };
    }
}```
```

ContentLicense: CC BY-SA 4.0

Body:
How do I load an addressable AssetReference dynamically, like a crate or something, via LoadAssetAsync and then reuse it throughout my game without calling LoadAssetAsync again?

I am generating a series of square platforms that are addressable objects. When each platform is spawned, it generates its own set of addressable objects to populate the platform. The objects for each platform are assigned to an array of AssetReferences via the inspector. Using the code below, I am able to loop through the array and generate the objects for the platform. My problem is that when the next platform tries to generate its objects via LoadAssetAsync I get the error

Attempting to load AssetReference that has already been loaded.

I get that the objects have already been loaded, so doing it again makes no sense. How can I access the addressables, test that they are in the scene, and duplicate them as prefabs for future platforms?

I think this is probably simple, and I am just missing something basic, but I can't figure it out.

using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;

public class SquareObjectsDistributor : MonoBehaviour
{
    public SquareObject[] SquareObjectArray;

    [System.Serializable]
    public class SquareObject {
        public string sqObject;
        public AssetReference sqObjectReference;
        public Vector3 sqObjectPosition;
        public Vector3 sqObjectRotation;
    }

    public void DistributeObjects(int whichSquare) {
        for(int i = 0; i < SquareObjectArray.Length; i++)
        {
            InstantiateSquareObjects(whichSquare, i);
        }
    }

    void InstantiateSquareObjects(int whichSquare, int whichObject) {
        Debug.Log("Object_" + whichSquare + "_" + whichObject);
        SquareObjectArray[whichObject].sqObjectReference.LoadAssetAsync<GameObject>().Completed +=
            (asyncOperationHandle) => {
                if(asyncOperationHandle.Status == AsyncOperationStatus.Succeeded) {
                    GameObject newObject = Instantiate(asyncOperationHandle.Result, SquareObjectArray[whichObject].sqObjectPosition, Quaternion.Euler(SquareObjectArray[whichObject].sqObjectRotation)) as GameObject;
                    newObject.name = "Object_" + whichSquare + "_" + whichObject;
                } else {
                    Debug.Log("Failed to load");
                }
        };
    }
}```


问:
Filemaker Pro Date Calculation
I currently have a script issue that didn't transfer correctly from version 18 to the upgrade to version 19. It is an invoice function. If the invoice is created on a certain date, the "Days Due" should show zero, but it incrementally showing a count in reverse on the day I upgraded (12/26/22) as day zero. For example, a new invoice date of 12/30/22 shows days due -4 days when it should be 0 days. The invoice is hung up on 12/26 as day zero.

I am guessing it is a simple script adjustment for a function that didn't convert to the new version, but I am not good enough with scripts to fix the problem. The current calculation script for the Days Due is:

If(GetAsNumber(Amount Paid)<GetAsNumber(Order Total);Today- Invoice Date;0)

The invoice date is a date-type field with 'Creation Date' as the option. When the amount is paid, the 'Days Due' calculation returns to zero, which it correctly does.

Title: Filemaker Pro Date Calculation


问:
Google custom search api safe search discord.py
I added a custom search api into my bot but one issue is that safe search isn't on.

```<code>@client.hybrid_command(name = "image", with_app_command=True, description="Get an image from your search from Google", aliases=["search", "show"])
@commands.guild_only()
async def image(ctx, *, search):
    cur_page = 1
    pages = 5
    check = list(votedb.votes.find({"user_id": ctx.author.id}))
    voted = None
    for w in check:
        voted = w.get("voted")
    if voted == "false" or voted is None and ctx.author.id != 867567949300760606:
        await ctx.reply("You need to vote to use this command!")
    else:
        resource = build("customsearch","v1", developerKey=googleapi_key).cse()
        result = resource.list(q=f"{search}",cx="3173341b71a7846be", searchType="image").execute()

        # Rest of code here
</code>```

How can I add safe search as an arg?

I haven't found anything for python on enabling safe search in the search

Body:
I added a custom search api into my bot but one issue is that safe search isn't on.

@client.hybrid_command(name = "image", with_app_command=True, description="Get an image from your search from Google", aliases=["search", "show"])
@commands.guild_only()
async def image(ctx, *, search):
    cur_page = 1
    pages = 5
    check = list(votedb.votes.find({"user_id": ctx.author.id}))
    voted = None
    for w in check:
        voted = w.get("voted")
    if voted == "false" or voted is None and ctx.author.id != 867567949300760606:
        await ctx.reply("You need to vote to use this command!")
    else:
        resource = build("customsearch","v1", developerKey=googleapi_key).cse()
        result = resource.list(q=f"{search}",cx="3173341b71a7846be", searchType="image").execute()

        # Rest of code here

How can I add safe search as an arg?

I haven't found anything for python on enabling safe search in the search


问:
MUI textfield value not changing
I am trying to make a simple curd application using React + Material-UI (MUI). I have this page which has a table with some values and an edit button which on click opens a MUI dialogue box and populates the table row value in textfield.

Here is the code for the page:

```<code>const [modalopen, setModalOpen] = useState(false);

const [modalProps, setModalProps] = useState<{ title: string; focusedTxtField: boolean; client: Client | null; }>({
  title: '',
  focusedTxtField: false,
  client: null,
});

const onModalClose = () => {
  setModalOpen(false)
  setModalProps({
    ...modalProps,
    title: '',
    focusedTxtField: false,
    client: null,
  });
};

const addModalHandle = () => {
  setModalProps({
    ...modalProps,
    title: 'Add Client',
    focusedTxtField: false,
    client: null,
  });
  setModalOpen((prev) => !prev);
};

const editModalHandle = (client: Client) => {
  setModalProps({
    ...modalProps,
    title: 'Edit Client',
    focusedTxtField: true,
    client: client,
  });
  setModalOpen((prev) => !prev);
};

return (
  <Box>
    <AddClientModal
      config={modalProps}
      handleClose={onModalClose}
      status={modalopen}
    />
</code>```

Now the problem I am facing is when I open the dialogue box and click on a texfield and close the dialogue box, then again click edit button on a different row, the dialogue box opens but the value from the previous row is retained on the textfield I clicked before and it changes back to the new value only if I click on the textfield again.

Here is the code for the dialogue box:

```<code><Dialog  fullWidth open={props.status} onClose={props.handleClose}>
  <DialogTitle
    color={'white'}
    bgcolor={'rgb(51, 171, 159)'}
    borderBottom={0.1}
  >
    {props.config.title}
  </DialogTitle>
  <Box component='form' noValidate onSubmit={handleSubmit(submitClient)}>
    <DialogContent>
      <TextField
        autoFocus
        margin='dense'
        label='Client Name'
        type='name'
        fullWidth
        focused={props.config.focusedTxtField}
        value={props.config.client?.name !== '' ?props.config.client?.name : ''}
        variant='standard'
        {...register('name', {
          required: 'Enter Client Name',
          pattern: {
            value: /^[a-z\d\-_\s]+$/i,
            message: 'Enter a valid Name',
          },
        })}
      />
</code>```

I am unable to figure out what is happening. What I am doing incorrectly?

Title: MUI textfield value not changing

Body:
I am trying to make a simple curd application using React + Material-UI (MUI). I have this page which has a table with some values and an edit button which on click opens a MUI dialogue box and populates the table row value in textfield.

Here is the code for the page:

const [modalopen, setModalOpen] = useState(false);

const [modalProps, setModalProps] = useState<{ title: string; focusedTxtField: boolean; client: Client | null; }>({
  title: '',
  focusedTxtField: false,
  client: null,
});

const onModalClose = () => {
  setModalOpen(false)
  setModalProps({
    ...modalProps,
    title: '',
    focusedTxtField: false,
    client: null,
  });
};

const addModalHandle = () => {
  setModalProps({
    ...modalProps,
    title: 'Add Client',
    focusedTxtField: false,
    client: null,
  });
  setModalOpen((prev) => !prev);
};

const editModalHandle = (client: Client) => {
  setModalProps({
    ...modalProps,
    title: 'Edit Client',
    focusedTxtField: true,
    client: client,
  });
  setModalOpen((prev) => !prev);
};

return (
  <Box>
    <AddClientModal
      config={modalProps}
      handleClose={onModalClose}
      status={modalopen}
    />

Now the problem I am facing is when I open the dialogue box and click on a texfield and close the dialogue box, then again click edit button on a different row, the dialogue box opens but the value from the previous row is retained on the textfield I clicked before and it changes back to the new value only if I click on the textfield again.

Here is the code for the dialogue box:

<Dialog  fullWidth open={props.status} onClose={props.handleClose}>
  <DialogTitle
    color={'white'}
    bgcolor={'rgb(51, 171, 159)'}
    borderBottom={0.1}
  >
    {props.config.title}
  </DialogTitle>
  <Box component='form' noValidate onSubmit={handleSubmit(submitClient)}>
    <DialogContent>
      <TextField
        autoFocus
        margin='dense'
        label='Client Name'
        type='name'
        fullWidth
        focused={props.config.focusedTxtField}
        value={props.config.client?.name !== '' ?props.config.client?.name : ''}
        variant='standard'
        {...register('name', {
          required: 'Enter Client Name',
          pattern: {
            value: /^[a-z\d\-_\s]+$/i,
            message: 'Enter a valid Name',
          },
        })}
      />

I am unable to figure out what is happening. What I am doing incorrectly?


问:
How to open a file or program in python
I'm developing a file system manager in python and I want to make so that when the user clicks a file, it opens in the screen, and if possible I want to implement an open with feature. How can I do this?

I don't even know where to start looking for an answer, because when I Google for it all I find is the open function or the with statement which reads the file to memory which is not what I want. I want to be able to, if the file is an image, use a software installed in the pc, like photos or photoshop to open the image or if it's a spreadsheet use excel to open it.

Note: I'm using Windows, if possible, I'd like a way that works on Windows, Mac and Linux.

Title: How to open a file or program in python


问:
How to prevent generating duplicate rows in CSV file
I am trying to predict positive cancer cases from a set of 9 biomarkers. The code is iterating through a list of combinations of the biomarkers, and outputting the LogReg results in the form of a CSV sheet.

However, everything works, except that multiple consecutive rows of the same results are printed for each combination. How do I solve this?
`

```<code>for index, row in df.iterrows():
      # Convert the elements in the row to strings
      row_str = [str(x) for x in row]

      # Join the elements in the row with a comma separator
      row_str = ",".join(row_str)

      combinations = row_str.split(",")

      cols = []

      # Loop through the elements and identify biomarkers
      for element in combinations:
        if element == "1":
          cols.append("Biomarker 1")
        if element == "2":
          cols.append("Biomarker 2")
        if element == "3":
          cols.append("Biomarker 3")
        if element == "4":
          cols.append("Biomarker 4")
        if element == "5":
          cols.append("Biomarker 5")
        if element == "6":
          cols.append("Biomarker 6")
        if element == "7":
          cols.append("Biomarker 7")
        if element == "8":
          cols.append("Biomarker 8")
        if element == "9":
          cols.append("Biomarker 9")

        X = df2[cols].values
        y = df2['Patient']
        y = y.astype(int)

        X_train, X_test, y_train, y_test = train_test_split(X, y, train_size = 0.45,
                                                            test_size=0.55,
                                                            random_state=15,
                                                            stratify=df2["Patient"])
        log_reg = LogisticRegression(random_state=10, solver = 'lbfgs')
        log_reg.fit(X_train, y_train)

        # predict - Predict class labels for samples in X
        log_reg.predict(X_train)
        y_pred = log_reg.predict(X_train)

        # predict_proba - Probability estimates
        pred_proba = log_reg.predict_proba(X_train)

        #Accuracy
        training_accuracy = log_reg.score(X_train, y_train)

        testing_accuracy = log_reg.score(X_test, y_test)

        #Calculate TEST FPR & TPR & Auc
        pred_proba_t = log_reg.predict_proba(X_test)
        fpr, tpr, thresholds = roc_curve(y_test, pred_proba_t[:, 1])
        auc = roc_auc_score(y_test, pred_proba_t[:, 1])

        #Calculate TRAIN FPR & TPR & Auc
        fprtr, tprtr, thresholdstr = roc_curve(y_train, pred_proba[:, 1])
        auctr = roc_auc_score(y_train, pred_proba[:, 1])

        #Create dataframe with variables
        data = {'Combinations': row_str, 'Training Accuracy': training_accuracy,
          'Testing Accuracy': testing_accuracy, 'AUC Test': auc, 'AUC_Train': auctr,
          'FPR': [fpr], 'TPR': [tpr], 'thresholds': [thresholds]}
        index = pd.RangeIndex(start=0, stop=num_rows, step=1)
        df_report = pd.DataFrame(data, index=row_index)
        df_report.to_csv("haha.csv", index=False, mode='a', sep=',')
</code>```

CSV Sheet

Body:
I am trying to predict positive cancer cases from a set of 9 biomarkers. The code is iterating through a list of combinations of the biomarkers, and outputting the LogReg results in the form of a CSV sheet.

However, everything works, except that multiple consecutive rows of the same results are printed for each combination. How do I solve this?
`

for index, row in df.iterrows():
      # Convert the elements in the row to strings
      row_str = [str(x) for x in row]

      # Join the elements in the row with a comma separator
      row_str = ",".join(row_str)

      combinations = row_str.split(",")

      cols = []

      # Loop through the elements and identify biomarkers
      for element in combinations:
        if element == "1":
          cols.append("Biomarker 1")
        if element == "2":
          cols.append("Biomarker 2")
        if element == "3":
          cols.append("Biomarker 3")
        if element == "4":
          cols.append("Biomarker 4")
        if element == "5":
          cols.append("Biomarker 5")
        if element == "6":
          cols.append("Biomarker 6")
        if element == "7":
          cols.append("Biomarker 7")
        if element == "8":
          cols.append("Biomarker 8")
        if element == "9":
          cols.append("Biomarker 9")

        X = df2[cols].values
        y = df2['Patient']
        y = y.astype(int)

        X_train, X_test, y_train, y_test = train_test_split(X, y, train_size = 0.45,
                                                            test_size=0.55,
                                                            random_state=15,
                                                            stratify=df2["Patient"])
        log_reg = LogisticRegression(random_state=10, solver = 'lbfgs')
        log_reg.fit(X_train, y_train)

        # predict - Predict class labels for samples in X
        log_reg.predict(X_train)
        y_pred = log_reg.predict(X_train)

        # predict_proba - Probability estimates
        pred_proba = log_reg.predict_proba(X_train)

        #Accuracy
        training_accuracy = log_reg.score(X_train, y_train)

        testing_accuracy = log_reg.score(X_test, y_test)

        #Calculate TEST FPR & TPR & Auc
        pred_proba_t = log_reg.predict_proba(X_test)
        fpr, tpr, thresholds = roc_curve(y_test, pred_proba_t[:, 1])
        auc = roc_auc_score(y_test, pred_proba_t[:, 1])

        #Calculate TRAIN FPR & TPR & Auc
        fprtr, tprtr, thresholdstr = roc_curve(y_train, pred_proba[:, 1])
        auctr = roc_auc_score(y_train, pred_proba[:, 1])

        #Create dataframe with variables
        data = {'Combinations': row_str, 'Training Accuracy': training_accuracy,
          'Testing Accuracy': testing_accuracy, 'AUC Test': auc, 'AUC_Train': auctr,
          'FPR': [fpr], 'TPR': [tpr], 'thresholds': [thresholds]}
        index = pd.RangeIndex(start=0, stop=num_rows, step=1)
        df_report = pd.DataFrame(data, index=row_index)
        df_report.to_csv("haha.csv", index=False, mode='a', sep=',')

CSV Sheet


问:
Errow when displaying the details of a patient when I'm using this serial format LNSD_123122_LMV
Hello how can I fix this, Fatal error: Uncaught mysqli_sql_exception: Unknown column 'LNSD_123122_LMV' in 'where clause' in C:\xampp\htdocs\HMO_Home\view_medicalrecord.php:89 Stack trace: #0 C:\xampp\htdocs\HMO_Home\view_medicalrecord.php(89): mysqli->query('SELECT * FROM m...') #1 {main} thrown in C:\xampp\htdocs\HMO_Home\view_medicalrecord.php on line 89

this error show when I'm using this serial format (LNSD_123122_LMV), but when the patients has pure number of format (029029) it showing its details.

heres is my query code

```<code>                 <?php

                    $familynumber = $row['family_number'];

                    $sql1 = "SELECT * FROM medical_itr WHERE family_number LIKE
                    $familynumber";
                    $medical_itr = $con->query($sql1) or die ($con->error);
                    $row = $medical_itr->fetch_assoc();

                 ?>
</code>```

Body:
Hello how can I fix this, Fatal error: Uncaught mysqli_sql_exception: Unknown column 'LNSD_123122_LMV' in 'where clause' in C:\xampp\htdocs\HMO_Home\view_medicalrecord.php:89 Stack trace: #0 C:\xampp\htdocs\HMO_Home\view_medicalrecord.php(89): mysqli->query('SELECT * FROM m...') #1 {main} thrown in C:\xampp\htdocs\HMO_Home\view_medicalrecord.php on line 89

this error show when I'm using this serial format (LNSD_123122_LMV), but when the patients has pure number of format (029029) it showing its details.

heres is my query code

                 <?php

                    $familynumber = $row['family_number'];

                    $sql1 = "SELECT * FROM medical_itr WHERE family_number LIKE
                    $familynumber";
                    $medical_itr = $con->query($sql1) or die ($con->error);
                    $row = $medical_itr->fetch_assoc();

                 ?>


问:
MongoDB find in the collection and display the column without knowing what is in it. Python
I have a collection in MongoDB, I need to find a collection where: "user_id" : 965554753650192394, and in this collection there is a column with `"coins"' and I need to display the data of this column

I tried to implement it via

user = collection.find_one({})
print(user)
```

But this method is not suitable because initially you need to know the contents of the column.
That is, I need to find the "user_id", and then find the "coins" column data in this collection and display them in the column and display data from this column(python)

Body:
I have a collection in MongoDB, I need to find a collection where: "user_id" : 965554753650192394, and in this collection there is a column with `"coins"' and I need to display the data of this column

I tried to implement it via

user = collection.find_one({})
print(user)

But this method is not suitable because initially you need to know the contents of the column.
That is, I need to find the "user_id", and then find the "coins" column data in this collection and display them in the column and display data from this column(python)


问:
Matrix multiplication quickly overflows in backpropagation equations
I'm trying to do my own neural network implementation from scratch, but I'm having some problems. Specifically, with the way one of the terms grows exponentially as iterations advance, which makes the accuracy quickly reach a plateau and gradient descent not find any optimal solution.

The equations I'm using I reached on my own, while studying some of the available resources online. I chose to write my own equations so I could understand them better:

 ... (1) where L is the last layer, and the hadamard product is being performed, and A is the values from the Lth layer after the activation function, Z is the values before the activation function is applied.

... (2) where W is the matrix of weights from the i+1th layer, with the number of rows is equal to the number of neurons in the i+1th layer and columns equals the number of neurones in the ith layer.

... (3)

... (4)

I struggled a lot with these, but I finally was able to make it work and keep all the correct dimensions of each matrix. Now, implementing these equations into my code:

```<code>def back_prop(self):
    delta = np.multiply(self.a_record[-1] - self.target, self.layers[-1].prime(self.z_record[-1]))

    for i, layer in reversed(list(enumerate(self.layers))):
        dw = np.matmul(delta, self.a_record[i].T)
        db = np.matmul(delta, np.ones((self.n, 1)))

        self.dw_record.append(dw)
        self.db_record.append(db)

        if i > 0:
            delta = np.multiply(np.matmul(self.w[i].T, delta), layer.prime(self.z_record[i - 1]))
</code>```

a_record and z_record are lists that store the arrays corresponding to each layer. Same for dw and db records. I wrote it like this so it is as close as possible to my equations.
Problem comes once I start to measure performance on any dataset, which remain stagnant after just a couple of iterations. I get this warning, since it's not an error it doesn't stop the script.

```<code>RuntimeWarning: overflow encountered in multiply delta = np.multiply(self.a_record[-1] - self.target, self.layers[-1].prime(self.z_record[-1]))
</code>```

When I analize the values that come from delta I find that the value of delta is growing way too fast, it starts with small values but grows up to e+200 magnitude and then it just returns infinity, which makes the next delta a bunch of np.nan and all the weights and biases to stop changing.
I'm fairly certain that the equations are equivalent to other equations I found in other neural networks, so I don't really know why this is happening. I don't imagine the values from any randomly generated dataset to be so insanely big that it overflows after just a couple of iterations.
I will post the whole class I made:

```<code>class Network():
def __init__(self, input, target, layers, alpha = 0.1, iter= 1000):
    self.input = np.array(input).T
    self.y_true = target
    #self.target = np.array(one_hot(target)).T
    self.target = np.array(target).T
    self.layers = layers
    self.alpha = alpha
    self.iter = iter
    self.n = len(input)

    self.w = []
    self.b = []

    for i, layer in enumerate(layers):
        if i == 0:
            self.w.append(np.random.rand(layer.neurons, len(self.input)) - 0.5)
        else:
            self.w.append(np.random.rand(layer.neurons, layers[i - 1].neurons) - 0.5)

        self.b.append(np.random.rand(layer.neurons, 1) - 0.5)

    self.a_record = []
    self.z_record = []

    self.dw_record = []
    self.db_record = []

def forward_prop(self):
    a = self.input
    self.a_record.append(a)

    for i, layer in enumerate(self.layers):

        z = np.matmul(self.w[i], a) + self.b[i].reshape(-1, 1)
        a = layer.func(z)

        self.z_record.append(z)
        self.a_record.append(a)

    self.output = a

def back_prop(self):
    delta = np.multiply(self.a_record[-1] - self.target, self.layers[-1].prime(self.z_record[-1]))

    print(delta)
    for i, layer in reversed(list(enumerate(self.layers))):
        dw = np.matmul(delta, self.a_record[i].T)
        db = np.matmul(delta, np.ones((self.n, 1)))

        self.dw_record.append(dw)
        self.db_record.append(db)

        print(self.a_record[i].T)
        print("------------------------------------------")

        if i > 0:
            delta = np.multiply(np.matmul(self.w[i].T, delta), layer.prime(self.z_record[i - 1]))

def gradient_desc(self):
    w_copy = self.w
    for i, (w, dw) in enumerate(zip(w_copy, self.dw_record[::-1])):
        self.w[i] = w - self.alpha*dw

    b_copy = self.b
    for i, (b, db) in enumerate(zip(b_copy, self.db_record[::-1])):
        self.b[i] = b - self.alpha*db

def fit(self):
    for i in range(self.iter):
        self.forward_prop()
        self.back_prop()
        self.gradient_desc()

        if i % 40 == 0:
            print(f"Iteration: {i + 1} / {self.iter} =====================================")
            print(f"Accuracy: {get_accuracy(self.output, self.y_true)}")
</code>```

I've been trying for a couple days now to figure this out, but I don't seem to find the error or maybe a workaround to prevent overflow. Maybe the equations are wrong from the start? Please any help would be greatly appreciated, thank you in advance.

Body:
I'm trying to do my own neural network implementation from scratch, but I'm having some problems. Specifically, with the way one of the terms grows exponentially as iterations advance, which makes the accuracy quickly reach a plateau and gradient descent not find any optimal solution.

The equations I'm using I reached on my own, while studying some of the available resources online. I chose to write my own equations so I could understand them better:

 ... (1) where L is the last layer, and the hadamard product is being performed, and A is the values from the Lth layer after the activation function, Z is the values before the activation function is applied.

... (2) where W is the matrix of weights from the i+1th layer, with the number of rows is equal to the number of neurons in the i+1th layer and columns equals the number of neurones in the ith layer.

... (3)

... (4)

I struggled a lot with these, but I finally was able to make it work and keep all the correct dimensions of each matrix. Now, implementing these equations into my code:

def back_prop(self):
    delta = np.multiply(self.a_record[-1] - self.target, self.layers[-1].prime(self.z_record[-1]))

    for i, layer in reversed(list(enumerate(self.layers))):
        dw = np.matmul(delta, self.a_record[i].T)
        db = np.matmul(delta, np.ones((self.n, 1)))

        self.dw_record.append(dw)
        self.db_record.append(db)

        if i > 0:
            delta = np.multiply(np.matmul(self.w[i].T, delta), layer.prime(self.z_record[i - 1]))

a_record and z_record are lists that store the arrays corresponding to each layer. Same for dw and db records. I wrote it like this so it is as close as possible to my equations.
Problem comes once I start to measure performance on any dataset, which remain stagnant after just a couple of iterations. I get this warning, since it's not an error it doesn't stop the script.

RuntimeWarning: overflow encountered in multiply delta = np.multiply(self.a_record[-1] - self.target, self.layers[-1].prime(self.z_record[-1]))

When I analize the values that come from delta I find that the value of delta is growing way too fast, it starts with small values but grows up to e+200 magnitude and then it just returns infinity, which makes the next delta a bunch of np.nan and all the weights and biases to stop changing.
I'm fairly certain that the equations are equivalent to other equations I found in other neural networks, so I don't really know why this is happening. I don't imagine the values from any randomly generated dataset to be so insanely big that it overflows after just a couple of iterations.
I will post the whole class I made:

class Network():
def __init__(self, input, target, layers, alpha = 0.1, iter= 1000):
    self.input = np.array(input).T
    self.y_true = target
    #self.target = np.array(one_hot(target)).T
    self.target = np.array(target).T
    self.layers = layers
    self.alpha = alpha
    self.iter = iter
    self.n = len(input)

    self.w = []
    self.b = []

    for i, layer in enumerate(layers):
        if i == 0:
            self.w.append(np.random.rand(layer.neurons, len(self.input)) - 0.5)
        else:
            self.w.append(np.random.rand(layer.neurons, layers[i - 1].neurons) - 0.5)

        self.b.append(np.random.rand(layer.neurons, 1) - 0.5)

    self.a_record = []
    self.z_record = []

    self.dw_record = []
    self.db_record = []

def forward_prop(self):
    a = self.input
    self.a_record.append(a)

    for i, layer in enumerate(self.layers):

        z = np.matmul(self.w[i], a) + self.b[i].reshape(-1, 1)
        a = layer.func(z)

        self.z_record.append(z)
        self.a_record.append(a)

    self.output = a

def back_prop(self):
    delta = np.multiply(self.a_record[-1] - self.target, self.layers[-1].prime(self.z_record[-1]))

    print(delta)
    for i, layer in reversed(list(enumerate(self.layers))):
        dw = np.matmul(delta, self.a_record[i].T)
        db = np.matmul(delta, np.ones((self.n, 1)))

        self.dw_record.append(dw)
        self.db_record.append(db)

        print(self.a_record[i].T)
        print("------------------------------------------")

        if i > 0:
            delta = np.multiply(np.matmul(self.w[i].T, delta), layer.prime(self.z_record[i - 1]))

def gradient_desc(self):
    w_copy = self.w
    for i, (w, dw) in enumerate(zip(w_copy, self.dw_record[::-1])):
        self.w[i] = w - self.alpha*dw

    b_copy = self.b
    for i, (b, db) in enumerate(zip(b_copy, self.db_record[::-1])):
        self.b[i] = b - self.alpha*db

def fit(self):
    for i in range(self.iter):
        self.forward_prop()
        self.back_prop()
        self.gradient_desc()

        if i % 40 == 0:
            print(f"Iteration: {i + 1} / {self.iter} =====================================")
            print(f"Accuracy: {get_accuracy(self.output, self.y_true)}")

I've been trying for a couple days now to figure this out, but I don't seem to find the error or maybe a workaround to prevent overflow. Maybe the equations are wrong from the start? Please any help would be greatly appreciated, thank you in advance.


问:
Spring OAuth2: Error when redirecting to the access_token from Todoist OAuth2
I am trying to create a simple OAuth2 Client to access Todoist API features like Todoist Webhook. I am using Spring Boot 3.0 with Spring OAuth2 Client. When get redirected to the access_token this error occurs:

```<code>2022-12-30T21:22:41.948-03:00 ERROR 3858 --- [p-nio-80-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception

org.springframework.http.converter.HttpMessageNotReadableException: An error occurred reading the OAuth 2.0 Error: JSON parse error: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
    at org.springframework.security.oauth2.core.http.converter.OAuth2ErrorHttpMessageConverter.readInternal(OAuth2ErrorHttpMessageConverter.java:84) ~[spring-security-oauth2-core-6.0.1.jar:6.0.1]
    at org.springframework.security.oauth2.core.http.converter.OAuth2ErrorHttpMessageConverter.readInternal(OAuth2ErrorHttpMessageConverter.java:48) ~[spring-security-oauth2-core-6.0.1.jar:6.0.1]
    at org.springframework.http.converter.AbstractHttpMessageConverter.read(AbstractHttpMessageConverter.java:199) ~[spring-web-6.0.3.jar:6.0.3]
    at org.springframework.security.oauth2.client.http.OAuth2ErrorResponseErrorHandler.handleError(OAuth2ErrorResponseErrorHandler.java:64) ~[spring-security-oauth2-client-6.0.1.jar:6.0.1]
    at org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63) ~[spring-web-6.0.3.jar:6.0.3]
    at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:915) ~[spring-web-6.0.3.jar:6.0.3]
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:864) ~[spring-web-6.0.3.jar:6.0.3]
    at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:704) ~[spring-web-6.0.3.jar:6.0.3]
    at org.springframework.security.oauth2.client.endpoint.DefaultAuthorizationCodeTokenResponseClient.getResponse(DefaultAuthorizationCodeTokenResponseClient.java:88) ~[spring-security-oauth2-client-6.0.1.jar:6.0.1]
    at org.springframework.security.oauth2.client.endpoint.DefaultAuthorizationCodeTokenResponseClient.getTokenResponse(DefaultAuthorizationCodeTokenResponseClient.java:77) ~[spring-security-oauth2-client-6.0.1.jar:6.0.1]
    at org.springframework.security.oauth2.client.endpoint.DefaultAuthorizationCodeTokenResponseClient.getTokenResponse(DefaultAuthorizationCodeTokenResponseClient.java:56) ~[spring-security-oauth2-client-6.0.1.jar:6.0.1]
    at org.springframework.security.oauth2.client.authentication.OAuth2AuthorizationCodeAuthenticationProvider.authenticate(OAuth2AuthorizationCodeAuthenticationProvider.java:85) ~[spring-security-oauth2-client-6.0.1.jar:6.0.1]
    at org.springframework.security.oauth2.client.authentication.OAuth2LoginAuthenticationProvider.authenticate(OAuth2LoginAuthenticationProvider.java:107) ~[spring-security-oauth2-client-6.0.1.jar:6.0.1]
    at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:182) ~[spring-security-core-6.0.1.jar:6.0.1]
</code>```

I believe Todoist API is returning  an HTML page rather than a the access token and token type but not sure. This is my applications.yml file:

```<code>server:
  port: 80
spring:
  security:
    oauth2:
      client:
        registration:
          todoist:
            client-id: ${TODOIST_CLIENT_ID}
            client-secret: ${TODOIST_CLIENT_SECRET}
            scope: data:read_write
            authorization-grant-type: authorization_code
            redirect-uri: "http://localhost/login/oauth2/code/{registrationId}"
            client-authentication-method: post
        provider:
          todoist:
            authorization-uri: https://todoist.com/oauth/authorize
            token-uri: https://todoist.com/oauth/access_token
</code>```

Is there something wrong with my yaml file? Do I need to create a custom handler for the response from Todoist?

I tried to debug the RestTemplate calls but they do not show me the result of the request with the access tokens.

Body:
I am trying to create a simple OAuth2 Client to access Todoist API features like Todoist Webhook. I am using Spring Boot 3.0 with Spring OAuth2 Client. When get redirected to the access_token this error occurs:

2022-12-30T21:22:41.948-03:00 ERROR 3858 --- [p-nio-80-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception

org.springframework.http.converter.HttpMessageNotReadableException: An error occurred reading the OAuth 2.0 Error: JSON parse error: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
    at org.springframework.security.oauth2.core.http.converter.OAuth2ErrorHttpMessageConverter.readInternal(OAuth2ErrorHttpMessageConverter.java:84) ~[spring-security-oauth2-core-6.0.1.jar:6.0.1]
    at org.springframework.security.oauth2.core.http.converter.OAuth2ErrorHttpMessageConverter.readInternal(OAuth2ErrorHttpMessageConverter.java:48) ~[spring-security-oauth2-core-6.0.1.jar:6.0.1]
    at org.springframework.http.converter.AbstractHttpMessageConverter.read(AbstractHttpMessageConverter.java:199) ~[spring-web-6.0.3.jar:6.0.3]
    at org.springframework.security.oauth2.client.http.OAuth2ErrorResponseErrorHandler.handleError(OAuth2ErrorResponseErrorHandler.java:64) ~[spring-security-oauth2-client-6.0.1.jar:6.0.1]
    at org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63) ~[spring-web-6.0.3.jar:6.0.3]
    at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:915) ~[spring-web-6.0.3.jar:6.0.3]
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:864) ~[spring-web-6.0.3.jar:6.0.3]
    at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:704) ~[spring-web-6.0.3.jar:6.0.3]
    at org.springframework.security.oauth2.client.endpoint.DefaultAuthorizationCodeTokenResponseClient.getResponse(DefaultAuthorizationCodeTokenResponseClient.java:88) ~[spring-security-oauth2-client-6.0.1.jar:6.0.1]
    at org.springframework.security.oauth2.client.endpoint.DefaultAuthorizationCodeTokenResponseClient.getTokenResponse(DefaultAuthorizationCodeTokenResponseClient.java:77) ~[spring-security-oauth2-client-6.0.1.jar:6.0.1]
    at org.springframework.security.oauth2.client.endpoint.DefaultAuthorizationCodeTokenResponseClient.getTokenResponse(DefaultAuthorizationCodeTokenResponseClient.java:56) ~[spring-security-oauth2-client-6.0.1.jar:6.0.1]
    at org.springframework.security.oauth2.client.authentication.OAuth2AuthorizationCodeAuthenticationProvider.authenticate(OAuth2AuthorizationCodeAuthenticationProvider.java:85) ~[spring-security-oauth2-client-6.0.1.jar:6.0.1]
    at org.springframework.security.oauth2.client.authentication.OAuth2LoginAuthenticationProvider.authenticate(OAuth2LoginAuthenticationProvider.java:107) ~[spring-security-oauth2-client-6.0.1.jar:6.0.1]
    at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:182) ~[spring-security-core-6.0.1.jar:6.0.1]

I believe Todoist API is returning  an HTML page rather than a the access token and token type but not sure. This is my applications.yml file:

server:
  port: 80
spring:
  security:
    oauth2:
      client:
        registration:
          todoist:
            client-id: ${TODOIST_CLIENT_ID}
            client-secret: ${TODOIST_CLIENT_SECRET}
            scope: data:read_write
            authorization-grant-type: authorization_code
            redirect-uri: "http://localhost/login/oauth2/code/{registrationId}"
            client-authentication-method: post
        provider:
          todoist:
            authorization-uri: https://todoist.com/oauth/authorize
            token-uri: https://todoist.com/oauth/access_token

Is there something wrong with my yaml file? Do I need to create a custom handler for the response from Todoist?

I tried to debug the RestTemplate calls but they do not show me the result of the request with the access tokens.


问:
Android app is crashing but i can't reproduce the error. It looks like a native crash
I have a crash in crashlytics and i can't reproduce it all the time. This crash started since i updated the app to API lvl 32.

Target versions:

```<code>minSdkVersion 21
targetSdkVersion 32
compileSdkVersion 32
</code>```

Here are some information about the crash. There is a long file so i will upload the last lines of code i see in crashlytics. The file is kinda long to upload it here i think. If you need more info let me know please.

```<code>Signal Catcher (runnable):tid=6 systid=8150
#00 pc 0x377c45 libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, BacktraceMap*, char const*, art::ArtMethod*, void*, bool) + 76)
#01 pc 0x446fc7 libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool, BacktraceMap*, bool) const + 386)
#02 pc 0x442993 libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool, BacktraceMap*, bool) const + 34)
#03 pc 0x45f569 libart.so (art::DumpCheckpoint::Run(art::Thread*) + 664)
#04 pc 0x45ab43 libart.so (art::ThreadList::RunCheckpoint(art::Closure*, art::Closure*) + 354)
#05 pc 0x45a07b libart.so (art::ThreadList::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool) + 1486)
#06 pc 0x459775 libart.so (art::ThreadList::DumpForSigQuit(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) + 604)
#07 pc 0x411eeb libart.so (art::Runtime::DumpForSigQuit(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) + 130)
#08 pc 0x421aa3 libart.so (art::SignalCatcher::HandleSigQuit() + 1046)
#09 pc 0x420e3b libart.so (art::SignalCatcher::Run(void*) + 290)
#10 pc 0xaaf33 libc.so (__pthread_start(void*) + 40)
#11 pc 0x642e3 libc.so (__start_thread + 30)

Jit thread pool worker thread 0 (native):tid=7 systid=8151
#00 pc 0x5e4a8 libc.so (syscall + 28)
#01 pc 0x131bb3 libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*) + 82)
#02 pc 0x460a87 libart.so (art::ThreadPool::GetTask(art::Thread*) + 58)
#03 pc 0x460199 libart.so (art::ThreadPoolWorker::Run() + 72)
#04 pc 0x45fdd9 libart.so (art::ThreadPoolWorker::Callback(void*) + 116)
#05 pc 0xaaf33 libc.so (__pthread_start(void*) + 40)
#06 pc 0x642e3 libc.so (__start_thread + 30)
</code>```

Since i upgraded the app to android 12 and i started testing it now i have a crash that i can't reproduce it all the time.
I tested on two different devices:
Galaxy A32/ Android 12
Galaxy Tab A / Android 11

Body:
I have a crash in crashlytics and i can't reproduce it all the time. This crash started since i updated the app to API lvl 32.

Target versions:

minSdkVersion 21
targetSdkVersion 32
compileSdkVersion 32

Here are some information about the crash. There is a long file so i will upload the last lines of code i see in crashlytics. The file is kinda long to upload it here i think. If you need more info let me know please.

Signal Catcher (runnable):tid=6 systid=8150
#00 pc 0x377c45 libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, BacktraceMap*, char const*, art::ArtMethod*, void*, bool) + 76)
#01 pc 0x446fc7 libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool, BacktraceMap*, bool) const + 386)
#02 pc 0x442993 libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool, BacktraceMap*, bool) const + 34)
#03 pc 0x45f569 libart.so (art::DumpCheckpoint::Run(art::Thread*) + 664)
#04 pc 0x45ab43 libart.so (art::ThreadList::RunCheckpoint(art::Closure*, art::Closure*) + 354)
#05 pc 0x45a07b libart.so (art::ThreadList::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool) + 1486)
#06 pc 0x459775 libart.so (art::ThreadList::DumpForSigQuit(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) + 604)
#07 pc 0x411eeb libart.so (art::Runtime::DumpForSigQuit(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) + 130)
#08 pc 0x421aa3 libart.so (art::SignalCatcher::HandleSigQuit() + 1046)
#09 pc 0x420e3b libart.so (art::SignalCatcher::Run(void*) + 290)
#10 pc 0xaaf33 libc.so (__pthread_start(void*) + 40)
#11 pc 0x642e3 libc.so (__start_thread + 30)

Jit thread pool worker thread 0 (native):tid=7 systid=8151
#00 pc 0x5e4a8 libc.so (syscall + 28)
#01 pc 0x131bb3 libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*) + 82)
#02 pc 0x460a87 libart.so (art::ThreadPool::GetTask(art::Thread*) + 58)
#03 pc 0x460199 libart.so (art::ThreadPoolWorker::Run() + 72)
#04 pc 0x45fdd9 libart.so (art::ThreadPoolWorker::Callback(void*) + 116)
#05 pc 0xaaf33 libc.so (__pthread_start(void*) + 40)
#06 pc 0x642e3 libc.so (__start_thread + 30)

Since i upgraded the app to android 12 and i started testing it now i have a crash that i can't reproduce it all the time.
I tested on two different devices:
Galaxy A32/ Android 12
Galaxy Tab A / Android 11


问:
I have a react js and node js app and cant auto start index.js (the backend file)
I have 2 main files.

App.js

index.js
my target: Deploy the website.
the problem: index.js(backend file) not running when deployed.
solution: automatically run the command node index.js.
but the thing is...
I tried implementing stuff in json and its not working...

```<code>    "start":  "set PORT=3001 && react-scripts start && node index.js"
</code>```

such as this line...

Body:
I have 2 main files.

App.js

index.js
my target: Deploy the website.
the problem: index.js(backend file) not running when deployed.
solution: automatically run the command node index.js.
but the thing is...
I tried implementing stuff in json and its not working...

    "start":  "set PORT=3001 && react-scripts start && node index.js"

such as this line...


问:
Library not loaded: @rpath/Sample_320EDFA1A561D4D9_PackageProduct.framework Error on AppLaunch on device
Created a Swift Package and it works fine on Simulator but fails to run on device with Library not loaded error on device on Launch.

Library not loaded: @rpath/Sample_320EDFA1A561D4D9_PackageProduct.framework/Sample_320EDFA1A561D4D9_PackageProduct


问:
EF Core LogIn Taking a Long Time
I'm trying to make an endpoint for logging in with a token in ASP.NET Core. The API is using EFCore, but my code is taking a long time to log me in.

This is the service:

```<code>        public async Task<AuthModel> GetTokenAsync(UserLoginDto model)
        {

            var authModel = new AuthModel();

            var user = await _userManager.FindByEmailAsync(model.Email);

            if (user is null || !await _userManager.CheckPasswordAsync(user, model.Password))
            {
                authModel.Message = "Email or Password is incorrect!";
                return authModel;
            }

            var jwtSecurityToken = await CreateJwtToken(user);
            var rolesList = await _userManager.GetRolesAsync(user);

            authModel.IsAuthenticated = true;
            authModel.Token = new JwtSecurityTokenHandler().WriteToken(jwtSecurityToken);
            authModel.Email = user.Email;
            authModel.Username = user.UserName;
            //authModel.ExpiresOn = jwtSecurityToken.ValidTo;
            authModel.Roles = rolesList.ToList();
            if (user.RefreshTokens.Any(t => t.IsActive))
            {
                var activeRefreshToken = user.RefreshTokens.FirstOrDefault(t => t.IsActive);
                authModel.RefreshToken = activeRefreshToken.Token;
                authModel.RefreshTokenExpiration = activeRefreshToken.ExpiresOn;
            }
            else
            {
                var refreshToken = GetRefreshToken();
                authModel.RefreshToken = refreshToken.Token;
                authModel.RefreshTokenExpiration = refreshToken.ExpiresOn;
                user.RefreshTokens.Add(refreshToken);
                await _userManager.UpdateAsync(user);
            }

            return authModel;
        }
</code>```

Endpoint:

```<code>    [HttpPost]
    public async Task<ActionResult> Login([FromBody]UserLoginDto loginDto)
    {
        if (!ModelState.IsValid)
            return BadRequest(ModelState);
        var result = await _authService.GetTokenAsync(loginDto);

        if (!string.IsNullOrEmpty(result.RefreshToken))
        {
            _authService.SetRefreshTokenInCookie(result.RefreshToken, result.RefreshTokenExpiration);
        }
        return Ok(result);
    }
</code>```

Title: EF Core LogIn Taking a Long Time

Body:
I'm trying to make an endpoint for logging in with a token in ASP.NET Core. The API is using EFCore, but my code is taking a long time to log me in.

This is the service:

        public async Task<AuthModel> GetTokenAsync(UserLoginDto model)
        {

            var authModel = new AuthModel();

            var user = await _userManager.FindByEmailAsync(model.Email);

            if (user is null || !await _userManager.CheckPasswordAsync(user, model.Password))
            {
                authModel.Message = "Email or Password is incorrect!";
                return authModel;
            }

            var jwtSecurityToken = await CreateJwtToken(user);
            var rolesList = await _userManager.GetRolesAsync(user);

            authModel.IsAuthenticated = true;
            authModel.Token = new JwtSecurityTokenHandler().WriteToken(jwtSecurityToken);
            authModel.Email = user.Email;
            authModel.Username = user.UserName;
            //authModel.ExpiresOn = jwtSecurityToken.ValidTo;
            authModel.Roles = rolesList.ToList();
            if (user.RefreshTokens.Any(t => t.IsActive))
            {
                var activeRefreshToken = user.RefreshTokens.FirstOrDefault(t => t.IsActive);
                authModel.RefreshToken = activeRefreshToken.Token;
                authModel.RefreshTokenExpiration = activeRefreshToken.ExpiresOn;
            }
            else
            {
                var refreshToken = GetRefreshToken();
                authModel.RefreshToken = refreshToken.Token;
                authModel.RefreshTokenExpiration = refreshToken.ExpiresOn;
                user.RefreshTokens.Add(refreshToken);
                await _userManager.UpdateAsync(user);
            }

            return authModel;
        }

Endpoint:

    [HttpPost]
    public async Task<ActionResult> Login([FromBody]UserLoginDto loginDto)
    {
        if (!ModelState.IsValid)
            return BadRequest(ModelState);
        var result = await _authService.GetTokenAsync(loginDto);

        if (!string.IsNullOrEmpty(result.RefreshToken))
        {
            _authService.SetRefreshTokenInCookie(result.RefreshToken, result.RefreshTokenExpiration);
        }
        return Ok(result);
    }


问:
When I upload sound file and convert sampling rate with librosa, memory usage is too big
I am developing a web using flask + nginx + gunicorn to convert sampling rate on file upload.
When I upload and convert an audio file(mp3 or wav) of about 40MB, I could see a sharp increase in RAM usage.
Although I use aws lightsail(memory 2GB), instantaneous memory usage is over

Log are
At nginx error.log, upstream prematurely closed connection while reading response header from upstream
At sys.log,  OOM and memory killed

I'm using virtual memory to make one file work somehow, but I want to make it simultaneously used by several people, so I'm trying to solve the memory problem.

Question

Why does the upload consume much more memory than the size of the file?

What is the solution?

code is using librosa.
Function memory_usage was added to see memory usage history.

[#1] memory usage:  153.62500 MB

[#2] memory usage:  488.25391 MB

[#3] memory usage:  219.86719 MB

[#4] memory usage:  220.30078 MB

'''
'

```<code>import psutil
from flask import Flask, render_template, request, send_file
import librosa, soundfile

import librosa.display
from werkzeug.utils import secure_filename
from datetime import datetime
import os
import io
from pydub import AudioSegment

#memory
def memory_usage(message: str = 'debug'):
    # current process RAM usage
    p = psutil.Process()
    rss = p.memory_info().rss / 2 ** 20 # Bytes to MB
    print(f"[{message}] memory usage: {rss: 10.5f} MB")
    file = open(f"C:\\Users\\kimkunyu\\Desktop\\mmmmm.txt","a")
    file.write(f"[{message}] memory usage: {rss: 10.5f} MB")
    file.close()

def create_app():
    app = Flask(__name__)

    @app.route('/')
    def hello_pybo():
        return render_template('main.html')

    @app.route('/upload', methods=['POST', 'GET'])
    def upload():
        if request.method == 'POST':
            audio_data = request.files["lc"]
            memory_usage('#1')
            if audio_data:
                filename = secure_filename(audio_data.filename)
                src = f"pybo/sound/{filename}"
                audio_data.save(src)
                stem, fileExtension = os.path.splitext(filename)
                if fileExtension == '.mp3':
                    audSeg = AudioSegment.from_mp3(src)
                    ##
                    os.remove(src)
                    src = f"pybo/sound/{stem}" + '.wav'
                    audSeg.export(src, format="wav")

                sr = librosa.get_samplerate(src)
                memory_usage('#2')
                audio_data, sr = librosa.load(src, sr=sr // 6)
                # print(sr)
                # print(audio_data.shape)
                # print(audio_data.dtype)
                # print(len(audio_data))

                memory_usage('#3')
                new_filename = f'{filename.split(".")[0]}_{str(datetime.now())}.wav'
                new_filename = new_filename.replace(':', "_")
                os.remove(src)

                save_location = f'pybo/output/{new_filename}'

                soundfile.write(save_location, audio_data, sr, format='WAV')
                memory_usage('#4')

                return render_template("download.html", save_location=save_location)

    @app.route('/download', methods=['POST', 'GET'])
    def download():
        save_location = request.form["save_location"]
        with open(save_location, 'rb') as fo:
            return_data = io.BytesIO()
            memory_usage('#5')

            return_data.write(fo.read())
            memory_usage('#6')
        # (after writing, cursor will be at last byte, so move it to start)
        return_data.seek(0)

        os.remove(save_location)
        return send_file(return_data, as_attachment=True, download_name='converted_file.wav')
    return app`
</code>```
```<code></code>```

Body:
I am developing a web using flask + nginx + gunicorn to convert sampling rate on file upload.
When I upload and convert an audio file(mp3 or wav) of about 40MB, I could see a sharp increase in RAM usage.
Although I use aws lightsail(memory 2GB), instantaneous memory usage is over

Log are
At nginx error.log, upstream prematurely closed connection while reading response header from upstream
At sys.log,  OOM and memory killed

I'm using virtual memory to make one file work somehow, but I want to make it simultaneously used by several people, so I'm trying to solve the memory problem.

Question

Why does the upload consume much more memory than the size of the file?

What is the solution?

code is using librosa.
Function memory_usage was added to see memory usage history.

[#1] memory usage:  153.62500 MB

[#2] memory usage:  488.25391 MB

[#3] memory usage:  219.86719 MB

[#4] memory usage:  220.30078 MB

'''
'

import psutil
from flask import Flask, render_template, request, send_file
import librosa, soundfile

import librosa.display
from werkzeug.utils import secure_filename
from datetime import datetime
import os
import io
from pydub import AudioSegment

#memory
def memory_usage(message: str = 'debug'):
    # current process RAM usage
    p = psutil.Process()
    rss = p.memory_info().rss / 2 ** 20 # Bytes to MB
    print(f"[{message}] memory usage: {rss: 10.5f} MB")
    file = open(f"C:\\Users\\kimkunyu\\Desktop\\mmmmm.txt","a")
    file.write(f"[{message}] memory usage: {rss: 10.5f} MB")
    file.close()

def create_app():
    app = Flask(__name__)

    @app.route('/')
    def hello_pybo():
        return render_template('main.html')

    @app.route('/upload', methods=['POST', 'GET'])
    def upload():
        if request.method == 'POST':
            audio_data = request.files["lc"]
            memory_usage('#1')
            if audio_data:
                filename = secure_filename(audio_data.filename)
                src = f"pybo/sound/{filename}"
                audio_data.save(src)
                stem, fileExtension = os.path.splitext(filename)
                if fileExtension == '.mp3':
                    audSeg = AudioSegment.from_mp3(src)
                    ##
                    os.remove(src)
                    src = f"pybo/sound/{stem}" + '.wav'
                    audSeg.export(src, format="wav")

                sr = librosa.get_samplerate(src)
                memory_usage('#2')
                audio_data, sr = librosa.load(src, sr=sr // 6)
                # print(sr)
                # print(audio_data.shape)
                # print(audio_data.dtype)
                # print(len(audio_data))

                memory_usage('#3')
                new_filename = f'{filename.split(".")[0]}_{str(datetime.now())}.wav'
                new_filename = new_filename.replace(':', "_")
                os.remove(src)

                save_location = f'pybo/output/{new_filename}'

                soundfile.write(save_location, audio_data, sr, format='WAV')
                memory_usage('#4')

                return render_template("download.html", save_location=save_location)

    @app.route('/download', methods=['POST', 'GET'])
    def download():
        save_location = request.form["save_location"]
        with open(save_location, 'rb') as fo:
            return_data = io.BytesIO()
            memory_usage('#5')

            return_data.write(fo.read())
            memory_usage('#6')
        # (after writing, cursor will be at last byte, so move it to start)
        return_data.seek(0)

        os.remove(save_location)
        return send_file(return_data, as_attachment=True, download_name='converted_file.wav')
    return app`


问:
making an executable with pyinstall: trouble with vlc module (linux)
I want to make an executable out of a gui youtube audio player I made.
There is a problem with the vlc module. When I just make the executable (on Linux), I can't open the file.
Opening in the terminal gives the following error:

Traceback (most recent call last):
File "ytplayer.py", line 39, in
player = instance.media_player_new()
AttributeError: 'NoneType' object has no attribute 'media_player_new'
[24084] Failed to execute script 'ytplayer' due to unhandled exception!

in my code I have:

```<code>from vlc import Instance
</code>```

and

```<code>vlc_instance = Instance()
player = vlc_instance.media_player_new()
</code>```

I found some information on the net about this problem, but no solution yet. This is one post on the internet:

By specifying a VLC_PLUGIN_PATH environment variable, everything works as expected! It's an exciting workaround:

```<code>os.environ["VLC_PLUGIN_PATH"] = "/usr/lib64/vlc/plugins"
</code>```

Problem is: I dont know where my vlc plugins are... So I cant test this.
Does anybody have ideas either for other ways to get around this problem, or to find the path of my vlc plugings?

FYI: My script works perfectly when I dont put it through PyInstaller.

link to the website with the info:

https://github.com/pyinstaller/pyinstaller/issues/4506

Body:
I want to make an executable out of a gui youtube audio player I made.
There is a problem with the vlc module. When I just make the executable (on Linux), I can't open the file.
Opening in the terminal gives the following error:

Traceback (most recent call last):
File "ytplayer.py", line 39, in
player = instance.media_player_new()
AttributeError: 'NoneType' object has no attribute 'media_player_new'
[24084] Failed to execute script 'ytplayer' due to unhandled exception!

in my code I have:

from vlc import Instance

and

vlc_instance = Instance()
player = vlc_instance.media_player_new()

I found some information on the net about this problem, but no solution yet. This is one post on the internet:

By specifying a VLC_PLUGIN_PATH environment variable, everything works as expected! It's an exciting workaround:

os.environ["VLC_PLUGIN_PATH"] = "/usr/lib64/vlc/plugins"

Problem is: I dont know where my vlc plugins are... So I cant test this.
Does anybody have ideas either for other ways to get around this problem, or to find the path of my vlc plugings?

FYI: My script works perfectly when I dont put it through PyInstaller.

link to the website with the info:

https://github.com/pyinstaller/pyinstaller/issues/4506


问:
PyStan: TypeError: cannot convert the series to <class ‘int’>
I'm using PyStan in a Jupyter notebook. This is possible with the nest_asyncio.apply() trick. Stan seems to have some issue receiving a numpy array of integer variables.

import numpy as np
import pandas as pd
import stan
import nest_asyncio
nest_asyncio.apply()

def sigmoid(x):
    return 1 / (1 + np.exp(-x))

treatment_slope = 0.2
test_slope = 0.15
intercept = 0.7

def link(X):
    theta = sigmoid(X[0] * treatment_slope + X[1] * test_slope + intercept)
    return theta

ctrl = np.random.binomial(n=1, p=link([0,0]), size=500)
test_no_exp = np.random.binomial(n=1, p=link([0,1]), size=250)
test_w_exp = np.random.binomial(n=1, p=link([0,1]), size=250)

import pandas as pd
data = {'test':[], 'exposure':[], 'outcome':[]}
for c in ctrl:
    data['test'].append(0)
    data['exposure'].append(0)
    data['outcome'].append(c)

for t in test_no_exp:
    data['test'].append(1)
    data['exposure'].append(0)
    data['outcome'].append(t)

for e in test_w_exp:
    data['test'].append(1)
    data['exposure'].append(1)
    data['outcome'].append(e)

df = pd.DataFrame(data)
X = df[['test','exposure']].to_numpy()
y = df['outcome']

payload = {'X':X, 'y':y, 'K':1000, 'N':2}

logistic_regression_model = """
// logistic regression code
data {
    int<lower=0> N;                 // number of observations
    int<lower=0> K;                 // number of predictor variables
    matrix[N, K] X;                 // predictor matrix
    int<lower=0,upper=1> y[N];      // outcome vector
}

parameters {
    real alpha;                     // intercept
    vector[K] theta;                // coefficients on Q_ast
    real<lower=0> sigma;            // error scale
}

model {
    // priors
    for (d in 1:D) {
        theta[d] ~ normal(0, 1);
    }
    alpha ~ normal(0, 10);
    // likelihood
    y ~ bernoulli_logit(X * theta + alpha);
}
"""
posterior = stan.build(logistic_regression_model, data=payload)
fit = posterior.sample(num_chains=4, num_samples=1000)
```

The error returned is: TypeError: cannot convert the series to <class 'int'>. But my inputs, as you can reproduce from code block, are already integer types. What's the issue here?

Body:
I'm using PyStan in a Jupyter notebook. This is possible with the nest_asyncio.apply() trick. Stan seems to have some issue receiving a numpy array of integer variables.

import numpy as np
import pandas as pd
import stan
import nest_asyncio
nest_asyncio.apply()

def sigmoid(x):
    return 1 / (1 + np.exp(-x))

treatment_slope = 0.2
test_slope = 0.15
intercept = 0.7

def link(X):
    theta = sigmoid(X[0] * treatment_slope + X[1] * test_slope + intercept)
    return theta

ctrl = np.random.binomial(n=1, p=link([0,0]), size=500)
test_no_exp = np.random.binomial(n=1, p=link([0,1]), size=250)
test_w_exp = np.random.binomial(n=1, p=link([0,1]), size=250)

import pandas as pd
data = {'test':[], 'exposure':[], 'outcome':[]}
for c in ctrl:
    data['test'].append(0)
    data['exposure'].append(0)
    data['outcome'].append(c)

for t in test_no_exp:
    data['test'].append(1)
    data['exposure'].append(0)
    data['outcome'].append(t)

for e in test_w_exp:
    data['test'].append(1)
    data['exposure'].append(1)
    data['outcome'].append(e)

df = pd.DataFrame(data)
X = df[['test','exposure']].to_numpy()
y = df['outcome']

payload = {'X':X, 'y':y, 'K':1000, 'N':2}

logistic_regression_model = """
// logistic regression code
data {
    int<lower=0> N;                 // number of observations
    int<lower=0> K;                 // number of predictor variables
    matrix[N, K] X;                 // predictor matrix
    int<lower=0,upper=1> y[N];      // outcome vector
}

parameters {
    real alpha;                     // intercept
    vector[K] theta;                // coefficients on Q_ast
    real<lower=0> sigma;            // error scale
}

model {
    // priors
    for (d in 1:D) {
        theta[d] ~ normal(0, 1);
    }
    alpha ~ normal(0, 10);
    // likelihood
    y ~ bernoulli_logit(X * theta + alpha);
}
"""
posterior = stan.build(logistic_regression_model, data=payload)
fit = posterior.sample(num_chains=4, num_samples=1000)

The error returned is: TypeError: cannot convert the series to <class 'int'>. But my inputs, as you can reproduce from code block, are already integer types. What's the issue here?


问:
Can fetch api and app.get(url) be combined?
So, I've seen a lot of tutorials (eg for login page) using routes (eg

app.get("/home", isLoggedIn, function (req, res) { res.render("home"); }); or for sessions

and others using fetch api (eg link )

however, it seems to me that those two (fetch and routes) are not combined.

I'm really confused, so how can I use them both? I haven't managed to find a single tutorial with those two.


问:
How to set a task as the build task?
I am attempting to run a helloworld C++ program in VSCode. This code is running inside a C++ docker container using dev containers extension. I have created the following tasks.json

```<code>{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "CPP build",
            "type": "cppbuild",
            "command": "g++ helloworld.cpp -o helloworld"
        }
    ]
}
</code>```

Then I run command+shift-B or terminal run build task. I get the following error:

No build task to run found. Configure Build Task...

Furthermore, a warning pops up in the lower right that says, "There are task errors. See the output for details" When I click on this it says:

```<code>Error: The cppbuild task detection didn't contribute a task for the following configuration:
{
    "label": "CPP build",
    "type": "cppbuild",
    "command": "g++ helloworld.cpp -o helloworld"
}
</code>```

How do I set this task as my build task so that I can build it?

Title: How to set a task as the build task?

Body:
I am attempting to run a helloworld C++ program in VSCode. This code is running inside a C++ docker container using dev containers extension. I have created the following tasks.json

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "CPP build",
            "type": "cppbuild",
            "command": "g++ helloworld.cpp -o helloworld"
        }
    ]
}

Then I run command+shift-B or terminal run build task. I get the following error:

No build task to run found. Configure Build Task...

Furthermore, a warning pops up in the lower right that says, "There are task errors. See the output for details" When I click on this it says:

Error: The cppbuild task detection didn't contribute a task for the following configuration:
{
    "label": "CPP build",
    "type": "cppbuild",
    "command": "g++ helloworld.cpp -o helloworld"
}

How do I set this task as my build task so that I can build it?


问:
Deprecation of force_uaccess_begin() in Linux kernel 5.19 / 6.0?
I try to rebuild a Linux device driver in recent kernels, namely 5.19 and 6.0.

The functions force_uaccess_begin() and force_uaccess_end(), as well as type mm_segment_t, are no longer defined and the compilation fails.

In the source code of the driver, for kernels before 5.10, the old set_fs() was used. For 5.10 and higher, force_uaccess_begin() and force_uaccess_end() are used instead. Up to kernel 5.14 at least, it compiles. The force_uaccess_*() functions are defined in linux/uaccess.h.

With kernels 5.19 and 6.0, the compilation fails. The force_uaccess_*() functions are no longer defined in linux/uaccess.h. I have no intermediate kernel 5.15 to 5.18 to test.

I could not find any precise online information about this. The transition from set_fs() to the force_uaccess_*() functions is abundantly documented but not the removal of the latter.

As far as I can see from the headers in 5.14 and the evolution of some other drivers, it seems that the force_uaccess_*() functions are no longer necessary and can be fully removed.

I have two questions:

Could you confirm that the force_uaccess_*() functions are no longer necessary and calling them can be safely removed? Or what shall we care about? I did not write that driver, so that would require some investigation.

What is the first kernel version where the force_uaccess_*() functions were removed? This is required to write the exact #elif LINUX_VERSION_CODE ... in the code.

Thanks a lot for your answers.


问:
Disabling "New Tag collected" message on android
As a normal behaviour, Android shows up a "New Tag collected" message when it reads an NFC tag.
However, I do not want this message to appear when I use my app.
I searched for many solutions on the internet, but with no success.
Any ideas about what I can do?
I will share the function I use to get the tag's ID and my AndroidManifest.xml.

```<code>const readNFC = async (): Promise<string | undefined> => {
  return new Promise(async (resolve, reject) => {
    try {
      await NfcManager.requestTechnology(NfcTech.NdefFormatable);
      const tag = await NfcManager.getTag();
      if (Platform.OS === 'ios') {
        await NfcManager.setAlertMessageIOS('TAG detect');
      }
      NfcManager.cancelTechnologyRequest();
      if (tag) {
        resolve(tag.id);
      }
    } catch (er) {
      reject('An error has occurred.');
    }
  });
};
</code>```

AndroidManifest.xml

```<code><manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.newronda">
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.NFC" />
    <uses-permission android:name="android.permission.CAMERA" />
    <application
      android:name=".MainApplication"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:allowBackup="false"
      android:theme="@style/AppTheme">
      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
        android:launchMode="singleTask"
        android:windowSoftInputMode="adjustResize"
        android:exported="true">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.nfc.action.NDEF_DISCOVERED"/>
            <category android:name="android.intent.category.DEFAULT"/>
            <data android:mimeType="application/vnd.hello.sample.nfcmanager" />
        </intent-filter>
      </activity>
    </application>
</manifest>
</code>```

Body:
As a normal behaviour, Android shows up a "New Tag collected" message when it reads an NFC tag.
However, I do not want this message to appear when I use my app.
I searched for many solutions on the internet, but with no success.
Any ideas about what I can do?
I will share the function I use to get the tag's ID and my AndroidManifest.xml.

const readNFC = async (): Promise<string | undefined> => {
  return new Promise(async (resolve, reject) => {
    try {
      await NfcManager.requestTechnology(NfcTech.NdefFormatable);
      const tag = await NfcManager.getTag();
      if (Platform.OS === 'ios') {
        await NfcManager.setAlertMessageIOS('TAG detect');
      }
      NfcManager.cancelTechnologyRequest();
      if (tag) {
        resolve(tag.id);
      }
    } catch (er) {
      reject('An error has occurred.');
    }
  });
};

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.newronda">
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.NFC" />
    <uses-permission android:name="android.permission.CAMERA" />
    <application
      android:name=".MainApplication"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:allowBackup="false"
      android:theme="@style/AppTheme">
      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
        android:launchMode="singleTask"
        android:windowSoftInputMode="adjustResize"
        android:exported="true">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.nfc.action.NDEF_DISCOVERED"/>
            <category android:name="android.intent.category.DEFAULT"/>
            <data android:mimeType="application/vnd.hello.sample.nfcmanager" />
        </intent-filter>
      </activity>
    </application>
</manifest>


问:
Flyway with spring boot 3.xxx problems when execute script
I'm trying to create a test project using flyway and spring 3.0.1.

Whenever I try to run the project when the flyway tries to run the script, an error appears stating that the tables have already been created previously.
I'm working with the h2 database, this type of error shouldn't happen...
I have a suspicion that spring jpa's hibernate is generating the tables even though I parameterize it so as not to create table by jpa.
application.yml

```<code>spring:
  datasource:
    url: jdbc:h2:mem:clientdb
    driver-class-name: org.h2.Driver
    username: sa
    password: password
  jpa:
    show-sql: true
    database-platform: org.hibernate.dialect.H2Dialect
    hibernate:
      ddl-auto: none
  h2:
    console:
      enabled: true
  flyway:
    enabled: true
    url: jdbc:h2:mem:clientdb
    user: sa
    password: password
    #group: true
    baseline-on-migrate: true
</code>```

pom.xml

```<code><?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-parent</artifactId>
      <version>3.0.1</version>
      <relativePath/> <!-- lookup parent from repository -->
   </parent>
   <groupId>com.br.smart</groupId>
   <artifactId>smart-cliente</artifactId>
   <version>0.0.1-SNAPSHOT</version>
   <name>smart-cliente</name>
   <description>Serviço responsável por armazenar os cliente</description>
   <properties>
      <java.version>17</java.version>
   </properties>
   <dependencies>
      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-data-jpa</artifactId>
      </dependency>
      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-web</artifactId>
      </dependency>
      <dependency>
         <groupId>org.flywaydb</groupId>
         <artifactId>flyway-core</artifactId>
         <!--<version>5.0.3</version>-->
      </dependency>

      <dependency>
         <groupId>com.h2database</groupId>
         <artifactId>h2</artifactId>
         <scope>runtime</scope>
      </dependency>
      <!--<dependency>
         <groupId>org.postgresql</groupId>
         <artifactId>postgresql</artifactId>
         <scope>runtime</scope>
      </dependency>-->
      <dependency>
         <groupId>org.projectlombok</groupId>
         <artifactId>lombok</artifactId>
         <optional>true</optional>
      </dependency>
      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-test</artifactId>
         <scope>test</scope>
      </dependency>

      <dependency>
         <groupId>org.springdoc</groupId>
         <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
         <version>2.0.2</version>
      </dependency>
   </dependencies>

   <build>
      <plugins>
         <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
               <excludes>
                  <exclude>
                     <groupId>org.projectlombok</groupId>
                     <artifactId>lombok</artifactId>
                  </exclude>
               </excludes>
            </configuration>
         </plugin>
      </plugins>
   </build>

</project>

</code>```

sql

```<code>CREATE SEQUENCE "SEQ_CLIENTE_TELEFONE";
CREATE SEQUENCE "SEQ_ENDERECO_CLIENTE";
CREATE SEQUENCE "SEQ_CLIENTE";

CREATE TABLE CLIENTE_EMAIL (
    COD_CLIENTE INTEGER NOT NULL,
    EMAIL VARCHAR(200) NOT NULL
);

CREATE TABLE CLIENTE_TELEFONE (
    COD_TELEFONE_CLIENTE INTEGER NOT NULL,
    DDI VARCHAR(4) NOT NULL,
    DDD VARCHAR(3) NOT NULL,
    NUMERO VARCHAR(12) NOT NULL,
    TIPO_TELEFONE VARCHAR(20) NOT NULL

);

CREATE TABLE CLIENTE_TELEFONE (
    COD_ENDERECO_CLIENTE INTEGER NOT NULL,
    LOGRADOURO VARCHAR(150) NOT NULL,
    NUMERO VARCHAR(6) NOT NULL,
    COMPLEMENTO VARCHAR(20),
    BAIRRO VARCHAR(50),
    CIDADE VARCHAR(50),
    ESTADO VARCHAR(50),
    PAIS VARCHAR(50),
    CEP VARCHAR(20),
    TIPO_ENDERECO VARCHAR(15)
);

CREATE TABLE CLIENTE (
    COD_USUARIO INTEGER NOT NULL,
    NOME VARCHAR(100) NOT NULL,
    CPF_CNPJ VARCHAR(14) NOT NULL
);
</code>```

entity

```<code>@Entity
@AllArgsConstructor
@Getter
@Builder
@Table(name = "CLIENTE")
public class ClientEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_CLIENTE")
    @Column(name = "COD_USUARIO")
    private Integer id;
    @Column(name = "NOME")
    private String name;
    @Column(name = "CPF_CNPJ")
    private String cpfCnpj;

    @OneToMany(mappedBy = "clientEntity")
    private List<PhoneEntity> phoneList;
    @OneToMany(mappedBy = "clientEntity")
    private List<AddressEntity> addressList;
    @ElementCollection(fetch = FetchType.LAZY)
    @CollectionTable(name = "CLIENTE_EMAIL", joinColumns = @JoinColumn(name = "COD_USUARIO"))
    @Column(name = "EMAIL")
    private Set<String> emailSet
</code>```
```<code>@Entity
@Builder
@AllArgsConstructor
@Getter
@Table(name = "ENDERECO_CLIENTE")
public class AddressEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_ENDERECO_CLIENTE")
    @Column(name = "COD_ENDERECO_CLIENTE")
    private Integer id;
    @Column(name = "LOGRADOURO")
    private String location;
    @Column(name = "NUMERO")
    private String number;
    @Column(name = "COMPLEMENTO")
    private String complement;
    @Column(name = "BAIRRO")
    private String district;
    @Column(name = "CIDADE")
    private String city;
    @Column(name = "ESTADO")
    private String state;
    @Column(name = "PAIS")
    private String country;
    @Column(name = "CEP")
    private String zipCode;
    @Column(name = "TIPO_ENDERECO")
    private String addressType;

    @ManyToOne(fetch = FetchType.EAGER)
    private ClientEntity clientEntity;
</code>```
```<code>@Entity
@AllArgsConstructor
@Builder
@Getter
@Table(name = "CLIENTE_TELEFONE")
public class PhoneEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_CLIENTE_TELEFONE")
    @Column(name = "COD_TELEFONE_CLIENTE")
    private Integer id;
    @Column(name = "DDI")
    private String ddi;
    @Column(name = "DDD")
    private String ddd;
    @Column(name = "NUMERO")
    private String number;

    @Column(name = "TIPO_TELEFONE")
    private String phoneType;

    @ManyToOne(fetch = FetchType.EAGER)
    private ClientEntity clientEntity;
</code>```

I tried to create a flyway configuration file as described in some stackoverflow links and I was unsuccessful.

Body:
I'm trying to create a test project using flyway and spring 3.0.1.

Whenever I try to run the project when the flyway tries to run the script, an error appears stating that the tables have already been created previously.
I'm working with the h2 database, this type of error shouldn't happen...
I have a suspicion that spring jpa's hibernate is generating the tables even though I parameterize it so as not to create table by jpa.
application.yml

spring:
  datasource:
    url: jdbc:h2:mem:clientdb
    driver-class-name: org.h2.Driver
    username: sa
    password: password
  jpa:
    show-sql: true
    database-platform: org.hibernate.dialect.H2Dialect
    hibernate:
      ddl-auto: none
  h2:
    console:
      enabled: true
  flyway:
    enabled: true
    url: jdbc:h2:mem:clientdb
    user: sa
    password: password
    #group: true
    baseline-on-migrate: true

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-parent</artifactId>
      <version>3.0.1</version>
      <relativePath/>
   </parent>
   <groupId>com.br.smart</groupId>
   <artifactId>smart-cliente</artifactId>
   <version>0.0.1-SNAPSHOT</version>
   <name>smart-cliente</name>
   <description>Serviço responsável por armazenar os cliente</description>
   <properties>
      <java.version>17</java.version>
   </properties>
   <dependencies>
      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-data-jpa</artifactId>
      </dependency>
      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-web</artifactId>
      </dependency>
      <dependency>
         <groupId>org.flywaydb</groupId>
         <artifactId>flyway-core</artifactId>

      </dependency>

      <dependency>
         <groupId>com.h2database</groupId>
         <artifactId>h2</artifactId>
         <scope>runtime</scope>
      </dependency>

      <dependency>
         <groupId>org.projectlombok</groupId>
         <artifactId>lombok</artifactId>
         <optional>true</optional>
      </dependency>
      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-test</artifactId>
         <scope>test</scope>
      </dependency>

      <dependency>
         <groupId>org.springdoc</groupId>
         <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
         <version>2.0.2</version>
      </dependency>
   </dependencies>

   <build>
      <plugins>
         <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
               <excludes>
                  <exclude>
                     <groupId>org.projectlombok</groupId>
                     <artifactId>lombok</artifactId>
                  </exclude>
               </excludes>
            </configuration>
         </plugin>
      </plugins>
   </build>

</project>

sql

CREATE SEQUENCE "SEQ_CLIENTE_TELEFONE";
CREATE SEQUENCE "SEQ_ENDERECO_CLIENTE";
CREATE SEQUENCE "SEQ_CLIENTE";

CREATE TABLE CLIENTE_EMAIL (
    COD_CLIENTE INTEGER NOT NULL,
    EMAIL VARCHAR(200) NOT NULL
);

CREATE TABLE CLIENTE_TELEFONE (
    COD_TELEFONE_CLIENTE INTEGER NOT NULL,
    DDI VARCHAR(4) NOT NULL,
    DDD VARCHAR(3) NOT NULL,
    NUMERO VARCHAR(12) NOT NULL,
    TIPO_TELEFONE VARCHAR(20) NOT NULL

);

CREATE TABLE CLIENTE_TELEFONE (
    COD_ENDERECO_CLIENTE INTEGER NOT NULL,
    LOGRADOURO VARCHAR(150) NOT NULL,
    NUMERO VARCHAR(6) NOT NULL,
    COMPLEMENTO VARCHAR(20),
    BAIRRO VARCHAR(50),
    CIDADE VARCHAR(50),
    ESTADO VARCHAR(50),
    PAIS VARCHAR(50),
    CEP VARCHAR(20),
    TIPO_ENDERECO VARCHAR(15)
);

CREATE TABLE CLIENTE (
    COD_USUARIO INTEGER NOT NULL,
    NOME VARCHAR(100) NOT NULL,
    CPF_CNPJ VARCHAR(14) NOT NULL
);

entity

@Entity
@AllArgsConstructor
@Getter
@Builder
@Table(name = "CLIENTE")
public class ClientEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_CLIENTE")
    @Column(name = "COD_USUARIO")
    private Integer id;
    @Column(name = "NOME")
    private String name;
    @Column(name = "CPF_CNPJ")
    private String cpfCnpj;

    @OneToMany(mappedBy = "clientEntity")
    private List<PhoneEntity> phoneList;
    @OneToMany(mappedBy = "clientEntity")
    private List<AddressEntity> addressList;
    @ElementCollection(fetch = FetchType.LAZY)
    @CollectionTable(name = "CLIENTE_EMAIL", joinColumns = @JoinColumn(name = "COD_USUARIO"))
    @Column(name = "EMAIL")
    private Set<String> emailSet

@Entity
@Builder
@AllArgsConstructor
@Getter
@Table(name = "ENDERECO_CLIENTE")
public class AddressEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_ENDERECO_CLIENTE")
    @Column(name = "COD_ENDERECO_CLIENTE")
    private Integer id;
    @Column(name = "LOGRADOURO")
    private String location;
    @Column(name = "NUMERO")
    private String number;
    @Column(name = "COMPLEMENTO")
    private String complement;
    @Column(name = "BAIRRO")
    private String district;
    @Column(name = "CIDADE")
    private String city;
    @Column(name = "ESTADO")
    private String state;
    @Column(name = "PAIS")
    private String country;
    @Column(name = "CEP")
    private String zipCode;
    @Column(name = "TIPO_ENDERECO")
    private String addressType;

    @ManyToOne(fetch = FetchType.EAGER)
    private ClientEntity clientEntity;

@Entity
@AllArgsConstructor
@Builder
@Getter
@Table(name = "CLIENTE_TELEFONE")
public class PhoneEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_CLIENTE_TELEFONE")
    @Column(name = "COD_TELEFONE_CLIENTE")
    private Integer id;
    @Column(name = "DDI")
    private String ddi;
    @Column(name = "DDD")
    private String ddd;
    @Column(name = "NUMERO")
    private String number;

    @Column(name = "TIPO_TELEFONE")
    private String phoneType;

    @ManyToOne(fetch = FetchType.EAGER)
    private ClientEntity clientEntity;

I tried to create a flyway configuration file as described in some stackoverflow links and I was unsuccessful.


问:
How to get raw thermal Y16 data from Lepton 3.5 on Pure Thermal 2 on Raspberry Pi 4b running Ubuntu 20.04.5 - uvc_start_streaming failed: -2
Setup; Flir Lepton 3.5 radiometric camera on a Pure Thermal 2 (PT2) board running fw:v1.3.0, connected by usb cable to a raspberry pi 4b running Ubuntu 20.04.5 LTS

I'm trying to use the python uvc-radiometry.py script at https://github.com/groupgets/purethermal1-uvc-capture/tree/master+libuvc-upstream to get the raw Y16 data image matrices from the Lepton 3.5 so that I can manipulate them to isolate temperature regions above 200 Deg C.

I've spent weeks debugging problems with the uvc-radiometry.py script but I'm still getting a uvc_start_streaming failed: -2 error.

When I switch to the UYVY frame format, the video feed displays but the min/max temperatures but they are completely wrong, I assume because it's not outputting raw temperature values.  From what I've read online, it seems that I need to update the pure thermal firmware with the right patch to turn Y16 format on and turn AGC off via dfu. However, after fw v-1.0.0, it seems that this Y16 should be on by default. https://github.com/groupgets/purethermal1-firmware/releases

I've tried many posted solutions, the most relevant being this one https://github.com/groupgets/purethermal1-uvc-capture/tree/master+libuvc-upstream
Fix UVC_FRAME_FORMAT_Y16 due to upstream change
'Commit libuvc/libuvc@53e2d2f - added a value to the middle of the types enumeration, which broke our bindings. This manifested as the "uvc_start_streaming failed: -2" error. This change corrects the enumeration value to match master.'

However, even after using the uvc-radiometry.py version from this upstream branch, I still get the -2 error. I suspect it's something to do with the 'enumeration value matching master' but I'm at a total loss as to how to fix this.

code output of running uvc-radiometry.py is as follows...

```<code>Running script: "/home/ubuntu/projects/flamesmart/src/uvc-radiometry.py"
Found 1 devices
unsupported descriptor subtype VS_COLORFORMAT
unsupported descriptor subtype VS_COLORFORMAT
PureThermal device opened:  unsupported descriptor subtype VS_COLORFORMAT
b'GroupGets'unsupported descriptor subtype VS_COLORFORMAT
 unsupported descriptor subtype VS_COLORFORMAT
b'PureThermal (fw:v1.2.2)' b'0005800e-5111-3039-3433-373300000000'
Version gpp: 3.3.26 dsp: 3.3.26
FLIR part #: b'500-0771-01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
FLIR serial #: b'\x17\xdf#\x00\x00\x00\x00\x00'
format: b'UYVY'
  frame 160x120 @ 9fps
format: b'Y16 '
  frame 160x120 @ 9fps
  frame 160x122 @ 9fps
format: b'Y8  '
  frame 160x120 @ 9fps
format: b'RGBP'
  frame 160x120 @ 9fps
format: b'}\xeb6\xe4'
  frame 160x120 @ 9fps
uvc_start_streaming failed: -2
</code>```

I'm really desperate to solve this after weeks of online searches and so would greatly appreciate some help good people! Thanks.

Body:
Setup; Flir Lepton 3.5 radiometric camera on a Pure Thermal 2 (PT2) board running fw:v1.3.0, connected by usb cable to a raspberry pi 4b running Ubuntu 20.04.5 LTS

I'm trying to use the python uvc-radiometry.py script at https://github.com/groupgets/purethermal1-uvc-capture/tree/master+libuvc-upstream to get the raw Y16 data image matrices from the Lepton 3.5 so that I can manipulate them to isolate temperature regions above 200 Deg C.

I've spent weeks debugging problems with the uvc-radiometry.py script but I'm still getting a uvc_start_streaming failed: -2 error.

When I switch to the UYVY frame format, the video feed displays but the min/max temperatures but they are completely wrong, I assume because it's not outputting raw temperature values.  From what I've read online, it seems that I need to update the pure thermal firmware with the right patch to turn Y16 format on and turn AGC off via dfu. However, after fw v-1.0.0, it seems that this Y16 should be on by default. https://github.com/groupgets/purethermal1-firmware/releases

I've tried many posted solutions, the most relevant being this one https://github.com/groupgets/purethermal1-uvc-capture/tree/master+libuvc-upstream
Fix UVC_FRAME_FORMAT_Y16 due to upstream change
'Commit libuvc/libuvc@53e2d2f - added a value to the middle of the types enumeration, which broke our bindings. This manifested as the "uvc_start_streaming failed: -2" error. This change corrects the enumeration value to match master.'

However, even after using the uvc-radiometry.py version from this upstream branch, I still get the -2 error. I suspect it's something to do with the 'enumeration value matching master' but I'm at a total loss as to how to fix this.

code output of running uvc-radiometry.py is as follows...

Running script: "/home/ubuntu/projects/flamesmart/src/uvc-radiometry.py"
Found 1 devices
unsupported descriptor subtype VS_COLORFORMAT
unsupported descriptor subtype VS_COLORFORMAT
PureThermal device opened:  unsupported descriptor subtype VS_COLORFORMAT
b'GroupGets'unsupported descriptor subtype VS_COLORFORMAT
 unsupported descriptor subtype VS_COLORFORMAT
b'PureThermal (fw:v1.2.2)' b'0005800e-5111-3039-3433-373300000000'
Version gpp: 3.3.26 dsp: 3.3.26
FLIR part #: b'500-0771-01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
FLIR serial #: b'\x17\xdf#\x00\x00\x00\x00\x00'
format: b'UYVY'
  frame 160x120 @ 9fps
format: b'Y16 '
  frame 160x120 @ 9fps
  frame 160x122 @ 9fps
format: b'Y8  '
  frame 160x120 @ 9fps
format: b'RGBP'
  frame 160x120 @ 9fps
format: b'}\xeb6\xe4'
  frame 160x120 @ 9fps
uvc_start_streaming failed: -2

I'm really desperate to solve this after weeks of online searches and so would greatly appreciate some help good people! Thanks.