问:
matlab loops for converting unit
```<code>while strcmp(unit, "oz") == 0 && strcmp(unit, "lb") == 0 && strcmp(unit, "ton") == 0 && strcmp(unit, "in") == 0 && strcmp(unit, "ft") == 0 && strcmp(unit, "mi") == 0 && strcmp(unit, "F") == 0 && strcmp(unit, "g") == 0 && strcmp(unit, "kg") == 0 && strcmp(unit, "tonne") == 0 && strcmp(unit, "cm") == 0 && strcmp(unit, "m") == 0 && strcmp(unit, "km") == 0 && strcmp(unit, "C") == 0
    if strcmp(unit_type, "mass") == 1
        while contains(unit, "oz") == 0 && strcmp(unit, "lb") == 0 && contains(unit, "ton") == 0 && contains(unit, "g") == 0 && strcmp(unit, "kg") == 0 && contains(unit, "tonne") == 0
            unit = input("Enter the unit: ","s");
        end

    elseif strcmp(unit_type, "temperature") == 1
        while contains(unit, "F") == 0 && contains(unit, "C") == 0
            unit = input("Enter the unit: ","s");
        end

    elseif strcmp(unit_type, "length") == 1
        while contains(unit, "in") == 0 && contains(unit, "ft") == 0 && contains(unit, "mi") == 0 && contains(unit, "cm") == 0 && contains(unit, "m") == 0 && contains(unit, "km") == 0
            unit = input("Enter the unit: ","s");
        end
    end

    disp('Error: Invalid input. Please enter a valid unit.');
    unit = input("Enter the unit: ","s");
end
</code>```

up there is the piece of the scrip that i wrote for my converting unit program but the thing is I wanted to loop it for when the user wrongly input. For instance, when the user choose mass and input the unit of the value is km it should pop the error and request to input again. Could you guys help me with this? it still runs the rest of the code since the While condition is what im still working on it

What did you try and what were you expecting? for this section im still thinkign of another solution

Title: matlab loops for converting unit

Body:
while strcmp(unit, "oz") == 0 && strcmp(unit, "lb") == 0 && strcmp(unit, "ton") == 0 && strcmp(unit, "in") == 0 && strcmp(unit, "ft") == 0 && strcmp(unit, "mi") == 0 && strcmp(unit, "F") == 0 && strcmp(unit, "g") == 0 && strcmp(unit, "kg") == 0 && strcmp(unit, "tonne") == 0 && strcmp(unit, "cm") == 0 && strcmp(unit, "m") == 0 && strcmp(unit, "km") == 0 && strcmp(unit, "C") == 0
    if strcmp(unit_type, "mass") == 1
        while contains(unit, "oz") == 0 && strcmp(unit, "lb") == 0 && contains(unit, "ton") == 0 && contains(unit, "g") == 0 && strcmp(unit, "kg") == 0 && contains(unit, "tonne") == 0
            unit = input("Enter the unit: ","s");
        end

    elseif strcmp(unit_type, "temperature") == 1
        while contains(unit, "F") == 0 && contains(unit, "C") == 0
            unit = input("Enter the unit: ","s");
        end

    elseif strcmp(unit_type, "length") == 1
        while contains(unit, "in") == 0 && contains(unit, "ft") == 0 && contains(unit, "mi") == 0 && contains(unit, "cm") == 0 && contains(unit, "m") == 0 && contains(unit, "km") == 0
            unit = input("Enter the unit: ","s");
        end
    end

    disp('Error: Invalid input. Please enter a valid unit.');
    unit = input("Enter the unit: ","s");
end

up there is the piece of the scrip that i wrote for my converting unit program but the thing is I wanted to loop it for when the user wrongly input. For instance, when the user choose mass and input the unit of the value is km it should pop the error and request to input again. Could you guys help me with this? it still runs the rest of the code since the While condition is what im still working on it

What did you try and what were you expecting? for this section im still thinkign of another solution


来源: stackexchange

问:
Flutter “Share a Post” or “Direct / Private Message” (It’s already developed by LinkedIn, Twitter, and Facebook)
When the user selects text / image and shares something via LinkedIn it asks for 2 options

```<code>(1). Direct / Private message (2). Share a Post
</code>```

How can I develop these features via the Flutter Mobile app?

You can try this below step for a better understanding,

1. Open Wikipedia

2. select the text and share the text via LinkedIn, Twitter, and Facebook app.

you can see what I need to develop (same as the screenshot)

Current:-

Already tried out this package, In this package, I got the share content / Image in the application.

but it's not asking for options (intent).

This package already tried:- Receive Intent

Expect:-

How I can show the user 2 options displayed in a screenshot?

ContentLicense: CC BY-SA 4.0

Body:
When the user selects text / image and shares something via LinkedIn it asks for 2 options

(1). Direct / Private message (2). Share a Post

How can I develop these features via the Flutter Mobile app?

You can try this below step for a better understanding,

1. Open Wikipedia

2. select the text and share the text via LinkedIn, Twitter, and Facebook app.

you can see what I need to develop (same as the screenshot)

Current:-

Already tried out this package, In this package, I got the share content / Image in the application.

but it's not asking for options (intent).

This package already tried:- Receive Intent

Expect:-

How I can show the user 2 options displayed in a screenshot?


问:
Python-Classifier-Xgboost - show cv information to long time after finish script
I have a code

```<code>import sys
old_stdout = sys.stdout
log_file = open("cv.log","w")
sys.stdout = log_file

import xgboost as xgb
from sklearn.pipeline import Pipeline
from sklearn.datasets import make_classification
from sklearn.model_selection import GridSearchCV
X_train, y_train = make_classification(n_samples=2000)

params_str_dict = {"xgb__n_estimators": [10, 30], "xgb__max_depth": [50], "xgb__learning_rate": [0.5, 1], "xgb__objective": ["binary:logistic"]}

pipe = Pipeline(steps=[("xgb", xgb.XGBClassifier())])
model_GS = GridSearchCV(
    estimator=pipe,
    param_grid=params_str_dict,
    n_jobs=-1,
    cv=3,
    verbose=3,
).fit(X_train, y_train)

sys.stdout = old_stdout
log_file.close()
</code>```

When script has ended - in file i see

```<code>Fitting 3 folds for each of 4 candidates, totalling 12 fits
</code>```

However, after 2 minutes, information about the cv show in the visual output. I think that's why it's not save to the file (it comes too late)

```<code>[CV 1/3] END xgb__learning_rate=0.5, xgb__max_depth=50, xgb__n_estimators=10, xgb__objective=binary:logistic;, score=0.964 total time=   0.1s
[CV 2/3] END xgb__learning_rate=0.5, xgb__max_depth=50, xgb__n_estimators=10, xgb__objective=binary:logistic;, score=0.951 total time=   0.1s
[CV 3/3] END xgb__learning_rate=0.5, xgb__max_depth=50, xgb__n_estimators=10, xgb__objective=binary:logistic;, score=0.961 total time=   0.1s
[CV 1/3] END xgb__learning_rate=1, xgb__max_depth=50, xgb__n_estimators=10, xgb__objective=binary:logistic;, score=0.973 total time=   0.1s
</code>```

I use Visual Studio Code with Jupyter Kernel but in Python is the same problem.

Body:
I have a code

import sys
old_stdout = sys.stdout
log_file = open("cv.log","w")
sys.stdout = log_file

import xgboost as xgb
from sklearn.pipeline import Pipeline
from sklearn.datasets import make_classification
from sklearn.model_selection import GridSearchCV
X_train, y_train = make_classification(n_samples=2000)

params_str_dict = {"xgb__n_estimators": [10, 30], "xgb__max_depth": [50], "xgb__learning_rate": [0.5, 1], "xgb__objective": ["binary:logistic"]}

pipe = Pipeline(steps=[("xgb", xgb.XGBClassifier())])
model_GS = GridSearchCV(
    estimator=pipe,
    param_grid=params_str_dict,
    n_jobs=-1,
    cv=3,
    verbose=3,
).fit(X_train, y_train)

sys.stdout = old_stdout
log_file.close()

When script has ended - in file i see

Fitting 3 folds for each of 4 candidates, totalling 12 fits

However, after 2 minutes, information about the cv show in the visual output. I think that's why it's not save to the file (it comes too late)

[CV 1/3] END xgb__learning_rate=0.5, xgb__max_depth=50, xgb__n_estimators=10, xgb__objective=binary:logistic;, score=0.964 total time=   0.1s
[CV 2/3] END xgb__learning_rate=0.5, xgb__max_depth=50, xgb__n_estimators=10, xgb__objective=binary:logistic;, score=0.951 total time=   0.1s
[CV 3/3] END xgb__learning_rate=0.5, xgb__max_depth=50, xgb__n_estimators=10, xgb__objective=binary:logistic;, score=0.961 total time=   0.1s
[CV 1/3] END xgb__learning_rate=1, xgb__max_depth=50, xgb__n_estimators=10, xgb__objective=binary:logistic;, score=0.973 total time=   0.1s

I use Visual Studio Code with Jupyter Kernel but in Python is the same problem.


问:
External Image URL Not Working React GrapeJs
Using a package called GrapeJs allowing editor to make dynmaic templates.
Recently I upgrade my React Project, below are the packages that I upgraded.

```<code>"grapesjs": "^0.18.1",
"grapesjs-preset-webpage": "^0.1.11",
"react": "^18.2.0",
"react-device-detect": "^2.2.2",
"react-dom": "^18.2.0",
"next": "^13.1.1",
"next-images": "^1.8.4",
</code>```

Suddenly Images with external urls stopped working, if I download the same image in my local and save it in pulbic folder, it works.

Also images with external urls are working all over the project, just not in GrapeJs logic.

Below is my code :

```<code>export const customBlocks = (editordata) => {
    const blockManager = editordata.BlockManager
    blockManager.add('footer1', {
        content: `<img id="ioje" src="https://img.icons8.com/windows/32/00a6a6/left2.png" class="ioje"/>`,
        category: 'Footers',
        attributes: {
            title: 'Predefined Footer',
        },
    })
    blockManager.add('footer12', {
        content: `<img id="ioje" src=${require("../../../public/left2.png")} class="ioje"/>`,
        category: 'Footers',
        attributes: {
            title: 'Predefined Footer1',
        },
    })
}
</code>```

Here footer1 is not working, as it has an external link image, while footer12 is coming as it is coming from public folder

Body:
Using a package called GrapeJs allowing editor to make dynmaic templates.
Recently I upgrade my React Project, below are the packages that I upgraded.

"grapesjs": "^0.18.1",
"grapesjs-preset-webpage": "^0.1.11",
"react": "^18.2.0",
"react-device-detect": "^2.2.2",
"react-dom": "^18.2.0",
"next": "^13.1.1",
"next-images": "^1.8.4",

Suddenly Images with external urls stopped working, if I download the same image in my local and save it in pulbic folder, it works.

Also images with external urls are working all over the project, just not in GrapeJs logic.

Below is my code :

export const customBlocks = (editordata) => {
    const blockManager = editordata.BlockManager
    blockManager.add('footer1', {
        content: `<img id="ioje" src="https://img.icons8.com/windows/32/00a6a6/left2.png" class="ioje"/>`,
        category: 'Footers',
        attributes: {
            title: 'Predefined Footer',
        },
    })
    blockManager.add('footer12', {
        content: `<img id="ioje" src=${require("../../../public/left2.png")} class="ioje"/>`,
        category: 'Footers',
        attributes: {
            title: 'Predefined Footer1',
        },
    })
}

Here footer1 is not working, as it has an external link image, while footer12 is coming as it is coming from public folder


问:
tensorflow sparse dense layer
I want to create a custom dense layer in tf.keras, which works with sparse weight matrices. My weight matrices are zero almost everywhere, and I know the sparsity pattern. It would be a huge cost saving. How would I incorporate sparse matrices into a custom Dense layer? Could someone point me to a reference? I could not find this functionality in tf. Edit: the layer should be trainable.</p>

Title: tensorflow sparse dense layer


问:
Not able to build apk at time of run time error
when i am tryinng to build apk it showing below error

org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugCompileClasspath'.

at time run
org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugCompileClasspath'.


问:
Error while connecting snowflake to glue using custom jdbc connector and connection?
I am trying to connect AWS Glue with Snowflake by using JDBC custom connector and connection. However after I have created the connection and run my job and call the toDF() method to convert dynamic frame to Pyspark Dataframe I get the following error

```<code>File "/tmp/Snowflake_Test_Job.py", line 22, in <module>
df1 = Snowflake_New_Connector_node1.toDF()
File "/opt/amazon/lib/python3.7/site-packages/awsglue/dynamicframe.py", line 147, in toDF
return DataFrame(self._jdf.toDF(self.glue_ctx._jvm.PythonUtils.toSeq(scala_options)), self.glue_ctx)
File "/opt/amazon/spark/python/lib/py4j-0.10.9.5-src.zip/py4j/java_gateway.py", line 1321, in __call__
return_value = get_return_value(
File "/opt/amazon/lib/python3.7/site-packages/pyspark/sql/utils.py", line 190, in deco
return f(*a, **kw)
File "/opt/amazon/spark/python/lib/py4j-0.10.9.5-src.zip/py4j/protocol.py", line 326, in get_return_value
raise Py4JJavaError(
py4j.protocol.Py4JJavaError: An error occurred while calling o95.toDF.
: org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 0.0 failed 4 times, most recent failure: Lost task 0.3 in stage 0.0 (TID 3) (179.39.34.49 executor 2): org.apache.spark.util.TaskCompletionListenerException: null
Previous exception in task: Glue ETL Marketplace: JDBC driver failure, driverClassName: net.snowflake.client.jdbc.SnowflakeDriver, error message: No suitable driver found for rendered JDBC URL
</code>```

The URL I am using is according to the snowflake documentation
I am using the following JDBC jar file snowflake-jdbc-3.13.22.jar

Not sure what is going wrong here? If someone has faced a similar problem and found solution to this please share?

I tried creating connection with other JAR files as well however when I try it gives the same error. I tried creating connection from Glue Job code as well but was getting same error. The Ideal result should have been execution of the query on snowflake.

Body:
I am trying to connect AWS Glue with Snowflake by using JDBC custom connector and connection. However after I have created the connection and run my job and call the toDF() method to convert dynamic frame to Pyspark Dataframe I get the following error

File "/tmp/Snowflake_Test_Job.py", line 22, in <module>
df1 = Snowflake_New_Connector_node1.toDF()
File "/opt/amazon/lib/python3.7/site-packages/awsglue/dynamicframe.py", line 147, in toDF
return DataFrame(self._jdf.toDF(self.glue_ctx._jvm.PythonUtils.toSeq(scala_options)), self.glue_ctx)
File "/opt/amazon/spark/python/lib/py4j-0.10.9.5-src.zip/py4j/java_gateway.py", line 1321, in __call__
return_value = get_return_value(
File "/opt/amazon/lib/python3.7/site-packages/pyspark/sql/utils.py", line 190, in deco
return f(*a, **kw)
File "/opt/amazon/spark/python/lib/py4j-0.10.9.5-src.zip/py4j/protocol.py", line 326, in get_return_value
raise Py4JJavaError(
py4j.protocol.Py4JJavaError: An error occurred while calling o95.toDF.
: org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 0.0 failed 4 times, most recent failure: Lost task 0.3 in stage 0.0 (TID 3) (179.39.34.49 executor 2): org.apache.spark.util.TaskCompletionListenerException: null
Previous exception in task: Glue ETL Marketplace: JDBC driver failure, driverClassName: net.snowflake.client.jdbc.SnowflakeDriver, error message: No suitable driver found for rendered JDBC URL

The URL I am using is according to the snowflake documentation
I am using the following JDBC jar file snowflake-jdbc-3.13.22.jar

Not sure what is going wrong here? If someone has faced a similar problem and found solution to this please share?

I tried creating connection with other JAR files as well however when I try it gives the same error. I tried creating connection from Glue Job code as well but was getting same error. The Ideal result should have been execution of the query on snowflake.


问:
Is there any way to integrate the photosphere in flutter application
Right now I am working on flutter application in which I want to add the functionality of taking 3D scans of the anything from camera.

What I want is to open the 3D scan photosphere and take that scans or download these scans to the gallery and all this will be done by my application.

If any one give me the Idea or solution. Thanks in advance.


问:
Dynamically adding styling cues to vtt subtitle track
I would like to ask if there is a way to dynamically add styling cues with the addTextTrack API. Something along the lines of:

 tempTrack.addCue(new VTTCue((sentence.data.start / 1000).toFixed(3), (sentence.data.end / 1000).toFixed(3), `<c.red.background-yellow>${sentence.data.text}</c>`));```

but instead of passing in some text for the subtitle, passing in a styling cue? But not using predefined ::cue classes.

What I want to do is have a user select any color, for background or text color, and then pass that into the textTrack dynamically.

I would be grateful for any tips.

Body:
I would like to ask if there is a way to dynamically add styling cues with the addTextTrack API. Something along the lines of:

 tempTrack.addCue(new VTTCue((sentence.data.start / 1000).toFixed(3), (sentence.data.end / 1000).toFixed(3), `<c.red.background-yellow>${sentence.data.text}</c>`));

but instead of passing in some text for the subtitle, passing in a styling cue? But not using predefined ::cue classes.

What I want to do is have a user select any color, for background or text color, and then pass that into the textTrack dynamically.

I would be grateful for any tips.


问:
How to set React Native background location for accurate result? Can only be done in Native?
I'm trying to create a running app with React Native. The background location permission needs to be in "Allow all the time" to get an accurate location when the screen is off (in addition to turning the power saver and battery optimization off).

How can run apps like "Strava" and "Runtastic" be able to track background location accurately only with "While only using the app" permission?

I have been researching and testing for 5 days now with no luck. Even using paid background module (react native) required "Allow all the time" permission to get accurate results: https://github.com/transistorsoft/react-native-background-geolocation.

Is this can only be done in native? If yes, can I integrate the background native code to react native?

Would appreciate any guidance.

Thank you.


问:
Updating Audiences in the Optimizely using the SDK
There is a requirement for updating audiences, we searched a lot, and apparently, there is no such feature in the java SDK.

The requirement is that there is a micro-service that notifies us to include a new audience in an already existing feature flag (we want to roll out a feature in our backends by cities) and we need to add the new audience programmatically to the audiences whenever the other micro-service tell us. This is not an A/B test or an experiment it is actually a rollout plan.
How should we achieve this?


问:
Returning data from axios and extracting elements in nextjs useSWR
I am using axios in a nextjs framework with swr for handling fetch requests.

```<code>import { useRouter } from "next/router";
import useSWR from 'swr';
import axios from 'axios';
import { type } from "os";

const fetcher = async (url: string) => {
    return await axios.get(url)
        .then(res => res.data)
        .catch(error => {
            if (error.response.status !== 409) throw error
        })
}

export default function Person () {
    const { query } = useRouter();
    console.log("id is ", query.id);
    const { data, error} = useSWR(`/api/person/${query.id}`, fetcher);
    console.log("data in main ", data, typeof data);

    return (
        <table>
            <tbody>
                <tr>
                    <td>{data.name}</td>
                </tr>
            </tbody>
        </table>
    );
}
</code>```

In the above code, {data.name}	 throws an error TypeError: Cannot read properties of undefined (reading 'id'). When I remove that line, console.log("id is ", query) shows the correct id and console.log("data in main ", data, typeof data); shows Object { id: "2", name: "jdf", age: "17", school: "abc" }. But othwerwise, with the {data.name}, I don't observe any logs, only an error message.

My api/person/[id].ts which serves the fetch request contains the following:

```<code>import { people } from '../../../data';
import { Person } from '../../../interfaces';
import { NextApiResponse, NextApiRequest } from 'next';

interface ResponseError {
    message: string;
}

export default function handler(req: NextApiRequest,
    res: NextApiResponse<Person | ResponseError>) {
    const { id } = req.query;
    const filtered = people.filter((p) => p.id === id)

    return filtered.length > 0
    ? res.status(200).json(filtered[0])
    : res.status(404).json({ message: `User with id: ${id} not found.` })
}
</code>```

It reads a json array of persons from data.ts and filters users for id and returns them.

Body:
I am using axios in a nextjs framework with swr for handling fetch requests.

import { useRouter } from "next/router";
import useSWR from 'swr';
import axios from 'axios';
import { type } from "os";

const fetcher = async (url: string) => {
    return await axios.get(url)
        .then(res => res.data)
        .catch(error => {
            if (error.response.status !== 409) throw error
        })
}

export default function Person () {
    const { query } = useRouter();
    console.log("id is ", query.id);
    const { data, error} = useSWR(`/api/person/${query.id}`, fetcher);
    console.log("data in main ", data, typeof data);

    return (

                    {data.name}

    );
}

In the above code, {data.name}	 throws an error TypeError: Cannot read properties of undefined (reading 'id'). When I remove that line, console.log("id is ", query) shows the correct id and console.log("data in main ", data, typeof data); shows Object { id: "2", name: "jdf", age: "17", school: "abc" }. But othwerwise, with the {data.name}, I don't observe any logs, only an error message.

My api/person/[id].ts which serves the fetch request contains the following:

import { people } from '../../../data';
import { Person } from '../../../interfaces';
import { NextApiResponse, NextApiRequest } from 'next';

interface ResponseError {
    message: string;
}

export default function handler(req: NextApiRequest,
    res: NextApiResponse<Person | ResponseError>) {
    const { id } = req.query;
    const filtered = people.filter((p) => p.id === id)

    return filtered.length > 0
    ? res.status(200).json(filtered[0])
    : res.status(404).json({ message: `User with id: ${id} not found.` })
}

It reads a json array of persons from data.ts and filters users for id and returns them.


问:
Description A byte of unknown significance exists in the Headers frame of http2
I used a man-in-the-middle program to get the http2 source data.

I got a HEADERS frame like this after I split and shunt the data I got.

This frame is the first HEADERS frame returned by the server in this connection.

[enter image description here][1]

Data analysis：

Frame len : 0x00 00 99

Frame type:0x01(HEADERS)

Frame Flag:0x05(END_STREAM(0x1)  | END_HEADERS(0x4))

Frame StreamID: 0x00 00 00 01

The unknown three bytes(0x3f 0xe1 0x5f Protocol does not use these three bytes)

(Dropping these three bytes into the HPACK parser causes an error)

0x8b:(:status 304 )

All HEADERS:

[enter image description here][2]

I wonder why there are these fixed three bytes and it doesn't seem to come up every time.

[1]: https://i.stack.imgur.com/hMmIi.png
[2]: https://i.stack.imgur.com/uOI4Z.png


问:
Maven implementation in android project
Im using two android modules from maven, where one module depends on the other, how can this be achieved by implementing the dependency of both the modules together and make the modules the access it from dependency cache instead of implementing?

How to implement maven module 1's dependency in another maven module or how to access it from dependency cache

Title: Maven implementation in android project


问:
How to write unit test for idb package?
I am using idb to use indexeddb in my project. I am trying to write unit tests for a child component which is just a card with a bunch of information, it does not directly interact with the indexeddb, but the parent component does and passes data as props to this child component.While running the unit test for the child component I am getting this error

```<code>> ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){export
> * from './build/index.js';

SyntaxError: Unexpected token 'export'

> 1 | import { deleteDB, openDB } from 'idb/with-async-ittr.js';
</code>```

What can I do to resolve this error?

Title: How to write unit test for idb package?

Body:
I am using idb to use indexeddb in my project. I am trying to write unit tests for a child component which is just a card with a bunch of information, it does not directly interact with the indexeddb, but the parent component does and passes data as props to this child component.While running the unit test for the child component I am getting this error

> ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){export
> * from './build/index.js';

SyntaxError: Unexpected token 'export'

> 1 | import { deleteDB, openDB } from 'idb/with-async-ittr.js';

What can I do to resolve this error?


问:
How to validate schema date on adonis js?
I have a schema like this:

```<code>
    judul: schema.string(),
    ringkasan: schema.string(),
    tahun_terbit: schema.date({
      format: 'yyyy-MM-dd'
    }),
    halaman: schema.number(),
    kategori_id: schema.number([rules.exists({ table: 'categories', column: 'id' })])

</code>```

I have controller to create after validate like this:

```<code>const books = await request.validate(BooksValidationValidator);

await Book.create(books)
</code>```

in my case the problem was mysql couldn't save the data. i think the problem is in the date format.
I've tried it with rfc2822, iso, and sql formats but it still doesn't work.

Body:
I have a schema like this:

    judul: schema.string(),
    ringkasan: schema.string(),
    tahun_terbit: schema.date({
      format: 'yyyy-MM-dd'
    }),
    halaman: schema.number(),
    kategori_id: schema.number([rules.exists({ table: 'categories', column: 'id' })])

I have controller to create after validate like this:

const books = await request.validate(BooksValidationValidator);

await Book.create(books)

in my case the problem was mysql couldn't save the data. i think the problem is in the date format.
I've tried it with rfc2822, iso, and sql formats but it still doesn't work.


问:
How to write a custom drop down paste handler in a RCP client?
I have a RCP3 client (with RCP4 compatibility mode) with a text field. I want to write a custom paste handler for (A) CTRL-V and (B) paste via the right click drop down context menu.

I managed the CTRL-V case (A) by adding a handler for the  event in my plugin.xml:

```<code>   <extension point="org.eclipse.ui.handlers">
        <handler class="xx.yyy.infop.rcp.myperpective.internal.ui.handlers.vm.PasteNummerHandler:paste" commandId="org.eclipse.ui.edit.paste">
        <activeWhen>
            <with variable="activeContexts">
                <iterate operator="or">
                    <equals value="ch.sbb.infop.rcp.ui.context"></equals>
                </iterate>
            </with>
        </activeWhen>
        </handler>
    </extension>
</code>```

But for paste via drop down (B) this does not have any effect. To me it looks like I don't have any control in RCP over the this menu. I looks the same as in a lot of other Windows applications. Break points in my PasteNummerHandler or in the org.eclipse.swt.widgets.Text.paste() are never hit via the drop down.

Any ideas how to hook into or overwrite the paste action via drop down?

Body:
I have a RCP3 client (with RCP4 compatibility mode) with a text field. I want to write a custom paste handler for (A) CTRL-V and (B) paste via the right click drop down context menu.

I managed the CTRL-V case (A) by adding a handler for the  event in my plugin.xml:

   <extension point="org.eclipse.ui.handlers">
        <handler class="xx.yyy.infop.rcp.myperpective.internal.ui.handlers.vm.PasteNummerHandler:paste" commandId="org.eclipse.ui.edit.paste">
        <activeWhen>
            <with variable="activeContexts">
                <iterate operator="or">
                    <equals value="ch.sbb.infop.rcp.ui.context"></equals>
                </iterate>
            </with>
        </activeWhen>
        </handler>
    </extension>

But for paste via drop down (B) this does not have any effect. To me it looks like I don't have any control in RCP over the this menu. I looks the same as in a lot of other Windows applications. Break points in my PasteNummerHandler or in the org.eclipse.swt.widgets.Text.paste() are never hit via the drop down.

Any ideas how to hook into or overwrite the paste action via drop down?


问:
java.util.concurrent.ThreadPoolExecutor$Worker.run
I have faced these ANRs on my play store console but not on my devices. My firebase crash analytics is also clear.

Same issue reported in other app play console but play store console graph shows 99.1% ANRs free.

```<code>Thread.  "Signal Catcher" tid=6 Runnable
 #00  pc 0x0000000000371645  /apex/com.android.art/lib/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 0x00000000004405f7  /apex/com.android.art/lib/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool, BacktraceMap*, bool) const+386)
  #02  pc 0x000000000043bfc3  /apex/com.android.art/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool, BacktraceMap*, bool) const+34)
  #03  pc 0x0000000000458b99  /apex/com.android.art/lib/libart.so (art::DumpCheckpoint::Run(art::Thread*)+664)
  #04  pc 0x0000000000454173  /apex/com.android.art/lib/libart.so (art::ThreadList::RunCheckpoint(art::Closure*, art::Closure*)+354)
  #05  pc 0x00000000004536ab  /apex/com.android.art/lib/libart.so (art::ThreadList::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool)+1486)
  #06  pc 0x0000000000452da5  /apex/com.android.art/lib/libart.so (art::ThreadList::DumpForSigQuit(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)+604)
  #07  pc 0x000000000040b52b  /apex/com.android.art/lib/libart.so (art::Runtime::DumpForSigQuit(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)+130)
  #08  pc 0x000000000041b0c7  /apex/com.android.art/lib/libart.so (art::SignalCatcher::HandleSigQuit()+1046)
  #09  pc 0x000000000041a465  /apex/com.android.art/lib/libart.so (art::SignalCatcher::Run(void*)+268)
  #10  pc 0x00000000000aacf3  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40)
  #11  pc 0x0000000000064063  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30)

Thread: "FinalizerWatchdogDaemon" tid=11 Waiting
  #00  pc 0x000000000005e328  /apex/com.android.runtime/lib/bionic/libc.so (syscall+28)
  #01  pc 0x0000000000130fb3  /apex/com.android.art/lib/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+82)
  #02  pc 0x000000000045a0b7  /apex/com.android.art/lib/libart.so (art::ThreadPool::GetTask(art::Thread*)+58)
  #03  pc 0x00000000004597c9  /apex/com.android.art/lib/libart.so (art::ThreadPoolWorker::Run()+72)
  #04  pc 0x0000000000459409  /apex/com.android.art/lib/libart.so (art::ThreadPoolWorker::Callback(void*)+116)
  #05  pc 0x00000000000aacf3  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40)
  #06  pc 0x0000000000064063  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30)

Thread:  "Binder:1852_1" tid=12 Native
  #00  pc 0x000000000009ae90  /apex/com.android.runtime/lib/bionic/libc.so (__ioctl+8)
  #01  pc 0x000000000006932f  /apex/com.android.runtime/lib/bionic/libc.so (ioctl+26)
  #02  pc 0x0000000000039a13  /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+238)
  #03  pc 0x0000000000039b85  /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+8)
  #04  pc 0x000000000003a263  /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+38)
  #05  pc 0x00000000000534e9  /system/lib/libbinder.so (android::PoolThread::threadLoop()+12)
  #06  pc 0x000000000000ee95  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+168)
  #07  pc 0x000000000006d02f  /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+86)
  #08  pc 0x000000000000e9dd  /system/lib/libutils.so (thread_data_t::trampoline(thread_data_t const*)+256)
  #09  pc 0x00000000000aacf3  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40)
  #10  pc 0x0000000000064063  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30)
</code>```

Our app core functionality is fetching data from phone and upload to AWS s3 bucket. so i changed coroutines scopes in background thread. Not task running in Main thread except UI changes.but still ANRs graph is not falling.

Body:
I have faced these ANRs on my play store console but not on my devices. My firebase crash analytics is also clear.

Same issue reported in other app play console but play store console graph shows 99.1% ANRs free.

Thread.  "Signal Catcher" tid=6 Runnable
 #00  pc 0x0000000000371645  /apex/com.android.art/lib/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 0x00000000004405f7  /apex/com.android.art/lib/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool, BacktraceMap*, bool) const+386)
  #02  pc 0x000000000043bfc3  /apex/com.android.art/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool, BacktraceMap*, bool) const+34)
  #03  pc 0x0000000000458b99  /apex/com.android.art/lib/libart.so (art::DumpCheckpoint::Run(art::Thread*)+664)
  #04  pc 0x0000000000454173  /apex/com.android.art/lib/libart.so (art::ThreadList::RunCheckpoint(art::Closure*, art::Closure*)+354)
  #05  pc 0x00000000004536ab  /apex/com.android.art/lib/libart.so (art::ThreadList::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool)+1486)
  #06  pc 0x0000000000452da5  /apex/com.android.art/lib/libart.so (art::ThreadList::DumpForSigQuit(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)+604)
  #07  pc 0x000000000040b52b  /apex/com.android.art/lib/libart.so (art::Runtime::DumpForSigQuit(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)+130)
  #08  pc 0x000000000041b0c7  /apex/com.android.art/lib/libart.so (art::SignalCatcher::HandleSigQuit()+1046)
  #09  pc 0x000000000041a465  /apex/com.android.art/lib/libart.so (art::SignalCatcher::Run(void*)+268)
  #10  pc 0x00000000000aacf3  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40)
  #11  pc 0x0000000000064063  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30)

Thread: "FinalizerWatchdogDaemon" tid=11 Waiting
  #00  pc 0x000000000005e328  /apex/com.android.runtime/lib/bionic/libc.so (syscall+28)
  #01  pc 0x0000000000130fb3  /apex/com.android.art/lib/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+82)
  #02  pc 0x000000000045a0b7  /apex/com.android.art/lib/libart.so (art::ThreadPool::GetTask(art::Thread*)+58)
  #03  pc 0x00000000004597c9  /apex/com.android.art/lib/libart.so (art::ThreadPoolWorker::Run()+72)
  #04  pc 0x0000000000459409  /apex/com.android.art/lib/libart.so (art::ThreadPoolWorker::Callback(void*)+116)
  #05  pc 0x00000000000aacf3  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40)
  #06  pc 0x0000000000064063  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30)

Thread:  "Binder:1852_1" tid=12 Native
  #00  pc 0x000000000009ae90  /apex/com.android.runtime/lib/bionic/libc.so (__ioctl+8)
  #01  pc 0x000000000006932f  /apex/com.android.runtime/lib/bionic/libc.so (ioctl+26)
  #02  pc 0x0000000000039a13  /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+238)
  #03  pc 0x0000000000039b85  /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+8)
  #04  pc 0x000000000003a263  /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+38)
  #05  pc 0x00000000000534e9  /system/lib/libbinder.so (android::PoolThread::threadLoop()+12)
  #06  pc 0x000000000000ee95  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+168)
  #07  pc 0x000000000006d02f  /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+86)
  #08  pc 0x000000000000e9dd  /system/lib/libutils.so (thread_data_t::trampoline(thread_data_t const*)+256)
  #09  pc 0x00000000000aacf3  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40)
  #10  pc 0x0000000000064063  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30)

Our app core functionality is fetching data from phone and upload to AWS s3 bucket. so i changed coroutines scopes in background thread. Not task running in Main thread except UI changes.but still ANRs graph is not falling.


问:
I can't add custom instructions to RISC-V GNU GCC
I want to add custom instructions to riscv64-gnu-gcc. I added the following code to riscv-opc.c and riscv-opc.h while referring to the following sites. I am getting an error for some reason. Why?
Ubuntu20.04, riscv64-gnu-tool 12.2.0.
I plan to run a C program on a RISC-V 32bit IM compatible CPU.

I added these codes.

```<code>///home/ubuntu2/riscv-gnu-toolchain/binutils/gdb/opcodes/riscv-opc.c
{"custom",     32, INSN_CLASS_I,     "d,s,t", MATCH_CUSTOM, MASK_CUSTOM, match_opcode, 0}

~/riscv-opc.h
#define MATCH_CUSTOM 0x700b
#define MASK_CUSTOM  0xfe00707f

DECLARE_INSN(custom, MATCH_CUSTOM, MASK_CUSTOM)
</code>```

I did command and got errors.

```<code>//terminal
$cd riscv-gnu-toolchain
$make clean
$make build-binutils
$cd /home/sample_code
$riscv64-unknown-linux-gnu-gcc -march=rv32im -mabi=ilp32 custom_.c

custom.c: Assembler messages:
custom.c:2: Error: unrecognized opcode `custom a1,a2,a3'
</code>```
```<code>//custom.c code
int main(void){
    asm("custom a1, a2, a3");
}
</code>```

Body:
I want to add custom instructions to riscv64-gnu-gcc. I added the following code to riscv-opc.c and riscv-opc.h while referring to the following sites. I am getting an error for some reason. Why?
Ubuntu20.04, riscv64-gnu-tool 12.2.0.
I plan to run a C program on a RISC-V 32bit IM compatible CPU.

I added these codes.

///home/ubuntu2/riscv-gnu-toolchain/binutils/gdb/opcodes/riscv-opc.c
{"custom",     32, INSN_CLASS_I,     "d,s,t", MATCH_CUSTOM, MASK_CUSTOM, match_opcode, 0}

~/riscv-opc.h
#define MATCH_CUSTOM 0x700b
#define MASK_CUSTOM  0xfe00707f

DECLARE_INSN(custom, MATCH_CUSTOM, MASK_CUSTOM)

I did command and got errors.

//terminal
$cd riscv-gnu-toolchain
$make clean
$make build-binutils
$cd /home/sample_code
$riscv64-unknown-linux-gnu-gcc -march=rv32im -mabi=ilp32 custom_.c

custom.c: Assembler messages:
custom.c:2: Error: unrecognized opcode `custom a1,a2,a3'

//custom.c code
int main(void){
    asm("custom a1, a2, a3");
}


问:
Is the line with the word "Date" a header or just the first row? and how can I remove it?
I have imported some stock prices and converted it to pandas dataframe. What I get is a dataframe with 2 headers (See screenshot attached). The 2nd header just has the work "Data". I want to remove the this 2nd header and then rename the header of the first column (which is blank) to "Date"

enter image description here

I tried the drop and droplevel function but it is not working.

enter image description here


问:
Inconsistent border width between table rows after collapsing the cell border
I'm having the issue that my table borders act differently after collapsing it.

It seems the bottom border width of second row is slightly thicker than the rest, I tried changing the border style but still couldn't identify the issue.
Here is my code:

table {
    background-color: burlywood;
    height: 200px;
    width: 600px;
    border: 1px solid black;
    text-align: center;
    border-collapse: collapse;
}

table > tbody > tr > td {
    border: 1px solid black;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><table>
    <tbody>
        <tr>
            <td>cell 1</td>
            <td>cell 2</td>
            <td>cell 3</td>
        </tr>
        <tr>
            <td>cell 4</td>
            <td>cell 5</td>
            <td>cell 6</td>
        </tr>
        <tr>
            <td>cell 7</td>
            <td>cell 8</td>
            <td>cell 9</td>
        </tr>
        <tr>
            <td>cell 10</td>
            <td>cell 11</td>
            <td>cell 12</td>
        </tr>
    </tbody>
</table></code>```

My goal is to make all border width consistent, thanks for anyone helping me on this.

Body:
I'm having the issue that my table borders act differently after collapsing it.

It seems the bottom border width of second row is slightly thicker than the rest, I tried changing the border style but still couldn't identify the issue.
Here is my code:

table {
    background-color: burlywood;
    height: 200px;
    width: 600px;
    border: 1px solid black;
    text-align: center;
    border-collapse: collapse;
}

table > tbody > tr > td {
    border: 1px solid black;
}

            cell 1
            cell 2
            cell 3

            cell 4
            cell 5
            cell 6

            cell 7
            cell 8
            cell 9

            cell 10
            cell 11
            cell 12

My goal is to make all border width consistent, thanks for anyone helping me on this.


问:
How to get specific key value pairs form array of objects in JavaScript
I am working with a object array in JavaScript and i want to output the code in a specific format i.e to remove the object array and created it like a array only and remove rest of the parameters.

```<code> purchase_roas: [
            {
               action_type: "omni_purchase",
               value: "29.650019"
            }
         ],
</code>```

The output I need is in this format:
purchase_roas:29.650019

I tried using map function but the output is not the expected one.
I used the code below:

```<code>for (var number in purchase_roas) {
  if (purchase_roas.hasOwnProperty(number)) {
    keys.push(number);
  }
}
</code>```

The output i am getting is ["0"]

Body:
I am working with a object array in JavaScript and i want to output the code in a specific format i.e to remove the object array and created it like a array only and remove rest of the parameters.

 purchase_roas: [
            {
               action_type: "omni_purchase",
               value: "29.650019"
            }
         ],

The output I need is in this format:
purchase_roas:29.650019

I tried using map function but the output is not the expected one.
I used the code below:

for (var number in purchase_roas) {
  if (purchase_roas.hasOwnProperty(number)) {
    keys.push(number);
  }
}

The output i am getting is ["0"]


问:
how can I fill in the username and password elements moodle mobile
I want to enter the Moodel Mobile application from another application, and my main question is, how can I fill in the username and password elements when entering and then login the user?
Although the login page of the mobile moodel is JavaScript.

How can I access to this JS?

It is like bellow:

```<code>    (window.webpackJsonp = window.webpackJsonp || []).push([
    [102], {
        ...some code....

            function CoreLoginCredentialsPage_img_17_Template(e, t) {
                if (1 & e && f.zc(0, "img", 22), 2 & e) {
                    const e = f.Oc();
                    f.Vc("src", e.logoUrl, f.id)
                }
            }

            function CoreLoginCredentialsPage_img_18_Template(e, t) {
                1 & e && f.zc(0, "img", 23)
            }

            function CoreLoginCredentialsPage_h3_19_Template(e, t) {
                if (1 & e && (f.Ec(0, "h3", 24), f.zc(1, "core-format-text", 25), f.Dc()), 2 & e) {
                    const e = f.Oc();
                    f.lc(1), f.Vc("text", e.siteName)("filter", !1)
                }
            }

            function CoreLoginCredentialsPage_ion_item_24_Template(e, t) {
                1 & e && (f.Ec(0, "ion-item"), f.Ec(1, "ion-label", 26), f.pd(2), f.Pc(3, "translate"), f.Dc(), f.zc(4, "ion-input", 27), f.Pc(5, "translate"), f.Dc()), 2 & e && (f.lc(2), f.qd(f.Qc(3, 2, "core.login.username")), f.lc(2), f.Wc("placeholder", f.Qc(5, 4, "core.login.username")))
            }

            function CoreLoginCredentialsPage_ion_item_25_Template(e, t) {
                1 & e && (f.Ec(0, "ion-item", 28), f.Ec(1, "ion-label", 26), f.pd(2), f.Pc(3, "translate"), f.Dc(), f.Ec(4, "core-show-password", 29), f.zc(5, "ion-input", 30), f.Pc(6, "translate"), f.Dc(), f.Dc()), 2 & e && (f.lc(2), f.qd(f.Qc(3, 3, "core.login.password")), f.lc(3), f.Wc("placeholder", f.Qc(6, 5, "core.login.password")), f.Vc("clearOnEdit", !1))
            }

            function CoreLoginCredentialsPage_ng_container_30_Template(e, t) {
                if (1 & e) {
                    const e = f.Fc();
                    f.Cc(0), f.Ec(1, "div", 31), f.pd(2), f.Pc(3, "translate"), f.Dc(), f.Ec(4, "ion-button", 32), f.Mc("click", (function CoreLoginCredentialsPage_ng_container_30_Template_ion_button_click_4_listener() {
                        f.fd(e);
                        return f.Oc().showInstructionsAndScanQR()
                    })), f.zc(5, "ion-icon", 33), f.pd(6), f.Pc(7, "translate"), f.Dc(), f.Bc()
                }
                2 & e && (f.lc(2), f.qd(f.Qc(3, 2, "core.login.or")), f.lc(4), f.rd(" ", f.Qc(7, 4, "core.scanqr"), " "))
            }

            function CoreLoginCredentialsPage_ion_button_31_Template(e, t) {
                if (1 & e) {
                    const e = f.Fc();
                    f.Ec(0, "ion-button", 34), f.Mc("click", (function CoreLoginCredentialsPage_ion_button_31_Template_ion_button_click_0_listener() {
                        f.fd(e);
                        return f.Oc().forgottenPassword()
                    })), f.pd(1), f.Pc(2, "translate"), f.Dc()
                }
                2 & e && (f.lc(1), f.rd(" ", f.Qc(2, 1, "core.login.forgotten"), " "))
            }

            function CoreLoginCredentialsPage_ion_list_32_ion_button_6_Template(e, t) {
                if (1 & e) {
                    const e = f.Fc();
                    f.Ec(0, "ion-button", 39), f.Mc("click", (function CoreLoginCredentialsPage_ion_list_32_ion_button_6_Template_ion_button_click_0_listener() {
                        f.fd(e);
                        const n = t.$implicit;
                        return f.Oc(2).oauthClicked(n)
                    })), f.zc(1, "img", 40), f.Ec(2, "ion-label"), f.pd(3), f.Dc(), f.Dc()
                }
                if (2 & e) {
                    const e = t.$implicit;
                    f.mc("aria-label", e.name), f.lc(1), f.Vc("src", e.iconurl, f.id), f.lc(2), f.qd(e.name)
                }
            }

            function CoreLoginCredentialsPage_ion_list_32_Template(e, t) {
                if (1 & e && (f.Ec(0, "ion-list", 35), f.Ec(1, "ion-item", 36), f.Ec(2, "ion-label"), f.Ec(3, "h3", 37), f.pd(4), f.Pc(5, "translate"), f.Dc(), f.Dc(), f.Dc(), f.nd(6, CoreLoginCredentialsPage_ion_list_32_ion_button_6_Template, 4, 3, "ion-button", 38), f.Dc()), 2 & e) {
                    const e = f.Oc();
                    f.lc(4), f.qd(f.Qc(5, 2, "core.login.potentialidps")), f.lc(2), f.Vc("ngForOf", e.identityProviders)
                }
            }

            function CoreLoginCredentialsPage_ion_list_33_ion_item_6_Template(e, t) {
                if (1 & e && (f.Ec(0, "ion-item", 36), f.Ec(1, "ion-label"), f.Ec(2, "p"), f.zc(3, "core-format-text", 25), f.Dc(), f.Dc(), f.Dc()), 2 & e) {
                    const e = f.Oc(2);
                    f.lc(3), f.Vc("text", e.authInstructions)("filter", !1)
                }
            }

            function CoreLoginCredentialsPage_ion_list_33_Template(e, t) {
                if (1 & e) {
                    const e = f.Fc();
                    f.Ec(0, "ion-list", 41), f.Ec(1, "ion-item", 36), f.Ec(2, "ion-label"), f.Ec(3, "h3", 37), f.pd(4), f.Pc(5, "translate"), f.Dc(), f.Dc(), f.Dc(), f.nd(6, CoreLoginCredentialsPage_ion_list_33_ion_item_6_Template, 4, 2, "ion-item", 42), f.Ec(7, "ion-button", 43), f.Mc("click", (function CoreLoginCredentialsPage_ion_list_33_Template_ion_button_click_7_listener() {
                        f.fd(e);
                        return f.Oc().openEmailSignup()
                    })), f.pd(8), f.Pc(9, "translate"), f.Dc(), f.Dc()
                }
                if (2 & e) {
                    const e = f.Oc();
                    f.lc(4), f.qd(f.Qc(5, 3, "core.login.firsttime")), f.lc(2), f.Vc("ngIf", e.authInstructions), f.lc(2), f.rd(" ", f.Qc(9, 5, "core.login.startsignup"), " ")
                }
            }
            let x = (() => {
                class CoreLoginCredentialsPage {
                    constructor(e) {
                        this.fb = e, this.siteChecked = !1, this.pageLoaded = !1, this.isBrowserSSO = !1, this.isFixedUrlSet = !1, this.showForgottenPassword = !0, this.showScanQR = !1, this.eventThrown = !1, this.viewLeft = !1
                    }
                    ngOnInit() {
            ..some code..
]);
</code>```

Body:
I want to enter the Moodel Mobile application from another application, and my main question is, how can I fill in the username and password elements when entering and then login the user?
Although the login page of the mobile moodel is JavaScript.

How can I access to this JS?

It is like bellow:

    (window.webpackJsonp = window.webpackJsonp || []).push([
    [102], {
        ...some code....

            function CoreLoginCredentialsPage_img_17_Template(e, t) {
                if (1 & e && f.zc(0, "img", 22), 2 & e) {
                    const e = f.Oc();
                    f.Vc("src", e.logoUrl, f.id)
                }
            }

            function CoreLoginCredentialsPage_img_18_Template(e, t) {
                1 & e && f.zc(0, "img", 23)
            }

            function CoreLoginCredentialsPage_h3_19_Template(e, t) {
                if (1 & e && (f.Ec(0, "h3", 24), f.zc(1, "core-format-text", 25), f.Dc()), 2 & e) {
                    const e = f.Oc();
                    f.lc(1), f.Vc("text", e.siteName)("filter", !1)
                }
            }

            function CoreLoginCredentialsPage_ion_item_24_Template(e, t) {
                1 & e && (f.Ec(0, "ion-item"), f.Ec(1, "ion-label", 26), f.pd(2), f.Pc(3, "translate"), f.Dc(), f.zc(4, "ion-input", 27), f.Pc(5, "translate"), f.Dc()), 2 & e && (f.lc(2), f.qd(f.Qc(3, 2, "core.login.username")), f.lc(2), f.Wc("placeholder", f.Qc(5, 4, "core.login.username")))
            }

            function CoreLoginCredentialsPage_ion_item_25_Template(e, t) {
                1 & e && (f.Ec(0, "ion-item", 28), f.Ec(1, "ion-label", 26), f.pd(2), f.Pc(3, "translate"), f.Dc(), f.Ec(4, "core-show-password", 29), f.zc(5, "ion-input", 30), f.Pc(6, "translate"), f.Dc(), f.Dc()), 2 & e && (f.lc(2), f.qd(f.Qc(3, 3, "core.login.password")), f.lc(3), f.Wc("placeholder", f.Qc(6, 5, "core.login.password")), f.Vc("clearOnEdit", !1))
            }

            function CoreLoginCredentialsPage_ng_container_30_Template(e, t) {
                if (1 & e) {
                    const e = f.Fc();
                    f.Cc(0), f.Ec(1, "div", 31), f.pd(2), f.Pc(3, "translate"), f.Dc(), f.Ec(4, "ion-button", 32), f.Mc("click", (function CoreLoginCredentialsPage_ng_container_30_Template_ion_button_click_4_listener() {
                        f.fd(e);
                        return f.Oc().showInstructionsAndScanQR()
                    })), f.zc(5, "ion-icon", 33), f.pd(6), f.Pc(7, "translate"), f.Dc(), f.Bc()
                }
                2 & e && (f.lc(2), f.qd(f.Qc(3, 2, "core.login.or")), f.lc(4), f.rd(" ", f.Qc(7, 4, "core.scanqr"), " "))
            }

            function CoreLoginCredentialsPage_ion_button_31_Template(e, t) {
                if (1 & e) {
                    const e = f.Fc();
                    f.Ec(0, "ion-button", 34), f.Mc("click", (function CoreLoginCredentialsPage_ion_button_31_Template_ion_button_click_0_listener() {
                        f.fd(e);
                        return f.Oc().forgottenPassword()
                    })), f.pd(1), f.Pc(2, "translate"), f.Dc()
                }
                2 & e && (f.lc(1), f.rd(" ", f.Qc(2, 1, "core.login.forgotten"), " "))
            }

            function CoreLoginCredentialsPage_ion_list_32_ion_button_6_Template(e, t) {
                if (1 & e) {
                    const e = f.Fc();
                    f.Ec(0, "ion-button", 39), f.Mc("click", (function CoreLoginCredentialsPage_ion_list_32_ion_button_6_Template_ion_button_click_0_listener() {
                        f.fd(e);
                        const n = t.$implicit;
                        return f.Oc(2).oauthClicked(n)
                    })), f.zc(1, "img", 40), f.Ec(2, "ion-label"), f.pd(3), f.Dc(), f.Dc()
                }
                if (2 & e) {
                    const e = t.$implicit;
                    f.mc("aria-label", e.name), f.lc(1), f.Vc("src", e.iconurl, f.id), f.lc(2), f.qd(e.name)
                }
            }

            function CoreLoginCredentialsPage_ion_list_32_Template(e, t) {
                if (1 & e && (f.Ec(0, "ion-list", 35), f.Ec(1, "ion-item", 36), f.Ec(2, "ion-label"), f.Ec(3, "h3", 37), f.pd(4), f.Pc(5, "translate"), f.Dc(), f.Dc(), f.Dc(), f.nd(6, CoreLoginCredentialsPage_ion_list_32_ion_button_6_Template, 4, 3, "ion-button", 38), f.Dc()), 2 & e) {
                    const e = f.Oc();
                    f.lc(4), f.qd(f.Qc(5, 2, "core.login.potentialidps")), f.lc(2), f.Vc("ngForOf", e.identityProviders)
                }
            }

            function CoreLoginCredentialsPage_ion_list_33_ion_item_6_Template(e, t) {
                if (1 & e && (f.Ec(0, "ion-item", 36), f.Ec(1, "ion-label"), f.Ec(2, "p"), f.zc(3, "core-format-text", 25), f.Dc(), f.Dc(), f.Dc()), 2 & e) {
                    const e = f.Oc(2);
                    f.lc(3), f.Vc("text", e.authInstructions)("filter", !1)
                }
            }

            function CoreLoginCredentialsPage_ion_list_33_Template(e, t) {
                if (1 & e) {
                    const e = f.Fc();
                    f.Ec(0, "ion-list", 41), f.Ec(1, "ion-item", 36), f.Ec(2, "ion-label"), f.Ec(3, "h3", 37), f.pd(4), f.Pc(5, "translate"), f.Dc(), f.Dc(), f.Dc(), f.nd(6, CoreLoginCredentialsPage_ion_list_33_ion_item_6_Template, 4, 2, "ion-item", 42), f.Ec(7, "ion-button", 43), f.Mc("click", (function CoreLoginCredentialsPage_ion_list_33_Template_ion_button_click_7_listener() {
                        f.fd(e);
                        return f.Oc().openEmailSignup()
                    })), f.pd(8), f.Pc(9, "translate"), f.Dc(), f.Dc()
                }
                if (2 & e) {
                    const e = f.Oc();
                    f.lc(4), f.qd(f.Qc(5, 3, "core.login.firsttime")), f.lc(2), f.Vc("ngIf", e.authInstructions), f.lc(2), f.rd(" ", f.Qc(9, 5, "core.login.startsignup"), " ")
                }
            }
            let x = (() => {
                class CoreLoginCredentialsPage {
                    constructor(e) {
                        this.fb = e, this.siteChecked = !1, this.pageLoaded = !1, this.isBrowserSSO = !1, this.isFixedUrlSet = !1, this.showForgottenPassword = !0, this.showScanQR = !1, this.eventThrown = !1, this.viewLeft = !1
                    }
                    ngOnInit() {
            ..some code..
]);


问:
GPSD does not communicate with other programs
The setup a a garmin GPS wuth GPSD is not working fully, there is valid coordinates outputted from gpsd -N -D3 /dev/ttyUSB0, but kismet claims there is no GPS, cgps and gpsmon fails to get a fix, gpspipe outputs zero values (in the correct format) for -r and -w and the same raw binary that gpsmon uses for -R the following is the output of the command gpsd -N -D3 /dev/ttyUSB0.

```<code>gpsd:INFO: Garmin: Geoid Separation (MSL-WGS84): from garmin xx.xxxxxx, calculated xx.xxxxxx
gpsd:INFO: Garmin: Alt: 150.000, sep: 759.426, eph: 1518.852, Epv: 759.426, Fix: 1, Gps_tow: 195686.000000, Lat: xx.xxx, Lon: xx.xxx, velN: 0.000, velE: 0.000, velD: -0.000, geoidsep: xx.xxx, Leap: 18, GarminDays: 12054
gpsd:WARN: Garmin: Unknown packet id: 0x27, Sz: 0x2
gpsd:WARN: Garmin: Unknown packet id: 0x28, Sz: 0x4
gpsd:INFO: Garmin: Sat 16, snr:     0, elev:  0, Azmth:   0, Stat: x0
gpsd:INFO: Garmin: Sat 16, snr:     0, elev:  0, Azmth:   0, Stat: x0
gpsd:INFO: Garmin: Sat 16, snr:     0, elev:  0, Azmth:   0, Stat: x0
gpsd:INFO: Garmin: Sat 16, snr:     0, elev:  0, Azmth:   0, Stat: x0
gpsd:INFO: Garmin: Sat 16, snr:     0, elev:  0, Azmth:   0, Stat: x0
gpsd:INFO: Garmin: Sat 16, snr:     0, elev:  0, Azmth:   0, Stat: x0
gpsd:INFO: Garmin: Sat 16, snr:     0, elev:  0, Azmth:   0, Stat: x0
gpsd:INFO: Garmin: Sat 16, snr:     0, elev:  0, Azmth:   0, Stat: x0
gpsd:INFO: Garmin: Sat 16, snr:     0, elev:  0, Azmth:   0, Stat: x0
gpsd:INFO: Garmin: Sat 16, snr:     0, elev:  0, Azmth:   0, Stat: x0
gpsd:INFO: Garmin: Sat 16, snr:     0, elev:  0, Azmth:   0, Stat: x0
gpsd:INFO: Garmin: Sat 16, snr:     0, elev:  0, Azmth:   0, Stat: x0
</code>```

I don't mind that the satelite information is zero, but I would like to be able to access the other information with these programs.

Body:
The setup a a garmin GPS wuth GPSD is not working fully, there is valid coordinates outputted from gpsd -N -D3 /dev/ttyUSB0, but kismet claims there is no GPS, cgps and gpsmon fails to get a fix, gpspipe outputs zero values (in the correct format) for -r and -w and the same raw binary that gpsmon uses for -R the following is the output of the command gpsd -N -D3 /dev/ttyUSB0.

gpsd:INFO: Garmin: Geoid Separation (MSL-WGS84): from garmin xx.xxxxxx, calculated xx.xxxxxx
gpsd:INFO: Garmin: Alt: 150.000, sep: 759.426, eph: 1518.852, Epv: 759.426, Fix: 1, Gps_tow: 195686.000000, Lat: xx.xxx, Lon: xx.xxx, velN: 0.000, velE: 0.000, velD: -0.000, geoidsep: xx.xxx, Leap: 18, GarminDays: 12054
gpsd:WARN: Garmin: Unknown packet id: 0x27, Sz: 0x2
gpsd:WARN: Garmin: Unknown packet id: 0x28, Sz: 0x4
gpsd:INFO: Garmin: Sat 16, snr:     0, elev:  0, Azmth:   0, Stat: x0
gpsd:INFO: Garmin: Sat 16, snr:     0, elev:  0, Azmth:   0, Stat: x0
gpsd:INFO: Garmin: Sat 16, snr:     0, elev:  0, Azmth:   0, Stat: x0
gpsd:INFO: Garmin: Sat 16, snr:     0, elev:  0, Azmth:   0, Stat: x0
gpsd:INFO: Garmin: Sat 16, snr:     0, elev:  0, Azmth:   0, Stat: x0
gpsd:INFO: Garmin: Sat 16, snr:     0, elev:  0, Azmth:   0, Stat: x0
gpsd:INFO: Garmin: Sat 16, snr:     0, elev:  0, Azmth:   0, Stat: x0
gpsd:INFO: Garmin: Sat 16, snr:     0, elev:  0, Azmth:   0, Stat: x0
gpsd:INFO: Garmin: Sat 16, snr:     0, elev:  0, Azmth:   0, Stat: x0
gpsd:INFO: Garmin: Sat 16, snr:     0, elev:  0, Azmth:   0, Stat: x0
gpsd:INFO: Garmin: Sat 16, snr:     0, elev:  0, Azmth:   0, Stat: x0
gpsd:INFO: Garmin: Sat 16, snr:     0, elev:  0, Azmth:   0, Stat: x0

I don't mind that the satelite information is zero, but I would like to be able to access the other information with these programs.


问:
Repository & stored procedure
In my repository, I have a method to execute my stored procedure like this:

```<code>public DbRawSqlQuery<TEntity> SQLQuery<TEntity>(string SQL, params object[] Parameters)
{
    return _context.Database.SqlQuery<TEntity>(SQL, Parameters);
}
</code>```

And in WPF window, I call the above method like this:

```<code>private void btnTest_Click(object sender, RoutedEventArgs e)
{
    using (UnitOfWork DB = new UnitOfWork())
    {
        SqlParameter P1 = new SqlParameter("FName", SqlDbType.NVarChar) { Value = "Ali" };
        SqlParameter P2 = new SqlParameter("LName", SqlDbType.NVarChar) { Value = "Karimi" };
        SqlParameter P3 = new SqlParameter("Age", SqlDbType.Int) { Value = 30 };

        DB.SP_Test.SQLQuery("SP_Test @FName, @LName, @Age", P1, P2, P3);
    }
}
</code>```

But I get an error :

Error  CS0411

The type arguments for method 'StoredProcedureRepository.SQLQuery(string, params object[])' cannot be inferred from the usage. Try specifying the type arguments explicitly.

What does this error mean? How to fix it?

Title: Repository & stored procedure

Body:
In my repository, I have a method to execute my stored procedure like this:

public DbRawSqlQuery<TEntity> SQLQuery<TEntity>(string SQL, params object[] Parameters)
{
    return _context.Database.SqlQuery<TEntity>(SQL, Parameters);
}

And in WPF window, I call the above method like this:

private void btnTest_Click(object sender, RoutedEventArgs e)
{
    using (UnitOfWork DB = new UnitOfWork())
    {
        SqlParameter P1 = new SqlParameter("FName", SqlDbType.NVarChar) { Value = "Ali" };
        SqlParameter P2 = new SqlParameter("LName", SqlDbType.NVarChar) { Value = "Karimi" };
        SqlParameter P3 = new SqlParameter("Age", SqlDbType.Int) { Value = 30 };

        DB.SP_Test.SQLQuery("SP_Test @FName, @LName, @Age", P1, P2, P3);
    }
}

But I get an error :

Error  CS0411

The type arguments for method 'StoredProcedureRepository.SQLQuery(string, params object[])' cannot be inferred from the usage. Try specifying the type arguments explicitly.

What does this error mean? How to fix it?


问:
Eyedropper tool in UIColorPickerViewController
I am using color picker view controller in my app. I would like to hide Eye Dropper because, I only want to use color picker without Eye Dropper. I have look into UIColorPickerViewController class but did not find anything related to eyedropper. Please tell me if this can be done or not.

Thanks,


问:
Why my nestj.js microservice not responding?
I made two microservice with nest.js and I connected these services on gateway. There is no problem while I work with localhost but I can't receive a response from host. This is the error:

Error: Connection closed
    at ClientTCP.handleClose (/Users/ali/Desktop/topstudy/topstudy-app/node_modules/@nestjs/microservices/client/client-tcp.js:79:25)
    at Socket.<anonymous> (/Users/ali/Desktop/topstudy/topstudy-app/node_modules/@nestjs/microservices/client/client-tcp.js:69:55)
    at Socket.emit (node:events:532:35)
    at TCP.<anonymous> (node:net:687:12)
```
<p>And this is my port and host values:</p>
<pre class="lang-js prettyprint-override"><code>{
    imports: [ConfigModule],
    inject: [ConfigService],
    name: 'SCHOOL_SERVICE',
    useFactory: (configService: ConfigService) => {
        return {
            transport: Transport.TCP,
            options: {
                host: 'url.herokuapp.com',
                port: 80,
            },
        }
    },
}
</code>```

If I switch this credentials with the local ones works as expected. But I'm sure host credentials are not wrong I get connection closed error after 30 seconds.

Body:
I made two microservice with nest.js and I connected these services on gateway. There is no problem while I work with localhost but I can't receive a response from host. This is the error:

Error: Connection closed
    at ClientTCP.handleClose (/Users/ali/Desktop/topstudy/topstudy-app/node_modules/@nestjs/microservices/client/client-tcp.js:79:25)
    at Socket.<anonymous> (/Users/ali/Desktop/topstudy/topstudy-app/node_modules/@nestjs/microservices/client/client-tcp.js:69:55)
    at Socket.emit (node:events:532:35)
    at TCP.<anonymous> (node:net:687:12)

And this is my port and host values:

{
    imports: [ConfigModule],
    inject: [ConfigService],
    name: 'SCHOOL_SERVICE',
    useFactory: (configService: ConfigService) => {
        return {
            transport: Transport.TCP,
            options: {
                host: 'url.herokuapp.com',
                port: 80,
            },
        }
    },
}

If I switch this credentials with the local ones works as expected. But I'm sure host credentials are not wrong I get connection closed error after 30 seconds.


问:
Will variables inside of scope-blocks be garbage collected once the scope exists in JavaScript?
For example, will this data variable be garbage collected instantly?

{
  const data = new Array(10000);
}
```

...and if so, does this mean using scope-blocks in JavaScript can be a practical method of localizing short-lived data? I know this shouldn't be high priority or anything, but I'm just curious.

Body:
For example, will this data variable be garbage collected instantly?

{
  const data = new Array(10000);
}

...and if so, does this mean using scope-blocks in JavaScript can be a practical method of localizing short-lived data? I know this shouldn't be high priority or anything, but I'm just curious.


问:
Getting permission denied while importing .bacpac file to amazone rds
I am trying to import .bacpac file to one of my amazone RDS SQL server and I am getting the following error,

```<code>Error SQL72014: Core Microsoft SqlClient Data Provider: Msg 15151, Level 16, State 1, Line 1 Cannot drop the user 'myuser', because it does not exist or you do not have permission.
Error SQL72045: Script execution error.  The executed script:
DROP USER [myuser];
</code>```

I am using sqlpackage command utility to import the .bacpac file. Here "myuser" is my rds master user name which was specified when I a creating the rds instance server.

Also, I would like to know how I can give full privilege to a user to a database in Amazone RDS SQL server.

Body:
I am trying to import .bacpac file to one of my amazone RDS SQL server and I am getting the following error,

Error SQL72014: Core Microsoft SqlClient Data Provider: Msg 15151, Level 16, State 1, Line 1 Cannot drop the user 'myuser', because it does not exist or you do not have permission.
Error SQL72045: Script execution error.  The executed script:
DROP USER [myuser];

I am using sqlpackage command utility to import the .bacpac file. Here "myuser" is my rds master user name which was specified when I a creating the rds instance server.

Also, I would like to know how I can give full privilege to a user to a database in Amazone RDS SQL server.


问:
Having trouble with Bootstrap inline block
I am building a portfolio website and trying to get three images to line up next to each other. I used a classname of d-inline-block(bootstrap) and they don't appear next to each other but one by one down the page.

```<code><div className="d-inline-block g-card">
        <img className="g-card-image" src={props.item.imgSrc} alt={props.item.imgSrc} onClick={()=>props.click(props.item)}/>
        {props.item.selected && <CardInfo title={props.item.title} subTitle={props.item.subTitle} link={props.item.link} />}
    </div>
</code>```

Here is my css:

```<code>.g-card{
    margin: 20px
}

.g-card-image{
    border-radius:10px;
    width:300px;
    height:480px;
    box-shadow:0px 0px 3px 1px #ccc;

}

.gcard-info{
    margin-top:10px;
    min-height:100px;
}

g-card-title{
    font-size:24px;
    margin:0px;
}

.g-card-sub-title{
    font-size:16px;
    margin:0px;
}
</code>```

I tried using bootstrap flex but that didn't work.

Body:
I am building a portfolio website and trying to get three images to line up next to each other. I used a classname of d-inline-block(bootstrap) and they don't appear next to each other but one by one down the page.

        props.click(props.item)}/>
        {props.item.selected && <CardInfo title={props.item.title} subTitle={props.item.subTitle} link={props.item.link} />}

Here is my css:

.g-card{
    margin: 20px
}

.g-card-image{
    border-radius:10px;
    width:300px;
    height:480px;
    box-shadow:0px 0px 3px 1px #ccc;

}

.gcard-info{
    margin-top:10px;
    min-height:100px;
}

g-card-title{
    font-size:24px;
    margin:0px;
}

.g-card-sub-title{
    font-size:16px;
    margin:0px;
}

I tried using bootstrap flex but that didn't work.


问:
Image rotation prediction STL-10 dataset PyTorch
I am doing Self-supervised learning where you create a proxy task to learn image representations (Python 3.10 And PyTorch 1.13). STL-10 dataset has 100K unlabeled RGB images of (96, 96) dimensions. One way is to rotate each image with either 0, 90, 180 or 270 degrees randomly and ask the network to predict it. This becomes a supervised task: X = randomly rotated image, y = image rotation angle (to predict).

```<code># Define training dataset-
train_dataset = torchvision.datasets.STL10(
    root = 'C:/Users/arjun/Downloads/data/', split = 'unlabeled',
    folds = None, transform = None,
    target_transform = None, download = True
)

# Define testing dataset-
test_dataset = torchvision.datasets.STL10(
    root = 'C:/Users/arjun/Downloads/data/', split = 'unlabeled',
    folds = None, transform = None,
    target_transform = None, download = True
)
</code>```

How can I define this in the transformations-

```<code># Define torchvision transformations for training and test sets-
transform_train = transforms.Compose(
    [
        # transforms.RandomCrop(32, padding = 4),
        transforms.RandomHorizontalFlip(p = 0.4),
        transforms.RandomRotation(degrees = 40),
        transforms.RandomVerticalFlip(p = 0.1),
        transforms.ColorJitter(brightness = 0, contrast = 0, saturation = 0, hue = 0),
        transforms.ToTensor(),
        transforms.Normalize((0.4914, 0.4822, 0.4465), (0.2023, 0.1994, 0.2010)),
    ]
)

transform_test = transforms.Compose(
    [
        transforms.ToTensor(),
        transforms.Normalize((0.4914, 0.4822, 0.4465), (0.2023, 0.1994, 0.2010)),
    ]
)
</code>```

Body:
I am doing Self-supervised learning where you create a proxy task to learn image representations (Python 3.10 And PyTorch 1.13). STL-10 dataset has 100K unlabeled RGB images of (96, 96) dimensions. One way is to rotate each image with either 0, 90, 180 or 270 degrees randomly and ask the network to predict it. This becomes a supervised task: X = randomly rotated image, y = image rotation angle (to predict).

# Define training dataset-
train_dataset = torchvision.datasets.STL10(
    root = 'C:/Users/arjun/Downloads/data/', split = 'unlabeled',
    folds = None, transform = None,
    target_transform = None, download = True
)

# Define testing dataset-
test_dataset = torchvision.datasets.STL10(
    root = 'C:/Users/arjun/Downloads/data/', split = 'unlabeled',
    folds = None, transform = None,
    target_transform = None, download = True
)

How can I define this in the transformations-

# Define torchvision transformations for training and test sets-
transform_train = transforms.Compose(
    [
        # transforms.RandomCrop(32, padding = 4),
        transforms.RandomHorizontalFlip(p = 0.4),
        transforms.RandomRotation(degrees = 40),
        transforms.RandomVerticalFlip(p = 0.1),
        transforms.ColorJitter(brightness = 0, contrast = 0, saturation = 0, hue = 0),
        transforms.ToTensor(),
        transforms.Normalize((0.4914, 0.4822, 0.4465), (0.2023, 0.1994, 0.2010)),
    ]
)

transform_test = transforms.Compose(
    [
        transforms.ToTensor(),
        transforms.Normalize((0.4914, 0.4822, 0.4465), (0.2023, 0.1994, 0.2010)),
    ]
)


问:
Amplify -v itself downloading latest version of amplify?
When i am trying to uninstall amplify it is not uninstalling it and when trying to check version using amplify -v it is downloading latest version of amplify itself.

On uninstall it should uninstall amplify and on amplify -v don’t download it itself.


问:
Only record audio from device itself in flutter
I want to record audio from the device only, such as the music from the device.

I had try package sound_stream, but it record all audio from microphone, it's not what I need.

Is there any way I can record audio from device itself only?


问:
Chrome Mobile Simulator with touch doesn't capture the touched location correctly

Chrome Version 108.0.5359.124

OS: Ubuntu 22.04.1 LTS (Identified the same on Windows 10 too)

Ember.js (ember-cli 3.3.0)

When clicked on a small element (clear input button), with touch enabled on Chrome Developer Tools mobile simulator, it triggers the adjacent element (which in this case is a text input box) instead of the one it was intended to, or doesn't do anything at all if the padding of the intended element is too small. If the space is large enough (>10px) between the input box and the clear button, it works when clicked with around 10px offset away from the adjacent input element (the input doesn't have a margin or padding at the moment). This is where I'm confused about whether it is a Chrome bug or something else is going on.

On Desktop mode, it works fine with or without touch-enabled. With mobile (no touch), it works fine as well.

Tested on Firefox 105.0.1, it works fine even with mobile (with touch).

I have seen many older posts in this regard citing bugs with Chrome, but couldn't find anything regarding newer versions.

This is what I'm working with, (ember.js with ember-cli 3.3.0)

        {{input id="helpSearch" class="full-width" type="text" placeholder="Search" value=searchKey}}

```
<pre class="lang-js prettyprint-override"><code>actions: {
    clearSearchText: function () {
        this.set('searchKey', '');
    }
}
</code>```

Any workarounds to fix this?

Body:
Chrome Version 108.0.5359.124

OS: Ubuntu 22.04.1 LTS (Identified the same on Windows 10 too)

Ember.js (ember-cli 3.3.0)

When clicked on a small element (clear input button), with touch enabled on Chrome Developer Tools mobile simulator, it triggers the adjacent element (which in this case is a text input box) instead of the one it was intended to, or doesn't do anything at all if the padding of the intended element is too small. If the space is large enough (>10px) between the input box and the clear button, it works when clicked with around 10px offset away from the adjacent input element (the input doesn't have a margin or padding at the moment). This is where I'm confused about whether it is a Chrome bug or something else is going on.

On Desktop mode, it works fine with or without touch-enabled. With mobile (no touch), it works fine as well.

Tested on Firefox 105.0.1, it works fine even with mobile (with touch).

I have seen many older posts in this regard citing bugs with Chrome, but couldn't find anything regarding newer versions.

This is what I'm working with, (ember.js with ember-cli 3.3.0)

        {{input id="helpSearch" class="full-width" type="text" placeholder="Search" value=searchKey}}

actions: {
    clearSearchText: function () {
        this.set('searchKey', '');
    }
}

Any workarounds to fix this?


问:
How to create a method that returns generics with incompatible bounds?
Sorry for this noob Java question

I am trying to write a parser for the String representation of an Object of type T

T could be

String

ArrayList<T>

LinkedHashMap<String, T>

I have used toString() to convert it into a String, example strings are like

```<code>
"a"
"{foo=bar}"
"[foo, bar]"
"[{foo1=bar1}, {foo2=bar2}]"
"{a=[a1, a2], b=b1, c={key:val}}"
</code>```

Because the parsed result could be of various type, I am trying to make the parser return a generic type

I tried something like

```<code>
private <T extends String & LinkedHashMap<String, T> & ArrayList<T>> T parse(String s)
throws ParseException {

    if (s.charAt(0) != '{' && s.charAt(0) != '[') {
      return s;
    } else if (s.charAt(0) == '{') {
      LinkedHashMap<String, T> res = new LinkedHashMap<>();
      for (String entry : s.substring(1, s.length() - 1).split(", ")) {
        String[] data = entry.split("=");
        res.put(data[0], parse(data[1]));
      }
      return res;
    } else if (s.charAt(0) == '[') {
      ArrayList<T> res = new ArrayList<>();
      for (String data : s.substring(1, s.length() - 1).split(", ")) {
        res.add(parse(data));
      }
      return res;
    } else {
      throw new ParseException(...);
    }

}
</code>```

And got errors like

```<code>
incompatible types:
   String cannot be converted to T
   LinkedHashMap<String,T> cannot be converted to T
   ArrayList<T> cannot be converted to T
</code>```

How do I make it work?
Thanks for the help in advance!

Body:
Sorry for this noob Java question

I am trying to write a parser for the String representation of an Object of type T

T could be

String

ArrayList<T>

LinkedHashMap<String, T>

I have used toString() to convert it into a String, example strings are like

"a"
"{foo=bar}"
"[foo, bar]"
"[{foo1=bar1}, {foo2=bar2}]"
"{a=[a1, a2], b=b1, c={key:val}}"

Because the parsed result could be of various type, I am trying to make the parser return a generic type

I tried something like

private <T extends String & LinkedHashMap<String, T> & ArrayList<T>> T parse(String s)
throws ParseException {

    if (s.charAt(0) != '{' && s.charAt(0) != '[') {
      return s;
    } else if (s.charAt(0) == '{') {
      LinkedHashMap<String, T> res = new LinkedHashMap<>();
      for (String entry : s.substring(1, s.length() - 1).split(", ")) {
        String[] data = entry.split("=");
        res.put(data[0], parse(data[1]));
      }
      return res;
    } else if (s.charAt(0) == '[') {
      ArrayList<T> res = new ArrayList<>();
      for (String data : s.substring(1, s.length() - 1).split(", ")) {
        res.add(parse(data));
      }
      return res;
    } else {
      throw new ParseException(...);
    }

}

And got errors like

incompatible types:
   String cannot be converted to T
   LinkedHashMap<String,T> cannot be converted to T
   ArrayList<T> cannot be converted to T

How do I make it work?
Thanks for the help in advance!


问:
how to protect the NestJS service from the directory traversal attack
Scenario :
I have created a API service using NestJS and deployed it to azure app service using docker container image type.

Question:
Can we achieve directory traversal through the deployed API URL to access the deployed container
files

```<code>https://sample.azurewebsites.net/sampleEndpoint/../../etc/
</code>```

If possible how to protect the NestJS service from the directory traversal attack ?

Body:
Scenario :
I have created a API service using NestJS and deployed it to azure app service using docker container image type.

Question:
Can we achieve directory traversal through the deployed API URL to access the deployed container
files

https://sample.azurewebsites.net/sampleEndpoint/../../etc/

If possible how to protect the NestJS service from the directory traversal attack ?


问:
How to insert separator between items except when wrapped (in CSS)?
Okay, you’re got a box. You are rendering two (or more items) in the box. Let's assume they are inline (or inline-block) elements. When more than one item appears on the same line, we want to insert the string · between the items. However, when the second (or whatever) item begins a new line, we want to skip the separator.

Is there a reasonable CSS-only solution to this design requirement?

Here is an example JSFiddle.


问:
rust slog: set desired logging level via parameter
I wish to set slog-async logging level to a user-defined value upon execution of the application.
Is there a way to set slog-async to desired logging level at runtime?

today my slog-async setup looks like this:

```<code>extern crate slog;
extern crate slog_term;
extern crate slog_async;
use slog::{Drain};

/* Initiate slog the logger */
let decorator = slog_term::TermDecorator::new().build();
let drain = slog_term::FullFormat::new(decorator).build().fuse();
let drain = slog_async::Async::new(drain).build().fuse();
let logger = slog::Logger::root(drain, slog::o!());
</code>```

and logging is performed is through calling:

```<code>slog::debug!(logger, "SQLite database at {} already exists", &db_url);
</code>```

but have no idea on how to make logging level only warning and more severe.

Body:
I wish to set slog-async logging level to a user-defined value upon execution of the application.
Is there a way to set slog-async to desired logging level at runtime?

today my slog-async setup looks like this:

extern crate slog;
extern crate slog_term;
extern crate slog_async;
use slog::{Drain};

/* Initiate slog the logger */
let decorator = slog_term::TermDecorator::new().build();
let drain = slog_term::FullFormat::new(decorator).build().fuse();
let drain = slog_async::Async::new(drain).build().fuse();
let logger = slog::Logger::root(drain, slog::o!());

and logging is performed is through calling:

slog::debug!(logger, "SQLite database at {} already exists", &db_url);

but have no idea on how to make logging level only warning and more severe.


问:
When to use v-model in vue.js?
I'm using ci4 and vue.js to create a drop-down list. I'm confuse when to use a v-model and when not to use.
I try to view selected data in drop-down list. When I use a v-model, the selected  data doesn't view in my drop-down list.

`

  <select class="form-control" v-model="sel_kod_negara" :class="{'is-invalid': error.kod_negara}">
        <option value="">-Select Country-</option>
        <option :value="selected.di_kod_negara" selected>{{selected.keterangan}}</option>
        <option :value="r.kod" v-for="r in kod_negara">{{r.keterangan}}</option>
  </select>

```

`

the picture below show when i put the v-model

enter image description here

When I delete the v-model from my attributes drop-down list, the selected data will view. It's any problem if I'm not use a v-model in my drop-down list attributes?

the picture below show when i don't put the v-model

enter image description here

Any advise please? Thank you!

Title: When to use v-model in vue.js?

Body:
I'm using ci4 and vue.js to create a drop-down list. I'm confuse when to use a v-model and when not to use.
I try to view selected data in drop-down list. When I use a v-model, the selected  data doesn't view in my drop-down list.

`

  <select class="form-control" v-model="sel_kod_negara" :class="{'is-invalid': error.kod_negara}">
        <option value="">-Select Country-</option>
        <option :value="selected.di_kod_negara" selected>{{selected.keterangan}}</option>
        <option :value="r.kod" v-for="r in kod_negara">{{r.keterangan}}</option>
  </select>

`

the picture below show when i put the v-model

enter image description here

When I delete the v-model from my attributes drop-down list, the selected data will view. It's any problem if I'm not use a v-model in my drop-down list attributes?

the picture below show when i don't put the v-model

enter image description here

Any advise please? Thank you!


问:
React App slowly exhausts file descriptor limit on Ubuntu server and crashes in few days
I have a React App which I am running using serve command from Jenkins pipeline. One thing to note here is that I configured my Jenkins jobs to run indefinitely for logs. Below screenshot show how my app is running.

Aforesaid setup is running on Ubuntu server and my React App stops once the per-process file descriptor hard limit of 4096 is exhausted.

After a lot of investigation, I found that index.html file is getting opened periodically and is not getting closed so File Descriptor count keeps increasing over time. Also, while using app I have observed that there is no increase in count of index.html files i.e. I think its not tied to direct app usage.

Sever Side events is also already implemented for notifications, and I didn't have this issue so not sure if this issue is related to SSE.

Lastly, this started happening since recent release where multiple dependencies were updated and I changed package manager from npm to yarn.

Please note :

I am not looking for answers suggesting to increase file descriptor limit on Linux but figure out and resolve actual issue.

This project is built using create-react-app.

Node version is v14.21.1


问:
CORS Failed & NS_ERROR_DOM_BAD_URI
I have an angular application which I am trying to connect to springboot backend but I am getting CORS Failed.
Here's my angular-deployment.yml

```<code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: angular-deployment
spec:
  selector:
    matchLabels:
      app: angular
  replicas: 1
  template:
    metadata:
      labels:
        app: angular
    spec:
      containers:
        - name: angular
          image: dockerimage
          ports:
            - containerPort: 80
---
kind: Service
apiVersion: v1
metadata:
  name: angular-service
spec:
  selector:
    app: angular
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
      nodePort: 31000
  type: NodePort

</code>```

Here's my springboot-deployment.yml

```<code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: springboot-deployment
spec:
  selector:
    matchLabels:
      app: springboot-mysql
  replicas: 1
  template:
    metadata:
      labels:
        app: springboot-mysql
    spec:
      containers:
        - name: springboot-k8s
          image: spring-docker-image
          imagePullPolicy: Always
          ports:
            - containerPort: 8080
          env:
            - name: DB_HOST
              valueFrom :
                configMapKeyRef :
                  name : db-config
                  key :  host

            - name: DB_NAME
              valueFrom :
                configMapKeyRef :
                  name : db-config
                  key :  dbName

            - name: DB_USERNAME
              valueFrom :
                secretKeyRef :
                  name : mysql-secrets
                  key :  username

            - name: DB_PASSWORD
              valueFrom :
                secretKeyRef :
                  name : mysql-secrets
                  key :  password

---

apiVersion: v1
kind: Service
metadata:
  name: springboot-svc
spec:
  selector:
    app: springboot-mysql
  ports:
    - protocol: "TCP"
      port: 8080
      targetPort: 8080
  type: NodePort
</code>```

I am using Minikube and I have CORS enabled in kube-apiserver but I am not sure what else I am doing wrong. I would appreciate some help on how to get my angular app to connect to spring. I would also appreciate if someone could tell me if it's an issue from my side or from the angular side.

Title: CORS Failed & NS_ERROR_DOM_BAD_URI

Body:
I have an angular application which I am trying to connect to springboot backend but I am getting CORS Failed.
Here's my angular-deployment.yml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: angular-deployment
spec:
  selector:
    matchLabels:
      app: angular
  replicas: 1
  template:
    metadata:
      labels:
        app: angular
    spec:
      containers:
        - name: angular
          image: dockerimage
          ports:
            - containerPort: 80
---
kind: Service
apiVersion: v1
metadata:
  name: angular-service
spec:
  selector:
    app: angular
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
      nodePort: 31000
  type: NodePort

Here's my springboot-deployment.yml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: springboot-deployment
spec:
  selector:
    matchLabels:
      app: springboot-mysql
  replicas: 1
  template:
    metadata:
      labels:
        app: springboot-mysql
    spec:
      containers:
        - name: springboot-k8s
          image: spring-docker-image
          imagePullPolicy: Always
          ports:
            - containerPort: 8080
          env:
            - name: DB_HOST
              valueFrom :
                configMapKeyRef :
                  name : db-config
                  key :  host

            - name: DB_NAME
              valueFrom :
                configMapKeyRef :
                  name : db-config
                  key :  dbName

            - name: DB_USERNAME
              valueFrom :
                secretKeyRef :
                  name : mysql-secrets
                  key :  username

            - name: DB_PASSWORD
              valueFrom :
                secretKeyRef :
                  name : mysql-secrets
                  key :  password

---

apiVersion: v1
kind: Service
metadata:
  name: springboot-svc
spec:
  selector:
    app: springboot-mysql
  ports:
    - protocol: "TCP"
      port: 8080
      targetPort: 8080
  type: NodePort

I am using Minikube and I have CORS enabled in kube-apiserver but I am not sure what else I am doing wrong. I would appreciate some help on how to get my angular app to connect to spring. I would also appreciate if someone could tell me if it's an issue from my side or from the angular side.


问:
Trying to use custom shader code in a class inheriting from QMaterial for Android
I'm trying to work around a bug inside a material class in the Extras for the Qt3D module:
https://bugreports.qt.io/browse/QTBUG-109574. I've trying to accomplish this, running on my Nokia G20 smartphone. I'm using Qt 6.2.4.

I believe the problem is that the wrong QTechnique is being used at runtime. Within the implementation for QPhongMaterial, there contains a few different techniques with graphics API filters for OpenGL and OpenGL/ES, versions 2 and 3, as seen here: https://github.com/qt/qt3d/blob/6.2.4/src/extras/defaults/qdiffusespecularmaterial.cpp.

To try and influence the QTechnique choice, I've tried to override the rendering API, and the surface format to be compatible with my smartphone:

```<code>QSurfaceFormat surfaceFormat;
surfaceFormat.setMajorVersion(2);
surfaceFormat.setMinorVersion(0);
surfaceFormat.setProfile(QSurfaceFormat::OpenGLContextProfile::NoProfile);
qputenv("QSG_RHI_BACKEND", "gles2");
</code>```

I've also tried to make my own class derived from QMaterial, but that's another issue, as I'm getting a black screen in my viewport with that, which I can't fix, because the Android GPU Inspector doesn't support my device.

Body:
I'm trying to work around a bug inside a material class in the Extras for the Qt3D module:
https://bugreports.qt.io/browse/QTBUG-109574. I've trying to accomplish this, running on my Nokia G20 smartphone. I'm using Qt 6.2.4.

I believe the problem is that the wrong QTechnique is being used at runtime. Within the implementation for QPhongMaterial, there contains a few different techniques with graphics API filters for OpenGL and OpenGL/ES, versions 2 and 3, as seen here: https://github.com/qt/qt3d/blob/6.2.4/src/extras/defaults/qdiffusespecularmaterial.cpp.

To try and influence the QTechnique choice, I've tried to override the rendering API, and the surface format to be compatible with my smartphone:

QSurfaceFormat surfaceFormat;
surfaceFormat.setMajorVersion(2);
surfaceFormat.setMinorVersion(0);
surfaceFormat.setProfile(QSurfaceFormat::OpenGLContextProfile::NoProfile);
qputenv("QSG_RHI_BACKEND", "gles2");

I've also tried to make my own class derived from QMaterial, but that's another issue, as I'm getting a black screen in my viewport with that, which I can't fix, because the Android GPU Inspector doesn't support my device.


问:
Android ListView on click listener not working
I have implemented a search bar which fills a list of search results every time a search token is inserted. My XML goes like this:

```<code><android.widget.SearchView
        android:id="@+id/my_searchView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:queryHint="Search Here" />

    <ListView
        android:id="@+id/my_listView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
</code>```

Once the token is inserted, an api is invoked and the results are stored in a list called resultUsers. I am populating the ListView like this:

```<code>runOnUiThread(new Runnable() {
    @Override
    public void run() {
        ListView list = findViewById(R.id.my_listView);
        adapter = new ArrayAdapter<>(MyActivity.this, android.R.layout.simple_list_item_1, userNames);
        list.setAdapter(adapter);
        getSelectedUserDetails(list);
    }
});
</code>```

getSelectedUserDetails() function is called to prepare the listener for the item click:

```<code>public void getSelectedUserDetails(ListView list){
    list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
            String selection = (String) list.getItemAtPosition(i);
            User selectedUser = new User();
            for(int j = 0; j < resultUsers.size(); j++) {
                if(selection.equals(resultUsers.get(j).getName())){
                    selectedUser = resultUsers.get(j);
                    System.out.print(selectedUser.getId());
                    Toast.makeText(getBaseContext(), selectedUser.getId().toString(), Toast.LENGTH_SHORT).show();
                }
            }
        }
    });
}
</code>```

2 unexpected results occur:

The system output appears not when i click the item on the list but after clicking the item and reinserting a search token

The Toast does not appear at all

Is this a bug or have i got it wrong all together and there's a different approach for search results lists?

Body:
I have implemented a search bar which fills a list of search results every time a search token is inserted. My XML goes like this:

<android.widget.SearchView
        android:id="@+id/my_searchView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:queryHint="Search Here" />

    <ListView
        android:id="@+id/my_listView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

Once the token is inserted, an api is invoked and the results are stored in a list called resultUsers. I am populating the ListView like this:

runOnUiThread(new Runnable() {
    @Override
    public void run() {
        ListView list = findViewById(R.id.my_listView);
        adapter = new ArrayAdapter<>(MyActivity.this, android.R.layout.simple_list_item_1, userNames);
        list.setAdapter(adapter);
        getSelectedUserDetails(list);
    }
});

getSelectedUserDetails() function is called to prepare the listener for the item click:

public void getSelectedUserDetails(ListView list){
    list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
            String selection = (String) list.getItemAtPosition(i);
            User selectedUser = new User();
            for(int j = 0; j < resultUsers.size(); j++) {
                if(selection.equals(resultUsers.get(j).getName())){
                    selectedUser = resultUsers.get(j);
                    System.out.print(selectedUser.getId());
                    Toast.makeText(getBaseContext(), selectedUser.getId().toString(), Toast.LENGTH_SHORT).show();
                }
            }
        }
    });
}

2 unexpected results occur:

The system output appears not when i click the item on the list but after clicking the item and reinserting a search token

The Toast does not appear at all

Is this a bug or have i got it wrong all together and there's a different approach for search results lists?


问:
How can I set absolute path in logging.ini Python
My project file structure looks like:

```<code>project
│   README.md
│   requirements.txt
│   main.py
|
└───log
│   │   clear_log.py
│   │   file.log
</code>```

I wrote the fileHandler inside logging.ini

```<code>[handler_fileHandler\]
class=FileHandler
level=INFO
formatter=simpleFormatter
args=("log/file.log",)
</code>```

I call

import logging.config

logging.config.fileConfig("logging.ini", disable_existing_loggers=False)
logger = logging.getLogger(__name__)
logger.info("log something.")
```
<p>in both <code>main.py</code> and <code>clear_log.py</code>, however, the <code>args</code> inside <code>handler_fileHandler</code> is set to be "log/file.log", the function above work inside <code>main.py</code>, didn't work inside <code>clear_log.py</code>, error:</p>
```FileNotFoundError: [Errno 2] No such file or directory:
```

How can I solve it? Can I set an absolute path inside logging.ini args, or any other better solution for it?

Body:
My project file structure looks like:

project
│   README.md
│   requirements.txt
│   main.py
|
└───log
│   │   clear_log.py
│   │   file.log

I wrote the fileHandler inside logging.ini

[handler_fileHandler\]
class=FileHandler
level=INFO
formatter=simpleFormatter
args=("log/file.log",)

I call

import logging.config

logging.config.fileConfig("logging.ini", disable_existing_loggers=False)
logger = logging.getLogger(__name__)
logger.info("log something.")

in both main.py and clear_log.py, however, the args inside handler_fileHandler is set to be "log/file.log", the function above work inside main.py, didn't work inside clear_log.py, error:

FileNotFoundError: [Errno 2] No such file or directory:

How can I solve it? Can I set an absolute path inside logging.ini args, or any other better solution for it?