问:
Cannot Successfully Build RN Android Project due to Missing Keystone
I had my Android Studio, Google Play Console, JDK, and all keys and signings managed and working, but due to an unsolvable issue in another project I had to wipe my machine. I came back to this project to update a Google Play Build, but find myself unable to complete the build process.
Following the instructions here, I got everything set back up. My Gradle Files synced with no problem, but then when running ./gradlew bundleRelease  I get the following error...

```<code>AILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:signReleaseBundle'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.FinalizeBundleTask$BundleToolRunnable
   > Failed to read key my-key-alias from store "/Users/******/GitHub/*****/android/app/my-upload-key.keystore": toDerInputStream rejects tag type 77
</code>```

And this does not make much sense to me, as I've followed the instructions that worked perfectly last time.

My my-upload-key.keystore file looks like this...

```<code>MYAPP_UPLOAD_STORE_FILE=my-upload-key.keystore
MYAPP_UPLOAD_KEY_ALIAS=my-key-alias
MYAPP_UPLOAD_STORE_PASSWORD=***********
MYAPP_UPLOAD_KEY_PASSWORD=**********
</code>```

To further diagnose the issue, I ran ./gradlew signingReport which just confirms what I knew, the build isn't finding the keystone even though it's right there and set up properly just like last time. The output is as follows...

```<code>> Task :react-native-fs:signingReport
Variant: debugAndroidTest
Config: debug
Store: /Users/******/.android/debug.keystore
Alias: AndroidDebugKey
Error: Missing keystore
----------

> Task :react-native-gesture-handler:signingReport
Variant: debugAndroidTest
Config: debug
Store: /Users/*******/.android/debug.keystore
Alias: AndroidDebugKey
Error: Missing keystore
----------
// It continutes like this
</code>```

This is incredibly frustrating, especially as I use React Native since I do not have an extensive background in Android and all their issues and the mess that is Android Studio. Does anyone know what.a potential solution is

Body:
I had my Android Studio, Google Play Console, JDK, and all keys and signings managed and working, but due to an unsolvable issue in another project I had to wipe my machine. I came back to this project to update a Google Play Build, but find myself unable to complete the build process.
Following the instructions here, I got everything set back up. My Gradle Files synced with no problem, but then when running ./gradlew bundleRelease  I get the following error...

AILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:signReleaseBundle'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.FinalizeBundleTask$BundleToolRunnable
   > Failed to read key my-key-alias from store "/Users/******/GitHub/*****/android/app/my-upload-key.keystore": toDerInputStream rejects tag type 77

And this does not make much sense to me, as I've followed the instructions that worked perfectly last time.

My my-upload-key.keystore file looks like this...

MYAPP_UPLOAD_STORE_FILE=my-upload-key.keystore
MYAPP_UPLOAD_KEY_ALIAS=my-key-alias
MYAPP_UPLOAD_STORE_PASSWORD=***********
MYAPP_UPLOAD_KEY_PASSWORD=**********

To further diagnose the issue, I ran ./gradlew signingReport which just confirms what I knew, the build isn't finding the keystone even though it's right there and set up properly just like last time. The output is as follows...

> Task :react-native-fs:signingReport
Variant: debugAndroidTest
Config: debug
Store: /Users/******/.android/debug.keystore
Alias: AndroidDebugKey
Error: Missing keystore
----------

> Task :react-native-gesture-handler:signingReport
Variant: debugAndroidTest
Config: debug
Store: /Users/*******/.android/debug.keystore
Alias: AndroidDebugKey
Error: Missing keystore
----------
// It continutes like this

This is incredibly frustrating, especially as I use React Native since I do not have an extensive background in Android and all their issues and the mess that is Android Studio. Does anyone know what.a potential solution is


来源: stackexchange

问:
How to get the Null Model for CLMM (multilevel modeling with ordinal variable)
I'm trying to make the null model for my multilevel model with ordinal variable. I have the model with my variables set up, but I can't get the null model to work.

Here's what I'm trying:

```<code>modelnullother <- clmm(outofpocket.fac ~ (1|state.fac), data = finalproject.recodedclean)
summary(modelnullother)
</code>```

I get this error: Error in environment(fixedForm) <- environment(form) <- form.envir :
cannot set attribute on a symbol

This is my model that works

```<code>model.other <- clmm(outofpocket.fac ~ sex.fac + race.fac + insurancetype.fac + sc_age_years + (1|state.fac), data = finalproject.recodedclean, na.action=na.omit)
summary(model.other)
</code>```

Any ideas on how to get my null model to work?

Here's what I'm trying:

```<code>modelnullother <- clmm(outofpocket.fac ~ (1|state.fac), data = finalproject.recodedclean)
summary(modelnullother)
</code>```

I get this error: Error in environment(fixedForm) <- environment(form) <- form.envir :
cannot set attribute on a symbol

ContentLicense: CC BY-SA 4.0

Body:
I'm trying to make the null model for my multilevel model with ordinal variable. I have the model with my variables set up, but I can't get the null model to work.

Here's what I'm trying:

modelnullother <- clmm(outofpocket.fac ~ (1|state.fac), data = finalproject.recodedclean)
summary(modelnullother)

I get this error: Error in environment(fixedForm) <- environment(form) <- form.envir :
cannot set attribute on a symbol

This is my model that works

model.other <- clmm(outofpocket.fac ~ sex.fac + race.fac + insurancetype.fac + sc_age_years + (1|state.fac), data = finalproject.recodedclean, na.action=na.omit)
summary(model.other)

Any ideas on how to get my null model to work?

Here's what I'm trying:

modelnullother <- clmm(outofpocket.fac ~ (1|state.fac), data = finalproject.recodedclean)
summary(modelnullother)

I get this error: Error in environment(fixedForm) <- environment(form) <- form.envir :
cannot set attribute on a symbol


问:
NodeJS doesn't log any thing on the console for smart contract deployment
I'm deploying smart contract into a private Ethereum network by web3js and the web3 provider is a Geth node. According to the deployment code, NodeJS should log the deployed contract address on the console (Windows PowerShell), But nothing occurred on it. I don't know what the wrong is. I need a solution to log contract deployment on the console.

The deployment code in NodeJS:

```<code>const Web3=require("web3");
const fs=require("fs");
const web3=new Web3(new Web3.providers.WebsocketProvider("ws://<Geth ip in the private network>:<port>"));
      web3.eth.personal.unlockAccount(<sender address>,<password>,300);
const contractJson=".../contract.json";
const contractObj=JSON.parse(fs.readFileSync(contractJsonInterface));
const contractBytecode=`...`;
const contract=new web3.eth.Contract(contractObj.abi,null,{data:contractBytecode});
      contract.deploy().send({from:<sender address>}).then((ins)=>{console.log("Contract mined at "+ins.options.address);});
</code>```

Body:
I'm deploying smart contract into a private Ethereum network by web3js and the web3 provider is a Geth node. According to the deployment code, NodeJS should log the deployed contract address on the console (Windows PowerShell), But nothing occurred on it. I don't know what the wrong is. I need a solution to log contract deployment on the console.

The deployment code in NodeJS:

const Web3=require("web3");
const fs=require("fs");
const web3=new Web3(new Web3.providers.WebsocketProvider("ws://<Geth ip in the private network>:<port>"));
      web3.eth.personal.unlockAccount(<sender address>,<password>,300);
const contractJson=".../contract.json";
const contractObj=JSON.parse(fs.readFileSync(contractJsonInterface));
const contractBytecode=`...`;
const contract=new web3.eth.Contract(contractObj.abi,null,{data:contractBytecode});
      contract.deploy().send({from:<sender address>}).then((ins)=>{console.log("Contract mined at "+ins.options.address);});


问:
EF Core 7.0 Migration Ignores DeleteBehavior.NoAction
I have an EF Core model with a root entity type that has multiple one-to-many relationships with other entity types. Some of these child types also relate to each other, so I understand that I need to take precautions to avoid circular reference issues when deleting a root entity instance.

Without any explicit model builder configuration between the root entity type and its child types, the resulting migration includes clauses like this:

```<code>migrationBuilder.AddForeignKey(
    name: "FK_Merchants_Platforms_PlatformId",
    table: "Merchants",
    column: "PlatformId",
    principalTable: "Platforms",
    principalColumn: "Id");
</code>```

If I attempt to run this migration, I see the following error:

In an attempt to solve this problem, I added explicit model builder configurations, which force NoAction on delete. Here's one example, applied to the child entity type:

```<code>builder
    .HasOne(e => e.Platform)
    .WithMany()
    .HasForeignKey(e => e.PlatformId)
    .OnDelete(DeleteBehavior.NoAction);
</code>```

The above explicit change has no effect on the generated migration. However, if I change the DeleteBehavior to something other than NoAction, it produces the desired effect:

```<code>builder
    .HasOne(e => e.Platform)
    .WithMany()
    .HasForeignKey(e => e.PlatformId)
    .OnDelete(DeleteBehavior.Restrict);

migrationBuilder.AddForeignKey(
    name: "FK_Merchants_Platforms_PlatformId",
    table: "Merchants",
    column: "PlatformId",
    principalTable: "Platforms",
    principalColumn: "Id",
    onDelete: ReferentialAction.Restrict);
</code>```

Based on what I am seeing above, I guess NoAction is the default configuration and is implicitly applied when a migration is executed. However, if that's the case, it is not clear why I am seeing runtime migration errors.

Can anyone suggest the correct model builder configuration to force NoAction in the generated migration?

Body:
I have an EF Core model with a root entity type that has multiple one-to-many relationships with other entity types. Some of these child types also relate to each other, so I understand that I need to take precautions to avoid circular reference issues when deleting a root entity instance.

Without any explicit model builder configuration between the root entity type and its child types, the resulting migration includes clauses like this:

migrationBuilder.AddForeignKey(
    name: "FK_Merchants_Platforms_PlatformId",
    table: "Merchants",
    column: "PlatformId",
    principalTable: "Platforms",
    principalColumn: "Id");

If I attempt to run this migration, I see the following error:

In an attempt to solve this problem, I added explicit model builder configurations, which force NoAction on delete. Here's one example, applied to the child entity type:

builder
    .HasOne(e => e.Platform)
    .WithMany()
    .HasForeignKey(e => e.PlatformId)
    .OnDelete(DeleteBehavior.NoAction);

The above explicit change has no effect on the generated migration. However, if I change the DeleteBehavior to something other than NoAction, it produces the desired effect:

builder
    .HasOne(e => e.Platform)
    .WithMany()
    .HasForeignKey(e => e.PlatformId)
    .OnDelete(DeleteBehavior.Restrict);

migrationBuilder.AddForeignKey(
    name: "FK_Merchants_Platforms_PlatformId",
    table: "Merchants",
    column: "PlatformId",
    principalTable: "Platforms",
    principalColumn: "Id",
    onDelete: ReferentialAction.Restrict);

Based on what I am seeing above, I guess NoAction is the default configuration and is implicitly applied when a migration is executed. However, if that's the case, it is not clear why I am seeing runtime migration errors.

Can anyone suggest the correct model builder configuration to force NoAction in the generated migration?


问:
How to convert existing property decorator to a parameter decorator to work with property shorthand?
I want to use some property decorator (@Type from 'class-transformer' package) on a parameter, that is a property shorthand. Basically convert this:

```<code>class Test {
  @Type(() => SomeClassType)
  public prop1: SomeClassType;

  constructor(prop1: SomeClassType) {
    this.prop1 = prop1;
  }
}
</code>```

Into this:

```<code>class Test {
  constructor(@Type(() => SomeClassType) public prop1: SomeClassType) {}
}
</code>```

The problem is that decorator Type is only Property decorator, not a Property AND/OR Parameter decorator. So that I cannot use it directly on a parameter.

What is the easiest way to create a wrapper/adapter on a property decorator to make it work with parameter

(note: a parameter here is a shorthand property - public prop1: ...)

Body:
I want to use some property decorator (@Type from 'class-transformer' package) on a parameter, that is a property shorthand. Basically convert this:

class Test {
  @Type(() => SomeClassType)
  public prop1: SomeClassType;

  constructor(prop1: SomeClassType) {
    this.prop1 = prop1;
  }
}

Into this:

class Test {
  constructor(@Type(() => SomeClassType) public prop1: SomeClassType) {}
}

The problem is that decorator Type is only Property decorator, not a Property AND/OR Parameter decorator. So that I cannot use it directly on a parameter.

What is the easiest way to create a wrapper/adapter on a property decorator to make it work with parameter

(note: a parameter here is a shorthand property - public prop1: ...)


问:
Get total number of orders from a user by full name in WooCommerce
I want to modify the below code to get the total number of of orders by a user using the full name. I tried using get_formatted_billing_full_name meta data and it didn't work.

```<code>add_action( 'manage_shop_order_posts_custom_column' , 'my_shop_order_list_column_content', 10, 2 );

function has_guest_bought_by_name( $first_name ) {
    global $wpdb;

    // Get all order statuses.
    $order_statuses = array("wc-processing","wc-completed","wc-payment-settled","wc-picked_up");

    $results = $wpdb->get_col( "
        SELECT p.ID FROM {$wpdb->prefix}posts AS p
        INNER JOIN {$wpdb->prefix}postmeta AS pm ON p.ID = pm.post_id
        WHERE p.post_status IN ( '" . implode( "','", $order_statuses ) . "' )
        AND p.post_type LIKE 'shop_order'
        AND pm.meta_key = '_billing_first_name'
        AND pm.meta_value = '$first_name'
    " );

    // Return result
    return count( $results );
}

</code>```

Hope someone can help me out to get it done :)

Thanks in advance

Body:
I want to modify the below code to get the total number of of orders by a user using the full name. I tried using get_formatted_billing_full_name meta data and it didn't work.

add_action( 'manage_shop_order_posts_custom_column' , 'my_shop_order_list_column_content', 10, 2 );

function has_guest_bought_by_name( $first_name ) {
    global $wpdb;

    // Get all order statuses.
    $order_statuses = array("wc-processing","wc-completed","wc-payment-settled","wc-picked_up");

    $results = $wpdb->get_col( "
        SELECT p.ID FROM {$wpdb->prefix}posts AS p
        INNER JOIN {$wpdb->prefix}postmeta AS pm ON p.ID = pm.post_id
        WHERE p.post_status IN ( '" . implode( "','", $order_statuses ) . "' )
        AND p.post_type LIKE 'shop_order'
        AND pm.meta_key = '_billing_first_name'
        AND pm.meta_value = '$first_name'
    " );

    // Return result
    return count( $results );
}

Hope someone can help me out to get it done :)

Thanks in advance


问:
Adding example value for a controller parameter in Swagger
I have a .NET Core Web API that I have enabled XML comments on in the program.cs file by calling IncludeXmlComments.

I have the following XML comments set on my controller:

But the webpage displays an empty example column:

How do I get the Example column to be populated by the example attribute inside the  tag?

The XML on my model does update when I change it so I believe this is correctly configured. I cannot get the Example column to hold a value for the controller parameter.


问:
Using axum and reqwest to upload a file to cloud bucket, streaming it
I've created a small Github repo that mimics exactly what I'm trying to achieve: streaming file uploads to both file systems and the cloud (S3) using axum (and reqwest).

I can change all the code you see. There is no restriction. All signatures were invented by me who are in my early days with the awesome Rust.

If you want I can also eliminate reqwest, as long as I understand what to use instead! :smile:

Can you help me understand how to fix the only error left?

```<code>error[E0521]: borrowed data escapes outside of associated function
  --> src\adapter_s3.rs:56:19
   |
41 |     async fn put_file<'a>(
   |                       -- lifetime `'a` defined here
42 |         &'a self,
   |         -------- `self` is a reference that is only valid in the associated function body
...
56 |             .body(reqwest::Body::wrap_stream(ReaderStream::new(reader)))
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |                   |
   |                   `self` escapes the associated function body here
   |                   argument requires that `'a` must outlive `'static`
</code>```

This is the relevant code I think:

async fn put_file<'a>(
    &'a self,
    filename: &'a str,
    reader: Pin<Box<dyn AsyncRead + Send + Sync + 'a>>,
) -> Result<()> {
    let presigned_url_duration = Duration::from_secs(60 * 60);

    let action = self.bucket.put_object(Some(&self.credentials), filename);

    let client = reqwest::Client::new();

    client
        .post(action.sign(presigned_url_duration))
        // .body(reader)
        // .body(reqwest::Body::wrap_stream(reader))
        .body(reqwest::Body::wrap_stream(ReaderStream::new(reader)))
        .send()
        .await?
        .error_for_status()?;

    Ok(())
}
```
<p>UPDATE:</p>
<p>I tried with <code>hyper</code> too and it's the same error obviously:</p>
<pre class="lang-rust prettyprint-override"><code>hyper::Client::new()
    .request(
        hyper::Request::builder()
            .uri(action.sign(presigned_url_duration).to_string())
            .body(hyper::Body::wrap_stream(ReaderStream::new(reader)))
            .unwrap(),
    )
    .await
    .unwrap();
</code>```
```<code>error[E0521]: borrowed data escapes outside of associated function
    |
66  |     async fn put_file<'a>(
    |                       -- lifetime `'a` defined here
67  |         &'a self,
    |         -------- `self` is a reference that is only valid in the associated function body
...
124 |                     .body(hyper::Body::wrap_stream(ReaderStream::new(reader)))
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |                           |
    |                           `self` escapes the associated function body here
    |                           argument requires that `'a` must outlive `'static`
</code>```

Body:
I've created a small Github repo that mimics exactly what I'm trying to achieve: streaming file uploads to both file systems and the cloud (S3) using axum (and reqwest).

I can change all the code you see. There is no restriction. All signatures were invented by me who are in my early days with the awesome Rust.

If you want I can also eliminate reqwest, as long as I understand what to use instead! :smile:

Can you help me understand how to fix the only error left?

error[E0521]: borrowed data escapes outside of associated function
  --> src\adapter_s3.rs:56:19
   |
41 |     async fn put_file<'a>(
   |                       -- lifetime `'a` defined here
42 |         &'a self,
   |         -------- `self` is a reference that is only valid in the associated function body
...
56 |             .body(reqwest::Body::wrap_stream(ReaderStream::new(reader)))
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |                   |
   |                   `self` escapes the associated function body here
   |                   argument requires that `'a` must outlive `'static`

This is the relevant code I think:

async fn put_file<'a>(
    &'a self,
    filename: &'a str,
    reader: Pin<Box<dyn AsyncRead + Send + Sync + 'a>>,
) -> Result<()> {
    let presigned_url_duration = Duration::from_secs(60 * 60);

    let action = self.bucket.put_object(Some(&self.credentials), filename);

    let client = reqwest::Client::new();

    client
        .post(action.sign(presigned_url_duration))
        // .body(reader)
        // .body(reqwest::Body::wrap_stream(reader))
        .body(reqwest::Body::wrap_stream(ReaderStream::new(reader)))
        .send()
        .await?
        .error_for_status()?;

    Ok(())
}

UPDATE:

I tried with hyper too and it's the same error obviously:

hyper::Client::new()
    .request(
        hyper::Request::builder()
            .uri(action.sign(presigned_url_duration).to_string())
            .body(hyper::Body::wrap_stream(ReaderStream::new(reader)))
            .unwrap(),
    )
    .await
    .unwrap();

error[E0521]: borrowed data escapes outside of associated function
    |
66  |     async fn put_file<'a>(
    |                       -- lifetime `'a` defined here
67  |         &'a self,
    |         -------- `self` is a reference that is only valid in the associated function body
...
124 |                     .body(hyper::Body::wrap_stream(ReaderStream::new(reader)))
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |                           |
    |                           `self` escapes the associated function body here
    |                           argument requires that `'a` must outlive `'static`


问:
Search a pair in unordered_set of pairs from first element in C++
I want to erase the pair: (x,"whatever"), and i want:
1)find an iterator position of the pair with x as first element
2)after that erase the element in the position of the iterator

```<code>typedef pair<int, int> pairs;

// Hash function
struct hashFunction{
   size_t operator()(const pairs &x) const{return x.first ^ x.second;}
};

//Comparator function
struct comp{
    bool operator()(pairs a , pairs b){
        return a.first < b.first ? a : b;
    }
};

//The function that I want to implement
void delEdge(unordered_set<pairs>, hashFunction, comp> adj[], int u, int v){
    adj[v].erase(/*a function that finds the position of the pair (u,_)*/);
    adj[u].erase(/*a function that finds the position of the pair (v,_)*/);
}
</code>```

I found that, it exists this function:

```<code>find_if(adj[v].begin(), adj[v].end(), [](auto& el){ return el.first == u; });
</code>```

from: How can I search for a element in unordered_set of pairs on the basis of first element>

But as I have been searching, I found that this find_if complexity is O(n) and not O(1) on average.

Question:
How to implement: s.find(x), (s as an unordered_set of pairs) that finds the position of the (x,_)pair in the same complexity as the original find method (in O(1) on average)?

Body:
I want to erase the pair: (x,"whatever"), and i want:
1)find an iterator position of the pair with x as first element
2)after that erase the element in the position of the iterator

typedef pair<int, int> pairs;

// Hash function
struct hashFunction{
   size_t operator()(const pairs &x) const{return x.first ^ x.second;}
};

//Comparator function
struct comp{
    bool operator()(pairs a , pairs b){
        return a.first < b.first ? a : b;
    }
};

//The function that I want to implement
void delEdge(unordered_set<pairs>, hashFunction, comp> adj[], int u, int v){
    adj[v].erase(/*a function that finds the position of the pair (u,_)*/);
    adj[u].erase(/*a function that finds the position of the pair (v,_)*/);
}

I found that, it exists this function:

find_if(adj[v].begin(), adj[v].end(), [](auto& el){ return el.first == u; });

from: How can I search for a element in unordered_set of pairs on the basis of first element>

But as I have been searching, I found that this find_if complexity is O(n) and not O(1) on average.

Question:
How to implement: s.find(x), (s as an unordered_set of pairs) that finds the position of the (x,_)pair in the same complexity as the original find method (in O(1) on average)?


问:
Is it possible to insert a web component into an SVG element?
Is it possible to embed a web component inside an SVG element and then display child SVG elements in the web component?

I'd like to componentise the elements on my svg canvas but I just get an empty component when attempting this.

```<code><svg height="100" width="100">
    <circle-elem></circle-elem>
</svg>
</code>```
```<code>class CircleElem extends HTMLElement {
    connectedCallback() {
        this.innerHTML = `<circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" />`;
    }
}

customElements.define('circle-elem', CircleElem);
</code>```

CodePen

Body:
Is it possible to embed a web component inside an SVG element and then display child SVG elements in the web component?

I'd like to componentise the elements on my svg canvas but I just get an empty component when attempting this.

<svg height="100" width="100">
    <circle-elem></circle-elem>
</svg>

class CircleElem extends HTMLElement {
    connectedCallback() {
        this.innerHTML = `<circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" />`;
    }
}

customElements.define('circle-elem', CircleElem);

CodePen


问:
Generic constraints for Dapper.FSharp SELECT WHERE query
What is the appropriate way to create generic SELECT * FROM table WHERE id = @id; with type constraint using Dapper.FSharp?

Here is my snippet. With (p.Id  = id) it won't compile because of type constraint mismatch and with (checkId id p) it obviously fails

```<code>#r "nuget: Dapper.Fsharp"
#r "nuget: Npgsql.Fsharp"
open Npgsql
open Npgsql.FSharp
open Dapper.FSharp.PostgreSQL

module Example =
    type Id = Guid

    type A = {
        Id : Id
        DoubleValue : double
    }

    type B = {
        Id : Id
        IntValue: int
    }

    let inline checkId (id: ^id when ^id : equality ) a =
             ( ^a:( member Id : ^id ) a) = id

    let inline getById< ^a,^id when ^a:( member Id : ^id ) and ^id : equality > (con:NpgsqlConnection) (table: QuerySource< ^a  >  ) (id: ^id ) =
                    select {
                        for  p in table do
                        //where (checkId id p) // <- this will compile, but raises NotImplementedException
                        where (p.Id  = id) // <- this won't compile with "Type constraint mismatch. The type ''a' is not compatible with type 'B'"
                        take 1
                    }
                    |> con.SelectAsync< ^a >
                    |> Async.AwaitTask

</code>```

I ended up using this as a workaround

```<code>#r "nuget: Dapper.Fsharp"
#r "nuget: Npgsql.Fsharp"
open Npgsql
open Dapper
type Id = Guid
module Example =
    [<CLIMutable>]
    type A = {
        Id : Id
        DoubleValue : double
    }
    [<CLIMutable>]
    type B = {
        Id : Id
        IntValue: int
    }
    let toTableName<'a> =
        failwith "todo"

    let getById<'a> (con:NpgsqlConnection) (id: Id ) =
                    con.QuerySingleAsync<'a>($"""SELECT * FROM "{toTableName<'a>}" WHERE "Id" = @id;""", {| id = id |})
                    |> Async.AwaitTask

</code>```

Body:
What is the appropriate way to create generic SELECT * FROM table WHERE id = @id; with type constraint using Dapper.FSharp?

Here is my snippet. With (p.Id  = id) it won't compile because of type constraint mismatch and with (checkId id p) it obviously fails

#r "nuget: Dapper.Fsharp"
#r "nuget: Npgsql.Fsharp"
open Npgsql
open Npgsql.FSharp
open Dapper.FSharp.PostgreSQL

module Example =
    type Id = Guid

    type A = {
        Id : Id
        DoubleValue : double
    }

    type B = {
        Id : Id
        IntValue: int
    }

    let inline checkId (id: ^id when ^id : equality ) a =
             ( ^a:( member Id : ^id ) a) = id

    let inline getById< ^a,^id when ^a:( member Id : ^id ) and ^id : equality > (con:NpgsqlConnection) (table: QuerySource< ^a  >  ) (id: ^id ) =
                    select {
                        for  p in table do
                        //where (checkId id p) // <- this will compile, but raises NotImplementedException
                        where (p.Id  = id) // <- this won't compile with "Type constraint mismatch. The type ''a' is not compatible with type 'B'"
                        take 1
                    }
                    |> con.SelectAsync< ^a >
                    |> Async.AwaitTask

I ended up using this as a workaround

#r "nuget: Dapper.Fsharp"
#r "nuget: Npgsql.Fsharp"
open Npgsql
open Dapper
type Id = Guid
module Example =
    [<CLIMutable>]
    type A = {
        Id : Id
        DoubleValue : double
    }
    [<CLIMutable>]
    type B = {
        Id : Id
        IntValue: int
    }
    let toTableName<'a> =
        failwith "todo"

    let getById<'a> (con:NpgsqlConnection) (id: Id ) =
                    con.QuerySingleAsync<'a>($"""SELECT * FROM "{toTableName<'a>}" WHERE "Id" = @id;""", {| id = id |})
                    |> Async.AwaitTask


问:
How to close specific circuit in Blazor (server) app
I monitor use of my application through CircuitHandler. It implements useful tasks like OnCircuitOpened or OnCircuitClosed but what I also want is to be able to force close certain circuits (a.k.a. kick users out). How can I do it in Blazor Server?


问:
Firebase notification click is not redirecting when app is closed flutter
I have a app with firebase messaging.
When app is open, I received a remote notification and show a local notification.

When app is killed, and I send a push notification and click, not redirect to specific url, but if app is opened or foreground yes!

My code:

```<code>Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
await Firebase.initializeApp();
print('Handling a background message ${message.messageId}');
flutterLocalNotificationsPlugin.show(
    message.data.hashCode,
    message.data['title'],
    message.data['body'],
    NotificationDetails(
      android: AndroidNotificationDetails(channel.id, channel.name,
          channelDescription: channel.description),
    ),
    payload: message.data['click_action']);
}

const AndroidNotificationChannel channel = AndroidNotificationChannel(
'high_importance_channel', // id
'High Importance Notifications', // title
description:
    'This channel is used for important notifications.', // description
importance: Importance.high,
);

const IOSNotificationDetails iosNotificationDetails = IOSNotificationDetails();

final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
  FlutterLocalNotificationsPlugin();

Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();

await Firebase.initializeApp();
await Permission.notification.request();

await FirebaseMessaging.instance.subscribeToTopic("NEWS");
FirebaseMessaging messaging = FirebaseMessaging.instance;

NotificationSettings settings = await messaging.requestPermission(
  alert: true,
  announcement: false,
  badge: true,
  carPlay: false,
  criticalAlert: false,
  provisional: false,
  sound: true,
);

if (settings.authorizationStatus == AuthorizationStatus.authorized) {
  print('User granted permission');
} else if (settings.authorizationStatus == AuthorizationStatus.provisional) {
  print('User granted provisional permission');
} else {
  print('User declined or has not accepted permission');
}
FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
await flutterLocalNotificationsPlugin
    .resolvePlatformSpecificImplementation<
        AndroidFlutterLocalNotificationsPlugin>()
    ?.createNotificationChannel(channel);

SystemChrome.setPreferredOrientations([
  DeviceOrientation.portraitUp,
]);

runApp(App());
}
</code>```

app.dart

```<code>Future<void> getToken() async {
  final FirebaseMessaging _fcm = FirebaseMessaging.instance;
  final token = await _fcm.getToken();
  print("#####################################################");
  print(token.toString());
  print("#####################################################");
}

class _AppState extends State<App> {
  @override
  void initState() {
    var initialzationSettingsAndroid =
        AndroidInitializationSettings('@mipmap/ic_launcher');
    var initializationSettings = InitializationSettings(
      android: initialzationSettingsAndroid,
      iOS: IOSInitializationSettings(),
    );

    flutterLocalNotificationsPlugin.initialize(initializationSettings,
        onSelectNotification: onSelectNotification);
    FirebaseMessaging.onMessage.listen((RemoteMessage message) {
      RemoteNotification? notification = message.notification;
      AndroidNotification? android = message.notification?.android;
      AppleNotification? ios = message.notification?.apple;
      if (notification != null && android != null) {
        flutterLocalNotificationsPlugin.show(
            notification.hashCode,
            notification.title,
            notification.body,
            NotificationDetails(
                android: AndroidNotificationDetails(
                  channel.id,
                  channel.name,
                  channelDescription: channel.description,
                  icon: android.smallIcon,
                ),
                iOS: IOSNotificationDetails()),
            payload: message.data['click_action']);
      }
    });

    FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {
      String? ask = message.data['click_action'];
      if (ask!.contains("www")) {
        openLink(Uri.parse(message.data['click_action']));
      } else if (ask == "APP") {
        //GO TO PAGE
      } else {
        null;
      }
    });

    getToken();
    super.initState();
  }

  Future onSelectNotification(String? payload) async {
    String? ask = payload;
    if (ask!.contains("www")) {
      openLink(Uri.parse(payload!));
    } else if (ask == "APP") {
      //GO TO PAGE
    } else {
      null;
    }
  }

  @override
  Widget build(BuildContext context) {..}

}

void openLink(_url) async {
  if (!await launchUrl(
    _url,
    mode: LaunchMode.externalApplication,
  )) throw 'Could not launch $_url';
}

</code>```

I send the notification with firebase console:

```<code>{
    "to" : "/topics/NEWS",
    "priority": "high",
    "importance":"max",
    "notification": {
        "title": "title",
        "body" : "body",
        "text": "Text",
        "sound":"default"
    },
    "data":{
        "click_action":"https://www.google.com"
    }
}
</code>```

Body:
I have a app with firebase messaging.
When app is open, I received a remote notification and show a local notification.

When app is killed, and I send a push notification and click, not redirect to specific url, but if app is opened or foreground yes!

My code:

Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
await Firebase.initializeApp();
print('Handling a background message ${message.messageId}');
flutterLocalNotificationsPlugin.show(
    message.data.hashCode,
    message.data['title'],
    message.data['body'],
    NotificationDetails(
      android: AndroidNotificationDetails(channel.id, channel.name,
          channelDescription: channel.description),
    ),
    payload: message.data['click_action']);
}

const AndroidNotificationChannel channel = AndroidNotificationChannel(
'high_importance_channel', // id
'High Importance Notifications', // title
description:
    'This channel is used for important notifications.', // description
importance: Importance.high,
);

const IOSNotificationDetails iosNotificationDetails = IOSNotificationDetails();

final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
  FlutterLocalNotificationsPlugin();

Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();

await Firebase.initializeApp();
await Permission.notification.request();

await FirebaseMessaging.instance.subscribeToTopic("NEWS");
FirebaseMessaging messaging = FirebaseMessaging.instance;

NotificationSettings settings = await messaging.requestPermission(
  alert: true,
  announcement: false,
  badge: true,
  carPlay: false,
  criticalAlert: false,
  provisional: false,
  sound: true,
);

if (settings.authorizationStatus == AuthorizationStatus.authorized) {
  print('User granted permission');
} else if (settings.authorizationStatus == AuthorizationStatus.provisional) {
  print('User granted provisional permission');
} else {
  print('User declined or has not accepted permission');
}
FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
await flutterLocalNotificationsPlugin
    .resolvePlatformSpecificImplementation<
        AndroidFlutterLocalNotificationsPlugin>()
    ?.createNotificationChannel(channel);

SystemChrome.setPreferredOrientations([
  DeviceOrientation.portraitUp,
]);

runApp(App());
}

app.dart

Future<void> getToken() async {
  final FirebaseMessaging _fcm = FirebaseMessaging.instance;
  final token = await _fcm.getToken();
  print("#####################################################");
  print(token.toString());
  print("#####################################################");
}

class _AppState extends State<App> {
  @override
  void initState() {
    var initialzationSettingsAndroid =
        AndroidInitializationSettings('@mipmap/ic_launcher');
    var initializationSettings = InitializationSettings(
      android: initialzationSettingsAndroid,
      iOS: IOSInitializationSettings(),
    );

    flutterLocalNotificationsPlugin.initialize(initializationSettings,
        onSelectNotification: onSelectNotification);
    FirebaseMessaging.onMessage.listen((RemoteMessage message) {
      RemoteNotification? notification = message.notification;
      AndroidNotification? android = message.notification?.android;
      AppleNotification? ios = message.notification?.apple;
      if (notification != null && android != null) {
        flutterLocalNotificationsPlugin.show(
            notification.hashCode,
            notification.title,
            notification.body,
            NotificationDetails(
                android: AndroidNotificationDetails(
                  channel.id,
                  channel.name,
                  channelDescription: channel.description,
                  icon: android.smallIcon,
                ),
                iOS: IOSNotificationDetails()),
            payload: message.data['click_action']);
      }
    });

    FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {
      String? ask = message.data['click_action'];
      if (ask!.contains("www")) {
        openLink(Uri.parse(message.data['click_action']));
      } else if (ask == "APP") {
        //GO TO PAGE
      } else {
        null;
      }
    });

    getToken();
    super.initState();
  }

  Future onSelectNotification(String? payload) async {
    String? ask = payload;
    if (ask!.contains("www")) {
      openLink(Uri.parse(payload!));
    } else if (ask == "APP") {
      //GO TO PAGE
    } else {
      null;
    }
  }

  @override
  Widget build(BuildContext context) {..}

}

void openLink(_url) async {
  if (!await launchUrl(
    _url,
    mode: LaunchMode.externalApplication,
  )) throw 'Could not launch $_url';
}

I send the notification with firebase console:

{
    "to" : "/topics/NEWS",
    "priority": "high",
    "importance":"max",
    "notification": {
        "title": "title",
        "body" : "body",
        "text": "Text",
        "sound":"default"
    },
    "data":{
        "click_action":"https://www.google.com"
    }
}


问:
TensorFlow Tutorial with Keras
I am currently trying to do this tutorial and really understand what happens and why.

https://colab.research.google.com/github/tensorflow/examples/blob/master/lite/codelabs/digit_classifier/ml/step2_train_ml_model.ipynb#scrollTo=IWgBGmaplzcp

Disclaimer: I am not really a math expert and maybe I am missing some basics, but I try to understand piece by piece what it is doing.

I learned that the Conv2D is actually multiplying the input pixels with the given parameters.

# Define the model architecture
model = keras.Sequential([
  keras.layers.InputLayer(input_shape=(28, 28)),
  keras.layers.Reshape(target_shape=(28, 28, 1)),
  keras.layers.Conv2D(filters=32, kernel_size=(3, 3), activation=tf.nn.relu),
  keras.layers.Conv2D(filters=64, kernel_size=(3, 3), activation=tf.nn.relu),
  keras.layers.MaxPooling2D(pool_size=(2, 2)),
  keras.layers.Dropout(0.25),
  keras.layers.Flatten(),
  keras.layers.Dense(10)
])
```

What I dont get here is:

Why are we applying 32 filters that consist of 3x3 and then we are taking the result and doing it again with 64 filters?

What is this thing actually trying to do? What does it try to detect by doing these two sequences?

I hope my question is understandable.

Thanks.

Title: TensorFlow Tutorial with Keras

Body:
I am currently trying to do this tutorial and really understand what happens and why.

https://colab.research.google.com/github/tensorflow/examples/blob/master/lite/codelabs/digit_classifier/ml/step2_train_ml_model.ipynb#scrollTo=IWgBGmaplzcp

Disclaimer: I am not really a math expert and maybe I am missing some basics, but I try to understand piece by piece what it is doing.

I learned that the Conv2D is actually multiplying the input pixels with the given parameters.

# Define the model architecture
model = keras.Sequential([
  keras.layers.InputLayer(input_shape=(28, 28)),
  keras.layers.Reshape(target_shape=(28, 28, 1)),
  keras.layers.Conv2D(filters=32, kernel_size=(3, 3), activation=tf.nn.relu),
  keras.layers.Conv2D(filters=64, kernel_size=(3, 3), activation=tf.nn.relu),
  keras.layers.MaxPooling2D(pool_size=(2, 2)),
  keras.layers.Dropout(0.25),
  keras.layers.Flatten(),
  keras.layers.Dense(10)
])

What I dont get here is:

Why are we applying 32 filters that consist of 3x3 and then we are taking the result and doing it again with 64 filters?

What is this thing actually trying to do? What does it try to detect by doing these two sequences?

I hope my question is understandable.

Thanks.


问:
Bootstrap carousel control's shape shows different between server and localhost
I'm using Bootstrap3 to working on my home view page in Visual Studio, but the carousel control icon shows different between sever side(looks like square) and localhost(looks normal), is anything I missed? Thank you so much for the help!

I attached the carousel part of my code below:

```<code><div class="col-lg-5">
                    <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
                        <!-- Indicators
                        <ol class="carousel-indicators">
                            <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
                            <li data-target="#carousel-example-generic" data-slide-to="1"></li>
                            <li data-target="#carousel-example-generic" data-slide-to="2"></li>
                            <li data-target="#carousel-example-generic" data-slide-to="3"></li>
                        </ol> -->
                        <!-- Wrapper for slides -->
                        <div class="carousel-inner" role="listbox">
                            <div class="item active">
                                <table id="Report_InvHardCatExpiring-table" class="table table-striped styleTable table-hover" style="border:2px;">
                                    <caption>Hardware expiring 90 days out.</caption>
                                    <thead>
                                        <tr bgcolor="#a0bac4">
                                            <th>
                                                @Html.LabelFor(model => model.Report_InvHardwareAggregateCat.FirstOrDefault().InvHardwareCatName)
                                            </th>
                                            <th>
                                                @Html.LabelFor(model => model.Report_InvSoftwareAggregateCat.FirstOrDefault().CountType)
                                            </th>
                                        </tr>
                                    </thead>

                                    <tbody>
                                        @foreach (var item in Model.Report_InvHardwareAggregateCat)
                                        {
                                            <tr>
                                                <td>
                                                    @item.InvHardwareCatName
                                                </td>
                                                <td>
                                                    @item.CountType
                                                </td>
                                            </tr>
                                        }

                                    </tbody>
                                </table>
                            </div>
                            <div class="item">
                                <table id="Report_InvSoftCatExpiring-table" class="table table-striped styleTable table-hover" style="border:2px;">
                                    <caption>Software expiring 90 days out.</caption>
                                    <thead>
                                        <tr bgcolor="#a0bac4">
                                            <th>
                                                @Html.LabelFor(model => model.Report_InvSoftwareAggregateCat.FirstOrDefault().InvSoftwareCatName)
                                            </th>
                                            <th>
                                                @Html.LabelFor(model => model.Report_InvSoftwareAggregateCat.FirstOrDefault().CountType)
                                            </th>
                                        </tr>
                                    </thead>
                                    <tbody>

                                        @foreach (var item in Model.Report_InvSoftwareAggregateCat)
                                        {
                                            <tr>
                                                <td>
                                                    @item.InvSoftwareCatName
                                                </td>
                                                <td>
                                                    @item.CountType
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>

                                                </td>
                                                <td>

                                                </td>
                                            </tr>
                                            <tr>
                                                <td>

                                                </td>
                                                <td>

                                                </td>
                                            </tr>
                                            <tr>
                                                <td>

                                                </td>
                                                <td>

                                                </td>
                                            </tr>
                                            <tr>
                                                <td>

                                                </td>
                                                <td>

                                                </td>
                                            </tr>
                                            <tr>
                                                <td>

                                                </td>
                                                <td>

                                                </td>
                                            </tr>
                                            <tr>
                                                <td>

                                                </td>
                                                <td>

                                                </td>
                                            </tr>

                                        }

                                    </tbody>
                                </table>
                            </div>
                            <div class="item">
                                <table id="Report_InvFurnitureCatExpiring-table" class="table table-striped styleTable table-hover" style="border:2px;">
                                    <caption>Furniture expiring 90 days out.</caption>
                                    <thead>
                                        <tr bgcolor="#a0bac4">
                                            <th>
                                                @Html.LabelFor(model => model.Report_InvFurnitureAggregateCat.FirstOrDefault().InvFurnitureCatName)
                                            </th>
                                            <th>
                                                @Html.LabelFor(model => model.Report_InvFurnitureAggregateCat.FirstOrDefault().CountType)
                                            </th>
                                        </tr>
                                    </thead>
                                    <tbody>

                                        @foreach (var item in Model.Report_InvFurnitureAggregateCat)
                                        {
                                            <tr>
                                                <td>
                                                    @item.InvFurnitureCatName
                                                </td>
                                                <td>
                                                    @item.CountType
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>

                                                </td>
                                                <td>

                                                </td>
                                            </tr>
                                            <tr>
                                                <td>

                                                </td>
                                                <td>

                                                </td>
                                            </tr>
                                            <tr>
                                                <td>

                                                </td>
                                                <td>

                                                </td>
                                            </tr>
                                            <tr>
                                                <td>

                                                </td>
                                                <td>

                                                </td>
                                            </tr>
                                            <tr>
                                                <td>

                                                </td>
                                                <td>

                                                </td>
                                            </tr>
                                            <tr>
                                                <td>

                                                </td>
                                                <td>

                                                </td>
                                            </tr>
                                        }

                                    </tbody>
                                </table>
                            </div>
                            <div class="item">
                                <table id="Report_InvHardware_ByProdTypeByAmount-table" class="table table-striped styleTable table-hover" style="border:2px;">
                                    <caption>Hardware category by cost.</caption>
                                    <thead>
                                        <tr bgcolor="#a0bac4">
                                            <th>
                                                @Html.LabelFor(model => model.Report_InvHardware_ByProdTypeByAmount.FirstOrDefault().Name)
                                            </th>
                                            <th>
                                                @Html.LabelFor(model => model.Report_InvHardware_ByProdTypeByAmount.FirstOrDefault().CountInvProductTypeID)
                                            </th>
                                            <th>
                                                @Html.LabelFor(model => model.Report_InvHardware_ByProdTypeByAmount.FirstOrDefault().SumAmount)
                                            </th>
                                        </tr>
                                    </thead>
                                    <tbody>

                                        @foreach (var item in Model.Report_InvHardware_ByProdTypeByAmount)
                                        {
                                            <tr>
                                                <td>
                                                    @item.Name
                                                </td>
                                                <td>
                                                    @item.CountInvProductTypeID
                                                </td>
                                                <td>
                                                    @item.SumAmountFormatted
                                                </td>
                                            </tr>
                                        }

                                    </tbody>
                                </table>
                            </div>

                        </div>

                        <!-- Controls -->
                        <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev" style="background-image: none;">
                            <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
                            <span class="sr-only">Previous</span>
                        </a>
                        <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next" style="background-image: none;">
                            <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                            <span class="sr-only">Next</span>
                        </a>

                    </div>
                </div>
</code>```

What it shows on my server:
enter image description here

What it shows on my localhost:
enter image description here

Body:
I'm using Bootstrap3 to working on my home view page in Visual Studio, but the carousel control icon shows different between sever side(looks like square) and localhost(looks normal), is anything I missed? Thank you so much for the help!

I attached the carousel part of my code below:

Hardware expiring 90 days out.

                                                @Html.LabelFor(model => model.Report_InvHardwareAggregateCat.FirstOrDefault().InvHardwareCatName)

                                                @Html.LabelFor(model => model.Report_InvSoftwareAggregateCat.FirstOrDefault().CountType)

                                        @foreach (var item in Model.Report_InvHardwareAggregateCat)
                                        {

                                                    @item.InvHardwareCatName

                                                    @item.CountType

                                        }

Software expiring 90 days out.

                                                @Html.LabelFor(model => model.Report_InvSoftwareAggregateCat.FirstOrDefault().InvSoftwareCatName)

                                                @Html.LabelFor(model => model.Report_InvSoftwareAggregateCat.FirstOrDefault().CountType)

                                        @foreach (var item in Model.Report_InvSoftwareAggregateCat)
                                        {

                                                    @item.InvSoftwareCatName

                                                    @item.CountType

                                        }

Furniture expiring 90 days out.

                                                @Html.LabelFor(model => model.Report_InvFurnitureAggregateCat.FirstOrDefault().InvFurnitureCatName)

                                                @Html.LabelFor(model => model.Report_InvFurnitureAggregateCat.FirstOrDefault().CountType)

                                        @foreach (var item in Model.Report_InvFurnitureAggregateCat)
                                        {

                                                    @item.InvFurnitureCatName

                                                    @item.CountType

                                        }

Hardware category by cost.

                                                @Html.LabelFor(model => model.Report_InvHardware_ByProdTypeByAmount.FirstOrDefault().Name)

                                                @Html.LabelFor(model => model.Report_InvHardware_ByProdTypeByAmount.FirstOrDefault().CountInvProductTypeID)

                                                @Html.LabelFor(model => model.Report_InvHardware_ByProdTypeByAmount.FirstOrDefault().SumAmount)

                                        @foreach (var item in Model.Report_InvHardware_ByProdTypeByAmount)
                                        {

                                                    @item.Name

                                                    @item.CountInvProductTypeID

                                                    @item.SumAmountFormatted

                                        }

                            Previous

                            Next

What it shows on my server:
enter image description here

What it shows on my localhost:
enter image description here


问:
Matplotlib does not set correct xaxis range and ticklabels for multiple plots in a figure
I have a problem, where I want to create a split x-axis and set different limits for the right and left part. I loosely followed the tutorial from here:
https://matplotlib.org/stable/gallery/subplots_axes_and_figures/broken_axis.html
but the x-axis are neither set correctly, nor are the ticklabels correct.

```<code>Test_X = [50,70,100,250,500,1000,6000,10000,15000,30000]
Test_Y = np.array([3,4,5,3,6,2,5,3,4,2])*1e-3

colors = ['blue','red','green','black','orange']
Labels = ['0','1','2','3','4']
axis_fontsize = 20

f, (ax1, ax2) = plt.subplots(1, 2, sharex=True,figsize= (10,5))

ax1.scatter(Test_X,Test_Y,facecolors='none',edgecolors = colors[0])
ax2.scatter(Test_X,Test_Y,facecolors='none',edgecolors = colors[0])

ax2.set_xlim(xmin=5000,xmax=40000)
ax1.set_xlim(xmin=40,xmax=1100)

ax1.set_ylabel('YLabel$',fontsize = axis_fontsize)
ax1.set_xlabel('XLabel',fontsize = axis_fontsize)

ax1.spines['right'].set_visible(False)
ax2.spines['left'].set_visible(False)

ax2.yaxis.tick_right()
ax2.tick_params(labelright=False)

d = .03
kwargs = dict(transform=ax1.transAxes, color='k', clip_on=False)

ax1.plot((1 - d, 1 + d), (-d, +d), **kwargs)
ax1.plot((1 - d, 1 + d), (1-d, 1+d), **kwargs)

kwargs.update(transform=ax2.transAxes)
ax2.plot((-d, +d), (1 - d, 1 + d), **kwargs)
ax2.plot((-d, +d), (- d, + d), **kwargs)
plt.show()
</code>```

which produces the plot below.

How can I fix the incorrect x-axis?

Switching the order of the set_xlim switches the tick labels on both axis but not the range.

Body:
I have a problem, where I want to create a split x-axis and set different limits for the right and left part. I loosely followed the tutorial from here:
https://matplotlib.org/stable/gallery/subplots_axes_and_figures/broken_axis.html
but the x-axis are neither set correctly, nor are the ticklabels correct.

Test_X = [50,70,100,250,500,1000,6000,10000,15000,30000]
Test_Y = np.array([3,4,5,3,6,2,5,3,4,2])*1e-3

colors = ['blue','red','green','black','orange']
Labels = ['0','1','2','3','4']
axis_fontsize = 20

f, (ax1, ax2) = plt.subplots(1, 2, sharex=True,figsize= (10,5))

ax1.scatter(Test_X,Test_Y,facecolors='none',edgecolors = colors[0])
ax2.scatter(Test_X,Test_Y,facecolors='none',edgecolors = colors[0])

ax2.set_xlim(xmin=5000,xmax=40000)
ax1.set_xlim(xmin=40,xmax=1100)

ax1.set_ylabel('YLabel$',fontsize = axis_fontsize)
ax1.set_xlabel('XLabel',fontsize = axis_fontsize)

ax1.spines['right'].set_visible(False)
ax2.spines['left'].set_visible(False)

ax2.yaxis.tick_right()
ax2.tick_params(labelright=False)

d = .03
kwargs = dict(transform=ax1.transAxes, color='k', clip_on=False)

ax1.plot((1 - d, 1 + d), (-d, +d), **kwargs)
ax1.plot((1 - d, 1 + d), (1-d, 1+d), **kwargs)

kwargs.update(transform=ax2.transAxes)
ax2.plot((-d, +d), (1 - d, 1 + d), **kwargs)
ax2.plot((-d, +d), (- d, + d), **kwargs)
plt.show()

which produces the plot below.

How can I fix the incorrect x-axis?

Switching the order of the set_xlim switches the tick labels on both axis but not the range.


问:
Grouping a column classified by KMeans(cluster no=4) by another column in dataframe(Python)
First of all, my dataset had singer and lyrics. I wanted to classify the lyrics of these singers in order to group them. So I converted the lyrics to a 768 array using one of the "SentenceTransformer" models. Then I found the ideal cluster number to implement KMeans with both Elbow and Silhouette methods and applied KMeans according to this number. As a result, I got a situation where the lyrics were divided into 4 different groups. I also added this to the dataframe.

Now there is a point where I am stuck. I want to classify the singers according to this class column. But since there will be different class values for a singer, what would be the ideal way to do this?
If I take the mean of the class column by singers, I will have a single class value for each singer. Can I get a successful result if I classify it by dividing it into intervals according to this single value found? Or are there other ways to deal with these situations?

```<code>            singer       class
0         Barış Manço      0
1         Barış Manço      3
2         Barış Manço      2
3         Barış Manço      1
4         Barış Manço      2
...          ...          ...
4423      Şebnem Ferah     0
4424      Şebnem Ferah     1
4425      Şebnem Ferah     1
4426      Şebnem Ferah     0
4427      Şebnem Ferah     1
</code>```

class[0,1,2,3] => so cluster number is 4

```<code>In[9]: gk = df.groupby("singer")["class"]
In[11]:gk.head()

Out[11]:

0       0
1       3
2       2
3       1
4       2
       ..
4331    2
4332    0
4333    0
4334    0
4335    0

</code>```

I tried this method but it didn't work.
What could be the reason for the increase in the number of rows here?

Body:
First of all, my dataset had singer and lyrics. I wanted to classify the lyrics of these singers in order to group them. So I converted the lyrics to a 768 array using one of the "SentenceTransformer" models. Then I found the ideal cluster number to implement KMeans with both Elbow and Silhouette methods and applied KMeans according to this number. As a result, I got a situation where the lyrics were divided into 4 different groups. I also added this to the dataframe.

Now there is a point where I am stuck. I want to classify the singers according to this class column. But since there will be different class values for a singer, what would be the ideal way to do this?
If I take the mean of the class column by singers, I will have a single class value for each singer. Can I get a successful result if I classify it by dividing it into intervals according to this single value found? Or are there other ways to deal with these situations?

            singer       class
0         Barış Manço      0
1         Barış Manço      3
2         Barış Manço      2
3         Barış Manço      1
4         Barış Manço      2
...          ...          ...
4423      Şebnem Ferah     0
4424      Şebnem Ferah     1
4425      Şebnem Ferah     1
4426      Şebnem Ferah     0
4427      Şebnem Ferah     1

class[0,1,2,3] => so cluster number is 4

In[9]: gk = df.groupby("singer")["class"]
In[11]:gk.head()

Out[11]:

0       0
1       3
2       2
3       1
4       2
       ..
4331    2
4332    0
4333    0
4334    0
4335    0

I tried this method but it didn't work.
What could be the reason for the increase in the number of rows here?


问:
Get Total Count Of List Elements After a Specific Element Occurs (going from left to right in the list)
I have a python list below. I would like to get the total count of all elements which are 1. The count needs to start once an element is 0. For example, in the list the count should be 3 as the first 0 is at index 2. Beyond this index, there are 3 instances of 1. The first two 1's should be ignored in the count.</p>
```<code>mylist = [1, 1, 0, 1, 0, 0, 1, 1]
</code>```

Body:
I have a python list below. I would like to get the total count of all elements which are 1. The count needs to start once an element is 0. For example, in the list the count should be 3 as the first 0 is at index 2. Beyond this index, there are 3 instances of 1. The first two 1's should be ignored in the count.

mylist = [1, 1, 0, 1, 0, 0, 1, 1]


问:
How to secure solr access
I am trying to setup solr and one of the thigs I have trouble with is security.

I have two cores: project-1 and project-2

I also created two users: project-1 and project-2

Now I am trying to setup permissions but it is confusing to me how to do it.

From what I understand from documentation I need to create a permission called project-1, assign it to a group called project-1 and assign that group to user project-1, that I do understand.

But I am having an issue with creating the permission itself.

It seems I have two fields to fill: collection and path.

Should I set collection = project-1 or path = /solr/project-1/* or both, or maybe something else?

Title: How to secure solr access


问:
Show/Hide Text Entry Box on Single Choice MC Question
I am new to coding and qualtrics in general. In sort of a time crunch but slowly teaching myself the basics of html currently.

I have a survey question that consist of a single choice MC question with three choices available. Each choice has a text entry box that appears for the choice selected. A hide/show function essentially. However, I am needing to add difference prefixes and suffixes for the text entry boxes like "$" and "annually". I am having an issue where the prefixes and suffixes appear before the choice is selected and the text entry box does not appear till you select the choice. Pictures below. The mobile picture at the very end also does not fit correctly. Any help is appreciated. I added my current code at the end.

EDIT: The mobile compatibility issue has been resolved. The hide/show issue has not been resolved yet.

The following images contain the question in this inquiry. The mobile view is also not compatible.

Question before any selection:

Question with selection and text entry box showing:

Question with a different selection and text entry box show:

Mobile Preview:

The code below is what I have currently:

```<code>Qualtrics.SurveyEngine.addOnload(function()
{

var textInputs = jQuery("#"+this.questionId+" .InputText").css("float","none");
    textInputs.eq(0).before("$ ").after(" hourly");
    textInputs.eq(1).before("$ ").after(" annually");
    textInputs.eq(2).after(" %");

var QID= this.questionId;
    jQuery("#"+this.questionId+" input[type='text']").attr('type', 'tel');
    jQuery("#" + QID + " .InputText ").hide();
     jQuery("#" + QID + " input[type='radio']").each(function(){

            if(jQuery(this).prop("checked") == true)
            {
                var v1 = jQuery(this).attr("id");
                jQuery("[id*='"+v1+"~TEXT']").show();
                }
           else
           {
            var v1 = jQuery(this).attr("id");
            jQuery("[id*='"+v1+"~TEXT']").val('');
            jQuery("[id*='"+v1+"~TEXT']").hide();
         }
     });

  jQuery("#" + QID + " .Selection ").on("click change",function(){

       jQuery("#" + QID + " input[type='radio']").each(function(){

            if(jQuery(this).prop("checked") == true)
            {
                    var v1 = jQuery(this).attr("id");
                jQuery("[id*='"+v1+"~TEXT']").show();
                }
           else
           {
            var v1 = jQuery(this).attr("id");
            jQuery("[id*='"+v1+"~TEXT']").val('');
            jQuery("[id*='"+v1+"~TEXT']").hide();
         }
     });
});
});

  jQuery("#" + QID + " .Selection ").on("click change",function(){

       jQuery("#" + QID + " input[type='radio']").each(function(){

            if(jQuery(this).prop("checked") == true)
            {
                    var v1 = jQuery(this).attr("id");
                jQuery("[id*='"+v1+"~TEXT']").show();
                }
           else
           {
            var v1 = jQuery(this).attr("id");
            jQuery("[id*='"+v1+"~TEXT']").val('');
            jQuery("[id*='"+v1+"~TEXT']").hide();
         }
     });
});

Qualtrics.SurveyEngine.addOnReady(function()
{
    /*Place your JavaScript here to run when the page is fully displayed*/

});

Qualtrics.SurveyEngine.addOnUnload(function()
{
    /*Place your JavaScript here to run when the page is unloaded*/

});
</code>```
```<code><style>
@media (max-width: 480px){ #QID23 .InputText { width: 20% !important; } }
</style>
</code>```

Body:
I am new to coding and qualtrics in general. In sort of a time crunch but slowly teaching myself the basics of html currently.

I have a survey question that consist of a single choice MC question with three choices available. Each choice has a text entry box that appears for the choice selected. A hide/show function essentially. However, I am needing to add difference prefixes and suffixes for the text entry boxes like "$" and "annually". I am having an issue where the prefixes and suffixes appear before the choice is selected and the text entry box does not appear till you select the choice. Pictures below. The mobile picture at the very end also does not fit correctly. Any help is appreciated. I added my current code at the end.

EDIT: The mobile compatibility issue has been resolved. The hide/show issue has not been resolved yet.

The following images contain the question in this inquiry. The mobile view is also not compatible.

Question before any selection:

Question with selection and text entry box showing:

Question with a different selection and text entry box show:

Mobile Preview:

The code below is what I have currently:

Qualtrics.SurveyEngine.addOnload(function()
{

var textInputs = jQuery("#"+this.questionId+" .InputText").css("float","none");
    textInputs.eq(0).before("$ ").after(" hourly");
    textInputs.eq(1).before("$ ").after(" annually");
    textInputs.eq(2).after(" %");

var QID= this.questionId;
    jQuery("#"+this.questionId+" input[type='text']").attr('type', 'tel');
    jQuery("#" + QID + " .InputText ").hide();
     jQuery("#" + QID + " input[type='radio']").each(function(){

            if(jQuery(this).prop("checked") == true)
            {
                var v1 = jQuery(this).attr("id");
                jQuery("[id*='"+v1+"~TEXT']").show();
                }
           else
           {
            var v1 = jQuery(this).attr("id");
            jQuery("[id*='"+v1+"~TEXT']").val('');
            jQuery("[id*='"+v1+"~TEXT']").hide();
         }
     });

  jQuery("#" + QID + " .Selection ").on("click change",function(){

       jQuery("#" + QID + " input[type='radio']").each(function(){

            if(jQuery(this).prop("checked") == true)
            {
                    var v1 = jQuery(this).attr("id");
                jQuery("[id*='"+v1+"~TEXT']").show();
                }
           else
           {
            var v1 = jQuery(this).attr("id");
            jQuery("[id*='"+v1+"~TEXT']").val('');
            jQuery("[id*='"+v1+"~TEXT']").hide();
         }
     });
});
});

  jQuery("#" + QID + " .Selection ").on("click change",function(){

       jQuery("#" + QID + " input[type='radio']").each(function(){

            if(jQuery(this).prop("checked") == true)
            {
                    var v1 = jQuery(this).attr("id");
                jQuery("[id*='"+v1+"~TEXT']").show();
                }
           else
           {
            var v1 = jQuery(this).attr("id");
            jQuery("[id*='"+v1+"~TEXT']").val('');
            jQuery("[id*='"+v1+"~TEXT']").hide();
         }
     });
});

Qualtrics.SurveyEngine.addOnReady(function()
{
    /*Place your JavaScript here to run when the page is fully displayed*/

});

Qualtrics.SurveyEngine.addOnUnload(function()
{
    /*Place your JavaScript here to run when the page is unloaded*/

});


问:
How to check if the words from voice search are contained in array
I'm a newbie in learning JS and have been stuck for five days now trying to solve this problem.
I want to be able to play the song that  in its title includes  the words said by User with Voice search .
For now I have response 'Playing ... song', but only if I say the name of the first song, for the other two it doesn't work.

```<code>// Response
function playingChoosenSong(message) {
  const speech = new SpeechSynthesisUtterance();

  speech.text = "I didn't catch that, can you repeat?";

  const contains = songs.some((element) => {
    if (message.includes(element)) {
      speech.text = `Playing ${element}`;
      loadSong(element);
      playSong();
    }
  });

  window.speechSynthesis.speak(speech);
}

</code>```

Thank you for your time!

Body:
I'm a newbie in learning JS and have been stuck for five days now trying to solve this problem.
I want to be able to play the song that  in its title includes  the words said by User with Voice search .
For now I have response 'Playing ... song', but only if I say the name of the first song, for the other two it doesn't work.

// Response
function playingChoosenSong(message) {
  const speech = new SpeechSynthesisUtterance();

  speech.text = "I didn't catch that, can you repeat?";

  const contains = songs.some((element) => {
    if (message.includes(element)) {
      speech.text = `Playing ${element}`;
      loadSong(element);
      playSong();
    }
  });

  window.speechSynthesis.speak(speech);
}

Thank you for your time!


问:
Opening a PDF file which is a resource file embedded within a WPF application
I am trying to open a PDF file which is a resource file embedded within my WPF application.
The resource file is marked as a Resource for build action and also as do not copy. I am doing below without success. I am not able to build the Uri based on the embedded resource file:

```<code>        System.Windows.Controls.Frame frame = new System.Windows.Controls.Frame();
        System.Windows.Controls.WebBrowser browser = new System.Windows.Controls.WebBrowser();
        browser.Unloaded += Browser_Unloaded;
        Uri myUri = new Uri("pack://application:,,,/myApp;component/Resources/myPDFFile.pdf", UriKind.RelativeOrAbsolute);
        browser.Navigate(myUri);
        frame.Content = browser;
</code>```

And this is my method when PDF is unloaded:

```<code>    private void Browser_Unloaded(object sender, System.Windows.RoutedEventArgs e)
    {
        browser = frame.Content as System.Windows.Controls.WebBrowser;
        browser.Dispose();
        frame.Content = null;
    }
</code>```

Instead of a resource file embedded within the application, if I put the PDF somewhere in the disk and I specify the absolute path as "C:\Users\MyUser\Downloads\myPDFFile.pdf", then it works but I want the PDF file to be embedded within the application as a resource file and be able to open it.

It looks like the URI I have built is not correct, sure is failing pack://application:,,,/myApp;component/Resources/myPDFFile.pdf but I am not able to see why.

Body:
I am trying to open a PDF file which is a resource file embedded within my WPF application.
The resource file is marked as a Resource for build action and also as do not copy. I am doing below without success. I am not able to build the Uri based on the embedded resource file:

        System.Windows.Controls.Frame frame = new System.Windows.Controls.Frame();
        System.Windows.Controls.WebBrowser browser = new System.Windows.Controls.WebBrowser();
        browser.Unloaded += Browser_Unloaded;
        Uri myUri = new Uri("pack://application:,,,/myApp;component/Resources/myPDFFile.pdf", UriKind.RelativeOrAbsolute);
        browser.Navigate(myUri);
        frame.Content = browser;

And this is my method when PDF is unloaded:

    private void Browser_Unloaded(object sender, System.Windows.RoutedEventArgs e)
    {
        browser = frame.Content as System.Windows.Controls.WebBrowser;
        browser.Dispose();
        frame.Content = null;
    }

Instead of a resource file embedded within the application, if I put the PDF somewhere in the disk and I specify the absolute path as "C:\Users\MyUser\Downloads\myPDFFile.pdf", then it works but I want the PDF file to be embedded within the application as a resource file and be able to open it.

It looks like the URI I have built is not correct, sure is failing pack://application:,,,/myApp;component/Resources/myPDFFile.pdf but I am not able to see why.


问:
pd.crosstab not working for a categorical group
I am using Python 3 and replacing a few values, I tried to use pd.crosstab to table it but it does not show the categories. The categories are

```<code>Traditional     565
Other           221
French           97
Town House       70
Cottage          68
Contemporary     40
</code>```

May I know what code can I put to reslove this problem?

<pandas.io.formats.style.Styler object at 0x000002642AE9AA00>

I am just starting therefore I have no clue. What I expected from the result was it will show me the age which also has categorical values and the style.
Instead of this:
age Between 11 and 20 years Between 6 and 10 years  More than 20 years  Up to 5 years
row_0

<pandas.io.formats.style.Styler object at 0x000002791445EE80>   176 107 460 318

It'll be like this
age (Between 11 and 20 years) (Between 6 and 10 years) (More than 20 years) (Up to 5 years)

Traditional 176 107 460 318
Other             5      6       8        7
French            3      21      43     65
...
Contemporary     11      22       23     56

Body:
I am using Python 3 and replacing a few values, I tried to use pd.crosstab to table it but it does not show the categories. The categories are

Traditional     565
Other           221
French           97
Town House       70
Cottage          68
Contemporary     40

May I know what code can I put to reslove this problem?

<pandas.io.formats.style.Styler object at 0x000002642AE9AA00>

I am just starting therefore I have no clue. What I expected from the result was it will show me the age which also has categorical values and the style.
Instead of this:
age Between 11 and 20 years Between 6 and 10 years  More than 20 years  Up to 5 years
row_0

<pandas.io.formats.style.Styler object at 0x000002791445EE80>   176 107 460 318

It'll be like this
age (Between 11 and 20 years) (Between 6 and 10 years) (More than 20 years) (Up to 5 years)

Traditional 176 107 460 318
Other             5      6       8        7
French            3      21      43     65
...
Contemporary     11      22       23     56


问:
JMESPath Remove Time from Date
I am using JMESPath to query REST Api from a Fortigate Firewall. My query is here:

```<code>Licensing.forticare.support.hardware.[expires_r]
</code>```

Results:

```<code>[ "2025-12-04T00:00:00.000Z" ]
</code>```

How do I remove the T and everything after it so I am only left with a date? I have messed around with replace, but I think I need to convert it to a string before?

At the end of the day I would like the result to look like this:

```<code>[ "2025-12-04" ]
</code>```

Title: JMESPath Remove Time from Date

Body:
I am using JMESPath to query REST Api from a Fortigate Firewall. My query is here:

Licensing.forticare.support.hardware.[expires_r]

Results:

[ "2025-12-04T00:00:00.000Z" ]

How do I remove the T and everything after it so I am only left with a date? I have messed around with replace, but I think I need to convert it to a string before?

At the end of the day I would like the result to look like this:

[ "2025-12-04" ]


问:
Remote SSH creates many folders with multiple code cli under ~/.vscode-server/bin
I use Remote SSH to connect to my remote Ubuntu machines. I enjoy this flow a lot until recently, one of my small EC2 instances ran out of space. I then found many folders under ~/.vscode-server/bin. Each folder has its own code cli and extension folders. I wonder if there is a way I can suppress such behavior with VSCode. Maybe this is simply a bug with VSCode? I appreciate your help.

Btw, my VSCode should be the latest version.

Since I am the only user of my Ubuntu machines, I expect a single folder under ~/.vscode-server/bin.


问:
All CSS Flip Cards going to the same position
So I'm trying to achieve the affect of a flippable card when its clicked, I'm so close and just need a little bit of help for the last steps.

Whenever I click on any of the cards they all make their way to that first position regardless.

I have a feeling it's due to me not using position: absolute; like the guy I'm referencing did. However, when I do use this my cards disappear to other parts of the site

Here is my current CSS

```<code>    .scene {
        display: inline-block;
        width: 200px;
        height: 260px;
      /*   border: 1px solid #CCC; */
        margin: 40px 0;
        perspective: 600px;
      }

    .card {
        position: relative;
        width: 100%;
        height: 100%;
        cursor: pointer;
        transform-style: preserve-3d;
        transform-origin: center right;
        transition: transform 1s;
      }

    .card.is-flipped {
        transform: translateX(-100%) rotateY(-180deg);
    }

    .server_info {
        position: absolute;
        width: 100%;
        height: 100%;
        /* line-height: 260px; */
        color: white;
        text-align: center;
        /* font-weight: bold; */
        /* font-size: 40px; */
        backface-visibility: hidden;
    }

    .server_info--back {
        position: absolute;
        background-color: black;
        transform: rotateY(180deg);
    }
</code>```

and here is the respective HTML/EJS (per card)

<%= server_data[i].map %>

 <%= server_data[i].time %> in <%= server_data[i].map.charAt(0).toUpperCase() + server_data[i].map.slice(1) %>

  <%= server_data[i].night_accel %>x Nightime Acceleration

  <%= server_data[i].day_accel %>x Daytime Acceleration

  <%= server_data[i].mod_count %> Mods

                                            <%= server_data[i].online_players %>
Players Online

                                        <% if(server_data[i].online) { %>

<%= server_data[i].map.charAt(0).toUpperCase() + server_data[i].map.slice(1) %> is currently online <%= server_data[i].status_emoji %>

                                        <% } else { %>

<%= server_data[i].map.charAt(0).toUpperCase() + server_data[i].map.slice(1) %> is currently offline, this may be due to a restart or server update <%= server_data[i].status_emoji %>

                                        <% } %>

                                            " class="bttn-white">Connect

View online players

<%= server_data[i].map %> SIDE 2

 <%= server_data[i].time %> in <%= server_data[i].map.charAt(0).toUpperCase() + server_data[i].map.slice(1) %>

  <%= server_data[i].night_accel %>x Nightime Acceleration

  <%= server_data[i].day_accel %>x Daytime Acceleration

  <%= server_data[i].mod_count %> Mods

                                            <%= server_data[i].online_players %>
Players Online

                                        <% if(server_data[i].online) { %>

<%= server_data[i].map.charAt(0).toUpperCase() + server_data[i].map.slice(1) %> is currently online <%= server_data[i].status_emoji %>

                                        <% } else { %>

<%= server_data[i].map.charAt(0).toUpperCase() + server_data[i].map.slice(1) %> is currently offline, this may be due to a restart or server update <%= server_data[i].status_emoji %>

                                        <% } %>

                                            " class="bttn-white">Connect

View online players

```

Any help is appreciated, thanks!

Body:
So I'm trying to achieve the affect of a flippable card when its clicked, I'm so close and just need a little bit of help for the last steps.

Whenever I click on any of the cards they all make their way to that first position regardless.

I have a feeling it's due to me not using position: absolute; like the guy I'm referencing did. However, when I do use this my cards disappear to other parts of the site

Here is my current CSS

    .scene {
        display: inline-block;
        width: 200px;
        height: 260px;
      /*   border: 1px solid #CCC; */
        margin: 40px 0;
        perspective: 600px;
      }

    .card {
        position: relative;
        width: 100%;
        height: 100%;
        cursor: pointer;
        transform-style: preserve-3d;
        transform-origin: center right;
        transition: transform 1s;
      }

    .card.is-flipped {
        transform: translateX(-100%) rotateY(-180deg);
    }

    .server_info {
        position: absolute;
        width: 100%;
        height: 100%;
        /* line-height: 260px; */
        color: white;
        text-align: center;
        /* font-weight: bold; */
        /* font-size: 40px; */
        backface-visibility: hidden;
    }

    .server_info--back {
        position: absolute;
        background-color: black;
        transform: rotateY(180deg);
    }

and here is the respective HTML/EJS (per card)

<%= server_data[i].map %>

 <%= server_data[i].time %> in <%= server_data[i].map.charAt(0).toUpperCase() + server_data[i].map.slice(1) %>

  <%= server_data[i].night_accel %>x Nightime Acceleration

  <%= server_data[i].day_accel %>x Daytime Acceleration

  <%= server_data[i].mod_count %> Mods

                                            <%= server_data[i].online_players %>
Players Online

                                        <% if(server_data[i].online) { %>

<%= server_data[i].map.charAt(0).toUpperCase() + server_data[i].map.slice(1) %> is currently online <%= server_data[i].status_emoji %>

                                        <% } else { %>

<%= server_data[i].map.charAt(0).toUpperCase() + server_data[i].map.slice(1) %> is currently offline, this may be due to a restart or server update <%= server_data[i].status_emoji %>

                                        <% } %>

                                            <a href="<%= server_data[i].connect %>" class="bttn-white">Connect

View online players

<%= server_data[i].map %> SIDE 2

 <%= server_data[i].time %> in <%= server_data[i].map.charAt(0).toUpperCase() + server_data[i].map.slice(1) %>

  <%= server_data[i].night_accel %>x Nightime Acceleration

  <%= server_data[i].day_accel %>x Daytime Acceleration

  <%= server_data[i].mod_count %> Mods

                                            <%= server_data[i].online_players %>
Players Online

                                        <% if(server_data[i].online) { %>

<%= server_data[i].map.charAt(0).toUpperCase() + server_data[i].map.slice(1) %> is currently online <%= server_data[i].status_emoji %>

                                        <% } else { %>

<%= server_data[i].map.charAt(0).toUpperCase() + server_data[i].map.slice(1) %> is currently offline, this may be due to a restart or server update <%= server_data[i].status_emoji %>

                                        <% } %>

                                            <a href="<%= server_data[i].connect %>" class="bttn-white">Connect

View online players

Any help is appreciated, thanks!


问:
Manipulate HTTPS packets and forward them
TLS is used for ensuring confidentiality and integrity of the packet contents. How can I sniff, manipulate and forward HTTPS packets in order to find out if the machine/device receiving these manipulated packets (e.g. an update file) checks the integrity?

I have already tried to find useful sources and I have found e.g. Bettercap for MitM-attacks which also is able to manipulate for example JavaScript of (HTTP-requested) websites but I do not get how to manipulate HTTPS packets.


问:
How to call toHaveBeenCalledTimes in jest on condition
I am trying to call a function and checking it with toHaveBeenCalledTimes whether it has been called or not in jest, that function runs on a condition, how I can check it on condition?</p>


问:
Plotly append multiple subplot figures into single figure
I am trying to append a plotly subplot figure as a single figure to another subplot figure (masterFig) in a for loop. (approach 1)

The only other approach I can think for this problem is instead of appending a subplot figure is appending a single trace at a time to the masterFig. (approach 2)

The first approach would be much cleaner and nicer to work with

Approach 1:

```<code>    masterFig = make_subplots(
        rows=len(df['symbol'].unique()),
        cols=1,
        shared_xaxes=True)

    for sym in df['symbol'].unique():
        fig = make_subplots(rows=6, cols=1, shared_xaxes=True, specs=[[{"rowspan": 3}], [{}], [{}], [{}], [{}], [{}]])
        fig.add_trace(go.Candlestick(), row=1, col=1)
        fig.add_trace(go.Scatter(), row=1, col=1)
        fig.add_trace(go.Scatter(), row=1, col=1)
        fig.add_trace(go.Bar(), row=4, col=1)
        fig.add_trace(go.Bar(), row=5, col=1)
        fig.add_trace(go.Bar(), row=6, col=1)
        fig.update_layout(hovermode="x unified", template='plotly_dark', xaxis_rangeslider_visible=False, height=1200)
        masterFig.append(fig)

    return masterFig
</code>```

Approach 2 (Working code I have for other things, however it only takes a fixed amount of figures and does not allow me to generate a figure for each item in a for loop).

```<code>masterFig = make_subplots(
    rows=len(df['symbol'].unique()),
    cols=1,
    shared_xaxes=True)

for sym in df['symbol'].unique():
    figures = [
        px.bar(),
        px.bar(),
        px.bar(),
        px.bar(),
        ]

    for i, figure in enumerate(figures):
        for trace in range(len(figure["data"])):
            masterFig.append_trace(figure["data"][trace], row=i+1, col=1)

return masterFig
</code>```

I want to try to use approach 1, as it allows for easy formatting of the subplot figure within the for loop.

Really appreciate any ideas, thank you.

Body:
I am trying to append a plotly subplot figure as a single figure to another subplot figure (masterFig) in a for loop. (approach 1)

The only other approach I can think for this problem is instead of appending a subplot figure is appending a single trace at a time to the masterFig. (approach 2)

The first approach would be much cleaner and nicer to work with

Approach 1:

    masterFig = make_subplots(
        rows=len(df['symbol'].unique()),
        cols=1,
        shared_xaxes=True)

    for sym in df['symbol'].unique():
        fig = make_subplots(rows=6, cols=1, shared_xaxes=True, specs=[[{"rowspan": 3}], [{}], [{}], [{}], [{}], [{}]])
        fig.add_trace(go.Candlestick(), row=1, col=1)
        fig.add_trace(go.Scatter(), row=1, col=1)
        fig.add_trace(go.Scatter(), row=1, col=1)
        fig.add_trace(go.Bar(), row=4, col=1)
        fig.add_trace(go.Bar(), row=5, col=1)
        fig.add_trace(go.Bar(), row=6, col=1)
        fig.update_layout(hovermode="x unified", template='plotly_dark', xaxis_rangeslider_visible=False, height=1200)
        masterFig.append(fig)

    return masterFig

Approach 2 (Working code I have for other things, however it only takes a fixed amount of figures and does not allow me to generate a figure for each item in a for loop).

masterFig = make_subplots(
    rows=len(df['symbol'].unique()),
    cols=1,
    shared_xaxes=True)

for sym in df['symbol'].unique():
    figures = [
        px.bar(),
        px.bar(),
        px.bar(),
        px.bar(),
        ]

    for i, figure in enumerate(figures):
        for trace in range(len(figure["data"])):
            masterFig.append_trace(figure["data"][trace], row=i+1, col=1)

return masterFig

I want to try to use approach 1, as it allows for easy formatting of the subplot figure within the for loop.

Really appreciate any ideas, thank you.