问:
PynamoDB TransactWrite NoCredentialError
I'm trying to TransactWrite using PynamoDB.
But, I'm getting botocore.exceptions.NoCredentialsError: Unable to locate credentials error.

I am sending a request to DynamoDB from local PC. And, since MFA is applied to the locally stored AWS Profile, I got and applied the credentials through STS.

It seems that the credentials entered in the meta information of the table is not being applied well. Has anyone had this kind of experience?

Below is the code that tries TransactWrite and the code that defines the table.

```<code>from pynamodb.connection import Connection

connection = Connection(region="ap-northeast-2")

with TransactWrite(connection=connection) as transaction:
  transaction.update(
    item,
    actions=[
      Table.one.set(1),
      Table.type.set("test)
    ]
  )
  transaction.save(
    Table("1234", "test"),
  )

class Table(Model):
  class Meta:
    aws_access_key_id = credentials["AccessKeyId"]
    aws_secret_access_key = credentials["SecretAccessKey"]
    aws_session_token = credentials["SessionToken"]

    table_name = "test-dev-table"
    region = "ap-northeast-2"

  id = UnicodeAttribute(hash_key=True)
  ts = NumberAttribute(range_key=True)
  one = NumberAttribute(null=True)
  type = UnicodeAttribute(null=True)
</code>```

Thank you for your help.

Body:
I'm trying to TransactWrite using PynamoDB.
But, I'm getting botocore.exceptions.NoCredentialsError: Unable to locate credentials error.

I am sending a request to DynamoDB from local PC. And, since MFA is applied to the locally stored AWS Profile, I got and applied the credentials through STS.

It seems that the credentials entered in the meta information of the table is not being applied well. Has anyone had this kind of experience?

Below is the code that tries TransactWrite and the code that defines the table.

from pynamodb.connection import Connection

connection = Connection(region="ap-northeast-2")

with TransactWrite(connection=connection) as transaction:
  transaction.update(
    item,
    actions=[
      Table.one.set(1),
      Table.type.set("test)
    ]
  )
  transaction.save(
    Table("1234", "test"),
  )

class Table(Model):
  class Meta:
    aws_access_key_id = credentials["AccessKeyId"]
    aws_secret_access_key = credentials["SecretAccessKey"]
    aws_session_token = credentials["SessionToken"]

    table_name = "test-dev-table"
    region = "ap-northeast-2"

  id = UnicodeAttribute(hash_key=True)
  ts = NumberAttribute(range_key=True)
  one = NumberAttribute(null=True)
  type = UnicodeAttribute(null=True)

Thank you for your help.


来源: stackexchange

问:
Most efficient way to read a huge parquet file into memory in Python
Ideally, I would like to have the data in a dictionary. I am not even sure if a dictionary is better than a dataframe in this context. After a bit of research, I found the following ways to read a parquet file into memory:

Pyarrow (Python API of Apache Arrow):

With pyarrow, I can read a parquet file into a pyarrow.Table. I can also read the data into a pyarrow.DictionaryArray. Both are easily convertible into a dataframe, but wouldn't memory consumption double in this case?

Pandas:

Via pd.read_parquet. The file is read into a dataframe. Again, would a dataframe perform as well as a dictionary?

parquet-python (pure python, supports read-only):

Supports reading in each row in a parquet as a dictionary. That means I'd have to merge a lot of nano-dictionaries. I am not sure if this is wise.

ContentLicense: CC BY-SA 4.0


问:
Why editorjs ( rich text editor) is not working with textarea tag?
I am trying to incorporate editorjs in my react app. I incorporated it with the div element with contentEditable="true". I want to implement the text editor with the textarea element also but it seems it's not working.

Is there anything extra to be done in order to implement the rich-text-editor on textarea tag.
Using the id of the element on the holder element of editorjs is not helping me with textarea tag.

https://laracasts.com/discuss/channels/laravel/editorjs-is-not-working-with-textarea
I referred to the link above and unfortunately, it's not helping me.

I am pretty new to implementing this stuff, Does anyone know the issue?
Thanks


问:
Copy C++ FFmpeg AVFrame to C# WritableBitmap
I have a C++ function definition with ffmpeg scaler The last two parameter is my question (buffer and stride):

```<code>int scale_decoded_video_frame(void* handle, void* scalerHandle, void* scaledBuffer, int scaledBufferStride)

sws_scale(
    scalerContext->sws_context,
    srcData,
    context->frame->linesize,
    0,
    scalerContext->source_height,
    reinterpret_cast<uint8_t**>(&scaledBuffer),
    &scaledBufferStride);
</code>```

When I declared it in C# I use the following code:

```<code>[DllImport(LibraryName, EntryPoint = "scale_decoded_video_frame", CallingConvention = CallingConvention.Cdecl)]
public static extern int ScaleDecodedVideoFrame(IntPtr handle, IntPtr scalerHandle, IntPtr scaledBuffer, int scaledBufferStride);
</code>```

And the C# call:

```<code>WriteableBitmap w = new WriteableBitmap(1920, 1080, 96, 96, PixelFormats.Pbgra32, null);
RenderOptions.SetBitmapScalingMode(w, BitmapScalingMode.NearestNeighbor);
w.Lock();

Int32Rect rect = new Int32Rect(0, 0, 1920, 1080);

resultCode = FFmpegVideoPInvoke.ScaleDecodedVideoFrame(decoderPtr, scalerHandle, w.BackBuffer, w.BackBufferStride);
if (resultCode == 0)
   w.AddDirtyRect(rect);

w.Unlock();
</code>```

It works perfect, but I want to skip the scale function and only want to get the decoded image to the WritableBitmap buffer. I try to use this code, change the sws_scale function to memcpy, but it shows nothing. The context->frame is AVFrame*.

```<code>memcpy(scaledBuffer, context->frame->data, AV_NUM_DATA_POINTERS * sizeof(uint8_t));
memcpy(&scaledBufferStride, context->frame->linesize, AV_NUM_DATA_POINTERS * sizeof(int));
</code>```

How can I copy the AVFrame buffer to the WritableBitmap buffer?

Body:
I have a C++ function definition with ffmpeg scaler The last two parameter is my question (buffer and stride):

int scale_decoded_video_frame(void* handle, void* scalerHandle, void* scaledBuffer, int scaledBufferStride)

sws_scale(
    scalerContext->sws_context,
    srcData,
    context->frame->linesize,
    0,
    scalerContext->source_height,
    reinterpret_cast<uint8_t**>(&scaledBuffer),
    &scaledBufferStride);

When I declared it in C# I use the following code:

[DllImport(LibraryName, EntryPoint = "scale_decoded_video_frame", CallingConvention = CallingConvention.Cdecl)]
public static extern int ScaleDecodedVideoFrame(IntPtr handle, IntPtr scalerHandle, IntPtr scaledBuffer, int scaledBufferStride);

And the C# call:

WriteableBitmap w = new WriteableBitmap(1920, 1080, 96, 96, PixelFormats.Pbgra32, null);
RenderOptions.SetBitmapScalingMode(w, BitmapScalingMode.NearestNeighbor);
w.Lock();

Int32Rect rect = new Int32Rect(0, 0, 1920, 1080);

resultCode = FFmpegVideoPInvoke.ScaleDecodedVideoFrame(decoderPtr, scalerHandle, w.BackBuffer, w.BackBufferStride);
if (resultCode == 0)
   w.AddDirtyRect(rect);

w.Unlock();

It works perfect, but I want to skip the scale function and only want to get the decoded image to the WritableBitmap buffer. I try to use this code, change the sws_scale function to memcpy, but it shows nothing. The context->frame is AVFrame*.

memcpy(scaledBuffer, context->frame->data, AV_NUM_DATA_POINTERS * sizeof(uint8_t));
memcpy(&scaledBufferStride, context->frame->linesize, AV_NUM_DATA_POINTERS * sizeof(int));

How can I copy the AVFrame buffer to the WritableBitmap buffer?


问:
CardView with rounded corners
everyone. I would like to show only the top two corners of a CardView rounded. I'm trying to do that with a separate layout file. Nothing happens at all. The corners are not rounded.

acitivity_single_xml layout

```<code>   <androidx.cardview.widget.CardView
    android:id="@+id/cardView2"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="40dp"
    android:background="@drawable/card_radius"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/imageView3">

     ...

   </androidx.cardview.widget.CardView>
</code>```

card_radius.xml

```<code><?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
    <shape android:shape="rectangle">
        <corners android:topRightRadius="40dp"
            android:topLeftRadius="40dp"
            android:bottomLeftRadius="0dp"
            android:bottomRightRadius="0dp"></corners>
        <solid android:color="@color/white_real"></solid>
    </shape>
 </item>
</code>```

Title: CardView with rounded corners

Body:
everyone. I would like to show only the top two corners of a CardView rounded. I'm trying to do that with a separate layout file. Nothing happens at all. The corners are not rounded.

acitivity_single_xml layout

   <androidx.cardview.widget.CardView
    android:id="@+id/cardView2"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="40dp"
    android:background="@drawable/card_radius"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/imageView3">

     ...

   </androidx.cardview.widget.CardView>

card_radius.xml

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
    <shape android:shape="rectangle">
        <corners android:topRightRadius="40dp"
            android:topLeftRadius="40dp"
            android:bottomLeftRadius="0dp"
            android:bottomRightRadius="0dp"></corners>
        <solid android:color="@color/white_real"></solid>
    </shape>
 </item>


问:
org.xml.sax.SAXException: No deserializer for {http://www.w3.org/2001/XMLSchema}anyType using SOAP in NODEJS
I'm trying to run an XML post using node-fetch but I get this error:
org.xml.sax.SAXException: No deserializer for {http://www.w3.org/2001/XMLSchema}anyType

Here is the body I send:

```<code><soapenv:Body>
        <e:getXMLListObject>
            <table>Enterprise</table>
            <fields>
                <item>EntCorpName</item>
                <item>EntAcronym</item>
                <item>EntSiren</item>
                <item>EntSiret</item>
                <item>EntAd1</item>
                <item>EntZip</item>
                <item>EntCity</item>
            </fields>
            <query>
                <item>
                    <item>Entid = '001152000000'</item>
                </item>
            </query>
        </e:getXMLListObject>\n
    </soapenv:Body>
</code>```

An idea please, this is the first time I use this type of body (table) for the others, it works very well.

The code:  await fetch(url,options).then(response => {...}
I put this xml in the body parameter in options with soapenv:Envelope ofc.

```<code>let options = {
        method: 'POST',
        body: xml,
        timeout: 10000,
        credentials: 'include',
        headers: {
            'Content-Type': 'text/xml;application/x-www-form-urlencoded;charset=UTF-8',
            'Content-Length': xml.length,
            'Accept': 'text/xml',
            'Access-Control-Allow-Credentials': true,
            'Access-Control-Allow-Origin': true,
            'soapaction': 'add',
            "Access-Control-Expose-Headers":"Authorization",
            "Cookie": cookies
        }
    };
</code>```

NB : Is a client Xml.

Body:
I'm trying to run an XML post using node-fetch but I get this error:
org.xml.sax.SAXException: No deserializer for {http://www.w3.org/2001/XMLSchema}anyType

Here is the body I send:

<soapenv:Body>
        <e:getXMLListObject>

Enterprise

            <fields>
                <item>EntCorpName</item>
                <item>EntAcronym</item>
                <item>EntSiren</item>
                <item>EntSiret</item>
                <item>EntAd1</item>
                <item>EntZip</item>
                <item>EntCity</item>
            </fields>
            <query>
                <item>
                    <item>Entid = '001152000000'</item>
                </item>
            </query>
        </e:getXMLListObject>\n
    </soapenv:Body>

An idea please, this is the first time I use this type of body (table) for the others, it works very well.

The code:  await fetch(url,options).then(response => {...}
I put this xml in the body parameter in options with soapenv:Envelope ofc.

let options = {
        method: 'POST',
        body: xml,
        timeout: 10000,
        credentials: 'include',
        headers: {
            'Content-Type': 'text/xml;application/x-www-form-urlencoded;charset=UTF-8',
            'Content-Length': xml.length,
            'Accept': 'text/xml',
            'Access-Control-Allow-Credentials': true,
            'Access-Control-Allow-Origin': true,
            'soapaction': 'add',
            "Access-Control-Expose-Headers":"Authorization",
            "Cookie": cookies
        }
    };

NB : Is a client Xml.


问:
Rails Credentials Encrypted and Saved but Return Nil
I'm following this rails tutorial : Ruby on Rails for Beginners. I was doing fine until I had to save some credentials in development environment.

I did the following command in the ubuntu console :

EDITOR="code --wait" rails credentials:edit --environment=development
```
<p>It opened an empty file (number.development.yaml) in which I typed some test data for me to fetch later :</p>
<pre class="lang-yaml prettyprint-override"><code> test:
   my_key: "hello"
   another_key: "world"
</code>```

Then I did ctrl+S, it saved in c:/tmp.

And I closed it so it could be encrypted and saved.

My Ubuntu terminal is telling me that it worked :

nyc@LAPTOP-IMRKD0GG:/mnt/c/code/sheduled_tweets$ EDITOR="code --wait" rails credentials:edit --environment=development
File encrypted and saved.
```
<p>But then when I try to access the data by going in the console it doesn't work.
Trying various commands to see if I can access the data:</p>
```Rails.application.credentials
# => #<ActiveSupport::EncryptedConfiguration:0x00007f25d7122cb8
# @config={},
# @content_path=#<Pathname:/mnt/c/code/sheduled_tweets/config/credentials/development.yml.enc>,
# @encryptor=
#  #<ActiveSupport::MessageEncryptor:0x00007f25d71221a0
#   @aead_mode=true,
#   @cipher="aes-128-gcm",
#   @on_rotation=nil,
#   @options={:cipher=>"aes-128-gcm"},
#   @rotations=[],
#   @secret="I\x82\xC2\xE2\xEB|)R\xFA+t\xF7<3:\x17",
#   @serializer=Marshal,
#   @sign_secret=nil,
#   @verifier=ActiveSupport::MessageEncryptor::NullVerifier>,
# @env_key="RAILS_MASTER_KEY",
# @key_file_contents="4982c2e2eb7c2952fa2b74f73c333a17",
# @key_path=#<Pathname:/mnt/c/code/sheduled_tweets/config/credentials/development.key>,
# @options={},
# @raise_if_missing_key=false>

Rails.application.credentials.test
# => nil

Rails.application.credentials.dig(:test)
# => nil

Rails.application.credentials.dig(:test, :my_key)
# => nil

Rails.application.credentials.dig(:test, :another_key)
# => nil
```

As you can see it doesn't look like my test was saved anywhere.

I read and watched many tutorials and guides , watched a bunch of answers to similar issues here on stackoverflow but without any success.

If you have an idea on what I'm doing wrong I would greatly appreciate your help.

Body:
I'm following this rails tutorial : Ruby on Rails for Beginners. I was doing fine until I had to save some credentials in development environment.

I did the following command in the ubuntu console :

EDITOR="code --wait" rails credentials:edit --environment=development

It opened an empty file (number.development.yaml) in which I typed some test data for me to fetch later :

 test:
   my_key: "hello"
   another_key: "world"

Then I did ctrl+S, it saved in c:/tmp.

And I closed it so it could be encrypted and saved.

My Ubuntu terminal is telling me that it worked :

nyc@LAPTOP-IMRKD0GG:/mnt/c/code/sheduled_tweets$ EDITOR="code --wait" rails credentials:edit --environment=development
File encrypted and saved.

But then when I try to access the data by going in the console it doesn't work.
Trying various commands to see if I can access the data:

Rails.application.credentials
# => #<ActiveSupport::EncryptedConfiguration:0x00007f25d7122cb8
# @config={},
# @content_path=#<Pathname:/mnt/c/code/sheduled_tweets/config/credentials/development.yml.enc>,
# @encryptor=
#  #<ActiveSupport::MessageEncryptor:0x00007f25d71221a0
#   @aead_mode=true,
#   @cipher="aes-128-gcm",
#   @on_rotation=nil,
#   @options={:cipher=>"aes-128-gcm"},
#   @rotations=[],
#   @secret="I\x82\xC2\xE2\xEB|)R\xFA+t\xF7<3:\x17",
#   @serializer=Marshal,
#   @sign_secret=nil,
#   @verifier=ActiveSupport::MessageEncryptor::NullVerifier>,
# @env_key="RAILS_MASTER_KEY",
# @key_file_contents="4982c2e2eb7c2952fa2b74f73c333a17",
# @key_path=#<Pathname:/mnt/c/code/sheduled_tweets/config/credentials/development.key>,
# @options={},
# @raise_if_missing_key=false>

Rails.application.credentials.test
# => nil

Rails.application.credentials.dig(:test)
# => nil

Rails.application.credentials.dig(:test, :my_key)
# => nil

Rails.application.credentials.dig(:test, :another_key)
# => nil

As you can see it doesn't look like my test was saved anywhere.

I read and watched many tutorials and guides , watched a bunch of answers to similar issues here on stackoverflow but without any success.

If you have an idea on what I'm doing wrong I would greatly appreciate your help.


问:
difference between PowerPoint 2003 and 2010 (ParagraphFormat.Alignment)
What we do:

We create powerpoints documents for Powerpoint 2010 and Powerpoint 2003.

Where the problem is:

Lables created with following sourcecode appear different in Powerpoint 2010 and Powerpoint 2003. This error only occurs with lables with alignment = center and/or if we set rotation > 0. (see screenshot)

```<code>private Microsoft.Office.Interop.PowerPoint.Shape AddLabel(Microsoft.Office.Interop.PowerPoint.Slide Slide,
        float Left, float Top, float Width, float Height, string Text, float FontSize,
        bool Bold, Microsoft.Office.Interop.PowerPoint.PpParagraphAlignment Alignment)
{
        Microsoft.Office.Interop.PowerPoint.Shape label;

        label = Slide.Shapes.AddLabel(
            Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationHorizontal,
            Left, Top, Width, Height);
        label.TextFrame.TextRange.Text = Text;
        label.TextFrame.TextRange.Font.Size = FontSize;
        label.TextFrame.TextRange.Font.Bold = Bold ? MsoTriState.msoTrue : MsoTriState.msoFalse;
        label.TextFrame.TextRange.ParagraphFormat.Alignment = Alignment;

        return label;
}

[...]

label = AddLabel(slide, 50, (slide.Master.Height - 30) / 2, slide.Master.Height, 30,
            "Nutzen", 18, false, PpParagraphAlignment.ppAlignCenter);
label.Rotation = -90;
</code>```

Does anybody know, if there is a simple way to make the source compatible to both Powerpoint versions?

ContentLicense: CC BY-SA 3.0

Body:
What we do:

We create powerpoints documents for Powerpoint 2010 and Powerpoint 2003.

Where the problem is:

Lables created with following sourcecode appear different in Powerpoint 2010 and Powerpoint 2003. This error only occurs with lables with alignment = center and/or if we set rotation > 0. (see screenshot)

private Microsoft.Office.Interop.PowerPoint.Shape AddLabel(Microsoft.Office.Interop.PowerPoint.Slide Slide,
        float Left, float Top, float Width, float Height, string Text, float FontSize,
        bool Bold, Microsoft.Office.Interop.PowerPoint.PpParagraphAlignment Alignment)
{
        Microsoft.Office.Interop.PowerPoint.Shape label;

        label = Slide.Shapes.AddLabel(
            Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationHorizontal,
            Left, Top, Width, Height);
        label.TextFrame.TextRange.Text = Text;
        label.TextFrame.TextRange.Font.Size = FontSize;
        label.TextFrame.TextRange.Font.Bold = Bold ? MsoTriState.msoTrue : MsoTriState.msoFalse;
        label.TextFrame.TextRange.ParagraphFormat.Alignment = Alignment;

        return label;
}

[...]

label = AddLabel(slide, 50, (slide.Master.Height - 30) / 2, slide.Master.Height, 30,
            "Nutzen", 18, false, PpParagraphAlignment.ppAlignCenter);
label.Rotation = -90;

Does anybody know, if there is a simple way to make the source compatible to both Powerpoint versions?


问:
Execute a function as a different account in google apps script
Let's say there is the admin who has written an apps script code and the admin credentials are
username - admin@gmail.com
password - admin_password

It's deployed as a web app and the user can access the app with their google account

The app has 2 functions which are related to google drive (shared drive)
Now I want the first function to run with the credentials of the user accessing the app and the second function to run under the credentials of the admin, but I don't want to share the admin credentials with the end user

How can this be achieved with apps script ?

Can we sign in using a code for the admin and hide the code to the end user ?

I tried the execute as admin function in apps script but that asks for the credentials of the admin


问:
how to save multiline dataframe string value in CSV with line continuation
Source data is a multiline like below

Name,Skills

"Mark","AWS Developer

Airflow"

"Joe", "Java

Azure"

when I read it through multiline option with pyspark dataframe and I can do search and replace "\n" new line character.

I need to load similar multiline data into redshift using copy option and due to variety of data I can't use CSV option as I need to use escape option as well which is not compatible with CSV option.

Purpose can be solved if I could produce CSV in following format but I'm not able to do it despite using different replace options even same in parquet as well.

"Name","Skills"

"Mark","AWS Developer \

Airflow"

"Joe", "Java \

Azure"

Any help/suggestion is highly appreciated

When I replace this "\n" with "\\\\n" and render dataframe field in log, I could see things changed the way I wanted

```<code>df = spark.read.options(header='True', delimiter=',', multiLine='True').csv("s3://sample/csv/data.csv")
column_list = df.columns
c_newline = "\\\\" + "\n"
for d_col in column_list:
  df = df.withColumn(d_col,regexp_replace(d_col,"\n",c_newline))
df.show(5,False)
df.write.mode('overwrite').option("header", true").option("quoteAll",true").csv("s3://sample/csv/dataprocessed.csv")
</code>```

but when it stores in CSV, it saves something like below

"Name","Skills"

"Mark","AWS Developer \\

Airflow"

"Joe", "Java \\

Azure"

Expectation is like below:

"Name","Skills"

"Mark","AWS Developer \

Airflow"

"Joe", "Java \

Azure"

Body:
Source data is a multiline like below

Name,Skills

"Mark","AWS Developer

Airflow"

"Joe", "Java

Azure"

when I read it through multiline option with pyspark dataframe and I can do search and replace "\n" new line character.

I need to load similar multiline data into redshift using copy option and due to variety of data I can't use CSV option as I need to use escape option as well which is not compatible with CSV option.

Purpose can be solved if I could produce CSV in following format but I'm not able to do it despite using different replace options even same in parquet as well.

"Name","Skills"

"Mark","AWS Developer \

Airflow"

"Joe", "Java \

Azure"

Any help/suggestion is highly appreciated

When I replace this "\n" with "\\\\n" and render dataframe field in log, I could see things changed the way I wanted

df = spark.read.options(header='True', delimiter=',', multiLine='True').csv("s3://sample/csv/data.csv")
column_list = df.columns
c_newline = "\\\\" + "\n"
for d_col in column_list:
  df = df.withColumn(d_col,regexp_replace(d_col,"\n",c_newline))
df.show(5,False)
df.write.mode('overwrite').option("header", true").option("quoteAll",true").csv("s3://sample/csv/dataprocessed.csv")

but when it stores in CSV, it saves something like below

"Name","Skills"

"Mark","AWS Developer \\

Airflow"

"Joe", "Java \\

Azure"

Expectation is like below:

"Name","Skills"

"Mark","AWS Developer \

Airflow"

"Joe", "Java \

Azure"


问:
Why does my spigot plugin maven build fail - cannot access org.bukkit.advancement.AdvancementDisplayType?
I'm making a spigot plugin just for my minecraft server. Until now everything was OK and worked perfectly. Then I added some code and it just won't build...
Here is the maven output:

https://pastebin.com/fftMVJth

And here is the code I added:

@EventHandler
public void onPlayerAdvancement(@NotNull PlayerAdvancementDoneEvent _event) {
    AdvancementDisplay $display = Objects.requireNonNull(_event.getAdvancement().getDisplay());
    String $message = "";

    switch ($display.getType()) {
        case TASK -> $message =
                """
                ["","<Name> has made the advancement ",{"text":"[<AName>]","color":"green","hoverEvent":{"action":"show_text","contents":[{"text":"<AName>\\n","color":"green"},{"text":"<ADescription>","color":"green"}]}}]
                """;
        case GOAL -> $message =
                """
                ["","<Name> has reached the goal ",{"text":"[<AName>]","color":"green","hoverEvent":{"action":"show_text","contents":[{"text":"<AName>\\n","color":"green"},{"text":"<ADescription>","color":"green"}]}}]
                """;
        case CHALLENGE -> $message =
                """
                ["","<Name> has completed the challenge ",{"text":"[<AName>]","color":"dark_purple","hoverEvent":{"action":"show_text","contents":[{"text":"<AName>\\n","color":"dark_purple"},{"text":"<ADescription>","color":"dark_purple"}]}}]
                """;
    }

    String final$message = $message;
    getServer().getOnlinePlayers().forEach(_player -> _player.sendRawMessage(final$message
            .replaceAll("<Name>", _event.getPlayer().getName())
            .replaceAll("<AName>", $display.getTitle())
            .replaceAll("<ADescription>", $display.getDescription())));
}
```
<p>I don't think the error is in my code, it is probably in something else...
So here is my <code>pom.xml</code>:</p>
<pre class="lang-xml prettyprint-override"><code><?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>codes.rorak</groupId>
    <artifactId>Plugin</artifactId>
    <version>0.0.16-SNAPSHOT</version>

    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
    </properties>

    <repositories>
        <repository>
            <id>spigot-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.19.3-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations</artifactId>
            <version>RELEASE</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>

</project>
</code>```

I tried to bring the version in pom.xml down to 8, but then my code doesn't work, because I use string blocks, switch expressions and parametrized instanceof operators... But I don't think that would work then, because in the error message, some of the errors are from code that was there from start and worked perfectly before...

EDIT: I event tried to edit my code so it works on Java 8 (and bringing it down to that level too ofc), but the error is still there...

Thanks for help!

Body:
I'm making a spigot plugin just for my minecraft server. Until now everything was OK and worked perfectly. Then I added some code and it just won't build...
Here is the maven output:

https://pastebin.com/fftMVJth

And here is the code I added:

@EventHandler
public void onPlayerAdvancement(@NotNull PlayerAdvancementDoneEvent _event) {
    AdvancementDisplay $display = Objects.requireNonNull(_event.getAdvancement().getDisplay());
    String $message = "";

    switch ($display.getType()) {
        case TASK -> $message =
                """
                ["","<Name> has made the advancement ",{"text":"[<AName>]","color":"green","hoverEvent":{"action":"show_text","contents":[{"text":"<AName>\\n","color":"green"},{"text":"<ADescription>","color":"green"}]}}]
                """;
        case GOAL -> $message =
                """
                ["","<Name> has reached the goal ",{"text":"[<AName>]","color":"green","hoverEvent":{"action":"show_text","contents":[{"text":"<AName>\\n","color":"green"},{"text":"<ADescription>","color":"green"}]}}]
                """;
        case CHALLENGE -> $message =
                """
                ["","<Name> has completed the challenge ",{"text":"[<AName>]","color":"dark_purple","hoverEvent":{"action":"show_text","contents":[{"text":"<AName>\\n","color":"dark_purple"},{"text":"<ADescription>","color":"dark_purple"}]}}]
                """;
    }

    String final$message = $message;
    getServer().getOnlinePlayers().forEach(_player -> _player.sendRawMessage(final$message
            .replaceAll("<Name>", _event.getPlayer().getName())
            .replaceAll("<AName>", $display.getTitle())
            .replaceAll("<ADescription>", $display.getDescription())));
}

I don't think the error is in my code, it is probably in something else...
So here is my pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>codes.rorak</groupId>
    <artifactId>Plugin</artifactId>
    <version>0.0.16-SNAPSHOT</version>

    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
    </properties>

    <repositories>
        <repository>
            <id>spigot-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.19.3-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations</artifactId>
            <version>RELEASE</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>

</project>

I tried to bring the version in pom.xml down to 8, but then my code doesn't work, because I use string blocks, switch expressions and parametrized instanceof operators... But I don't think that would work then, because in the error message, some of the errors are from code that was there from start and worked perfectly before...

EDIT: I event tried to edit my code so it works on Java 8 (and bringing it down to that level too ofc), but the error is still there...

Thanks for help!


问:
overlapping words during iteration
I am trying to have a simple loop for random words that may be placed horizontally and/or vertically and/or diagonally depending on the allowed space and wordLength.
Below, is what I came up with but there is significant overlapping and broken words.
Is there a way to have the loop in a single 'put' routine for all direction?
All my attempts have resulted in buggier outcomes.
Thanks

`

```<code>//Check horizontal orientation and place the word if available spaces allow it
void putHorizzontalWord(char word[10])
{
    int rRow, rCol , ok , i;

    do
    {
        rRow = rand() % 10;
        rCol = rand() % 10;

        ok = 1;
        if(rCol + strlen(word) < 10)
        {
            for(i = 0;i < strlen(word);i++)
            {
                if(puzzle[rRow][rCol + i] == '*' ||
                    puzzle[rRow][rCol + i] == word[i])
                {
                    puzzle[rRow][rCol + i] = word[i];
                }
                else
                {
                    ok = 0;
                }
            }
        }
        else
        {
            ok = 0;
        }
    }
    while(ok == 0);
}

//Check vertical orientation and place the word if available spaces allow it
void putVerticalWord(char word[10]) //this, doesn't seem to work'
{
    int rRow, rCol , ok , i;

    do
    {
        rRow = rand() % 10;
        rCol = rand() % 10;

        ok = 0;
        if(rRow + strlen(word) < 10)
        {
            for(i = 0;i < strlen(word);i++)
            {
                if(puzzle[rRow + i][rCol] == '*' ||
                    puzzle[rRow + i][rCol] == word[i])
                {
                    puzzle[rRow + i][rCol] = word[i];
                }
                else
                {
                    ok = 1;
                }
            }
        }
        else
        {
            ok = 1;
        }
    }
    while(ok == 1);
}

//Check diagonal orientation and place the word if available spaces allow it
void putDiagonalWord(char word[10]) //this, doesn't seem to work'
{
    int rRow, rCol , ok , i;

    do
    {
        rRow = rand() % 10;
        rCol = rand() % 10;

        ok = 2;
        if(rRow + strlen(word) < 10)
        {
            for(i = 0;i < strlen(word);i++)
            {
                if(puzzle[rRow + i][rCol + i] == '*' ||
                    puzzle[rRow + i][rCol + i] == word[i])
                {
                    puzzle[rRow + i][rCol + i] = word[i];
                }
                else
                {
                    ok = 2;
                }
            }
        }
        else
        {
            ok = 1;
        }
    }
    while(ok == 0);
}

void fillPuzzleWithWords()
{
    int i , orientation;
    getFourRandomWords();

    for(i=0; i<4; i++)
    {
        orientation = rand() % 3;
        if(orientation == 0)
        {
            putHorizzontalWord(fourWords[i]);
        }
        else if(orientation == 1)
        {
            putVerticalWord(fourWords[i]);
        }
        else
        {
            putDiagonalWord(fourWords[i]);
        }
    }
}

</code>```

`

Tried to have a single put routine for all word directions without breaking or overlapping

Title: overlapping words during iteration

Body:
I am trying to have a simple loop for random words that may be placed horizontally and/or vertically and/or diagonally depending on the allowed space and wordLength.
Below, is what I came up with but there is significant overlapping and broken words.
Is there a way to have the loop in a single 'put' routine for all direction?
All my attempts have resulted in buggier outcomes.
Thanks

`

//Check horizontal orientation and place the word if available spaces allow it
void putHorizzontalWord(char word[10])
{
    int rRow, rCol , ok , i;

    do
    {
        rRow = rand() % 10;
        rCol = rand() % 10;

        ok = 1;
        if(rCol + strlen(word) < 10)
        {
            for(i = 0;i < strlen(word);i++)
            {
                if(puzzle[rRow][rCol + i] == '*' ||
                    puzzle[rRow][rCol + i] == word[i])
                {
                    puzzle[rRow][rCol + i] = word[i];
                }
                else
                {
                    ok = 0;
                }
            }
        }
        else
        {
            ok = 0;
        }
    }
    while(ok == 0);
}

//Check vertical orientation and place the word if available spaces allow it
void putVerticalWord(char word[10]) //this, doesn't seem to work'
{
    int rRow, rCol , ok , i;

    do
    {
        rRow = rand() % 10;
        rCol = rand() % 10;

        ok = 0;
        if(rRow + strlen(word) < 10)
        {
            for(i = 0;i < strlen(word);i++)
            {
                if(puzzle[rRow + i][rCol] == '*' ||
                    puzzle[rRow + i][rCol] == word[i])
                {
                    puzzle[rRow + i][rCol] = word[i];
                }
                else
                {
                    ok = 1;
                }
            }
        }
        else
        {
            ok = 1;
        }
    }
    while(ok == 1);
}

//Check diagonal orientation and place the word if available spaces allow it
void putDiagonalWord(char word[10]) //this, doesn't seem to work'
{
    int rRow, rCol , ok , i;

    do
    {
        rRow = rand() % 10;
        rCol = rand() % 10;

        ok = 2;
        if(rRow + strlen(word) < 10)
        {
            for(i = 0;i < strlen(word);i++)
            {
                if(puzzle[rRow + i][rCol + i] == '*' ||
                    puzzle[rRow + i][rCol + i] == word[i])
                {
                    puzzle[rRow + i][rCol + i] = word[i];
                }
                else
                {
                    ok = 2;
                }
            }
        }
        else
        {
            ok = 1;
        }
    }
    while(ok == 0);
}

void fillPuzzleWithWords()
{
    int i , orientation;
    getFourRandomWords();

    for(i=0; i<4; i++)
    {
        orientation = rand() % 3;
        if(orientation == 0)
        {
            putHorizzontalWord(fourWords[i]);
        }
        else if(orientation == 1)
        {
            putVerticalWord(fourWords[i]);
        }
        else
        {
            putDiagonalWord(fourWords[i]);
        }
    }
}

`

Tried to have a single put routine for all word directions without breaking or overlapping


问:
Is there any alernatives for execute INSERT query from main_db stored procedure to a log table in another database
Trying to keep log of a table. At every update time i need to insert the row that is being updated into log table

main table and log table are created in separate databases.

Is there any alternative/ More optimized version of solution for this use-case.

Here provided dummy database, stored procedure which does the job of my use-case
In this approach

Need to explicitly pass connection string

Right now connection string hard coded. But it's not very convenient.

------ MAIN DATABASE -----

```<code>CREATE TABLE tbl_test (
        pk_test_id BIGSERIAL PRIMARY KEY,
        vhr_test_value VARCHAR(200) DEFAULT ''
);
</code>```

------ LOG DATABASE -----

```<code>CREATE TABLE tbl_test_log (
        pk_test_log_id BIGSERIAL PRIMARY KEY,
        fk_test_id BIGINT NOT NULL,
        vhr_test_value VARCHAR(200) DEFAULT ''
);
</code>```

---- INSERTING TO LOG TABLE -----

```<code>CREATE OR REPLACE PROCEDURE sp_insert_or_update_to_test_log() AS $$
    DECLARE
        insert_statement TEXT;

    BEGIN

        insert_statement = $Q1$ INSERT INTO tbl_test_log (fk_test_id, vhr_test_value)
                                SELECT pk_test_id, vhr_test_value
                                FROM dblink('host=192.168.1.3 port=5432 user=postgres password=admin dbname=main_db',
                                            'SELECT pk_test_id, vhr_test_value FROM tbl_test WHERE pk_test_id=1')
                                     AS ct(pk_test_id BIGINT, vhr_test_value VARCHAR) $Q1$;

        dblink_exec('host=192.168.1.3 port=5432 user=postgres password=admin dbname=db_log', insert_statement, true);
        RETURN;

    END;
$$ LANGUAGE plpgsql;

CALL sp_insert_or_update_to_test_log(); -- Executed from main database.
</code>```

Body:
Trying to keep log of a table. At every update time i need to insert the row that is being updated into log table

main table and log table are created in separate databases.

Is there any alternative/ More optimized version of solution for this use-case.

Here provided dummy database, stored procedure which does the job of my use-case
In this approach

Need to explicitly pass connection string

Right now connection string hard coded. But it's not very convenient.

------ MAIN DATABASE -----

CREATE TABLE tbl_test (
        pk_test_id BIGSERIAL PRIMARY KEY,
        vhr_test_value VARCHAR(200) DEFAULT ''
);

------ LOG DATABASE -----

CREATE TABLE tbl_test_log (
        pk_test_log_id BIGSERIAL PRIMARY KEY,
        fk_test_id BIGINT NOT NULL,
        vhr_test_value VARCHAR(200) DEFAULT ''
);

---- INSERTING TO LOG TABLE -----

CREATE OR REPLACE PROCEDURE sp_insert_or_update_to_test_log() AS $$
    DECLARE
        insert_statement TEXT;

    BEGIN

        insert_statement = $Q1$ INSERT INTO tbl_test_log (fk_test_id, vhr_test_value)
                                SELECT pk_test_id, vhr_test_value
                                FROM dblink('host=192.168.1.3 port=5432 user=postgres password=admin dbname=main_db',
                                            'SELECT pk_test_id, vhr_test_value FROM tbl_test WHERE pk_test_id=1')
                                     AS ct(pk_test_id BIGINT, vhr_test_value VARCHAR) $Q1$;

        dblink_exec('host=192.168.1.3 port=5432 user=postgres password=admin dbname=db_log', insert_statement, true);
        RETURN;

    END;
$$ LANGUAGE plpgsql;

CALL sp_insert_or_update_to_test_log(); -- Executed from main database.


问:
Unable to open Onedrive File Picker in Nuxt application
I have integrated the Onedrive Picker 7.2 in my nuxt application and I am getting the following error:

errorCode: "popupOpen"

message: "Another popup is already opened."

stack: "Error: Another popup is already opened.
at new e (https://js.live.net/v7.2/OneDrive.js:4:32744)
at https://js.live.net/v7.2/OneDrive.js:4:19359"

I have created only one url i.e /upload (upload.vue) and the code is as follows:

```<code><template>
    <button @click="launchOneDrivePicker()">Open from OneDrive</button>
</template>

<script>
export default {
    mounted() {
        let gDrive = document.createElement("script")
        gDrive.setAttribute("type", "text/javascript")
        gDrive.setAttribute("src", "https://js.live.net/v7.2/OneDrive.js")
        document.head.appendChild(gDrive)
    },
    methods: {
        launchOneDrivePicker(){
            var odOptions = {
                clientId: "3b448xxx-f8b6-45bd-axx6-b0ec0xxxxxxx",
                multiSelect: false,
                action: "download",
                success: function(files) { console.log("success") },
                cancel: function() { console.log("cancel") },
                error: function(error) { console.log("error") }
            }
            OneDrive.open(odOptions);
        }
    }
}
</script>
</code>```

Also, I have added the redirect URI so I guess thats not the issue with that. The same thing I have tried on static html page run on live IP and its working fine.

Body:
I have integrated the Onedrive Picker 7.2 in my nuxt application and I am getting the following error:

errorCode: "popupOpen"

message: "Another popup is already opened."

stack: "Error: Another popup is already opened.
at new e (https://js.live.net/v7.2/OneDrive.js:4:32744)
at https://js.live.net/v7.2/OneDrive.js:4:19359"

I have created only one url i.e /upload (upload.vue) and the code is as follows:

<template>
    <button @click="launchOneDrivePicker()">Open from OneDrive</button>
</template>

Also, I have added the redirect URI so I guess thats not the issue with that. The same thing I have tried on static html page run on live IP and its working fine.


问:
Amplify build failed for angular project
I am trying to deploy an angular project on AWS Amplify but the build doesn't go through

node version : 16
angular version: 14

note: I've  forced the npm build and with npm audit -f and tried to npm install --legacy-peer-deps but still failed

Some help will be very much appreciated!

Here are the logs of Amplify

```<code>phase: preBuild
                                 # Executing command: npm i -f
2023-01-02T09:04:12.161Z [WARNING]: npm
2023-01-02T09:04:12.162Z [WARNING]: WARN using --force Recommended protections disabled.
2023-01-02T09:04:15.990Z [WARNING]: npm
2023-01-02T09:04:15.992Z [WARNING]: WARN ERESOLVE overriding peer dependency
                                    npm WARN While resolving: @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN Found: @angular/common@14.2.12
                                    npm WARN node_modules/@angular/common
                                    npm WARN   @angular/common@"^14.2.8" from the root project
                                    npm WARN   6 more (@angular/cdk, @angular/forms, @angular/material, ...)
                                    npm WARN
                                    npm WARN Could not resolve dependency:
                                    npm WARN peer @angular/common@"^13.0.0" from @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN node_modules/@ng-bootstrap/ng-bootstrap
                                    npm WARN   @ng-bootstrap/ng-bootstrap@"^11.0.1" from the root project
                                    npm WARN
                                    npm WARN Conflicting peer dependency: @angular/common@13.3.12
                                    npm WARN node_modules/@angular/common
                                    npm WARN   peer @angular/common@"^13.0.0" from @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN   node_modules/@ng-bootstrap/ng-bootstrap
                                    npm WARN     @ng-bootstrap/ng-bootstrap@"^11.0.1" from the root project
2023-01-02T09:04:15.994Z [WARNING]: npm
2023-01-02T09:04:15.995Z [WARNING]: WARN ERESOLVE overriding peer dependency
                                    npm WARN While resolving: @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN Found: @angular/core@14.2.12
                                    npm WARN node_modules/@angular/core
                                    npm WARN   @angular/core@"^14.2.8" from the root project
                                    npm WARN   10 more (@angular/animations, @angular/cdk, @angular/common, ...)
                                    npm WARN
                                    npm WARN Could not resolve dependency:
                                    npm WARN peer @angular/core@"^13.0.0" from @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN node_modules/@ng-bootstrap/ng-bootstrap
                                    npm WARN   @ng-bootstrap/ng-bootstrap@"^11.0.1" from the root project
                                    npm WARN
                                    npm WARN Conflicting peer dependency: @angular/core@13.3.12
                                    npm WARN node_modules/@angular/core
                                    npm WARN   peer @angular/core@"^13.0.0" from @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN
2023-01-02T09:04:15.995Z [WARNING]: node_modules/@ng-bootstrap/ng-bootstrap
                                    npm WARN     @ng-bootstrap/ng-bootstrap@"^11.0.1" from the root project
2023-01-02T09:04:15.996Z [WARNING]: npm WARN ERESOLVE overriding peer dependency
                                    npm WARN While resolving: @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN Found: @angular/forms@14.2.12
                                    npm WARN node_modules/@angular/forms
                                    npm WARN   @angular/forms@"^14.2.8" from the root project
                                    npm WARN   1 more (@angular/material)
                                    npm
2023-01-02T09:04:15.997Z [WARNING]: WARN
                                    npm WARN Could not resolve dependency:
                                    npm WARN peer @angular/forms@"^13.0.0" from @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN node_modules/@ng-bootstrap/ng-bootstrap
                                    npm WARN   @ng-bootstrap/ng-bootstrap@"^11.0.1" from the root project
                                    npm WARN
                                    npm WARN Conflicting peer dependency: @angular/forms@13.3.12
                                    npm WARN node_modules/@angular/forms
                                    npm WARN   peer @angular/forms@"^13.0.0" from @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN   node_modules/@ng-bootstrap/ng-bootstrap
                                    npm WARN     @ng-bootstrap/ng-bootstrap@"^11.0.1" from the root project
2023-01-02T09:04:16.010Z [WARNING]: npm WARN
2023-01-02T09:04:16.010Z [WARNING]: ERESOLVE overriding peer dependency
2023-01-02T09:04:16.014Z [WARNING]: npm WARN
2023-01-02T09:04:16.014Z [WARNING]: ERESOLVE overriding peer dependency
2023-01-02T09:04:16.441Z [WARNING]: npm WARN ERESOLVE overriding peer dependency
2023-01-02T09:04:16.442Z [WARNING]: npm WARN While resolving: @angular-devkit/build-angular@14.2.10
                                    npm WARN Found: @angular/localize@13.3.12
                                    npm WARN node_modules/@angular/localize
                                    npm WARN   peer @angular/localize@"^13.0.0" from @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN   node_modules/@ng-bootstrap/ng-bootstrap
                                    npm WARN     @ng-bootstrap/ng-bootstrap@"^11.0.1" from the root project
                                    npm WARN
                                    npm WARN Could not resolve dependency:
                                    npm WARN peerOptional @angular/localize@"^14.0.0" from @angular-devkit/build-angular@14.2.10
                                    npm WARN node_modules/@angular-devkit/build-angular
                                    npm WARN   dev @angular-devkit/build-angular@"^14.2.7" from the root project
                                    npm WARN
                                    npm WARN Conflicting peer dependency: @angular/localize@14.2.12
                                    npm WARN node_modules/@angular/localize
                                    npm WARN   peerOptional @angular/localize@"^14.0.0" from @angular-devkit/build-angular@14.2.10
                                    npm WARN   node_modules/@angular-devkit/build-angular
                                    npm WARN     dev @angular-devkit/build-angular@"^14.2.7" from the root project
2023-01-02T09:04:19.201Z [WARNING]: npm
2023-01-02T09:04:19.205Z [WARNING]: WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
2023-01-02T09:04:20.287Z [INFO]: removed 1 package, changed 32 packages, and audited 1289 packages in 8s
2023-01-02T09:04:20.287Z [INFO]: 168 packages are looking for funding
                                 run `npm fund` for details
2023-01-02T09:04:20.289Z [INFO]: 2 high severity vulnerabilities
                                 To address all issues, run:
                                 npm audit fix
                                 Run `npm audit` for details.
2023-01-02T09:04:20.302Z [INFO]: # Executing command: npm install --legacy-peer-deps
2023-01-02T09:04:21.971Z [INFO]: removed 7 packages, and audited 1282 packages in 1s
2023-01-02T09:04:21.971Z [INFO]: 165 packages are looking for funding
                                 run `npm fund` for details
2023-01-02T09:04:21.974Z [INFO]: 2 high severity vulnerabilities
                                 To address all issues, run:
                                 npm audit fix
                                 Run `npm audit` for details.
2023-01-02T09:04:21.981Z [INFO]: # Executing command: npm audit fix --force
2023-01-02T09:04:22.247Z [WARNING]: npm
2023-01-02T09:04:22.247Z [WARNING]: WARN using --force Recommended protections disabled.
2023-01-02T09:04:23.836Z [WARNING]: npm
2023-01-02T09:04:23.838Z [WARNING]: WARN ERESOLVE overriding peer dependency
                                    npm WARN While resolving: @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN Found: @angular/common@14.2.12
                                    npm WARN node_modules/@angular/common
                                    npm WARN   @angular/common@"^14.2.8" from the root project
                                    npm WARN   6 more (@angular/cdk, @angular/forms, @angular/material, ...)
                                    npm WARN
                                    npm WARN Could not resolve dependency:
                                    npm WARN peer @angular/common@"^13.0.0" from @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN node_modules/@ng-bootstrap/ng-bootstrap
                                    npm WARN   @ng-bootstrap/ng-bootstrap@"^11.0.1" from the root project
                                    npm WARN
                                    npm WARN Conflicting peer dependency: @angular/common@13.3.12
                                    npm WARN node_modules/@angular/common
                                    npm WARN   peer @angular/common@"^13.0.0" from @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN   node_modules/@ng-bootstrap/ng-bootstrap
                                    npm WARN     @ng-bootstrap/ng-bootstrap@"^11.0.1" from the root project
2023-01-02T09:04:23.840Z [WARNING]: npm
2023-01-02T09:04:23.840Z [WARNING]: WARN ERESOLVE overriding peer dependency
                                    npm WARN While resolving: @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN Found: @angular/core@14.2.12
                                    npm WARN node_modules/@angular/core
                                    npm WARN   @angular/core@"^14.2.8" from the root project
                                    npm WARN   10 more (@angular/animations, @angular/cdk, @angular/common, ...)
                                    npm WARN
                                    npm WARN Could not resolve dependency:
                                    npm WARN
2023-01-02T09:04:23.840Z [WARNING]: peer @angular/core@"^13.0.0" from @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN node_modules/@ng-bootstrap/ng-bootstrap
                                    npm WARN   @ng-bootstrap/ng-bootstrap@"^11.0.1" from the root project
                                    npm WARN
                                    npm WARN Conflicting peer dependency: @angular/core@13.3.12
                                    npm WARN node_modules/@angular/core
                                    npm WARN   peer @angular/core@"^13.0.0" from @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN   node_modules/@ng-bootstrap/ng-bootstrap
                                    npm WARN     @ng-bootstrap/ng-bootstrap@"^11.0.1" from the root project
2023-01-02T09:04:23.842Z [WARNING]: npm
2023-01-02T09:04:23.842Z [WARNING]: WARN ERESOLVE overriding peer dependency
                                    npm WARN While resolving: @ng-bootstrap/ng-bootstrap@11.0.1
2023-01-02T09:04:23.842Z [WARNING]: npm WARN Found: @angular/forms@14.2.12
                                    npm WARN node_modules/@angular/forms
                                    npm WARN   @angular/forms@"^14.2.8" from the root project
                                    npm WARN   1 more (@angular/material)
                                    npm WARN
                                    npm WARN Could not resolve dependency:
                                    npm WARN peer @angular/forms@"^13.0.0" from @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN node_modules/@ng-bootstrap/ng-bootstrap
                                    npm WARN   @ng-bootstrap/ng-bootstrap@"^11.0.1" from the root project
                                    npm WARN
                                    npm WARN Conflicting peer dependency: @angular/forms@13.3.12
                                    npm WARN node_modules/@angular/forms
                                    npm WARN   peer @angular/forms@"^13.0.0" from @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN   node_modules/@ng-bootstrap/ng-bootstrap
                                    npm WARN     @ng-bootstrap/ng-bootstrap@"^11.0.1" from the root project
2023-01-02T09:04:23.853Z [WARNING]: npm WARN
2023-01-02T09:04:23.853Z [WARNING]: ERESOLVE overriding peer dependency
2023-01-02T09:04:23.856Z [WARNING]: npm
2023-01-02T09:04:23.856Z [WARNING]: WARN ERESOLVE overriding peer dependency
2023-01-02T09:04:23.890Z [WARNING]: npm
2023-01-02T09:04:23.890Z [WARNING]: WARN ERESOLVE overriding peer dependency
                                    npm WARN While resolving: @angular-devkit/build-angular@14.2.10
                                    npm WARN Found: @angular/localize@13.3.12
                                    npm WARN node_modules/@angular/localize
                                    npm WARN   peer @angular/localize@"^13.0.0" from @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN   node_modules/@ng-bootstrap/ng-bootstrap
                                    npm WARN     @ng-bootstrap/ng-bootstrap@"^11.0.1" from the root project
                                    npm WARN
                                    npm WARN Could not resolve dependency:
                                    npm WARN peerOptional @angular/localize@"^14.0.0" from @angular-devkit/build-angular@14.2.10
                                    npm WARN node_modules/@angular-devkit/build-angular
                                    npm WARN   dev @angular-devkit/build-angular@"^14.2.7" from the root project
                                    npm WARN
                                    npm WARN Conflicting peer dependency: @angular/localize@14.2.12
                                    npm WARN
2023-01-02T09:04:23.891Z [WARNING]: node_modules/@angular/localize
                                    npm WARN   peerOptional @angular/localize@"^14.0.0" from @angular-devkit/build-angular@14.2.10
                                    npm WARN   node_modules/@angular-devkit/build-angular
                                    npm WARN     dev @angular-devkit/build-angular@"^14.2.7" from the root project
2023-01-02T09:04:24.104Z [WARNING]: npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
2023-01-02T09:04:24.406Z [INFO]: added 7 packages, changed 2 packages, and audited 1289 packages in 2s
2023-01-02T09:04:24.406Z [INFO]: 168 packages are looking for funding
                                 run `npm fund` for details
2023-01-02T09:04:24.409Z [INFO]: # npm audit report
                                 json5  <2.2.2
                                 Severity: high
                                 Prototype Pollution in JSON5 via Parse Method - https://github.com/advisories/GHSA-9c47-m6qq-7p4h
                                 fix available via `npm audit fix`
                                 node_modules/tsconfig-paths/node_modules/json5
                                 tsconfig-paths  3.5.0 - 3.9.0 || 3.11.0 - 3.14.1
                                 Depends on vulnerable versions of json5
                                 node_modules/tsconfig-paths
                                 2 high severity vulnerabilities
                                 To address all issues, run:
                                 npm audit fix
2023-01-02T09:04:24.416Z [ERROR]: !!! Build failed
2023-01-02T09:04:24.417Z [ERROR]: !!! Non-Zero Exit Code detected
2023-01-02T09:04:24.417Z [INFO]: # Starting environment caching...
2023-01-02T09:04:24.417Z [INFO]: # Uploading environment cache artifact...
2023-01-02T09:04:24.496Z [INFO]: # Uploaded environment cache artifact
2023-01-02T09:04:24.497Z [INFO]: # Environment caching completed
Terminating logging...
</code>```

Body:
I am trying to deploy an angular project on AWS Amplify but the build doesn't go through

node version : 16
angular version: 14

note: I've  forced the npm build and with npm audit -f and tried to npm install --legacy-peer-deps but still failed

Some help will be very much appreciated!

Here are the logs of Amplify

phase: preBuild
                                 # Executing command: npm i -f
2023-01-02T09:04:12.161Z [WARNING]: npm
2023-01-02T09:04:12.162Z [WARNING]: WARN using --force Recommended protections disabled.
2023-01-02T09:04:15.990Z [WARNING]: npm
2023-01-02T09:04:15.992Z [WARNING]: WARN ERESOLVE overriding peer dependency
                                    npm WARN While resolving: @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN Found: @angular/common@14.2.12
                                    npm WARN node_modules/@angular/common
                                    npm WARN   @angular/common@"^14.2.8" from the root project
                                    npm WARN   6 more (@angular/cdk, @angular/forms, @angular/material, ...)
                                    npm WARN
                                    npm WARN Could not resolve dependency:
                                    npm WARN peer @angular/common@"^13.0.0" from @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN node_modules/@ng-bootstrap/ng-bootstrap
                                    npm WARN   @ng-bootstrap/ng-bootstrap@"^11.0.1" from the root project
                                    npm WARN
                                    npm WARN Conflicting peer dependency: @angular/common@13.3.12
                                    npm WARN node_modules/@angular/common
                                    npm WARN   peer @angular/common@"^13.0.0" from @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN   node_modules/@ng-bootstrap/ng-bootstrap
                                    npm WARN     @ng-bootstrap/ng-bootstrap@"^11.0.1" from the root project
2023-01-02T09:04:15.994Z [WARNING]: npm
2023-01-02T09:04:15.995Z [WARNING]: WARN ERESOLVE overriding peer dependency
                                    npm WARN While resolving: @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN Found: @angular/core@14.2.12
                                    npm WARN node_modules/@angular/core
                                    npm WARN   @angular/core@"^14.2.8" from the root project
                                    npm WARN   10 more (@angular/animations, @angular/cdk, @angular/common, ...)
                                    npm WARN
                                    npm WARN Could not resolve dependency:
                                    npm WARN peer @angular/core@"^13.0.0" from @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN node_modules/@ng-bootstrap/ng-bootstrap
                                    npm WARN   @ng-bootstrap/ng-bootstrap@"^11.0.1" from the root project
                                    npm WARN
                                    npm WARN Conflicting peer dependency: @angular/core@13.3.12
                                    npm WARN node_modules/@angular/core
                                    npm WARN   peer @angular/core@"^13.0.0" from @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN
2023-01-02T09:04:15.995Z [WARNING]: node_modules/@ng-bootstrap/ng-bootstrap
                                    npm WARN     @ng-bootstrap/ng-bootstrap@"^11.0.1" from the root project
2023-01-02T09:04:15.996Z [WARNING]: npm WARN ERESOLVE overriding peer dependency
                                    npm WARN While resolving: @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN Found: @angular/forms@14.2.12
                                    npm WARN node_modules/@angular/forms
                                    npm WARN   @angular/forms@"^14.2.8" from the root project
                                    npm WARN   1 more (@angular/material)
                                    npm
2023-01-02T09:04:15.997Z [WARNING]: WARN
                                    npm WARN Could not resolve dependency:
                                    npm WARN peer @angular/forms@"^13.0.0" from @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN node_modules/@ng-bootstrap/ng-bootstrap
                                    npm WARN   @ng-bootstrap/ng-bootstrap@"^11.0.1" from the root project
                                    npm WARN
                                    npm WARN Conflicting peer dependency: @angular/forms@13.3.12
                                    npm WARN node_modules/@angular/forms
                                    npm WARN   peer @angular/forms@"^13.0.0" from @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN   node_modules/@ng-bootstrap/ng-bootstrap
                                    npm WARN     @ng-bootstrap/ng-bootstrap@"^11.0.1" from the root project
2023-01-02T09:04:16.010Z [WARNING]: npm WARN
2023-01-02T09:04:16.010Z [WARNING]: ERESOLVE overriding peer dependency
2023-01-02T09:04:16.014Z [WARNING]: npm WARN
2023-01-02T09:04:16.014Z [WARNING]: ERESOLVE overriding peer dependency
2023-01-02T09:04:16.441Z [WARNING]: npm WARN ERESOLVE overriding peer dependency
2023-01-02T09:04:16.442Z [WARNING]: npm WARN While resolving: @angular-devkit/build-angular@14.2.10
                                    npm WARN Found: @angular/localize@13.3.12
                                    npm WARN node_modules/@angular/localize
                                    npm WARN   peer @angular/localize@"^13.0.0" from @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN   node_modules/@ng-bootstrap/ng-bootstrap
                                    npm WARN     @ng-bootstrap/ng-bootstrap@"^11.0.1" from the root project
                                    npm WARN
                                    npm WARN Could not resolve dependency:
                                    npm WARN peerOptional @angular/localize@"^14.0.0" from @angular-devkit/build-angular@14.2.10
                                    npm WARN node_modules/@angular-devkit/build-angular
                                    npm WARN   dev @angular-devkit/build-angular@"^14.2.7" from the root project
                                    npm WARN
                                    npm WARN Conflicting peer dependency: @angular/localize@14.2.12
                                    npm WARN node_modules/@angular/localize
                                    npm WARN   peerOptional @angular/localize@"^14.0.0" from @angular-devkit/build-angular@14.2.10
                                    npm WARN   node_modules/@angular-devkit/build-angular
                                    npm WARN     dev @angular-devkit/build-angular@"^14.2.7" from the root project
2023-01-02T09:04:19.201Z [WARNING]: npm
2023-01-02T09:04:19.205Z [WARNING]: WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
2023-01-02T09:04:20.287Z [INFO]: removed 1 package, changed 32 packages, and audited 1289 packages in 8s
2023-01-02T09:04:20.287Z [INFO]: 168 packages are looking for funding
                                 run `npm fund` for details
2023-01-02T09:04:20.289Z [INFO]: 2 high severity vulnerabilities
                                 To address all issues, run:
                                 npm audit fix
                                 Run `npm audit` for details.
2023-01-02T09:04:20.302Z [INFO]: # Executing command: npm install --legacy-peer-deps
2023-01-02T09:04:21.971Z [INFO]: removed 7 packages, and audited 1282 packages in 1s
2023-01-02T09:04:21.971Z [INFO]: 165 packages are looking for funding
                                 run `npm fund` for details
2023-01-02T09:04:21.974Z [INFO]: 2 high severity vulnerabilities
                                 To address all issues, run:
                                 npm audit fix
                                 Run `npm audit` for details.
2023-01-02T09:04:21.981Z [INFO]: # Executing command: npm audit fix --force
2023-01-02T09:04:22.247Z [WARNING]: npm
2023-01-02T09:04:22.247Z [WARNING]: WARN using --force Recommended protections disabled.
2023-01-02T09:04:23.836Z [WARNING]: npm
2023-01-02T09:04:23.838Z [WARNING]: WARN ERESOLVE overriding peer dependency
                                    npm WARN While resolving: @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN Found: @angular/common@14.2.12
                                    npm WARN node_modules/@angular/common
                                    npm WARN   @angular/common@"^14.2.8" from the root project
                                    npm WARN   6 more (@angular/cdk, @angular/forms, @angular/material, ...)
                                    npm WARN
                                    npm WARN Could not resolve dependency:
                                    npm WARN peer @angular/common@"^13.0.0" from @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN node_modules/@ng-bootstrap/ng-bootstrap
                                    npm WARN   @ng-bootstrap/ng-bootstrap@"^11.0.1" from the root project
                                    npm WARN
                                    npm WARN Conflicting peer dependency: @angular/common@13.3.12
                                    npm WARN node_modules/@angular/common
                                    npm WARN   peer @angular/common@"^13.0.0" from @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN   node_modules/@ng-bootstrap/ng-bootstrap
                                    npm WARN     @ng-bootstrap/ng-bootstrap@"^11.0.1" from the root project
2023-01-02T09:04:23.840Z [WARNING]: npm
2023-01-02T09:04:23.840Z [WARNING]: WARN ERESOLVE overriding peer dependency
                                    npm WARN While resolving: @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN Found: @angular/core@14.2.12
                                    npm WARN node_modules/@angular/core
                                    npm WARN   @angular/core@"^14.2.8" from the root project
                                    npm WARN   10 more (@angular/animations, @angular/cdk, @angular/common, ...)
                                    npm WARN
                                    npm WARN Could not resolve dependency:
                                    npm WARN
2023-01-02T09:04:23.840Z [WARNING]: peer @angular/core@"^13.0.0" from @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN node_modules/@ng-bootstrap/ng-bootstrap
                                    npm WARN   @ng-bootstrap/ng-bootstrap@"^11.0.1" from the root project
                                    npm WARN
                                    npm WARN Conflicting peer dependency: @angular/core@13.3.12
                                    npm WARN node_modules/@angular/core
                                    npm WARN   peer @angular/core@"^13.0.0" from @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN   node_modules/@ng-bootstrap/ng-bootstrap
                                    npm WARN     @ng-bootstrap/ng-bootstrap@"^11.0.1" from the root project
2023-01-02T09:04:23.842Z [WARNING]: npm
2023-01-02T09:04:23.842Z [WARNING]: WARN ERESOLVE overriding peer dependency
                                    npm WARN While resolving: @ng-bootstrap/ng-bootstrap@11.0.1
2023-01-02T09:04:23.842Z [WARNING]: npm WARN Found: @angular/forms@14.2.12
                                    npm WARN node_modules/@angular/forms
                                    npm WARN   @angular/forms@"^14.2.8" from the root project
                                    npm WARN   1 more (@angular/material)
                                    npm WARN
                                    npm WARN Could not resolve dependency:
                                    npm WARN peer @angular/forms@"^13.0.0" from @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN node_modules/@ng-bootstrap/ng-bootstrap
                                    npm WARN   @ng-bootstrap/ng-bootstrap@"^11.0.1" from the root project
                                    npm WARN
                                    npm WARN Conflicting peer dependency: @angular/forms@13.3.12
                                    npm WARN node_modules/@angular/forms
                                    npm WARN   peer @angular/forms@"^13.0.0" from @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN   node_modules/@ng-bootstrap/ng-bootstrap
                                    npm WARN     @ng-bootstrap/ng-bootstrap@"^11.0.1" from the root project
2023-01-02T09:04:23.853Z [WARNING]: npm WARN
2023-01-02T09:04:23.853Z [WARNING]: ERESOLVE overriding peer dependency
2023-01-02T09:04:23.856Z [WARNING]: npm
2023-01-02T09:04:23.856Z [WARNING]: WARN ERESOLVE overriding peer dependency
2023-01-02T09:04:23.890Z [WARNING]: npm
2023-01-02T09:04:23.890Z [WARNING]: WARN ERESOLVE overriding peer dependency
                                    npm WARN While resolving: @angular-devkit/build-angular@14.2.10
                                    npm WARN Found: @angular/localize@13.3.12
                                    npm WARN node_modules/@angular/localize
                                    npm WARN   peer @angular/localize@"^13.0.0" from @ng-bootstrap/ng-bootstrap@11.0.1
                                    npm WARN   node_modules/@ng-bootstrap/ng-bootstrap
                                    npm WARN     @ng-bootstrap/ng-bootstrap@"^11.0.1" from the root project
                                    npm WARN
                                    npm WARN Could not resolve dependency:
                                    npm WARN peerOptional @angular/localize@"^14.0.0" from @angular-devkit/build-angular@14.2.10
                                    npm WARN node_modules/@angular-devkit/build-angular
                                    npm WARN   dev @angular-devkit/build-angular@"^14.2.7" from the root project
                                    npm WARN
                                    npm WARN Conflicting peer dependency: @angular/localize@14.2.12
                                    npm WARN
2023-01-02T09:04:23.891Z [WARNING]: node_modules/@angular/localize
                                    npm WARN   peerOptional @angular/localize@"^14.0.0" from @angular-devkit/build-angular@14.2.10
                                    npm WARN   node_modules/@angular-devkit/build-angular
                                    npm WARN     dev @angular-devkit/build-angular@"^14.2.7" from the root project
2023-01-02T09:04:24.104Z [WARNING]: npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
2023-01-02T09:04:24.406Z [INFO]: added 7 packages, changed 2 packages, and audited 1289 packages in 2s
2023-01-02T09:04:24.406Z [INFO]: 168 packages are looking for funding
                                 run `npm fund` for details
2023-01-02T09:04:24.409Z [INFO]: # npm audit report
                                 json5  <2.2.2
                                 Severity: high
                                 Prototype Pollution in JSON5 via Parse Method - https://github.com/advisories/GHSA-9c47-m6qq-7p4h
                                 fix available via `npm audit fix`
                                 node_modules/tsconfig-paths/node_modules/json5
                                 tsconfig-paths  3.5.0 - 3.9.0 || 3.11.0 - 3.14.1
                                 Depends on vulnerable versions of json5
                                 node_modules/tsconfig-paths
                                 2 high severity vulnerabilities
                                 To address all issues, run:
                                 npm audit fix
2023-01-02T09:04:24.416Z [ERROR]: !!! Build failed
2023-01-02T09:04:24.417Z [ERROR]: !!! Non-Zero Exit Code detected
2023-01-02T09:04:24.417Z [INFO]: # Starting environment caching...
2023-01-02T09:04:24.417Z [INFO]: # Uploading environment cache artifact...
2023-01-02T09:04:24.496Z [INFO]: # Uploaded environment cache artifact
2023-01-02T09:04:24.497Z [INFO]: # Environment caching completed
Terminating logging...


问:
[python][sqlalchemy] I want to ungroup the grouping
Please let me know if there is something you do not understand or lack.

I want to ungroup the grouping.

If you look at FarmReadStatus, it is grouped by Farm.

I want to show this one by one like FarmRead.

including code information.

my models.py

```<code># models.py
class Farm(Base):
  __tablename__ = "farm"

  id = Column(INTEGER(unsigned=True), primary_key=True, autoincrement=True, nullable=False)
  user_name = Column(STRING(50)),

  location_time = relationship("CodeLocationTime", backref=backref("farm"))

class CodeLocationTime(Base):
  __tablename__ = "code_location_time"

  id = Column(INTEGER(unsigned=True), primary_key=True, autoincrement=True, nullable=False)
  name = Column(String(50), nullable=False)
  transition_time = Column(String(50), nullable=False)

class Piggery(Base):
  __tablename__ = "piggery"

  id = Column(INTEGER(unsigned=True), primary_key=True, autoincrement=True, nullable=False)
  farm_id = Column(INTEGER(unsigned=True), ForeignKey("farm.id", ondelete="CASCADE"), nullable=False)
</code>```

my function

```<code># farm.py
@router.get("/test/{farm_id}", response_model=schemas.FarmReadStatus)
def read_current_farm(farm_id: int, location_timezone: str = Header(default="Asia/Seoul")):
  farm = db.query(
        models.Farm
      , func.IFNULL(func.count(models.Piggery.id),0).label('piggery_count')
    )\
    .filter(models.Farm.user_id == current_user.id, models.Farm.id == farm_id)\
    .outerjoin(models.Piggery, models.Farm.id == models.Piggery.farm_id)\
    .group_by(models.Farm)\
    .first()

  return farm
</code>```

my schemas.py

FarmRead << i want
but, only the FarmReadStatus schema works.

```<code># i want schema
class FarmRead(BaseModel):
  id: int
  user_name: str

  location_time_id: Optional[int] = None
  location_time: Optional[CodeLocationTime] = None

  piggery_count: Optional[int] = None

  class Config:
    orm_mode = True

# working schema
class FarmReadStatus(BaseModel):
  Farm: FarmRead
  piggery_count: Optional[int] = None
  class Config:
    orm_mode = True
</code>```

Body:
Please let me know if there is something you do not understand or lack.

I want to ungroup the grouping.

If you look at FarmReadStatus, it is grouped by Farm.

I want to show this one by one like FarmRead.

including code information.

my models.py

# models.py
class Farm(Base):
  __tablename__ = "farm"

  id = Column(INTEGER(unsigned=True), primary_key=True, autoincrement=True, nullable=False)
  user_name = Column(STRING(50)),

  location_time = relationship("CodeLocationTime", backref=backref("farm"))

class CodeLocationTime(Base):
  __tablename__ = "code_location_time"

  id = Column(INTEGER(unsigned=True), primary_key=True, autoincrement=True, nullable=False)
  name = Column(String(50), nullable=False)
  transition_time = Column(String(50), nullable=False)

class Piggery(Base):
  __tablename__ = "piggery"

  id = Column(INTEGER(unsigned=True), primary_key=True, autoincrement=True, nullable=False)
  farm_id = Column(INTEGER(unsigned=True), ForeignKey("farm.id", ondelete="CASCADE"), nullable=False)

my function

# farm.py
@router.get("/test/{farm_id}", response_model=schemas.FarmReadStatus)
def read_current_farm(farm_id: int, location_timezone: str = Header(default="Asia/Seoul")):
  farm = db.query(
        models.Farm
      , func.IFNULL(func.count(models.Piggery.id),0).label('piggery_count')
    )\
    .filter(models.Farm.user_id == current_user.id, models.Farm.id == farm_id)\
    .outerjoin(models.Piggery, models.Farm.id == models.Piggery.farm_id)\
    .group_by(models.Farm)\
    .first()

  return farm

my schemas.py

FarmRead << i want
but, only the FarmReadStatus schema works.

# i want schema
class FarmRead(BaseModel):
  id: int
  user_name: str

  location_time_id: Optional[int] = None
  location_time: Optional[CodeLocationTime] = None

  piggery_count: Optional[int] = None

  class Config:
    orm_mode = True

# working schema
class FarmReadStatus(BaseModel):
  Farm: FarmRead
  piggery_count: Optional[int] = None
  class Config:
    orm_mode = True


问:
Processing Pandas Data frames containing very large number of data
```<code>file = filedialog.askopenfilename()
name = os.path.basename(file)
path = str(pathlib.Path(file).parent.resolve())
original = pd.read_csv(file, sep='\t',dtype={0:'string',1:'float16', 2:'int8'}, header=None)
original.columns=['Date','Force(kg)','Cycle']

i=0

def printit():
  threading.Timer(100.0, printit).start()
  print('Programme Running, Please Wait...........'+str(i))
printit()

og_filt=pd.DataFrame()
for i in range (0,len(original)):
    if original.loc[i,['Force(kg)']].values != original.loc[i+1,['Force(kg)']].values:
        og_filt = pd.concat([og_filt,original.iloc[i,]], axis =1 )
        i = i+1

og_filt = og_filt.transpose()
print('Finished')
plt.plot(og_filt['Force(kg)'])
plt.show()
</code>```

The file that I am working with contains more than 1.5 million rows.
I am trying to filter out the 'Force(kg)' column so as to eliminate any repeating values.
prinit() function is just running to show me that my system is still running.

Running the above script the programme is running but it is taking a long time.
It is getting progressively more slower as more data are being processed into the og_filt dataframe.
Would really like to know if there is any faster way of achieving my goal.

Body:
file = filedialog.askopenfilename()
name = os.path.basename(file)
path = str(pathlib.Path(file).parent.resolve())
original = pd.read_csv(file, sep='\t',dtype={0:'string',1:'float16', 2:'int8'}, header=None)
original.columns=['Date','Force(kg)','Cycle']

i=0

def printit():
  threading.Timer(100.0, printit).start()
  print('Programme Running, Please Wait...........'+str(i))
printit()

og_filt=pd.DataFrame()
for i in range (0,len(original)):
    if original.loc[i,['Force(kg)']].values != original.loc[i+1,['Force(kg)']].values:
        og_filt = pd.concat([og_filt,original.iloc[i,]], axis =1 )
        i = i+1

og_filt = og_filt.transpose()
print('Finished')
plt.plot(og_filt['Force(kg)'])
plt.show()

The file that I am working with contains more than 1.5 million rows.
I am trying to filter out the 'Force(kg)' column so as to eliminate any repeating values.
prinit() function is just running to show me that my system is still running.

Running the above script the programme is running but it is taking a long time.
It is getting progressively more slower as more data are being processed into the og_filt dataframe.
Would really like to know if there is any faster way of achieving my goal.


问:
Hbase: Apps giving issue in coming up due to StreamBootstrapper class missing
Hbase issue in coming up due to StreamBootstrapper class missing

Getting following error due to which my hbase related service is not coming up

at com.hub.storage.server.Start.main(Start.java:72) [storage-server-0.2-SNAPSHOT.jar:?]
Caused by: org.python.core.PyException

Caused by: java.lang.NoSuchMethodError: 'com.ctc.wstx.io.StreamBootstrapper com.ctc.wstx.io.StreamBootstrapper.getInstance(java.lang.String, com.ctc.wstx.io.SystemId, java.io.InputStream)'
at org.apache.hadoop.conf.Configuration.parse(Configuration.java:2974) ~[hadoop-common-3.2.2.jar:?]
at org.apache.hadoop.conf.Configuration.parse(Configuration.java:2957) ~[hadoop-common-3.2.2.jar:?]
at org.apache.hadoop.conf.Configuration.getStreamReader(Configuration.java:3053) ~[hadoop-common-3.2.2.jar:?]


问:
How to add social logins to Keystone 6 application
I want to authenticate in my Keystone application using GitHub and Gmail as SSO providers.

I have tried to use @opensaas/keystone-nextjs-auth package but I want to do it manually.


问:
How can I define an over-arching validation error message for a Symfony Validator Compound / Sequence constraint?
Using the Symfony Validator, I can create a Compound constraint by inheritance:

```<code>// source: https://symfony.com/doc/current/reference/constraints/Compound.html
// src/Validator/Constraints/PasswordRequirements.php
namespace App\Validator\Constraints;

use Symfony\Component\Validator\Constraints\Compound;
use Symfony\Component\Validator\Constraints as Assert;

#[\Attribute]
class PasswordRequirements extends Compound
{
    protected function getConstraints(array $options): array
    {
        return [
            new Assert\NotBlank(),
            new Assert\Type('string'),
            new Assert\Length(['min' => 12]),
            new Assert\NotCompromisedPassword(),
        ];
   }
}
</code>```

In alternate cases, I could also use Assert\Sequence to create a compound constraint that stops at the first validation error:

```<code>new Assert\Required( [
    new Assert\NotNull(),
    new Assert\NotBlank() // If the value is NULL, there is no need to check for blank
] );
</code>```

The problem is, in both cases, I don't see a way to control the resulting validation error messages.

When using a Compound constraint, every validation error is returned. I would prefer to just have an over-arching error message, something like "Your password is not valid. Please make sure ... etc".

In the case of a Sequence, I would just like to return "This field is required." instead of different variations depending on what exactly went wrong (especially since the user really doesn't need to know the difference between null and "blank").

How can I return an over-arching custom error message for composite constraints like the above?

Body:
Using the Symfony Validator, I can create a Compound constraint by inheritance:

// source: https://symfony.com/doc/current/reference/constraints/Compound.html
// src/Validator/Constraints/PasswordRequirements.php
namespace App\Validator\Constraints;

use Symfony\Component\Validator\Constraints\Compound;
use Symfony\Component\Validator\Constraints as Assert;

#[\Attribute]
class PasswordRequirements extends Compound
{
    protected function getConstraints(array $options): array
    {
        return [
            new Assert\NotBlank(),
            new Assert\Type('string'),
            new Assert\Length(['min' => 12]),
            new Assert\NotCompromisedPassword(),
        ];
   }
}

In alternate cases, I could also use Assert\Sequence to create a compound constraint that stops at the first validation error:

new Assert\Required( [
    new Assert\NotNull(),
    new Assert\NotBlank() // If the value is NULL, there is no need to check for blank
] );

The problem is, in both cases, I don't see a way to control the resulting validation error messages.

When using a Compound constraint, every validation error is returned. I would prefer to just have an over-arching error message, something like "Your password is not valid. Please make sure ... etc".

In the case of a Sequence, I would just like to return "This field is required." instead of different variations depending on what exactly went wrong (especially since the user really doesn't need to know the difference between null and "blank").

How can I return an over-arching custom error message for composite constraints like the above?


问:
Nodejs Babel TypeError: Cannot read properties of undefined (reading 'default')
I'm using babel to transpile es6 code to es5. I have this mongoose model

```<code>// src/user.model
const User = mongoose.model('User', userSchema);

export default User;
</code>```

used in this index.js file within the same folder

```<code>// src/index.js
import User from "./user.model";

export {User};
</code>```

On build it generates this error

```<code>return _user["default"];
                ^
TypeError: Cannot read properties of undefined (reading 'default')
</code>```

The full compiled code is

```<code>// build/index.js
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
Object.defineProperty(exports, "User", {
  enumerable: true,
  get: function get() {
    return _user["default"];
  }
});
var _user = _interopRequireDefault(require("./user.model"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
</code>```

As you can see the _user variable is initialized after it was referenced.

When I tweak this compiled code and initialize the _user variable before it is used, the error goes.
Is there something I can do to prevent babel from initializing variables before it is called?

Body:
I'm using babel to transpile es6 code to es5. I have this mongoose model

// src/user.model
const User = mongoose.model('User', userSchema);

export default User;

used in this index.js file within the same folder

// src/index.js
import User from "./user.model";

export {User};

On build it generates this error

return _user["default"];
                ^
TypeError: Cannot read properties of undefined (reading 'default')

The full compiled code is

// build/index.js
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
Object.defineProperty(exports, "User", {
  enumerable: true,
  get: function get() {
    return _user["default"];
  }
});
var _user = _interopRequireDefault(require("./user.model"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

As you can see the _user variable is initialized after it was referenced.

When I tweak this compiled code and initialize the _user variable before it is used, the error goes.
Is there something I can do to prevent babel from initializing variables before it is called?


问:
Colormap in Python
I have created a colormap in software Matlab R2014b. The code is:

```<code>figure, imshow(classImage,[])
colormap(gcf,parula)
</code>```

How can I process in python/ gcolab?
thankyou for your help

Title: Colormap in Python

Body:
I have created a colormap in software Matlab R2014b. The code is:

figure, imshow(classImage,[])
colormap(gcf,parula)

How can I process in python/ gcolab?
thankyou for your help


问:
How to find idle nodes of a linux cluster
I am trying to print only the idle nodes of a linux cluster. I only need the names of the idle nodes. But using the command

sinfo %C | grep idle

this command is giving details such as PARTITION AVAIL  TIMELIMIT  NODES  STATE NODELIST but I only requires the node list. Is there any way of doing this?

Thank you.


问:
InstantiationException: CurrencyViewModel has no zero argument constructor
I have a problem using Hilt. I get the following exception:

```<code>Caused by: java.lang.InstantiationException: java.lang.Class<com.example.mycurencyconverter.presentation.CurrencyViewModel> has no zero argument constructor
</code>```

ViewModel looks like this:

```<code>@HiltViewModel
class CurrencyViewModel @Inject constructor(
    private val repository: CurrencyConverterImpl,
    private val dispatchers:DispatcherProvider
): ViewModel(){

</code>```

The activity looks like this:

```<code>@AndroidEntryPoint
class CurrencyActivity : AppCompatActivity() {
</code>```

Core App:

```<code>@HiltAndroidApp
class CoreApp: Application() {
}
</code>```

If it asks for a zero constructor, then how can I pass the parameters?
I found a similar question, and tried all the options but didn't help...
Please help me:)

Body:
I have a problem using Hilt. I get the following exception:

Caused by: java.lang.InstantiationException: java.lang.Class<com.example.mycurencyconverter.presentation.CurrencyViewModel> has no zero argument constructor

ViewModel looks like this:

@HiltViewModel
class CurrencyViewModel @Inject constructor(
    private val repository: CurrencyConverterImpl,
    private val dispatchers:DispatcherProvider
): ViewModel(){

The activity looks like this:

@AndroidEntryPoint
class CurrencyActivity : AppCompatActivity() {

Core App:

@HiltAndroidApp
class CoreApp: Application() {
}

If it asks for a zero constructor, then how can I pass the parameters?
I found a similar question, and tried all the options but didn't help...
Please help me:)


问:
php CRUD Operation
I have got warning error while connecting table details for crud operation.
Warning: mysqli_query() expects parameter 1 to be mysqli, object given in C:\xampp\htdocs\login_pdo\display.php on line 32

conn.php

```<code><?php
    $db_username = 'root';
    $db_password = '';
    $conn = new PDO( 'mysql:host=localhost;dbname=db_login', $db_username, $db_password );
    if(!$conn){
        die("Fatal Error: Connection Failed!");
    }
?>
</code>```

display.php

```<code><?php
include 'conn.php';

?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Crud Operation </title>
    <link rel="stylesheet" type="text/css" href="css/bootstrap.css"/>
</head>
<body>
    <div class="container">
        <button class="btn btn-primary my-5"><a href="registration.php" style="color:white;">Add User</a>
            </button>
            <table class="table">
  <thead>
    <tr>
      <th scope="col">mem_id</th>
      <th scope="col">Firstname</th>
      <th scope="col">Lastname</th>
      <th scope="col">Username</th>
      <th scope="col">Password</th>
    </tr>
  </thead>
  <tbody>
    <?php
    $sql="Select * from 'member' ";
    $result=mysqli_query($conn,$sql);
    if($result){
        $row=mysqli_fetch_assoc($result);
        echo $row['firstname'];
    }
    ?>

    // <!-- // <tr>
    //   <th scope="row">1</th>
    //   <td>Mark</td>
    //   <td>Otto</td>
    //   <td>@mdo</td>
    // </tr>
    // <tr>
    //   <th scope="row">2</th>
    //   <td>Jacob</td>
    //   <td>Thornton</td>
    //   <td>@fat</td>
    // </tr>
    // <tr>
    //   <th scope="row">3</th>
    //   <td colspan="2">Larry the Bird</td>
    //   <td>@twitter</td>
    // </tr> -->
  </tbody>
</table>
    </div>
</body>
</html>
</code>```

I have tried changing the parameter, still pop up with same error.

Title: php CRUD Operation

Body:
I have got warning error while connecting table details for crud operation.
Warning: mysqli_query() expects parameter 1 to be mysqli, object given in C:\xampp\htdocs\login_pdo\display.php on line 32

conn.php

<?php
    $db_username = 'root';
    $db_password = '';
    $conn = new PDO( 'mysql:host=localhost;dbname=db_login', $db_username, $db_password );
    if(!$conn){
        die("Fatal Error: Connection Failed!");
    }
?>

display.php

<?php
include 'conn.php';

?>

<!DOCTYPE html>

    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Crud Operation </title>
    <link rel="stylesheet" type="text/css" href="css/bootstrap.css"/>

        <button class="btn btn-primary my-5">Add User
            </button>

      mem_id
      Firstname
      Lastname
      Username
      Password

    <?php
    $sql="Select * from 'member' ";
    $result=mysqli_query($conn,$sql);
    if($result){
        $row=mysqli_fetch_assoc($result);
        echo $row['firstname'];
    }
    ?>

    //

I have tried changing the parameter, still pop up with same error.


问:
Flutter Webview: Could cascading calls interfere with NavigationDelegate?
Could cascading statements (e.g. controller..setJavascriptMode()..setNavigationDelegate()..loadRequest()) in a Flutter Webview fail to set NavigationDelegate prior to loadUrl? I ask because both setNavigationDelegate and loadUrl return a future.


问:
React iframe sandbox attributes along with contentWindow.postMessage
I'm making cross-origin requests to trusted 1p API which returns the content in iframe. I'm using
contentWindow.postMessage to communicate cross-origin. I use React in this way -

```<code>
        const [contentWindow, setContentWindow] = React.useState<Window | null>(null);

        const onIFrameRef = React.useCallback((iframeElement: HTMLIFrameElement | null) => {
        setContentWindow((iframeElement && iframeElement.contentWindow) || null);
    }, []);

    return (
        <iframe
            width={width}
            height={height}
            style={iframeStyle}
            ref={onIFrameRef}
            sandbox={'allow-same-origin allow-scripts allow-forms'}
        />
    );
</code>```

This works fine with using allow-same-origin, allow-scripts and allow-forms, but I learnt that using allow-same-origin and allow-scripts is dangerous and not recommended. What are ways to handle this?

I tried sandbox={'allow-same-origin allow-scripts allow-forms'}, this works fine, but looking for ways if the allow-same-origin and allow-scripts are allowed together with contentWindow.postMessage.

Body:
I'm making cross-origin requests to trusted 1p API which returns the content in iframe. I'm using
contentWindow.postMessage to communicate cross-origin. I use React in this way -

        const [contentWindow, setContentWindow] = React.useState<Window | null>(null);

        const onIFrameRef = React.useCallback((iframeElement: HTMLIFrameElement | null) => {
        setContentWindow((iframeElement && iframeElement.contentWindow) || null);
    }, []);

    return (

    );

This works fine with using allow-same-origin, allow-scripts and allow-forms, but I learnt that using allow-same-origin and allow-scripts is dangerous and not recommended. What are ways to handle this?

I tried sandbox={'allow-same-origin allow-scripts allow-forms'}, this works fine, but looking for ways if the allow-same-origin and allow-scripts are allowed together with contentWindow.postMessage.


问:
Python Tkinter label printing

import os
import tkinter as tk

cmd = 'curl https://ipinfo.io/ip'
puip = str(os.system(cmd))

root = Tk()
var = StringVar()
label = Label(root, textvariable=var, relief=RAISED)

p = str(puip)
s = p
print(type(p))

var.set(s)
label.pack()
root.mainloop()
```

I want to print the public IP of our network. Also I want to print using tkinter label. I am able to print a string, but I can't print the public IP. Output is getting the terminal, but I would like to print through label

Title: Python Tkinter label printing

Body:
import os
import tkinter as tk

cmd = 'curl https://ipinfo.io/ip'
puip = str(os.system(cmd))

root = Tk()
var = StringVar()
label = Label(root, textvariable=var, relief=RAISED)

p = str(puip)
s = p
print(type(p))

var.set(s)
label.pack()
root.mainloop()

I want to print the public IP of our network. Also I want to print using tkinter label. I am able to print a string, but I can't print the public IP. Output is getting the terminal, but I would like to print through label