问:
Why transform: scale() seems to be translateX?
I use framer-motion with next params:

```<code>  whileHover={{ scale: 1.05 }}
  whileTap={{ scale: 0.95 }}
</code>```

But instead of scaling it seems to be translating by X.

This item has next css properties:

```<code>display: flex;
flex-direction: column;
margin-left: 50px;
</code>```

look a video:

https://www.awesomescreenshot.com/video/13121928?key=24fb66bc4fd804516e16d34aaf573a84

Body:
I use framer-motion with next params:

  whileHover={{ scale: 1.05 }}
  whileTap={{ scale: 0.95 }}

But instead of scaling it seems to be translating by X.

This item has next css properties:

display: flex;
flex-direction: column;
margin-left: 50px;

look a video:

https://www.awesomescreenshot.com/video/13121928?key=24fb66bc4fd804516e16d34aaf573a84


来源: stackexchange

问:
Time Series forecasting with Bidirectional LSTMs
I have implemented a Bidirectional LSTM which predicts a certain profile by using a windowing input in tensorflow. Conceptually it makes sense to me during the training phase.

Once the model is trained I use it to predict future and evaluate against a test set. However, I am unsure what happens to the backward LSTM cells that were originally trained with information passed from future to past. Does the network first do a forward pass in time and then a backward pass to give an output? Could someone please elaborate how does the network work in testing phase.

Network architecture

Thanks in advance.

I have tried to find some resources online but couldn't find a convincing answer

ContentLicense: CC BY-SA 4.0


问:
How to make intentfilter that way to open app immediately
Currently i have deep linking and everything works good, how ever when user scan the application he can choose to open with MyApp or any browser Chrome for example. How i can prevent that so it can be open only with MyApp if is installed. Here is how my config looks like:

```<code> intentFilters: [
            {
              action: 'VIEW',
              autoVerify: true,
              data: [
                {
                  scheme: 'https',
                  host: '*1b1.art',
                  pathPrefix: '/claim',
                },
              ],
              category: ['BROWSABLE', 'DEFAULT'],
            },
          ],
</code>```

any ideas, thanks!

Body:
Currently i have deep linking and everything works good, how ever when user scan the application he can choose to open with MyApp or any browser Chrome for example. How i can prevent that so it can be open only with MyApp if is installed. Here is how my config looks like:

 intentFilters: [
            {
              action: 'VIEW',
              autoVerify: true,
              data: [
                {
                  scheme: 'https',
                  host: '*1b1.art',
                  pathPrefix: '/claim',
                },
              ],
              category: ['BROWSABLE', 'DEFAULT'],
            },
          ],

any ideas, thanks!


问:
Confluent Kafka configure initial connection retry timeout
I have a go project with confluent Kafka and I want to change it's initial connection timeout. If the kafka is not available on the first try I want to retry connecting to it every few seconds and give up retrying after 10 min.

By default it is repeatedly trying to connect to Kafka without break, I am getting the following log over again: [thrd:localhost:9092/bootstrap]: localhost:9092/bootstrap: Connect to ipv6#[::1]:9092 failed: Connection refused (after 1ms in state CONNECT)
(sometimes lightly different eg ipv4 instead of ipv6 and 0ms or 2ms instead of 1ms)

I've tried the following configurations but none of them seems to work

```<code>    conf := kafka.ConfigMap{
        "bootstrap.servers":      fmt.Sprintf("%s:%d", kafkaHost, kafkaPort),
        "group.id":               "billing",
        "auto.offset.reset":      "earliest",
        "go.logs.channel.enable": true,

        "heartbeat.interval.ms":              10000,
        "session.timeout.ms":                 10000,
        "connections.max.idle.ms":            10000,
        "max.poll.interval.ms":               10000,
        "socket.connection.setup.timeout.ms": 10000,
        "auto.commit.interval.ms":            10000,
        "metadata.max.age.ms":                100000,
        "reconnect.backoff.max.ms":           100000,
        "reconnect.backoff.ms":               10000,
    }
</code>```

I am able to connect to Kafka normally when it is running in a docker compose. Right now I only want to handle the case when it's down.

Body:
I have a go project with confluent Kafka and I want to change it's initial connection timeout. If the kafka is not available on the first try I want to retry connecting to it every few seconds and give up retrying after 10 min.

By default it is repeatedly trying to connect to Kafka without break, I am getting the following log over again: [thrd:localhost:9092/bootstrap]: localhost:9092/bootstrap: Connect to ipv6#[::1]:9092 failed: Connection refused (after 1ms in state CONNECT)
(sometimes lightly different eg ipv4 instead of ipv6 and 0ms or 2ms instead of 1ms)

I've tried the following configurations but none of them seems to work

    conf := kafka.ConfigMap{
        "bootstrap.servers":      fmt.Sprintf("%s:%d", kafkaHost, kafkaPort),
        "group.id":               "billing",
        "auto.offset.reset":      "earliest",
        "go.logs.channel.enable": true,

        "heartbeat.interval.ms":              10000,
        "session.timeout.ms":                 10000,
        "connections.max.idle.ms":            10000,
        "max.poll.interval.ms":               10000,
        "socket.connection.setup.timeout.ms": 10000,
        "auto.commit.interval.ms":            10000,
        "metadata.max.age.ms":                100000,
        "reconnect.backoff.max.ms":           100000,
        "reconnect.backoff.ms":               10000,
    }

I am able to connect to Kafka normally when it is running in a docker compose. Right now I only want to handle the case when it's down.


问:
SESSION MERGE new record on changes for specific columns
Let's say my User Database has this record already inserted

```<code>[id=1, name="GRIZZLY BEAR", age= 20, run_id=49019]
</code>```

The behavior I want upon a new insert is the following:

If primary key value [id] already exists in the DB

Check to see if there's a change on any column BUT the [run_id]
column

If there's a change, merge the changes including the new [run_id] value

If it doesn't exist

Insert new Record

Example 1 :
Causing no change in DB record:

```<code>o = User(id=1, name="GRIZZLY BEAR", age= 20, run_id=49020)
session.merge(o)
</code>```

Example 2:
Causing a change in DB record to be [id=1, name="GRIZZLY BEAR", age= 19, run_id=49020]

```<code>o = User(id=1, name="GRIZZLY BEAR", age= 19, run_id=49020)
session.merge(o)
</code>```

SQLAlchemy merge checks for every column so the run_id in the first example will cause an update automatically, which is a behavior I don't want.

Do I have to make my own SQL merge query and execute it using SQLAlchemy or is there a way to use the built-in fn automatically and say detect changes on specific columns.

Body:
Let's say my User Database has this record already inserted

[id=1, name="GRIZZLY BEAR", age= 20, run_id=49019]

The behavior I want upon a new insert is the following:

If primary key value [id] already exists in the DB

Check to see if there's a change on any column BUT the [run_id]
column

If there's a change, merge the changes including the new [run_id] value

If it doesn't exist

Insert new Record

Example 1 :
Causing no change in DB record:

o = User(id=1, name="GRIZZLY BEAR", age= 20, run_id=49020)
session.merge(o)

Example 2:
Causing a change in DB record to be [id=1, name="GRIZZLY BEAR", age= 19, run_id=49020]

o = User(id=1, name="GRIZZLY BEAR", age= 19, run_id=49020)
session.merge(o)

SQLAlchemy merge checks for every column so the run_id in the first example will cause an update automatically, which is a behavior I don't want.

Do I have to make my own SQL merge query and execute it using SQLAlchemy or is there a way to use the built-in fn automatically and say detect changes on specific columns.


问:
How can we add multiple taxonomies slugs in shortcode
I have created Custom Post and Taxonomy using WCK plugin. And also created multiple slugs taxonomy.

I want to display multiple slugs results using shortcode

Ex: [testimonial city="abc, efg"]

Thanks in Advance.

Any references should appreciated.

Thanks


问:
Export an html to PDF in Django application with charts
I have a Django application, and I want to provide 'export to pdf' functionality on all pages, (Note: all pages have images).
I saw multiple tutorials on the topic, there are two ways: either write your pdf on your own or provide an HTML file path and context dictionary (which is difficult for me to provide).
I need something like the following:
button -> some_url -> some_view_function -> get all content from requesting page -> show the pdf content to the user in a separate window so the user can save it.</p>


问:
How to Access the data inside the JSON object. Some of my columns in pyspark dataframe is in JSON format
I was trying to access the data inside object. The table is in pyspark dataframe, but some table values are in JSON format. I need t access the date from it and convert into meaningful format. Any help or idea will be great relief.

This is thing i'm working out:

I was able to extract  data which are in array format using:

```<code>data_df=df_deidentifieddocuments_tst.select("_id",explode("annotationId").alias("annotationId")).select("_id","annotationId.*")
</code>```

The above code doesn't work for date, as its showing type mismatch error

AnalysisException: cannot resolve 'explode(createdAt)' due to data type mismatch: input to function explode should be array or map type, not struct<$date:bigint>;

Body:
I was trying to access the data inside object. The table is in pyspark dataframe, but some table values are in JSON format. I need t access the date from it and convert into meaningful format. Any help or idea will be great relief.

This is thing i'm working out:

I was able to extract  data which are in array format using:

data_df=df_deidentifieddocuments_tst.select("_id",explode("annotationId").alias("annotationId")).select("_id","annotationId.*")

The above code doesn't work for date, as its showing type mismatch error

AnalysisException: cannot resolve 'explode(createdAt)' due to data type mismatch: input to function explode should be array or map type, not struct<$date:bigint>;


问:
Pcolormesh plots entire plot as white if it has a single value
I want to visualize some data across multiple dimensions, and so for each of the dimensions I plot a pcolormesh. However, if in any dimension, all values are the same, pcolormesh appears to just plot a white area. How can I fix this?

To reproduce what I mean, here is some sample data

```<code>import numpy as np
** create some data
x_grid = np.linspace(1, 3, 10)
y_grid = np.linspace(10, 30, 8)
X, Y = np.meshgrid(x_grid, y_grid, indexing='ij')
cmap = cm.get_cmap("Greys", lut=2)

* second dimension has no variation in Z
Z = X * 0
Z[x_grid > 1] = 1
Z2 = X * 0 + 1
</code>```

And here, my attempt to plot it

```<code>import matplotlib.pyplot as plt
import matplotlib.cm as cm

fig, axes = plt.subplots(2)
pc1 = axes[0].pcolormesh(y_grid, x_grid, Z, cmap=cmap, shading='auto')
axes[1].pcolormesh(y_grid, x_grid, Z2, cmap=cmap, shading='auto')
cb = fig.colorbar(pc1, ax=axes[1], location='bottom')
cb.set_ticks([0.25, 0.75])
cb.set_ticklabels(['Value = 0', 'Value = 1'])
</code>```

Clearly, the mapping is {0 -> white, 1 -> black}. This works correctly in the first panel, but not so much in the second one.

Presumably, I could just add a single value in some corner, but that feels very hacky (and is a wrong depiction of the data). Also, this worries my about my entire approach. I thought that I am assigning unique colors to integer values using my attempt here. What if my data is not binary, but instead has 4 outcomes. If the first panel were to show 4 different values, but the second panel only 3 different values, would the mapping still be consistent across panels?

Body:
I want to visualize some data across multiple dimensions, and so for each of the dimensions I plot a pcolormesh. However, if in any dimension, all values are the same, pcolormesh appears to just plot a white area. How can I fix this?

To reproduce what I mean, here is some sample data

import numpy as np
** create some data
x_grid = np.linspace(1, 3, 10)
y_grid = np.linspace(10, 30, 8)
X, Y = np.meshgrid(x_grid, y_grid, indexing='ij')
cmap = cm.get_cmap("Greys", lut=2)

* second dimension has no variation in Z
Z = X * 0
Z[x_grid > 1] = 1
Z2 = X * 0 + 1

And here, my attempt to plot it

import matplotlib.pyplot as plt
import matplotlib.cm as cm

fig, axes = plt.subplots(2)
pc1 = axes[0].pcolormesh(y_grid, x_grid, Z, cmap=cmap, shading='auto')
axes[1].pcolormesh(y_grid, x_grid, Z2, cmap=cmap, shading='auto')
cb = fig.colorbar(pc1, ax=axes[1], location='bottom')
cb.set_ticks([0.25, 0.75])
cb.set_ticklabels(['Value = 0', 'Value = 1'])

Clearly, the mapping is {0 -> white, 1 -> black}. This works correctly in the first panel, but not so much in the second one.

Presumably, I could just add a single value in some corner, but that feels very hacky (and is a wrong depiction of the data). Also, this worries my about my entire approach. I thought that I am assigning unique colors to integer values using my attempt here. What if my data is not binary, but instead has 4 outcomes. If the first panel were to show 4 different values, but the second panel only 3 different values, would the mapping still be consistent across panels?


问:
ImportError: blis.cy does not export expected C function sgemm
I have installed spacy in my anaconda prompt using

```<code>conda install -c conda-forge spacy
</code>```

but, when i try to import in jupyter notebook :
import spacy
the result is like this:

```<code>**ImportError: blis.cy does not export expected C function sgemm**

</code>```

please how to solve this?

i tried to reinstall but still no progress

Body:
I have installed spacy in my anaconda prompt using

conda install -c conda-forge spacy

but, when i try to import in jupyter notebook :
import spacy
the result is like this:

**ImportError: blis.cy does not export expected C function sgemm**

please how to solve this?

i tried to reinstall but still no progress


问:
When garbage collector decides to clean inpustream object?
Current short question for REST API app.

Let's suppose we have Map<String, List> files4users in @Component class.

This map contains name of user and connected csv file that the user can download.
So an user can download the file anytime.

But what if an user already downloaded the file and we want to exclude this file for usage to clean memory.

Is there some option how we can handle this? For example when user call REST API download/data --> we return ResponseEntity with this kind of file.

How can we quarantee that garbage collector will clean this inputstream? Let's imagine that the file is 500MB.

Thanks.


问:
Prohibit resetting the password from service users in keycloak web console
Can I somehow prevent a service user with the manage-users role from resetting the password to other users, but at the same time leave the option to block other users?

Roles

Prohibit:
Credentials

Keep allow:
Allow

At the moment I have not found whether it is possible to prohibit editing credentials


问:
"RangeError: Maximum call stack size exceeded" when trying to use Jest with Mongoose and MongoMemoryServer
I'm trying to test my express app using Jest. Anytime I run my test I get the following error that is somehow connected to MongoDB but I can't figure out what exactly I have to do to solve this problem:

```<code> FAIL  src/routes/__test__/signUp.test.ts
  ● Test suite failed to run

    RangeError: Maximum call stack size exceeded

      at Object.get [as ObjectId] (node_modules/mongodb/src/bson.ts:39:3)
      at Object.get [as ObjectId] (node_modules/mongodb/src/bson.ts:39:3)
      at Object.get [as ObjectId] (node_modules/mongodb/src/bson.ts:39:3)
</code>```

Here is the test:

```<code>import request from 'supertest';
import { app } from 'app';

it('Returns a 201 on successful signup', async () => {
  return request(app)
    .post('/api/users/signup')
    .send({
      email: 'test@test.com',
      password: 'password',
    })
    .expect(201);
});
</code>```

I also have some setup for my tests, maybe the problem is hiding somewhere here:

```<code>import mongoose from 'mongoose';
import { MongoMemoryServer } from 'mongodb-memory-server';

let mongo: MongoMemoryServer;

beforeAll(async () => {
  process.env.JWT_KEY = 'whateverfornow';

  mongo = await MongoMemoryServer.create();
  const mongoUri = mongo.getUri();

  await mongoose.connect(mongoUri, {});
});

beforeEach(async () => {
  const collections = await mongoose.connection.db.collections();

  for (let collection of collections) {
    await collection.deleteMany({});
  }
});

afterAll(async () => {
  if (mongo) {
    await mongo.stop();
  }

  await mongoose.connection.close();
});
</code>```

Body:
I'm trying to test my express app using Jest. Anytime I run my test I get the following error that is somehow connected to MongoDB but I can't figure out what exactly I have to do to solve this problem:

 FAIL  src/routes/__test__/signUp.test.ts
  ● Test suite failed to run

    RangeError: Maximum call stack size exceeded

      at Object.get [as ObjectId] (node_modules/mongodb/src/bson.ts:39:3)
      at Object.get [as ObjectId] (node_modules/mongodb/src/bson.ts:39:3)
      at Object.get [as ObjectId] (node_modules/mongodb/src/bson.ts:39:3)

Here is the test:

import request from 'supertest';
import { app } from 'app';

it('Returns a 201 on successful signup', async () => {
  return request(app)
    .post('/api/users/signup')
    .send({
      email: 'test@test.com',
      password: 'password',
    })
    .expect(201);
});

I also have some setup for my tests, maybe the problem is hiding somewhere here:

import mongoose from 'mongoose';
import { MongoMemoryServer } from 'mongodb-memory-server';

let mongo: MongoMemoryServer;

beforeAll(async () => {
  process.env.JWT_KEY = 'whateverfornow';

  mongo = await MongoMemoryServer.create();
  const mongoUri = mongo.getUri();

  await mongoose.connect(mongoUri, {});
});

beforeEach(async () => {
  const collections = await mongoose.connection.db.collections();

  for (let collection of collections) {
    await collection.deleteMany({});
  }
});

afterAll(async () => {
  if (mongo) {
    await mongo.stop();
  }

  await mongoose.connection.close();
});


问:
How to set yarn version for a specific project
I have 2 projects which I need to run parallely on my local machine. Problem is, one of the project is using Yarn 3 and other one is using Yarn 1.

Steps given on Yarn's website https://yarnpkg.com/getting-started/install, sets the version globally, due to which only one project runs at a time and other one fails.

Can somebody please help me configure yarn version to specific project?


问:
How to use google drive api v3 angular without gapi
I want to use the new version of Google Drive Api, because the old one is going to be deprecated in March 2023. However, I don't know how to use the Google Drive Api without the gapi library for downloading and exporting files.

I have been able to login and get my access_token, but then I'm stuck about how to proceed. I've checked their website, but there aren't any solution. The only solution they bring with javascript is the obsolete one.

Here is  my code to login

```<code>newLogin(){
this.pageInfo.client = google.accounts.oauth2.initTokenClient({
  client_id: 'myid',
  scope: 'https://www.googleapis.com/auth/drive',
  callback: (response) => {
    console.log(response);
  },
});
this.pageInfo.client.requestAccessToken();
</code>```

}

My question is about how could I proceed with Angular on download/exporting a document? If I use the gapi library, it tells  me that gapi doesen't exist (Because I have not load it due the deprectation)

Thanks

Body:
I want to use the new version of Google Drive Api, because the old one is going to be deprecated in March 2023. However, I don't know how to use the Google Drive Api without the gapi library for downloading and exporting files.

I have been able to login and get my access_token, but then I'm stuck about how to proceed. I've checked their website, but there aren't any solution. The only solution they bring with javascript is the obsolete one.

Here is  my code to login

newLogin(){
this.pageInfo.client = google.accounts.oauth2.initTokenClient({
  client_id: 'myid',
  scope: 'https://www.googleapis.com/auth/drive',
  callback: (response) => {
    console.log(response);
  },
});
this.pageInfo.client.requestAccessToken();

}

My question is about how could I proceed with Angular on download/exporting a document? If I use the gapi library, it tells  me that gapi doesen't exist (Because I have not load it due the deprectation)

Thanks


问:
Spring Cloud Stream Binder Issue when using both Rabbit MQ and Kafka
I am trying to create simple producer and consumer application with both kafka and rabbitmq I have controller for each I could run them as separate apps without any issue but when I combine code I get Binder Error

```<code>Failed to start bean 'inputBindingLifecycle'; nested exception is java.lang.IllegalStateException: A default binder has been requested, but there is more than one binder available for 'org.springframework.cloud.stream.messaging.DirectWithAttributesChannel' : kafka,rabbit, and no default binder has been set.
</code>```

How to configure the binders for both Kafka and Rabbit MQ

Here is my

application.yml

```<code>

spring:
  cloud:
    function:
      definition: consumer;producer
    stream:
       bindings:
        user-in-0:
          group: consumer
          destination: DestJson
          binder: rabbit
        sender-in-0:
          group: processor
          destination: DestJson
          binder: rabbit
        publisher-out-0:
          group: processor
          destination: DestJson
          binder: rabbit
        sender:
          content-type: application/x-java-object;com.messagebroker.poc.dtos.User
        sender-out-0:
          destination: DestJson
          group: consumer
          binder: rabbit
        user:
          content-type: application/json

        producer-out-0:
            producer:
              configuration:
                value.serializer: com.messagebroker.poc.serializer.MessageSerializer

        consumer-in-0:
            consumer:
              configuration:
                value.deserializer: com.messagebroker.poc.serializer.MessageDeSerializer
            binder:
             brokers: localhost:9092
        bindings:
               producer-out-0:
                  destination: ezzylink-kafka-topics
                  binder: kafka
                  producer:
                   useNativeEncoding: true
               consumer-in-0:
                   destination: kafka-topics
                   binder: kafka
                   consumer:
                    use-native-decoding: true

</code>```

pom.xml

```<code><properties>
        <java.version>17</java.version>
        <spring-cloud-gcp.version>3.4.0</spring-cloud-gcp.version>
        <spring-cloud.version>2021.0.5</spring-cloud.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <!--<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-validation</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
  <groupId>org.springframework.cloud</groupId>
  <artifactId>spring-cloud-stream-binder-kafka</artifactId>
      </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-stream-binder-rabbit</artifactId>
        </dependency>
       <dependency>
     <groupId>io.springfox</groupId>
    <artifactId>springfox-swagger2</artifactId>
    <version>2.9.2</version>
    </dependency>
    <dependency>
     <groupId>io.springfox</groupId>
    <artifactId>springfox-swagger-ui</artifactId>
    <version>2.9.2</version>
    </dependency>
        <!--<dependency>
            <groupId>com.google.cloud</groupId>
            <artifactId>spring-cloud-gcp-starter</artifactId>
        </dependency>-->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-stream</artifactId>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-stream</artifactId>
            <scope>test</scope>
            <classifier>test-binder</classifier>
            <type>test-jar</type>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <scope>test</scope>
        </dependency>
              <dependency>
       <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
      <version>2.8.5</version> <!-- check latest version for GSON -->
      </dependency>
    </dependencies>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.google.cloud</groupId>
                <artifactId>spring-cloud-gcp-dependencies</artifactId>
                <version>${spring-cloud-gcp.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
</code>```

Body:
I am trying to create simple producer and consumer application with both kafka and rabbitmq I have controller for each I could run them as separate apps without any issue but when I combine code I get Binder Error

Failed to start bean 'inputBindingLifecycle'; nested exception is java.lang.IllegalStateException: A default binder has been requested, but there is more than one binder available for 'org.springframework.cloud.stream.messaging.DirectWithAttributesChannel' : kafka,rabbit, and no default binder has been set.

How to configure the binders for both Kafka and Rabbit MQ

Here is my

application.yml

spring:
  cloud:
    function:
      definition: consumer;producer
    stream:
       bindings:
        user-in-0:
          group: consumer
          destination: DestJson
          binder: rabbit
        sender-in-0:
          group: processor
          destination: DestJson
          binder: rabbit
        publisher-out-0:
          group: processor
          destination: DestJson
          binder: rabbit
        sender:
          content-type: application/x-java-object;com.messagebroker.poc.dtos.User
        sender-out-0:
          destination: DestJson
          group: consumer
          binder: rabbit
        user:
          content-type: application/json

        producer-out-0:
            producer:
              configuration:
                value.serializer: com.messagebroker.poc.serializer.MessageSerializer

        consumer-in-0:
            consumer:
              configuration:
                value.deserializer: com.messagebroker.poc.serializer.MessageDeSerializer
            binder:
             brokers: localhost:9092
        bindings:
               producer-out-0:
                  destination: ezzylink-kafka-topics
                  binder: kafka
                  producer:
                   useNativeEncoding: true
               consumer-in-0:
                   destination: kafka-topics
                   binder: kafka
                   consumer:
                    use-native-decoding: true

pom.xml

<properties>
        <java.version>17</java.version>
        <spring-cloud-gcp.version>3.4.0</spring-cloud-gcp.version>
        <spring-cloud.version>2021.0.5</spring-cloud.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-validation</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
  <groupId>org.springframework.cloud</groupId>
  <artifactId>spring-cloud-stream-binder-kafka</artifactId>
      </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-stream-binder-rabbit</artifactId>
        </dependency>
       <dependency>
     <groupId>io.springfox</groupId>
    <artifactId>springfox-swagger2</artifactId>
    <version>2.9.2</version>
    </dependency>
    <dependency>
     <groupId>io.springfox</groupId>
    <artifactId>springfox-swagger-ui</artifactId>
    <version>2.9.2</version>
    </dependency>

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-stream</artifactId>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-stream</artifactId>
            <scope>test</scope>
            <classifier>test-binder</classifier>
            <type>test-jar</type>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <scope>test</scope>
        </dependency>
              <dependency>
       <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
      <version>2.8.5</version>
      </dependency>
    </dependencies>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.google.cloud</groupId>
                <artifactId>spring-cloud-gcp-dependencies</artifactId>
                <version>${spring-cloud-gcp.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>


问:
How to make a radial context menu with d3 and open a modal upon node creation?
I'm trying to make a context menu for adding, editing, deleting nodes and edges in a d3 network graph.

I haven't been able to find any examples of radial context menus nor have I seen examples on opening a modal between you click the "create node" menu item in the context menu, and it is added.

I need to specify some additional data when I add a node, which is why the modal is so important. The screenshots I made was taken from Arangodb that has this feature, so i was wondering if something similar can be done with d3?

There's generally not a whole lot of info about how to make context menus with d3.


问:
YOLOv5 and custom data training for object detection
I was working with with YOLOv5, I got it running, and now I want to train it. It already has pretrained datasets object detection. Is there anyway to permanently delete the previously trained classes from my program so that it does not detect those objects any longer?

I have tried all the things that came to my mind but nothing seems to be working. Some help will really mean a lot to me.

I tried creating a new yaml file for training
Tried deleting the old yaml file that it was trained on, (coco128.yaml)
Tried re training the old yaml file


问:
Could not read meta.json
I'm making a resume parser and facing an error.

Parser_1:

```<code>import os
import multiprocessing as mp
import io
import spacy
import pprint
from spacy.matcher import Matcher
import utils

class ResumeParser(object):

    def __init__(
        self,
        resume,
        skills_file=None,
        custom_regex=None
    ):
        nlp = spacy.load(r"C:\Users\Sauravi\env\Lib\site-packages\en_core_web_sm\en_core_web_sm-3.0.0")
        custom_nlp = spacy.load(os.path.dirname(os.path.abspath(__file__)))
        self.__skills_file = skills_file
        self.__custom_regex = custom_regex
        self.__matcher = Matcher(nlp.vocab)
        self.__details = {
            'name': None,
            'email': None,
            'mobile_number': None,
            'address': None,
            'skills': None,
            'college_name': None,
            'projects': None,
            'designation': None,
            'experience': None,
            'company_names': None,
            'no_of_pages': None,
            'total_experience': None,
        }
        self.__resume = resume
        if not isinstance(self.__resume, io.BytesIO):
            ext = os.path.splitext(self.__resume)[1].split('.')[1]
        else:
            ext = self.__resume.name.split('.')[1]
        self.__text_raw = utils.extract_text(self.__resume, '.' + ext)
        self.__text = ' '.join(self.__text_raw.split())
        self.__nlp = nlp(self.__text)
        self.__custom_nlp = custom_nlp(self.__text_raw)
        self.__noun_chunks = list(self.__nlp.noun_chunks)
        self.__get_basic_details()
</code>```

Error:

enter image description here

How do I solve this error?
I installed en_core_web_sm using https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.0.0/en_core_web_sm-3.0.0.tar.gz

Title: Could not read meta.json

Body:
I'm making a resume parser and facing an error.

Parser_1:

import os
import multiprocessing as mp
import io
import spacy
import pprint
from spacy.matcher import Matcher
import utils

class ResumeParser(object):

    def __init__(
        self,
        resume,
        skills_file=None,
        custom_regex=None
    ):
        nlp = spacy.load(r"C:\Users\Sauravi\env\Lib\site-packages\en_core_web_sm\en_core_web_sm-3.0.0")
        custom_nlp = spacy.load(os.path.dirname(os.path.abspath(__file__)))
        self.__skills_file = skills_file
        self.__custom_regex = custom_regex
        self.__matcher = Matcher(nlp.vocab)
        self.__details = {
            'name': None,
            'email': None,
            'mobile_number': None,
            'address': None,
            'skills': None,
            'college_name': None,
            'projects': None,
            'designation': None,
            'experience': None,
            'company_names': None,
            'no_of_pages': None,
            'total_experience': None,
        }
        self.__resume = resume
        if not isinstance(self.__resume, io.BytesIO):
            ext = os.path.splitext(self.__resume)[1].split('.')[1]
        else:
            ext = self.__resume.name.split('.')[1]
        self.__text_raw = utils.extract_text(self.__resume, '.' + ext)
        self.__text = ' '.join(self.__text_raw.split())
        self.__nlp = nlp(self.__text)
        self.__custom_nlp = custom_nlp(self.__text_raw)
        self.__noun_chunks = list(self.__nlp.noun_chunks)
        self.__get_basic_details()

Error:

enter image description here

How do I solve this error?
I installed en_core_web_sm using https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.0.0/en_core_web_sm-3.0.0.tar.gz


问:
is there any option to escape value for i18next by different pattern and also plurals
1- is there any way to replace i18next escape pattern ?

from {{- name}} to be something like %{name}

2- is there any option to change plurals technique ?

from

```<code>"key_zero"
"key_one"
"key_other"
</code>```

to

```<code>key: {
"zero":
"one":
"other":
}
</code>```

expecting solving that from interpolation for ex

Body:
1- is there any way to replace i18next escape pattern ?

from {{- name}} to be something like %{name}

2- is there any option to change plurals technique ?

from

"key_zero"
"key_one"
"key_other"

to

key: {
"zero":
"one":
"other":
}

expecting solving that from interpolation for ex


问:
Why did writes stop working when a secondary in my replica set went down?
I have a MongoDB replica set with 3 nodes and 1 arbiter.

The nodes have priority 0, 1, and 10. The arbiter has priority 1. They all have 1 vote.

The priority 10 was PRIMARY, while the priority 0 and 1 were both SECONDARY.

I set the default write concern to {w: 1}.

As a test I cleanly shut off one of the SECONDARY, namely the priority 0 node, with db.shutdownServer().

What I expected to happen is that everything continued to operate normally. Since the primary was still up, and the write concern was 1 (meaning only the primary needs to acknowledge), then everything should still be ok.

However, what I observed is that sometimes a write query would work, while other times it would block forever. My system as a whole stopped working. As soon as I brought the secondary back up, it started working again normally.

Why is this happening? One of my co-workers said it's because the queries try to write to any one of the nodes, and if they pick the secondary that is down then it will fail, but that isn't my understanding from what the documentation says.

Is the replica set really supposed to fail if a SECONDARY goes down? Isn't the point of the replica set to solve precisely this issue?

Additional info: when I set the priority 0 node to also have 0 votes, shutting it down didn't affect anything. So it seems it having a vote contributes to the issue... but not sure what it could be.


问:
Can I usue dash_cytoscape with plotly? or other similar network visualisation libraries?
I've looked at https://dash.plotly.com/cytoscape and was trying to figure out if I can use this in plotly standard.

I also found this page:

https://plotly.com/python/network-graphs/

which seems to indicate no - but wanted to check given I know dash and plotly are very interdependent.

Unfortunately for my usecase I can't use dash as it's running in a cloud jupyter style notebook where I can plot using plotly but can't use tools like jupyter-dash.

Alternatively if someone has a python network visualisation happy to see that as an answer to the question of interactive network visualisation in python.


问:
How to get content of message body of email into spreadsheet using App Script?
I want to get the content of email into spreadsheet using App script.

Mail body format is like this :
Account : xyz
Address : 12xyz
Mail Id : xyz@gmail.com
Id : 1234

I want to add this info into different columns of spreadsheet using App script.

Below is my script

```<code>var ss = SpreadsheetApp.getActiveSheet();
  var label = GmailApp.getUserLabelByName("Exclusion Check");
  var threads = label.getThreads();

  for (var i=0; i<1; i++)
  {
    var messages = threads[i].getMessages();

    for (var j=0; j<messages.length; j++)
    {
      var content = messages[j].getPlainBody();
      if (content) {
      var tmp
      tmp = content.match(/Account:\n([A-Za-z0-9\s]+)(\r?\n)/);
      var account = (tmp && tmp[1]) ? tmp[1].trim() : 'NULL';

      tmp = content.match(/Address:\n([\s\S]+)/);
      var address = (tmp && tmp[1]) ? tmp[1] : 'NULL';

      tmp = content.match(/MDM ID:\n([0-9]*$)/);
      var mdmId = (tmp && tmp[1]) ? tmp[1].trim() : 'NULL';

      tmp = content.match(/NPI ID:\n([\s\S]+)/);
      var npiId = (tmp && tmp[1]) ? tmp[1] : 'NULL';

      tmp = content.match(/Active State Licenses:\n([A-Za-z0-9@.]+)/);
      var activeStateLicenses = (tmp && tmp[1]) ? tmp[1].trim() : 'NULL';

      tmp = content.match(/Requested by:\n([A-Za-z0-9@.]+)/);
      var requestedBy = (tmp && tmp[1]) ? tmp[1].trim() : 'NULL';

      tmp = content.match(/Requestor e-mail:\n([A-Za-z0-9@.]+)/);
      var email = (tmp && tmp[1]) ? tmp[1].trim() : 'NULL';

      var sub = messages[j].getSubject();
      var dat = messages[j].getDate();

      ss.appendRow([account,address,mdmId,npiId,activeStateLicenses,requestedBy, email,sub,dat])
      }
    }
      // threads[i].removeLabel(label);
  }
}
</code>```

Can someone help me in this ?!

I tried using content.match() function but it is showing me NULL result according to above script.
I don't where the error is.

Body:
I want to get the content of email into spreadsheet using App script.

Mail body format is like this :
Account : xyz
Address : 12xyz
Mail Id : xyz@gmail.com
Id : 1234

I want to add this info into different columns of spreadsheet using App script.

Below is my script

var ss = SpreadsheetApp.getActiveSheet();
  var label = GmailApp.getUserLabelByName("Exclusion Check");
  var threads = label.getThreads();

  for (var i=0; i<1; i++)
  {
    var messages = threads[i].getMessages();

    for (var j=0; j<messages.length; j++)
    {
      var content = messages[j].getPlainBody();
      if (content) {
      var tmp
      tmp = content.match(/Account:\n([A-Za-z0-9\s]+)(\r?\n)/);
      var account = (tmp && tmp[1]) ? tmp[1].trim() : 'NULL';

      tmp = content.match(/Address:\n([\s\S]+)/);
      var address = (tmp && tmp[1]) ? tmp[1] : 'NULL';

      tmp = content.match(/MDM ID:\n([0-9]*$)/);
      var mdmId = (tmp && tmp[1]) ? tmp[1].trim() : 'NULL';

      tmp = content.match(/NPI ID:\n([\s\S]+)/);
      var npiId = (tmp && tmp[1]) ? tmp[1] : 'NULL';

      tmp = content.match(/Active State Licenses:\n([A-Za-z0-9@.]+)/);
      var activeStateLicenses = (tmp && tmp[1]) ? tmp[1].trim() : 'NULL';

      tmp = content.match(/Requested by:\n([A-Za-z0-9@.]+)/);
      var requestedBy = (tmp && tmp[1]) ? tmp[1].trim() : 'NULL';

      tmp = content.match(/Requestor e-mail:\n([A-Za-z0-9@.]+)/);
      var email = (tmp && tmp[1]) ? tmp[1].trim() : 'NULL';

      var sub = messages[j].getSubject();
      var dat = messages[j].getDate();

      ss.appendRow([account,address,mdmId,npiId,activeStateLicenses,requestedBy, email,sub,dat])
      }
    }
      // threads[i].removeLabel(label);
  }
}

Can someone help me in this ?!

I tried using content.match() function but it is showing me NULL result according to above script.
I don't where the error is.


问:
Reading multiple Excel files in succession with pandas ( Python )
I'm using this line to read an Excel file

```<code>df = pd.read_excel('D001_balance.xlsx')
</code>```

I have several such files, with names D001, D002, etc. and would like to read all of this at once. I tried to do a for loop, but replacing the running number with an index doesn't work as in

```<code>for i in range(N):
 df = pd.read_excel('D00i_balance.xlsx')
</code>```

Obviously it wont work because the index is inside a string. I tinkered a bit with the file names and the index, but nothing. Can the pd.read command include some combination of str and int types to make this work in a simple way?

Body:
I'm using this line to read an Excel file

df = pd.read_excel('D001_balance.xlsx')

I have several such files, with names D001, D002, etc. and would like to read all of this at once. I tried to do a for loop, but replacing the running number with an index doesn't work as in

for i in range(N):
 df = pd.read_excel('D00i_balance.xlsx')

Obviously it wont work because the index is inside a string. I tinkered a bit with the file names and the index, but nothing. Can the pd.read command include some combination of str and int types to make this work in a simple way?


问:
PayPal IPN Problem
This is really basic but:

If I send an IPN test (via the PayPal IPN test tool) to a script url that simply triggers a generic email to me.

Shouldn't that send me an email?

I just want to make sure that I am not ignorant about something simple here. But If PayPal is really touching that script, it should fire off the email right?

PayPal IPN test tool says it is getting a failure and describing it as a code 500. But my host says ports are open and working fine. I can browse to my script with a browser and it triggers the email.

Any ideas what I am missing?

The code in my listener is simply one line that sends me an email:

```<code><?php
    mail($this->tech_email,'Requested Before POSTBACK',"Here you go");
?>
</code>```

I am just trying to make sure PayPal is actually calling this url. Doesn't appear to be.

ContentLicense: CC BY-SA 3.0

Title: PayPal IPN Problem

Body:
This is really basic but:

If I send an IPN test (via the PayPal IPN test tool) to a script url that simply triggers a generic email to me.

Shouldn't that send me an email?

I just want to make sure that I am not ignorant about something simple here. But If PayPal is really touching that script, it should fire off the email right?

PayPal IPN test tool says it is getting a failure and describing it as a code 500. But my host says ports are open and working fine. I can browse to my script with a browser and it triggers the email.

Any ideas what I am missing?

The code in my listener is simply one line that sends me an email:

<?php
    mail($this->tech_email,'Requested Before POSTBACK',"Here you go");
?>

I am just trying to make sure PayPal is actually calling this url. Doesn't appear to be.


问:
Azure Bicep - Best practice with regards to noisy what-if output
I am creating a deployment on Azure from scratch consisting of various resources, e.g., Application Gateway, AKS cluster, Managed Identities. When checking az what-if after deploying, I can see some unexpected noise. I know that the team is working on eliminating as much noise as they can from the what-if output, but what is good practice with regards to this in the mean time?

replicate the changes in the template, such that they don't appear?

keep track of the previous 'what-if' output, then compare with the next one to see what actually changed?

deploy in stages, such that the noisy part can be separated from the clean part?

...

I spotted various types of noise, easy or difficult to deal with:

default properties that were not specified in the template. For example, properties.networkProfile.ipFamilies == 'IPv4 for a managedCluster. I could add this in the template to make it more complete, which would eliminate the noise.

external influences such as vnet peerings made by external parties. When outside parties peer with my vnet, it changes its definition too, which then pops up as noise (properties.virtualNetworkPeerings). When re-applying, as far as I understood, it fortunately doesn't eliminate these peerings. However, it would be nice to know when it doesn't overwrite such changes. Is this described somewhere?

references such as properties.principalId:   "a09185a3d" => "[reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('test-mi')), '2018-11-30').principalId]". I've seen this described as a bug/issue on the tracker, yet to be resolved.

bidirectional information (don't have an example at hand), like allowing a resource access to the vnet, which would modify the vnet but would also show a reference to the vnet in the resource. This is superfluous information, and adding it to the template to make sure the what-if remains clean seems wrong.

So, generally speaking, I'm looking for some tips and tricks to get the cleanest workflow possible. Having proper feedback on the upcoming changes on a template is crucial to prevent mistakes.


问:
Import declaration conflicts with local declaration of 'fs'
I'm getting this error:

```<code>Import declaration conflicts with local declaration of 'fs'
</code>```

in main :

```<code>import fs from 'fs-extra'

fs.ensureDir(settingsUserDataFolder, err => {
  console.log(err)
})
</code>```

If I comment this part:

```<code>//fs.ensureDir(settingsUserDataFolder, err => {
  //console.log(err)
//})
</code>```

the error disappears

In webpack.main.config.js :

```<code>const fs = require('fs-extra')

module.exports = {
  // https://webpack.js.org/configuration/externals/#externalstypecommonjs
  externalsType: 'commonjs',
  externals: {
    'fs': 'fs-extra',
  }
};
</code>```

ts.config.json :

```<code>{
  "$schema": "https://json.schemastore.org/tsconfig",
  "display": "Node 16",
  "compilerOptions": {
    "allowJs": true,
    "lib": ["es2021", "dom", "dom.iterable"], // https://www.e-learn.cn/topic/3468143
    "module": "commonjs",
    "target": "es2019",
    "skipLibCheck": true,
    "experimentalDecorators": true,
    "esModuleInterop": true,
    "jsx": "react",
    "noImplicitAny": false,
    "sourceMap": true,
    "baseUrl": "./src",
    "outDir": "dist",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "paths": {
      "@app/*": ["app/*"],
      "*": ["node_modules/*"]
    }
  },
  "include": ["./src/**/*"]
}
</code>```

Other Info:

```<code>"typescript": "^4.9.3",
"electron": "^17.2.0",
"@electron-forge/plugin-webpack": "6.0.0-beta.63",
"@types/fs-extra": "^9.0.13",
 "fs-extra": "^11.1.0",

node: v18.12.1
O.S.: Ubuntu 22.04 Desktop
</code>```

With import fsExtra from 'fs-extra' I get the same error:

```<code>Import declaration conflicts with local declaration of 'fsExtra'
</code>```

How to solve the issue?

Body:
I'm getting this error:

Import declaration conflicts with local declaration of 'fs'

in main :

import fs from 'fs-extra'

fs.ensureDir(settingsUserDataFolder, err => {
  console.log(err)
})

If I comment this part:

//fs.ensureDir(settingsUserDataFolder, err => {
  //console.log(err)
//})

the error disappears

In webpack.main.config.js :

const fs = require('fs-extra')

module.exports = {
  // https://webpack.js.org/configuration/externals/#externalstypecommonjs
  externalsType: 'commonjs',
  externals: {
    'fs': 'fs-extra',
  }
};

ts.config.json :

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "display": "Node 16",
  "compilerOptions": {
    "allowJs": true,
    "lib": ["es2021", "dom", "dom.iterable"], // https://www.e-learn.cn/topic/3468143
    "module": "commonjs",
    "target": "es2019",
    "skipLibCheck": true,
    "experimentalDecorators": true,
    "esModuleInterop": true,
    "jsx": "react",
    "noImplicitAny": false,
    "sourceMap": true,
    "baseUrl": "./src",
    "outDir": "dist",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "paths": {
      "@app/*": ["app/*"],
      "*": ["node_modules/*"]
    }
  },
  "include": ["./src/**/*"]
}

Other Info:

"typescript": "^4.9.3",
"electron": "^17.2.0",
"@electron-forge/plugin-webpack": "6.0.0-beta.63",
"@types/fs-extra": "^9.0.13",
 "fs-extra": "^11.1.0",

node: v18.12.1
O.S.: Ubuntu 22.04 Desktop

With import fsExtra from 'fs-extra' I get the same error:

Import declaration conflicts with local declaration of 'fsExtra'

How to solve the issue?


问:
unable to read PHP cURL result. var_dump works, but unable to pass it to variable
I have cURL function which reads remote json data. It works with many servers just fine, but now I need to use it on one specific website and it does not pass data to variable. I can still var_dump it or just simply echo it and it sends me to that website.

this is my remote server side code (simple just for here):

```<code><?php echo json_encode(['test'=>'test']);?>
</code>```

this is my receiving end:

```<code><?php
        $ch = curl_init();
        $curlConfig = array(
            CURLOPT_URL            => 'http://binance99.unaux.com/index.php',
            CURLOPT_RETURNTRANSFER => true
        );
        curl_setopt_array($ch, $curlConfig);
        $r = curl_exec($ch);
        curl_close($ch);
        print_r(json_decode($r));
?>
</code>```

there is nothing in $r, if I var_dump($r) it redirects me to the http://binance99.unaux.com/index.php,

I tried CURLOPT_HEADER => false, also I tried SSL version of my remote website, no luck.

I also tried file_get_contents() with same results.

Any help would be appreciated!

Body:
I have cURL function which reads remote json data. It works with many servers just fine, but now I need to use it on one specific website and it does not pass data to variable. I can still var_dump it or just simply echo it and it sends me to that website.

this is my remote server side code (simple just for here):

<?php echo json_encode(['test'=>'test']);?>

this is my receiving end:

<?php
        $ch = curl_init();
        $curlConfig = array(
            CURLOPT_URL            => 'http://binance99.unaux.com/index.php',
            CURLOPT_RETURNTRANSFER => true
        );
        curl_setopt_array($ch, $curlConfig);
        $r = curl_exec($ch);
        curl_close($ch);
        print_r(json_decode($r));
?>

there is nothing in $r, if I var_dump($r) it redirects me to the http://binance99.unaux.com/index.php,

I tried CURLOPT_HEADER => false, also I tried SSL version of my remote website, no luck.

I also tried file_get_contents() with same results.

Any help would be appreciated!


问:
Using a BertTokenizer when training a RobertaForMaskedLM Hugginface
I want to train from scrath a RobertaForMaskedLM model. But I need a character level tokenizer and I found one already, perfect for me. So I am wondering,
can I re-use it?
This is my RobertaForMaskedLM config:

```<code>{"architectures": ["RobertaForMaskedLM"],
"attention_probs_dropout_prob": 0.1,
"hidden_act": "gelu",
 "hidden_dropout_prob": 0.1,
 "hidden_size": 768, "initializer_range": 0.02,
"intermediate_size": 3072,
"layer_norm_eps": 1e-05,
"max_position_embeddings": 40000,
"model_type": "roberta",
 "num_attention_heads": 12,
 "num_hidden_layers": 12,
 "type_vocab_size": 1,
 "vocab_size": 30} # edited to be the same as the tokenizer
</code>```

This is the BertTokenizer config:

```<code>{
  "version": "1.0",
  "truncation": {
    "direction": "Right",
    "max_length": 512,
    "strategy": "LongestFirst",
    "stride": 0
  },
  "padding": null,
  "added_tokens": [
    {
      "id": 0,
      "content": "[PAD]",
      "single_word": false,
      "lstrip": false,
      "rstrip": false,
      "normalized": false,
      "special": true
    },
    {
      "id": 1,
      "content": "[UNK]",
      "single_word": false,
      "lstrip": false,
      "rstrip": false,
      "normalized": false,
      "special": true
    },
    {
      "id": 2,
      "content": "[CLS]",
      "single_word": false,
      "lstrip": false,
      "rstrip": false,
      "normalized": false,
      "special": true
    },
    {
      "id": 3,
      "content": "[SEP]",
      "single_word": false,
      "lstrip": false,
      "rstrip": false,
      "normalized": false,
      "special": true
    },
    {
      "id": 4,
      "content": "[MASK]",
      "single_word": false,
      "lstrip": false,
      "rstrip": false,
      "normalized": false,
      "special": true
    }
  ],
  "normalizer": {
    "type": "BertNormalizer",
    "clean_text": true,
    "handle_chinese_chars": true,
    "strip_accents": null,
    "lowercase": false
  },
  "pre_tokenizer": {
    "type": "BertPreTokenizer"
  },
  "post_processor": {
    "type": "TemplateProcessing",
    "single": [
      {
        "SpecialToken": {
          "id": "[CLS]",
          "type_id": 0
        }
      },
      {
        "Sequence": {
          "id": "A",
          "type_id": 0
        }
      },
      {
        "SpecialToken": {
          "id": "[SEP]",
          "type_id": 0
        }
      }
    ],
    "pair": [
      {
        "SpecialToken": {
          "id": "[CLS]",
          "type_id": 0
        }
      },
      {
        "Sequence": {
          "id": "A",
          "type_id": 0
        }
      },
      {
        "SpecialToken": {
          "id": "[SEP]",
          "type_id": 0
        }
      },
      {
        "Sequence": {
          "id": "B",
          "type_id": 1
        }
      },
      {
        "SpecialToken": {
          "id": "[SEP]",
          "type_id": 1
        }
      }
    ],
    "special_tokens": {
      "[CLS]": {
        "id": "[CLS]",
        "ids": [
          2
        ],
        "tokens": [
          "[CLS]"
        ]
      },
      "[SEP]": {
        "id": "[SEP]",
        "ids": [
          3
        ],
        "tokens": [
          "[SEP]"
        ]
      }
    }
  },
  "decoder": {
    "type": "WordPiece",
    "prefix": "##",
    "cleanup": true
  },
  "model": {
    "type": "WordPiece",
    "unk_token": "[UNK]",
    "continuing_subword_prefix": "##",
    "max_input_chars_per_word": 100,
    "vocab": {
      "[PAD]": 0,
      "[UNK]": 1,
      "[CLS]": 2,
      "[SEP]": 3,
      "[MASK]": 4,
      "L": 5,
      "A": 6,
      "G": 7,
      "V": 8,
      "E": 9,
      "S": 10,
      "I": 11,
      "K": 12,
      "R": 13,
      "D": 14,
      "T": 15,
      "P": 16,
      "N": 17,
      "Q": 18,
      "F": 19,
      "Y": 20,
      "M": 21,
      "H": 22,
      "C": 23,
      "W": 24,
      "X": 25,
      "U": 26,
      "B": 27,
      "Z": 28,
      "O": 29
    }
  }
}
</code>```

Thank you very much! If you now how to create a character based tokenizer let me know please.

Body:
I want to train from scrath a RobertaForMaskedLM model. But I need a character level tokenizer and I found one already, perfect for me. So I am wondering,
can I re-use it?
This is my RobertaForMaskedLM config:

{"architectures": ["RobertaForMaskedLM"],
"attention_probs_dropout_prob": 0.1,
"hidden_act": "gelu",
 "hidden_dropout_prob": 0.1,
 "hidden_size": 768, "initializer_range": 0.02,
"intermediate_size": 3072,
"layer_norm_eps": 1e-05,
"max_position_embeddings": 40000,
"model_type": "roberta",
 "num_attention_heads": 12,
 "num_hidden_layers": 12,
 "type_vocab_size": 1,
 "vocab_size": 30} # edited to be the same as the tokenizer

This is the BertTokenizer config:

{
  "version": "1.0",
  "truncation": {
    "direction": "Right",
    "max_length": 512,
    "strategy": "LongestFirst",
    "stride": 0
  },
  "padding": null,
  "added_tokens": [
    {
      "id": 0,
      "content": "[PAD]",
      "single_word": false,
      "lstrip": false,
      "rstrip": false,
      "normalized": false,
      "special": true
    },
    {
      "id": 1,
      "content": "[UNK]",
      "single_word": false,
      "lstrip": false,
      "rstrip": false,
      "normalized": false,
      "special": true
    },
    {
      "id": 2,
      "content": "[CLS]",
      "single_word": false,
      "lstrip": false,
      "rstrip": false,
      "normalized": false,
      "special": true
    },
    {
      "id": 3,
      "content": "[SEP]",
      "single_word": false,
      "lstrip": false,
      "rstrip": false,
      "normalized": false,
      "special": true
    },
    {
      "id": 4,
      "content": "[MASK]",
      "single_word": false,
      "lstrip": false,
      "rstrip": false,
      "normalized": false,
      "special": true
    }
  ],
  "normalizer": {
    "type": "BertNormalizer",
    "clean_text": true,
    "handle_chinese_chars": true,
    "strip_accents": null,
    "lowercase": false
  },
  "pre_tokenizer": {
    "type": "BertPreTokenizer"
  },
  "post_processor": {
    "type": "TemplateProcessing",
    "single": [
      {
        "SpecialToken": {
          "id": "[CLS]",
          "type_id": 0
        }
      },
      {
        "Sequence": {
          "id": "A",
          "type_id": 0
        }
      },
      {
        "SpecialToken": {
          "id": "[SEP]",
          "type_id": 0
        }
      }
    ],
    "pair": [
      {
        "SpecialToken": {
          "id": "[CLS]",
          "type_id": 0
        }
      },
      {
        "Sequence": {
          "id": "A",
          "type_id": 0
        }
      },
      {
        "SpecialToken": {
          "id": "[SEP]",
          "type_id": 0
        }
      },
      {
        "Sequence": {
          "id": "B",
          "type_id": 1
        }
      },
      {
        "SpecialToken": {
          "id": "[SEP]",
          "type_id": 1
        }
      }
    ],
    "special_tokens": {
      "[CLS]": {
        "id": "[CLS]",
        "ids": [
          2
        ],
        "tokens": [
          "[CLS]"
        ]
      },
      "[SEP]": {
        "id": "[SEP]",
        "ids": [
          3
        ],
        "tokens": [
          "[SEP]"
        ]
      }
    }
  },
  "decoder": {
    "type": "WordPiece",
    "prefix": "##",
    "cleanup": true
  },
  "model": {
    "type": "WordPiece",
    "unk_token": "[UNK]",
    "continuing_subword_prefix": "##",
    "max_input_chars_per_word": 100,
    "vocab": {
      "[PAD]": 0,
      "[UNK]": 1,
      "[CLS]": 2,
      "[SEP]": 3,
      "[MASK]": 4,
      "L": 5,
      "A": 6,
      "G": 7,
      "V": 8,
      "E": 9,
      "S": 10,
      "I": 11,
      "K": 12,
      "R": 13,
      "D": 14,
      "T": 15,
      "P": 16,
      "N": 17,
      "Q": 18,
      "F": 19,
      "Y": 20,
      "M": 21,
      "H": 22,
      "C": 23,
      "W": 24,
      "X": 25,
      "U": 26,
      "B": 27,
      "Z": 28,
      "O": 29
    }
  }
}

Thank you very much! If you now how to create a character based tokenizer let me know please.


问:
fullpage js scrollOverflow is not working when scrollBar is set to false
I have a section which has some content more that the viewport height.
The fullpage.js option scrollOverflow is set to true but always the output is force me to use scrollBar to false then the section became scrollable.
But if I set scrollBar to true then the section is not scrolling anymore.
I need to keep the scrollBar to true for some jquery wheel animation.

This is the code I'm using:

`

```<code>var myFullpage = new fullpage('#fullpage', {
        licenseKey: '67582BFF-B4A142AC-ABCE62BE-45C58F1F',
        sectionSelector: '.section',
        scrollBar: true,
//      fitToSection: false,
        scrollingSpeed: 1300,
        bigSectionsDestination: top,
        css3: true,
        slideSelector: '.slide',
//         normalScrollElements: '.normal_scroll',
        scrollOverflow: true,
        scrollOverflowMacStyle: true,
        onScrollOverflow: function(section, slide, position, direction){
            var params = {
                section: section,
                slide: slide,
                position: position,
                direction: direction
            };

            //console.log("--- onScrollOverflow ---");
            //console.log(params);
        },
        //controlArrows: false,
        loopHorizontal: false,
        responsiveWidth: 1025,
</code>```

`

Body:
I have a section which has some content more that the viewport height.
The fullpage.js option scrollOverflow is set to true but always the output is force me to use scrollBar to false then the section became scrollable.
But if I set scrollBar to true then the section is not scrolling anymore.
I need to keep the scrollBar to true for some jquery wheel animation.

This is the code I'm using:

`

var myFullpage = new fullpage('#fullpage', {
        licenseKey: '67582BFF-B4A142AC-ABCE62BE-45C58F1F',
        sectionSelector: '.section',
        scrollBar: true,
//      fitToSection: false,
        scrollingSpeed: 1300,
        bigSectionsDestination: top,
        css3: true,
        slideSelector: '.slide',
//         normalScrollElements: '.normal_scroll',
        scrollOverflow: true,
        scrollOverflowMacStyle: true,
        onScrollOverflow: function(section, slide, position, direction){
            var params = {
                section: section,
                slide: slide,
                position: position,
                direction: direction
            };

            //console.log("--- onScrollOverflow ---");
            //console.log(params);
        },
        //controlArrows: false,
        loopHorizontal: false,
        responsiveWidth: 1025,

`


问:
Create a scrolling list in html format with app script
I'm trying to create an lselect option by retrieving the data from my sheet but after many attempts I get nothing at all. My getPropertiesNamesList function retrieves the data but I can't display them in the select

code.gs

```<code>const getPropertiesNamesList = () => {
  try {
    const propertiesSheet = getSs(jamPropertyManagementSettingsSpreadsheetId).getSheetByName('Properties');
    const propertiesNamesList = getSheetHeaders(propertiesSheet);
    return propertiesNamesList;
  } catch (error) {
    Logger.log(`getPropertiesNamesListError: ${error.message}`);
    return `getPropertiesNamesListError: ${error.message}`;
  };
};
</code>```

Script.html

```<code>
$(function() {
  google.script.run.withSuccessHandler(showProperty)
      .getPropertiesNamesList();
});

function showProperty(property) {
  var list = $('#propertyNameList');
  list.empty();
  for (var i = 0; i < property.length; i++) {
    list.append('<option>' + property[i] + '</option>');
  }
}
</code>```

index.html

```<code> <label for="property" class="form-label">Property</label>
     <select class="selectpicker form-control"
       data-live-search="true" title="Choose a Property" name="propertyNameList"   id="propertyNameList" required>

  </select>
</code>```

Body:
I'm trying to create an lselect option by retrieving the data from my sheet but after many attempts I get nothing at all. My getPropertiesNamesList function retrieves the data but I can't display them in the select

code.gs

const getPropertiesNamesList = () => {
  try {
    const propertiesSheet = getSs(jamPropertyManagementSettingsSpreadsheetId).getSheetByName('Properties');
    const propertiesNamesList = getSheetHeaders(propertiesSheet);
    return propertiesNamesList;
  } catch (error) {
    Logger.log(`getPropertiesNamesListError: ${error.message}`);
    return `getPropertiesNamesListError: ${error.message}`;
  };
};

Script.html

$(function() {
  google.script.run.withSuccessHandler(showProperty)
      .getPropertiesNamesList();
});

function showProperty(property) {
  var list = $('#propertyNameList');
  list.empty();
  for (var i = 0; i < property.length; i++) {
    list.append('<option>' + property[i] + '</option>');
  }
}

index.html

 Property
     <select class="selectpicker form-control"
       data-live-search="true" title="Choose a Property" name="propertyNameList"   id="propertyNameList" required>

  </select>


问:
Colour in the legend does not match colour in the plot (ggplot2 v 3.4.0)
I have tried to search the answers to questions similar to mine, however I have not yet been able to come across a reliable answer so asking separately.

My dataframe named Vedo_Project2_CD38CD127 looks like this:

I am trying to create a boxplot of the variables in this specific order: PD1posCD8pos, TIGITposCD8pos, CD38posCD8pos. I have specified this order in the ggplot2 boxplot and it shows up correct in the graph itself (correct order and correct colouring). My issue lies in the legend which does not show the exact colours that I have specified, even though the ordering of the variable names in the legend is correct. For example, I have specified PD1posCD8pos to be "black", and it shows up as black in the boxplot, but in the legend PD1posCD8pos (now labelled as PD1+CD8+ for clarity) shows up as blue. How can I fix this so that the legend colours correspond to the order I have specified?

I am thinking that because CD38posCD8pos comes first alphabetically and since it is blue, the legend is forcing it to go first. Oddly enough, the previous version of ggplot2 re-ordered the legend automatically, so it is only this version that is giving me issues.

Please see my code below:

```<code>#colour vector
cols<- c("PD1posCD8pos"="black","TIGITposCD8pos"="red","CD38posCD8pos"="blue")

#plot
pw<- ggplot(Vedo_Project2_CD38CD127, aes(variable,value,fill=variable)) +
  geom_boxplot(fill="white",width=0.5,position = position_dodge(0.1)) +
  geom_dotplot(binaxis = "y",stackdir = "center",dotsize = 0.5) +
  scale_fill_manual(labels=c("PD1+CD8+","TIGIT+CD8+","CD38+CD8+"),values=cols) +
  scale_x_discrete(limits=c("PD1posCD8pos","TIGITposCD8pos","CD38posCD8pos"))+
  labs(x="Sample",y="Frequency of PD1+/TIGIT+/CD38+ (% of CD8+ T cells)",fill="Legend")

pw
</code>```

Please see the graph output that I am getting below:

Many thanks in advance!

Body:
I have tried to search the answers to questions similar to mine, however I have not yet been able to come across a reliable answer so asking separately.

My dataframe named Vedo_Project2_CD38CD127 looks like this:

I am trying to create a boxplot of the variables in this specific order: PD1posCD8pos, TIGITposCD8pos, CD38posCD8pos. I have specified this order in the ggplot2 boxplot and it shows up correct in the graph itself (correct order and correct colouring). My issue lies in the legend which does not show the exact colours that I have specified, even though the ordering of the variable names in the legend is correct. For example, I have specified PD1posCD8pos to be "black", and it shows up as black in the boxplot, but in the legend PD1posCD8pos (now labelled as PD1+CD8+ for clarity) shows up as blue. How can I fix this so that the legend colours correspond to the order I have specified?

I am thinking that because CD38posCD8pos comes first alphabetically and since it is blue, the legend is forcing it to go first. Oddly enough, the previous version of ggplot2 re-ordered the legend automatically, so it is only this version that is giving me issues.

Please see my code below:

#colour vector
cols<- c("PD1posCD8pos"="black","TIGITposCD8pos"="red","CD38posCD8pos"="blue")

#plot
pw<- ggplot(Vedo_Project2_CD38CD127, aes(variable,value,fill=variable)) +
  geom_boxplot(fill="white",width=0.5,position = position_dodge(0.1)) +
  geom_dotplot(binaxis = "y",stackdir = "center",dotsize = 0.5) +
  scale_fill_manual(labels=c("PD1+CD8+","TIGIT+CD8+","CD38+CD8+"),values=cols) +
  scale_x_discrete(limits=c("PD1posCD8pos","TIGITposCD8pos","CD38posCD8pos"))+
  labs(x="Sample",y="Frequency of PD1+/TIGIT+/CD38+ (% of CD8+ T cells)",fill="Legend")

pw

Please see the graph output that I am getting below:

Many thanks in advance!


问:
connect() failed (111: Connection refused) while connecting to upstream between two Nginx reverse proxy
I've been wrapping my head around an Nginx configuration and I just can't do it. I've made some improvements, and I feel like I am quite close from what I'd like to achieve, but I get this issue :

```<code>[error] 31768#31768: *12417609 connect() failed (111: Connection refused) while connecting to upstream,
client: <ip_from_my_vpn>,
server: <domain_name.com>,
request: "GET /var/my_app/ HTTP/1.1",
upstream: "http://127.0.0.1:5500/var/my_app/",
host: <domain_name.com>
</code>```

The configuration is the following:

I have server2 that has an /var/my_app/app.js that works, listening to localhost:5500.

On top of that, on this server2, I have an Nginx reverse proxy:

```<code>server {
    listen       80 default_server;
    server_name  <ip_server2>;
    root /;

    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_connect_timeout 20s;
    proxy_read_timeout 60s;
    proxy_http_version 1.1;

  location ~ ^/var/my_app/ {
    proxy_pass http://127.0.0.1:5500;
    proxy_cache_bypass      $http_upgrade;

  }
}
</code>```

So through Nginx, using port 80, we can now get the appli. We use that because we'll get others applications running on localhost but with a different port later on.

And now on server1, I have another nginx reverse proxy, whith that configuration:

```<code>server {
  gzip on;
  gzip_types    text/plain application/javascript application/x-javascript text/javascript text/xml text/css;
  listen 443 ssl;
  server_name <domain_name.com>;
  root /home/ubuntu;
  client_max_body_size 50M;

  ssl_certificate /etc/nginx/ssl/<domain_name.com>/certificate.crt;
  ssl_certificate_key /etc/nginx/ssl/<domain_name.com>/private.key;

 location /var/my_app/ {
    proxy_pass http://<ip_server2>;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto https;
    proxy_redirect off;

 }
}
</code>```

My goal is the following: using the https://<domaine_name.com>/var/my_app/ on a browser, we can now use the application hosted on server2.

The flux are open; from server1, I can curl http://<ip_server2>/var/my_app/ -vI and it says http 200, nginx Ok and so on.

nmap -p 80 <ip_server2> works too.

But the URL does not work. And actually, given the error (localhost:5500), I don't even know if it even tries to reach the server2 or if it runs on server1 localhost:5500.

Any idea? Thank you.

Body:
I've been wrapping my head around an Nginx configuration and I just can't do it. I've made some improvements, and I feel like I am quite close from what I'd like to achieve, but I get this issue :

[error] 31768#31768: *12417609 connect() failed (111: Connection refused) while connecting to upstream,
client: <ip_from_my_vpn>,
server: <domain_name.com>,
request: "GET /var/my_app/ HTTP/1.1",
upstream: "http://127.0.0.1:5500/var/my_app/",
host: <domain_name.com>

The configuration is the following:

I have server2 that has an /var/my_app/app.js that works, listening to localhost:5500.

On top of that, on this server2, I have an Nginx reverse proxy:

server {
    listen       80 default_server;
    server_name  <ip_server2>;
    root /;

    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_connect_timeout 20s;
    proxy_read_timeout 60s;
    proxy_http_version 1.1;

  location ~ ^/var/my_app/ {
    proxy_pass http://127.0.0.1:5500;
    proxy_cache_bypass      $http_upgrade;

  }
}

So through Nginx, using port 80, we can now get the appli. We use that because we'll get others applications running on localhost but with a different port later on.

And now on server1, I have another nginx reverse proxy, whith that configuration:

server {
  gzip on;
  gzip_types    text/plain application/javascript application/x-javascript text/javascript text/xml text/css;
  listen 443 ssl;
  server_name <domain_name.com>;
  root /home/ubuntu;
  client_max_body_size 50M;

  ssl_certificate /etc/nginx/ssl/<domain_name.com>/certificate.crt;
  ssl_certificate_key /etc/nginx/ssl/<domain_name.com>/private.key;

 location /var/my_app/ {
    proxy_pass http://<ip_server2>;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto https;
    proxy_redirect off;

 }
}

My goal is the following: using the https://<domaine_name.com>/var/my_app/ on a browser, we can now use the application hosted on server2.

The flux are open; from server1, I can curl http://<ip_server2>/var/my_app/ -vI and it says http 200, nginx Ok and so on.

nmap -p 80 <ip_server2> works too.

But the URL does not work. And actually, given the error (localhost:5500), I don't even know if it even tries to reach the server2 or if it runs on server1 localhost:5500.

Any idea? Thank you.


问:
SHA512 hash with specified number of transformations in C#
I need to create SHA512 from string:

```<code>20191018143572123034102012221314181237774212
</code>```

and it says, that I have to use 5000 transformations and hash result should be:

```<code>f8b915776eab735fdd10266b2e66068447904852b82c30eeb6de30703a087eb17ea4c4a37630494607194ddb9354c1211bd984fb5f4d9cff95f5a24ed52065e7
</code>```

But my final hash string is:

```<code>B4CA157DBBC9DFC22A8046092C00367CBDB51F0D780A428CB7731251FA29D1E426E0853E0F52A1ACA8460D6D1679477509490D7F4305DCDC7D77FD0CC1993D3A
</code>```

What am I doing wrong?

I am using this code:

```<code>static void Main(string[] args)
{
    string sha512 = "";
    string puvodni = "20191018143572123034102012221314181237774212";
    Console.WriteLine("Puvodni: " + puvodni);
    for (int i = 0; i < 5000; i++)
    {
        sha512 = TestCrypt.ComputeSHA512(puvodni);
        Console.WriteLine("Hash: " + sha512);
        puvodni=sha512;
    }
}

internal class TestCrypt
{
    public static string ComputeSHA512(string s)
    {
        StringBuilder sb = new StringBuilder();
        using (SHA512 sha512 = SHA512.Create())
        {
            byte[] hashValue = sha512.ComputeHash(Encoding.UTF8.GetBytes(s));
            foreach (byte b in hashValue)
            {
                sb.Append($"{b:X2}");
            }
        }

        return sb.ToString();
    }
}
</code>```

EDIT

I am still in problems, update my program to this. Trying to use SHA512 built-in function, also BouncyCastle, but results are same.

```<code>static void Main(string[] args)
{
    string puvodni = "20191018143572123034102012221314181237774212";
    Console.WriteLine("Puvodni: " + puvodni);

    //varianta 1
    SHA512 sha512 = SHA512.Create();
    byte[] hash = Encoding.UTF8.GetBytes(puvodni);
    for (int i = 0; i < 2; i++)
    {
        hash=sha512.ComputeHash(hash);
        string result = BitConverter.ToString(hash).Replace("-", "");
        Console.WriteLine(i.ToString() + ". Hash: " + result);
    }

    //varianta 2
    byte[] bytes = System.Text.Encoding.UTF8.GetBytes(puvodni);
    Org.BouncyCastle.Crypto.Digests.Sha512Digest digester = new Org.BouncyCastle.Crypto.Digests.Sha512Digest();
    for (int i = 0; i < 2; i++)
    {
        byte[] retValue = new byte[digester.GetDigestSize()];
        digester.BlockUpdate(bytes, 0, bytes.Length);
        digester.DoFinal(retValue, 0);
        string result1 = BitConverter.ToString(retValue).Replace("-", "");
        Console.WriteLine("BouncyCastle Hash: " + i.ToString() + ". " + result1);
        bytes=retValue;
    }
}
</code>```

I need same result as on this page: https://www.podatki.gov.pl/kalkulator-sha-512
Where:
NIP: 1435721230
Numer konta: 34 1020 1222 1314 1812 3777 4212
Wprowadź datę: 18-10-2019

On one iteration result is ok, bud on second iteration I am receiving another hash string in my program.

Body:
I need to create SHA512 from string:

20191018143572123034102012221314181237774212

and it says, that I have to use 5000 transformations and hash result should be:

f8b915776eab735fdd10266b2e66068447904852b82c30eeb6de30703a087eb17ea4c4a37630494607194ddb9354c1211bd984fb5f4d9cff95f5a24ed52065e7

But my final hash string is:

B4CA157DBBC9DFC22A8046092C00367CBDB51F0D780A428CB7731251FA29D1E426E0853E0F52A1ACA8460D6D1679477509490D7F4305DCDC7D77FD0CC1993D3A

What am I doing wrong?

I am using this code:

static void Main(string[] args)
{
    string sha512 = "";
    string puvodni = "20191018143572123034102012221314181237774212";
    Console.WriteLine("Puvodni: " + puvodni);
    for (int i = 0; i < 5000; i++)
    {
        sha512 = TestCrypt.ComputeSHA512(puvodni);
        Console.WriteLine("Hash: " + sha512);
        puvodni=sha512;
    }
}

internal class TestCrypt
{
    public static string ComputeSHA512(string s)
    {
        StringBuilder sb = new StringBuilder();
        using (SHA512 sha512 = SHA512.Create())
        {
            byte[] hashValue = sha512.ComputeHash(Encoding.UTF8.GetBytes(s));
            foreach (byte b in hashValue)
            {
                sb.Append($"{b:X2}");
            }
        }

        return sb.ToString();
    }
}

EDIT

I am still in problems, update my program to this. Trying to use SHA512 built-in function, also BouncyCastle, but results are same.

static void Main(string[] args)
{
    string puvodni = "20191018143572123034102012221314181237774212";
    Console.WriteLine("Puvodni: " + puvodni);

    //varianta 1
    SHA512 sha512 = SHA512.Create();
    byte[] hash = Encoding.UTF8.GetBytes(puvodni);
    for (int i = 0; i < 2; i++)
    {
        hash=sha512.ComputeHash(hash);
        string result = BitConverter.ToString(hash).Replace("-", "");
        Console.WriteLine(i.ToString() + ". Hash: " + result);
    }

    //varianta 2
    byte[] bytes = System.Text.Encoding.UTF8.GetBytes(puvodni);
    Org.BouncyCastle.Crypto.Digests.Sha512Digest digester = new Org.BouncyCastle.Crypto.Digests.Sha512Digest();
    for (int i = 0; i < 2; i++)
    {
        byte[] retValue = new byte[digester.GetDigestSize()];
        digester.BlockUpdate(bytes, 0, bytes.Length);
        digester.DoFinal(retValue, 0);
        string result1 = BitConverter.ToString(retValue).Replace("-", "");
        Console.WriteLine("BouncyCastle Hash: " + i.ToString() + ". " + result1);
        bytes=retValue;
    }
}

I need same result as on this page: https://www.podatki.gov.pl/kalkulator-sha-512
Where:
NIP: 1435721230
Numer konta: 34 1020 1222 1314 1812 3777 4212
Wprowadź datę: 18-10-2019

On one iteration result is ok, bud on second iteration I am receiving another hash string in my program.


问:
NPM run error: AssignProcessToJobObject: (6) The handle is invalid
My angular app is built using Angular 14, nestjs 8 and nrwl 14. When I am trying to build the application, it builds successfully with no error but when I am trying to run the application, it is throwing below error. Kindly help on this.

Command to run the application

```<code>nx run ui-app:serve:development --port=4200 --ssl=true --o=true
</code>```

Build generated successfully:

Error:

```<code>** Angular Live Development Server is listening on localhost:4200, open your browser on https://localhost:4200/ **

AssignProcessToJobObject: (6) The handle is invalid.

 ———————————————————————————————————————————————————————————————————————————————————————————————————————————

 >  NX   Running target "ui-app:serve" failed

   Failed tasks:

   - ui-app:serve:development

   Hint: run the command with --verbose for more details.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ui-app@0.0.0 start:ui-app: `node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng serve ui-app --port 4200 --ssl true -o`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ui-app@0.0.0 start:ui-app script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
</code>```

Verbose Error

```<code>npm verb lifecycle ui-app@0.0.0~start:ui-app: CWD: C:\Users\Rahul\WorkSpace\Project\ui-app
npm info lifecycle ui-app@0.0.0~start:ui-app: Failed to exec start:ui-app script
npm verb stack Error: ui-app@0.0.0 start:ui-app: `node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng serve ui-app --port 4200 --ssl true -o`
npm verb stack Exit status 1
npm verb stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
npm verb stack     at EventEmitter.emit (events.js:400:28)
npm verb stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
npm verb stack     at ChildProcess.emit (events.js:400:28)
npm verb stack     at maybeClose (internal/child_process.js:1088:16)
npm verb stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:296:5)
npm verb pkgid ui-app@0.0.0
npm verb cwd C:\Users\Rahul\WorkSpace\Project\ui-app
npm verb Windows_NT 10.0.19044
npm verb argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "start:ui-app" "--verbose"
npm verb node v14.21.1
npm verb npm  v6.14.17
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ui-app@0.0.0 start:ui-app: `node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng serve ui-app --port 4200 --ssl true -o`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ui-app@0.0.0 start:ui-app script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm verb exit [ 1, true ]
npm timing npm Completed in 220039ms
</code>```

Body:
My angular app is built using Angular 14, nestjs 8 and nrwl 14. When I am trying to build the application, it builds successfully with no error but when I am trying to run the application, it is throwing below error. Kindly help on this.

Command to run the application

nx run ui-app:serve:development --port=4200 --ssl=true --o=true

Build generated successfully:

Error:

** Angular Live Development Server is listening on localhost:4200, open your browser on https://localhost:4200/ **

AssignProcessToJobObject: (6) The handle is invalid.

 ———————————————————————————————————————————————————————————————————————————————————————————————————————————

 >  NX   Running target "ui-app:serve" failed

   Failed tasks:

   - ui-app:serve:development

   Hint: run the command with --verbose for more details.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ui-app@0.0.0 start:ui-app: `node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng serve ui-app --port 4200 --ssl true -o`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ui-app@0.0.0 start:ui-app script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Verbose Error

npm verb lifecycle ui-app@0.0.0~start:ui-app: CWD: C:\Users\Rahul\WorkSpace\Project\ui-app
npm info lifecycle ui-app@0.0.0~start:ui-app: Failed to exec start:ui-app script
npm verb stack Error: ui-app@0.0.0 start:ui-app: `node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng serve ui-app --port 4200 --ssl true -o`
npm verb stack Exit status 1
npm verb stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
npm verb stack     at EventEmitter.emit (events.js:400:28)
npm verb stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
npm verb stack     at ChildProcess.emit (events.js:400:28)
npm verb stack     at maybeClose (internal/child_process.js:1088:16)
npm verb stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:296:5)
npm verb pkgid ui-app@0.0.0
npm verb cwd C:\Users\Rahul\WorkSpace\Project\ui-app
npm verb Windows_NT 10.0.19044
npm verb argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "start:ui-app" "--verbose"
npm verb node v14.21.1
npm verb npm  v6.14.17
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ui-app@0.0.0 start:ui-app: `node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng serve ui-app --port 4200 --ssl true -o`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ui-app@0.0.0 start:ui-app script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm verb exit [ 1, true ]
npm timing npm Completed in 220039ms


问:
File path name storing undefined in database using node js typescript?
I am using here this ${file.filename} for path name store in databbase. I have two input parameter for two files; but I am getting file path store as "undefined".

const addPremiumJob = async (req : any, file: any, data: any) => {
    const connection = await createConnection()

    const filePath = `${req.protocol}://${req.get('host')}/public/uploads/company-logos/${file.filename}`

    const param = [issuer.insertId, premiumJobModel.logo, filePath], [issuer.insertId, premiumJobModel.coverImage, filePath]
}
```

I am geting this file path as a undefined.

"http://localhost:3003/public/uploads/company-logos/undefined"

Body:
I am using here this ${file.filename} for path name store in databbase. I have two input parameter for two files; but I am getting file path store as "undefined".

const addPremiumJob = async (req : any, file: any, data: any) => {
    const connection = await createConnection()

    const filePath = `${req.protocol}://${req.get('host')}/public/uploads/company-logos/${file.filename}`

    const param = [issuer.insertId, premiumJobModel.logo, filePath], [issuer.insertId, premiumJobModel.coverImage, filePath]
}

I am geting this file path as a undefined.

"http://localhost:3003/public/uploads/company-logos/undefined"


问:
flutter run in android device error, but in simulation device is ok, Execution failed for task ':sqflite:compileDebugJavaWithJavac'
the error message is below:

```<code>java.lang.AssertionError: annotationType(): unrecognized Attribute name MODULE (class com.sun.tools.javac.util.UnsharedNameTable$NameImpl)
        at com.sun.tools.javac.util.Assert.error(Assert.java:133)
        at com.sun.tools.javac.code.TypeAnnotations.annotationType(TypeAnnotations.java:231)
        at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.separateAnnotationsKinds(TypeAnnotations.java:294)
        at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.visitMethodDef(TypeAnnotations.java:1066)
        at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:778)
        at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
        at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.scan(TypeAnnotations.java:275)
        at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
        at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.visitClassDef(TypeAnnotations.java:1042)
        at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:693)
        at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
        at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.scan(TypeAnnotations.java:275)
        at com.sun.tools.javac.code.TypeAnnotations$1.run(TypeAnnotations.java:127)
        at com.sun.tools.javac.comp.Annotate.flush(Annotate.java:152)
        at com.sun.tools.javac.comp.Annotate.enterDone(Annotate.java:129)
        at com.sun.tools.javac.comp.Enter.complete(Enter.java:512)
        at com.sun.tools.javac.comp.Enter.main(Enter.java:471)
        at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:982)
        at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:857)
        at com.sun.tools.javac.main.Main.compile(Main.java:523)
        at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
        at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
        at org.gradle.internal.compiler.java.IncrementalCompileTask.call(IncrementalCompileTask.java:74)
        at org.gradle.api.internal.tasks.compile.AnnotationProcessingCompileTask.call(AnnotationProcessingCompileTask.java:94)
        at org.gradle.api.internal.tasks.compile.ResourceCleaningCompilationTask.call(ResourceCleaningCompilationTask.java:57)
        at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:55)
        at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:40)
        at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:97)
        at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:51)
        at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:37)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':sqflite:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 8s
Running Gradle task 'assembleDebug'...                             71.2s
Exception: Gradle task assembleDebug failed with exit code 1
</code>```

I just add some packages

shared_preferences: ^2.0.15
cached_network_image: ^3.2.3

then I try use flutter run in android device is not working, but in simulator is working

Body:
the error message is below:

java.lang.AssertionError: annotationType(): unrecognized Attribute name MODULE (class com.sun.tools.javac.util.UnsharedNameTable$NameImpl)
        at com.sun.tools.javac.util.Assert.error(Assert.java:133)
        at com.sun.tools.javac.code.TypeAnnotations.annotationType(TypeAnnotations.java:231)
        at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.separateAnnotationsKinds(TypeAnnotations.java:294)
        at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.visitMethodDef(TypeAnnotations.java:1066)
        at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:778)
        at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
        at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.scan(TypeAnnotations.java:275)
        at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
        at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.visitClassDef(TypeAnnotations.java:1042)
        at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:693)
        at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
        at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.scan(TypeAnnotations.java:275)
        at com.sun.tools.javac.code.TypeAnnotations$1.run(TypeAnnotations.java:127)
        at com.sun.tools.javac.comp.Annotate.flush(Annotate.java:152)
        at com.sun.tools.javac.comp.Annotate.enterDone(Annotate.java:129)
        at com.sun.tools.javac.comp.Enter.complete(Enter.java:512)
        at com.sun.tools.javac.comp.Enter.main(Enter.java:471)
        at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:982)
        at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:857)
        at com.sun.tools.javac.main.Main.compile(Main.java:523)
        at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
        at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
        at org.gradle.internal.compiler.java.IncrementalCompileTask.call(IncrementalCompileTask.java:74)
        at org.gradle.api.internal.tasks.compile.AnnotationProcessingCompileTask.call(AnnotationProcessingCompileTask.java:94)
        at org.gradle.api.internal.tasks.compile.ResourceCleaningCompilationTask.call(ResourceCleaningCompilationTask.java:57)
        at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:55)
        at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:40)
        at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:97)
        at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:51)
        at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:37)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':sqflite:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 8s
Running Gradle task 'assembleDebug'...                             71.2s
Exception: Gradle task assembleDebug failed with exit code 1

I just add some packages

shared_preferences: ^2.0.15
cached_network_image: ^3.2.3

then I try use flutter run in android device is not working, but in simulator is working