问:
MSYS2: Wrong pkg-config.exe path on Meson
I want to cross-compile a program (QEMU) in MSYS2 using Meson.
During the configuration phase Meson throw an error for a missing dependency

```<code>../meson.build:553:2: ERROR: Dependency "pixman-1" not found, tried pkgconfig
</code>```

I checked the log and I got

```<code>...
Determining dependency 'pixman-1' with pkg-config executable 'C:\\msys64\\usr\\bin/pkg-config.EXE'
env[PKG_CONFIG_PATH]: C:\msys64\mingw64\lib\pkgconfig;C:\msys64\mingw64\share\pkgconfig
env[PKG_CONFIG_SYSTEM_INCLUDE_PATH]: C:/msys64/mingw64/include
env[PKG_CONFIG_SYSTEM_LIBRARY_PATH]: C:/msys64/mingw64/lib
Called `C:\msys64\usr\bin/pkg-config.EXE --modversion pixman-1` -> 1

Run-time dependency pixman-1 found: NO (tried pkgconfig)

../meson.build:553:2: ERROR: Dependency "pixman-1" not found, tried pkgconfig
...
</code>```

The path to the pkg-config executable uses the Windows format and this is not valid in UNIX.

How can I update the path using the correct UNIX format? Is it a Meson or MSYS2 error?

Thanks!

Body:
I want to cross-compile a program (QEMU) in MSYS2 using Meson.
During the configuration phase Meson throw an error for a missing dependency

../meson.build:553:2: ERROR: Dependency "pixman-1" not found, tried pkgconfig

I checked the log and I got

...
Determining dependency 'pixman-1' with pkg-config executable 'C:\\msys64\\usr\\bin/pkg-config.EXE'
env[PKG_CONFIG_PATH]: C:\msys64\mingw64\lib\pkgconfig;C:\msys64\mingw64\share\pkgconfig
env[PKG_CONFIG_SYSTEM_INCLUDE_PATH]: C:/msys64/mingw64/include
env[PKG_CONFIG_SYSTEM_LIBRARY_PATH]: C:/msys64/mingw64/lib
Called `C:\msys64\usr\bin/pkg-config.EXE --modversion pixman-1` -> 1

Run-time dependency pixman-1 found: NO (tried pkgconfig)

../meson.build:553:2: ERROR: Dependency "pixman-1" not found, tried pkgconfig
...

The path to the pkg-config executable uses the Windows format and this is not valid in UNIX.

How can I update the path using the correct UNIX format? Is it a Meson or MSYS2 error?

Thanks!


来源: stackexchange

问:
App redirects PUT method (Laravel + VUE3 + inertia)
From Ideas/Show.vue component I am updating the idea entry. Selected approach:

```<code><script>
    import { Head, useForm } from '@inertiajs/inertia-vue3';
    export default {
        props: {
            idea: {
                type: Object,
                required: true,
            },
        },
        data() {
            return {
                ideaEditForm: useForm({
                    title: this.idea.title,
                    description: this.idea.description,
                }),
                edit: false,
            }
        },
        methods: {
            cancelEdit() {
                this.edit = false;
                this.ideaEditForm.title = this.idea.title;
                this.ideaEditForm.description = this.idea.description;
            },

            updateIdea() {
                this.ideaEditForm.put(route('ideas.update', this.idea.id), {
                    onSuccess: () => {
                        alertify.success('Success!');
                        this.ideaEditForm.reset();
                    },
                });

            },
        },
    }
</script>
</code>```

the controller update method:

```<code>public function update(Idea $idea, UpdateIdeaRequest $request) {
    $idea->update($request->validated());
    return redirect()->back();
}
</code>```

When I update idea I get error. The ideas/1/8 method is not supported for route PUT. Supported methods: GET, HEAD. Why is it using PUT method? I thought maybe redirect()->back()
has some quirks I am unaware about, but same thing happens with return redirect()->route('ideas.show', [$idea->information_system_id, $idea->id]);

ContentLicense: CC BY-SA 4.0

Body:
From Ideas/Show.vue component I am updating the idea entry. Selected approach:

the controller update method:

public function update(Idea $idea, UpdateIdeaRequest $request) {
    $idea->update($request->validated());
    return redirect()->back();
}

When I update idea I get error. The ideas/1/8 method is not supported for route PUT. Supported methods: GET, HEAD. Why is it using PUT method? I thought maybe redirect()->back()
has some quirks I am unaware about, but same thing happens with return redirect()->route('ideas.show', [$idea->information_system_id, $idea->id]);


问:
Google App Script "Exceeded Execution time" on simple function
I am writing an App Script embedded in Google sheets so the maximum execution time is 30s. When I try to run the function it always returns an error saying the execution time was exceeded. However when I run the function in a online compiler for javascript it takes less than a second to run. I am pretty sure that the problem are the two embedded while loops, but I don't know how I could get rid of them without sacrificing the functionality of my function.
I am also surprised that it takes so long to run this function as it seems quite simple to me. Is app script this slow?
Can someone please explain why it takes so long and what steps I could take to improve the speed of my function without sacrificing functionality?

```<code>function counter(input,input2) {
var mx=input[0];
  var my=input[1];
  var links=input2[0];
  var unten=input2[1];

  // distance
  var xmin=0.3;
  var ymin=0.3;

  // size of object
  var xlength=mx;
  var ylength=my;

  var counter=0
  var pvx1={}
  var pvy1={}

  //Startposition x
  var xPosition=xmin;

  while (xPosition<=(unten-xlength-xmin)){
    var yPosition=ymin;
    while (yPosition<=(links-ylength-ymin)){

      counter=counter+1;
      yPosition=yPosition+ylength;

    }
    xPosition=xPosition+xlength;
  }

return counter
}
</code>```

I'm trying to stack rectangles into a bigger rectangle and count the amount that fits in. I'm starting in the bottom left corner and fill up each column form bottom to top and then continue in the row.
For a later application I need more than just the number of rectangles I can fit in, I also need their position within the other rectangle.

Body:
I am writing an App Script embedded in Google sheets so the maximum execution time is 30s. When I try to run the function it always returns an error saying the execution time was exceeded. However when I run the function in a online compiler for javascript it takes less than a second to run. I am pretty sure that the problem are the two embedded while loops, but I don't know how I could get rid of them without sacrificing the functionality of my function.
I am also surprised that it takes so long to run this function as it seems quite simple to me. Is app script this slow?
Can someone please explain why it takes so long and what steps I could take to improve the speed of my function without sacrificing functionality?

function counter(input,input2) {
var mx=input[0];
  var my=input[1];
  var links=input2[0];
  var unten=input2[1];

  // distance
  var xmin=0.3;
  var ymin=0.3;

  // size of object
  var xlength=mx;
  var ylength=my;

  var counter=0
  var pvx1={}
  var pvy1={}

  //Startposition x
  var xPosition=xmin;

  while (xPosition<=(unten-xlength-xmin)){
    var yPosition=ymin;
    while (yPosition<=(links-ylength-ymin)){

      counter=counter+1;
      yPosition=yPosition+ylength;

    }
    xPosition=xPosition+xlength;
  }

return counter
}

I'm trying to stack rectangles into a bigger rectangle and count the amount that fits in. I'm starting in the bottom left corner and fill up each column form bottom to top and then continue in the row.
For a later application I need more than just the number of rectangles I can fit in, I also need their position within the other rectangle.


问:
Is there a Custom MenuStrip with all styling properties?
Is there a custom MenuStrip with all styling properties?

I have been having a really hard time customing the default Menu Strip.

(Winforms)


问:
Can I remove symlinks without deleting the files?
I was following the Dotfiles exercises in the CLE MIT Missing Semester course and I messed up. I created a dotfiles directory and moved all the dotfiles in my home folder to that directory, then I ran the following code from dotfiles:

```<code>for filename in dotfiles
do
ln -s $filename dotfiles/$filename
end
</code>```

Basically, I symlinked everything in the wrong direction. Now all those dotfiles in my home directory are useless, and all the dotfiles in the dotfiles directory are pointless because they don't actually point to anything.
Is there any solution to this problem that doesn't involve deleting all my dotfiles and reinstalling everything? I'm using macOS Monterey.

I tried using the unlink command but that just deletes the files. I'm looking for a solution where I can keep all my dotfiles and just remove the symlinks.

Body:
I was following the Dotfiles exercises in the CLE MIT Missing Semester course and I messed up. I created a dotfiles directory and moved all the dotfiles in my home folder to that directory, then I ran the following code from dotfiles:

for filename in dotfiles
do
ln -s $filename dotfiles/$filename
end

Basically, I symlinked everything in the wrong direction. Now all those dotfiles in my home directory are useless, and all the dotfiles in the dotfiles directory are pointless because they don't actually point to anything.
Is there any solution to this problem that doesn't involve deleting all my dotfiles and reinstalling everything? I'm using macOS Monterey.

I tried using the unlink command but that just deletes the files. I'm looking for a solution where I can keep all my dotfiles and just remove the symlinks.


问:
Flat File Staging For Format Conversion:
I have a code the converts data from one format to another by inserting the data manually. I need assistance on how to stage the flat/txt file and apply the same code to come up with same results.

DBFiddle https://dbfiddle.uk/cwfvntlt

```<code>-- DDL and sample data population, start
DECLARE @tbl TABLE (Token VARCHAR(1024));
INSERT @tbl (Token) VALUES
('{1:F01SBZAZAJJXXXX9999999999}{2:I940SBICMWMXXXXXN}{4:'),
(':20:D424A100110011E4'),
(':25:020083203'),
(':28C:49/1'),
(':60F:C140106ZAR1029873,62'),
(':61:1401060106DR5000,NTRF99999999//NONREF20140106-13175-016050001844421'),
(':86:/PREF/ZA000520CATS THIRD PARTY PAYMENT'),
(':62F:C140106ZAR0,00'),
('-}'),
('{1:F01SBZAZAJJXXXX9999999999}{2:I940SBICMWMXXXXXN}{4:'),
(':20:D3DE7040110011E4'),
(':25:020083204'),
(':28C:51/1'),
(':60F:C140106NAD1030073,'),
(':61:1401060106DR5000,NTRF20140106-13175-0//NONREF20140106-13175-016050001844421'),
(':86:/PREF/NA000520TRANSFER'),
(':62F:C140106NAD0,00'),
('-}');
-- DDL and sample data population, end

DECLARE @group INT = (SELECT COUNT(*) FROM @tbl) / 9

;WITH rs AS
(
SELECT *
    , _token = PARSENAME(REPLACE(token,':','.'),1)
    , seq = (ROW_NUMBER() OVER (ORDER BY (SELECT NULL))) % 9
    , grp = NTILE(@group) OVER (ORDER BY (SELECT NULL))
FROM @tbl
)
SELECT DISTINCT [20] = MAX(IIF(seq = 2, _token, '')) OVER (PARTITION BY grp)
    , [25] = MAX(IIF(seq = 3, _token, '')) OVER (PARTITION BY grp)
    , [28C] = MAX(IIF(seq = 4, _token, '')) OVER (PARTITION BY grp)
    , [60F] = MAX(IIF(seq = 5, _token, '')) OVER (PARTITION BY grp)
    , [61] = MAX(IIF(seq = 6, _token, '')) OVER (PARTITION BY grp)
    , [86] = MAX(IIF(seq = 7, _token, '')) OVER (PARTITION BY grp)
    , [62F] = MAX(IIF(seq = 8, _token, '')) OVER (PARTITION BY grp)
FROM rs;
</code>```

Expected results

Body:
I have a code the converts data from one format to another by inserting the data manually. I need assistance on how to stage the flat/txt file and apply the same code to come up with same results.

DBFiddle https://dbfiddle.uk/cwfvntlt

-- DDL and sample data population, start
DECLARE @tbl TABLE (Token VARCHAR(1024));
INSERT @tbl (Token) VALUES
('{1:F01SBZAZAJJXXXX9999999999}{2:I940SBICMWMXXXXXN}{4:'),
(':20:D424A100110011E4'),
(':25:020083203'),
(':28C:49/1'),
(':60F:C140106ZAR1029873,62'),
(':61:1401060106DR5000,NTRF99999999//NONREF20140106-13175-016050001844421'),
(':86:/PREF/ZA000520CATS THIRD PARTY PAYMENT'),
(':62F:C140106ZAR0,00'),
('-}'),
('{1:F01SBZAZAJJXXXX9999999999}{2:I940SBICMWMXXXXXN}{4:'),
(':20:D3DE7040110011E4'),
(':25:020083204'),
(':28C:51/1'),
(':60F:C140106NAD1030073,'),
(':61:1401060106DR5000,NTRF20140106-13175-0//NONREF20140106-13175-016050001844421'),
(':86:/PREF/NA000520TRANSFER'),
(':62F:C140106NAD0,00'),
('-}');
-- DDL and sample data population, end

DECLARE @group INT = (SELECT COUNT(*) FROM @tbl) / 9

;WITH rs AS
(
SELECT *
    , _token = PARSENAME(REPLACE(token,':','.'),1)
    , seq = (ROW_NUMBER() OVER (ORDER BY (SELECT NULL))) % 9
    , grp = NTILE(@group) OVER (ORDER BY (SELECT NULL))
FROM @tbl
)
SELECT DISTINCT [20] = MAX(IIF(seq = 2, _token, '')) OVER (PARTITION BY grp)
    , [25] = MAX(IIF(seq = 3, _token, '')) OVER (PARTITION BY grp)
    , [28C] = MAX(IIF(seq = 4, _token, '')) OVER (PARTITION BY grp)
    , [60F] = MAX(IIF(seq = 5, _token, '')) OVER (PARTITION BY grp)
    , [61] = MAX(IIF(seq = 6, _token, '')) OVER (PARTITION BY grp)
    , [86] = MAX(IIF(seq = 7, _token, '')) OVER (PARTITION BY grp)
    , [62F] = MAX(IIF(seq = 8, _token, '')) OVER (PARTITION BY grp)
FROM rs;

Expected results


问:
INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: (at Binary XML file line #23): intent tag may have at most one data scheme
Error:

ADB exited with exit code 1 Performing Streamed Install adb: failed to
install
/Users/rajvaghasiya/Documents/GitHub/micatalog-3/build/app/outputs/flutter-apk/app.apk:
Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during
installPackageLI: /data/app/vmdl1855179046.tmp/base.apk (at Binary XML
file line #23): intent tag may have at most one data scheme.] Error
launching application on SM T290.

I have facing this error in my flutter project.If anyone know solutions Help me.


问:
Set initial axis limits while preserving pan/zoom in DearPyGui
Using DearPyGui, the x-axis and y-axis limits of a plot can be set using the dpg.set_axis_limits function, i.e.

```<code>dpg.set_axis_limits("xaxis", xmin, xmax)
dpg.set_axis_limits("yaxis", ymin, ymax)
</code>```

This does set the limits of the respective axis, but it also prevents the plot from being panned or zoomed like is available by default in a DearPyGui plot (when dpg.set_axis_limits is not used).

Is it possible to set the initial axis limits of a DearPyGui plot (similar to above) but still have the ability to pan and zoom beyond the initial axis limits?

Note: due to the structure of my data, relying on auto-formatting via dpg.set_axis_limits_auto does not work for setting the initial plot view.

Body:
Using DearPyGui, the x-axis and y-axis limits of a plot can be set using the dpg.set_axis_limits function, i.e.

dpg.set_axis_limits("xaxis", xmin, xmax)
dpg.set_axis_limits("yaxis", ymin, ymax)

This does set the limits of the respective axis, but it also prevents the plot from being panned or zoomed like is available by default in a DearPyGui plot (when dpg.set_axis_limits is not used).

Is it possible to set the initial axis limits of a DearPyGui plot (similar to above) but still have the ability to pan and zoom beyond the initial axis limits?

Note: due to the structure of my data, relying on auto-formatting via dpg.set_axis_limits_auto does not work for setting the initial plot view.


问:
SetRenderer has already been called for this instance (in Compose)
I am using a library TPL which is similar to Google Maps. It however doesn't have support for Compose, so I am trying to use it using AndroidView in Composable. My code is

```<code> AndroidView(
            factory = { context ->
                val view = LayoutInflater.from(context).inflate(R.layout.tpl_map, null, false)

                // do whatever you want...
                view // return the view
            },
            update = { view ->
                // Update the view

                mapView = view.findViewById(R.id.map_view)

                    mapView?.loadMapAsync {
                        mapController = it
                    }})
</code>```

For the first time everything works fine. But when I navigate to the screen containing this map after first time, this line gives error that -> setRenderer has already been called for this instance. And then the map shows nothing.

```<code>mapView?.loadMapAsync {
    mapController = it
}
</code>```

Any idea how to get rid of this issue?

Body:
I am using a library TPL which is similar to Google Maps. It however doesn't have support for Compose, so I am trying to use it using AndroidView in Composable. My code is

 AndroidView(
            factory = { context ->
                val view = LayoutInflater.from(context).inflate(R.layout.tpl_map, null, false)

                // do whatever you want...
                view // return the view
            },
            update = { view ->
                // Update the view

                mapView = view.findViewById(R.id.map_view)

                    mapView?.loadMapAsync {
                        mapController = it
                    }})

For the first time everything works fine. But when I navigate to the screen containing this map after first time, this line gives error that -> setRenderer has already been called for this instance. And then the map shows nothing.

mapView?.loadMapAsync {
    mapController = it
}

Any idea how to get rid of this issue?


问:
Is there a way to open a commit in Bitbucket cloud from VS Code?
Something like Vim's vim-fubitive plugin.

Tried google but I can't find anything on this. Just started with VS code so maybe I'm missing some plugins.


问:
support same path with different params in swagger 3.0.3
**I have two params

basePath/{a}:
POST

basePath/{b}
GET
But swagger yaml is NOT RECOGNISING path 2 says get not allowed
cannot change url , any other way ?**

Tried rearranging the paths , but apparently swagger sorts the path alphabetically and always the alphabetically smaller path is recognised

so if I changed path 1 as :
basePath/{c}
POST
the path 2 would work and I would be able to GET basePath/{b}
but basePath/{c} wont work and it gives error POST not allowed


问:
Slack API admin.roles.listAssignments return feature_not_enabled
I am trying to run the Slack API admin.roles.listAssignments but I have this error
{ "ok": false, "error": "feature_not_enabled" }

Is there a way to enabled this feature ? What does the error message mean ?


问:
Mosek via cvxpy - save verbose output
I use Mosek through the cvxpy interface. When I use the verbose option, it shows some nice output, that I would like to further work with. I looked through the parameters in https://docs.mosek.com/latest/pythonapi/parameters.html#doc-sparam-list whether something would store me this output somewhere. The parameter stat_key seemed promising, but it does not work as I thought.

MWE:

import cvxpy as cvx
import mosek
import numpy as np

A = np.random.randint(10, size = (16,32))
b = np.random.randint(10, size = 16)
c = np.random.randint(10, size = 32)

x = cvx.Variable(32, integer = True)
prob = cvx.Problem(cvx.Maximize(c @ x), [A @ x <= b, x >= 0, x <= 10])
prob.solve(solver = cvx.MOSEK, mosek_params={mosek.sparam.stat_key: 'results.txt'}, verbose = True)
```

expected/wanted behaviour: There should be a file results.txt that contains the line that are printed on the terminal from the verbose option.

observed behaviour: No such file exists.

Title: Mosek via cvxpy - save verbose output

Body:
I use Mosek through the cvxpy interface. When I use the verbose option, it shows some nice output, that I would like to further work with. I looked through the parameters in https://docs.mosek.com/latest/pythonapi/parameters.html#doc-sparam-list whether something would store me this output somewhere. The parameter stat_key seemed promising, but it does not work as I thought.

MWE:

import cvxpy as cvx
import mosek
import numpy as np

A = np.random.randint(10, size = (16,32))
b = np.random.randint(10, size = 16)
c = np.random.randint(10, size = 32)

x = cvx.Variable(32, integer = True)
prob = cvx.Problem(cvx.Maximize(c @ x), [A @ x <= b, x >= 0, x <= 10])
prob.solve(solver = cvx.MOSEK, mosek_params={mosek.sparam.stat_key: 'results.txt'}, verbose = True)

expected/wanted behaviour: There should be a file results.txt that contains the line that are printed on the terminal from the verbose option.

observed behaviour: No such file exists.


问:
Converting ActiveMQ bean to Camel Kafka
This is the given route of the ActiveMQ in the camel.

```<code><route id="readInactiveRecordNotification">
        <from uri="appActiveMQConsumer:queue:Consumer.hydra.ldap_updates_poller.VirtualTopic.ldap.in" />
</code>```

The Bean is given below:

```<code>   @Bean(name = "appActiveMQConsumer")
    public ActiveMQComponent amqConsumer() throws Exception {
        ActiveMQComponent amqConsumer = new ActiveMQComponent();
        amqConsumer.setConnectionFactory(pooledConnectionFactoryConsumer());
        amqConsumer.setTransacted(true);
        amqConsumer.setDeliveryPersistent(true);
        amqConsumer.setCacheLevelName("CACHE_CONSUMER");
        amqConsumer.setAcknowledgementModeName("SESSION_TRANSACTED");
        return amqConsumer;
    }
}
</code>```

I want to migrate this with Kafka. I have written the bean

```<code> @Bean(name="appkafkaConsumer")
    public KafkaComponent kafkaComponentConsumer(){

        KafkaComponent kafkaComponentConsumer = new KafkaComponent();
        kafkaComponentConsumer.setConfiguration(kafkaConfiguration());
        return kafkaComponentConsumer;

    }
</code>```

What is the correct way to migrate the above route?

Title: Converting ActiveMQ bean to Camel Kafka

Body:
This is the given route of the ActiveMQ in the camel.

<route id="readInactiveRecordNotification">
        <from uri="appActiveMQConsumer:queue:Consumer.hydra.ldap_updates_poller.VirtualTopic.ldap.in" />

The Bean is given below:

   @Bean(name = "appActiveMQConsumer")
    public ActiveMQComponent amqConsumer() throws Exception {
        ActiveMQComponent amqConsumer = new ActiveMQComponent();
        amqConsumer.setConnectionFactory(pooledConnectionFactoryConsumer());
        amqConsumer.setTransacted(true);
        amqConsumer.setDeliveryPersistent(true);
        amqConsumer.setCacheLevelName("CACHE_CONSUMER");
        amqConsumer.setAcknowledgementModeName("SESSION_TRANSACTED");
        return amqConsumer;
    }
}

I want to migrate this with Kafka. I have written the bean

 @Bean(name="appkafkaConsumer")
    public KafkaComponent kafkaComponentConsumer(){

        KafkaComponent kafkaComponentConsumer = new KafkaComponent();
        kafkaComponentConsumer.setConfiguration(kafkaConfiguration());
        return kafkaComponentConsumer;

    }

What is the correct way to migrate the above route?


问:
How do I get the path of the selected file(using <input type="file" accept=".jpg">) in Angular?
I am making a E-commerce Website, stuck at this problem. The client wants to have a Portal for the owner with functionality of adding new Items to the Website. I want to get the image file from the user and then display it using img tag in html.

```<code><img src="#FileUploadedByUser.path"
</code>```

Please check the image for more clarity of the problem

-I asked client to user something like google drive to store the images.
-So I instead of asking for file directly we can ask for the link.

Body:
I am making a E-commerce Website, stuck at this problem. The client wants to have a Portal for the owner with functionality of adding new Items to the Website. I want to get the image file from the user and then display it using img tag in html.

<img src="#FileUploadedByUser.path"

Please check the image for more clarity of the problem

-I asked client to user something like google drive to store the images.
-So I instead of asking for file directly we can ask for the link.


问:
List the file name and its specific date creation within different Folder or directories - Python 3
I have tried to apply the below python codes, but it not getting the correct creation date.

import os, pandas as pd, datetime

l = []
pt = r"C:\Users\ndofi.vontade\OneDrive - Jupiter Desenvolvimento Informatico LTDA\Documentos\Jupiter\BI"
count = 0
for dirpath, dirname, filename  in os.walk (pt):
    for file in filename:

        count = count + 1
        date_mod = os.path.getctime(pt)
        dt_m = datetime.datetime.fromtimestamp (date_mod)
        #l.append( (os.path.join(dirpath, file)))
        print (count,file, dt_m)
```


问:
Playwright - Login problem with Azure B2C login
I'm trying to do some tests with playwright. I use Azure B2C for the login service. I have followed the authentication documentation on official website: Playwright auth documentation

I have created a global-setup

```<code>    // global-setup.ts
    import { chromium, FullConfig } from '@playwright/test';

    async function globalSetup(config?: FullConfig) {
      const browser = await chromium.launch();
      const context = await browser.newContext();
      const page = await context.newPage();

      await page.goto('https://myapp.it/it');
      await page.click('text=Prosegui');
      await page.waitForSelector('input[id="email"]');
      await page.fill('input[id="email"]', 'usertest1@myapp.it');
      await page.waitForSelector('text=Password');
      await page.fill('text=Password', 'mypassword');
      await page.click('text=Accesso');
      // Save signed-in state to 'storageState.json'.
      await page.context().storageState({ path: 'storageState.json' });

      await browser.close();
    }

    export default globalSetup;
</code>```

and I have defined the config in this way:

```<code>    // playwright.config.ts
    import { PlaywrightTestConfig } from '@playwright/test';

    const config: PlaywrightTestConfig = {
      globalSetup: require.resolve('./global-setup'),
      // Use the default browser options, but override the
      // headless mode.globalSetup: require.resolve('./global-setup'),

      use: {
        headless: false,
        video: 'retain-on-failure',
        viewport: { width: 1280, height: 720 },
        baseURL: 'https://myapp.it/it/',
        storageState: 'storageState.json',
        //bypassCSP: true,
      },
    };
    export default config;
</code>```

Now, I have multiple files for multiple tests. If I debug global-setup function it works correctly, it do the login correctly but If I run other tests, the context of new browser doesn't add cookies stored in storageState.json and I'm not logged in.

```<code>    import { test } from '@playwright/test';
    //onboarding.spec.ts
    test('onboarding', async ({ baseURL, page, context }) => {

      await page.goto(baseURL);
      await page.waitForSelector('text=Dashboard');
      await page.getByRole('button', { name: 'arrow_forward_ios' }).click();
      await page.getByRole('button', { name: 'arrow_forward_ios' }).click();
      await page.getByRole('button', { name: 'arrow_forward_ios' }).click();
      // await page.goto(`${baseURL}get-folder/details/**`);
      await page.waitForNavigation({ url: 'get-folder/details/**' });
      await page.getByRole('button', { name: 'arrow_forward_ios' }).click();
      await page.getByRole('button', { name: 'arrow_forward_ios' }).click();
      await page.getByRole('button', { name: 'arrow_forward_ios' }).click();
      await page.getByRole('button', { name: 'arrow_forward_ios' }).click();
      await page.getByRole('button', { name: 'arrow_forward_ios' }).click();
      await page.getByText('Conferma').click();
      // Use a glob URL pattern. Note no await.
      await page.waitForResponse('/services/api/identity/tutorial/**');
    });
</code>```

If I run this test I can't proceed it because I'm not logged in and I'm unauthorized. I can't understand why cookies are not present in the context of new browser. What could be a solution?

Body:
I'm trying to do some tests with playwright. I use Azure B2C for the login service. I have followed the authentication documentation on official website: Playwright auth documentation

I have created a global-setup

    // global-setup.ts
    import { chromium, FullConfig } from '@playwright/test';

    async function globalSetup(config?: FullConfig) {
      const browser = await chromium.launch();
      const context = await browser.newContext();
      const page = await context.newPage();

      await page.goto('https://myapp.it/it');
      await page.click('text=Prosegui');
      await page.waitForSelector('input[id="email"]');
      await page.fill('input[id="email"]', 'usertest1@myapp.it');
      await page.waitForSelector('text=Password');
      await page.fill('text=Password', 'mypassword');
      await page.click('text=Accesso');
      // Save signed-in state to 'storageState.json'.
      await page.context().storageState({ path: 'storageState.json' });

      await browser.close();
    }

    export default globalSetup;

and I have defined the config in this way:

    // playwright.config.ts
    import { PlaywrightTestConfig } from '@playwright/test';

    const config: PlaywrightTestConfig = {
      globalSetup: require.resolve('./global-setup'),
      // Use the default browser options, but override the
      // headless mode.globalSetup: require.resolve('./global-setup'),

      use: {
        headless: false,
        video: 'retain-on-failure',
        viewport: { width: 1280, height: 720 },
        baseURL: 'https://myapp.it/it/',
        storageState: 'storageState.json',
        //bypassCSP: true,
      },
    };
    export default config;

Now, I have multiple files for multiple tests. If I debug global-setup function it works correctly, it do the login correctly but If I run other tests, the context of new browser doesn't add cookies stored in storageState.json and I'm not logged in.

    import { test } from '@playwright/test';
    //onboarding.spec.ts
    test('onboarding', async ({ baseURL, page, context }) => {

      await page.goto(baseURL);
      await page.waitForSelector('text=Dashboard');
      await page.getByRole('button', { name: 'arrow_forward_ios' }).click();
      await page.getByRole('button', { name: 'arrow_forward_ios' }).click();
      await page.getByRole('button', { name: 'arrow_forward_ios' }).click();
      // await page.goto(`${baseURL}get-folder/details/**`);
      await page.waitForNavigation({ url: 'get-folder/details/**' });
      await page.getByRole('button', { name: 'arrow_forward_ios' }).click();
      await page.getByRole('button', { name: 'arrow_forward_ios' }).click();
      await page.getByRole('button', { name: 'arrow_forward_ios' }).click();
      await page.getByRole('button', { name: 'arrow_forward_ios' }).click();
      await page.getByRole('button', { name: 'arrow_forward_ios' }).click();
      await page.getByText('Conferma').click();
      // Use a glob URL pattern. Note no await.
      await page.waitForResponse('/services/api/identity/tutorial/**');
    });

If I run this test I can't proceed it because I'm not logged in and I'm unauthorized. I can't understand why cookies are not present in the context of new browser. What could be a solution?


问:
I can't open the Iris dataset on Pycharm but I can on Jupyter
I am very new to python. The code below works in Jupyter but not in pycharm. Running this code in pycharm produces this error message.

```<code>url = 'https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data'

iris = np.genfromtxt(url, delimiter=',',
                 names=['sepal length', 'sepal width', 'petal length', 'petal width', 'species'],
                 dtype=[np.float64, np.float64, np.float64, np.float64, '|S15'])
</code>```

Traceback (most recent call last):
File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/pydevconsole.py", line 364, in runcode
coro = func()
^^^^^^
File "", line 1, in
File "/Users/morr/PycharmProjects/pythonProject/venv/lib/python3.11/site-packages/numpy/lib/npyio.py", line 1969, in genfromtxt
fid = np.lib._datasource.open(fname, 'rt', encoding=encoding)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/morr/PycharmProjects/pythonProject/venv/lib/python3.11/site-packages/numpy/lib/_datasource.py", line 193, in open
return ds.open(path, mode, encoding=encoding, newline=newline)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/morr/PycharmProjects/pythonProject/venv/lib/python3.11/site-packages/numpy/lib/_datasource.py", line 533, in open
raise FileNotFoundError(f"{path} not found.")
FileNotFoundError: https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data not found.

I tried to trouble shoot with chatgpt but none of the solutions worked.

I also tried just downloading the file and opening it numpy but I can't match how the output is in jupyter when I do this in pycharm. This is part of an exercise sheet so, if I can't get the output how it is meant to be (as it is in Jupyter) I can't do the subsequent exercises.

Any help would be really appreciated.

Body:
I am very new to python. The code below works in Jupyter but not in pycharm. Running this code in pycharm produces this error message.

url = 'https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data'

iris = np.genfromtxt(url, delimiter=',',
                 names=['sepal length', 'sepal width', 'petal length', 'petal width', 'species'],
                 dtype=[np.float64, np.float64, np.float64, np.float64, '|S15'])

Traceback (most recent call last):
File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/pydevconsole.py", line 364, in runcode
coro = func()
^^^^^^
File "", line 1, in
File "/Users/morr/PycharmProjects/pythonProject/venv/lib/python3.11/site-packages/numpy/lib/npyio.py", line 1969, in genfromtxt
fid = np.lib._datasource.open(fname, 'rt', encoding=encoding)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/morr/PycharmProjects/pythonProject/venv/lib/python3.11/site-packages/numpy/lib/_datasource.py", line 193, in open
return ds.open(path, mode, encoding=encoding, newline=newline)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/morr/PycharmProjects/pythonProject/venv/lib/python3.11/site-packages/numpy/lib/_datasource.py", line 533, in open
raise FileNotFoundError(f"{path} not found.")
FileNotFoundError: https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data not found.

I tried to trouble shoot with chatgpt but none of the solutions worked.

I also tried just downloading the file and opening it numpy but I can't match how the output is in jupyter when I do this in pycharm. This is part of an exercise sheet so, if I can't get the output how it is meant to be (as it is in Jupyter) I can't do the subsequent exercises.

Any help would be really appreciated.


问:
Prarse String to Html and Components
I am building a website with Nextjs and have my course lessons stored in a different file. In there I have String containing content like for example

```<code>taskInfo: `
     <h1 className="task-section__info-header px-task pt-task-header">Hello World!</h1>
    <div className="task-section__info-description px-task">
    For this lesson, we will be creating a simple "Hello World!" program.
    <br />
    If you forgot how to do this, revisit the previous lesson.
    <div className="task-section__code">
    <CodeSnippet
    language="javascript"
    >
    console.log("Hello World!");
    </CodeSnippet>
  </div>
    `,
</code>```

My goal now is to pass this string as a prop to a component and display that string on the screen with the components and the rendered HTML. I've tried things like html-to-react or unified or babel, but they all provided their own errors and didn't work. Html-To-React, for example, only converts the HTML but not the component.

Title: Prarse String to Html and Components

Body:
I am building a website with Nextjs and have my course lessons stored in a different file. In there I have String containing content like for example

taskInfo: `

Hello World!

    For this lesson, we will be creating a simple "Hello World!" program.

    If you forgot how to do this, revisit the previous lesson.

    <CodeSnippet
    language="javascript"
    >
    console.log("Hello World!");
    </CodeSnippet>

    `,

My goal now is to pass this string as a prop to a component and display that string on the screen with the components and the rendered HTML. I've tried things like html-to-react or unified or babel, but they all provided their own errors and didn't work. Html-To-React, for example, only converts the HTML but not the component.


问:
getting date in certain format using $date in MongoDB gives invalid date
im receiving a document from another service using api and one of the date fields looks like this:

```<code>    "workloadCreationDate": {
        "$date": 1671580800000
    },
</code>```

but when insert this to the db I get this:

which is so weird cause nothing really changed in this service so I don't know why suddenly I get invalid date

thanks

Body:
im receiving a document from another service using api and one of the date fields looks like this:

    "workloadCreationDate": {
        "$date": 1671580800000
    },

but when insert this to the db I get this:

which is so weird cause nothing really changed in this service so I don't know why suddenly I get invalid date

thanks


问:
GraphqlTools why batchDelegateToSchema aggregate repeating the same data for all resulting fields from reponse
The issue I'm having is difficult to explain but in my API, calling a GQL query results in data aggregated in fields where should be an empty object

An example of the query usage

Seeing the above example if you check the results I have the objects and inside you see

callReminders

siteAppointments

Which are aliases of events from the query and give back us results based on the types filter

As you see the result is the same for both objects

```<code>{
            "id": "33116",
            "startTime": "2023-01-10T08:57:00.000Z",
            "type": "APPOINTMENT_PHONE"
}
</code>```

the second object siteAppointments should result as nodes: [] as that candidate has only APPOINTMENT_PHONEbut that is duplicated to the results of the second object and I don't know why.

The resolver for the event

```<code>events: {
      selectionSet: '{ id }',
      resolve(candidate, args, context, info) {
        return batchDelegateToSchema({
          schema: event,
          operation: 'query',
          fieldName: 'eventsByOwner',
          key: candidate.id,
          transforms: [transformEventsByOwner],
          argsFromKeys: keys => ({
            ...args,
            filter: {
              ...(args?.filter ?? {}),
              ownerTypes: ['CANDIDATE'],
              ownerIds: keys,
            },
          }),
          valuesFromResults: (results, keys) =>
            keys.map(findByOwnerId(results)).map(mapToConnection),
          context,
          info,
        });
      },
    },
</code>```

The methods used inside

```<code>export function findByOwnerId(results) {
  return id => results?.find(item => item?.ownerId === id);
}

export function mapToConnection(result) {
  return {
    totalCount: result?.totalCount ?? 0,
    nodes: result?.nodes ?? [],
  };
}
</code>```

I believe there is a problem with the valuesFromResultsbut have no clue what to change and how to have the expected result as

```<code>{
  "data": {
    "candidate": {
      "id": "CY-001745",
      "callReminders": {
        "nodes": [
          {
            "id": "33116",
            "startTime": "2023-01-10T08:57:00.000Z",
            "type": "APPOINTMENT_PHONE"
          }
        ],
        "totalCount": 1
      },
      "siteAppointments": {
        "nodes": [],
        "totalCount": 0
      }
    }
  }
}
</code>```

Body:
The issue I'm having is difficult to explain but in my API, calling a GQL query results in data aggregated in fields where should be an empty object

An example of the query usage

Seeing the above example if you check the results I have the objects and inside you see

callReminders

siteAppointments

Which are aliases of events from the query and give back us results based on the types filter

As you see the result is the same for both objects

{
            "id": "33116",
            "startTime": "2023-01-10T08:57:00.000Z",
            "type": "APPOINTMENT_PHONE"
}

the second object siteAppointments should result as nodes: [] as that candidate has only APPOINTMENT_PHONEbut that is duplicated to the results of the second object and I don't know why.

The resolver for the event

events: {
      selectionSet: '{ id }',
      resolve(candidate, args, context, info) {
        return batchDelegateToSchema({
          schema: event,
          operation: 'query',
          fieldName: 'eventsByOwner',
          key: candidate.id,
          transforms: [transformEventsByOwner],
          argsFromKeys: keys => ({
            ...args,
            filter: {
              ...(args?.filter ?? {}),
              ownerTypes: ['CANDIDATE'],
              ownerIds: keys,
            },
          }),
          valuesFromResults: (results, keys) =>
            keys.map(findByOwnerId(results)).map(mapToConnection),
          context,
          info,
        });
      },
    },

The methods used inside

export function findByOwnerId(results) {
  return id => results?.find(item => item?.ownerId === id);
}

export function mapToConnection(result) {
  return {
    totalCount: result?.totalCount ?? 0,
    nodes: result?.nodes ?? [],
  };
}

I believe there is a problem with the valuesFromResultsbut have no clue what to change and how to have the expected result as

{
  "data": {
    "candidate": {
      "id": "CY-001745",
      "callReminders": {
        "nodes": [
          {
            "id": "33116",
            "startTime": "2023-01-10T08:57:00.000Z",
            "type": "APPOINTMENT_PHONE"
          }
        ],
        "totalCount": 1
      },
      "siteAppointments": {
        "nodes": [],
        "totalCount": 0
      }
    }
  }
}


问:
image download(crawling) by using winhttp in VBA
I'm trying to download(crawling) image in VBA.
I'm using "winhttp" for this.

```<code>Public Function WebFileDownload(ByVal strURL As String, ByVal strFileName As String) As Boolean
    Dim Buf() As Byte, oWinHttp

    On Error GoTo Err_Sub

    Set oWinHttp = CreateObject("WinHttp.WinHttpRequest.5.1")

    With oWinHttp
        .Open "GET", strURL, 0
        .Send
        Buf = .ResponseBody
    End With

    Open ThisWorkbook.Path & "\" & strFileName For Binary Access Write As #1
        Put #1, , Buf
    Close #1

    Set oWinHttp = Nothing
    WebFileDownload = True

Err_Sub:
    If Err Then MsgBox Err.Description
    If Not oWinHttp Is Nothing Then Set oWinHttp = Nothing

End Function
</code>```

Unfortunately, After download 20-30 files. Server change the speed very slow. I think It detect by bot. I'm using VBA, So I don't know How to avoid this. I wrote sleep time randomly, But it is not work well. Is there any tip?

Body:
I'm trying to download(crawling) image in VBA.
I'm using "winhttp" for this.

Public Function WebFileDownload(ByVal strURL As String, ByVal strFileName As String) As Boolean
    Dim Buf() As Byte, oWinHttp

    On Error GoTo Err_Sub

    Set oWinHttp = CreateObject("WinHttp.WinHttpRequest.5.1")

    With oWinHttp
        .Open "GET", strURL, 0
        .Send
        Buf = .ResponseBody
    End With

    Open ThisWorkbook.Path & "\" & strFileName For Binary Access Write As #1
        Put #1, , Buf
    Close #1

    Set oWinHttp = Nothing
    WebFileDownload = True

Err_Sub:
    If Err Then MsgBox Err.Description
    If Not oWinHttp Is Nothing Then Set oWinHttp = Nothing

End Function

Unfortunately, After download 20-30 files. Server change the speed very slow. I think It detect by bot. I'm using VBA, So I don't know How to avoid this. I wrote sleep time randomly, But it is not work well. Is there any tip?


问:
Control snackbar transition duration in Flutter
Is there a way to control snackbar transition duration?

It seems to be a bit hardcoded in: https://github.com/flutter/flutter/blob/cb9a1d623ccd460c3744ed019af76496c47a353e/packages/flutter/lib/src/material/snack_bar.dart ln: 26


问:
SyntaxError: Unexpected end of JSON input at callAboutPage (About.js:25:1)
I am trying to fetch the currently logged-in user's data using the jwt tokens. The API routing for the token verification is working fine but the data I think the (rootUser) from auth.js sent as response might have a problem although it is giving correct values on console.log(rootUser) but when i tried to access the about page on the browser it gave the error
SyntaxError: Unexpected end of JSON input
at callAboutPage (About.js:25:1) that is at line 25 for the About.js file. How to solve this issue?
This is code to About.js where i have defined a callabout page function to behave necessarily on accessing the about page on browser:

const About = ()=>{
    const navigate = useNavigate();
    const [userData, setUserData] = useState({});
    const callAboutPage = async() =>{
        try {
            const res = await fetch("/about",{
                method: "GET",
                headers: {
                    Accept: "application/json",
                    "Content-Type" : "application/json"

                },
                credentials: "include"
            });
            const data = await res.json();
            console.log(data);
            // setUserData(data);
            if(res.status === 401 || res.status===403){
                const error = new Error(res.error);
                throw error;

            }

        } catch (err) {
            console.log(err);
            navigate("/login");
        }
    }
useEffect(()=>{
    callAboutPage();
},  []);
}```
</div>
</div>
</p>
<p>This is authenticate.js file where tokens are verified and corresponding user data is finded</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>const Authenticate = async(req, res, next) => {
    const accessToken = req.cookies.jwt;
    if(!accessToken) {
        return res.status(401).json({error: "Unauthorized: No token provided"});

    }
        try {
            const user = jwt.verify(accessToken, process.env.TOKEN_KEY);
            const rootUser = await User.findOne({_id: user.user_id, "tokens.token": accessToken});
            if(user) {
                req.user = rootUser;
                return next();
            }
        } catch (error) {
            return res.status(403).json({error: "Forbidden token error"})
        }
}</code>```

This is auth.js file to call /about at backend

  router.get("/about", Authenticate, function (req, res) {
    console.log("about running");
    res.send(req.rootUser);
  });```

Body:
I am trying to fetch the currently logged-in user's data using the jwt tokens. The API routing for the token verification is working fine but the data I think the (rootUser) from auth.js sent as response might have a problem although it is giving correct values on console.log(rootUser) but when i tried to access the about page on the browser it gave the error
SyntaxError: Unexpected end of JSON input
at callAboutPage (About.js:25:1) that is at line 25 for the About.js file. How to solve this issue?
This is code to About.js where i have defined a callabout page function to behave necessarily on accessing the about page on browser:

const About = ()=>{
    const navigate = useNavigate();
    const [userData, setUserData] = useState({});
    const callAboutPage = async() =>{
        try {
            const res = await fetch("/about",{
                method: "GET",
                headers: {
                    Accept: "application/json",
                    "Content-Type" : "application/json"

                },
                credentials: "include"
            });
            const data = await res.json();
            console.log(data);
            // setUserData(data);
            if(res.status === 401 || res.status===403){
                const error = new Error(res.error);
                throw error;

            }

        } catch (err) {
            console.log(err);
            navigate("/login");
        }
    }
useEffect(()=>{
    callAboutPage();
},  []);
}

This is authenticate.js file where tokens are verified and corresponding user data is finded

const Authenticate = async(req, res, next) => {
    const accessToken = req.cookies.jwt;
    if(!accessToken) {
        return res.status(401).json({error: "Unauthorized: No token provided"});

    }
        try {
            const user = jwt.verify(accessToken, process.env.TOKEN_KEY);
            const rootUser = await User.findOne({_id: user.user_id, "tokens.token": accessToken});
            if(user) {
                req.user = rootUser;
                return next();
            }
        } catch (error) {
            return res.status(403).json({error: "Forbidden token error"})
        }
}

This is auth.js file to call /about at backend

  router.get("/about", Authenticate, function (req, res) {
    console.log("about running");
    res.send(req.rootUser);
  });


Title: Creating a DXF polyline from a list of 3D coordinates

Body:
I'm trying to create a 3D polyline from a list of coordinates using EZDXF in Python. I modified this script and it works great. I can import it in Fusion and can see the points in 3D space. The thing is, I would like to make a polyline instead.

I've tried using the add_polyline3d function but it's not working. The script executes just fine but when I try to import the DXF file, it's empty.

Here's the code I used:

import ezdxf
from ezdxf.gfxattribs import GfxAttribs
from ezdxf import units

doc = ezdxf.new("R2000")
doc.units = units.CM

msp = doc.modelspace()

attribsp = GfxAttribs(layer="LINE")

msp.add_polyline3d([(0.0, 0.0, 0.0), (-0.00961, -0.0224, -0.83254), (-0.037, -0.0909, -1.6623), (-0.0789, -0.20771, -2.4859), (-0.13198, -0.37455, -3.3001), (-0.19328, -0.59253, -4.1016), (-0.25978, -0.86226, -4.8867), (-0.32886, -1.1838, -5.6518), (-0.39809, -1.5566, -6.3932), (-0.46537, -1.9799, -7.1073), (-0.5289, -2.4521, -7.7904), (-0.58727, -2.9713, -8.4389), (-0.63937, -3.5352, -9.0496), (-0.68449, -4.1406, -9.6196), (-0.7222, -4.7847, -10.146), (-0.75252, -5.4636, -10.628), (-0.77571, -6.1739, -11.062), (-0.79238, -6.912, -11.447), (-0.80336, -7.6744, -11.782), (-0.80965, -8.4574, -12.066), (-0.81234, -9.2574, -12.298), (-0.81256, -10.071, -12.477), (-0.81148, -10.894, -12.603), (-0.81031, -11.724, -12.677), (-0.81028, -12.556, -12.698), (-0.81257, -13.389, -12.667), (-0.81821, -14.218, -12.585), (-0.82809, -15.04, -12.452), (-0.84291, -15.853, -12.271), (-0.86326, -16.654, -12.042), (-0.88953, -17.44, -11.768), (-0.92199, -18.209, -11.45), (-0.96075, -18.959, -11.09), (-1.0059, -19.688, -10.69), (-1.0574, -20.395, -10.252), (-1.1154, -21.078, -9.7787), (-1.1797, -21.736, -9.2714), (-1.2506, -22.366, -8.732), (-1.3281, -22.969, -8.1622), (-1.4122, -23.543, -7.5638), (-1.5032, -24.085, -6.9385), (-1.601, -24.596, -6.2879), (-1.7055, -25.074, -5.6138), (-1.8167, -25.519, -4.9179), (-1.9343, -25.928, -4.202), (-2.0576, -26.302, -3.4678), (-2.186, -26.64, -2.7174), (-2.3187, -26.942, -1.9524), (-2.4548, -27.207, -1.1744), (-2.5932, -27.436, -0.38543), (-2.7326, -27.629, 0.41293), (-2.8715, -27.787, 1.219), (-3.0086, -27.911, 2.0312), (-3.1422, -28.004, 2.8483), (-3.2707, -28.067, 3.6691), (-3.3926, -28.102, 4.4926), (-3.5063, -28.112, 5.3179), (-3.6101, -28.099, 6.1445), (-3.7027, -28.065, 6.9719), (-3.7826, -28.013, 7.7997), (-3.8486, -27.945, 8.6275), (-3.8996, -27.863, 9.4551), (-3.9343, -27.77, 10.282), (-3.9519, -27.668, 11.109), (-3.9514, -27.558, 11.935), (-3.9318, -27.444, 12.76), (-3.8925, -27.326, 13.584), (-3.8327, -27.208, 14.407), (-3.7518, -27.09, 15.228), (-3.6494, -26.974, 16.046), (-3.5254, -26.862, 16.862), (-3.3798, -26.755, 17.676), (-3.2129, -26.655, 18.486), (-3.0254, -26.564, 19.293), (-2.8177, -26.481, 20.095), (-2.5907, -26.409, 20.894), (-2.3452, -26.348, 21.688), (-2.0822, -26.299, 22.477), (-1.8028, -26.262, 23.261), (-1.5079, -26.237, 24.04), (-1.1983, -26.226, 24.813), (-0.87464, -26.228, 25.581), (-0.53727, -26.244, 26.343), (-0.18642, -26.274, 27.098), (0.17803, -26.32, 27.846), (0.55634, -26.381, 28.585), (0.94884, -26.459, 29.316), (1.3559, -26.554, 30.037), (1.7778, -26.668, 30.746), (2.2148, -26.8, 31.443), (2.6667, -26.951, 32.127), (3.133, -27.122, 32.795), (3.6133, -27.313, 33.449), (4.1064, -27.525, 34.086), (4.6113, -27.758, 34.707), (5.1265, -28.012, 35.31), (5.6502, -28.288, 35.896), (6.1804, -28.588, 36.465), (6.7151, -28.91, 37.016), (7.2522, -29.257, 37.551), (7.7895, -29.629, 38.068), (8.3246, -30.027, 38.567), (8.8552, -30.452, 39.048), (9.3792, -30.906, 39.51), (9.8942, -31.389, 39.953), (10.398, -31.901, 40.374), (10.889, -32.443, 40.774), (11.364, -33.014, 41.15), (11.822, -33.615, 41.501), (12.26, -34.244, 41.826), (12.677, -34.902, 42.122), (13.071, -35.585, 42.389), (13.44, -36.294, 42.624), (13.782, -37.026, 42.827), (14.097, -37.778, 42.994), (14.383, -38.549, 43.125), (14.64, -39.336, 43.22), (14.866, -40.136, 43.276), (15.062, -40.945, 43.293), (15.228, -41.761, 43.271), (15.362, -42.58, 43.21), (15.467, -43.4, 43.11), (15.542, -44.218, 42.971), (15.587, -45.03, 42.792), (15.604, -45.834, 42.575), (15.592, -46.627, 42.32), (15.554, -47.406, 42.028), (15.49, -48.169, 41.7), (15.401, -48.914, 41.338), (15.289, -49.638, 40.942), (15.153, -50.34, 40.515), (14.996, -51.018, 40.057), (14.817, -51.67, 39.571), (14.619, -52.295, 39.057), (14.402, -52.892, 38.519), (14.168, -53.46, 37.956), (13.916, -53.997, 37.371), (13.649, -54.504, 36.767), (13.366, -54.979, 36.144), (13.069, -55.422, 35.504), (12.758, -55.832, 34.848), (12.434, -56.209, 34.18), (12.098, -56.553, 33.5), (11.749, -56.863, 32.81), (11.389, -57.139, 32.111), (11.018, -57.382, 31.406), (10.636, -57.591, 30.696), (10.244, -57.768, 29.982), (9.8417, -57.912, 29.267), (9.4299, -58.024, 28.551), (9.0089, -58.104, 27.837), (8.5791, -58.154, 27.125), (8.1409, -58.175, 26.417), (7.6945, -58.166, 25.713), (7.2404, -58.13, 25.016), (6.7786, -58.068, 24.325), (6.3092, -57.98, 23.643), (5.8322, -57.868, 22.969), (5.3474, -57.732, 22.305), (4.8546, -57.576, 21.651), (4.3535, -57.399, 21.01), (3.8436, -57.203, 20.38), (3.3245, -56.99, 19.764), (2.7958, -56.761, 19.163), (2.257, -56.518, 18.575), (1.7079, -56.261, 18.004), (1.1479, -55.994, 17.448), (0.5765, -55.716, 16.909), (-0.00687, -55.43, 16.387), (-0.60281, -55.138, 15.884), (-1.2119, -54.841, 15.399), (-1.8348, -54.541, 14.934), (-2.4721, -54.24, 14.49), (-3.1239, -53.939, 14.066), (-3.7906, -53.642, 13.665), (-4.4722, -53.349, 13.286), (-5.1687, -53.061, 12.931), (-5.8796, -52.782, 12.598), (-6.6048, -52.512, 12.289), (-7.3438, -52.254, 12.005), (-8.0958, -52.008, 11.744), (-8.8603, -51.775, 11.508), (-9.6364, -51.559, 11.297), (-10.423, -51.359, 11.11), (-11.219, -51.176, 10.947), (-12.024, -51.013, 10.808), (-12.837, -50.87, 10.691), (-13.655, -50.748, 10.597), (-14.479, -50.646, 10.523), (-15.307, -50.567, 10.469), (-16.137, -50.51, 10.433), (-16.969, -50.476, 10.414), (-17.802, -50.463, 10.409), (-18.635, -50.474, 10.419), (-19.467, -50.507, 10.44), (-20.298, -50.563, 10.472), (-21.126, -50.642, 10.513), (-21.952, -50.744, 10.562), (-22.774, -50.869, 10.618), (-23.591, -51.017, 10.68), (-24.404, -51.188, 10.748), (-25.211, -51.38, 10.821), (-26.013, -51.595, 10.897), (-26.808, -51.83, 10.978), (-27.597, -52.085, 11.061), (-28.379, -52.359, 11.146), (-29.154, -52.651, 11.233), (-29.923, -52.96, 11.32), (-30.685, -53.286, 11.407), (-31.44, -53.627, 11.493), (-32.189, -53.983, 11.577), (-32.931, -54.353, 11.658), (-33.666, -54.738, 11.737), (-34.395, -55.135, 11.811), (-35.117, -55.545, 11.881), (-35.833, -55.966, 11.946), (-36.542, -56.4, 12.006), (-37.245, -56.844, 12.06), (-37.942, -57.299, 12.109), (-38.632, -57.764, 12.151), (-39.316, -58.238, 12.186), (-39.995, -58.72, 12.215), (-40.669, -59.21, 12.235), (-41.337, -59.708, 12.249), (-42.001, -60.211, 12.254), (-42.661, -60.72, 12.25), (-43.317, -61.233, 12.238), (-43.971, -61.75, 12.215), (-44.622, -62.268, 12.183), (-45.272, -62.788, 12.139), (-45.921, -63.308, 12.084), (-46.569, -63.828, 12.015), (-47.217, -64.345, 11.933), (-47.865, -64.86, 11.835), (-48.513, -65.371, 11.72), (-49.161, -65.877, 11.588), (-49.81, -66.378, 11.437), (-50.458, -66.873, 11.266), (-51.106, -67.36, 11.074), (-51.754, -67.838, 10.861), (-52.402, -68.307, 10.627), (-53.049, -68.766, 10.371), (-53.694, -69.213, 10.092), (-54.338, -69.648, 9.7916), (-54.98, -70.07, 9.4687), (-55.619, -70.478, 9.1237), (-56.255, -70.872, 8.7567), (-56.887, -71.251, 8.3682), (-57.514, -71.616, 7.9587), (-58.136, -71.965, 7.5289), (-58.753, -72.299, 7.0795), (-59.365, -72.617, 6.611), (-59.97, -72.919, 6.1244), (-60.568, -73.205, 5.6202), (-61.16, -73.475, 5.0995), (-61.745, -73.728, 4.5629), (-62.322, -73.965, 4.0113), (-62.893, -74.185, 3.4457), (-63.457, -74.389, 2.867), (-64.014, -74.575, 2.2762), (-64.564, -74.746, 1.6741), (-65.108, -74.9, 1.062), (-65.646, -75.038, 0.44072), (-66.178, -75.16, -0.18849), (-66.706, -75.267, -0.82444), (-67.23, -75.36, -1.4659), (-67.75, -75.439, -2.1117), (-68.269, -75.505, -2.7605), (-68.787, -75.559, -3.4108), (-69.307, -75.6, -4.0611), (-69.829, -75.629, -4.7098), (-70.355, -75.647, -5.3553), (-70.889, -75.654, -5.9955), (-71.43, -75.649, -6.6287), (-71.983, -75.633, -7.2524), (-72.547, -75.607, -7.8644), (-73.126, -75.57, -8.4624), (-73.721, -75.524, -9.0438), (-74.334, -75.469, -9.606), (-74.965, -75.405, -10.146), (-75.615, -75.335, -10.662), (-76.285, -75.257, -11.151), (-76.975, -75.174, -11.61), (-77.683, -75.086, -12.039), (-78.41, -74.995, -12.435), (-79.154, -74.9, -12.798), (-79.913, -74.803, -13.128), (-80.684, -74.704, -13.425), (-81.468, -74.603, -13.69), (-82.26, -74.501, -13.925), (-83.061, -74.399, -14.132), (-83.867, -74.296, -14.314), (-84.679, -74.192, -14.473), (-85.493, -74.088, -14.612), (-86.311, -73.985, -14.735), (-87.13, -73.881, -14.845), (-87.951, -73.777, -14.944), (-88.773, -73.673, -15.037), (-89.595, -73.57, -15.126), (-90.417, -73.467, -15.212)], dxfattribs=attribsp)

# Save the DXF file
doc.saveas('polyline.dxf')

Any help would be greatly appreciated!


问:
How to use constructusing with generic types in mapster
```<code>TypeAdapterConfig.GlobalSettings.ForType(typeof(PagedList<>),typeof(PagedList<>))
</code>```

for above  config constructusing does not appear and can't use.

I try use define constructusing for generic class PagedList

but doesn't appear for this config constructusing
I expect to use this

```<code>ConstructUsing(dest => new PagedList<Type>(new List<Type>(), 1, 1));
</code>```

Body:
TypeAdapterConfig.GlobalSettings.ForType(typeof(PagedList<>),typeof(PagedList<>))

for above  config constructusing does not appear and can't use.

I try use define constructusing for generic class PagedList

but doesn't appear for this config constructusing
I expect to use this

ConstructUsing(dest => new PagedList<Type>(new List<Type>(), 1, 1));


问:
MWE of GitLab CI that uses a (QEMU) simulated android phone over adb?

Context

While trying to simulate a phone and unit test adb and uiautomator interactions with the phone, in Python, I am experiencing some difficulties in finding a MWE that:

Simulates an Android phone

Simulates that Android phone over adb.

In a .gitlab-ci.yml file.

Most of the examples 1, 2, 3, 4, 5 I that I found, also compile an Android app and build it, however, I am not interested in that. I merely would like to simulate and test the interaction with the phone. Hence, I would like to ask:

Question

How can one simulate an Android phone with adb in GitLab CI and run (two files, one Bash, one Python) that contain:

adb install some_app.apk
```
<p>And:</p>
<pre class="lang-py prettyprint-override"><code>from uiautomator import device
device.screenshot("/some_path/some_file.png")
</code>```

?

Approach I

I found this script to be automatically installing Android Emulator, installing an Android phone, and running it with GUI:

# Source: https://github.com/Uirado/linux-bash-install/blob/a150a462d2f9d095734f10a7b8c6c39871e5df71/batch-install.sh
# Worked.
yes | sudo apt install openjdk-8-jdk
echo 'export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::")' >> ~/.profile
sudo update-java-alternatives --set java-1.8.0-openjdk-amd64
. ~/.profile

sudo apt update
sudo apt upgrade

#installLog "Android SDK"
mkdir -p ~/Android/Sdk
wget -O ~/Android/Sdk/android-sdk.zip "https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip"
unzip -o -qq ~/Android/Sdk/android-sdk.zip -d ~/Android/Sdk
rm ~/Android/Sdk/android-sdk.zip
mv ~/Android/Sdk/tools/emulator ~/Android/Sdk/tools/emulator2

wget -O ~/gradle-4.10.3.zip https://downloads.gradle-dn.com/distributions/gradle-4.10.3-all.zip
unzip -o -qq ~/gradle-4.10.3.zip -d ~/

echo 'export GRADLE_HOME=$HOME/gradle-4.10.3' >> ~/.profile
echo 'export ANDROID_HOME=$HOME/Android/Sdk' >> ~/.profile
echo 'export ANDROID_SDK_ROOT=$ANDROID_HOME' >> ~/.profile
echo 'export PATH=$PATH:$ANDROID_HOME/tools' >> ~/.profile
echo 'export PATH=$PATH:$ANDROID_HOME/tools/bin' >> ~/.profile
echo 'export PATH=$PATH:$GRADLE_HOME/bin' >> ~/.profile

. ~/.profile
mkdir -p ~/.android
touch ~/.android/repositories.cfg
installLog "Android SDK packages"
sdkmanager --install "platform-tools"
sdkmanager --install "build-tools;29.0.2"
sdkmanager --install "extras;google;google_play_services"
sdkmanager --install "system-images;android-28;google_apis_playstore;x86_64"

sdkmanager --install emulator
echo 'export PATH=$PATH:$ANDROID_HOME/emulator' >> ~/.profile
. ~/.profile

# create android VMs android-small and @android-large
avdmanager create avd -n "android-small" -k "system-images;android-28;google_apis_playstore;x86_64"
# avdmanager create avd -n "android-small" -k "system-images;android-28;google_apis_playstore;x86_64" -d "Nexus S" -c 512

# Show installed android devices:
emulator -list-avds

# Launch emulated phone:
emulator -avd android-small -netdelay none -netspeed full
```

However, I was not yet able to interact with it from Python nor bash.

Body:
Context

While trying to simulate a phone and unit test adb and uiautomator interactions with the phone, in Python, I am experiencing some difficulties in finding a MWE that:

Simulates an Android phone

Simulates that Android phone over adb.

In a .gitlab-ci.yml file.

Most of the examples 1, 2, 3, 4, 5 I that I found, also compile an Android app and build it, however, I am not interested in that. I merely would like to simulate and test the interaction with the phone. Hence, I would like to ask:

Question

How can one simulate an Android phone with adb in GitLab CI and run (two files, one Bash, one Python) that contain:

adb install some_app.apk

And:

from uiautomator import device
device.screenshot("/some_path/some_file.png")

?

Approach I

I found this script to be automatically installing Android Emulator, installing an Android phone, and running it with GUI:

# Source: https://github.com/Uirado/linux-bash-install/blob/a150a462d2f9d095734f10a7b8c6c39871e5df71/batch-install.sh
# Worked.
yes | sudo apt install openjdk-8-jdk
echo 'export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::")' >> ~/.profile
sudo update-java-alternatives --set java-1.8.0-openjdk-amd64
. ~/.profile

sudo apt update
sudo apt upgrade

#installLog "Android SDK"
mkdir -p ~/Android/Sdk
wget -O ~/Android/Sdk/android-sdk.zip "https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip"
unzip -o -qq ~/Android/Sdk/android-sdk.zip -d ~/Android/Sdk
rm ~/Android/Sdk/android-sdk.zip
mv ~/Android/Sdk/tools/emulator ~/Android/Sdk/tools/emulator2

wget -O ~/gradle-4.10.3.zip https://downloads.gradle-dn.com/distributions/gradle-4.10.3-all.zip
unzip -o -qq ~/gradle-4.10.3.zip -d ~/

echo 'export GRADLE_HOME=$HOME/gradle-4.10.3' >> ~/.profile
echo 'export ANDROID_HOME=$HOME/Android/Sdk' >> ~/.profile
echo 'export ANDROID_SDK_ROOT=$ANDROID_HOME' >> ~/.profile
echo 'export PATH=$PATH:$ANDROID_HOME/tools' >> ~/.profile
echo 'export PATH=$PATH:$ANDROID_HOME/tools/bin' >> ~/.profile
echo 'export PATH=$PATH:$GRADLE_HOME/bin' >> ~/.profile

. ~/.profile
mkdir -p ~/.android
touch ~/.android/repositories.cfg
installLog "Android SDK packages"
sdkmanager --install "platform-tools"
sdkmanager --install "build-tools;29.0.2"
sdkmanager --install "extras;google;google_play_services"
sdkmanager --install "system-images;android-28;google_apis_playstore;x86_64"

sdkmanager --install emulator
echo 'export PATH=$PATH:$ANDROID_HOME/emulator' >> ~/.profile
. ~/.profile

# create android VMs android-small and @android-large
avdmanager create avd -n "android-small" -k "system-images;android-28;google_apis_playstore;x86_64"
# avdmanager create avd -n "android-small" -k "system-images;android-28;google_apis_playstore;x86_64" -d "Nexus S" -c 512

# Show installed android devices:
emulator -list-avds

# Launch emulated phone:
emulator -avd android-small -netdelay none -netspeed full

However, I was not yet able to interact with it from Python nor bash.


问:
Slick 3.4.1 + Scala Driver org.h2.Driver does not know how to handle URL jdbc:mysql://localhost:3306/Test
I am using Slick 3.4.1 and Scala 2.12 and this is my code to connect to a MySql Database:

while this is mySql workbecnh

It seems like the Sql is not running though, seen that when I try ping 127.0.0.1:3306 the output is ping: 127.0.0.1:3306: Name or service not known. I really do not know what is wrong.


问:
Why Richtext content is not searchable in hygraph/graphcms?
Im try to search content from the query user requested but hygraph not showing the result it only show data if title contains it...

```<code>export async function getServerSideProps(context) {
const { query } = context;
const { posts } = await hygraph.request(
    `
      query BlogPostPage($search: String! ){
            posts(where:{_search: $search}){
            createdAt
            id
            slug
            titile
            coverPhoto {
                url
            }
            content {
                html
            }
            author {
                name
                avtar {
                url
                }
            }
        }
      }
    `,
    { search: query.q }
);

return {
    props: {
        posts,
    },
};
</code>```

}

i want this search query search the query from all the field how to do that ?

Body:
Im try to search content from the query user requested but hygraph not showing the result it only show data if title contains it...

export async function getServerSideProps(context) {
const { query } = context;
const { posts } = await hygraph.request(
    `
      query BlogPostPage($search: String! ){
            posts(where:{_search: $search}){
            createdAt
            id
            slug
            titile
            coverPhoto {
                url
            }
            content {
                html
            }
            author {
                name
                avtar {
                url
                }
            }
        }
      }
    `,
    { search: query.q }
);

return {
    props: {
        posts,
    },
};

}

i want this search query search the query from all the field how to do that ?


问:
Crystal Report Visual Studio 'Cannot Find custom tool'
I'm Using Crystal Report v2013 & Visual Studio 2017.I had installed crystal report for visual studio. But its not working when i generate the cs code of any report it showing error

have anyone idea about this?


问:
How to get the Header Row from XLSX Sheet-JS Node module (React)?
I dont understand why the fields of the first row NOT offered in the response?

Ive used this file: file. And Getting the following JSON response upon reading it:

```<code>{
"opts": {
    ...
},
"SheetNames": [
    "Dates"
],
"Sheets": {
    "Dates": {
        "!margins": {
           ...
        },
        "A1": {
            "v": "Name",
            "t": "s",
            "w": "Name"
        },
        "B1": {
            "v": "Birthday",
            "t": "s",
            "w": "Birthday"
        },
        "A2": {
            "v": "George Washington",
            "t": "s",
            "w": "George Washington"
        },
        "B2": {
            "v": "1732-02-22",
            "t": "s",
            "w": "1732-02-22"
        },
        "A3": {
            "v": "John Adams",
            "t": "s",
            "w": "John Adams"
        },
        "B3": {
            "v": "1735-10-19",
            "t": "s",
            "w": "1735-10-19"
        },
        "A4": {
            "v": "Thomas Jefferson",
            "t": "s",
            "w": "Thomas Jefferson"
        },
        "B4": {
            "v": "1743-04-13",
            "t": "s",
            "w": "1743-04-13"
        },
        "!ref": "A1:B4"
    }
},
"Preamble": {},
"Strings": [
...
],
"SSF": {
    ...
},
"Metadata": {
 ...
},
"Workbook": {
   ...
},
"Custprops": {
  ...
},
"Props": {
   ...
}
</code>```

And I created this parsing algorithm:

```<code>const getFirstColumnsFromSheet = () => {
    const selectedSheetName = "Dates";

    return (
        selectedSheetName &&
        Object.entries(wb['Sheets'][selectedSheetName])
            .filter(
                (it) => it[0] === it[0].toUpperCase() && /[A-Z]+[1]$/.test(it[0])
            )
            .map((it) => (it[1] as any)['v'])
    );
};
</code>```

It works fine but its a little try hard, I wonder if there is a simple way to get the column that doesnt include FILTERING - using the uppercase check and if it has the format of "Some letter and the number 1" characters - from ALL the data. (This simply filters out so you only get the fields like :A1,B2,C1,D1 etc...

Is there a more simple solution to this?

Body:
I dont understand why the fields of the first row NOT offered in the response?

Ive used this file: file. And Getting the following JSON response upon reading it:

{
"opts": {
    ...
},
"SheetNames": [
    "Dates"
],
"Sheets": {
    "Dates": {
        "!margins": {
           ...
        },
        "A1": {
            "v": "Name",
            "t": "s",
            "w": "Name"
        },
        "B1": {
            "v": "Birthday",
            "t": "s",
            "w": "Birthday"
        },
        "A2": {
            "v": "George Washington",
            "t": "s",
            "w": "George Washington"
        },
        "B2": {
            "v": "1732-02-22",
            "t": "s",
            "w": "1732-02-22"
        },
        "A3": {
            "v": "John Adams",
            "t": "s",
            "w": "John Adams"
        },
        "B3": {
            "v": "1735-10-19",
            "t": "s",
            "w": "1735-10-19"
        },
        "A4": {
            "v": "Thomas Jefferson",
            "t": "s",
            "w": "Thomas Jefferson"
        },
        "B4": {
            "v": "1743-04-13",
            "t": "s",
            "w": "1743-04-13"
        },
        "!ref": "A1:B4"
    }
},
"Preamble": {},
"Strings": [
...
],
"SSF": {
    ...
},
"Metadata": {
 ...
},
"Workbook": {
   ...
},
"Custprops": {
  ...
},
"Props": {
   ...
}

And I created this parsing algorithm:

const getFirstColumnsFromSheet = () => {
    const selectedSheetName = "Dates";

    return (
        selectedSheetName &&
        Object.entries(wb['Sheets'][selectedSheetName])
            .filter(
                (it) => it[0] === it[0].toUpperCase() && /[A-Z]+[1]$/.test(it[0])
            )
            .map((it) => (it[1] as any)['v'])
    );
};

It works fine but its a little try hard, I wonder if there is a simple way to get the column that doesnt include FILTERING - using the uppercase check and if it has the format of "Some letter and the number 1" characters - from ALL the data. (This simply filters out so you only get the fields like :A1,B2,C1,D1 etc...

Is there a more simple solution to this?


问:
Possibility of dialogflow
im new on dialogflow

Dialogflow intents with and without question
i already read this question, but its not answer my question.

so my requirement is like this

I have 100 paragraphs

I want to put 100 paragraphs to database

when the user asks something, the engine will automatically answer by looking for answers in the 100 paragraphs earlier

example:

I have 100 paragraphs about PHP programming learning materials

I input all the learning materials into the database

I asked how to replace the string? then the engine will answer by looking for answers in those 100 paragraphs

so my requirement is engine that without training phrases, the answers can be automatically searched in those 100 paragraphs.

is this possible in dialogflow?

Title: Possibility of dialogflow


问:
How to load the react library built using webpack to dynamically in a react application which is using react-scripts
All,

I have an issue while doing Dynamic import of React Library (Built using webpack) in to React Application (Built using react-scripts). I was unable to import the component with normal import statements. I have tried to add the Library instance to window object and use it in react application which is working fine, but limited to Class based Components. If I try to use Functional Components, it says

`Invalid Hook Call Warning
You are probably here because you got the following error message:

Hooks can only be called inside the body of a function component.

There are three common reasons you might be seeing it:

You might have mismatching versions of React and React DOM.
You might be breaking the Rules of Hooks.
You might have more than one copy of React in the same app.`

Can anyone help on resolving my issue?


问:
change mapping function method to function() method solidity
can anyone help to change this code:

mapping(address => uint) public balances;

into function

Full code:

```<code>pragma solidity ^0.8.0;

contract SmartSHop{

    mapping(address => uint) public balances;

    function deposit() public payable{
        balances[msg.sender] += msg.value;
    }

    function withdraw(uint _amount) public{

        require(balances[msg.sender]>= _amount, "Not enough ether");

        balances[msg.sender] -= _amount;

        (bool sent,) = msg.sender.call{value: _amount}("Sent");
        require(sent, "failed to send ETH");
    }

        function getBalance(address _owner) public view returns (uint){
            return address(_owner).balance;
    }
}
</code>```

Body:
can anyone help to change this code:

mapping(address => uint) public balances;

into function

Full code:

pragma solidity ^0.8.0;

contract SmartSHop{

    mapping(address => uint) public balances;

    function deposit() public payable{
        balances[msg.sender] += msg.value;
    }

    function withdraw(uint _amount) public{

        require(balances[msg.sender]>= _amount, "Not enough ether");

        balances[msg.sender] -= _amount;

        (bool sent,) = msg.sender.call{value: _amount}("Sent");
        require(sent, "failed to send ETH");
    }

        function getBalance(address _owner) public view returns (uint){
            return address(_owner).balance;
    }
}


问:
Required Query column result in array with import range if row number is matched
Required Sheet3 O1:O Column Result in Sheet1 T1:T Column if row # matched but result with import range because this is my sample data orignal have in another sheet

=BYROW(A1:A, LAMBDA(x, IF(x<>"",IFERROR(QUERY( IMPORTRANGE("1SKXg3dFp9a83LQfURrF-QlAJvaupERvnqrdPv2CHMXw", "Sheet3!A1:O"), "select Col15 where lower(Col1) matches '.*"&LOWER(OFFSET(x,,0))&".*' ", 0),),)))

I try this code where col1 matches Row 1 but not work please guide but i want where Col1 equal to row 1

Sample of my sheet link

https://docs.google.com/spreadsheets/d/1SKXg3dFp9a83LQfURrF-QlAJvaupERvnqrdPv2CHMXw/edit#gid=0


问:
Laravel Sanctum middleware with OR condition
I am using Laravel Sanctum for Token Based Authentication.

I have created a customer guard for customer. For Other users its default users table.

```<code>'guards' => [
    'web' => [
        'driver' => 'session',
        'provider' => 'users',
    ],

    'customer' => [
        'driver' => 'sanctum',
        'provider' => 'customers',
    ],
],

'providers' => [
    'users' => [
        'driver' => 'eloquent',
        'model' => App\Models\User::class,
    ],
    'customers' => [
        'driver' => 'eloquent',
        'model' => Customer::class,
    ],

],
</code>```

I was authenticating all other users using middleware' => ['auth:sanctum'] now for the given particular route, I want customer guard can also access this Route. But there is no such Functionality provided by Laravel for OR condition.

```<code>Route::group(['as' => 'business', 'prefix' => 'business', 'middleware' => ['auth:sanctum']], function () {
    Route::get('/categories', [BusinessCategoryController::class, 'listBusinessCategories'])->name('business-category');
    Route::get('/categories/{parentId}', [BusinessCategoryController::class, 'listBusinessSubCategories'])->name('business-sub-category');
});
</code>```

I just want middleware' => ['auth:sanctum'] or ['auth:customer']

Body:
I am using Laravel Sanctum for Token Based Authentication.

I have created a customer guard for customer. For Other users its default users table.

'guards' => [
    'web' => [
        'driver' => 'session',
        'provider' => 'users',
    ],

    'customer' => [
        'driver' => 'sanctum',
        'provider' => 'customers',
    ],
],

'providers' => [
    'users' => [
        'driver' => 'eloquent',
        'model' => App\Models\User::class,
    ],
    'customers' => [
        'driver' => 'eloquent',
        'model' => Customer::class,
    ],

],

I was authenticating all other users using middleware' => ['auth:sanctum'] now for the given particular route, I want customer guard can also access this Route. But there is no such Functionality provided by Laravel for OR condition.

Route::group(['as' => 'business', 'prefix' => 'business', 'middleware' => ['auth:sanctum']], function () {
    Route::get('/categories', [BusinessCategoryController::class, 'listBusinessCategories'])->name('business-category');
    Route::get('/categories/{parentId}', [BusinessCategoryController::class, 'listBusinessSubCategories'])->name('business-sub-category');
});

I just want middleware' => ['auth:sanctum'] or ['auth:customer']


问:
Understanding iOS string formatting in assembly code
I am new to assembly code and am learning a lot through examining disassembled iOS code through Hopper. One thing I cannot figure out is how to determine the variables that are being used in a formatted string. Here is a code snippet.

```<code>r0 = [var_60 myCustomString];
r0 = [r0 retain];
r22 = [[NSString stringWithFormat:@"%@%@%@"] retain];
[r0 release];
</code>```

As you can see a variable is set in r0 just prior to r22. Then stringWithFormat:@"%@%@%@" is called with three variables (i.e. %@).

How would I go about finding what the other two variables are. I know one is myCustomString but do I just go back through the code and determine what other variables have not been released? If so, what order would the formatted string work in. For example, would myCustomString be the first format variable (%@) or the last one since it was most recently defined.

Thank you for your help!

EDIT

Here is the decompiled view of this variable:

Body:
I am new to assembly code and am learning a lot through examining disassembled iOS code through Hopper. One thing I cannot figure out is how to determine the variables that are being used in a formatted string. Here is a code snippet.

r0 = [var_60 myCustomString];
r0 = [r0 retain];
r22 = [[NSString stringWithFormat:@"%@%@%@"] retain];
[r0 release];

As you can see a variable is set in r0 just prior to r22. Then stringWithFormat:@"%@%@%@" is called with three variables (i.e. %@).

How would I go about finding what the other two variables are. I know one is myCustomString but do I just go back through the code and determine what other variables have not been released? If so, what order would the formatted string work in. For example, would myCustomString be the first format variable (%@) or the last one since it was most recently defined.

Thank you for your help!

EDIT

Here is the decompiled view of this variable:


问:
Firefox Extension - Add devtools panel and log all scripts of the current page
I'm trying to make a firefox extension that creates a new panel in the devtools and log all of the URL of the scripts tag loaded in the current page. But I'm having some troubles with the communication between the panel and the inspected window. This is how it looks like:

Panel image

And when you click the button it may appear in the panel all the scripts loaded.

I don't know how to communicate the panel script with the inspector of the window, I tried with postMessage but returns undefined.

Always return undefined when calling it:

Undefined image

This is my manifest.json:

{
  "manifest_version":2,
  "version":"1.0",
  "name":"Panel",
  "devtools_page": "devtools/devtools-page.html",

  "background": {
    "scripts": ["background_scripts/background.js"]
  },

  "permissions": [
   "contextualIdentities", "cookies", "tabs", "storage", "webRequest", "<all_urls>"
  ],

 "content_scripts": [
 {
   "run_at": "document_end",
   "matches": ["http://*/*", "https://*/*", "<all_urls>"],
   "js":
   [
     "main.js"
   ]
 }]
}
```

I will appreciate if you may help me a bit with this.

Body:
I'm trying to make a firefox extension that creates a new panel in the devtools and log all of the URL of the scripts tag loaded in the current page. But I'm having some troubles with the communication between the panel and the inspected window. This is how it looks like:

Panel image

And when you click the button it may appear in the panel all the scripts loaded.

I don't know how to communicate the panel script with the inspector of the window, I tried with postMessage but returns undefined.

Always return undefined when calling it:

Undefined image

This is my manifest.json:

{
  "manifest_version":2,
  "version":"1.0",
  "name":"Panel",
  "devtools_page": "devtools/devtools-page.html",

  "background": {
    "scripts": ["background_scripts/background.js"]
  },

  "permissions": [
   "contextualIdentities", "cookies", "tabs", "storage", "webRequest", "<all_urls>"
  ],

 "content_scripts": [
 {
   "run_at": "document_end",
   "matches": ["http://*/*", "https://*/*", "<all_urls>"],
   "js":
   [
     "main.js"
   ]
 }]
}

I will appreciate if you may help me a bit with this.


问:
Column does not allow null error when trying to insert a UNIQUEIDENTIFIER
I want to insert guid values into an existing column called rowguid in an existing table.

I've created the column with this statement:

ALTER TABLE [myschema].[mytablename]
    ADD rowguid uniqueidentifier
```
<p>The column has been created and it's full of <code>NULL</code>s.</p>
<p>I've tried this to generate the IDs for every row:</p>
<pre class="lang-sql prettyprint-override"><code>INSERT INTO [myschema].[mytablename] (rowguid)
VALUES(NEWID())
</code>```

But this returns with:

Cannot insert the value NULL into column '[another column name in my table]', table '[database].[schema].[mytablename]'; column does not allow nulls. INSERT fails. The statement has been terminated.

Body:
I want to insert guid values into an existing column called rowguid in an existing table.

I've created the column with this statement:

ALTER TABLE [myschema].[mytablename]
    ADD rowguid uniqueidentifier

The column has been created and it's full of NULLs.

I've tried this to generate the IDs for every row:

INSERT INTO [myschema].[mytablename] (rowguid)
VALUES(NEWID())

But this returns with:

Cannot insert the value NULL into column '[another column name in my table]', table '[database].[schema].[mytablename]'; column does not allow nulls. INSERT fails. The statement has been terminated.


问:
Prometheus | Pods from other namespace are not in targets
Below is my config map for Prometheus:

I am not much familiar with the Prometheus config, definitely missing to change some parameters.
When I check service discovery I can see those pods but they are not in active targets.

```<code>apiVersion: v1
kind: ConfigMap
metadata:
  name: prometheus-server-conf
  labels:
    name: prometheus-server-conf
  namespace: default
data:
  prometheus.rules: |-
    groups:
    - name: alert
      rules:
      - alert: High Pod Memory
        expr: sum(container_memory_usage_bytes) > 1
        for: 1m
        labels:
          severity: slack
        annotations:
          summary: High Memory Usage
  prometheus.yml: |-
    global:
      scrape_interval: 5s
      evaluation_interval: 5s
    rule_files:
      - /etc/prometheus/prometheus.rules

    scrape_configs:
      - job_name: 'node-exporter'
        kubernetes_sd_configs:
          - role: endpoints
        relabel_configs:
        - source_labels: [__meta_kubernetes_endpoints_name]
          regex: 'node-exporter'
          action: keep

      - job_name: 'kubernetes-apiservers'

        kubernetes_sd_configs:
        - role: endpoints
        scheme: https

        tls_config:
          ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
        bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token

        relabel_configs:
        - source_labels: [__meta_kubernetes_namespace, __meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name]
          action: keep
          regex: default;kubernetes;https

      - job_name: 'kubernetes-nodes'

        scheme: https

        tls_config:
          ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
        bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token

        kubernetes_sd_configs:
        - role: node

        relabel_configs:
        - action: labelmap
          regex: __meta_kubernetes_node_label_(.+)
        - target_label: __address__
          replacement: kubernetes.default.svc:443
        - source_labels: [__meta_kubernetes_node_name]
          regex: (.+)
          target_label: __metrics_path__
          replacement: /api/v1/nodes/${1}/proxy/metrics

      - job_name: 'kubernetes-pods'

        kubernetes_sd_configs:
        - role: pod

        relabel_configs:
        - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
          action: keep
          regex: true
        - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path]
          action: replace
          target_label: __metrics_path__
          regex: (.+)
        - source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
          action: replace
          regex: ([^:]+)(?::\d+)?;(\d+)
          replacement: $1:$2
          target_label: __address__
        - action: labelmap
          regex: __meta_kubernetes_pod_label_(.+)
        - source_labels: [__meta_kubernetes_namespace]
          action: replace
          target_label: kubernetes_namespace
        - source_labels: [__meta_kubernetes_pod_name]
          action: replace
          target_label: kubernetes_pod_name

      - job_name: 'kube-state-metrics'
        static_configs:
          - targets: ['kube-state-metrics.kube-system.svc.cluster.local:8080']

      - job_name: 'kubernetes-cadvisor'

        scheme: https

        tls_config:
          ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
        bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token

        kubernetes_sd_configs:
        - role: node

        relabel_configs:
        - action: labelmap
          regex: __meta_kubernetes_node_label_(.+)
        - target_label: __address__
          replacement: kubernetes.default.svc:443
        - source_labels: [__meta_kubernetes_node_name]
          regex: (.+)
          target_label: __metrics_path__
          replacement: /api/v1/nodes/${1}/proxy/metrics/cadvisor

      - job_name: 'kubernetes-service-endpoints'

        kubernetes_sd_configs:
        - role: endpoints

        relabel_configs:
        - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scrape]
          action: keep
          regex: true
        - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scheme]
          action: replace
          target_label: __scheme__
          regex: (https?)
        - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_path]
          action: replace
          target_label: __metrics_path__
          regex: (.+)
        - source_labels: [__address__, __meta_kubernetes_service_annotation_prometheus_io_port]
          action: replace
          target_label: __address__
          regex: ([^:]+)(?::\d+)?;(\d+)
          replacement: $1:$2
        - action: labelmap
          regex: __meta_kubernetes_service_label_(.+)
        - source_labels: [__meta_kubernetes_namespace]
          action: replace
          target_label: kubernetes_namespace
        - source_labels: [__meta_kubernetes_service_name]
          action: replace
          target_label: kubernetes_name
</code>```

Tried with mentioned Prometheus config, expecting all pods in default namespace should be visible in Targets.

Body:
Below is my config map for Prometheus:

I am not much familiar with the Prometheus config, definitely missing to change some parameters.
When I check service discovery I can see those pods but they are not in active targets.

apiVersion: v1
kind: ConfigMap
metadata:
  name: prometheus-server-conf
  labels:
    name: prometheus-server-conf
  namespace: default
data:
  prometheus.rules: |-
    groups:
    - name: alert
      rules:
      - alert: High Pod Memory
        expr: sum(container_memory_usage_bytes) > 1
        for: 1m
        labels:
          severity: slack
        annotations:
          summary: High Memory Usage
  prometheus.yml: |-
    global:
      scrape_interval: 5s
      evaluation_interval: 5s
    rule_files:
      - /etc/prometheus/prometheus.rules

    scrape_configs:
      - job_name: 'node-exporter'
        kubernetes_sd_configs:
          - role: endpoints
        relabel_configs:
        - source_labels: [__meta_kubernetes_endpoints_name]
          regex: 'node-exporter'
          action: keep

      - job_name: 'kubernetes-apiservers'

        kubernetes_sd_configs:
        - role: endpoints
        scheme: https

        tls_config:
          ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
        bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token

        relabel_configs:
        - source_labels: [__meta_kubernetes_namespace, __meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name]
          action: keep
          regex: default;kubernetes;https

      - job_name: 'kubernetes-nodes'

        scheme: https

        tls_config:
          ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
        bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token

        kubernetes_sd_configs:
        - role: node

        relabel_configs:
        - action: labelmap
          regex: __meta_kubernetes_node_label_(.+)
        - target_label: __address__
          replacement: kubernetes.default.svc:443
        - source_labels: [__meta_kubernetes_node_name]
          regex: (.+)
          target_label: __metrics_path__
          replacement: /api/v1/nodes/${1}/proxy/metrics

      - job_name: 'kubernetes-pods'

        kubernetes_sd_configs:
        - role: pod

        relabel_configs:
        - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
          action: keep
          regex: true
        - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path]
          action: replace
          target_label: __metrics_path__
          regex: (.+)
        - source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
          action: replace
          regex: ([^:]+)(?::\d+)?;(\d+)
          replacement: $1:$2
          target_label: __address__
        - action: labelmap
          regex: __meta_kubernetes_pod_label_(.+)
        - source_labels: [__meta_kubernetes_namespace]
          action: replace
          target_label: kubernetes_namespace
        - source_labels: [__meta_kubernetes_pod_name]
          action: replace
          target_label: kubernetes_pod_name

      - job_name: 'kube-state-metrics'
        static_configs:
          - targets: ['kube-state-metrics.kube-system.svc.cluster.local:8080']

      - job_name: 'kubernetes-cadvisor'

        scheme: https

        tls_config:
          ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
        bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token

        kubernetes_sd_configs:
        - role: node

        relabel_configs:
        - action: labelmap
          regex: __meta_kubernetes_node_label_(.+)
        - target_label: __address__
          replacement: kubernetes.default.svc:443
        - source_labels: [__meta_kubernetes_node_name]
          regex: (.+)
          target_label: __metrics_path__
          replacement: /api/v1/nodes/${1}/proxy/metrics/cadvisor

      - job_name: 'kubernetes-service-endpoints'

        kubernetes_sd_configs:
        - role: endpoints

        relabel_configs:
        - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scrape]
          action: keep
          regex: true
        - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scheme]
          action: replace
          target_label: __scheme__
          regex: (https?)
        - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_path]
          action: replace
          target_label: __metrics_path__
          regex: (.+)
        - source_labels: [__address__, __meta_kubernetes_service_annotation_prometheus_io_port]
          action: replace
          target_label: __address__
          regex: ([^:]+)(?::\d+)?;(\d+)
          replacement: $1:$2
        - action: labelmap
          regex: __meta_kubernetes_service_label_(.+)
        - source_labels: [__meta_kubernetes_namespace]
          action: replace
          target_label: kubernetes_namespace
        - source_labels: [__meta_kubernetes_service_name]
          action: replace
          target_label: kubernetes_name

Tried with mentioned Prometheus config, expecting all pods in default namespace should be visible in Targets.


问:
d3js not showing any objects on browser
I'm new to d3js and trying to vizualize a decision-tree from the following Github
https://github.com/fractalytics/sklearn-tree-d3js

when I download everything from above and open the index.html nothing shown on my web browser.
I swicthed from Chrome to FireFox but nothing happened.
What's wrong or missing in this case??

I tried some other examples like https://gist.github.com/ajschumacher/65eda1df2b0dd2cf616f
but got the same result. nothing shown on my browser.

Title: d3js not showing any objects on browser


问:
Why would running Pex Explorations result in ignoring a previously Pex-generated test method?
Code being tested:

```<code>public class TestReader
{
    public string Content { get; private set; }

    public void LoadFile(string fileName)
    {
        var content = FileSystem.ReadAllText(fileName);
        if (!content.StartsWith("test"))
            throw new ArgumentException("invalid file");
        this.Content = content;
    }
}

public static class FileSystem
{
    public static string ReadAllText(string fileName)
    {
        return File.ReadAllText(fileName);
    }
}
</code>```

Pex method in test project:

```<code>[PexMethod]
public void CheckValidFileWithPex(string content)
{
    // arrange
    var fileName = "test.txt";
    Moles_Example.Moles.MFileSystem.ReadAllTextString =
        delegate(string f)
        {
            Assert.IsTrue(f == fileName); return content;
        };
    // act
    var test = new TestReader();
    test.LoadFile(fileName);
    // assert
    Assert.AreEqual(content, test.Content);
}
</code>```

When I first run "Pex Explorations" on CheckValidFileWithPex(string content), five test methods are generated with the following values for content:

null

""

"\0\0\0\0"

"test"

"\0\0\0\0\0"

However, if I run "Pex Explorations" again, no changes made to the generated tests, existing test project code, or main project prior to second execution, then only 4 tests are listed as generated and the test input from item 3 ("\0\0\0\0") is missing.

The source code of the Pex-generated test file still has a test method for this case, but I do not understand why this case is not listed in Pex Exploration Results.

Thank you for your insight.

ContentLicense: CC BY-SA 3.0

Body:
Code being tested:

public class TestReader
{
    public string Content { get; private set; }

    public void LoadFile(string fileName)
    {
        var content = FileSystem.ReadAllText(fileName);
        if (!content.StartsWith("test"))
            throw new ArgumentException("invalid file");
        this.Content = content;
    }
}

public static class FileSystem
{
    public static string ReadAllText(string fileName)
    {
        return File.ReadAllText(fileName);
    }
}

Pex method in test project:

[PexMethod]
public void CheckValidFileWithPex(string content)
{
    // arrange
    var fileName = "test.txt";
    Moles_Example.Moles.MFileSystem.ReadAllTextString =
        delegate(string f)
        {
            Assert.IsTrue(f == fileName); return content;
        };
    // act
    var test = new TestReader();
    test.LoadFile(fileName);
    // assert
    Assert.AreEqual(content, test.Content);
}

When I first run "Pex Explorations" on CheckValidFileWithPex(string content), five test methods are generated with the following values for content:

null

""

"\0\0\0\0"

"test"

"\0\0\0\0\0"

However, if I run "Pex Explorations" again, no changes made to the generated tests, existing test project code, or main project prior to second execution, then only 4 tests are listed as generated and the test input from item 3 ("\0\0\0\0") is missing.

The source code of the Pex-generated test file still has a test method for this case, but I do not understand why this case is not listed in Pex Exploration Results.

Thank you for your insight.


问:
how nest js handle db connection for read write queries?
in my project have one database, I am creating one read connection and one write connection.
But for the GET method, the select query is also excepting the write DB connection.

How to find, which DB connection is connecting for which request in nest js?


问:
PWA Automated test with Selenium IDE
I'm having trouble automating PWA tests using selenium IDE.
Indeed I fill a form and at the time of saving the button "css=.hover\3Aopacity-90" remains grayed whereas I filled all the obligatory fields.

I also have the same problem when I switch from one page to another with toaster eruption and when I want to select a label in a dropdown list through the search bar "id=headlessui-combobox-input-".

If you can help me to move forward please. Thanks

Title: PWA Automated test with Selenium IDE