问:
PhpDoc show indirect extended method
We have some magic behaviour that adds additional features to class.

Right now we have lots of similar code:

/**
 * @see \App\Behaviour::someMethod
 * @method mixed someMethod(string ...$params)
 *
 * @see \App\Behaviour::anotherMethod
 * @method void anotherMethod()
 */
class Foo {
    public function __call(string $method, array $params) {
        $this->behaviour->{$method}(...$params);
    }
}
```
<hr />
<p>Is there a way to automatically indicate this magic behaviour instead of re-writing all public methods for each class that has this feature?</p>
<p>E.g. (non-existing code)</p>
<pre class="lang-php prettyprint-override"><code>/**
 * @magic-call \App\Behaviour
 */
class Foo {

}
</code>```

Title: PhpDoc show indirect extended method

Body:
We have some magic behaviour that adds additional features to class.

Right now we have lots of similar code:

/**
 * @see \App\Behaviour::someMethod
 * @method mixed someMethod(string ...$params)
 *
 * @see \App\Behaviour::anotherMethod
 * @method void anotherMethod()
 */
class Foo {
    public function __call(string $method, array $params) {
        $this->behaviour->{$method}(...$params);
    }
}

Is there a way to automatically indicate this magic behaviour instead of re-writing all public methods for each class that has this feature?

E.g. (non-existing code)

/**
 * @magic-call \App\Behaviour
 */
class Foo {

}


来源: stackexchange

问:
Browser's Debugger Showing Old Code for Vue
Sometimes I add a new variable to the Vue data() and get a ReferenceError (like "ReferenceError: windowHeight is not defined"), then when I check the error in the Firefox's debugger, I see that Vue in debugger is the old code not the one I have in my IDE. But when I try the exact same thing in Private Browsing I can see the code being exactly the same as my IDE.

Is this some kind of caching problem? Or is it related to my IDE which is VSCode. And how can I solve it?

I was expecting to see the same code as in my IDE, but during debug I see the old one.

ContentLicense: CC BY-SA 4.0


问:
Cookie with attribute SameSite Lax is included in the headers of a cross origin post request
As i've understood if I set the attribute sameSite of a cookie to Lax it won't be included in the headers of a post request when it is being sent from a different origin.

So I have a next app running in http://localhost:4000
and another malicious app running in http://localhost:8080.

I open both in the same browser (chrome) and I log in in http://localhost:4000. After i do so a sess cookie is being created which has SameSite Lax as checked in chrome dev tools application tab.

Now the endpoint http://localhost:4000/createFood accepts post requests and creates a new food if sess cookie is present(and matches a session).

So to simulate a CSRF attack I go to the malicious http://localhost:8080 where I have put the following request

```<code>fetch("http://localhost:4000/createFood ", {
      credentials: "include",
      method: "POST",
      mode: "no-cors",
      headers: {
        Accept: "application/json",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({name: "Banana", taste: "very good"}),
    });
</code>```

I would expect when i check the req.headers.cookies in my api that the sess cookie won't be present because it has sameSite = Lax but it is there although the post request is being sent from a different origin (from http://localhost:8080 to http://localhost:4000)!

Why is the sess cookie there?

Body:
As i've understood if I set the attribute sameSite of a cookie to Lax it won't be included in the headers of a post request when it is being sent from a different origin.

So I have a next app running in http://localhost:4000
and another malicious app running in http://localhost:8080.

I open both in the same browser (chrome) and I log in in http://localhost:4000. After i do so a sess cookie is being created which has SameSite Lax as checked in chrome dev tools application tab.

Now the endpoint http://localhost:4000/createFood accepts post requests and creates a new food if sess cookie is present(and matches a session).

So to simulate a CSRF attack I go to the malicious http://localhost:8080 where I have put the following request

fetch("http://localhost:4000/createFood ", {
      credentials: "include",
      method: "POST",
      mode: "no-cors",
      headers: {
        Accept: "application/json",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({name: "Banana", taste: "very good"}),
    });

I would expect when i check the req.headers.cookies in my api that the sess cookie won't be present because it has sameSite = Lax but it is there although the post request is being sent from a different origin (from http://localhost:8080 to http://localhost:4000)!

Why is the sess cookie there?


问:
react-router-dom switching between 5000 routes
I have a reactJS application where I have about 5000 routes and every load of a link in the browser lasts about 6 seconds. If I reduce the number of routes the time needed to load the page decreases.

Routes are declared in App.js like this:

```<code>class App extends Component {
  render() {
    return (
          <Switch>
              <Route path='/' exact={true} component={Home}/>
              <Route path='/Department47352List' exact={true} component={Department47352List}/>
              <Route path='/Department47352Edit/:id' exact={true} component={Department47352Edit}/>
              <Route path='/DepartmentType47353List' exact={true} component={DepartmentType47353List}/>
              <Route path='/DepartmentType47353Edit/:id' exact={true} component={DepartmentType47353Edit}/>
              ........
</code>```

Is there something I can do to optimize the speed without decreasing the number of routes?

I read on the official react-router-dom page that "You probably never need to render a  manually."
Is it wrong to do so or is it just a recommendation?

I can definitely reduce the number of routes to 1-2 thousand but still, I think the loading time is too high for 5000 routes, I can run a DB query on a table with over 10 thousand records much faster, in my mind the routes should work faster that any DB... so maybe there is something wrong in my approach?

Body:
I have a reactJS application where I have about 5000 routes and every load of a link in the browser lasts about 6 seconds. If I reduce the number of routes the time needed to load the page decreases.

Routes are declared in App.js like this:

class App extends Component {
  render() {
    return (
          <Switch>
              <Route path='/' exact={true} component={Home}/>
              <Route path='/Department47352List' exact={true} component={Department47352List}/>
              <Route path='/Department47352Edit/:id' exact={true} component={Department47352Edit}/>
              <Route path='/DepartmentType47353List' exact={true} component={DepartmentType47353List}/>
              <Route path='/DepartmentType47353Edit/:id' exact={true} component={DepartmentType47353Edit}/>
              ........

Is there something I can do to optimize the speed without decreasing the number of routes?

I read on the official react-router-dom page that "You probably never need to render a  manually."
Is it wrong to do so or is it just a recommendation?

I can definitely reduce the number of routes to 1-2 thousand but still, I think the loading time is too high for 5000 routes, I can run a DB query on a table with over 10 thousand records much faster, in my mind the routes should work faster that any DB... so maybe there is something wrong in my approach?


问:
How to avoid System Properties getting loaded in Typesafe config
We are using Typesafe config in our application.
Any way to ignore loading system properties into config object ?</p>


问:
Positional parameter not supported in GitHub Actions
I am starting to get along with GitHub actions, but cannot figure out a Problem here:

this is my GitHub Action yml:

```<code>name: Redwood CD for database deployment

on:
  push:
    branches: ['main']

env:
  DATABASE_URL: ${{ secrets.DATABASE_URL }}
  TEST_DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [16.x]
        # See supported Node.js release schedule at https://nodejs.org/en/about/releases/

    services:
      # Label used to access the service container
      postgres:
        # Docker Hub image
        image: postgres
        # Provide the password for postgres
        env:
          POSTGRES_PASSWORD: postgres
        # Set health checks to wait until postgres has started
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
        ports:
          # Maps tcp port 5432 on service container to the host
          - 5432:5432

    steps:

      # .... here I fetch and build my code which works...
      # then I want to tar it and deploy it to caprover --> which does not work:
      - name: Compress action step
        uses: a7ul/tar-action@v1.1.0
        id: compress
        with:
          command: c
          cwd: ./
          files: |
            /home/runner/work/redwood-tutorial/redwood-tutorial/api/dist/
            /home/runner/work/redwood-tutorial/redwood-tutorial/web/dist/
            captain-definition
          outPath: deploy.tar

      - uses: caprover/deploy-from-github@main
        with:
          server: '${{ secrets.CAPROVER_SERVER }}'
          app: '${{ secrets.APP_NAME }}'
          token: '${{ secrets.APP_TOKEN }}'
          branch: '${{ secrets.DEPLOY_BRANCH }}' # optional
          image: '${{ secrets.DEPLOY_IMAGE }}' # optional
</code>```

and this line:
outPath: deploy.tar seems to give me the following error:

```<code>Positional parameter not supported: ./deploy.tar
</code>```

does anyone know what the problem could be here? Google does not really help me here

Cheers and thanks!

Body:
I am starting to get along with GitHub actions, but cannot figure out a Problem here:

this is my GitHub Action yml:

name: Redwood CD for database deployment

on:
  push:
    branches: ['main']

env:
  DATABASE_URL: ${{ secrets.DATABASE_URL }}
  TEST_DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [16.x]
        # See supported Node.js release schedule at https://nodejs.org/en/about/releases/

    services:
      # Label used to access the service container
      postgres:
        # Docker Hub image
        image: postgres
        # Provide the password for postgres
        env:
          POSTGRES_PASSWORD: postgres
        # Set health checks to wait until postgres has started
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
        ports:
          # Maps tcp port 5432 on service container to the host
          - 5432:5432

    steps:

      # .... here I fetch and build my code which works...
      # then I want to tar it and deploy it to caprover --> which does not work:
      - name: Compress action step
        uses: a7ul/tar-action@v1.1.0
        id: compress
        with:
          command: c
          cwd: ./
          files: |
            /home/runner/work/redwood-tutorial/redwood-tutorial/api/dist/
            /home/runner/work/redwood-tutorial/redwood-tutorial/web/dist/
            captain-definition
          outPath: deploy.tar

      - uses: caprover/deploy-from-github@main
        with:
          server: '${{ secrets.CAPROVER_SERVER }}'
          app: '${{ secrets.APP_NAME }}'
          token: '${{ secrets.APP_TOKEN }}'
          branch: '${{ secrets.DEPLOY_BRANCH }}' # optional
          image: '${{ secrets.DEPLOY_IMAGE }}' # optional

and this line:
outPath: deploy.tar seems to give me the following error:

Positional parameter not supported: ./deploy.tar

does anyone know what the problem could be here? Google does not really help me here

Cheers and thanks!


问:
jspdf multiple page cut the pdf bottom line text in half
hello i am trying to generate multiple page dynamic pdf using html in my react js app. i got all the things right in pdf but the last line text of pages cuts if we set the dynamic pixels for html element it also cut table inside the html sometimes. here is my code

```<code>  var pdf  = new jsPDF({
                        orientation: "portrait", // landscape or portrait
                        unit: "mm",
                        format: "a4"//[250,250],

                        }
                        )

                        let pageHeight=pdf.internal.pageSize.height

                          pdf.html(html_element, {
                          callback: function (doc) {
                            doc.save();
                          },
                          x: 15,
                          autoPaging: "slice",
                          y: 15,
                          width: 170, //target width in the PDF document
                          windowWidth: 650 ,
                          margin:[10,7,10,7],

                       });
</code>```

please help me with this

i have also tried jsdpf html2 convas examples but it did not give bottom margin in pages

Body:
hello i am trying to generate multiple page dynamic pdf using html in my react js app. i got all the things right in pdf but the last line text of pages cuts if we set the dynamic pixels for html element it also cut table inside the html sometimes. here is my code

  var pdf  = new jsPDF({
                        orientation: "portrait", // landscape or portrait
                        unit: "mm",
                        format: "a4"//[250,250],

                        }
                        )

                        let pageHeight=pdf.internal.pageSize.height

                          pdf.html(html_element, {
                          callback: function (doc) {
                            doc.save();
                          },
                          x: 15,
                          autoPaging: "slice",
                          y: 15,
                          width: 170, //target width in the PDF document
                          windowWidth: 650 ,
                          margin:[10,7,10,7],

                       });

please help me with this

i have also tried jsdpf html2 convas examples but it did not give bottom margin in pages


问:
Flutter iOS App crashing on receiving VoIP notification
I am sending a VoIP notification to my app to show the call screen. I am using flutter_callkit_incoming  to handle these pushes.
However, recently I have been getting crashes with the following text from Xcode, saying this is the line causing the crash

```<code>PushKit 0x229d90744 -[PKPushRegistry _terminateAppIfThereAreUnhandledVoIPPushes] + 168 (PKPushRegistry.m:349)
</code>```

My AppDelegate.swift

```<code>    // Handle updated push credentials
func pushRegistry(_ registry: PKPushRegistry, didUpdate credentials: PKPushCredentials, for type: PKPushType) {
    print(credentials.token)
    let deviceToken = credentials.token.map { String(format: "%02x", $0) }.joined()
    print(deviceToken)
    //Save deviceToken to your server
    SwiftFlutterCallkitIncomingPlugin.sharedInstance?.setDevicePushTokenVoIP(deviceToken)
}

func pushRegistry(_ registry: PKPushRegistry, didInvalidatePushTokenFor type: PKPushType) {
    print("didInvalidatePushTokenFor")
    SwiftFlutterCallkitIncomingPlugin.sharedInstance?.setDevicePushTokenVoIP("")
}

    // Handle incoming pushes
func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) {
    print("didReceiveIncomingPushWith")
    guard type == .voIP else { return }

    let id = payload.dictionaryPayload["id"] as? String ?? ""
    let nameCaller = payload.dictionaryPayload["nameCaller"] as? String ?? ""
    let handle = payload.dictionaryPayload["handle"] as? String ?? ""
    let isVideo = payload.dictionaryPayload["isVideo"] as? Bool ?? false
    let notType = payload.dictionaryPayload["notType"] as? String ?? ""

    let data = flutter_callkit_incoming.Data(id: id, nameCaller: nameCaller, handle: handle, type: isVideo ? 1 : 0)
    //set more data
    data.extra = ["user": "abc@123", "platform": "ios"]
    //data.iconName = ...
    //data.....
    if (notType == "cancel") {
        print("didReceiveIncomingPushWith - Ending call")
        SwiftFlutterCallkitIncomingPlugin.sharedInstance?.endAllCalls();
    } else {
        SwiftFlutterCallkitIncomingPlugin.sharedInstance?.showCallkitIncoming(data, fromPushKit: true)
    }
}
</code>```

How I am sending the VoIP notificaiton

```<code>var note = new apn.Notification();

        note.expiry = Math.floor(Date.now() / 1000) + 3600; // Expires 1 hour from now.
        note.alert = `\uD83D\uDCE7 \u2709 ${userTitle} call`;
        note.payload = { 'nameCaller': userTitle, 'isVideo': isVideo, 'id': uuid ?? uuidv4(), 'notType': notType };
        note.pushType = "voip"
        const bundleId = isProd ? process.env.BUNDLE_ID_PROD : process.env.BUNDLE_ID_DEV
        note.topic = `${bundleId}.voip`;
        console.log('APN: 5')

        apnProvider.send(note, deviceToken).then((result) => {
            // see documentation for an explanation of result
            if (result.failed.length > 0) {
                console.log('APN Failed: ' + result.failed[0].response.reason || "Unknown")
            } else {
                console.log('APN Succeeded.')
            }
        });
</code>```

Body:
I am sending a VoIP notification to my app to show the call screen. I am using flutter_callkit_incoming  to handle these pushes.
However, recently I have been getting crashes with the following text from Xcode, saying this is the line causing the crash

PushKit 0x229d90744 -[PKPushRegistry _terminateAppIfThereAreUnhandledVoIPPushes] + 168 (PKPushRegistry.m:349)

My AppDelegate.swift

    // Handle updated push credentials
func pushRegistry(_ registry: PKPushRegistry, didUpdate credentials: PKPushCredentials, for type: PKPushType) {
    print(credentials.token)
    let deviceToken = credentials.token.map { String(format: "%02x", $0) }.joined()
    print(deviceToken)
    //Save deviceToken to your server
    SwiftFlutterCallkitIncomingPlugin.sharedInstance?.setDevicePushTokenVoIP(deviceToken)
}

func pushRegistry(_ registry: PKPushRegistry, didInvalidatePushTokenFor type: PKPushType) {
    print("didInvalidatePushTokenFor")
    SwiftFlutterCallkitIncomingPlugin.sharedInstance?.setDevicePushTokenVoIP("")
}

    // Handle incoming pushes
func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) {
    print("didReceiveIncomingPushWith")
    guard type == .voIP else { return }

    let id = payload.dictionaryPayload["id"] as? String ?? ""
    let nameCaller = payload.dictionaryPayload["nameCaller"] as? String ?? ""
    let handle = payload.dictionaryPayload["handle"] as? String ?? ""
    let isVideo = payload.dictionaryPayload["isVideo"] as? Bool ?? false
    let notType = payload.dictionaryPayload["notType"] as? String ?? ""

    let data = flutter_callkit_incoming.Data(id: id, nameCaller: nameCaller, handle: handle, type: isVideo ? 1 : 0)
    //set more data
    data.extra = ["user": "abc@123", "platform": "ios"]
    //data.iconName = ...
    //data.....
    if (notType == "cancel") {
        print("didReceiveIncomingPushWith - Ending call")
        SwiftFlutterCallkitIncomingPlugin.sharedInstance?.endAllCalls();
    } else {
        SwiftFlutterCallkitIncomingPlugin.sharedInstance?.showCallkitIncoming(data, fromPushKit: true)
    }
}

How I am sending the VoIP notificaiton

var note = new apn.Notification();

        note.expiry = Math.floor(Date.now() / 1000) + 3600; // Expires 1 hour from now.
        note.alert = `\uD83D\uDCE7 \u2709 ${userTitle} call`;
        note.payload = { 'nameCaller': userTitle, 'isVideo': isVideo, 'id': uuid ?? uuidv4(), 'notType': notType };
        note.pushType = "voip"
        const bundleId = isProd ? process.env.BUNDLE_ID_PROD : process.env.BUNDLE_ID_DEV
        note.topic = `${bundleId}.voip`;
        console.log('APN: 5')

        apnProvider.send(note, deviceToken).then((result) => {
            // see documentation for an explanation of result
            if (result.failed.length > 0) {
                console.log('APN Failed: ' + result.failed[0].response.reason || "Unknown")
            } else {
                console.log('APN Succeeded.')
            }
        });


问:
Unable to verify the request using self signed certificate
I am trying to send a request to a REST API using an SSL certificate.
Following is the code snippet I have written:

```<code>import requests
import os

url = "https://ip_address/api"

headers = {
    'Authorization': 'Bearer bearer_token'
}
path = os.path.join("/","tmp")
response = requests.request("GET", url, headers=headers, verify=os.path.join(path, "certfile.pem"))

print(response.status_code)
print(response.content)
</code>```

I tried to run this on my local machine in a virtual environment and in the docker container as well. It worked fine.

Following are the configurations on my local machine:

Virtual Environment:

OS: Ubuntu 22.04.1 LTS

Python version: 3.10.6

Docker container:

Python version: 3.10.4

This same script I tried to run on one of the servers and my first colleague's Windows 11 within windows as well as in WSL. It worked fine there too.

Server 1 configurations:

OS: Ubuntu 20.04

Python version: 3.10

Following are the configurations on his machine:

Windows 11:

Python version: 3.9.6

WSL:

OS: Ubuntu 22.04.1 LTS

Python version: 3.10.6

But this same script does not work on the other colleague's machine as well as on the servers.

The following are the configurations on These machines:

Second colleague:

OS: Ubuntu 22.04

Python version: 3.8 and 3.9

Third colleague:

OS: Ubuntu 22.04

Python version: 3.9 and 3.6

Server 2 (QRadar):

OS: RHEL

python version: 3.6

Server 3:

OS: Ubuntu 22.04

Python version: 3.8

In all the above machines we are getting the following error:

```<code>requests.exceptions.SSLError: HTTPSConnectionPool(host='xx.xx.xx.xxx', port=443): Max retries exceeded with url: /api/users/self (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:877)'),))
</code>```

We have tried to run the script using requests, urllib3, and httpx to figure out why.

Every time the result is the same.

It works with any of these libraries on the machine where it worked the first time.
On the machine where it gave an error, it gives an error with all of these.

What could be the issue here?

Body:
I am trying to send a request to a REST API using an SSL certificate.
Following is the code snippet I have written:

import requests
import os

url = "https://ip_address/api"

headers = {
    'Authorization': 'Bearer bearer_token'
}
path = os.path.join("/","tmp")
response = requests.request("GET", url, headers=headers, verify=os.path.join(path, "certfile.pem"))

print(response.status_code)
print(response.content)

I tried to run this on my local machine in a virtual environment and in the docker container as well. It worked fine.

Following are the configurations on my local machine:

Virtual Environment:

OS: Ubuntu 22.04.1 LTS

Python version: 3.10.6

Docker container:

Python version: 3.10.4

This same script I tried to run on one of the servers and my first colleague's Windows 11 within windows as well as in WSL. It worked fine there too.

Server 1 configurations:

OS: Ubuntu 20.04

Python version: 3.10

Following are the configurations on his machine:

Windows 11:

Python version: 3.9.6

WSL:

OS: Ubuntu 22.04.1 LTS

Python version: 3.10.6

But this same script does not work on the other colleague's machine as well as on the servers.

The following are the configurations on These machines:

Second colleague:

OS: Ubuntu 22.04

Python version: 3.8 and 3.9

Third colleague:

OS: Ubuntu 22.04

Python version: 3.9 and 3.6

Server 2 (QRadar):

OS: RHEL

python version: 3.6

Server 3:

OS: Ubuntu 22.04

Python version: 3.8

In all the above machines we are getting the following error:

requests.exceptions.SSLError: HTTPSConnectionPool(host='xx.xx.xx.xxx', port=443): Max retries exceeded with url: /api/users/self (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:877)'),))

We have tried to run the script using requests, urllib3, and httpx to figure out why.

Every time the result is the same.

It works with any of these libraries on the machine where it worked the first time.
On the machine where it gave an error, it gives an error with all of these.

What could be the issue here?


问:
Plotly express animations: Plotting multiple changing traces and background image for each frame
I am currently trying to create a debugging tool for a simulation. For this is am working with the animations of plotly express. What I want to achieve:
An animation with a different background image with different traces (also differing in number) for each frame. Any help would be very much appreciated! (Also if someone knows how to do this using any other library it'd be very much appreciated!)

Thanks!

Adding the background images work perfectly well like this:

```<code>fig = px.imshow(img,origin="upper", animation_frame=0, binary_string=True, labels=dict(animation_frame="slice"))
</code>```

So I only need to figure out how to display the traces.
I tried the following first:

```<code>fig = px.imshow(img,origin="upper", animation_frame=0, binary_string=True, labels=dict(animation_frame="slice")) # img consists of |time_step| images (np.array)

## now I'm trying to add the traces

for i in range(len(img)):
    time_step = df.iloc[i]
    for j in range(len(time_step)):
        current = time_step.iloc[j]
        x, y = current["x"], current["y"]

        if (not current["valid"]):
            fig.add_trace(go.Scatter(x=x, y=y, name="{}".format(current["unique_id"]),                         text="{}".format(current["costs"]), hoverinfo='text+name', line=dict(color="black", dash="dot"), line_shape="spline"))
        else:
            fig.add_traces(go.Scatter(x=x_list, y=y_list, line=dict(color="black"), line_shape="spline"))
fig.show()

</code>```

However, I realized that fig.add_trace always adds the trace to all frames of the animation. (When only displaying the first time step it worked though :) )
However, I'd like to add the traces for one time_step only and then the ones for the next time_step.
So I started looking into this approach:

```<code># saving in a list instead of printing immediately
        if (not current["feasible"]):
            info.append([x_list, y_list, "{}".format(current["unique_id"]),
                        "{}".format(current["costs"]), dict(color=color, dash="dot")])

        else:
            info.append([x_list, y_list, "{}".format(current["unique_id"]),
                        "{}".format(current["costs"]),dict(color=color)])

</code>```

and added the information to the single frames:

```<code>    frames.append(
        go.Frame(
                data=[go.Scatter(
                        x=information[0],
                        y=information[1],
                        name=information[2],
                        text=information[3],
                        hoverinfo='text+name',
                        line=information[4],
                        line_shape="spline"
                    )
                for information in info],
            )

        )

figa = go.Figure(data=fig.data, frames=frames, layout=fig.layout)
figa.show()
</code>```

But it only displays the first background image and once I start the animation it disappears and only shows the first saved Scatter for each time_step.

I'm a little lost as I don't have a set number of traces I can't "hardcode" the Scatters.

Body:
I am currently trying to create a debugging tool for a simulation. For this is am working with the animations of plotly express. What I want to achieve:
An animation with a different background image with different traces (also differing in number) for each frame. Any help would be very much appreciated! (Also if someone knows how to do this using any other library it'd be very much appreciated!)

Thanks!

Adding the background images work perfectly well like this:

fig = px.imshow(img,origin="upper", animation_frame=0, binary_string=True, labels=dict(animation_frame="slice"))

So I only need to figure out how to display the traces.
I tried the following first:

fig = px.imshow(img,origin="upper", animation_frame=0, binary_string=True, labels=dict(animation_frame="slice")) # img consists of |time_step| images (np.array)

## now I'm trying to add the traces

for i in range(len(img)):
    time_step = df.iloc[i]
    for j in range(len(time_step)):
        current = time_step.iloc[j]
        x, y = current["x"], current["y"]

        if (not current["valid"]):
            fig.add_trace(go.Scatter(x=x, y=y, name="{}".format(current["unique_id"]),                         text="{}".format(current["costs"]), hoverinfo='text+name', line=dict(color="black", dash="dot"), line_shape="spline"))
        else:
            fig.add_traces(go.Scatter(x=x_list, y=y_list, line=dict(color="black"), line_shape="spline"))
fig.show()

However, I realized that fig.add_trace always adds the trace to all frames of the animation. (When only displaying the first time step it worked though :) )
However, I'd like to add the traces for one time_step only and then the ones for the next time_step.
So I started looking into this approach:

# saving in a list instead of printing immediately
        if (not current["feasible"]):
            info.append([x_list, y_list, "{}".format(current["unique_id"]),
                        "{}".format(current["costs"]), dict(color=color, dash="dot")])

        else:
            info.append([x_list, y_list, "{}".format(current["unique_id"]),
                        "{}".format(current["costs"]),dict(color=color)])

and added the information to the single frames:

    frames.append(
        go.Frame(
                data=[go.Scatter(
                        x=information[0],
                        y=information[1],
                        name=information[2],
                        text=information[3],
                        hoverinfo='text+name',
                        line=information[4],
                        line_shape="spline"
                    )
                for information in info],
            )

        )

figa = go.Figure(data=fig.data, frames=frames, layout=fig.layout)
figa.show()

But it only displays the first background image and once I start the animation it disappears and only shows the first saved Scatter for each time_step.

I'm a little lost as I don't have a set number of traces I can't "hardcode" the Scatters.


问:
End method with indirect throw
recently I was running about a problem where I did throw an Exception, but it was not consumed by the GUI-Thread. I found a solution for this topic here.

As there are several places where I would need it, I want to place it in a method.
Now I am struggling in Methods which except to have a return value which cannot be null.

```<code>enum SomeEnum
{
    ONE,
    TWO

}

private SomeEnum DoSomeExecption()
{
    var e = new NotImplementedException();
    ThrowException(e);
    //return null;

}

internal static void ThrowException(Exception e)
{
    var dispatcher = App.Current.Dispatcher;

    if (dispatcher != null)
    {
        if (!dispatcher.CheckAccess())
        {
            dispatcher.BeginInvoke((ThreadStart)delegate
            {
                throw e;
            }, DispatcherPriority.Normal);
        }
        else
        {
            throw e;
        }
    }
}
</code>```

Does anyone know a way to tell the calling method that execution will stop with the method call?

Title: End method with indirect throw

Body:
recently I was running about a problem where I did throw an Exception, but it was not consumed by the GUI-Thread. I found a solution for this topic here.

As there are several places where I would need it, I want to place it in a method.
Now I am struggling in Methods which except to have a return value which cannot be null.

enum SomeEnum
{
    ONE,
    TWO

}

private SomeEnum DoSomeExecption()
{
    var e = new NotImplementedException();
    ThrowException(e);
    //return null;

}

internal static void ThrowException(Exception e)
{
    var dispatcher = App.Current.Dispatcher;

    if (dispatcher != null)
    {
        if (!dispatcher.CheckAccess())
        {
            dispatcher.BeginInvoke((ThreadStart)delegate
            {
                throw e;
            }, DispatcherPriority.Normal);
        }
        else
        {
            throw e;
        }
    }
}

Does anyone know a way to tell the calling method that execution will stop with the method call?


问:
Where can I see why a MySql query stays in loop
I have a problem and is that I have 8 cores and after a day of doing the same querys, 5 of them stay in 100% and don't decrease.

I changed some part of the code, for example instead of doing conection.open(), I use using(MySqlConnection con = new MySqlConnection()){ ... }, but that doesn't changed something significant.

Reading some blogs and documentation, I think that the problem could be the querys I'm doing, that stay in loop somewhere and that causes the 5 cores in 100%. I have to restart them to have again 0%.

So, my question is, where or how can I see the querys that causes my problem? Do you need to see some querys I use for my application? I'm using Visual Studio 2022 for code, phpMyAdmin as database

Please let me know.

Thanks.

Querys example:

Query 1: Select some records of One Orden

```<code>SELECT DISTINCT
    p.Order , p.Delivery, p.Rowing, e.Path, e.Fecha, t.numTram_tr, t.name_tr,
    t.lastname_tr, t.sex_tr, t.document_tr, t.ejem_tr, t.Delivery_tr,
    t.Birthday_tr, t.fechaEmision_tr, t.cod_tr, t.ImgFrenteDni_tr, t.ImgDorsoDni_tr
from Order p
INNER JOIN Delivery e ON p.Delivery= e.Delivery
left JOIN transport t ON p.Delivery=  t.Delivery_tr
WHERE p.Order = '972022'
</code>```

Query 2: Brings Deliverys in a certain date range

```<code>SELECT e.Entrega, p.Pedido, p.Remito, e.Fecha
from Entrega e
INNER JOIN Pedido p ON e.Entrega = p.Entrega
WHERE e.Fecha BETWEEN '" + fromDate + " 00:00:00' AND 'toDate 24:00:00'
GROUP BY e.Delivery, p.Order, p.Rowing
ORDER BY e.date ASC
</code>```

This two querys are the most used. I use indexes for Table Delivery (example query one, e.Delivery is indexed), and all "Delivery" columns are  PK

Also, I'm using DataTables, but I didn't download it, I'm refering to the page, in the  I have

```<code><link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.6.5/css/buttons.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.23/css/dataTables.bootstrap5.min.css">
</code>```

Body:
I have a problem and is that I have 8 cores and after a day of doing the same querys, 5 of them stay in 100% and don't decrease.

I changed some part of the code, for example instead of doing conection.open(), I use using(MySqlConnection con = new MySqlConnection()){ ... }, but that doesn't changed something significant.

Reading some blogs and documentation, I think that the problem could be the querys I'm doing, that stay in loop somewhere and that causes the 5 cores in 100%. I have to restart them to have again 0%.

So, my question is, where or how can I see the querys that causes my problem? Do you need to see some querys I use for my application? I'm using Visual Studio 2022 for code, phpMyAdmin as database

Please let me know.

Thanks.

Querys example:

Query 1: Select some records of One Orden

SELECT DISTINCT
    p.Order , p.Delivery, p.Rowing, e.Path, e.Fecha, t.numTram_tr, t.name_tr,
    t.lastname_tr, t.sex_tr, t.document_tr, t.ejem_tr, t.Delivery_tr,
    t.Birthday_tr, t.fechaEmision_tr, t.cod_tr, t.ImgFrenteDni_tr, t.ImgDorsoDni_tr
from Order p
INNER JOIN Delivery e ON p.Delivery= e.Delivery
left JOIN transport t ON p.Delivery=  t.Delivery_tr
WHERE p.Order = '972022'

Query 2: Brings Deliverys in a certain date range

SELECT e.Entrega, p.Pedido, p.Remito, e.Fecha
from Entrega e
INNER JOIN Pedido p ON e.Entrega = p.Entrega
WHERE e.Fecha BETWEEN '" + fromDate + " 00:00:00' AND 'toDate 24:00:00'
GROUP BY e.Delivery, p.Order, p.Rowing
ORDER BY e.date ASC

This two querys are the most used. I use indexes for Table Delivery (example query one, e.Delivery is indexed), and all "Delivery" columns are  PK

Also, I'm using DataTables, but I didn't download it, I'm refering to the page, in the  I have

<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.6.5/css/buttons.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.23/css/dataTables.bootstrap5.min.css">


问:
where are the HTTP requests in apk source code
I've extracted an apk(react native) with dex2jar and jar to java through jd-qui and also with apktool, and I can view the source code but there is no clue where are the HTTP requests in the source code.

When I intercept the apk traffic I can see all the requests to graphql endoint but I cannot see in the source code, where they are triggered or stored.

I searched the extracted source code with some keywords such as grahpql endpoint name, and the server address but still no result.

And the code seems not obfuscated to me, just some parts are like;

```<code>@Metadata(d1 = {"\000\026\n\002\030\002\n\002\020\000\n\000\n\002\020\002\n\000\n\002\030\002\n\000\bf\030\0002\0020\001J\020\020\002\032\0020\0032\006\020\004\032\0020\005H&\006\006"}, d2 = {"Lcom/shopify/arrive/E2EModule;", "", "launch", "", "intent", "Landroid/content/Intent;", "app_release"}, k = 1, mv = {1, 7, 1}, xi = 48)
public interface E2EModule {
  void launch(Intent paramIntent);
}
</code>```

Is there any way to reach where these requests are triggered or stored on the source code?

This is the apk name, com.shopify.arrive

Body:
I've extracted an apk(react native) with dex2jar and jar to java through jd-qui and also with apktool, and I can view the source code but there is no clue where are the HTTP requests in the source code.

When I intercept the apk traffic I can see all the requests to graphql endoint but I cannot see in the source code, where they are triggered or stored.

I searched the extracted source code with some keywords such as grahpql endpoint name, and the server address but still no result.

And the code seems not obfuscated to me, just some parts are like;

@Metadata(d1 = {"\000\026\n\002\030\002\n\002\020\000\n\000\n\002\020\002\n\000\n\002\030\002\n\000\bf\030\0002\0020\001J\020\020\002\032\0020\0032\006\020\004\032\0020\005H&\006\006"}, d2 = {"Lcom/shopify/arrive/E2EModule;", "", "launch", "", "intent", "Landroid/content/Intent;", "app_release"}, k = 1, mv = {1, 7, 1}, xi = 48)
public interface E2EModule {
  void launch(Intent paramIntent);
}

Is there any way to reach where these requests are triggered or stored on the source code?

This is the apk name, com.shopify.arrive


问:
ASP.net mvc, User and ClaimsIdentity lost after RedirectToRouteResult on HandleUnauthorizedRequest
as the title said, after i handled HandleUnauthorizedRequest on my custom AuthorizeAttribute and redirect to a page, it seems like the User and ClaimsIdentity is lost on the recieving page even though i set it before in HttpContext.User.

```<code>public override void OnAuthorization(System.Web.Mvc.AuthorizationContext filterContext)
{
   // just for testing.
    string username = GetCookies("username", httpContext);
    string role = GetCookies("role", httpContext);

     var identity = new ClaimsIdentity(new[]
    {
        new Claim(ClaimTypes.Name, username),
        new Claim(ClaimTypes.NameIdentifier, username)
    }, "keycloak_auth");

    identity.AddClaim(new Claim(ClaimTypes.Role, role));
    httpContext.User = new ClaimsPrincipal(identity);

    if (filterContext.HttpContext.User.Identity.IsAuthenticated)
    {
        filterContext.Result = new RedirectToRouteResult(
                         new RouteValueDictionary
                         {
                               { "action", "Contact" },
                               { "controller", "Home" }
                         });
    }
}
</code>```

On the receiving end on the Razor's page, i just simply display the name and it seems blank

```<code>@{
    ViewBag.Title = "Contact";
}
<h2>@ViewBag.Title.</h2>
<h3>@ViewBag.Message</h3>

<h3>@User.Identity.Name</h3>
</code>```

However, User.Identity.Name has become empty, what else am I missing here and where and what should i check for this issue?

Edit: I edited the sample code for simpler reproduction, i just created a simple attribute with forced values and redirect to the contract page from the ASP.Net default project files. The result is same, the identity (User.Identity) is lost including IsAuthenticated, Names, etc.

Body:
as the title said, after i handled HandleUnauthorizedRequest on my custom AuthorizeAttribute and redirect to a page, it seems like the User and ClaimsIdentity is lost on the recieving page even though i set it before in HttpContext.User.

public override void OnAuthorization(System.Web.Mvc.AuthorizationContext filterContext)
{
   // just for testing.
    string username = GetCookies("username", httpContext);
    string role = GetCookies("role", httpContext);

     var identity = new ClaimsIdentity(new[]
    {
        new Claim(ClaimTypes.Name, username),
        new Claim(ClaimTypes.NameIdentifier, username)
    }, "keycloak_auth");

    identity.AddClaim(new Claim(ClaimTypes.Role, role));
    httpContext.User = new ClaimsPrincipal(identity);

    if (filterContext.HttpContext.User.Identity.IsAuthenticated)
    {
        filterContext.Result = new RedirectToRouteResult(
                         new RouteValueDictionary
                         {
                               { "action", "Contact" },
                               { "controller", "Home" }
                         });
    }
}

On the receiving end on the Razor's page, i just simply display the name and it seems blank

@{
    ViewBag.Title = "Contact";
}

@ViewBag.Title.

@ViewBag.Message

@User.Identity.Name

However, User.Identity.Name has become empty, what else am I missing here and where and what should i check for this issue?

Edit: I edited the sample code for simpler reproduction, i just created a simple attribute with forced values and redirect to the contract page from the ASP.Net default project files. The result is same, the identity (User.Identity) is lost including IsAuthenticated, Names, etc.


问:
Laravel jobs/queue unclosed SQL Server database sessions
I noticed large amout of sessions running on database. Almost half of them have a query, take a look at . In my project I use queue worker to execute a code in background and use database as queue connection.

Here is the code I use:

Passing jobs to Batch:

```<code>        $jobs = [];
        foreach($data as $d){
            $jobs[] = new EstimateImportJob($d);
        }
        $batch = Bus::batch($jobs)->dispatch();
</code>```

Job source code:

```<code>        $current_date = Carbon::now();
        // Using these as tables don`t have increment traits
        $last_po_id = \DB::connection("main")->table('PO')->latest('ID')->first()->ID;
        $last_poline_id = \DB::connection("main")->table('POLINE')->latest('ID')->first()->ID;
        $last_poline_poline = \DB::connection("main")->table('POLINE')->latest('POLINE')->first()->POLINE;

        \DB::connection('main')->table('POLINE')->insert($d);
</code>```

As I know Laravel is supposed to close DB connection after code executions is finished. But I can`t find a reason why I have so many database sessions. Any ideas would be appretiated!

Normally, even with working queue worker expected result is to have 3-4 database sessions.

Body:
I noticed large amout of sessions running on database. Almost half of them have a query, take a look at . In my project I use queue worker to execute a code in background and use database as queue connection.

Here is the code I use:

Passing jobs to Batch:

        $jobs = [];
        foreach($data as $d){
            $jobs[] = new EstimateImportJob($d);
        }
        $batch = Bus::batch($jobs)->dispatch();

Job source code:

        $current_date = Carbon::now();
        // Using these as tables don`t have increment traits
        $last_po_id = \DB::connection("main")->table('PO')->latest('ID')->first()->ID;
        $last_poline_id = \DB::connection("main")->table('POLINE')->latest('ID')->first()->ID;
        $last_poline_poline = \DB::connection("main")->table('POLINE')->latest('POLINE')->first()->POLINE;

        \DB::connection('main')->table('POLINE')->insert($d);

As I know Laravel is supposed to close DB connection after code executions is finished. But I can`t find a reason why I have so many database sessions. Any ideas would be appretiated!

Normally, even with working queue worker expected result is to have 3-4 database sessions.


问:
How to disable line breaks in vscode when printing a spark-dataframe in a jupyter-notebook
I have my vscode set up to connect to a remote JupyterLab that connects to a spark cluster.

When printing a wide dataframe using df.show(false) the output wraps around and becomes unreadable.

What I have tried:

The same thing that works in JypterLab:

```<code>%%html
<style>
div.jp-OutputArea pre {
    white-space: pre;
}
</style>
</code>```

Setting Word Wrap to off in vscode (alt+z)

Google. I have found how to turn off wrapping the code, but nothing about the output.

Body:
I have my vscode set up to connect to a remote JupyterLab that connects to a spark cluster.

When printing a wide dataframe using df.show(false) the output wraps around and becomes unreadable.

What I have tried:

The same thing that works in JypterLab:

%%html

Setting Word Wrap to off in vscode (alt+z)

Google. I have found how to turn off wrapping the code, but nothing about the output.


问:
SwiftUI - Force arabic number keyboard
Is there a way (SwiftUI) to force the numberPad keyboard type only with Arabic numbers (1,2,3,4..9)?
The selected language makes the numberPad to present localized numbers (not arabic).</p>

Title: SwiftUI - Force arabic number keyboard


问:
A flutter simple text reader . but even i edited text file ,my reader still show old content
i just want to pick a text file then read it . But i found that even the text file got edited , next time i open it ,it still show the old content untill i change the file name.how can i solve it??

thx guys  thx thx thx thx thx thx thx

```<code>
class _MyHomePageState extends State<MyHomePage> {

  String screenText="Empty" ;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        endDrawer: sideDrawer(context),
      body:
          Stack(
            children: [
              textScreen(),
              loadFileButton(),
        ],
      )
    );
  }

  Widget loadFileButton(){
    return
      Container(
          alignment: Alignment.bottomRight,
          child: FloatingActionButton(

              child: Icon(Icons.add, size: 32,),
              onPressed: ()async{
                final file_picked = await FilePicker.platform.pickFiles();
                if (file_picked ==null) return;
                String filePath = file_picked.files.single.path!.toString();

                final reponse = await File(filePath).readAsString();
                screenText =reponse;
                setState(() {});
              }
          )
      );
  }

  Widget textScreen(){
    return
      Container(
        // alignment: Alignment.bottomLeft,
        padding: EdgeInsets.fromLTRB(30, 70, 30, 0),
        child: SingleChildScrollView(
          child: Text(
              screenText,
          ),
        ),
      );
  }
}

</code>```

Body:
i just want to pick a text file then read it . But i found that even the text file got edited , next time i open it ,it still show the old content untill i change the file name.how can i solve it??

thx guys  thx thx thx thx thx thx thx

class _MyHomePageState extends State<MyHomePage> {

  String screenText="Empty" ;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        endDrawer: sideDrawer(context),
      body:
          Stack(
            children: [
              textScreen(),
              loadFileButton(),
        ],
      )
    );
  }

  Widget loadFileButton(){
    return
      Container(
          alignment: Alignment.bottomRight,
          child: FloatingActionButton(

              child: Icon(Icons.add, size: 32,),
              onPressed: ()async{
                final file_picked = await FilePicker.platform.pickFiles();
                if (file_picked ==null) return;
                String filePath = file_picked.files.single.path!.toString();

                final reponse = await File(filePath).readAsString();
                screenText =reponse;
                setState(() {});
              }
          )
      );
  }

  Widget textScreen(){
    return
      Container(
        // alignment: Alignment.bottomLeft,
        padding: EdgeInsets.fromLTRB(30, 70, 30, 0),
        child: SingleChildScrollView(
          child: Text(
              screenText,
          ),
        ),
      );
  }
}


问:
How to remove faded background text from image with Python
i have a lot of pictures such as described below, and i want to remove text from image.
After trying this code i can remove only small sized text which is on the right bottom of image
How can i remove this faded text or any other idea?
i would like to mention that, this texts are same and the location of texts in image are the same also

def midpoint(x1, y1, x2, y2):
    x_mid = int((x1 + x2)/2)
    y_mid = int((y1 + y2)/2)
    return (x_mid, y_mid)

# Main function that detects text and inpaints.
def inpaint_text(img_path, pipeline):
    # read the image
    img = keras_ocr.tools.read(img_path)
    prediction_groups = pipeline.recognize([img])

    #Define the mask for inpainting
    mask = np.zeros(img.shape[:2], dtype="uint8")
    for box in prediction_groups[0]:
        x0, y0 = box[1][0]
        x1, y1 = box[1][1]
        x2, y2 = box[1][2]
        x3, y3 = box[1][3]

        x_mid0, y_mid0 = midpoint(x1, y1, x2, y2)
        x_mid1, y_mi1 = midpoint(x0, y0, x3, y3)

        thickness = int(math.sqrt( (x2 - x1)**2 + (y2 - y1)**2 ))

        cv2.line(mask, (x_mid0, y_mid0), (x_mid1, y_mi1), 255,
        thickness)
        inpainted_img = cv2.inpaint(img, mask, 7, cv2.INPAINT_NS)

    return inpainted_img

# weights for the detector and recognizer.
pipeline = keras_ocr.pipeline.Pipeline()

img_text_removed = inpaint_text('bina_test.jpg', pipeline)

plt.imshow(img_text_removed)

cv2.imwrite('text_removed_image.jpg', cv2.cvtColor(img_text_removed, cv2.COLOR_BGR2RGB))

```

Remove texts from image by python code

Body:
i have a lot of pictures such as described below, and i want to remove text from image.
After trying this code i can remove only small sized text which is on the right bottom of image
How can i remove this faded text or any other idea?
i would like to mention that, this texts are same and the location of texts in image are the same also

def midpoint(x1, y1, x2, y2):
    x_mid = int((x1 + x2)/2)
    y_mid = int((y1 + y2)/2)
    return (x_mid, y_mid)

# Main function that detects text and inpaints.
def inpaint_text(img_path, pipeline):
    # read the image
    img = keras_ocr.tools.read(img_path)
    prediction_groups = pipeline.recognize([img])

    #Define the mask for inpainting
    mask = np.zeros(img.shape[:2], dtype="uint8")
    for box in prediction_groups[0]:
        x0, y0 = box[1][0]
        x1, y1 = box[1][1]
        x2, y2 = box[1][2]
        x3, y3 = box[1][3]

        x_mid0, y_mid0 = midpoint(x1, y1, x2, y2)
        x_mid1, y_mi1 = midpoint(x0, y0, x3, y3)

        thickness = int(math.sqrt( (x2 - x1)**2 + (y2 - y1)**2 ))

        cv2.line(mask, (x_mid0, y_mid0), (x_mid1, y_mi1), 255,
        thickness)
        inpainted_img = cv2.inpaint(img, mask, 7, cv2.INPAINT_NS)

    return inpainted_img

# weights for the detector and recognizer.
pipeline = keras_ocr.pipeline.Pipeline()

img_text_removed = inpaint_text('bina_test.jpg', pipeline)

plt.imshow(img_text_removed)

cv2.imwrite('text_removed_image.jpg', cv2.cvtColor(img_text_removed, cv2.COLOR_BGR2RGB))

Remove texts from image by python code


问:
How to create an object JSON filter in JS/TS?
Here is the problem, I'm trying to create a filter based in an object JSON on the server side, the easiest example is youtube, I want a video with less than 4 minutes, at the first half of December 2022 that starts with the word "vlog". So the filter would be like this:

```<code>{
  "type": "video",
    "date": {
      "gte": "12-01-2022",
      "lt": "12-15-2022"
    },
    "searchValue":"vlog",
    "duration": {
      "lte": "240"
    }
}
</code>```

But we all know that the main object has other variables like "order by" or "features".
So the question is, how to create this filter based in an object the best possible way?

What I tried to do was to get every record that I have on my DB and then match the filters that the client wanted but this consumes too much of our database and I know that is not the best way to do it.

Body:
Here is the problem, I'm trying to create a filter based in an object JSON on the server side, the easiest example is youtube, I want a video with less than 4 minutes, at the first half of December 2022 that starts with the word "vlog". So the filter would be like this:

{
  "type": "video",
    "date": {
      "gte": "12-01-2022",
      "lt": "12-15-2022"
    },
    "searchValue":"vlog",
    "duration": {
      "lte": "240"
    }
}

But we all know that the main object has other variables like "order by" or "features".
So the question is, how to create this filter based in an object the best possible way?

What I tried to do was to get every record that I have on my DB and then match the filters that the client wanted but this consumes too much of our database and I know that is not the best way to do it.


问:
stock prediction / RNN/ keras/ LSTM / training data
I am doing a university project and would like to know why my Code is not working. The prediction is not working, although i follow this instruction. https://www.section.io/engineering-education/stock-price-prediction-using-python/

I have spent many hours on it but cannot find the problem. This is the colab research page: https://colab.research.google.com/drive/1RlmWS-42lnWznZXoTgRMNP-ZWFJPSu0y#scrollTo=8e38f80IO1UN

Thanks to everyone to help me!! <3

```<code>import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.preprocessing import MinMaxScaler
from keras.models import Sequential, load_model
from keras.layers import LSTM, Dense, Dropout

dataset_train = np.array(Amazon1[:int(Amazon1.shape[0]*0.8)])
dataset_test = np.array(Amazon1[int(Amazon1.shape[0]*0.8):])
print(dataset_train.shape)
print(dataset_test.shape)

#SCALING THE DATA
scaler = MinMaxScaler(feature_range=(0,1))
dataset_train = scaler.fit_transform(dataset_train)
dataset_test = scaler.transform(dataset_test)

dataset_test = scaler.transform(dataset_test)
dataset_test[:5]

def create_dataset(df):
    x = []
    y = []
    for i in range(350, df.shape[0]):
        x.append(df[i-50:i, 0])
        y.append(df[i, 0])
    x = np.array(x)
    y = np.array(y)
    return x,y

x_train, y_train = create_dataset(dataset_train)
x_test, y_test = create_dataset(dataset_test)

model = Sequential()
model.add(LSTM(units=96, return_sequences=True, input_shape=(x_train.shape[1], 1)))
model.add(Dropout(0.2))
model.add(LSTM(units=96,return_sequences=True))
model.add(Dropout(0.2))
model.add(LSTM(units=96,return_sequences=True))
model.add(Dropout(0.2))
model.add(LSTM(units=96))
model.add(Dropout(0.2))
model.add(Dense(units=1))

x_train = np.reshape(x_train, (x_train.shape[0], x_train.shape[1], 1))
x_test = np.reshape(x_test, (x_test.shape[0], x_test.shape[1], 1))

model.compile(loss='mean_squared_error', optimizer='adam')

model.fit(x_train, y_train, epochs=10, batch_size=32)
model.save('stock_prediction.h5')

predictions = model.predict(x_test)
predictions = scaler.inverse_transform(predictions)
y_test_scaled = scaler.inverse_transform(y_test.reshape(-1, 1))

fig, ax = plt.subplots(figsize=(16,8))
ax.set_facecolor('#000041')
ax.plot(y_test_scaled, color='red', label='Original price')
plt.plot(predictions, color='cyan', label='Predicted price')
plt.legend()
</code>```

Body:
I am doing a university project and would like to know why my Code is not working. The prediction is not working, although i follow this instruction. https://www.section.io/engineering-education/stock-price-prediction-using-python/

I have spent many hours on it but cannot find the problem. This is the colab research page: https://colab.research.google.com/drive/1RlmWS-42lnWznZXoTgRMNP-ZWFJPSu0y#scrollTo=8e38f80IO1UN

Thanks to everyone to help me!! <3

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.preprocessing import MinMaxScaler
from keras.models import Sequential, load_model
from keras.layers import LSTM, Dense, Dropout

dataset_train = np.array(Amazon1[:int(Amazon1.shape[0]*0.8)])
dataset_test = np.array(Amazon1[int(Amazon1.shape[0]*0.8):])
print(dataset_train.shape)
print(dataset_test.shape)

#SCALING THE DATA
scaler = MinMaxScaler(feature_range=(0,1))
dataset_train = scaler.fit_transform(dataset_train)
dataset_test = scaler.transform(dataset_test)

dataset_test = scaler.transform(dataset_test)
dataset_test[:5]

def create_dataset(df):
    x = []
    y = []
    for i in range(350, df.shape[0]):
        x.append(df[i-50:i, 0])
        y.append(df[i, 0])
    x = np.array(x)
    y = np.array(y)
    return x,y

x_train, y_train = create_dataset(dataset_train)
x_test, y_test = create_dataset(dataset_test)

model = Sequential()
model.add(LSTM(units=96, return_sequences=True, input_shape=(x_train.shape[1], 1)))
model.add(Dropout(0.2))
model.add(LSTM(units=96,return_sequences=True))
model.add(Dropout(0.2))
model.add(LSTM(units=96,return_sequences=True))
model.add(Dropout(0.2))
model.add(LSTM(units=96))
model.add(Dropout(0.2))
model.add(Dense(units=1))

x_train = np.reshape(x_train, (x_train.shape[0], x_train.shape[1], 1))
x_test = np.reshape(x_test, (x_test.shape[0], x_test.shape[1], 1))

model.compile(loss='mean_squared_error', optimizer='adam')

model.fit(x_train, y_train, epochs=10, batch_size=32)
model.save('stock_prediction.h5')

predictions = model.predict(x_test)
predictions = scaler.inverse_transform(predictions)
y_test_scaled = scaler.inverse_transform(y_test.reshape(-1, 1))

fig, ax = plt.subplots(figsize=(16,8))
ax.set_facecolor('#000041')
ax.plot(y_test_scaled, color='red', label='Original price')
plt.plot(predictions, color='cyan', label='Predicted price')
plt.legend()


问:
Using "<include file=" at the top of the class to also import method info
I am developing system that autogenerates documentation based on some of companies internal info. I am now interested in ways on how to display that autogenerated docs in IDE. Modifying summaries in script files through code seems a bit sketchy to me, especially because of git conflicts that might arise. Also, I would keep the XML in gitignore as they can be generated on any machine.

I've found usage of "<include file=" to be working nicely, although I hate that I have to include for each field/property/method. Is it possible to have only one include at the top of the class?

Here is the example of mine class:

/// <include file='docs.txt' path='Docs/Class[@name="SomeClass"]/ClassInfo/*' />
public class SomeClass
{
    // Can this include be removed in any way?
    /// <include file='docs.txt' path='Docs/Class[@name="SomeClass"]/FieldInfo[@name="SomeInt"]/*' />
    public int SomeInt;
}
```
<p>And here is the example of XML doc for it:</p>
<pre class="lang-xml prettyprint-override"><code><Docs>
    <Class name="SomeClass">
        <ClassInfo>
            <summary>
                Info for class
            </summary>>
        </ClassInfo>
        <FieldInfo name="SomeInt">
            <summary>
                Info for field called SomeInt
            </summary>
        </FieldInfo>
    </Class>
</Docs>
</code>```

It is okay for short classes, but classes with a lot of properties/field/methods and them having also their own attributes makes for a lot of repetitive comments. Anyway to handle this?

I also tried other options like Using [Description] attribute and trying to modify it's values via reflections on some compile trigger, writing plugin for IDE but this solution with XML looks the most native if I could just remove the repetitive stuff.

Body:
I am developing system that autogenerates documentation based on some of companies internal info. I am now interested in ways on how to display that autogenerated docs in IDE. Modifying summaries in script files through code seems a bit sketchy to me, especially because of git conflicts that might arise. Also, I would keep the XML in gitignore as they can be generated on any machine.

I've found usage of "<include file=" to be working nicely, although I hate that I have to include for each field/property/method. Is it possible to have only one include at the top of the class?

Here is the example of mine class:

/// <include file='docs.txt' path='Docs/Class[@name="SomeClass"]/ClassInfo/*' />
public class SomeClass
{
    // Can this include be removed in any way?
    /// <include file='docs.txt' path='Docs/Class[@name="SomeClass"]/FieldInfo[@name="SomeInt"]/*' />
    public int SomeInt;
}

And here is the example of XML doc for it:

<Docs>
    <Class name="SomeClass">
        <ClassInfo>

                Info for class
            >
        </ClassInfo>
        <FieldInfo name="SomeInt">

                Info for field called SomeInt

        </FieldInfo>
    </Class>
</Docs>

It is okay for short classes, but classes with a lot of properties/field/methods and them having also their own attributes makes for a lot of repetitive comments. Anyway to handle this?

I also tried other options like Using [Description] attribute and trying to modify it's values via reflections on some compile trigger, writing plugin for IDE but this solution with XML looks the most native if I could just remove the repetitive stuff.


问:
How to disable date drop down list
I am using the below code, how to disable the drop down list and change the date format

15-12-2022 . Please help.

```<code>   <input type="date" class="form-control" name="event_date" id="event_date" value="" maxlength="10">
    <script language="javascript">
        var today = new Date();
        var dd = String(today.getDate()).padStart(2, '0');
        var mm = String(today.getMonth() + 1).padStart(2, '0');
        var yyyy = today.getFullYear();

        today = yyyy + '-' + mm + '-' + dd;
        $('#event_date').attr('min',today);
    </script>
</code>```

Title: How to disable date drop down list

Body:
I am using the below code, how to disable the drop down list and change the date format

15-12-2022 . Please help.

   <input type="date" class="form-control" name="event_date" id="event_date" value="" maxlength="10">


问:
Why is DotNetCoreCLI test taking to much time?
I am trying to discover a way to fix too much time executing unit test. the azure command line is frorzen in this line: .

and this is my yml code:

```<code> - task: DotNetCoreCLI@2
  inputs:
    command: 'test'
    projects: '$(solutionUnitTest)'
    testRunTitle: 'Unit Tests'
</code>```

Body:
I am trying to discover a way to fix too much time executing unit test. the azure command line is frorzen in this line: .

and this is my yml code:

 - task: DotNetCoreCLI@2
  inputs:
    command: 'test'
    projects: '$(solutionUnitTest)'
    testRunTitle: 'Unit Tests'


问:
Docker Best Practise : Storing Private Key in Image for encrypting user data and save them to DB when running (–SECRET , ENV , ARG )
I am looking to become better  with Docker and to understand the concepts.
My question is about the --secret.

As I understand --secret is great for encrypting sensitive data so it doesn’t leave traces during build etc.

E.g. Getting the source code from git private repo.
The keys become available in run/secret and can be read during run.

It also plays an essential role whether you use docker build, docker-compose build or docker compose.

Concrete:
I want to use a private key  to store certain user data encrypted on the DB and decrypt it if necessary.

Best practice question:

how/where can and should I store such a private key  ?

What is state of the art approach ?

My approach:

I don’t want to store the private key   on the host as a file, I would prefer to read it from memory like run/secret.
This works for me with docker-compose build locally. Because the orchestration is done by docker.

(ENV : As environment variable I don’t want to store it, because someone who has access on the host can read it too. )
ISSUE: Now when I build the image and run it on a PAAS, run/secret is no longer available since the orchestration is not taken care by Docker.

I am banging my head on this and would appreciate any help

I tried to mount the private-key with --secret and hoped to access it in my image during run

locally it works

on PAAS  /run/secret/ folder isn't available, since orchestration isn't done by docker.


问:
How can i use DatabaseFacade ExecuteReader to execute a query .net 6?
I want to upgrade my .net core 2.1 project to .net 6
I used the Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade  to raw the sql query.
in asp net core 2.1 that work correctly but in .net 6 i have this error:

Error   CS1739  The best overload for 'ExecuteReader' does not have a parameter named 'parameterValues'

My function is :

```<code> public static RelationalDataReader ExecuteSqlQuery(this DatabaseFacade databaseFacade, string sql, params object[] parameters)
        {
            var concurrencyDetector = databaseFacade.GetService<IConcurrencyDetector>();

            using (concurrencyDetector.EnterCriticalSection())
            {
                var rawSqlCommand = databaseFacade
                    .GetService<IRawSqlCommandBuilder>()
                    .Build(sql, parameters);

                return rawSqlCommand
                    .RelationalCommand
                    .ExecuteReader(
                        databaseFacade.GetService<IRelationalConnection>(),
                        parameterValues: rawSqlCommand.ParameterValues);
            }
        }
</code>```

Body:
I want to upgrade my .net core 2.1 project to .net 6
I used the Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade  to raw the sql query.
in asp net core 2.1 that work correctly but in .net 6 i have this error:

Error   CS1739  The best overload for 'ExecuteReader' does not have a parameter named 'parameterValues'

My function is :

 public static RelationalDataReader ExecuteSqlQuery(this DatabaseFacade databaseFacade, string sql, params object[] parameters)
        {
            var concurrencyDetector = databaseFacade.GetService<IConcurrencyDetector>();

            using (concurrencyDetector.EnterCriticalSection())
            {
                var rawSqlCommand = databaseFacade
                    .GetService<IRawSqlCommandBuilder>()
                    .Build(sql, parameters);

                return rawSqlCommand
                    .RelationalCommand
                    .ExecuteReader(
                        databaseFacade.GetService<IRelationalConnection>(),
                        parameterValues: rawSqlCommand.ParameterValues);
            }
        }


问:
Issue with limiting number of responses in a google form. Whats wrong with the code?
```<code>// Set the maximum number of responses and the email address to send the notification to
var maxResponses = 100;
var email = 'email@gmail.com';

// Get the form object
var form = FormApp.getActiveForm();

// Set the form to accept a maximum of maxResponses responses
form.setLimitOneResponsePerUser(true)
  .setCollectEmail(true)
  .setCustomClosedFormMessage('This form has reached its maximum number of responses.')
  .setAcceptingResponses(true);

// Set a trigger to check the number of responses and send an email
// when the maximum is reached
function createTrigger() {
  ScriptApp.newTrigger('checkResponses')
    .forForm(form)
    .onFormSubmit()
    .create();
}

// Function to check the number of responses and send an email
// when the maximum is reached
function checkResponses() {
  var responses = form.getResponses();
  if (responses.length >= maxResponses) {
    MailApp.sendEmail(email, 'Form Response Limit Reached', 'This form has reached its maximum number of responses.');
    form.setAcceptingResponses(false);
  }
}
</code>```

I am expecting the code to close the form at a 100 responses and send me an email when it does so but having tested the form I can keep on submitting responses beyond 100, with no closure or email.

Body:
// Set the maximum number of responses and the email address to send the notification to
var maxResponses = 100;
var email = 'email@gmail.com';

// Get the form object
var form = FormApp.getActiveForm();

// Set the form to accept a maximum of maxResponses responses
form.setLimitOneResponsePerUser(true)
  .setCollectEmail(true)
  .setCustomClosedFormMessage('This form has reached its maximum number of responses.')
  .setAcceptingResponses(true);

// Set a trigger to check the number of responses and send an email
// when the maximum is reached
function createTrigger() {
  ScriptApp.newTrigger('checkResponses')
    .forForm(form)
    .onFormSubmit()
    .create();
}

// Function to check the number of responses and send an email
// when the maximum is reached
function checkResponses() {
  var responses = form.getResponses();
  if (responses.length >= maxResponses) {
    MailApp.sendEmail(email, 'Form Response Limit Reached', 'This form has reached its maximum number of responses.');
    form.setAcceptingResponses(false);
  }
}

I am expecting the code to close the form at a 100 responses and send me an email when it does so but having tested the form I can keep on submitting responses beyond 100, with no closure or email.


问:
How to pass value from suitelet to user event 2.0?
I didn't get a value it showed an error.</p>
```<code>ar suiteletPath = url.resolveScript({
                    scriptId: 'scriptId',
                    deploymentId: 'deploymentId',
                    returnExternalUrl: false

                    /*params: {
                       'send_item_id': item
                    }*/
</code>```

Body:
I didn't get a value it showed an error.

ar suiteletPath = url.resolveScript({
                    scriptId: 'scriptId',
                    deploymentId: 'deploymentId',
                    returnExternalUrl: false

                    /*params: {
                       'send_item_id': item
                    }*/


问:
How can I persist the `redirect_uri` with `https://abc.xyz.com/` instead of `http://localhost`?
I am new to Apache Httpd server and trying to configure the reverse proxy for an external site and below is my configuration:

```<code>SSLProxyEngine on
RewriteEngine on
ProxyPassMatch ^/(.*)$ https://abc.xyz.com/$1
ProxyPassReverse ^/(.*)$ https://abc.xyz.com/$1
RewriteRule /login-callback https://abc.xyz.com/login-callback
</code>```

When I an running httpd.exe and in browser when I am trying to browse http://localhost I can successfully proxy to the landing page of external site https://abc.xyz.com.

Now in landing page I have login button which will redirecting it to other site correctly but in redirect_uri it's appending http://localhost/login-callback like below,

https://PQR.xyz.com/oauth2/auth?client_id=my-client-id&code_challenge=lVv_PrQDR_m4Trw5ocYk5zaauGZZGU6EsIgJdmCOe20&code_challenge_method=S256&redirect_uri=http://localhost/login-callback&response_type=code

whereas It's should be https://abc.xyz.com/login-callback

Question: How can I persist the redirect_uri with https://abc.xyz.com/ instead of http://localhost?

Body:
I am new to Apache Httpd server and trying to configure the reverse proxy for an external site and below is my configuration:

SSLProxyEngine on
RewriteEngine on
ProxyPassMatch ^/(.*)$ https://abc.xyz.com/$1
ProxyPassReverse ^/(.*)$ https://abc.xyz.com/$1
RewriteRule /login-callback https://abc.xyz.com/login-callback

When I an running httpd.exe and in browser when I am trying to browse http://localhost I can successfully proxy to the landing page of external site https://abc.xyz.com.

Now in landing page I have login button which will redirecting it to other site correctly but in redirect_uri it's appending http://localhost/login-callback like below,

https://PQR.xyz.com/oauth2/auth?client_id=my-client-id&code_challenge=lVv_PrQDR_m4Trw5ocYk5zaauGZZGU6EsIgJdmCOe20&code_challenge_method=S256&redirect_uri=http://localhost/login-callback&response_type=code

whereas It's should be https://abc.xyz.com/login-callback

Question: How can I persist the redirect_uri with https://abc.xyz.com/ instead of http://localhost?


问:
How to serialize my SOAP request class with namespaces using XmlMapper?
For a SOAP API I need to POST a request XML in the following format:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws1="http://ws1.myapi.ch/">
  <soapenv:Header/>
  <soapenv:Body>
    <ws1:Suchen>
      <ws1:Benutzername>test</ws1:Benutzername>
      <ws1:Passwort>test</ws1:Passwort>
      <ws1:Sprache>De</ws1:Sprache>
      <ws1:Datenname>Arten</ws1:Datenname>
      <ws1:Einstellungen></ws1:Einstellungen>
    </ws1:Suchen>
  </soapenv:Body>
</soapenv:Envelope>
```
<p>In my Java code I have the following POJO for this:</p>
<pre class="lang-xml prettyprint-override"><code>@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "benutzername",
    "passwort",
    "sprache",
    "datenname",
    "suchwerte",
    "einstellungen"
})
@XmlRootElement(name = "Suchen")
public class Suchen {

    @XmlElement(name = "Benutzername")
    protected String benutzername;
    @XmlElement(name = "Passwort")
    protected String passwort;
    @XmlElement(name = "Sprache")
    protected String sprache;
    @XmlElement(name = "Datenname")
    protected String datenname;
    @XmlElement(name = "Suchwerte")
    protected String suchwerte;
    @XmlElement(name = "Einstellungen")
    protected String einstellungen;

    /**
     * Gets the value of the benutzername property.
     *
     * @return possible object is {@link String }
     */
    public String getBenutzername() {
        return benutzername;
    }

    /**
     * Sets the value of the benutzername property.
     *
     * @param value allowed object is {@link String }
     */
    public void setBenutzername(String value) {
        this.benutzername = value;
    }

    /**
     * Gets the value of the passwort property.
     *
     * @return possible object is {@link String }
     */
    public String getPasswort() {
        return passwort;
    }

    /**
     * Sets the value of the passwort property.
     *
     * @param value allowed object is {@link String }
     */
    public void setPasswort(String value) {
        this.passwort = value;
    }

    /**
     * Gets the value of the sprache property.
     *
     * @return possible object is {@link String }
     */
    public String getSprache() {
        return sprache;
    }

    /**
     * Sets the value of the sprache property.
     *
     * @param value allowed object is {@link String }
     */
    public void setSprache(String value) {
        this.sprache = value;
    }

    /**
     * Gets the value of the datenname property.
     *
     * @return possible object is {@link String }
     */
    public String getDatenname() {
        return datenname;
    }

    /**
     * Sets the value of the datenname property.
     *
     * @param value allowed object is {@link String }
     */
    public void setDatenname(String value) {
        this.datenname = value;
    }

    /**
     * Gets the value of the suchwerte property.
     *
     * @return possible object is {@link String }
     */
    public String getSuchwerte() {
        return suchwerte;
    }

    /**
     * Sets the value of the suchwerte property.
     *
     * @param value allowed object is {@link String }
     */
    public void setSuchwerte(String value) {
        this.suchwerte = value;
    }

    /**
     * Gets the value of the einstellungen property.
     *
     * @return possible object is {@link String }
     */
    public String getEinstellungen() {
        return einstellungen;
    }

    /**
     * Sets the value of the einstellungen property.
     *
     * @param value allowed object is {@link String }
     */
    public void setEinstellungen(String value) {
        this.einstellungen = value;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Suchen suchen = (Suchen) o;
        return Objects.equals(benutzername, suchen.benutzername) && Objects.equals(passwort, suchen.passwort) && Objects.equals(sprache, suchen.sprache)
                && Objects.equals(datenname, suchen.datenname) && Objects.equals(suchwerte, suchen.suchwerte) && Objects.equals(einstellungen,
                suchen.einstellungen);
    }

    @Override
    public int hashCode() {
        return Objects.hash(benutzername, passwort, sprache, datenname, suchwerte, einstellungen);
    }
}
</code>```

final String requestData = xmlMapper.writeValueAsString(requestPojo);
```
<p><code>requestData</code> looks like this:</p>
<pre class="lang-xml prettyprint-override"><code><Suchen>
  <benutzername>test</benutzername>
  <passwort>test</passwort>
  <sprache>De</sprache>
  <datenname>Arten</datenname>
  <suchwerte/>
  <einstellungen/>
</Suchen>
</code>```

Which does not meet the requirements at all.

So how can I add those special namespaces  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws1="http://ws1.myapi.ch/?

What is the best way to add those element name prefixes like <ws1:Suchen>?

Body:
For a SOAP API I need to POST a request XML in the following format:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws1="http://ws1.myapi.ch/">
  <soapenv:Header/>
  <soapenv:Body>
    <ws1:Suchen>
      <ws1:Benutzername>test</ws1:Benutzername>
      <ws1:Passwort>test</ws1:Passwort>
      <ws1:Sprache>De</ws1:Sprache>
      <ws1:Datenname>Arten</ws1:Datenname>
      <ws1:Einstellungen></ws1:Einstellungen>
    </ws1:Suchen>
  </soapenv:Body>
</soapenv:Envelope>

In my Java code I have the following POJO for this:

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "benutzername",
    "passwort",
    "sprache",
    "datenname",
    "suchwerte",
    "einstellungen"
})
@XmlRootElement(name = "Suchen")
public class Suchen {

    @XmlElement(name = "Benutzername")
    protected String benutzername;
    @XmlElement(name = "Passwort")
    protected String passwort;
    @XmlElement(name = "Sprache")
    protected String sprache;
    @XmlElement(name = "Datenname")
    protected String datenname;
    @XmlElement(name = "Suchwerte")
    protected String suchwerte;
    @XmlElement(name = "Einstellungen")
    protected String einstellungen;

    /**
     * Gets the value of the benutzername property.
     *
     * @return possible object is {@link String }
     */
    public String getBenutzername() {
        return benutzername;
    }

    /**
     * Sets the value of the benutzername property.
     *
     * @param value allowed object is {@link String }
     */
    public void setBenutzername(String value) {
        this.benutzername = value;
    }

    /**
     * Gets the value of the passwort property.
     *
     * @return possible object is {@link String }
     */
    public String getPasswort() {
        return passwort;
    }

    /**
     * Sets the value of the passwort property.
     *
     * @param value allowed object is {@link String }
     */
    public void setPasswort(String value) {
        this.passwort = value;
    }

    /**
     * Gets the value of the sprache property.
     *
     * @return possible object is {@link String }
     */
    public String getSprache() {
        return sprache;
    }

    /**
     * Sets the value of the sprache property.
     *
     * @param value allowed object is {@link String }
     */
    public void setSprache(String value) {
        this.sprache = value;
    }

    /**
     * Gets the value of the datenname property.
     *
     * @return possible object is {@link String }
     */
    public String getDatenname() {
        return datenname;
    }

    /**
     * Sets the value of the datenname property.
     *
     * @param value allowed object is {@link String }
     */
    public void setDatenname(String value) {
        this.datenname = value;
    }

    /**
     * Gets the value of the suchwerte property.
     *
     * @return possible object is {@link String }
     */
    public String getSuchwerte() {
        return suchwerte;
    }

    /**
     * Sets the value of the suchwerte property.
     *
     * @param value allowed object is {@link String }
     */
    public void setSuchwerte(String value) {
        this.suchwerte = value;
    }

    /**
     * Gets the value of the einstellungen property.
     *
     * @return possible object is {@link String }
     */
    public String getEinstellungen() {
        return einstellungen;
    }

    /**
     * Sets the value of the einstellungen property.
     *
     * @param value allowed object is {@link String }
     */
    public void setEinstellungen(String value) {
        this.einstellungen = value;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Suchen suchen = (Suchen) o;
        return Objects.equals(benutzername, suchen.benutzername) && Objects.equals(passwort, suchen.passwort) && Objects.equals(sprache, suchen.sprache)
                && Objects.equals(datenname, suchen.datenname) && Objects.equals(suchwerte, suchen.suchwerte) && Objects.equals(einstellungen,
                suchen.einstellungen);
    }

    @Override
    public int hashCode() {
        return Objects.hash(benutzername, passwort, sprache, datenname, suchwerte, einstellungen);
    }
}

final String requestData = xmlMapper.writeValueAsString(requestPojo);

requestData looks like this:

<Suchen>
  <benutzername>test</benutzername>
  <passwort>test</passwort>
  <sprache>De</sprache>
  <datenname>Arten</datenname>
  <suchwerte/>
  <einstellungen/>
</Suchen>

Which does not meet the requirements at all.

So how can I add those special namespaces  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws1="http://ws1.myapi.ch/?

What is the best way to add those element name prefixes like <ws1:Suchen>?


问:
Media feature hover in container queries
Can we use media features in container queries?

For example,

```<code>@container (hover: hover) {…
</code>```

Body:
Can we use media features in container queries?

For example,

@container (hover: hover) {…


问:
leapp upgrade: Centos7.9 to AlmaLinux 8.x fails with "mount: wrong fs type,..."
During “sudo leapp upgrade” I got only one issue (a few similar issues actually, but all connected to the same conflicting package):

2022-11-25 08:51:30.313 DEBUG PID: 21679 leapp.workflow.Download.dnf_package_download: file /usr/lib64/.libcrypto.so.1.1.1k.hmac from install of openssl-libs-1:1.1.1k-7.el8_6.x86_64 conflicts with file from package openssl11-libs-1:1.1.1k-4.el7.x86_64

I fixed it by uninstalling conflicting package:

```<code>yum -y remove openssl11-libs-1:1.1.1k-4.el7.x86_64
</code>```

After this, “sudo leapp upgrade” succeeded and asked to reboot the system. After the reboot it failed with the following errors in rdsosreport.txt:

ISSUE-1: iscsid: can't open InitiatorName configuration file /etc/iscsi/initiatorname.iscsi

ISSUE-2: WARNING: locking_type (4) is deprecated, using --sysinit --readonly

ISSUE-3: mount: wrong fs type, bad option, bad superblock:

Do you have any ideas what is wrong and how to fix it?

Body:
During “sudo leapp upgrade” I got only one issue (a few similar issues actually, but all connected to the same conflicting package):

2022-11-25 08:51:30.313 DEBUG PID: 21679 leapp.workflow.Download.dnf_package_download: file /usr/lib64/.libcrypto.so.1.1.1k.hmac from install of openssl-libs-1:1.1.1k-7.el8_6.x86_64 conflicts with file from package openssl11-libs-1:1.1.1k-4.el7.x86_64

I fixed it by uninstalling conflicting package:

yum -y remove openssl11-libs-1:1.1.1k-4.el7.x86_64

After this, “sudo leapp upgrade” succeeded and asked to reboot the system. After the reboot it failed with the following errors in rdsosreport.txt:

ISSUE-1: iscsid: can't open InitiatorName configuration file /etc/iscsi/initiatorname.iscsi

ISSUE-2: WARNING: locking_type (4) is deprecated, using --sysinit --readonly

ISSUE-3: mount: wrong fs type, bad option, bad superblock:

Do you have any ideas what is wrong and how to fix it?


问:
Qt executes an event before another event finishes its execution
I'm working on a project, which is a C++/Qt desktop application. In this application, I've identified a certain problem related to the execution of interface events.

For example, in this application, the mousePressEvent delegates a certain operation to the program, and this operation can be slow sometimes, so if the user presses the mouse button before this operation ends, the program begins to execute another operation before the previous one finishes.

Does anyone ever have this same issue with Qt?

Thank you.


问:
Possibility of reusing nested select value in other nested selects
Is it possible to create a reusable nested select statement in TSQL? Something like this?

Select(
   Select1(reusable)
   Select2(where Select1)
   Select3(where Select1)
   Select4(where Select1)
)
```
<p>or do I need to rewrite the same select statement to get the value I need to use in other selects in every lower statement? I tried to use it as below but I get always errors.</p>
<pre class="lang-sql prettyprint-override"><code>(SELECT TOP (1) LOCATION    FROM Address AS d
WHERE(RECID = trans.Address) ) as loc,

(SELECT TOP (1) CITY WHERE
(loc = other.recid)) as CITY
</code>```

Body:
Is it possible to create a reusable nested select statement in TSQL? Something like this?

Select(
   Select1(reusable)
   Select2(where Select1)
   Select3(where Select1)
   Select4(where Select1)
)

or do I need to rewrite the same select statement to get the value I need to use in other selects in every lower statement? I tried to use it as below but I get always errors.

(SELECT TOP (1) LOCATION    FROM Address AS d
WHERE(RECID = trans.Address) ) as loc,

(SELECT TOP (1) CITY WHERE
(loc = other.recid)) as CITY


问:
Text doesn't accept new FontWeight of modified TextStyle
I have a TextStyle called headline2, which is bold. Now I want to have a text with headline2, but not in bold. I can modify headline2 with textTheme.headline2!.copyWith(fontWeight: FontWeight.normal);or I use apply(fontWeightDelta: -3). Either way, if I use the new TextStyle in a Text or a TextSpan, it still shows up bold, even tho the new TextStyle has a FontWeight of 3.

```<code>   Expanded(
                    child: Padding(
                      padding: const EdgeInsets.only(top: GlobalSpacing.s),
                      child: ListView.separated(
                      shrinkWrap: true,
                    separatorBuilder: (context, index) =>
                    const Divider(
                      thickness: 1,
                    ),
                    itemCount: controller.currentStep + 3,
                    itemBuilder: (context, index) {
                      return Column(
                        mainAxisAlignment: MainAxisAlignment.end,
                        children: [
                          (controller.currentStep + 3 - 1 != index) ?
                          Padding(
                            padding: const EdgeInsets.fromLTRB(GlobalSpacing.m, 0.0, GlobalSpacing.m, 0.0),
                            child: Text.rich(
                              TextSpan(
                                style: textTheme.headline2,
                                text: "Text to be bold",
                                children: <TextSpan>[
                                  TextSpan(
                                style: textTheme.headline2!.copyWith(fontWeight: FontWeight.normal)),
                                    text: "text to be normal",
                                  ),
                                ],
                              ),
                            ),
                            /*
                            Row(
                            mainAxisSize: MainAxisSize.min,
                            children: [
                              Text("Bold", style: textTheme.headline2),
                              const Spacer(),
                              Text("Not bold", style: textTheme.headline2!.copyWith(fontWeight: FontWeight.normal)),
                            ],
                          ), */
                          ) :
                      createCurrentNodeWidget(textTheme),
                        ],
                      );
                    },
                  ),
                    ),
                    ),
</code>```

Body:
I have a TextStyle called headline2, which is bold. Now I want to have a text with headline2, but not in bold. I can modify headline2 with textTheme.headline2!.copyWith(fontWeight: FontWeight.normal);or I use apply(fontWeightDelta: -3). Either way, if I use the new TextStyle in a Text or a TextSpan, it still shows up bold, even tho the new TextStyle has a FontWeight of 3.

   Expanded(
                    child: Padding(
                      padding: const EdgeInsets.only(top: GlobalSpacing.s),
                      child: ListView.separated(
                      shrinkWrap: true,
                    separatorBuilder: (context, index) =>
                    const Divider(
                      thickness: 1,
                    ),
                    itemCount: controller.currentStep + 3,
                    itemBuilder: (context, index) {
                      return Column(
                        mainAxisAlignment: MainAxisAlignment.end,
                        children: [
                          (controller.currentStep + 3 - 1 != index) ?
                          Padding(
                            padding: const EdgeInsets.fromLTRB(GlobalSpacing.m, 0.0, GlobalSpacing.m, 0.0),
                            child: Text.rich(
                              TextSpan(
                                style: textTheme.headline2,
                                text: "Text to be bold",
                                children: <TextSpan>[
                                  TextSpan(
                                style: textTheme.headline2!.copyWith(fontWeight: FontWeight.normal)),
                                    text: "text to be normal",
                                  ),
                                ],
                              ),
                            ),
                            /*
                            Row(
                            mainAxisSize: MainAxisSize.min,
                            children: [
                              Text("Bold", style: textTheme.headline2),
                              const Spacer(),
                              Text("Not bold", style: textTheme.headline2!.copyWith(fontWeight: FontWeight.normal)),
                            ],
                          ), */
                          ) :
                      createCurrentNodeWidget(textTheme),
                        ],
                      );
                    },
                  ),
                    ),
                    ),


问:
Reason for "not rounded" window height for Chrome
Using window.innerWidth and window.innerHeight, I found that my chrome window size is 1440px * 749px. My question is, why the number 749? This is also the number I get using document.documentElement.clientHeight.

I found "749px" appearing in some other CSS media query questions, but I can't find anyone talking about WHY we use/get values like 749 or 549. Can't they be rounded up to something like 750 or 550?


问:
Is there a better way to find out which view blocks hittest in swiftui?
I have a few screens with lots of Stack view(Called View B) hierarchy, as well as overlaid by UIViewController (called View A).
after overriding the hittest() in UNViewController, and tapping the same view like UILable on View A, the tap gesture can just be passed through View B in part of screens.

is there a easy way to detect which one blocks hittest() instead of adding test code for each Stack view separately.

thanks.


问:
model is not a function error in loopback
I am making a rest api using loopback. I have when I was starting the project using npm start I encountered the error below

```<code>app.repository() function is needed for RepositoryBooter. You can add it to your Application using RepositoryMixin from @loopback/repository.
app.dataSource() function is needed for DataSourceBooter. You can add it to your Application using RepositoryMixin from @loopback/repository.
Cannot start the application. TypeError: this.app.model is not a function
    at ModelBooter.load (D:\api_luxorides\api_exp\node_modules\@loopback\boot\src\booters\model.booter.ts:58:32)
    at Bootstrapper.boot (D:\api_luxorides\api_exp\node_modules\@loopback\boot\src\bootstrapper.ts:123:11)
    at ApiExpApplication.boot (D:\api_luxorides\api_exp\node_modules\@loopback\boot\src\mixins\boot.mixin.ts:112:7)
    at main (D:\api_luxorides\api_exp\src\index.ts:7:3)
</code>```

Body:
I am making a rest api using loopback. I have when I was starting the project using npm start I encountered the error below

app.repository() function is needed for RepositoryBooter. You can add it to your Application using RepositoryMixin from @loopback/repository.
app.dataSource() function is needed for DataSourceBooter. You can add it to your Application using RepositoryMixin from @loopback/repository.
Cannot start the application. TypeError: this.app.model is not a function
    at ModelBooter.load (D:\api_luxorides\api_exp\node_modules\@loopback\boot\src\booters\model.booter.ts:58:32)
    at Bootstrapper.boot (D:\api_luxorides\api_exp\node_modules\@loopback\boot\src\bootstrapper.ts:123:11)
    at ApiExpApplication.boot (D:\api_luxorides\api_exp\node_modules\@loopback\boot\src\mixins\boot.mixin.ts:112:7)
    at main (D:\api_luxorides\api_exp\src\index.ts:7:3)


问:
'psycopg2.errors.UndefinedTable: relation "table" does not exist' when makemigrations
I have a django app (Django==4.1.2) and I am trying to migrate from sqlite3 to postgres.

I have been following multiples guides on how to do this, and they all do more or less the same and those are the steps I followed:

Get a dumpdata with python manage.py dumpdata > whole.json

Create db and user and connect to it

Config settings.py to set everything to the new database

Delete old migrations

run python manage.py makemigrations or python manage.py migrate --run-syncdb

There are more steps, but I am stuck in this 5th one getting 'psycopg2.errors.UndefinedTable: relation "table" does not exist'

Looking for solutions I've come to this post which may help someone, though I might not doing it right or something but commenting models have done nothing for me.

Thanks.


问:
Get latest master, including submodules
There is one thing I want: the latest bits of the remote master. This is equally true for the for the sub-modules. I'm not interested in any other branch or history. Any change made locally irrespective whether these changes are tracked or not should be blindly ditched.

So, here is my shot on this, formulated as part of a Makefile. It is quite slow (lots of/large files) and it fails some times. Please let me know how to improve it:

```<code>pull: $(LOCAL_REPO)
    cd $(LOCAL_REPO) && git submodule foreach git fetch origin master
    cd $(LOCAL_REPO) && git submodule foreach git reset --hard FETCH_HEAD
    cd $(LOCAL_REPO) && git submodule foreach git clean -fdx
    cd $(LOCAL_REPO) && git submodule foreach git pull --rebase --allow-unrelated-histories origin master --depth 1
    cd $(LOCAL_REPO) && git fetch origin master
    cd $(LOCAL_REPO) && git reset --hard FETCH_HEAD
    cd $(LOCAL_REPO) && git clean -dfx
    cd $(LOCAL_REPO) && git pull --rebase --allow-unrelated-histories origin master --depth 1

$(LOCAL_REPO):
    mkdir -p $(LOCAL_REPO)
    cd $(LOCAL_REPO) && git init
    cd $(LOCAL_REPO) && git remote add origin $(PRIVATE_GITHUB_GIT)
    cd $(LOCAL_REPO) && git pull origin master --depth 1
    cd $(LOCAL_REPO) && git submodule init $(SUBMOD1) $(SUBMOD2) $(SUBMOD3)
    cd $(LOCAL_REPO) && git submodule update --remote --merge --depth 1
</code>```

Title: Get latest master, including submodules

Body:
There is one thing I want: the latest bits of the remote master. This is equally true for the for the sub-modules. I'm not interested in any other branch or history. Any change made locally irrespective whether these changes are tracked or not should be blindly ditched.

So, here is my shot on this, formulated as part of a Makefile. It is quite slow (lots of/large files) and it fails some times. Please let me know how to improve it:

pull: $(LOCAL_REPO)
    cd $(LOCAL_REPO) && git submodule foreach git fetch origin master
    cd $(LOCAL_REPO) && git submodule foreach git reset --hard FETCH_HEAD
    cd $(LOCAL_REPO) && git submodule foreach git clean -fdx
    cd $(LOCAL_REPO) && git submodule foreach git pull --rebase --allow-unrelated-histories origin master --depth 1
    cd $(LOCAL_REPO) && git fetch origin master
    cd $(LOCAL_REPO) && git reset --hard FETCH_HEAD
    cd $(LOCAL_REPO) && git clean -dfx
    cd $(LOCAL_REPO) && git pull --rebase --allow-unrelated-histories origin master --depth 1

$(LOCAL_REPO):
    mkdir -p $(LOCAL_REPO)
    cd $(LOCAL_REPO) && git init
    cd $(LOCAL_REPO) && git remote add origin $(PRIVATE_GITHUB_GIT)
    cd $(LOCAL_REPO) && git pull origin master --depth 1
    cd $(LOCAL_REPO) && git submodule init $(SUBMOD1) $(SUBMOD2) $(SUBMOD3)
    cd $(LOCAL_REPO) && git submodule update --remote --merge --depth 1