问:
base64 image is not showing in email template
I'm trying to add application logo in the email template format but image is not visible. I just inspected the image from the email then I found that src in the img tag is not showing why?

```<code><img data-imagetype="DataUri" blockedimagesrc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot">
</code>```

Base64 data image is not assigned to the blockedimagesrc attribute rather than the src attribute as mention above.

Any suggestion would be highly appreciated.

Body:
I'm trying to add application logo in the email template format but image is not visible. I just inspected the image from the email then I found that src in the img tag is not showing why?

Base64 data image is not assigned to the blockedimagesrc attribute rather than the src attribute as mention above.

Any suggestion would be highly appreciated.


来源: stackexchange

问:
Mismatched type signatures when using Seaborn regplot
I'm trying to plot a regression plot of "peak-rpm" vs. "price" from this dataset.
I've tried the code;

```<code>sns.regplot(x="peak-rpm",y="price", data=df)
</code>```

I'm getting the scatterplot as output without the regression line, and showing the error;

UFuncTypeError: ufunc 'multiply' did not contain a loop with signature matching types (dtype('<U4'), dtype('float64')) -> None

How do I solve this?

Example Output

I'm able to get the desired result when I plot "engine-size" against "price";

```<code>sns.regplot(x="engine-size",y="price", data=df)
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I'm trying to plot a regression plot of "peak-rpm" vs. "price" from this dataset.
I've tried the code;

sns.regplot(x="peak-rpm",y="price", data=df)

I'm getting the scatterplot as output without the regression line, and showing the error;

UFuncTypeError: ufunc 'multiply' did not contain a loop with signature matching types (dtype('<U4'), dtype('float64')) -> None

How do I solve this?

Example Output

I'm able to get the desired result when I plot "engine-size" against "price";

sns.regplot(x="engine-size",y="price", data=df)


问:
VS Code Flutter comma formatting like Haskell
I sort of liked this format

```<code>data Device = Device
    { appCodeNameDevice :: Text
    , appNameDevice :: Text
    , appVersionDevice :: Text
    , deviceMemoryDevice :: Int
    , languageDevice :: Text
    , platformDevice :: Text
    , productDevice :: Text
    , productSubDevice :: Text
    , userAgentDevice :: Text
    , vendorDevice :: Text
    , vendorSubDevice :: Text
    , hardwareConcurrencyDevice :: Int
    } deriving (Show)
</code>```

Would you know how to configure VS-code to do this for flutter. I use prettier, but cannot find how to configure this in that addon

Body:
I sort of liked this format

data Device = Device
    { appCodeNameDevice :: Text
    , appNameDevice :: Text
    , appVersionDevice :: Text
    , deviceMemoryDevice :: Int
    , languageDevice :: Text
    , platformDevice :: Text
    , productDevice :: Text
    , productSubDevice :: Text
    , userAgentDevice :: Text
    , vendorDevice :: Text
    , vendorSubDevice :: Text
    , hardwareConcurrencyDevice :: Int
    } deriving (Show)

Would you know how to configure VS-code to do this for flutter. I use prettier, but cannot find how to configure this in that addon


问:
How to simulate the exact same network traffic that was previoulsy recorded?
On Unix, how to simulate the exact same network traffic that was previously recorded?

I have a LAN made of 2 machines:

A local PC with interface eth0 and IP 192.168.1.1. On this PC runs a code C that listens to eth0, grab UDP packets and produce a result with them.

A remote hardware with IP 192.168.1.10. The hardware needs an initialization step (configuration, handshake, acknowledgment) and needs to be maintained active with a heartbeat. As long as the hardware is active, it sends data (grabbed by the local PC at the other end). All the different communications are done through different ports (see picture).

On the local PC, I plug the remote running HW, run tcpdump -i eth0 -w dump.pcap & (running in background), and just after that I run the code C that uses UDP packets received from HW (in parallel tcpdump is running). This produces a result R1 on the local PC: R1 is valid and can be post-processed.

Now, after the record dump.pcap is done, I let the remote HW running (otherwise eth0 dies - ip a does no more associate an IP to eth0), I run tcpreplay -K --intf1=eth0 dump.pcap & (running in background), and just after that I re-run the code C that uses UDP packets received from tcpreplay running in parallel (at least, that's my understanding of what should occur). The traces when C runs looks correct (initialization OK, no error, running / receiving looks OK). Unfortunately, C produces another result R2... Which is different from R1: R2 is invalid and can not even be post-processed?! The size of R2 is about the size of R1 but seems to be filled with zero/uninitialized data.

Is it possible to simulate the exact same traffic that the one that was previously recorded? If yes, what did I miss or what do I do wrong?

Note: I use a bash script to run tcpdump and C just one after the other when recording, and run tcpreplay and C just one after the other when replaying (trying to do things the same ways with similar delays as much as possible).


问:
Visual Studio, Connected Service, RestApi client generator, Nswag does not manage range definition of status code (4XX)
I have a OpenApi definition like this :

'200':
     [...]
'4XX':
     $ref: '#/components/responses/error'
```
<p>Generate C# code by Nswag in Visual Studio 2022 :</p>
<pre class="lang-cs prettyprint-override"><code>if (status_ == 4XX)
{
</code>```

This code does not compile.

I already try to :

update the version of Nswag

Use NswagStudio

Sample of expected code (given by https://editor.swagger.io/)

if (((int)status_ ) >= 400)
```

Does anyone already fixed that ? And how ?

Thanks you very much

Body:
I have a OpenApi definition like this :

'200':
     [...]
'4XX':
     $ref: '#/components/responses/error'

Generate C# code by Nswag in Visual Studio 2022 :

if (status_ == 4XX)
{

This code does not compile.

I already try to :

update the version of Nswag

Use NswagStudio

Sample of expected code (given by https://editor.swagger.io/)

if (((int)status_ ) >= 400)

Does anyone already fixed that ? And how ?

Thanks you very much


问:
psql copy running out of tmp space on what host?
I have a python process that forks a psql command.  The command connects to the remote database and COPY's into a local psql which reads the data.  Here's the command vastly simplified and broken into several lines for readability.:

```<code>psql --quiet -X --quiet
    --command='\pset tuples_only'
    --command='\copy (TABLE QUERY) to program
        \'psql "--command=copy TABLE from stdin with (format binary)"
        postgresql://apolloqa:Apollo123@LOCALHOST:PORT/LOCAL_DB\'
    with (format binary)' postgresql://REMOTE_USER:REMOTE_PASS@REMOTE_HOST:PORT/REMOTE_DB
</code>```

(The quotes may be wrong after editing it from my logs, but it works on other machines, and it's not germane to my question.)  The logs show:

```<code>Dec 20 03:06:51 LOCAL_HOST copying_server.sh[2788715]: PSQL STDOUT:
Dec 20 03:06:51 LOCAL_HOST copying_server.sh[2788715]: COPY 1310
Dec 20 03:06:51 LOCAL_HOST copying_server.sh[2788715]: COPY 29285588
Dec 20 03:06:51 LOCAL_HOST copying_server.sh[2788715]:
Dec 20 03:06:51 LOCAL_HOST copying_server.sh[2788715]: PSQL STDERR:
Dec 20 03:06:51 LOCAL_HOST copying_server.sh[2788715]: ERROR:  could not write to file "base/pgsql_tmp/pgsql_tmp122309.3": No space left on device
Dec 20 03:06:51 LOCAL_HOST db_copy_server.sh[2788715]: ERROR:  COPY file signature not recognized
</code>```

The psql breaks because of no disk space.  But, which host ran out of disk space?  Local or remote host?  When I look at my local host, it has plenty of space.  So I doubt it's a local problem, but I cannot go onto the remote machine to see how much space it has.

I want to make sure it's not on my local host, before going to the admins for the remote host and remote database.

Thanks for the help.

Body:
I have a python process that forks a psql command.  The command connects to the remote database and COPY's into a local psql which reads the data.  Here's the command vastly simplified and broken into several lines for readability.:

psql --quiet -X --quiet
    --command='\pset tuples_only'
    --command='\copy (TABLE QUERY) to program
        \'psql "--command=copy TABLE from stdin with (format binary)"
        postgresql://apolloqa:Apollo123@LOCALHOST:PORT/LOCAL_DB\'
    with (format binary)' postgresql://REMOTE_USER:REMOTE_PASS@REMOTE_HOST:PORT/REMOTE_DB

(The quotes may be wrong after editing it from my logs, but it works on other machines, and it's not germane to my question.)  The logs show:

Dec 20 03:06:51 LOCAL_HOST copying_server.sh[2788715]: PSQL STDOUT:
Dec 20 03:06:51 LOCAL_HOST copying_server.sh[2788715]: COPY 1310
Dec 20 03:06:51 LOCAL_HOST copying_server.sh[2788715]: COPY 29285588
Dec 20 03:06:51 LOCAL_HOST copying_server.sh[2788715]:
Dec 20 03:06:51 LOCAL_HOST copying_server.sh[2788715]: PSQL STDERR:
Dec 20 03:06:51 LOCAL_HOST copying_server.sh[2788715]: ERROR:  could not write to file "base/pgsql_tmp/pgsql_tmp122309.3": No space left on device
Dec 20 03:06:51 LOCAL_HOST db_copy_server.sh[2788715]: ERROR:  COPY file signature not recognized

The psql breaks because of no disk space.  But, which host ran out of disk space?  Local or remote host?  When I look at my local host, it has plenty of space.  So I doubt it's a local problem, but I cannot go onto the remote machine to see how much space it has.

I want to make sure it's not on my local host, before going to the admins for the remote host and remote database.

Thanks for the help.


问:
How do I make DataGridView header text align with cell text
The very standart WinForms DataGridView with some data (both columns are string) looks like this. Notice the header and data don't align, header has some empty space on the left (marked yellow on the first column).

How do I make it go away?

There are similar questions out there, but they are about header text being off-center, in this case it's left aligned.

What I tried:

grd.EnableHeadersVisualStyles = false;

column.HeaderCell.Style.Padding = new Padding(0, 0, 0, 0);
column.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
column.SortMode = DataGridViewColumnSortMode.NotSortable;
column.Resizable = DataGridViewTriState.False;
```

I know there is the CellPainting-Event I can probably use, but I'd really rather not.

Body:
The very standart WinForms DataGridView with some data (both columns are string) looks like this. Notice the header and data don't align, header has some empty space on the left (marked yellow on the first column).

How do I make it go away?

There are similar questions out there, but they are about header text being off-center, in this case it's left aligned.

What I tried:

grd.EnableHeadersVisualStyles = false;

column.HeaderCell.Style.Padding = new Padding(0, 0, 0, 0);
column.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
column.SortMode = DataGridViewColumnSortMode.NotSortable;
column.Resizable = DataGridViewTriState.False;

I know there is the CellPainting-Event I can probably use, but I'd really rather not.


问:
Is it possible to get H.264's Picture Parameter Set (PPS) from Android encoder?
I am encoding bitmap to H.264. Please allow me to skip the code here because other places have excellent descriptions such as this one. It would take up a lot of space. The main idea is configuring MediaCodec to do the encoding.

The encoding appears to work well. The output frames have the following H.264 NAL unit types:

```<code>7 (Sequence parameter set)
5 (Coded slice of an IDR picture)
1 (Coded slice of a non-IDR picture)
1
1
1
...
</code>```

You can see it generates SPS but not PPS. My understanding is that PPS is needed for producing a valid MP4 file.

Is there a way to obtain PPS from the encoder?

Body:
I am encoding bitmap to H.264. Please allow me to skip the code here because other places have excellent descriptions such as this one. It would take up a lot of space. The main idea is configuring MediaCodec to do the encoding.

The encoding appears to work well. The output frames have the following H.264 NAL unit types:

7 (Sequence parameter set)
5 (Coded slice of an IDR picture)
1 (Coded slice of a non-IDR picture)
1
1
1
...

You can see it generates SPS but not PPS. My understanding is that PPS is needed for producing a valid MP4 file.

Is there a way to obtain PPS from the encoder?


问:
How do I stop Visual Studio Code from opening after I try to execute a .pl file from Command Prompt?
I use command prompt to run a file.pl and every time I do Visual Studio Code keeps auto launching and showing me the lines of code. I don't want it to open, just run the file in command prompt.

see above, it's pretty self explanatory


问:
Error: Where does the reference to this value come from? ("System.ArgumentException: [...] doesn't have value for keyword)
Could you please help me fix the code below?

It runs fine in Bash but when I run a debugger in Visual Studio I get the error "System.ArgumentException: 'Connection string doesn't have value for keyword 'connectionString'.'".

So I understand that there's an issue with my reference to connectionString but I don't know how to fix it. I tried replacing connectionString with my actual connection string and it works, but I'd like to avoid adding my actual connecting string directly in my code.

I'm a beginner so I get very confused.

```<code>using TestAppConfig;

var builder = WebApplication.CreateBuilder(args);

string connectionString = builder.Configuration.GetConnectionString("AppConfig");

builder.Configuration.AddAzureAppConfiguration("connectionString");

builder.Services.AddRazorPages();

builder.Services.Configure<Settings>(builder.Configuration.GetSection("TestApp:Settings"));

var app = builder.Build();

if (!app.Environment.IsDevelopment())
{
    app.UseExceptionHandler("/Error");
    app.UseHsts();
}

app.UseHttpsRedirection();
app.UseStaticFiles();

app.UseRouting();

app.UseAuthorization();

app.MapRazorPages();

app.Run();
</code>```

This code comes from a tutorial and in the process of running it I also ran this beforehand:

```<code>dotnet user-secrets init
dotnet user-secrets set ConnectionStrings:AppConfig "<my_connection_string>"
</code>```

I'm sure this is very basic but I can't fix it :(

Thank you

Body:
Could you please help me fix the code below?

It runs fine in Bash but when I run a debugger in Visual Studio I get the error "System.ArgumentException: 'Connection string doesn't have value for keyword 'connectionString'.'".

So I understand that there's an issue with my reference to connectionString but I don't know how to fix it. I tried replacing connectionString with my actual connection string and it works, but I'd like to avoid adding my actual connecting string directly in my code.

I'm a beginner so I get very confused.

using TestAppConfig;

var builder = WebApplication.CreateBuilder(args);

string connectionString = builder.Configuration.GetConnectionString("AppConfig");

builder.Configuration.AddAzureAppConfiguration("connectionString");

builder.Services.AddRazorPages();

builder.Services.Configure<Settings>(builder.Configuration.GetSection("TestApp:Settings"));

var app = builder.Build();

if (!app.Environment.IsDevelopment())
{
    app.UseExceptionHandler("/Error");
    app.UseHsts();
}

app.UseHttpsRedirection();
app.UseStaticFiles();

app.UseRouting();

app.UseAuthorization();

app.MapRazorPages();

app.Run();

This code comes from a tutorial and in the process of running it I also ran this beforehand:

dotnet user-secrets init
dotnet user-secrets set ConnectionStrings:AppConfig "<my_connection_string>"

I'm sure this is very basic but I can't fix it :(

Thank you


问:
Why skipping unsigned char breaks the program?
I want to send messages via UART interface, I had the following program:

#ifndef F_CPU
#error "F_CPU has to be defined"
#endif

#ifndef CONSOLE_BAUD
#pragma message "CONSOLE_BAUD was not defined, using 9600"
#define CONSOLE_BAUD 9600
#endif
#define UBRR_VALUE F_CPU/16/CONSOLE_BAUD-1

// init
UBRRH = (unsigned char)(UBRR_VALUE >> 8);
UBRRL = (unsigned char)UBRR_VALUE;
UCSRB = (1 << TXEN);
UCSRC = (1 << URSEL) | (1 << USBS) | (3 << UCSZ0);

// send
while (!(UCSRA & (1 << UDRE)));
UDR = 'A';
```
<p>This doesn't work. The HEX being sent is <code>00</code>.</p>
<p>I changed that to the following:</p>
<pre class="lang-cpp prettyprint-override"><code>#ifndef F_CPU
#error "F_CPU has to be defined"
#endif

#ifndef CONSOLE_BAUD
#pragma message "CONSOLE_BAUD was not defined, using 9600"
#define CONSOLE_BAUD 9600
#endif
#define UBRR_VALUE F_CPU/16/CONSOLE_BAUD-1

// init
unsigned int ubrr = UBRR_VALUE; // changed
UBRRH = (unsigned char)(ubrr >> 8); // changed
UBRRL = (unsigned char)ubrr; // changed
UCSRB = (1 << TXEN);
UCSRC = (1 << URSEL) | (1 << USBS) | (3 << UCSZ0);

// send
while (!(UCSRA & (1 << UDRE)));
UDR = 'A';
</code>```

And it started to work. Why is that? What's the difference between assigning the preprocessor directive directly to UBRRX and having an intermediary variable?

// EDIT
The question was marked as a duplicate although I had no chance to find the linked duplicate, since I did not see the issue (lack of parentheses) in the first place. I think that marking my question as a duplicate is unfair.

Body:
I want to send messages via UART interface, I had the following program:

#ifndef F_CPU
#error "F_CPU has to be defined"
#endif

#ifndef CONSOLE_BAUD
#pragma message "CONSOLE_BAUD was not defined, using 9600"
#define CONSOLE_BAUD 9600
#endif
#define UBRR_VALUE F_CPU/16/CONSOLE_BAUD-1

// init
UBRRH = (unsigned char)(UBRR_VALUE >> 8);
UBRRL = (unsigned char)UBRR_VALUE;
UCSRB = (1 << TXEN);
UCSRC = (1 << URSEL) | (1 << USBS) | (3 << UCSZ0);

// send
while (!(UCSRA & (1 << UDRE)));
UDR = 'A';

This doesn't work. The HEX being sent is 00.

I changed that to the following:

#ifndef F_CPU
#error "F_CPU has to be defined"
#endif

#ifndef CONSOLE_BAUD
#pragma message "CONSOLE_BAUD was not defined, using 9600"
#define CONSOLE_BAUD 9600
#endif
#define UBRR_VALUE F_CPU/16/CONSOLE_BAUD-1

// init
unsigned int ubrr = UBRR_VALUE; // changed
UBRRH = (unsigned char)(ubrr >> 8); // changed
UBRRL = (unsigned char)ubrr; // changed
UCSRB = (1 << TXEN);
UCSRC = (1 << URSEL) | (1 << USBS) | (3 << UCSZ0);

// send
while (!(UCSRA & (1 << UDRE)));
UDR = 'A';

And it started to work. Why is that? What's the difference between assigning the preprocessor directive directly to UBRRX and having an intermediary variable?

// EDIT
The question was marked as a duplicate although I had no chance to find the linked duplicate, since I did not see the issue (lack of parentheses) in the first place. I think that marking my question as a duplicate is unfair.


问:
How to fetch and keep updated data with flutter_hooks?
I'm studying flutter_hooks library. My aim is to fetch data into model and be able to refresh it any time. Also I'd like to refresh data from different screens. Currently I do it this way:

Page class:

```<code>class NewPage extends HookWidget{
  @override
  Widget build(BuildContext context) {
    final holder=useState<ModelHolder>(ModelHolder()).value;
    final notifier=useListenable(holder.notifier);
    final model=notifier.value;
    final refresh=useState<bool>(false);
    useEffect(()  {
      print('refetching');
      holder.fetch();
    },[refresh.value]);
    print('model:$model, ${model.hashCode}');
    return Scaffold(
      appBar: AppBar(
        title: Text('Page 2'),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () {
          refresh.value=!refresh.value;//trigger refresh
        },
        child: const Icon(Icons.add),
      ),
    );
  }

}
</code>```

ModelHolder class:

```<code>class ModelHolder {
  final ValueNotifier<Model?> notifier = ValueNotifier<Model?>(null);

  void fetch() async {
    await Future.delayed(const Duration(seconds: 2));//do server call
    notifier.value=Model('data');
  }
}
</code>```

Model class:

```<code>class Model{
  final String value;
  Model(this.value);
}
</code>```

Basically this code works as expected. The only thing I'm confused is refresh variable in the NewPage. Due to this I can't extract hook's logic into custom hook. This is a typical task. I suspect that I'm inventing a wheel. What is the right way of fetching/updating data with flutter_hooks?

UPD: I moved refresh property into ModelHolder and now able to isolate everything in a custom hook.

holder:

```<code>class ModelHolder {
  final ValueNotifier<bool> refresher;
  final ValueNotifier<Model?> notifier = ValueNotifier<Model?>(null);

  ModelHolder(this.refresher);

  void fetch() async {
    await Future.delayed(const Duration(seconds: 2));//do server call
    notifier.value=Model('data');
  }
}
</code>```

Custom hook:

```<code>ModelHolder useModel(){
  final refresh=useState<bool>(false);
  final holder=useState(ModelHolder(refresh)).value;
  useListenable(holder.notifier);
  useEffect(()  {
    print('refetching');
    holder.fetch();
  },[refresh.value]);
  return holder;
}
</code>```

Usage:

```<code>Widget build(BuildContext context) {
    final holder=useModel();
    ...
}
</code>```

And I can pass holder to other routes to update it from there.

Body:
I'm studying flutter_hooks library. My aim is to fetch data into model and be able to refresh it any time. Also I'd like to refresh data from different screens. Currently I do it this way:

Page class:

class NewPage extends HookWidget{
  @override
  Widget build(BuildContext context) {
    final holder=useState<ModelHolder>(ModelHolder()).value;
    final notifier=useListenable(holder.notifier);
    final model=notifier.value;
    final refresh=useState<bool>(false);
    useEffect(()  {
      print('refetching');
      holder.fetch();
    },[refresh.value]);
    print('model:$model, ${model.hashCode}');
    return Scaffold(
      appBar: AppBar(
        title: Text('Page 2'),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () {
          refresh.value=!refresh.value;//trigger refresh
        },
        child: const Icon(Icons.add),
      ),
    );
  }

}

ModelHolder class:

class ModelHolder {
  final ValueNotifier<Model?> notifier = ValueNotifier<Model?>(null);

  void fetch() async {
    await Future.delayed(const Duration(seconds: 2));//do server call
    notifier.value=Model('data');
  }
}

Model class:

class Model{
  final String value;
  Model(this.value);
}

Basically this code works as expected. The only thing I'm confused is refresh variable in the NewPage. Due to this I can't extract hook's logic into custom hook. This is a typical task. I suspect that I'm inventing a wheel. What is the right way of fetching/updating data with flutter_hooks?

UPD: I moved refresh property into ModelHolder and now able to isolate everything in a custom hook.

holder:

class ModelHolder {
  final ValueNotifier<bool> refresher;
  final ValueNotifier<Model?> notifier = ValueNotifier<Model?>(null);

  ModelHolder(this.refresher);

  void fetch() async {
    await Future.delayed(const Duration(seconds: 2));//do server call
    notifier.value=Model('data');
  }
}

Custom hook:

ModelHolder useModel(){
  final refresh=useState<bool>(false);
  final holder=useState(ModelHolder(refresh)).value;
  useListenable(holder.notifier);
  useEffect(()  {
    print('refetching');
    holder.fetch();
  },[refresh.value]);
  return holder;
}

Usage:

Widget build(BuildContext context) {
    final holder=useModel();
    ...
}

And I can pass holder to other routes to update it from there.


问:
React libray created with rollup not working css with srr or nextjs?
I create a simple react packages for personal uses (private package). But when I want to use it into nextjs project it's css not working with ssr. Actually, working but not ssr friendly. Here after component loading then css will be loaded. But I want it with ssr. I mean css also work with ssr.

rollup.config.mjs-

```<code>import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import typescript from "@rollup/plugin-typescript";
import dts from "rollup-plugin-dts";
import postcss from "rollup-plugin-postcss";
import peerDepsExternal from "rollup-plugin-peer-deps-external";

export default [
    {
        input: "src/index.ts",
        output: [
            {
                file: "dist/cjs/index.js",
                format: "cjs",
                sourcemap: true,
            },
            {
                file: "dist/esm/index.js",
                format: "esm",
                sourcemap: true,
            },
        ],
        plugins: [
            peerDepsExternal(),
            resolve(),
            commonjs(),
            typescript({ tsconfig: "./tsconfig.json" }),
            postcss()
        ],
        external: ["react", "react-dom"]
    },
    {
        input: "dist/esm/types/index.d.ts",
        output: [{ file: "dist/index.d.ts", format: "esm" }],
        plugins: [dts()],
        external: [/\.css$/]
    }
];
</code>```

Body:
I create a simple react packages for personal uses (private package). But when I want to use it into nextjs project it's css not working with ssr. Actually, working but not ssr friendly. Here after component loading then css will be loaded. But I want it with ssr. I mean css also work with ssr.

rollup.config.mjs-

import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import typescript from "@rollup/plugin-typescript";
import dts from "rollup-plugin-dts";
import postcss from "rollup-plugin-postcss";
import peerDepsExternal from "rollup-plugin-peer-deps-external";

export default [
    {
        input: "src/index.ts",
        output: [
            {
                file: "dist/cjs/index.js",
                format: "cjs",
                sourcemap: true,
            },
            {
                file: "dist/esm/index.js",
                format: "esm",
                sourcemap: true,
            },
        ],
        plugins: [
            peerDepsExternal(),
            resolve(),
            commonjs(),
            typescript({ tsconfig: "./tsconfig.json" }),
            postcss()
        ],
        external: ["react", "react-dom"]
    },
    {
        input: "dist/esm/types/index.d.ts",
        output: [{ file: "dist/index.d.ts", format: "esm" }],
        plugins: [dts()],
        external: [/\.css$/]
    }
];


问:
Power Automate - Monthly flow but only on 5th business day
I am a Power BI user, but new to Power Automate.  I have a Power BI dashboard in the cloud and want to create a Power Automate flow to execute the Power BI subscription on the 5th business day of each month, so I need to exclude weekends and holidays.  Is this possible to do in Power Automate?  Do I need to create an Excel calendar and store it somewhere for the flow to read it?  If so, where do I store this file? Or do I need to create a Sharepoint List?  Thanks for any help</p>


问:
MappedSupperClass properties not found by Spring Data JPA Test
Testing queries that include properties of a MappedSuperClass as query parameters leads to a column not found error in a Spring Data JPA test such as org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "INSERT-COLUMN-NAME" not found; SQL statement:

Spring Boot 3.0.0 and 2.7.x

Spring Data JPA

@Query [native] custom query

I thought this was an SQL mapping issue but @MappedSuperClass documentation described classes that extend a MappedSuperClass to simply inherit the properties defined in the said super class:

The Jarkata JPA 3.0 specification described a mapped super class as:

"An entity may inherit from a superclass that provides persistent entity state and mapping information, but which is not itself an entity. Typically, the purpose of such a mapped superclass is to define state and mapping information that is common to multiple entity classes...A class designated as a mapped superclass has no separate table defined for it. Its mapping information is applied to the entities that inherit from it."

Here is an example of this behaviour

**The Entity
**

@Entity
public class Tweet extends TweetMetadata {
    @Id
    private long id;
    private String contents;
    private String dateString;
    private String timeString;

    public Tweet(long id, String contents, String dateString, String timeString, String tweetType) {
        this.id = id;
        this.contents = contents;
        this.dateString = dateString;
        this.timeString = timeString;
        super.setTweetType(tweetType);
    }
}
```
<p>**The MappedSuperClass
**</p>
<pre class="lang-java prettyprint-override"><code>
@MappedSuperclass
public class TweetMetadata {
    private String tweetType;
    @CreatedDate
    private LocalDateTime created;
}
</code>```

**The Repository
**

@Repository
public interface TweetRepository extends JpaRepository<Tweet, Long> {

    @Query(value = "SELECT * FROM tweet WHERE tweetType = ?1", nativeQuery = true)
    List<Tweet> findAllCircleTweets(String type);
}
```
<p>The Test</p>
<pre class="lang-java prettyprint-override"><code>@DataJpaTest
@ExtendWith(SpringExtension.class)
public class TweetRepositoryTest {
    public static final Logger LOGGER = LoggerFactory.getLogger(TweetRepositoryTest.class);
    @Autowired
    private TweetRepository repository;

   @Test
   public void shouldFindAllCircleTweetsTests(){
    repository.save( new Tweet(1L,"This is a very secret message","2022-11-11","12:30PM",     "Circle Type"));
      var circleTweets = repository.findAllCircleTweets("Circle Type");
   }
}
</code>```

**The Stacktrace from running the test
**

Hibernate: select t1_0.id,t1_0.contents,t1_0.created,t1_0.date_string,t1_0.time_string,t1_0.tweet_type from tweet t1_0 where t1_0.id=?
Hibernate: insert into tweet (contents, created, date_string, time_string, tweet_type, id) values (?, ?, ?, ?, ?, ?)
Hibernate: SELECT * FROM tweet WHERE tweetType = ?
2022-12-20T19:45:17.197+03:00  WARN 3545 --- [           main] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 42122, SQLState: 42S22
2022-12-20T19:45:17.198+03:00 ERROR 3545 --- [           main] o.h.engine.jdbc.spi.SqlExceptionHelper   : Column "TWEETTYPE" not found; SQL statement:
SELECT * FROM tweet WHERE tweetType = ? [42122-214]

org.springframework.dao.InvalidDataAccessResourceUsageException: could not prepare statement; SQL [SELECT * FROM tweet WHERE tweetType = ?]

    at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:257)
    at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:233)
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:550)
    at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:61)
    at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:242)
    at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:152)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
    at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:134)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:218)
    at jdk.proxy2/jdk.proxy2.$Proxy103.findAllCircleTweets(Unknown Source)
    at com.owino.jpacode.persistence_tests.TweetRepositoryTest.shouldFindAllCircleTweetsTests(TweetRepositoryTest.java:161)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:727)
    at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
    at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:156)
    at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:147)
    at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:86)
    at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:103)
    at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(InterceptingExecutableInvoker.java:93)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
    at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:92)
    at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:86)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:217)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:213)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:138)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:68)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:147)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:127)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:90)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:55)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:102)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:54)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
    at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
    at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)
    at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:57)
    at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
    at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
    at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
    at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
    at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
Caused by: org.hibernate.exception.SQLGrammarException: could not prepare statement
    at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:64)
    at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:56)
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109)
    at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:186)
    at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareStatement(StatementPreparerImpl.java:75)
    at org.hibernate.sql.exec.internal.JdbcSelectExecutorStandardImpl.lambda$list$0(JdbcSelectExecutorStandardImpl.java:100)
    at org.hibernate.sql.results.jdbc.internal.DeferredResultSetAccess.executeQuery(DeferredResultSetAccess.java:171)
    at org.hibernate.sql.results.jdbc.internal.DeferredResultSetAccess.getResultSet(DeferredResultSetAccess.java:146)
    at org.hibernate.sql.results.jdbc.internal.AbstractResultSetAccess.getMetaData(AbstractResultSetAccess.java:33)
    at org.hibernate.sql.results.jdbc.internal.AbstractResultSetAccess.getColumnCount(AbstractResultSetAccess.java:49)
    at org.hibernate.query.results.ResultSetMappingImpl.resolve(ResultSetMappingImpl.java:187)
    at org.hibernate.sql.exec.internal.JdbcSelectExecutorStandardImpl.resolveJdbcValuesSource(JdbcSelectExecutorStandardImpl.java:559)
    at org.hibernate.sql.exec.internal.JdbcSelectExecutorStandardImpl.doExecuteQuery(JdbcSelectExecutorStandardImpl.java:350)
    at org.hibernate.sql.exec.internal.JdbcSelectExecutorStandardImpl.executeQuery(JdbcSelectExecutorStandardImpl.java:166)
    at org.hibernate.sql.exec.internal.JdbcSelectExecutorStandardImpl.list(JdbcSelectExecutorStandardImpl.java:91)
    at org.hibernate.sql.exec.spi.JdbcSelectExecutor.list(JdbcSelectExecutor.java:31)
    at org.hibernate.query.sql.internal.NativeSelectQueryPlanImpl.performList(NativeSelectQueryPlanImpl.java:103)
    at org.hibernate.query.sql.internal.NativeQueryImpl.doList(NativeQueryImpl.java:596)
    at org.hibernate.query.spi.AbstractSelectionQuery.list(AbstractSelectionQuery.java:363)
    at org.hibernate.query.Query.getResultList(Query.java:94)
    at org.springframework.data.jpa.repository.query.JpaQueryExecution$CollectionExecution.doExecute(JpaQueryExecution.java:127)
    at org.springframework.data.jpa.repository.query.JpaQueryExecution.execute(JpaQueryExecution.java:90)
    at org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:148)
    at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:136)
    at org.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke(RepositoryMethodInvoker.java:136)
    at org.springframework.data.repository.core.support.RepositoryMethodInvoker.invoke(RepositoryMethodInvoker.java:120)
    at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.doInvoke(QueryExecutorMethodInterceptor.java:164)
    at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.invoke(QueryExecutorMethodInterceptor.java:143)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
    at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:77)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
    at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
    at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137)
    ... 78 more
Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "TWEETTYPE" not found; SQL statement:
SELECT * FROM tweet WHERE tweetType = ? [42122-214]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:502)
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:477)
    at org.h2.message.DbException.get(DbException.java:223)
    at org.h2.message.DbException.get(DbException.java:199)
    at org.h2.expression.ExpressionColumn.getColumnException(ExpressionColumn.java:244)
    at org.h2.expression.ExpressionColumn.optimizeOther(ExpressionColumn.java:226)
    at org.h2.expression.ExpressionColumn.optimize(ExpressionColumn.java:213)
    at org.h2.expression.condition.Comparison.optimize(Comparison.java:139)
    at org.h2.expression.Expression.optimizeCondition(Expression.java:148)
    at org.h2.command.query.Select.prepareExpressions(Select.java:1177)
    at org.h2.command.query.Query.prepare(Query.java:218)
    at org.h2.command.Parser.prepareCommand(Parser.java:575)
    at org.h2.engine.SessionLocal.prepareLocal(SessionLocal.java:631)
    at org.h2.engine.SessionLocal.prepareCommand(SessionLocal.java:554)
    at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1116)
    at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:92)
    at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:288)
    at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$1.doPrepare(StatementPreparerImpl.java:90)
    at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:176)
    ... 110 more

```

Body:
Testing queries that include properties of a MappedSuperClass as query parameters leads to a column not found error in a Spring Data JPA test such as org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "INSERT-COLUMN-NAME" not found; SQL statement:

Spring Boot 3.0.0 and 2.7.x

Spring Data JPA

@Query [native] custom query

I thought this was an SQL mapping issue but @MappedSuperClass documentation described classes that extend a MappedSuperClass to simply inherit the properties defined in the said super class:

The Jarkata JPA 3.0 specification described a mapped super class as:

"An entity may inherit from a superclass that provides persistent entity state and mapping information, but which is not itself an entity. Typically, the purpose of such a mapped superclass is to define state and mapping information that is common to multiple entity classes...A class designated as a mapped superclass has no separate table defined for it. Its mapping information is applied to the entities that inherit from it."

Here is an example of this behaviour

**The Entity
**

@Entity
public class Tweet extends TweetMetadata {
    @Id
    private long id;
    private String contents;
    private String dateString;
    private String timeString;

    public Tweet(long id, String contents, String dateString, String timeString, String tweetType) {
        this.id = id;
        this.contents = contents;
        this.dateString = dateString;
        this.timeString = timeString;
        super.setTweetType(tweetType);
    }
}

**The MappedSuperClass
**

@MappedSuperclass
public class TweetMetadata {
    private String tweetType;
    @CreatedDate
    private LocalDateTime created;
}

**The Repository
**

@Repository
public interface TweetRepository extends JpaRepository<Tweet, Long> {

    @Query(value = "SELECT * FROM tweet WHERE tweetType = ?1", nativeQuery = true)
    List<Tweet> findAllCircleTweets(String type);
}

The Test

@DataJpaTest
@ExtendWith(SpringExtension.class)
public class TweetRepositoryTest {
    public static final Logger LOGGER = LoggerFactory.getLogger(TweetRepositoryTest.class);
    @Autowired
    private TweetRepository repository;

   @Test
   public void shouldFindAllCircleTweetsTests(){
    repository.save( new Tweet(1L,"This is a very secret message","2022-11-11","12:30PM",     "Circle Type"));
      var circleTweets = repository.findAllCircleTweets("Circle Type");
   }
}

**The Stacktrace from running the test
**

Hibernate: select t1_0.id,t1_0.contents,t1_0.created,t1_0.date_string,t1_0.time_string,t1_0.tweet_type from tweet t1_0 where t1_0.id=?
Hibernate: insert into tweet (contents, created, date_string, time_string, tweet_type, id) values (?, ?, ?, ?, ?, ?)
Hibernate: SELECT * FROM tweet WHERE tweetType = ?
2022-12-20T19:45:17.197+03:00  WARN 3545 --- [           main] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 42122, SQLState: 42S22
2022-12-20T19:45:17.198+03:00 ERROR 3545 --- [           main] o.h.engine.jdbc.spi.SqlExceptionHelper   : Column "TWEETTYPE" not found; SQL statement:
SELECT * FROM tweet WHERE tweetType = ? [42122-214]

org.springframework.dao.InvalidDataAccessResourceUsageException: could not prepare statement; SQL [SELECT * FROM tweet WHERE tweetType = ?]

    at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:257)
    at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:233)
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:550)
    at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:61)
    at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:242)
    at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:152)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
    at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:134)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:218)
    at jdk.proxy2/jdk.proxy2.$Proxy103.findAllCircleTweets(Unknown Source)
    at com.owino.jpacode.persistence_tests.TweetRepositoryTest.shouldFindAllCircleTweetsTests(TweetRepositoryTest.java:161)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:727)
    at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
    at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:156)
    at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:147)
    at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:86)
    at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:103)
    at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(InterceptingExecutableInvoker.java:93)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
    at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:92)
    at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:86)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:217)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:213)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:138)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:68)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:147)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:127)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:90)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:55)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:102)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:54)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
    at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
    at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)
    at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:57)
    at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
    at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
    at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
    at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
    at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
Caused by: org.hibernate.exception.SQLGrammarException: could not prepare statement
    at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:64)
    at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:56)
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109)
    at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:186)
    at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareStatement(StatementPreparerImpl.java:75)
    at org.hibernate.sql.exec.internal.JdbcSelectExecutorStandardImpl.lambda$list$0(JdbcSelectExecutorStandardImpl.java:100)
    at org.hibernate.sql.results.jdbc.internal.DeferredResultSetAccess.executeQuery(DeferredResultSetAccess.java:171)
    at org.hibernate.sql.results.jdbc.internal.DeferredResultSetAccess.getResultSet(DeferredResultSetAccess.java:146)
    at org.hibernate.sql.results.jdbc.internal.AbstractResultSetAccess.getMetaData(AbstractResultSetAccess.java:33)
    at org.hibernate.sql.results.jdbc.internal.AbstractResultSetAccess.getColumnCount(AbstractResultSetAccess.java:49)
    at org.hibernate.query.results.ResultSetMappingImpl.resolve(ResultSetMappingImpl.java:187)
    at org.hibernate.sql.exec.internal.JdbcSelectExecutorStandardImpl.resolveJdbcValuesSource(JdbcSelectExecutorStandardImpl.java:559)
    at org.hibernate.sql.exec.internal.JdbcSelectExecutorStandardImpl.doExecuteQuery(JdbcSelectExecutorStandardImpl.java:350)
    at org.hibernate.sql.exec.internal.JdbcSelectExecutorStandardImpl.executeQuery(JdbcSelectExecutorStandardImpl.java:166)
    at org.hibernate.sql.exec.internal.JdbcSelectExecutorStandardImpl.list(JdbcSelectExecutorStandardImpl.java:91)
    at org.hibernate.sql.exec.spi.JdbcSelectExecutor.list(JdbcSelectExecutor.java:31)
    at org.hibernate.query.sql.internal.NativeSelectQueryPlanImpl.performList(NativeSelectQueryPlanImpl.java:103)
    at org.hibernate.query.sql.internal.NativeQueryImpl.doList(NativeQueryImpl.java:596)
    at org.hibernate.query.spi.AbstractSelectionQuery.list(AbstractSelectionQuery.java:363)
    at org.hibernate.query.Query.getResultList(Query.java:94)
    at org.springframework.data.jpa.repository.query.JpaQueryExecution$CollectionExecution.doExecute(JpaQueryExecution.java:127)
    at org.springframework.data.jpa.repository.query.JpaQueryExecution.execute(JpaQueryExecution.java:90)
    at org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:148)
    at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:136)
    at org.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke(RepositoryMethodInvoker.java:136)
    at org.springframework.data.repository.core.support.RepositoryMethodInvoker.invoke(RepositoryMethodInvoker.java:120)
    at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.doInvoke(QueryExecutorMethodInterceptor.java:164)
    at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.invoke(QueryExecutorMethodInterceptor.java:143)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
    at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:77)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
    at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
    at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137)
    ... 78 more
Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "TWEETTYPE" not found; SQL statement:
SELECT * FROM tweet WHERE tweetType = ? [42122-214]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:502)
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:477)
    at org.h2.message.DbException.get(DbException.java:223)
    at org.h2.message.DbException.get(DbException.java:199)
    at org.h2.expression.ExpressionColumn.getColumnException(ExpressionColumn.java:244)
    at org.h2.expression.ExpressionColumn.optimizeOther(ExpressionColumn.java:226)
    at org.h2.expression.ExpressionColumn.optimize(ExpressionColumn.java:213)
    at org.h2.expression.condition.Comparison.optimize(Comparison.java:139)
    at org.h2.expression.Expression.optimizeCondition(Expression.java:148)
    at org.h2.command.query.Select.prepareExpressions(Select.java:1177)
    at org.h2.command.query.Query.prepare(Query.java:218)
    at org.h2.command.Parser.prepareCommand(Parser.java:575)
    at org.h2.engine.SessionLocal.prepareLocal(SessionLocal.java:631)
    at org.h2.engine.SessionLocal.prepareCommand(SessionLocal.java:554)
    at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1116)
    at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:92)
    at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:288)
    at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$1.doPrepare(StatementPreparerImpl.java:90)
    at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:176)
    ... 110 more


问:
Is it possible to get ALL dart code work sync?
I am familiar with await-async conception, but I am writing a lot of linear code that should always run in single thread and synchronously. Also it's much easier to debug synchronously code.

Is it possible to make ALL code work synchronously? Regardless of async\await calls in code?


问:
Object Detection API List index out of range
I'm trying to use the ssd mobilenetv3 object detection model, I found this tutorial
I tried running the python file on my device using an image I snapped with my phone

but I keep getting this error
Error message

```<code>---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
/Users/nombaadmin/Documents/GitHub/Object-Sorting-Robot/object_sorting.ipynb Cell 17 in <cell line: 29>()
     46     class_id = int(detection[1])
     47     # print (class_id)
     48     # draw the name of the predicted object along with the probability
---> 49     label = f"{class_names[class_id - 1].upper()} {probability * 100:.2f}%"
     50     cv2.putText(image, label, (box[0], box[1] + 15),
     51                 cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 255, 0), 2)
     53 cv2.imshow('Image', image)

IndexError: list index out of range
</code>```

This is the code from the tutorial

```<code>import cv2

image = cv2.imread('Images/IMG20221220090901.jpg')
image = cv2.resize(image, (640, 480))
h = image.shape[0]
w = image.shape[1]

# path to the weights and model files
weights = "frozen_inference_graph.pb"
model = "ssd_mobilenet_v3_large_coco_2020_01_14.pbtxt"
# load the MobileNet SSD model trained  on the COCO dataset
net = cv2.dnn.readNetFromTensorflow(weights, model)

# load the class labels the model was trained on
class_names = []
with open("labels.txt", "r") as f:
    class_names = f.read().strip().split("\n")

# print(class_names)

# create a blob from the image
blob = cv2.dnn.blobFromImage(
    image, 1.0/127.5, (320, 320), [127.5, 127.5, 127.5])
# pass the blog through our network and get the output predictions
net.setInput(blob)
output = net.forward()  # shape: (1, 1, 100, 7)

# loop over the number of detected objects
for detection in output[0, 0, :, :]:  # output[0, 0, :, :] has a shape of: (100, 7)
    # the confidence of the model regarding the detected object
    probability = detection[2]

    # if the confidence of the model is lower than 50%,
    # we do nothing (continue looping)
    if probability < 0.5:
        continue

    # perform element-wise multiplication to get
    # the (x, y) coordinates of the bounding box
    box = [int(a * b) for a, b in zip(detection[3:7], [w, h, w, h])]
    box = tuple(box)
    # draw the bounding box of the object
    cv2.rectangle(image, box[:2], box[2:], (0, 255, 0), thickness=2)

    # extract the ID of the detected object to get its name
    class_id = int(detection[1])
    # print (class_id)
    # draw the name of the predicted object along with the probability
    label = f"{class_names[class_id - 1].upper()} {probability * 100:.2f}%"
    cv2.putText(image, label, (box[0], box[1] + 15),
                cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 255, 0), 2)

cv2.imshow('Image', image)
cv2.waitKey()
</code>```

I have tried to check the value of class_id its value is 87 which is above the limit with is 1 to 80

I inputed the image of a spoon I snapped with my phone

Body:
I'm trying to use the ssd mobilenetv3 object detection model, I found this tutorial
I tried running the python file on my device using an image I snapped with my phone

but I keep getting this error
Error message

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
/Users/nombaadmin/Documents/GitHub/Object-Sorting-Robot/object_sorting.ipynb Cell 17 in <cell line: 29>()
     46     class_id = int(detection[1])
     47     # print (class_id)
     48     # draw the name of the predicted object along with the probability
---> 49     label = f"{class_names[class_id - 1].upper()} {probability * 100:.2f}%"
     50     cv2.putText(image, label, (box[0], box[1] + 15),
     51                 cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 255, 0), 2)
     53 cv2.imshow('Image', image)

IndexError: list index out of range

This is the code from the tutorial

import cv2

image = cv2.imread('Images/IMG20221220090901.jpg')
image = cv2.resize(image, (640, 480))
h = image.shape[0]
w = image.shape[1]

# path to the weights and model files
weights = "frozen_inference_graph.pb"
model = "ssd_mobilenet_v3_large_coco_2020_01_14.pbtxt"
# load the MobileNet SSD model trained  on the COCO dataset
net = cv2.dnn.readNetFromTensorflow(weights, model)

# load the class labels the model was trained on
class_names = []
with open("labels.txt", "r") as f:
    class_names = f.read().strip().split("\n")

# print(class_names)

# create a blob from the image
blob = cv2.dnn.blobFromImage(
    image, 1.0/127.5, (320, 320), [127.5, 127.5, 127.5])
# pass the blog through our network and get the output predictions
net.setInput(blob)
output = net.forward()  # shape: (1, 1, 100, 7)

# loop over the number of detected objects
for detection in output[0, 0, :, :]:  # output[0, 0, :, :] has a shape of: (100, 7)
    # the confidence of the model regarding the detected object
    probability = detection[2]

    # if the confidence of the model is lower than 50%,
    # we do nothing (continue looping)
    if probability < 0.5:
        continue

    # perform element-wise multiplication to get
    # the (x, y) coordinates of the bounding box
    box = [int(a * b) for a, b in zip(detection[3:7], [w, h, w, h])]
    box = tuple(box)
    # draw the bounding box of the object
    cv2.rectangle(image, box[:2], box[2:], (0, 255, 0), thickness=2)

    # extract the ID of the detected object to get its name
    class_id = int(detection[1])
    # print (class_id)
    # draw the name of the predicted object along with the probability
    label = f"{class_names[class_id - 1].upper()} {probability * 100:.2f}%"
    cv2.putText(image, label, (box[0], box[1] + 15),
                cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 255, 0), 2)

cv2.imshow('Image', image)
cv2.waitKey()

I have tried to check the value of class_id its value is 87 which is above the limit with is 1 to 80

I inputed the image of a spoon I snapped with my phone


问:
How to use Promise.all and Promise.allSettled Inisde Getserverside or GetStaticProps
i have component use  GetStaticProps like this

```<code>export const getStaticProps: GetStaticProps = async () => {
    const landingPage = await axios.get(
        'https://someapi/'
    );
    const gameData = await axios.get(
        'https://someapi'
    );

    return {
        props: {
            landingPageData: landingPage.data,
            gameData: gameData.data,
        },
        revalidate: 120,
    };
};
</code>```

I try to do like this

```<code>const promise1 = axios.get(URL1);
const promise2 = axios.get(URL2);
const promise3 = axios.get(URL3);

Promise.all([promise1, promise2, promise3]).then(function(data) {
  console.log(data);
});
</code>```

But I don't know how send the data into the return props
because of the data inside Promise.All

Body:
i have component use  GetStaticProps like this

export const getStaticProps: GetStaticProps = async () => {
    const landingPage = await axios.get(
        'https://someapi/'
    );
    const gameData = await axios.get(
        'https://someapi'
    );

    return {
        props: {
            landingPageData: landingPage.data,
            gameData: gameData.data,
        },
        revalidate: 120,
    };
};

I try to do like this

const promise1 = axios.get(URL1);
const promise2 = axios.get(URL2);
const promise3 = axios.get(URL3);

Promise.all([promise1, promise2, promise3]).then(function(data) {
  console.log(data);
});

But I don't know how send the data into the return props
because of the data inside Promise.All


问:
C# single instance class used by multiple EXEs
I have a class that acts as a 'zoneManager', it keeps track of which physical spaces are occupied by moving parts in a machine(robot arms/doors/etc..). Its a separate project that will be added in as a 'plug-and-play' DLL, I'm just unsure, given lack of Singleton experience if:

I have setup this code in a way to function as a single instance

How do I utilize it in exe/call to the functions? I don't just add as a reference the DLL and create/instantiate an instance like normal right? I feel like that defeats singleton somehow, or am I overthinking?

this class' Functions will be called from a 3rd party program on a different PC over WCF, so I'll need to ensure everyone is talking to same instance but I think that's OK since one of my local projects is the CommManager which deals with callback interface, and API is already shared with 3rd party

Here's what I have so far for the library manager:

```<code>namespace Mechanical_Interactions
{
    public sealed class ZoneManager
    {

        private static readonly ZoneManager instance = new ZoneManager();

        private ZoneManager()
        {
            //read in XML file into 2 Enumerable lists: users & content representing all locations and a list of all possible resources who could claim access to such a zone for avoiding collision and conflict prior to movement
        }

        public static ZoneManager getManager()
        {
            return instance;
        }

        public IEnumerable<Content>periodicals{get;}
        public IEnumerable<Users>users{get;}

        public bool requestAccess(string zone,string resource)
        {
            //mutex-locked, checks if zone is in-use by other resource, if so, return false. If not, apply resourceID as owner in zone object and return true
        }
        public void returnContent(string title, string resource)
        {
            //confirm the resource releasing access is the same who received in first place. if so, release access tag. failure is insignificant, as next requestOfAccess will return false and can be handled there
        }
        private object Mutex {get;} = new object();

    }

    public static class Zone
    {
        //string ID
        //string currentOwner
    }

    public class Resource
    {
        //string ID
        //List<Zone> InUseZones{get;}
    }
}
</code>```

Body:
I have a class that acts as a 'zoneManager', it keeps track of which physical spaces are occupied by moving parts in a machine(robot arms/doors/etc..). Its a separate project that will be added in as a 'plug-and-play' DLL, I'm just unsure, given lack of Singleton experience if:

I have setup this code in a way to function as a single instance

How do I utilize it in exe/call to the functions? I don't just add as a reference the DLL and create/instantiate an instance like normal right? I feel like that defeats singleton somehow, or am I overthinking?

this class' Functions will be called from a 3rd party program on a different PC over WCF, so I'll need to ensure everyone is talking to same instance but I think that's OK since one of my local projects is the CommManager which deals with callback interface, and API is already shared with 3rd party

Here's what I have so far for the library manager:

namespace Mechanical_Interactions
{
    public sealed class ZoneManager
    {

        private static readonly ZoneManager instance = new ZoneManager();

        private ZoneManager()
        {
            //read in XML file into 2 Enumerable lists: users & content representing all locations and a list of all possible resources who could claim access to such a zone for avoiding collision and conflict prior to movement
        }

        public static ZoneManager getManager()
        {
            return instance;
        }

        public IEnumerable<Content>periodicals{get;}
        public IEnumerable<Users>users{get;}

        public bool requestAccess(string zone,string resource)
        {
            //mutex-locked, checks if zone is in-use by other resource, if so, return false. If not, apply resourceID as owner in zone object and return true
        }
        public void returnContent(string title, string resource)
        {
            //confirm the resource releasing access is the same who received in first place. if so, release access tag. failure is insignificant, as next requestOfAccess will return false and can be handled there
        }
        private object Mutex {get;} = new object();

    }

    public static class Zone
    {
        //string ID
        //string currentOwner
    }

    public class Resource
    {
        //string ID
        //List<Zone> InUseZones{get;}
    }
}


问:
How to continue onTouchEvent on new Fragment after onLongClick
I launch a new fragment in setOnLongClickListener on top of the current fragment via add() in the transaction and I want the onTouchEvent event to start intercepting the new fragment without lowering my finger. Can this be done?

I tried to call action_down programmatically on new fragment. Because i thought that i can start touch events by action_down event and new events will be intercepting by new fragment. But it was not true

```<code>dispatchTouchEvent(MotionEvent.obtain(
    SystemClock.uptimeMillis(),
    SystemClock.uptimeMillis(),
    MotionEvent.ACTION_DOWN,
    binding.recordIv.x,
    binding.recordIv.y,
    0
))

</code>```

Body:
I launch a new fragment in setOnLongClickListener on top of the current fragment via add() in the transaction and I want the onTouchEvent event to start intercepting the new fragment without lowering my finger. Can this be done?

I tried to call action_down programmatically on new fragment. Because i thought that i can start touch events by action_down event and new events will be intercepting by new fragment. But it was not true

dispatchTouchEvent(MotionEvent.obtain(
    SystemClock.uptimeMillis(),
    SystemClock.uptimeMillis(),
    MotionEvent.ACTION_DOWN,
    binding.recordIv.x,
    binding.recordIv.y,
    0
))


问:
UWP UnauthorizedAccessException After Unity Upgrade to 2021.3.15f from 2020.3.38f
Im Having a issue after i upgraded to 2021.3.15f from 2020.3.38f.

The application crash on starts and im getting this in the log :

Uploading Crash Report UnauthorizedAccessException: Access to the path 'c:\data' is denied.

This is happened when I use:

Directory.CreateDirectory(sceneFilesPath);

To create a folder.

My code was working in the previous version and i had no issue.

The only thing i did was upgrade to the new unity version.

Also check the capabilities i have them all.

And the path is correct when i debug it.

Does anyone have any idea?

Also i have seen that unity is now using net standard 2.1 instead of net standard 2.0 Could this change affect the build !

Cheers

Using DirectoryInfo do the job but i still have no idea why this was working before ?


问:
Nuxt Deploy on Plesk
I need to deploy my Nuxt App on Plesk.

I set "/httpdocs/nuxt-app" in Document Root,
and "/httpdocs/nuxt-app" in Application Root

nuxt-app contains all files and folders as .output,.nuxt, package.json

```<code>   Vue packages version mismatch:
   - vue@3.2.45
   - vue-server-renderer@2.7.14
</code>```

Title: Nuxt Deploy on Plesk

Body:
I need to deploy my Nuxt App on Plesk.

I set "/httpdocs/nuxt-app" in Document Root,
and "/httpdocs/nuxt-app" in Application Root

nuxt-app contains all files and folders as .output,.nuxt, package.json

   Vue packages version mismatch:
   - vue@3.2.45
   - vue-server-renderer@2.7.14


问:
coloring histogram with multiple colors where each color has a specified range
I was trying to load an excel data into python and plot it as a histogram. My aim would be to color the histogram according to specific ranges: every number smaller than 4 = yellow, numbers between 4 and 12 = orange and so on. I encountered 2 problems I don´t have 4 separate histograms the programm plots everything in 1 graph. Second problem,one of the loops, obviously is wrong because it only shows everything in yellow.
Could somebody help me out which loop is wrong and why? Is there a better way to do this?I appriciate every help im pretty new at programming.

```<code>import matplotlib.pyplot as plt
import pandas as pd
import openpyxl

# Load the workbook
path='C:/Users/akosw/OneDrive/Desktop/Programmieren/Geotechnikstammdaten.xlsx'
#workbook = openpyxl.load_workbook("Geotechnikstammdaten.xlsx","C:/Users/akosw/OneDrive/Desktop/Programmieren")
workbook = openpyxl.load_workbook(path)
# Select the sheet
sheet = workbook['Tabelle3']

# Extract the values from each column
columns = [[cell.value for cell in column] for column in zip(*sheet.rows)]

# Iterate over the columns
for i, values in enumerate(columns):
    # Create the histogram
    plt.hist(values, bins=50)
# Color the bars according to the specified rules
for patch in plt.gca().patches:
    if patch.get_height() < 4:
        patch.set_facecolor('yellow')
    elif patch.get_height() < 12:
        patch.set_facecolor('orange')
    elif patch.get_height() < 26:
        patch.set_facecolor('green')
    elif patch.get_height() < 51:
        patch.set_facecolor('blue')
    else:
        patch.set_facecolor('red')
    plt.title(f'Column {i+1}')
plt.show()
    # Save the histogram to a file
   # plt.savefig(f'histogram_{i+1}.png')
</code>```

Here is kind of what im trying to achiev but instead of a bar chart i want a histogramm.

```<code>from bisect import bisect
import matplotlib.pyplot as plt
import numpy as np

OM_VALUES = [4, 12, 26, 51]
OM_COLORS = ["yellow", "orange", "blue", "green", "red"]

data = [4, 6, 7, 7, 11, 16, 23, 30, 30, 27, 1, 3, 4, 33, 37, 39, 45, 51]
labels = range(len(data))#[0,1,2,3,4,5,6,7,8,9,10,11]

plt.barh(labels, data,height=1.0, color=[OENORM_COLORS[bisect(OENORM_VALUES, v)] for v in data])

plt.title('Counts per depth')
plt.xlabel('Value')
plt.ylabel('Depth')
#plt.savefig('counts_depth.png')
plt.show()
</code>```

Body:
I was trying to load an excel data into python and plot it as a histogram. My aim would be to color the histogram according to specific ranges: every number smaller than 4 = yellow, numbers between 4 and 12 = orange and so on. I encountered 2 problems I don´t have 4 separate histograms the programm plots everything in 1 graph. Second problem,one of the loops, obviously is wrong because it only shows everything in yellow.
Could somebody help me out which loop is wrong and why? Is there a better way to do this?I appriciate every help im pretty new at programming.

import matplotlib.pyplot as plt
import pandas as pd
import openpyxl

# Load the workbook
path='C:/Users/akosw/OneDrive/Desktop/Programmieren/Geotechnikstammdaten.xlsx'
#workbook = openpyxl.load_workbook("Geotechnikstammdaten.xlsx","C:/Users/akosw/OneDrive/Desktop/Programmieren")
workbook = openpyxl.load_workbook(path)
# Select the sheet
sheet = workbook['Tabelle3']

# Extract the values from each column
columns = [[cell.value for cell in column] for column in zip(*sheet.rows)]

# Iterate over the columns
for i, values in enumerate(columns):
    # Create the histogram
    plt.hist(values, bins=50)
# Color the bars according to the specified rules
for patch in plt.gca().patches:
    if patch.get_height() < 4:
        patch.set_facecolor('yellow')
    elif patch.get_height() < 12:
        patch.set_facecolor('orange')
    elif patch.get_height() < 26:
        patch.set_facecolor('green')
    elif patch.get_height() < 51:
        patch.set_facecolor('blue')
    else:
        patch.set_facecolor('red')
    plt.title(f'Column {i+1}')
plt.show()
    # Save the histogram to a file
   # plt.savefig(f'histogram_{i+1}.png')

Here is kind of what im trying to achiev but instead of a bar chart i want a histogramm.

from bisect import bisect
import matplotlib.pyplot as plt
import numpy as np

OM_VALUES = [4, 12, 26, 51]
OM_COLORS = ["yellow", "orange", "blue", "green", "red"]

data = [4, 6, 7, 7, 11, 16, 23, 30, 30, 27, 1, 3, 4, 33, 37, 39, 45, 51]
labels = range(len(data))#[0,1,2,3,4,5,6,7,8,9,10,11]

plt.barh(labels, data,height=1.0, color=[OENORM_COLORS[bisect(OENORM_VALUES, v)] for v in data])

plt.title('Counts per depth')
plt.xlabel('Value')
plt.ylabel('Depth')
#plt.savefig('counts_depth.png')
plt.show()


问:
ggplot gradient map with horizontal and vertical breaks
i'm trying to do a risk matrix, with gradient colors using ggplots.

The boundaries for each color are defined by a reference book and the matrix must follow it.

I was able to create the color scheme with gradient based on the value of the pixel. However, there are also vertical and horizontal breaks, which i was not able to code.

and i want to set limits like this:
i.e,

Is it possible?

Many thanks,
Diogo

So far i have this:

```<code>library(tidyverse)
library(scales)
library(dplyr)

colour_breaks <- c(0,4,7,10,15)
colours <- c("green","blue","yellow","orange","red")

db <- seq(from=5,to=1,by=-0.1)%*%t(seq(from=1,to=5,by=0.1))
db<- as.data.frame(db)

row.names(db) <- db[,1]
colnames(db) <- seq(from=1,to=5,by=0.1)

db$ID <- db[,1]
db <-  db[-nrow(db),]

db_long <- db %>%
  gather(key = "variable", value = "value", -ID) %>%
  mutate(ID = as.numeric(ID)) %>%
  mutate(variable = as.numeric(variable))

plt1 <-  ggplot(data=db_long, aes(x=as.numeric(variable), y=as.numeric(ID), fill=value)) +
  geom_raster() +
  coord_cartesian(clip = "off") +
  annotate('segment', x = 3.4, xend = 3.4, y = -Inf, yend = 1.4,
           size = 0.1,
           alpha = 0.4) +
  scale_x_continuous(expand = c(0, 0)) +
  scale_y_continuous(expand = c(0, 0), breaks=c(0,1,2,3,4,5)) +
  geom_hline(yintercept=1.4, alpha=0.4) +
  geom_hline(yintercept=2.4, alpha=0.4) +
  geom_hline(yintercept=3.5, alpha=0.4) +
  ylab("Condition") +
  xlab("Critic") +
  ggtitle("Risk Matrix") +
  scale_fill_gradientn(
    limits  = range(db_long$value),
    colours = colours[c(1, seq_along(colours), length(colours))],
    values  = c(0, scales::rescale(colour_breaks, from = range(db_long$value)), 1),
  ) +
  #scale_fill_gradient2(low="blue",mid="green",high="red") +
  theme_bw()

print(plt1)
</code>```

Body:
i'm trying to do a risk matrix, with gradient colors using ggplots.

The boundaries for each color are defined by a reference book and the matrix must follow it.

I was able to create the color scheme with gradient based on the value of the pixel. However, there are also vertical and horizontal breaks, which i was not able to code.

and i want to set limits like this:
i.e,

Is it possible?

Many thanks,
Diogo

So far i have this:

library(tidyverse)
library(scales)
library(dplyr)

colour_breaks <- c(0,4,7,10,15)
colours <- c("green","blue","yellow","orange","red")

db <- seq(from=5,to=1,by=-0.1)%*%t(seq(from=1,to=5,by=0.1))
db<- as.data.frame(db)

row.names(db) <- db[,1]
colnames(db) <- seq(from=1,to=5,by=0.1)

db$ID <- db[,1]
db <-  db[-nrow(db),]

db_long <- db %>%
  gather(key = "variable", value = "value", -ID) %>%
  mutate(ID = as.numeric(ID)) %>%
  mutate(variable = as.numeric(variable))

plt1 <-  ggplot(data=db_long, aes(x=as.numeric(variable), y=as.numeric(ID), fill=value)) +
  geom_raster() +
  coord_cartesian(clip = "off") +
  annotate('segment', x = 3.4, xend = 3.4, y = -Inf, yend = 1.4,
           size = 0.1,
           alpha = 0.4) +
  scale_x_continuous(expand = c(0, 0)) +
  scale_y_continuous(expand = c(0, 0), breaks=c(0,1,2,3,4,5)) +
  geom_hline(yintercept=1.4, alpha=0.4) +
  geom_hline(yintercept=2.4, alpha=0.4) +
  geom_hline(yintercept=3.5, alpha=0.4) +
  ylab("Condition") +
  xlab("Critic") +
  ggtitle("Risk Matrix") +
  scale_fill_gradientn(
    limits  = range(db_long$value),
    colours = colours[c(1, seq_along(colours), length(colours))],
    values  = c(0, scales::rescale(colour_breaks, from = range(db_long$value)), 1),
  ) +
  #scale_fill_gradient2(low="blue",mid="green",high="red") +
  theme_bw()

print(plt1)


问:
401 error from download.file in for-loop in R
I am trying to download a series of raster tiles from the USGS website here. I am using R and hope to accomplish this via a for-loop like below. Note - I am working on a Mac.

```<code>tdir = tempdir()

tiles = c("p017r030",
          "p016r030",
          "p017r031",
          "p016r031",
          "p015r030",
          "p014r030",
          "p014r031")

for(k in unique(tiles)){
    tileurl=paste("https://e4ftl01.cr.usgs.gov/MEASURES/GFCC30TC.003/2015.01.01/GFCC30TC_",k,"_TC_2015.zip",sep="")
    download.file(tileurl,destfile = file.path(paste(tdir,"Canopy",k,".zip",sep="")))
    unzip(file.path(paste(tdir,"Canopy",k,".zip",sep=""),exdir=tdir))
    Canopy_tile = paste("Canopy_tile",k,sep="")
    assign(Canopy_tile,terra::rast(paste(tdir,"Canopy",k,".zip",sep="")))}
</code>```

However, I am left with an error because a USGS log in is required the first time you attempt to access these data. Error shown below. Is there a way to add the log in step into the for-loop, presumably only for the first time through the loop?

```<code>#> Warning in download.file(tileurl, destfile = file.path(paste(tdir,
#> "Canopy", : cannot open URL 'https://urs.earthdata.nasa.gov/oauth/authorize?
#> scope=uid&app_type=401&client_id=ijpRZvb9qeKCK5ctsn75Tg&response_type=code&redirect_uri=https%3A%2F%2Fe4ftl01.cr.usgs.gov%2Foauth&state=aHR0cHM6Ly9lNGZ0bDAxLmNyLnVzZ3MuZ292L01FQVNVUkVTL0dGQ0MzMFRDLjAwMy8yMDE1LjAxLjAxL0dGQ0MzMFRDX3AwMTdyMDMwX1RDXzIwMTUuemlw':
#> HTTP status was '401 Unauthorized'
#> Error in download.file(tileurl, destfile = file.path(paste(tdir, "Canopy", : cannot open URL 'https://e4ftl01.cr.usgs.gov/MEASURES/GFCC30TC.003/2015.01.01/GFCC30TC_p017r030_TC_2015.zip'
</code>```

Body:
I am trying to download a series of raster tiles from the USGS website here. I am using R and hope to accomplish this via a for-loop like below. Note - I am working on a Mac.

tdir = tempdir()

tiles = c("p017r030",
          "p016r030",
          "p017r031",
          "p016r031",
          "p015r030",
          "p014r030",
          "p014r031")

for(k in unique(tiles)){
    tileurl=paste("https://e4ftl01.cr.usgs.gov/MEASURES/GFCC30TC.003/2015.01.01/GFCC30TC_",k,"_TC_2015.zip",sep="")
    download.file(tileurl,destfile = file.path(paste(tdir,"Canopy",k,".zip",sep="")))
    unzip(file.path(paste(tdir,"Canopy",k,".zip",sep=""),exdir=tdir))
    Canopy_tile = paste("Canopy_tile",k,sep="")
    assign(Canopy_tile,terra::rast(paste(tdir,"Canopy",k,".zip",sep="")))}

However, I am left with an error because a USGS log in is required the first time you attempt to access these data. Error shown below. Is there a way to add the log in step into the for-loop, presumably only for the first time through the loop?

#> Warning in download.file(tileurl, destfile = file.path(paste(tdir,
#> "Canopy", : cannot open URL 'https://urs.earthdata.nasa.gov/oauth/authorize?
#> scope=uid&app_type=401&client_id=ijpRZvb9qeKCK5ctsn75Tg&response_type=code&redirect_uri=https%3A%2F%2Fe4ftl01.cr.usgs.gov%2Foauth&state=aHR0cHM6Ly9lNGZ0bDAxLmNyLnVzZ3MuZ292L01FQVNVUkVTL0dGQ0MzMFRDLjAwMy8yMDE1LjAxLjAxL0dGQ0MzMFRDX3AwMTdyMDMwX1RDXzIwMTUuemlw':
#> HTTP status was '401 Unauthorized'
#> Error in download.file(tileurl, destfile = file.path(paste(tdir, "Canopy", : cannot open URL 'https://e4ftl01.cr.usgs.gov/MEASURES/GFCC30TC.003/2015.01.01/GFCC30TC_p017r030_TC_2015.zip'


问:
How to make only some url [other than mydomain] in my webview app open in browser?
I would like to make any url other than my domains url to be opened in browser, for example if the user clicks a link like "https://www.google.com/(variable)" in my webview app , it should be opened in their browser not inside my webapp.

Please help me to do so In Kotlin


问:
How can I automate signing onto a website with Powershell?
I have been speculating on how to automate a process where I sign into a website but have only found a code so far that opens the site where I need to go. Is there a code where I can find the textbox, enter an email, hit next, (wait for the page to load, and enter a password and select next?

I am trying this out on google chrome through Powershell, Windows 10.

Here is what I have so far:

#opens to the site

$chrome = Start-Process -FilePath "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -ArgumentList "https://signin.absolute.com/Default.aspx?ReturnUrl=/SSO/SAML2/SSOService.aspx"

The next part has stumped me, I have one textbox where I want to put my email and click next. The HTML code looks like this, input name="ctl00$bodyContent$txtEmailAddress" id="txtEmailAddress" tabindex="1" class="form-control mb-2" type="text" placeholder="Enter your email address">

I have read that Invoke-webrequest could maybe do this, or Invoke-Restmethod, but I have either not understood or am not sure what it is that I can use.

Is there anything further I can try or look into?

Here is what I have tested so far:

$site = Invoke-WebRequest -uri "https://signin.absolute.com/Default.aspx?ReturnUrl=/SSO/SAML2/SSOService.aspx"

gets the info on the site
$site | Get-Member

$site.Content

$site.inputfields

Inputfields?
InputFields | select-object -Property "textfield"

#Site document.getelementbyid or tagname?

$site.document.getElementsByTagName('txtemailaddress') $element = $site.document.getElementsByTagName('txtemailaddress') $element.value = "myemail"

or ?
$site.InputFields.Contains('id="divlogin"')

where-object?
$emailElement = $inputs | where {$_.name -eq 'id="divlogin"'} if ($emailElement) { $emailElement.value = "myemail" }


问:
Error occurs in Net Core in the logic of generating a password with Identity's Salt and Hash
We do not use all of the Identity Framework, but we are using the following function when saving and verifying the password in the User Table.
We are currently upgrading from .Net Framework to .Net Core and we are getting errors when I try to use the function below.

1.Error1 :Severity  Code    Description Project File    Line    Suppression State
Error   CS7036  There is no argument given that corresponds to the required formal parameter 'context' of 'UserStore.UserStore(DbContext, IdentityErrorDescriber)'

2.Error2 :
Severity    Code    Description Project File    Line    Suppression State
Error   CS7036  There is no argument given that corresponds to the required formal parameter 'optionsAccessor' of 'UserManager.UserManager(IUserStore, IOptions, IPasswordHasher, IEnumerable<IUserValidator>, IEnumerable<IPasswordValidator>, ILookupNormalizer, IdentityErrorDescriber, IServiceProvider, ILogger<UserManager>)'

3.Error3 :
Severity    Code    Description Project File    Line    Suppression State
Error   CS7036  There is no argument given that corresponds to the required formal parameter 'password' of 'IPasswordHasher.HashPassword(IdentityUser, string)'

```<code>public static PortalUserDto GenerateHashAndSalt(string password)
        {
            try
            {
                if (string.IsNullOrEmpty(password)) { return null; }

                var userStore = new UserStore<IdentityUser>();
                var manager = new UserManager<IdentityUser>(userStore);

                string salt = GenerateSalt();

                string hashedPassword = manager.PasswordHasher.HashPassword(salt + password);

                return new PortalUserDto()
                {
                    Salt = salt,
                    Hash = hashedPassword
                };

            }
            catch (Exception ex)
            {
                Logger.Debug(ex);
            }
            return null;
        } ~~~
</code>```

Body:
We do not use all of the Identity Framework, but we are using the following function when saving and verifying the password in the User Table.
We are currently upgrading from .Net Framework to .Net Core and we are getting errors when I try to use the function below.

1.Error1 :Severity  Code    Description Project File    Line    Suppression State
Error   CS7036  There is no argument given that corresponds to the required formal parameter 'context' of 'UserStore.UserStore(DbContext, IdentityErrorDescriber)'

2.Error2 :
Severity    Code    Description Project File    Line    Suppression State
Error   CS7036  There is no argument given that corresponds to the required formal parameter 'optionsAccessor' of 'UserManager.UserManager(IUserStore, IOptions, IPasswordHasher, IEnumerable<IUserValidator>, IEnumerable<IPasswordValidator>, ILookupNormalizer, IdentityErrorDescriber, IServiceProvider, ILogger<UserManager>)'

3.Error3 :
Severity    Code    Description Project File    Line    Suppression State
Error   CS7036  There is no argument given that corresponds to the required formal parameter 'password' of 'IPasswordHasher.HashPassword(IdentityUser, string)'

public static PortalUserDto GenerateHashAndSalt(string password)
        {
            try
            {
                if (string.IsNullOrEmpty(password)) { return null; }

                var userStore = new UserStore<IdentityUser>();
                var manager = new UserManager<IdentityUser>(userStore);

                string salt = GenerateSalt();

                string hashedPassword = manager.PasswordHasher.HashPassword(salt + password);

                return new PortalUserDto()
                {
                    Salt = salt,
                    Hash = hashedPassword
                };

            }
            catch (Exception ex)
            {
                Logger.Debug(ex);
            }
            return null;
        } ~~~