问:
Vue PWA Workbox (InjectManifest) type error Failed to fetch
I've a Pwa Vue.js APP and I'm using @vue/cli-plugin-pwa plugin. I've setup a fetch event listener in my service-worker.js file, and When I get offline and reload the page its not getting serve from offline and show the error in console

```<code>service-worker.js:33 Uncaught (in promise) TypeError: Failed to fetch
    at service-worker.js:33:27
</code>```

Here is my service-worker.js file

```<code>importScripts("/precache-manifest.b0639782b7bbcefc0a5a16737bab59a4.js", "https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");

const bgSyncQueue = new workbox.backgroundSync.Queue('uploadQueue', {
  maxRetentionTime: 60 * 24 * 60,
  onSync: () => syncData(),
});

workbox.routing.registerNavigationRoute('/index.html');

this.onfetch = (event) => {
    let requestClone = event.request.clone();
    const methodsToReply = ['POST', 'PUT', 'DELETE']
    if (methodsToReply.includes(requestClone.method)) {
        event.respondWith(
            (() => {
                const promiseChain = fetch(requestClone).catch(() => {
                    return bgSyncQueue.pushRequest(event);
                });
                event.waitUntil(promiseChain);
                return promiseChain;
            })()
        );
    } else {
        event.respondWith(fetch(event.request));
    }
};

async function syncData() {

  console.log('sync data running');
  let entry;
  while ((entry = await bgSyncQueue.shiftRequest())) {
    try {
      console.log('sync data running', entry);

      await fetch(entry.request);
      console.error("Replay successful for request", entry.request);
    } catch (error) {
      console.error("Replay failed for request", entry.request, error);

      // Put the entry back in the bgSyncQueue and re-throw the error:
      await bgSyncQueue.unshiftRequest(entry);
      throw error;
    }
  }
  console.log("Replay complete!");
}
</code>```

Body:
I've a Pwa Vue.js APP and I'm using @vue/cli-plugin-pwa plugin. I've setup a fetch event listener in my service-worker.js file, and When I get offline and reload the page its not getting serve from offline and show the error in console

service-worker.js:33 Uncaught (in promise) TypeError: Failed to fetch
    at service-worker.js:33:27

Here is my service-worker.js file

importScripts("/precache-manifest.b0639782b7bbcefc0a5a16737bab59a4.js", "https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");

const bgSyncQueue = new workbox.backgroundSync.Queue('uploadQueue', {
  maxRetentionTime: 60 * 24 * 60,
  onSync: () => syncData(),
});

workbox.routing.registerNavigationRoute('/index.html');

this.onfetch = (event) => {
    let requestClone = event.request.clone();
    const methodsToReply = ['POST', 'PUT', 'DELETE']
    if (methodsToReply.includes(requestClone.method)) {
        event.respondWith(
            (() => {
                const promiseChain = fetch(requestClone).catch(() => {
                    return bgSyncQueue.pushRequest(event);
                });
                event.waitUntil(promiseChain);
                return promiseChain;
            })()
        );
    } else {
        event.respondWith(fetch(event.request));
    }
};

async function syncData() {

  console.log('sync data running');
  let entry;
  while ((entry = await bgSyncQueue.shiftRequest())) {
    try {
      console.log('sync data running', entry);

      await fetch(entry.request);
      console.error("Replay successful for request", entry.request);
    } catch (error) {
      console.error("Replay failed for request", entry.request, error);

      // Put the entry back in the bgSyncQueue and re-throw the error:
      await bgSyncQueue.unshiftRequest(entry);
      throw error;
    }
  }
  console.log("Replay complete!");
}


来源: stackexchange

问:
Delete list of s3 objects using lambda python
i have stored the list of files in json format in the source S3 bucket, and am trying to delete the list of s3 objects in a destination s3 bucket using Lambda python(boto3)

here is the python code i am trying with,

```<code>import boto3
import json
# Set the source and destination buckets
source_bucket_name = 'source-bucket'
destination_bucket_name = 'destination-bucket'

# Set the file format of the object list
file_format = 'json'

# Set the name of the file containing the object list
file_name = 'object-list.' + file_format

# Set the AWS region
region_name = 'us-east-1'

def lambda_handler(event, context):
    # Create an S3 client
    s3 = boto3.client('s3', region_name=region_name)

    # Get the object list from the source bucket
    response = s3.get_object(Bucket=source_bucket_name, Key=file_name)
    object_list = response['Body'].read()

    # Parse the object list based on the file format
    if file_format == 'json':
        # Parse the JSON object list
        object_list = json.loads(object_list)
    elif file_format == 'csv':
        # Parse the CSV object list
        object_list = csv.reader(object_list)

    # Delete the specified objects from the destination bucket
    for obj in object_list:
        s3.delete_object(Bucket=destination_bucket_name, Key=obj)

</code>```

I am not getting any error after executing the code. But the file is not getting deleted in destination S3 bucket. can someone guide me on the same

I am trying in AWS Lambda to automate deleting the list of S3 objects in a bucket.

ContentLicense: CC BY-SA 4.0

Body:
i have stored the list of files in json format in the source S3 bucket, and am trying to delete the list of s3 objects in a destination s3 bucket using Lambda python(boto3)

here is the python code i am trying with,

import boto3
import json
# Set the source and destination buckets
source_bucket_name = 'source-bucket'
destination_bucket_name = 'destination-bucket'

# Set the file format of the object list
file_format = 'json'

# Set the name of the file containing the object list
file_name = 'object-list.' + file_format

# Set the AWS region
region_name = 'us-east-1'

def lambda_handler(event, context):
    # Create an S3 client
    s3 = boto3.client('s3', region_name=region_name)

    # Get the object list from the source bucket
    response = s3.get_object(Bucket=source_bucket_name, Key=file_name)
    object_list = response['Body'].read()

    # Parse the object list based on the file format
    if file_format == 'json':
        # Parse the JSON object list
        object_list = json.loads(object_list)
    elif file_format == 'csv':
        # Parse the CSV object list
        object_list = csv.reader(object_list)

    # Delete the specified objects from the destination bucket
    for obj in object_list:
        s3.delete_object(Bucket=destination_bucket_name, Key=obj)

I am not getting any error after executing the code. But the file is not getting deleted in destination S3 bucket. can someone guide me on the same

I am trying in AWS Lambda to automate deleting the list of S3 objects in a bucket.


问:
Double output from getline()
So I have this problem with getline() in c++.After running the code, the output got jump down to "insert author", I've used cin.ignore() and got the first letter of the name dissapeared. How do I tackle this problem
Output:
Insert the name
Insert author

This is my code

#include <iostream>
using namespace std;
    class Book
    {
        public:
            string name;
            string author;
        void input()
        {
            cout << "insert the name\n";
           getline(cin,name);
           cout << "insert author\n";
           getline(cin,author);
        }
        void output()
        {
            cout << name << endl;
            cout << author << endl;
        }
    };

int main()
{
    int n;
    cout << "Insert how many books do you want to create\n";
    cin >> n;
    Book b[100];
    for(int i=0;i<n;i++)
    {
        b[i].input();
    }
    for(int i=0;i<n;i++)
    {
        b[i].output();
    }
}
```

Title: Double output from getline()


问:
How can I fix TSLint: Error: Cannot find module 'tslint/lib/lint' for Angular 14?
After updating my Angular application from 13 to 14, the above error always occurs when launching Intellij. Any idea how I can fix this?

My global settings look like this:

My package.json:


问:
Calculating Mean Time To Recovery - DataDog and PagerDuty integration
I have recently setup DataDog + PagerDuty integration and I am receiving data from PagerDuty in the form of DataDog events.

I am trying to setup a dashboard that shows the Mean Time to Recovery metric using these events. The idea is to group the events by Aggregation Key and then subtract the timestamp between success status and error status.

Currently, I'm not able to figure out how would I subtract the timestamps since that field is not available. Is there a way I can do this when setting up the dashboard on DataDog?

Below is an example of what a resolved PagerDuty event attributes looks something like

```<code>{
    aggregation_key 111190
    event_object    111190
    evt {
         id 6862368953771338774
         source_id  20
         type   pagerduty.incident
    }
    priority    normal
    service XXX-app
    status  success
    timestamp   1673291645000
    title   Resolved: XXX-app
}
</code>```

Body:
I have recently setup DataDog + PagerDuty integration and I am receiving data from PagerDuty in the form of DataDog events.

I am trying to setup a dashboard that shows the Mean Time to Recovery metric using these events. The idea is to group the events by Aggregation Key and then subtract the timestamp between success status and error status.

Currently, I'm not able to figure out how would I subtract the timestamps since that field is not available. Is there a way I can do this when setting up the dashboard on DataDog?

Below is an example of what a resolved PagerDuty event attributes looks something like

{
    aggregation_key 111190
    event_object    111190
    evt {
         id 6862368953771338774
         source_id  20
         type   pagerduty.incident
    }
    priority    normal
    service XXX-app
    status  success
    timestamp   1673291645000
    title   Resolved: XXX-app
}


问:
Build issue with vite related to styled component
I am getting below error while budling for production using vite , The build is working fine locally .

Here is the error ,

Error: [vite]: Rollup failed to resolve import "react-is" from "../../node_modules/styled-components/dist/styled-components.browser.esm.js".

Can anyone please suggest

I tried to add below plugin in vite config js but its not working

```<code>    plugins: [
      react({
        babel: {
          plugins: [
            [
              "babel-plugin-styled-components",
              {
                displayName: true,
                fileName: false,
              },
            ],
          ],
        },
      }),
    ];
</code>```

Body:
I am getting below error while budling for production using vite , The build is working fine locally .

Here is the error ,

Error: [vite]: Rollup failed to resolve import "react-is" from "../../node_modules/styled-components/dist/styled-components.browser.esm.js".

Can anyone please suggest

I tried to add below plugin in vite config js but its not working

    plugins: [
      react({
        babel: {
          plugins: [
            [
              "babel-plugin-styled-components",
              {
                displayName: true,
                fileName: false,
              },
            ],
          ],
        },
      }),
    ];


问:
unidrv windows printer driver plugin(bitmap.dll) sample source changes colors?
Using unidrv windows printer driver plugin(BITMAP.dll) sample source,

I can install and print color image to file (/w Print2file port).

but printed color is different with my original color.

For example,

original color (lime.bmp) is RGB(181,230,29), printed color(lime_prted.bmp) is RGB(175,228,23).

original(lime.bmp)  and printed color(lime_prted.bmp).

I didn't change any code from 'unidrv-based bitmap rendering plug-in and bitmap.gpd'

ImageProcessing of bitmap.dll plugin do just CopyMemory.

No color changing in ImageProcessing.

No color profile.

Who changes color?

////////////////////////////

I tried to add

*ChangeColorModeOnDoc?: FALSE

*EnableGDIColorMapping: FALSE

in bitmap.gpd.

No effect.

color changed.

////////////////////////////note ////////////////////

BITMAP

A Unidrv-based bitmap rendering plug-in. This sample demonstrates how to write a Unidrv-based rendering plug-in that functions as a bitmap driver.

https://github.com/microsoft/Windows-driver-samples/tree/main/print/OEM%20Printer%20Customization%20Plug-in%20Samples/C%2B%2B/bitmap

The IPrintOemUni::ImageProcessing method can be used with Unidrv-supported printers to modify image bitmap data

https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/prcomoem/nf-prcomoem-iprintoemuni-imageprocessing


问:
Handling Session Timeouts in Server side web applications integrated with Keycloak Java Servlet Adapter
Have Integrated a Java struts based server side application with a keycloak OIDC and Oauth provider.

Java servlet adapter mentioned in the https://access.redhat.com/documentation/en-us/red_hat_single_sign-on_continuous_delivery/3/html-single/securing_applications_and_services_guide/index#servlet_filter_adapter is used for the same implemetation.

The redirect_uri configured on the server is something like https://env.application.com/contextpath/

When the we application session timeouts and the user clicks on any link in the application the redirect_uri that goes as part of authorization code grant flow adds the URI of the link in addition to the redirect_uri configured in keycloak server. This will something like  for example https://env.application.com/contextpath**/submenu?name=menu**

This will result in an invalid redirect_uri error from the keycloak server.

The keycloak server doesn't allow to configure a placeholder * to be configured for security reasons.

Could someone please let me know how to handle we application session timeouts with integrated with keycloak OIDC and OAUTH provider.

Is there any other best practise availble to handle session timeouts in webapplications integrated with keyclaok OIDC.


问:
How to drag a custompainter widget in flutter
I created the clock in the image using custompainter. My objective is to drag the clock hands(second ,hour and minute hands) to set the time. How can i drag these hands around the clock from a fixed center point in flutter?


问:
Can't capture using set-literal, set(), or empty dict-literal (PEP-634, PEP-636)
I work at a Python shop, and I've got the green-light to start using 3.10 (we're so cutting-edge). SMP was a little disappointing at first, as I was anticipating Rust-style matching, but it's still pretty dang awesome.

...It has some quirks... I can match empty lists as expected, but I can't match empty dict literals, and I can't match set literals at al -- I can match dicts and sets by asserting the type of a capture, but that's kind of defeating the point of SMP.

Examples below, but I can't find existing SO questions, I can't find Python issue reports, and I can't find an explanation in the body of PEP-634 or PEP-636. A pointer towards an example of any of those 3 options probably counts as an "answered question", but I'm asking because I'm hoping there are answers.

Examples:

```<code># predictable and sane
match [1,2,3]:
    case [1,2,3]: print("lists are no substitute for arrays, but they do generally behave")
    case _: print("nice, predictable, and Never :)")

# a bit weird, but makes sense given the grammar
match (1,2,3):
    case tuple([1,2,3]): print("'e's a sinner, right, but 'e's friendly enough")
    case list((1,2,3)): print("This bit's fine. It sure is Python, but smells pleasantly of rust")

# this is officially annoying, but still workable. I'd rather have SMP like this than not.
match {"one": 1, "two": 2}:
    case dict(one=1, two=2): print("like, I get this not working...")
    case dict((("one", 1), ("two", 2))): print("...and I can't imagine this ever making sense.")
    case {"one": 1, "two": 2}: print("but you knew all along this was gonna work, so it's OK...")

# Definitely. Getting. Weirder:
match {1,2,3}:
    case set((1,2,3)): print("This should work, as far as what PEP-634 describes")
    case set(capture) if capture == {1,2,3}: print("There's this, sure, but...!?")
    case {1, 2, 3}: print("Syntax error. If anyone asks. '{' and '}' are for mapped captures.")
    case _: print("is there, for real, no way to capture a set-literal?")
</code>```

Body:
I work at a Python shop, and I've got the green-light to start using 3.10 (we're so cutting-edge). SMP was a little disappointing at first, as I was anticipating Rust-style matching, but it's still pretty dang awesome.

...It has some quirks... I can match empty lists as expected, but I can't match empty dict literals, and I can't match set literals at al -- I can match dicts and sets by asserting the type of a capture, but that's kind of defeating the point of SMP.

Examples below, but I can't find existing SO questions, I can't find Python issue reports, and I can't find an explanation in the body of PEP-634 or PEP-636. A pointer towards an example of any of those 3 options probably counts as an "answered question", but I'm asking because I'm hoping there are answers.

Examples:

# predictable and sane
match [1,2,3]:
    case [1,2,3]: print("lists are no substitute for arrays, but they do generally behave")
    case _: print("nice, predictable, and Never :)")

# a bit weird, but makes sense given the grammar
match (1,2,3):
    case tuple([1,2,3]): print("'e's a sinner, right, but 'e's friendly enough")
    case list((1,2,3)): print("This bit's fine. It sure is Python, but smells pleasantly of rust")

# this is officially annoying, but still workable. I'd rather have SMP like this than not.
match {"one": 1, "two": 2}:
    case dict(one=1, two=2): print("like, I get this not working...")
    case dict((("one", 1), ("two", 2))): print("...and I can't imagine this ever making sense.")
    case {"one": 1, "two": 2}: print("but you knew all along this was gonna work, so it's OK...")

# Definitely. Getting. Weirder:
match {1,2,3}:
    case set((1,2,3)): print("This should work, as far as what PEP-634 describes")
    case set(capture) if capture == {1,2,3}: print("There's this, sure, but...!?")
    case {1, 2, 3}: print("Syntax error. If anyone asks. '{' and '}' are for mapped captures.")
    case _: print("is there, for real, no way to capture a set-literal?")


问:
NGINX How to know if URL parameter is provided
How can I check in NGINX if query parameter in URL was provided.  Most examples have specific parameter in mind.  I just want to check if any is provided, but I don't know in advance what are the parameter names.</p>


问:
Why failed to open these dlls when I programming with Opencv In C++?
Everytimes I use opencv to debug,the vs studio will output the black window:
enter image description here
and its ignoring because when i close the black window the program is returned by the same time.
What happened with my opencv and how should i do?

I'll appreciate it for solving the problem!

I've tried to search for the solutions,and somehow it seems not a big deal.
but i just want to know how can i solve the problem completely.


问:
Spark Thrift Server connection to S3
I'm trying to connect to AWS S3 using Spark Thrift Service. I'm using:

spark-defaults.conf

```<code>spark.sql.warehouse.dir          s3://demo-metastore-001/
spark.hadoop.fs.s3.impl         org.apache.hadoop.fs.s3a.S3AFileSystem

spark.hadoop.fs.s3.aws.credentials.provider org.apache.hadoop.fs.s3a.SimpleAWSCredentialsProvider
spark.hadoop.fs.s3a.aws.credentials.provider org.apache.hadoop.fs.s3a.SimpleAWSCredentialsProvider

spark.hadoop.fs.s3.access.key   XXXXXXXXXXXXX
spark.hadoop.fs.s3.secret.key   yyyyyyyyyyyyyyyyyyyy
spark.hadoop.fs.s3a.access.key   XXXXXXXXXXXXX
spark.hadoop.fs.s3a.secret.key   yyyyyyyyyyyyyyyyyyyy
</code>```

hive-site.xml

```<code>  <property>
    <name>hive.metastore.warehouse.dir</name>
    <value>s3://demo-metastore-001/</value>
  </property>
  <property>
    <name>fs.s3.awsAccessKeyId</name>
    <value>XXXXXXXXXXXXX</value>
  </property>
  <property>
    <name>fs.s3.awsSecretAccessKey</name>
    <value>yyyyyyyyyyyyyyyyyyyy</value>
  </property>

  <property>
    <name>fs.s3a.awsAccessKeyId</name>
    <value>XXXXXXXXXXXXX</value>
  </property>
  <property>
    <name>fs.s3a.awsSecretAccessKey</name>
    <value>yyyyyyyyyyyyyyyyyyyy</value>
  </property>
</code>```

As you see I'm using brute force mixing s3 and s3a, not sure what are the right parameters

I'm running:

```<code>start-thriftserver.sh --packages org.apache.spark:spark-hadoop-cloud_2.12:3.3.1 --conf spark.hadoop.fs.s3.impl=org.apache.hadoop.fs.s3a.S3AFileSystem --master local[*]
</code>```

The log doesn't show any error:

```<code>23/01/12 04:16:12 INFO MetricsSystemImpl: s3a-file-system metrics system started
23/01/12 04:16:13 INFO SharedState: Warehouse path is 's3a://demo-metastore-001/'.
23/01/12 04:16:14 INFO HiveUtils: Initializing HiveMetastoreConnection version 2.3.9 using Spark classes.
23/01/12 04:16:14 INFO HiveClientImpl: Warehouse location for Hive client (version 2.3.9) is s3a://demo-metastore-001/
23/01/12 04:16:18 INFO HiveUtils: Initializing execution hive, version 2.3.9
23/01/12 04:16:18 INFO HiveClientImpl: Warehouse location for Hive client (version 2.3.9) is s3a://demo-metastore-001/
</code>```

But the metastore it is always created in the Master server directory not the in S3. Any idea how can I connect Spark-Thrift Server to AWS s3?

Title: Spark Thrift Server connection to S3

Body:
I'm trying to connect to AWS S3 using Spark Thrift Service. I'm using:

spark-defaults.conf

spark.sql.warehouse.dir          s3://demo-metastore-001/
spark.hadoop.fs.s3.impl         org.apache.hadoop.fs.s3a.S3AFileSystem

spark.hadoop.fs.s3.aws.credentials.provider org.apache.hadoop.fs.s3a.SimpleAWSCredentialsProvider
spark.hadoop.fs.s3a.aws.credentials.provider org.apache.hadoop.fs.s3a.SimpleAWSCredentialsProvider

spark.hadoop.fs.s3.access.key   XXXXXXXXXXXXX
spark.hadoop.fs.s3.secret.key   yyyyyyyyyyyyyyyyyyyy
spark.hadoop.fs.s3a.access.key   XXXXXXXXXXXXX
spark.hadoop.fs.s3a.secret.key   yyyyyyyyyyyyyyyyyyyy

hive-site.xml

  <property>
    <name>hive.metastore.warehouse.dir</name>
    <value>s3://demo-metastore-001/</value>
  </property>
  <property>
    <name>fs.s3.awsAccessKeyId</name>
    <value>XXXXXXXXXXXXX</value>
  </property>
  <property>
    <name>fs.s3.awsSecretAccessKey</name>
    <value>yyyyyyyyyyyyyyyyyyyy</value>
  </property>

  <property>
    <name>fs.s3a.awsAccessKeyId</name>
    <value>XXXXXXXXXXXXX</value>
  </property>
  <property>
    <name>fs.s3a.awsSecretAccessKey</name>
    <value>yyyyyyyyyyyyyyyyyyyy</value>
  </property>

As you see I'm using brute force mixing s3 and s3a, not sure what are the right parameters

I'm running:

start-thriftserver.sh --packages org.apache.spark:spark-hadoop-cloud_2.12:3.3.1 --conf spark.hadoop.fs.s3.impl=org.apache.hadoop.fs.s3a.S3AFileSystem --master local[*]

The log doesn't show any error:

23/01/12 04:16:12 INFO MetricsSystemImpl: s3a-file-system metrics system started
23/01/12 04:16:13 INFO SharedState: Warehouse path is 's3a://demo-metastore-001/'.
23/01/12 04:16:14 INFO HiveUtils: Initializing HiveMetastoreConnection version 2.3.9 using Spark classes.
23/01/12 04:16:14 INFO HiveClientImpl: Warehouse location for Hive client (version 2.3.9) is s3a://demo-metastore-001/
23/01/12 04:16:18 INFO HiveUtils: Initializing execution hive, version 2.3.9
23/01/12 04:16:18 INFO HiveClientImpl: Warehouse location for Hive client (version 2.3.9) is s3a://demo-metastore-001/

But the metastore it is always created in the Master server directory not the in S3. Any idea how can I connect Spark-Thrift Server to AWS s3?


问:
How to print SQLAlchemy update query?
According to docs printing queries is as simple as print(query).

But according to update function description, it returns an integer

:return: the count of rows matched as returned by the database's
"row count" feature.

My code:

    state = 'router_in_use'

    q = self.db_session.query(Router).filter(
        Router.id == self.router_id,
    ).update(
        {Router.state: state}, synchronize_session=False
    )

    #print(q) outputs just 1

    self.db_session.commit()
```

Is there a way to print q query in SQL language?

Query itself works fine.

python 3.8

Title: How to print SQLAlchemy update query?

Body:
According to docs printing queries is as simple as print(query).

But according to update function description, it returns an integer

:return: the count of rows matched as returned by the database's
"row count" feature.

My code:

    state = 'router_in_use'

    q = self.db_session.query(Router).filter(
        Router.id == self.router_id,
    ).update(
        {Router.state: state}, synchronize_session=False
    )

    #print(q) outputs just 1

    self.db_session.commit()

Is there a way to print q query in SQL language?

Query itself works fine.

python 3.8


问:
C3 Charts in C# html
Recently im working on c3 charts its actually working great
but i had a problem with dynamically get multiple data in DB

Multiple XY Lines chart
X had to be in string

I actually want multiple xy values and x values had to be string
After a long period i dont get any ideas

I tried json method in ajax

```<code> $.ajax({
                type: "POST",
                url: "../Home/timechart",
                data: Getdata,
                contentType: "application/json; chartset=utf-8",
                dataType: "json",
                success: function (response) {
                    successClass(response)
                },
            });

            function successClass(jsondata) {
                var data = {};
                var mvalue = [];
                var mdatetime = [];
                var TagID = [];

                jsondata.forEach(function (e) {
                    mvalue.push(e.mvalue);
                    mdatetime.push(e.mdatetime);
                    if (TagID != e.TagID) {
                        TagID.push(e.TagID);
                    }

                })

                //alert(objvalue)
                // alert(objdate)
                var chart = c3.generate({
                    bindto: '#chart',

                    data: {

                        columns: [

                            /* ['x'].concat(mdatetime),*/
                            [TagID].concat(mvalue)

                        ]

                    },
                    axis: {
                        x: {
                            type: 'category',
                            categories: mdatetime,
                            tick: {
                                rotate: -25,
                                multiline: false
                            },

                            height: 130
                        }
                    },
                    legend: {
                        position: 'outer-center'
                    }

                });

            }
        }
    });

});
</code>```

i can get a chart in single dynamic value but dont know how to get multiple y values and same x value in it

Title: C3 Charts in C# html

Body:
Recently im working on c3 charts its actually working great
but i had a problem with dynamically get multiple data in DB

Multiple XY Lines chart
X had to be in string

I actually want multiple xy values and x values had to be string
After a long period i dont get any ideas

I tried json method in ajax

 $.ajax({
                type: "POST",
                url: "../Home/timechart",
                data: Getdata,
                contentType: "application/json; chartset=utf-8",
                dataType: "json",
                success: function (response) {
                    successClass(response)
                },
            });

            function successClass(jsondata) {
                var data = {};
                var mvalue = [];
                var mdatetime = [];
                var TagID = [];

                jsondata.forEach(function (e) {
                    mvalue.push(e.mvalue);
                    mdatetime.push(e.mdatetime);
                    if (TagID != e.TagID) {
                        TagID.push(e.TagID);
                    }

                })

                //alert(objvalue)
                // alert(objdate)
                var chart = c3.generate({
                    bindto: '#chart',

                    data: {

                        columns: [

                            /* ['x'].concat(mdatetime),*/
                            [TagID].concat(mvalue)

                        ]

                    },
                    axis: {
                        x: {
                            type: 'category',
                            categories: mdatetime,
                            tick: {
                                rotate: -25,
                                multiline: false
                            },

                            height: 130
                        }
                    },
                    legend: {
                        position: 'outer-center'
                    }

                });

            }
        }
    });

});

i can get a chart in single dynamic value but dont know how to get multiple y values and same x value in it


问:
solidity reverse auction logic?
I am writing reverse auction with solidity and somewhat logic is confusing.
In regular auction, Seller make an auction with item, buyer (msg.sender) bids on the item, that bid amount will transfer to the smart contract, when auction is end, winning bid goes to the seller and other non-winning bid get refunded to the non-winners' account.

In reverse auction, Buyer create the auction, potential seller offer(bid) the price, lowest bid amount get selected and buyer (auction creator) will transfer money to the final offerer (bid winner with lowest price offer).

what i thought was that simply change the initial buyer and seller compare to the regular auction but it does not work

```<code>if (msg.value > winningBid) {
            pendingReturns[msg.sender] += msg.value;
            auctionWinner = msg.sender;
            winningBid = msg.value;
            emit RegularBidding(msg.sender, msg.value);
}
</code>```

is the regular auction bidding logic (which works fine)

```<code>if (msg.value < winningBid) {  // since winner is the one who offers the lowest price
            pendingReturns[product.buyer] += msg.value;  // when offer is made, buyer send money to the smart contract and get refunded later except for the winning offer amount
            auctionWinner = msg.sender;  // auctionWinner is the offerer (I think this line is wrong)
            winningBid = msg.value;
            emit ReverseBidding(product.buyer, msg.value);  // buyer transfer the value to the seller
}
</code>```

I know this code is wrong and logic is a bit confusing to me since msg.sender is totally opposite and buyer has to deposit money to the smart contract and get refunded later.

Title: solidity reverse auction logic?

Body:
I am writing reverse auction with solidity and somewhat logic is confusing.
In regular auction, Seller make an auction with item, buyer (msg.sender) bids on the item, that bid amount will transfer to the smart contract, when auction is end, winning bid goes to the seller and other non-winning bid get refunded to the non-winners' account.

In reverse auction, Buyer create the auction, potential seller offer(bid) the price, lowest bid amount get selected and buyer (auction creator) will transfer money to the final offerer (bid winner with lowest price offer).

what i thought was that simply change the initial buyer and seller compare to the regular auction but it does not work

if (msg.value > winningBid) {
            pendingReturns[msg.sender] += msg.value;
            auctionWinner = msg.sender;
            winningBid = msg.value;
            emit RegularBidding(msg.sender, msg.value);
}

is the regular auction bidding logic (which works fine)

if (msg.value < winningBid) {  // since winner is the one who offers the lowest price
            pendingReturns[product.buyer] += msg.value;  // when offer is made, buyer send money to the smart contract and get refunded later except for the winning offer amount
            auctionWinner = msg.sender;  // auctionWinner is the offerer (I think this line is wrong)
            winningBid = msg.value;
            emit ReverseBidding(product.buyer, msg.value);  // buyer transfer the value to the seller
}

I know this code is wrong and logic is a bit confusing to me since msg.sender is totally opposite and buyer has to deposit money to the smart contract and get refunded later.


问:
Incorrect Permission Assignment For Critical Resources on using @GetMapping, @PostMapping
We are using Spring Boot application to develop an API project. and it has swagger as well.
We are using Checkmarx for the identifying the vulnerabilities in the project.
And in resource methods we are using @GetMapping.
The usage  @GetMapping and @PostMapping is resulting "Incorrect Permission Assignment For Critical Resources"

```<code>@RestController
@RequestMapping("/test")
@Tag(name = "User Details")
public class UserDataController {

    private static final Logger LOGGER = ESAPI.getLogger(UserDataController.class);
@Operation(summary = "Get Details", tags = { "User Details" })
@GetMapping(path = "/v1.3/userData")
public ResponseEntity<UserDataResponseV3> getUserDataV3(
        @RequestParam(value = "changeFromDate", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:Ss.SSS") LocalDate changeFromDate,
        @RequestParam(value = "changeToDate", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:Ss.SSS") LocalDate changeToDate) {
    LOGGER.info(Logger.EVENT_SUCCESS,
            "Request processing for UserDataController.getUserDataV3() execution Started");

    LOGGER.debug(Logger.EVENT_SUCCESS, "userData Criteria-> from " + changeFromDate + " to {}" + changeToDate);

    LOGGER.info(Logger.EVENT_SUCCESS,
            "Request processing for UserDataController.getUserDataV3() execution Ended");

    return new ResponseEntity<>(userData, HttpStatus.OK);
}
}
</code>```

In Checkmarx report the below is the vulnerability getting listed.

A file is created on the file system by path in
src/main/java/com/test/codes/controller/UserDataController.java at
line 202 with potentially dangerous permissions.

Body:
We are using Spring Boot application to develop an API project. and it has swagger as well.
We are using Checkmarx for the identifying the vulnerabilities in the project.
And in resource methods we are using @GetMapping.
The usage  @GetMapping and @PostMapping is resulting "Incorrect Permission Assignment For Critical Resources"

@RestController
@RequestMapping("/test")
@Tag(name = "User Details")
public class UserDataController {

    private static final Logger LOGGER = ESAPI.getLogger(UserDataController.class);
@Operation(summary = "Get Details", tags = { "User Details" })
@GetMapping(path = "/v1.3/userData")
public ResponseEntity<UserDataResponseV3> getUserDataV3(
        @RequestParam(value = "changeFromDate", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:Ss.SSS") LocalDate changeFromDate,
        @RequestParam(value = "changeToDate", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:Ss.SSS") LocalDate changeToDate) {
    LOGGER.info(Logger.EVENT_SUCCESS,
            "Request processing for UserDataController.getUserDataV3() execution Started");

    LOGGER.debug(Logger.EVENT_SUCCESS, "userData Criteria-> from " + changeFromDate + " to {}" + changeToDate);

    LOGGER.info(Logger.EVENT_SUCCESS,
            "Request processing for UserDataController.getUserDataV3() execution Ended");

    return new ResponseEntity<>(userData, HttpStatus.OK);
}
}

In Checkmarx report the below is the vulnerability getting listed.

A file is created on the file system by path in
src/main/java/com/test/codes/controller/UserDataController.java at
line 202 with potentially dangerous permissions.


问:
changing the starting value in ROW_NUMBER in sql
When I am using ROW_NUMBER in SQL the starting value starts from '0' but I need to start it from '00001' is it possible?

```<code>SELECT
  ROW_NUMBER() OVER (PARTITION BY attribute1 ORDER BY attribute2 ASC) as 'VisitCode',
  Code1, Date, Id, PrefixCode
</code>```

I tried
ROW_NUMBER() OVER(ORDER BY Field) - 1 AS FieldAlias (To start from 00001) but it's showing an error:

'Expecting Select or ')' '

Body:
When I am using ROW_NUMBER in SQL the starting value starts from '0' but I need to start it from '00001' is it possible?

SELECT
  ROW_NUMBER() OVER (PARTITION BY attribute1 ORDER BY attribute2 ASC) as 'VisitCode',
  Code1, Date, Id, PrefixCode

I tried
ROW_NUMBER() OVER(ORDER BY Field) - 1 AS FieldAlias (To start from 00001) but it's showing an error:

'Expecting Select or ')' '


问:
Share a single index.rst master_doc for use in multiple Sphinx projects?
I have several projects which I document with Sphinx. The contents of index.rst are identical in each of them (I use some substitutions for project name and include another rst file with the list of modules). So I thought I could remove this file from most projects and only keep it in one shared project to which the others can find an absolute path during build.

However, the master_doc config does not let me enter an absolute path, and it even rejects relative paths that go "out of scope of the single project". I even tried adding the shared folder in sys.path, but it still did not help.

I've seen many questions asking the opposite, i.e. using multiple index.rst files in a single project. But that's not my case.

Do you have any ideas on how to get this working?


问:
Classification metrics can't handle a mix of unknown and binary targets
I am trying to evaluate my xgboost model using accuracy_score(). And I have the code:

```<code>predictions = xgb_model.predict(X_test)
accuracy = accuracy_score(y_test.to_numpy(), predictions)
</code>```

The error message looks like this:

```<code>---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Input In [126], in <cell line: 1>()
----> 1 accuracy = accuracy_score(y_test.to_numpy(), predictions)

File ~/opt/anaconda3/lib/python3.9/site-packages/sklearn/metrics/_classification.py:211, in accuracy_score(y_true, y_pred, normalize, sample_weight)
    145 """Accuracy classification score.
    146
    147 In multilabel classification, this function computes subset accuracy:
   (...)
    207 0.5
    208 """
    210 # Compute accuracy for each possible representation
--> 211 y_type, y_true, y_pred = _check_targets(y_true, y_pred)
    212 check_consistent_length(y_true, y_pred, sample_weight)
    213 if y_type.startswith("multilabel"):

File ~/opt/anaconda3/lib/python3.9/site-packages/sklearn/metrics/_classification.py:93, in _check_targets(y_true, y_pred)
     90     y_type = {"multiclass"}
     92 if len(y_type) > 1:
---> 93     raise ValueError(
     94         "Classification metrics can't handle a mix of {0} and {1} targets".format(
     95             type_true, type_pred
     96         )
     97     )
     99 # We can't have more than one value on y_type => The set is no more needed
    100 y_type = y_type.pop()

ValueError: Classification metrics can't handle a mix of unknown and binary targets
</code>```

The parameters look like this

```<code>y_test.to_numpy()
</code>```

```<code>predictions
</code>```

They are all 1-d arrays and I cannot find where is the problem.
How should I calculate the accuracy score?

Thanks!

Body:
I am trying to evaluate my xgboost model using accuracy_score(). And I have the code:

predictions = xgb_model.predict(X_test)
accuracy = accuracy_score(y_test.to_numpy(), predictions)

The error message looks like this:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Input In [126], in <cell line: 1>()
----> 1 accuracy = accuracy_score(y_test.to_numpy(), predictions)

File ~/opt/anaconda3/lib/python3.9/site-packages/sklearn/metrics/_classification.py:211, in accuracy_score(y_true, y_pred, normalize, sample_weight)
    145 """Accuracy classification score.
    146
    147 In multilabel classification, this function computes subset accuracy:
   (...)
    207 0.5
    208 """
    210 # Compute accuracy for each possible representation
--> 211 y_type, y_true, y_pred = _check_targets(y_true, y_pred)
    212 check_consistent_length(y_true, y_pred, sample_weight)
    213 if y_type.startswith("multilabel"):

File ~/opt/anaconda3/lib/python3.9/site-packages/sklearn/metrics/_classification.py:93, in _check_targets(y_true, y_pred)
     90     y_type = {"multiclass"}
     92 if len(y_type) > 1:
---> 93     raise ValueError(
     94         "Classification metrics can't handle a mix of {0} and {1} targets".format(
     95             type_true, type_pred
     96         )
     97     )
     99 # We can't have more than one value on y_type => The set is no more needed
    100 y_type = y_type.pop()

ValueError: Classification metrics can't handle a mix of unknown and binary targets

The parameters look like this

y_test.to_numpy()

predictions

They are all 1-d arrays and I cannot find where is the problem.
How should I calculate the accuracy score?

Thanks!


问:
How to write spec for time Zone in angular
Below ill share, my code for reference

```<code> getTimeZoneTime(val: string) {
    const userTimeZoneTime = moment
      .utc(val)
      .utcOffset(this.currentTimeZone)
      .local()
      .format('YYYY-MM-DD HH:mm:ss A');
    return userTimeZoneTime;
  }
</code>```

I have set the time zone using moment and UTC and I have returned the time zone at the end in this I have set the type to the current time zone as string currentTimeZone: string here I have created a form in that time zone will be displayed, I'm new to unit testing how can I write a spec for this function

Body:
Below ill share, my code for reference

 getTimeZoneTime(val: string) {
    const userTimeZoneTime = moment
      .utc(val)
      .utcOffset(this.currentTimeZone)
      .local()
      .format('YYYY-MM-DD HH:mm:ss A');
    return userTimeZoneTime;
  }

I have set the time zone using moment and UTC and I have returned the time zone at the end in this I have set the type to the current time zone as string currentTimeZone: string here I have created a form in that time zone will be displayed, I'm new to unit testing how can I write a spec for this function


问:
what's wakeups_resource.ips and is it indicate a crash?
As this problem said:https://developer.apple.com/forums/thread/110446?login=true,
it's a crash or some kind of warning or metric log?
ips file get from: iOS Settings > Privacy > Diagnostics & Usage > Analytics Data, generate by running monkey</p>


问:
using react-native-tab-view on expo on press tab not working but on local device its working fine
I am using npm I react-native-tab-view two create slider

installed Expo app first the tab view onPressTap is not working I have separately implement the on press tab there

after this

installed app on local device through android studio its working problem without mentioning onPressTap on clicked both the tap are working and slider is moving to respective pages

Why this happened is due to expo not supporting this library

react-native-tab-view
https://www.npmjs.com/package/react-native-tab-view

I try to installed app from expo not working then install locally through android studio its working properly.


问:
How to use external camera connected over wifi in IOS application?
I want to create an IOS app that would communicate and display the video feed from an external camera connected to my device (iphone) via WIFI. Example app could be like a dashcam (Vizen Cam). Is this possible with AVFoundation or would I need to use external SDK.

I tried something like this but

```<code>private func attemptToConfigureSession() {
    switch AVCaptureDevice.authorizationStatus(for: .video) {
    case .authorized:
        self.discoverExternalCamera()
    case .notDetermined:
        self.sessionQueue.suspend()
        AVCaptureDevice.requestAccess(for: .video) { granted in
        self.sessionQueue.resume()
        if granted {
            self.discoverExternalCamera()
        } else {
            self.cameraConfiguration = .permissionDenied
        }
        }
    case .denied:
        self.cameraConfiguration = .permissionDenied
    case .restricted:
        self.cameraConfiguration = .permissionDenied
    default:
        break
    }
}

private func discoverExternalCamera() {
    let discoverySession = AVCaptureDevice.DiscoverySession(
        deviceTypes: [.builtInWideAngleCamera, .external],
        mediaType: AVMediaType.video,
        position: .unspecified
    )
    for device in discoverySession.devices {
        if device.isConnected && device.hasMediaType(.video) {
        print(device.localizedName)
        if device.localizedName.contains("WiFi") {
            externalCamera = device
        }
    }
    }
    configureSession()
}
</code>```

Body:
I want to create an IOS app that would communicate and display the video feed from an external camera connected to my device (iphone) via WIFI. Example app could be like a dashcam (Vizen Cam). Is this possible with AVFoundation or would I need to use external SDK.

I tried something like this but

private func attemptToConfigureSession() {
    switch AVCaptureDevice.authorizationStatus(for: .video) {
    case .authorized:
        self.discoverExternalCamera()
    case .notDetermined:
        self.sessionQueue.suspend()
        AVCaptureDevice.requestAccess(for: .video) { granted in
        self.sessionQueue.resume()
        if granted {
            self.discoverExternalCamera()
        } else {
            self.cameraConfiguration = .permissionDenied
        }
        }
    case .denied:
        self.cameraConfiguration = .permissionDenied
    case .restricted:
        self.cameraConfiguration = .permissionDenied
    default:
        break
    }
}

private func discoverExternalCamera() {
    let discoverySession = AVCaptureDevice.DiscoverySession(
        deviceTypes: [.builtInWideAngleCamera, .external],
        mediaType: AVMediaType.video,
        position: .unspecified
    )
    for device in discoverySession.devices {
        if device.isConnected && device.hasMediaType(.video) {
        print(device.localizedName)
        if device.localizedName.contains("WiFi") {
            externalCamera = device
        }
    }
    }
    configureSession()
}


问:
Shaded error bars: Alternative to geom_ribbon and geom_errorbar?
How do I create error bars with a shaded fill? Similar to geom_ribbon() but instead of the ribbon converging into point for each datapoint like this:

They lie flat across each point, like this:

This is intended to better distinguish error bars for discrete variables.


问:
Use OpenCV to measure the pixel length of the line segments on the paper in the picture
I want to check the pixel length of the two lines on the paper in this image.

Original image:

I would like to crop out the area of the paper in the screen, and then detect the line segments in the crop screen and display the pixel lengths in the screen. Can anyone do this?

I tried to detect only the lines in the range of the paper in order to reduce false detections.
First, convert the image to HSV and create a mask to detect white paper.
Then use bitwise_and to exclude the background outside the paper and display only the part of the paper in the picture, but the part of the line on the paper is also excluded.

My Code:

```<code>        hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
        bi = cv2.bilateralFilter(hsv, 5, 75, 75)
        lower_white = np.array([0, 0, 120])
        upper_white = np.array([255, 70, 255])

        #create a mask for white colour using inRange function
        mask = cv2.inRange(bi, lower_white, upper_white)
        #perform bitwise and on the original image arrays using the mask
        res = cv2.bitwise_and(frame, frame, mask=mask)
</code>```

Try to use the inversion threshold directly on the picture, but some edges of the paper will also be detected

Use inverseion threshold:

Body:
I want to check the pixel length of the two lines on the paper in this image.

Original image:

I would like to crop out the area of the paper in the screen, and then detect the line segments in the crop screen and display the pixel lengths in the screen. Can anyone do this?

I tried to detect only the lines in the range of the paper in order to reduce false detections.
First, convert the image to HSV and create a mask to detect white paper.
Then use bitwise_and to exclude the background outside the paper and display only the part of the paper in the picture, but the part of the line on the paper is also excluded.

My Code:

        hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
        bi = cv2.bilateralFilter(hsv, 5, 75, 75)
        lower_white = np.array([0, 0, 120])
        upper_white = np.array([255, 70, 255])

        #create a mask for white colour using inRange function
        mask = cv2.inRange(bi, lower_white, upper_white)
        #perform bitwise and on the original image arrays using the mask
        res = cv2.bitwise_and(frame, frame, mask=mask)

Try to use the inversion threshold directly on the picture, but some edges of the paper will also be detected

Use inverseion threshold:


问:
antd ConfigProvider set prefixCls not in full effect coming from different packages
There is antdV4 version in the multi-package project, and now we want to use antdv5. In order to ensure      that the style is not affected, prefix is set at the entrance of the new package. However, this package refers to components wrapped by other packages, where the antd component prefix is not set。

[enter image description here](https://i.stack.imgur.com/N1Huo.png) [enter image description here](https://i.stack.imgur.com/b6Ksf.png) [enter image description here](https://i.stack.imgur.com/mMC4W.png)  Hopefully, the prefix will be set successfully, regardless of which package it was imported from


问:
Clip a raster data using rectangle defined by clicked posision and buffer in ArcObjects
Clip a raster data with rectangle using ArcObjects.
The rectangle is  defined by clicked posision and fixed length and width.

I have written the code so far, but I get an error.
Could someone please tell me how to do this?

```<code>
        protected override void OnMouseDown(MouseEventArgs arg)
        {
            IActiveView pActiveView = (IActiveView)ArcMap.Document.FocusMap;
            //
            IPoint pt = pActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(arg.X, arg.Y);
            IRasterLayer pRasterLay = (IRasterLayer)ArcMap.Document.FocusMap.get_Layer(0);
            IdentifyPixelValue(pRasterLay.Raster, pt.X, pt.Y);
        }

        public static void IdentifyPixelValue(IRaster raster, double xMap, double yMap)
        {
            IRaster2 raster2 = (IRaster2)raster;
            int col = raster2.ToPixelColumn(xMap);
            int row = raster2.ToPixelRow(yMap);
            //
            object pixelValue = (object)raster2.GetPixelValue(0, col, row);

            if (pixelValue == null)
            {
                //No Data
                System.Windows.Forms.MessageBox.Show("No Data");
            }
            else
            {
                //
                System.Windows.Forms.MessageBox.Show(pixelValue.ToString());
                System.Windows.Forms.MessageBox.Show(col.ToString() + ", " + row.ToString());
            }

            IEnvelope newExtent = new EnvelopeClass();

            envelope.XMin = xMap - 1024;

            envelope.XMax = xMap + 1024;

            envelope.YMin = yMap - 1024;

            envelope.YMax = yMap + 1024;

            clip = IRasterGeometryProc.Clip(envelope, raster);

        }
</code>```

Body:
Clip a raster data with rectangle using ArcObjects.
The rectangle is  defined by clicked posision and fixed length and width.

I have written the code so far, but I get an error.
Could someone please tell me how to do this?

        protected override void OnMouseDown(MouseEventArgs arg)
        {
            IActiveView pActiveView = (IActiveView)ArcMap.Document.FocusMap;
            //
            IPoint pt = pActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(arg.X, arg.Y);
            IRasterLayer pRasterLay = (IRasterLayer)ArcMap.Document.FocusMap.get_Layer(0);
            IdentifyPixelValue(pRasterLay.Raster, pt.X, pt.Y);
        }

        public static void IdentifyPixelValue(IRaster raster, double xMap, double yMap)
        {
            IRaster2 raster2 = (IRaster2)raster;
            int col = raster2.ToPixelColumn(xMap);
            int row = raster2.ToPixelRow(yMap);
            //
            object pixelValue = (object)raster2.GetPixelValue(0, col, row);

            if (pixelValue == null)
            {
                //No Data
                System.Windows.Forms.MessageBox.Show("No Data");
            }
            else
            {
                //
                System.Windows.Forms.MessageBox.Show(pixelValue.ToString());
                System.Windows.Forms.MessageBox.Show(col.ToString() + ", " + row.ToString());
            }

            IEnvelope newExtent = new EnvelopeClass();

            envelope.XMin = xMap - 1024;

            envelope.XMax = xMap + 1024;

            envelope.YMin = yMap - 1024;

            envelope.YMax = yMap + 1024;

            clip = IRasterGeometryProc.Clip(envelope, raster);

        }


问:
Identify older, simple compression routine
I'm trying to figure out how a compression routine from 30 years ago works, and it looks fairly simple.

Let's say I have an array of 240 bytes, representing 120 unsigned short values. Keeping the array really simple, it's the same 6 consecutive values (12 bytes) repeated 20 times.

We have {97 02   98 02   99 02   9A 02   9B 02   9C 02}, twenty times, giving:

```<code>97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
</code>```

When compressed, the following is the output:

```<code>97 02   98 02   99 02   9A 02   9B 02   9C 02
0C 7C   0C 7C   0C 7C   0C 7C   0C 7C   0C 7C   0C 7C   0C 64
</code>```

Every array compressed with this method also marks the end with 0xFFFF.

I've tried looking at the 0x7C0C and 0x640C values in multiple different ways, and done a fair amount of research on the implementation of various older compression routines, but haven't found one which performs this compression.

Body:
I'm trying to figure out how a compression routine from 30 years ago works, and it looks fairly simple.

Let's say I have an array of 240 bytes, representing 120 unsigned short values. Keeping the array really simple, it's the same 6 consecutive values (12 bytes) repeated 20 times.

We have {97 02   98 02   99 02   9A 02   9B 02   9C 02}, twenty times, giving:

97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02
97 02   98 02   99 02   9A 02   9B 02   9C 02

When compressed, the following is the output:

97 02   98 02   99 02   9A 02   9B 02   9C 02
0C 7C   0C 7C   0C 7C   0C 7C   0C 7C   0C 7C   0C 7C   0C 64

Every array compressed with this method also marks the end with 0xFFFF.

I've tried looking at the 0x7C0C and 0x640C values in multiple different ways, and done a fair amount of research on the implementation of various older compression routines, but haven't found one which performs this compression.


问:
How to change Visual Studio Create Unit Tests default test project
In Visual Studio Community 2022 I can right click on method then select Create Unit Tests then it will pop out a window like below

I can select my test project or create a New Test Project, but the default value of it is always
New Test Project. How to change the default setting from New Test Project to my own test project?


问:
How to convert list written in string back to list?
I have some data as string which contains list of list of data.

data = "[['asdaddas','asdasdasd'],['asdawdasd','asdwdefe']]"

As you can see that this is nested list in string not of type(list()).

I have tried manually using online-json-formatter and copying data from the result and pasting it for assigning it to some variable. like:

data = [['asdaddas','asdasdasd'],['asdawdasd','asdwdefe']]

but here is the issue that this is not how i will be doing it on all iterations. There should be some code to convert it from above mention string type data to list type data.

I hope you guys can help me!

Thanks in advance.


问:
Invalid request, No data was found Roudcube
I am currently facing to issue with Roundcube.
1)The first one is with OS compatibility when I use RoundCube in OS like CentOS or Ubuntu it's the usage count proper but when I use Almalinux or Cloudlinux it shows unknown instead of Usage calculation.
2)The second one is with roundcube_sessid I am using two SQLite DB at a time whenever the user is on the login page I am using the default DB for all the Email users but while posting the data I am justifying their DB path with the login Credentials. And I am getting Invalid Request, No Data was saved error. This is only happening in CentOS and Ubuntu Server but when I use Almulinux for the same it is working properly.

Any solution regarding this.
Thanks in advance.


问:
glVertexAttribPointer fails with GL_INT?
I was trying to add an attribute for material index to each vertex:

```<code>...
glVertexAttribPointer(3, 1, GL_INT, GL_FALSE, sizeof(VertexMaterial), (void*)offsetof(VertexMaterial, material_id));
...
</code>```

But the material_id read in the vertex shader was totally wrong:

```<code>layout(location = 3) in int aMaterial;
</code>```

Then I replaced glVertexAttribPointer with glVertexAttribIPointer:

```<code>glVertexAttribIPointer(3, 1, GL_INT, sizeof(VertexMaterial), (void*)offsetof(VertexMaterial, material_id));
</code>```

I modified nowhere else, but the vertex shader successfully got the right value for material_id this time.

But the OpenGL doc says that both glVertexAttribPointer and glVertexAttribIPointer can accept GL_INT (https://docs.gl/gl4/glVertexAttribPointer):
doc

So what's wrong in my code ?

Body:
I was trying to add an attribute for material index to each vertex:

...
glVertexAttribPointer(3, 1, GL_INT, GL_FALSE, sizeof(VertexMaterial), (void*)offsetof(VertexMaterial, material_id));
...

But the material_id read in the vertex shader was totally wrong:

layout(location = 3) in int aMaterial;

Then I replaced glVertexAttribPointer with glVertexAttribIPointer:

glVertexAttribIPointer(3, 1, GL_INT, sizeof(VertexMaterial), (void*)offsetof(VertexMaterial, material_id));

I modified nowhere else, but the vertex shader successfully got the right value for material_id this time.

But the OpenGL doc says that both glVertexAttribPointer and glVertexAttribIPointer can accept GL_INT (https://docs.gl/gl4/glVertexAttribPointer):
doc

So what's wrong in my code ?


问:
Custom prefix for Connect Direct pnum
Is there a way to specify a custom numerical prefix to the pnum that gets generated by the CD process? For example, if I set a custom prefix of 123 then the first process's pnum would be 1231. This is for CD 6.1 running on RHEL7.

I couldn't find any information about how to manipulate the generated pnum in the IBM documentation.

Title: Custom prefix for Connect Direct pnum


问:
Can I run Azure Data Studio as another user?
Is there any equivalent to this

```<code>RUNAS /user:DOMAIN\username "C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Ssms.exe"
</code>```

in order for me to run ADS as another user?
well, I tried modifying that command and point that to the executable file of ADS but It's not working.

Body:
Is there any equivalent to this

RUNAS /user:DOMAIN\username "C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Ssms.exe"

in order for me to run ADS as another user?
well, I tried modifying that command and point that to the executable file of ADS but It's not working.


问:
How do I show a message by opening a kendo popup?
In my form, there are 3 input values in the period line. If all of them are empty or zero, I want to give a warning in the kendo popup before clicking the button.If a non-zero value is entered for any of them, it will not give an error.
3 input values for period in form

My code is as below :

```<code><form id="formPlan" onsubmit="return hasValue()" class="form-horizontal form-group-sm" data-toggle="validator">
<div class="form-group required">
 <label for="inPeriod" class="control-label col-xs-3">@ln.label_period:</label>
    <div class="col-xs-4 input">
       <div class="row">
          <div class="col-xs-4">
              <input type="number" id="inPeriod_day" name="Period" class="form-control"  max="365" step="any" maxlength="2" style="width:100%">
           </div>
          <div class="col-xs-4">
              <input type="number" id="inPeriod_hour" name="PeriodHour" class="form-control"  max="23" step="any" maxlength="2">
           </div>
          <div class="col-xs-4">
              <input type="number" id="inPeriod_minute" name="PeriodMinute" class="form-control"  max="59" step="any" maxlength="2">
           </div>
      </div>
  </div>
</form>
<div id="popup">Periods can't be blank!</div>
</code>```
```<code><script>
    $("#popup").kendoPopup({
        animation: {
            close: {
                effects: "fadeOut zoom:out",
                duration: 300
            },
            open: {
                effects: "fadeIn zoom:in",
                duration: 300
            }
        }
    });

    function hasValue() {
        var period = document.forms["formPlan"]["Period"].value;
        var periodhour = document.forms["formPlan"]["PeriodHour"].value;
        var periodminute = document.forms["formPlan"]["PeriodMinute"].value;
        if (!period && !periodhour && !periodminute) {
            $("#popup").data("kendoPopup").open();
            return false;
        }
        return true;
    }
</script>
</code>```

Body:
In my form, there are 3 input values in the period line. If all of them are empty or zero, I want to give a warning in the kendo popup before clicking the button.If a non-zero value is entered for any of them, it will not give an error.
3 input values for period in form

My code is as below :

<form id="formPlan" onsubmit="return hasValue()" class="form-horizontal form-group-sm" data-toggle="validator">

 @ln.label_period:

              <input type="number" id="inPeriod_day" name="Period" class="form-control"  max="365" step="any" maxlength="2" style="width:100%">

              <input type="number" id="inPeriod_hour" name="PeriodHour" class="form-control"  max="23" step="any" maxlength="2">

              <input type="number" id="inPeriod_minute" name="PeriodMinute" class="form-control"  max="59" step="any" maxlength="2">

</form>

Periods can't be blank!


问:
Arraylist value changes to last entered
In my kotlin project there is an arraylist in another one.When i enter values to array list it changes to last entered value . My code and o/p given below.

Question.class

`data class Question(

```<code>var id: Int,
var question: String,
var Answers:ArrayList<String>,
var correct: Int
</code>```

)`

Main activity

```<code>       if(it!!.exists())
        {
            for (h in it.children){

                var ans : ArrayList<String> = ArrayList()

               for (g in h.children)
               {
                   when (g.key) {
                       "id" -> {
                           id = g.value.toString().toInt()
                       }
                       "question" -> {
                           ques = g.value.toString()
                       }
                       "correct" -> {
                           correct = g.value.toString().toInt()
                       }
                       "Answers" -> {
                           answers.clear()

                           for (i in g.children) {
                               answers.add(i.value.toString())
                           }
                           ans = answers
                       }
                   }

               }
                Log.d("12345",id.toString()+ques+correct+ans.toString())

                var card = Question(id,ques,ans,correct)
                questions.add(card)
                Log.d("12345",questions.toString())
</code>```

Output :
2023-01-12 11:27:30.716 27073-27073/com.example.firebase D/12345: 1Who was your favorite teacher ?1[pooja, anjali, rohit, jose]

2023-01-12 11:27:30.717 27073-27073/com.example.firebase D/12345: [Question(id=1, question=Who was your favorite teacher ?, Answers=[pooja, anjali, rohit, jose], correct=1)]

2023-01-12 11:27:30.718 27073-27073/com.example.firebase D/12345: 2What is one of your favorite smells?2[rose, lotus, sunflower]

2023-01-12 11:27:30.718 27073-27073/com.example.firebase D/12345: [Question(id=1, question=Who was your favorite teacher ?, Answers=[rose, lotus, sunflower], correct=1), Question(id=2, question=What is one of your favorite smells?, Answers=[rose, lotus, sunflower], correct=2)]

2023-01-12 11:27:30.719 27073-27073/com.example.firebase D/12345: 3What is your fav song?3[maroon, bts, back street biys]

2023-01-12 11:27:30.719 27073-27073/com.example.firebase D/12345: [Question(id=1, question=Who was your favorite teacher ?, Answers=[maroon, bts, back street biys], correct=1), Question(id=2, question=What is one of your favorite smells?, Answers=[maroon, bts, back street biys], correct=2), Question(id=3, question=What is your fav song?, Answers=[maroon, bts, back street biys], correct=3)]

2023-01-12 11:27:30.722 27073-27073/com.example.firebase D/12345: 4If you were a vegetable, what vegetable would you be?4[onion, pottato, brinjal, tomato]

2023-01-12 11:27:30.723 27073-27073/com.example.firebase D/12345: [Question(id=1, question=Who was your favorite teacher ?, Answers=[onion, pottato, brinjal, tomato], correct=1), Question(id=2, question=What is one of your favorite smells?, Answers=[onion, pottato, brinjal, tomato], correct=2), Question(id=3, question=What is your fav song?, Answers=[onion, pottato, brinjal, tomato], correct=3), Question(id=4, question=If you were a vegetable, what vegetable would you be?, Answers=[onion, pottato, brinjal, tomato], correct=4)]

Reference : ArrayList elements changed to last entry every time

How move first item of arraylist to last position?

Title: Arraylist value changes to last entered

Body:
In my kotlin project there is an arraylist in another one.When i enter values to array list it changes to last entered value . My code and o/p given below.

Question.class

`data class Question(

var id: Int,
var question: String,
var Answers:ArrayList<String>,
var correct: Int

)`

Main activity

       if(it!!.exists())
        {
            for (h in it.children){

                var ans : ArrayList<String> = ArrayList()

               for (g in h.children)
               {
                   when (g.key) {
                       "id" -> {
                           id = g.value.toString().toInt()
                       }
                       "question" -> {
                           ques = g.value.toString()
                       }
                       "correct" -> {
                           correct = g.value.toString().toInt()
                       }
                       "Answers" -> {
                           answers.clear()

                           for (i in g.children) {
                               answers.add(i.value.toString())
                           }
                           ans = answers
                       }
                   }

               }
                Log.d("12345",id.toString()+ques+correct+ans.toString())

                var card = Question(id,ques,ans,correct)
                questions.add(card)
                Log.d("12345",questions.toString())

Output :
2023-01-12 11:27:30.716 27073-27073/com.example.firebase D/12345: 1Who was your favorite teacher ?1[pooja, anjali, rohit, jose]

2023-01-12 11:27:30.717 27073-27073/com.example.firebase D/12345: [Question(id=1, question=Who was your favorite teacher ?, Answers=[pooja, anjali, rohit, jose], correct=1)]

2023-01-12 11:27:30.718 27073-27073/com.example.firebase D/12345: 2What is one of your favorite smells?2[rose, lotus, sunflower]

2023-01-12 11:27:30.718 27073-27073/com.example.firebase D/12345: [Question(id=1, question=Who was your favorite teacher ?, Answers=[rose, lotus, sunflower], correct=1), Question(id=2, question=What is one of your favorite smells?, Answers=[rose, lotus, sunflower], correct=2)]

2023-01-12 11:27:30.719 27073-27073/com.example.firebase D/12345: 3What is your fav song?3[maroon, bts, back street biys]

2023-01-12 11:27:30.719 27073-27073/com.example.firebase D/12345: [Question(id=1, question=Who was your favorite teacher ?, Answers=[maroon, bts, back street biys], correct=1), Question(id=2, question=What is one of your favorite smells?, Answers=[maroon, bts, back street biys], correct=2), Question(id=3, question=What is your fav song?, Answers=[maroon, bts, back street biys], correct=3)]

2023-01-12 11:27:30.722 27073-27073/com.example.firebase D/12345: 4If you were a vegetable, what vegetable would you be?4[onion, pottato, brinjal, tomato]

2023-01-12 11:27:30.723 27073-27073/com.example.firebase D/12345: [Question(id=1, question=Who was your favorite teacher ?, Answers=[onion, pottato, brinjal, tomato], correct=1), Question(id=2, question=What is one of your favorite smells?, Answers=[onion, pottato, brinjal, tomato], correct=2), Question(id=3, question=What is your fav song?, Answers=[onion, pottato, brinjal, tomato], correct=3), Question(id=4, question=If you were a vegetable, what vegetable would you be?, Answers=[onion, pottato, brinjal, tomato], correct=4)]

Reference : ArrayList elements changed to last entry every time

How move first item of arraylist to last position?


问:
UserWay is updating my span element id to random id am using https://userway.org/ on my app
I added the userway accessibility plugin but it caused issue with my one of span element tag updated its id to random.i debugged it this plugin has a function of generatedRandomId but could not able to prevent it why it is updating my span existing id to new one?

I don't know how to prevent plugin from updating my element existing id exists with room-count of my span tag.
my original html

```<code> <div id="rooms">
              <div class="dash"></div>
              <label>Rooms</label> <span id="room-count">1</span>
              <select class="custom-select" name="numBeds" id="selected-beds">
                <option value="1" selected>1</option>
              </select>
              <div class="icon" id="beds"><img src="~/images/bed.png" /></div>
              <i class="fa fa-angle-down chevron"></i>
            </div>
</code>```

plugin updated html

```<code><div id="rooms">
              <div class="dash"></div>
              <label>Rooms</label> <span id="uw5c59b57">1</span>
              <select class="custom-select" name="numBeds" id="selected-beds" aria-labelledby="uw5c59b57" aria-label="rooms" data-uw-rm-form="fx">
                <option value="1" selected="">1</option>
                <option value="2">2</option>
              </select>
              <div class="icon" id="beds"><img src="/images/bed.png" role="presentation" data-uw-rm-ima="un"></div>
              <i class="fa fa-angle-down chevron"></i>
            </div>
</code>```

Body:
I added the userway accessibility plugin but it caused issue with my one of span element tag updated its id to random.i debugged it this plugin has a function of generatedRandomId but could not able to prevent it why it is updating my span existing id to new one?

I don't know how to prevent plugin from updating my element existing id exists with room-count of my span tag.
my original html

              Rooms 1
              <select class="custom-select" name="numBeds" id="selected-beds">
                <option value="1" selected>1</option>
              </select>

plugin updated html

              Rooms 1
              <select class="custom-select" name="numBeds" id="selected-beds" aria-labelledby="uw5c59b57" aria-label="rooms" data-uw-rm-form="fx">
                <option value="1" selected="">1</option>
                <option value="2">2</option>
              </select>


问:
Count the number of vowels in a file
Im unable to count the number of vowels in this program i created. Im unsure why it doesnt work properly

Here is my program

```<code>myfile = open("student.txt","r")
ch = ""
vcount = 0
while ch:
    ch = myfile.read(1)
    if ch in ["a","A","e","E","i","I","o","O","u","U"]:
        vcount +=1
print(vcount)
</code>```

suppose the contents of student.txt was:

Ethan,Jordan,Kevin

im expecting the program to count the vowel so it should print 6. I tried different read methods and different loops but the result wasnt any better

Title: Count the number of vowels in a file

Body:
Im unable to count the number of vowels in this program i created. Im unsure why it doesnt work properly

Here is my program

myfile = open("student.txt","r")
ch = ""
vcount = 0
while ch:
    ch = myfile.read(1)
    if ch in ["a","A","e","E","i","I","o","O","u","U"]:
        vcount +=1
print(vcount)

suppose the contents of student.txt was:

Ethan,Jordan,Kevin

im expecting the program to count the vowel so it should print 6. I tried different read methods and different loops but the result wasnt any better


问:
how to read or display epub file from aws s3 bucket without downloading?
I have a set content type like this but it isn't work for me in epub case</p>
```<code> const params = {
      Bucket: AWS_BUCKET,
      Key: isEpub ? `common/files/epubs/${contenttype}` : `common/files/docs/${contenttype}`,
      Body: fileStream,
      ContentEncoding: 'base64',
      ContentDisposition: 'inline',
      ContentType: file.type,
      ACL: 'public-read'
    }
</code>```

Body:
I have a set content type like this but it isn't work for me in epub case

 const params = {
      Bucket: AWS_BUCKET,
      Key: isEpub ? `common/files/epubs/${contenttype}` : `common/files/docs/${contenttype}`,
      Body: fileStream,
      ContentEncoding: 'base64',
      ContentDisposition: 'inline',
      ContentType: file.type,
      ACL: 'public-read'
    }


问:
UnhandledPromiseRejection: The promise rejected with the reason "No local installation of Chrome was found." , "Windows_Build_Container"
UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "No local installation of Chrome was found.".] {
code: 'ERR_UNHANDLED_REJECTION'

I'm trying to execute the project through OneBranch Pipeline with "windows_build_container" mode.
Can anyone help how to install chrome on container.


问:
Where can we find the "jboss.server.log.dir" in the wildfly configuration and how can override that variable or path ? Please mention therootpath
Instead of changing in the domain.xml and the host.xml we need to edit in the  root path and if we try to change in the root path where it is setting the default path we use that and no need to edit all the configurations

I tried in the domain.xml and host.xml it is working and but all the remaining logs it is taking from the "Jboss.server.log.dir" , but in future we want to change again we need to  change all the log config files
, i need to know  where the exactly the "Jboss.server.log.dir" is getting intiated , Could please any one help this one


问:
Querydsl generate type that i not expected in Qclass
```<code>@Document
class Sample(
    val migrated: Migrated?
) {

    fun isMigrated():Boolean = migrated != null

    class Migrated(
        val update: Boolean
    )
}
</code>```

i'm using spring-data-mongo and querydsl recently

this is my class and when i run querydsl to make Qclass of Sample class (QSample)

in Qclass's migrated property type si BooleanPath which is not i expected one QMigrate class

but, when i delete or rename function isMigrated() it works what i expect

can anybody let me know why isMigrated() function affect to Qclass generating??

Body:
@Document
class Sample(
    val migrated: Migrated?
) {

    fun isMigrated():Boolean = migrated != null

    class Migrated(
        val update: Boolean
    )
}

i'm using spring-data-mongo and querydsl recently

this is my class and when i run querydsl to make Qclass of Sample class (QSample)

in Qclass's migrated property type si BooleanPath which is not i expected one QMigrate class

but, when i delete or rename function isMigrated() it works what i expect

can anybody let me know why isMigrated() function affect to Qclass generating??


问:
computed filter function in array of names in JS
I created small piece of code to search from given array in search bar. As i unserstood it is better to use computed function over method but when I put function in  it dosen't work and give me an error: Duplicate keys detected: '3'. This may cause an update. So how can I solve it?

My function:

```<code>data() {
    return {
      RMnames: [],
      filteredNames: [
        { name: "Zales", category: "Jewelry", id: 1 },
        { name: "Lux", category: "Jewelry", id: 2 },
        { name: "Edited", category: "Jewelry", id: 3 },
        { name: "Editedsdsdxs", category: "Jewelry", id: 3 },
      ],
      searchTerm: "",
      Names: [],
    };
  },
  computed: {
    filteredFunction() {
      this.Names = this.filteredNames.filter((n) => {
        return n.name.toLowerCase().indexOf(this.searchTerm.toLowerCase()) > -1;
      });
    },
  },
</code>```

My template:

```<code> <v-col align-self="start">
    <v-text-field
      v-model="searchTerm"
      placeholder="Search"
      @input="filteredFunction"
    ></v-text-field>

    <v-card v-for="item in filteredNames" :key="item.id">
      <v-card-title>{{ item.name }}</v-card-title>
    </v-card>
</code>```

Body:
I created small piece of code to search from given array in search bar. As i unserstood it is better to use computed function over method but when I put function in  it dosen't work and give me an error: Duplicate keys detected: '3'. This may cause an update. So how can I solve it?

My function:

data() {
    return {
      RMnames: [],
      filteredNames: [
        { name: "Zales", category: "Jewelry", id: 1 },
        { name: "Lux", category: "Jewelry", id: 2 },
        { name: "Edited", category: "Jewelry", id: 3 },
        { name: "Editedsdsdxs", category: "Jewelry", id: 3 },
      ],
      searchTerm: "",
      Names: [],
    };
  },
  computed: {
    filteredFunction() {
      this.Names = this.filteredNames.filter((n) => {
        return n.name.toLowerCase().indexOf(this.searchTerm.toLowerCase()) > -1;
      });
    },
  },

My template:

 <v-col align-self="start">
    <v-text-field
      v-model="searchTerm"
      placeholder="Search"
      @input="filteredFunction"
    ></v-text-field>

    <v-card v-for="item in filteredNames" :key="item.id">
      <v-card-title>{{ item.name }}</v-card-title>
    </v-card>


问:
Having issues to type text inside a cell text area
I am trying to locate the element and provide my input string but it does not take it.
I am able to click on the element but the input text syntax does not work.

```<code>double Click Element   ${FN1}                   -- Working
Input Text  ${FN1}  Primary Carrier             -- Not Working
Set Element Text    ${FN1}    Primary Carrier   -- Not working
Press Keys  ${FN1} Mike June                    -- Not working
</code>```

Can anyone help how I can get this?

Body:
I am trying to locate the element and provide my input string but it does not take it.
I am able to click on the element but the input text syntax does not work.

double Click Element   ${FN1}                   -- Working
Input Text  ${FN1}  Primary Carrier             -- Not Working
Set Element Text    ${FN1}    Primary Carrier   -- Not working
Press Keys  ${FN1} Mike June                    -- Not working

Can anyone help how I can get this?


问:
Modal Validation with Javascript in laravel form
My code uses a modal for form display, and I want to make the modal unlock when validation is active.
but after i add some javascript function line, it still doesn't work.

```<code>My Modal
<div class="modal fade" id="passwordModal{{Auth::user()->id}}">
<div class="modal-dialog modal-lg-6">
    <div class="modal-content">
        <div class="modal-header">
            <h5 class="modal-title" id="passwordModal">Update Password</h5>
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">×</span>
            </button>
        </div>
        <div class="modal-body">
            <form action="{{ route('password.update') }}" method="POST" enctype="multipart/form-data">
                @csrf
                <div class="content">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="form-group">
                                <input name="current_password" type="password" id="current_password" placeholder="Curent Password" class="form-control @error('current_password') is-invalid @enderror">
                                <span class="text-danger" id="current_passwordError"></span>
                                <div class="invalid-feedback">
                                    @error('current_password')
                                    {{ $message }}
                                    @enderror
                                </div>
                            </div>
                            <div class="form-group">
                                <input name="password" id="password" type="password" placeholder="New Password" class="form-control @error('password') is-invalid @enderror">
                                <span class="text-danger" id="passwordError"></span>
                                <div class="invalid-feedback">
                                    @error('password')
                                    {{ $message }}
                                    @enderror
                                </div>
                            </div>
                            <div class="form-group">
                                <input name="password_confirmation" type="password" id="password_confirmation" placeholder="Confirm New Password" class="form-control @error('password_confirmation') is-invalid @enderror">
                                <span class="text-danger" id="password_confirmationError"></span>
                                <div class="invalid-feedback">
                                    @error('password_confirmation')
                                    {{ $message }}
                                    @enderror
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                        <button type="submit" class="btn btn-primary">Update</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
</code>```

and my function js

```<code><script>
function openModal() {
    $('#passwordModal{{Auth::user()->id}}').modal('show')
}

function storeData() {
    var CSRF_TOKEN = $('meta[name="csrf - token"]').sttr('content');
    var current_password = $('#current_password').val();
    var password = $('#password').val();
    var password_confirmation = $('#password_confirmation').val();

    $('#current_passwordError').addClass('d-none');
    $('#passwordError').addClass('d-none');
    $('#password_confirmationError').addClass('d-none');

    $.ajax({
        type: 'POST',
        url: "{{ route('password.update') }}",
        data: {
            _token: CSRF_TOKEN,
            current_password: current_password,
            password: password,
            password_confirmation: password_confirmation,
        },

        success: function(data) {

        },

        error: function(data) {
            var errors = data.responseJSON;
            if ($.isEmptyObject(errors) == false) {
                $.each(errors.errors, function(key, value) {
                    var ErrorID = '#' + key + 'Error';
                    $(ErrorID).removeClass("d-none");
                    $(ErrorID).text(value)

                })
            }
        }
    });
}
</code>```

is my script correct, or is there another way that is more effective.
before I could use ?
is my script correct, or is there another way that is more effective.

before i was able to handle this case in ci-3, but when i used that code in laravel it didn't work, that's why i tried another way and this is the result.

Body:
My code uses a modal for form display, and I want to make the modal unlock when validation is active.
but after i add some javascript function line, it still doesn't work.

My Modal

id}}">

Update Password

            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                ×
            </button>

            <form action="{{ route('password.update') }}" method="POST" enctype="multipart/form-data">
                @csrf

                                <input name="current_password" type="password" id="current_password" placeholder="Curent Password" class="form-control @error('current_password') is-invalid @enderror">

                                    @error('current_password')
                                    {{ $message }}
                                    @enderror

                                <input name="password" id="password" type="password" placeholder="New Password" class="form-control @error('password') is-invalid @enderror">

                                    @error('password')
                                    {{ $message }}
                                    @enderror

                                <input name="password_confirmation" type="password" id="password_confirmation" placeholder="Confirm New Password" class="form-control @error('password_confirmation') is-invalid @enderror">

                                    @error('password_confirmation')
                                    {{ $message }}
                                    @enderror

                        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                        <button type="submit" class="btn btn-primary">Update</button>

            </form>

and my function js


问:
WebSocket does not connect to nest.js server
I have this code in the chat.gateway.ts file:

```<code>@Injectable()
@WebSocketGateway()
export class ChatGateway {
  @WebSocketServer()
  server: any;

  @SubscribeMessage('message')
  handleMessage(@MessageBody() message: string): void {
    this.server.emit('message', message);
  }
}
</code>```

The app.module.ts file code:

```<code>@Module({
  imports: [
    ConfigModule.forRoot({
      envFilePath: `${process.cwd()}/${process.env.NODE_ENV}.env`,
      isGlobal: true,
    }),
    ChatModule
  ],
  controllers: [AppController],
  providers: [AppService, ChatGateway, UserMiddleware],
})
</code>```

but when I connect from the client side on this URL: ws://192.168.29.88:9000/chat?EIO=4&transport=websocket. This does not work. Am I missing something? If I replace the endpoint chat with socket.io, it connects, but I am unable to send the message, and the server disconnects automatically.

Body:
I have this code in the chat.gateway.ts file:

@Injectable()
@WebSocketGateway()
export class ChatGateway {
  @WebSocketServer()
  server: any;

  @SubscribeMessage('message')
  handleMessage(@MessageBody() message: string): void {
    this.server.emit('message', message);
  }
}

The app.module.ts file code:

@Module({
  imports: [
    ConfigModule.forRoot({
      envFilePath: `${process.cwd()}/${process.env.NODE_ENV}.env`,
      isGlobal: true,
    }),
    ChatModule
  ],
  controllers: [AppController],
  providers: [AppService, ChatGateway, UserMiddleware],
})

but when I connect from the client side on this URL: ws://192.168.29.88:9000/chat?EIO=4&transport=websocket. This does not work. Am I missing something? If I replace the endpoint chat with socket.io, it connects, but I am unable to send the message, and the server disconnects automatically.


问:
remove or close specific images in a multi uploaded images functionality
Here I have multi uploading image functionality.

So here if the user selects Multiple images so using the below JavaScript code we can upload multiple images.

But here I want to enhance the functionality and the uploaded images should have a cross icon like close the image if the user doesn't want to upload the specific image he will be able to delete or remove the desired image, not all the image which image is not the good user can able to remove that image.

```<code> <input id="files" type="file" name="filename" accept="image/*" multiple>
            <div id="preview"><span id="cross">×</span>
            </div>

const prev = (file) => {
  const fr = new FileReader();
  fr.onload = () => {
    const img = document.createElement("img");
    img.src = fr.result;
    document.querySelector('#preview').append(img);
  };
  fr.readAsDataURL(file);
};
const files = document.querySelector("#files");
files.addEventListener("change", (a) => {
  if (!a.target.files) return;
  [...a.target.files].forEach(prev);
});
</code>```

Body:
Here I have multi uploading image functionality.

So here if the user selects Multiple images so using the below JavaScript code we can upload multiple images.

But here I want to enhance the functionality and the uploaded images should have a cross icon like close the image if the user doesn't want to upload the specific image he will be able to delete or remove the desired image, not all the image which image is not the good user can able to remove that image.

 <input id="files" type="file" name="filename" accept="image/*" multiple>

×

const prev = (file) => {
  const fr = new FileReader();
  fr.onload = () => {
    const img = document.createElement("img");
    img.src = fr.result;
    document.querySelector('#preview').append(img);
  };
  fr.readAsDataURL(file);
};
const files = document.querySelector("#files");
files.addEventListener("change", (a) => {
  if (!a.target.files) return;
  [...a.target.files].forEach(prev);
});


问:
IPA Binary Misconfiguration
During static analysis of an iOS IPA binary, it was found that the application contains misconfigured settings that may affect the security of the application. The following flags were misconfigured:

• Rpath: The "Runpath Search Path" flag instructs the dynamic linker to use an ordered list of paths to determine the location of a dynamic library. Enabling this flag may allow an attacker to place a malicious dynamic library in the location of one of the initially defined paths, allowing for hijacking.

It is recommended to reconfigure the application binary to ensure it has disabled the Runpath Search Path(@rpath). This can be performed by using the "-rpath" flag during compilation.

How to fix the IPA Binary Misconfiguration?

Title: IPA Binary Misconfiguration


问:
Android resource shrinking removes refs.xml from external library
i have made a library where i am using a refs.xml files in the values folder, which overrides a material resource file using tools:override to be able to rearrange the dialog buttons.

```<code><resources xmlns:tools="http://schemas.android.com/tools">
    <item name="mtrl_alert_dialog_actions" type="layout" tools:override="true">@layout/mtrl_alert_dialog_actions_custom</item>
</resources>
</code>```

Using this library and building the app in debug mode without shrinking the resources, everything works properly.
As soon as i enable resource shrinking, the refs.xml file is removed or not considered anymore.

When i place the refs.xml inside my app, the mtrl_alert_dialog_actions is overriden by mtrl_alert_dialog_actions_custom too.

But how can i achieve that i do not need to place the refs.xml file inside my app and tell the app to use the refs.xml file from the library when shrinkResources is enabled?

The build outputs do not mention anything that the refs.xml from the library is removed.

Body:
i have made a library where i am using a refs.xml files in the values folder, which overrides a material resource file using tools:override to be able to rearrange the dialog buttons.

<resources xmlns:tools="http://schemas.android.com/tools">
    <item name="mtrl_alert_dialog_actions" type="layout" tools:override="true">@layout/mtrl_alert_dialog_actions_custom</item>
</resources>

Using this library and building the app in debug mode without shrinking the resources, everything works properly.
As soon as i enable resource shrinking, the refs.xml file is removed or not considered anymore.

When i place the refs.xml inside my app, the mtrl_alert_dialog_actions is overriden by mtrl_alert_dialog_actions_custom too.

But how can i achieve that i do not need to place the refs.xml file inside my app and tell the app to use the refs.xml file from the library when shrinkResources is enabled?

The build outputs do not mention anything that the refs.xml from the library is removed.


问:
How can I make ID field in MySQL immutable
Is there are way to make ID fiels in MySql immutable?
It's possible in postgreSQL using PGAdmin for example.

ID field sets as primary key and auto incr but can be changed manually.


问:
Get number of employee group by division or department from BambooHR using Powershell
So it is my fist time working with BambooHR and I have basic knowledge on using Powershell.

I have task the required me to calculate the retention rate of the staff from each division on the company.

I want first to get number of employees per each division.

I have tried this:

```<code>$headers=@{}
$headers.Add("accept", "application/json")
$headers.Add("authorization", "Basic api")
$response = Invoke-WebRequest -Uri 'https://api.bamboohr.com/api/gateway.php/company/v1/employees/150/?fields=division' -Method GET -Headers $headers
$response
</code>```

Result:

```<code>Content       : {"id":"150","division":"######"}
</code>```

However it retrieve only one one employee even if I remove the id from the url. And it's not what I am looking for, and I don't have idea on how to write it. It should return the number of employees in each division.

Body:
So it is my fist time working with BambooHR and I have basic knowledge on using Powershell.

I have task the required me to calculate the retention rate of the staff from each division on the company.

I want first to get number of employees per each division.

I have tried this:

$headers=@{}
$headers.Add("accept", "application/json")
$headers.Add("authorization", "Basic api")
$response = Invoke-WebRequest -Uri 'https://api.bamboohr.com/api/gateway.php/company/v1/employees/150/?fields=division' -Method GET -Headers $headers
$response

Result:

Content       : {"id":"150","division":"######"}

However it retrieve only one one employee even if I remove the id from the url. And it's not what I am looking for, and I don't have idea on how to write it. It should return the number of employees in each division.