问:
How can I add legend and tooltips in this pie chart?
How can I add tooltips in this piechart?
`
``

```<code><div>
  <button onclick="update(data2006)">2006</button>
  <button onclick="update(data2007)">2007</button>
</div>
<select id="selectButton">
  <option></option>
</select>

<div id="pie_chart"></div>

<script>
  var width = 450;
  height = 450;
  margin = 40;

  var radius = Math.min(width, height) / 2 - margin;
  var tooltip = d3
    .select('#pie_chart')
    .append('div')
    .attr('class', 'tooltip')
    .style('opacity', 0);
  var svg = d3
    .select('#pie_chart')
    .append('svg')
    .attr('width', width)
    .attr('height', height)
    .append('g')
    .attr('transform', 'translate(' + width / 2 + ',' + height / 2 + ')');
  var data2006 = {
    AsiaMusic: 2,
    Movies: 1,
    Lifestyle: 1,
    Hiphop: 1,
    Entertainment: 2,
    Actiongame: 1,
    Music: 3,
  };
var data2007 = {
    AsiaMusic: 2,
    Movies: 1,
    Lifestyle: 1,
    Hiphop: 1,
    Entertainment: 2,
    Actiongame: 1,
    Music: 3,
  };
  function update(data) {
    var pie = d3
      .pie()
      .value(function (d) {
        return d.value;
      })
      .sort(function (a, b) {
        console.log(a);
        return d3.ascending(a.key, b.key);
      });
    var data_ready = pie(d3.entries(data));

    var u = svg.selectAll('path').data(data_ready);

    u.enter()
      .append('path')
      .merge(u)
      .transition()
      .duration(1000)
      .attr('d', d3.arc().innerRadius(0).outerRadius(radius))
      .attr('fill', function (d) {
        return color(d.data.key);
      })
      .attr('stroke', 'white')
      .style('stroke-width', '2px')
      .style('opacity', 1);
    u.exit().remove();
    });
  }

  update(data2006);
</script>
</code>```

I have been trying to find out the way to put some legend or tooltips in this pie chart but I don't know how to do it. I tried to tool tip and legend in this piechart but I cannot figure it out how to do it

Also, I hope I can know where I can find officical documentation of d3js.

Body:
How can I add tooltips in this piechart?
`
``

  <button onclick="update(data2006)">2006</button>
  <button onclick="update(data2007)">2007</button>

<select id="selectButton">
  <option></option>
</select>

I have been trying to find out the way to put some legend or tooltips in this pie chart but I don't know how to do it. I tried to tool tip and legend in this piechart but I cannot figure it out how to do it

Also, I hope I can know where I can find officical documentation of d3js.


来源: stackexchange

问:
Best practice to handle patch / delete in REST API
I have a collection of Employees, on which CRUD operations can be performed.

I am working on 2 given endpoints

delete multiple employees in single API requests given the ids of the employees to be deleted is given in the body of the request.

update multiple employees using single API request.

Lets consider an example where one of the ID is not found in the list of employee ids to be deleted/deleted/updated, in this case should the whole request be rejected ? or delete the existing ones and send error response only for the not found id?

It would be helpful, if you could help me with the best practice.

Thank you,

KK

ContentLicense: CC BY-SA 4.0


问:
How to increase the compatibility of my React Native Application?
Currently I have been facing a version issue, when recently launching two applications, one is like: "Minimum OS version 5.0" and another one is like: "Minimum OS version 12.0"

I already checked the MinSDKVersion of both and they present the same situation:

Minimum OS version 12.0:
build.gradle

```<code>android {
     ndkVersion rootProject.ext.ndkVersion
     compileSdkVersion rootProject.ext.compileSdkVersion

     defaultConfig {
         applicationId "com.myapp12"
         minSdk 31
         targetSdk 31
         versionCode 4
         versionName "4"

     splits {
         abi {
             reset()
             enable enableSeparateBuildPerCPUArchitecture
             universalApk false // If true, also generate a universal APK
             include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"

</code>```

Minimum OS version 5.0:
build.gradle

```<code>buildscript {
     ext {
         buildToolsVersion = "31.0.0"
         minSdkVersion = 21
         compileSdkVersion = 31
         targetSdkVersion = 31
         kotlin_version = '1.6.21'

         if (System.properties['os.arch'] =="aarch64") {
             // For M1 Users we need to use the NDK 24 which added support for aarch64
             ndkVersion="24.0.8215888"
         } else {
             // Otherwise we default to the side-by-side NDK version from AGP.
             ndkVersion = "21.4.7075529"

     repositories {
         Google()
         mavenCentral()

     dependencies {
         classpath("com.android.tools.build:gradle:7.2.1")
         classpath("com.facebook.react:react-native-gradle-plugin")
         classpath("de.undercouch:gradle-download-task:5.0.1")
         classpath 'com.google.gms:google-services:4.3.14'
         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files

</code>```

Body:
Currently I have been facing a version issue, when recently launching two applications, one is like: "Minimum OS version 5.0" and another one is like: "Minimum OS version 12.0"

I already checked the MinSDKVersion of both and they present the same situation:

Minimum OS version 12.0:
build.gradle

android {
     ndkVersion rootProject.ext.ndkVersion
     compileSdkVersion rootProject.ext.compileSdkVersion

     defaultConfig {
         applicationId "com.myapp12"
         minSdk 31
         targetSdk 31
         versionCode 4
         versionName "4"

     splits {
         abi {
             reset()
             enable enableSeparateBuildPerCPUArchitecture
             universalApk false // If true, also generate a universal APK
             include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"

Minimum OS version 5.0:
build.gradle

buildscript {
     ext {
         buildToolsVersion = "31.0.0"
         minSdkVersion = 21
         compileSdkVersion = 31
         targetSdkVersion = 31
         kotlin_version = '1.6.21'

         if (System.properties['os.arch'] =="aarch64") {
             // For M1 Users we need to use the NDK 24 which added support for aarch64
             ndkVersion="24.0.8215888"
         } else {
             // Otherwise we default to the side-by-side NDK version from AGP.
             ndkVersion = "21.4.7075529"

     repositories {
         Google()
         mavenCentral()

     dependencies {
         classpath("com.android.tools.build:gradle:7.2.1")
         classpath("com.facebook.react:react-native-gradle-plugin")
         classpath("de.undercouch:gradle-download-task:5.0.1")
         classpath 'com.google.gms:google-services:4.3.14'
         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files


问:
bug after installing nvidia drivers on ubuntu PREEMPT_RT kernel
I installed Nvidia drivers on my Ubuntu 20.04 PC with PREEMPT_RT kernel patch:5.15.79-rt54.For installation I used this tutorial: https://gist.github.com/pantor/9786c41c03a97bca7a52aa0a72fa9387.

After installation I'm getting this bug: bug scheduling while atomic: irq/88-s-nvidia/773/0x00000002. Bug appears sometimes every few seconds or few minutes.

I'm aware that nvidia drivers are not supported on realtime kernels but maybe anyone has found a solution to this problem or workaround? I don't have much experience with ubuntu kernels but PREEMPT_RT kernel is required to control 6DOF robotic arm that I'm working with. I also need CUDA for image processing that will determine movement of the robot. I was considering use of second PC that runs PREEMPT_RT kernel and commands robot velocities. I would make all calculations on the first machine(with Nvidia GPU and generic kernel) and transfer data over TCP/IP but I'm afraid that it would add to much latency to the system. I do apologize if I didn't provide enough information but I didn't really know what would be helpful in this situation.

I tried to install old version of nvidia drivers (520.56.06) but it didn't help.
This is Nvidia-smi output:

```<code>+-----------------------------------------------------------------------------+
| NVIDIA-SMI 520.56.06    Driver Version: 520.56.06    CUDA Version: 11.8     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0  On |                  N/A |
| N/A   38C    P8     5W /  N/A |    243MiB /  4096MiB |      2%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1629      G   /usr/lib/xorg/Xorg                 59MiB |
|    0   N/A  N/A      2154      G   /usr/lib/xorg/Xorg                 68MiB |
|    0   N/A  N/A      2278      G   /usr/bin/gnome-shell              104MiB |
+-----------------------------------------------------------------------------+

</code>```

Body:
I installed Nvidia drivers on my Ubuntu 20.04 PC with PREEMPT_RT kernel patch:5.15.79-rt54.For installation I used this tutorial: https://gist.github.com/pantor/9786c41c03a97bca7a52aa0a72fa9387.

After installation I'm getting this bug: bug scheduling while atomic: irq/88-s-nvidia/773/0x00000002. Bug appears sometimes every few seconds or few minutes.

I'm aware that nvidia drivers are not supported on realtime kernels but maybe anyone has found a solution to this problem or workaround? I don't have much experience with ubuntu kernels but PREEMPT_RT kernel is required to control 6DOF robotic arm that I'm working with. I also need CUDA for image processing that will determine movement of the robot. I was considering use of second PC that runs PREEMPT_RT kernel and commands robot velocities. I would make all calculations on the first machine(with Nvidia GPU and generic kernel) and transfer data over TCP/IP but I'm afraid that it would add to much latency to the system. I do apologize if I didn't provide enough information but I didn't really know what would be helpful in this situation.

I tried to install old version of nvidia drivers (520.56.06) but it didn't help.
This is Nvidia-smi output:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 520.56.06    Driver Version: 520.56.06    CUDA Version: 11.8     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0  On |                  N/A |
| N/A   38C    P8     5W /  N/A |    243MiB /  4096MiB |      2%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1629      G   /usr/lib/xorg/Xorg                 59MiB |
|    0   N/A  N/A      2154      G   /usr/lib/xorg/Xorg                 68MiB |
|    0   N/A  N/A      2278      G   /usr/bin/gnome-shell              104MiB |
+-----------------------------------------------------------------------------+


问:
React useState is called multiple times
I need to send a http request when the react component has loaded. I'm using the react useEffect function. The problem is that the useEffect function is called multiple times.

I searched and found that to call react useEffect once you need to add [] after the callback function. I tried this but it doesn't work. Thank you

This is my code:

```<code>
const LoginPage = () => {

  useEffect(() => {
    console.log("Log");
  }, []);

  return (
    <div className="login-container">

    </div>
  );
};
export default LoginPage;
</code>```

And this is the output console:

Title: React useState is called multiple times

Body:
I need to send a http request when the react component has loaded. I'm using the react useEffect function. The problem is that the useEffect function is called multiple times.

I searched and found that to call react useEffect once you need to add [] after the callback function. I tried this but it doesn't work. Thank you

This is my code:

const LoginPage = () => {

  useEffect(() => {
    console.log("Log");
  }, []);

  return (

  );
};
export default LoginPage;

And this is the output console:


问:
R the change of rnorm is rlnorm
I have my code that present my histogram correctly for rnorm:

```<code>pdf("plot1.pdf")
V_max=10
V_min=0
H=1
n=1

x_lim_min=-1
x_lim_max=13

par(mfrow=c(length(C)+1,1), mar = c(2,0,2,0),oma = c(1,5,0,0))

base_plot_fun <- function(x, x1, y, y1) {
  mean_x <- mean(x)
  mean_x1 <- mean(x1)

  # initialize the plot
  plot(
    0,
    0,
    ylim = range(c(y$counts, y1$counts)),
    xlim = range(c(y$breaks, y1$breaks)),
    xlab = "x",
    ylab = "counts",
    type = "n"

  )

  corners <- par('usr') # get the corners of the plots

  x_left <- corners[1]
  x_right <- quantile(x, 0.95) # at 95 percentile, change as needed

  x1_left <- x_right
  x1_right <- quantile(x1, 0.05) # at 5th percentile, change if needed

  rect(
    xleft = x_left,
    xright = x_right,
    ybottom = corners[3],
    ytop = corners[4],
    col = 'lightblue',
    density = 100
  )
  rect(
    xleft = x1_left,
    xright = x1_right,
    ybottom = corners[3],
    ytop = corners[4],
    col = 'pink',
    density = 100
  )

  plot(y, col='gray48',add=T,xlim=c(x_lim_min,x_lim_max))
  plot(y1, col='gray48',add=T,xlim=c(x_lim_min,x_lim_max))

  abline(v=x_right,col='steelblue',lwd=3)
  abline(v=x1_right,col='firebrick',lwd=3)
  abline(v=mean_x,col='forestgreen',lwd=3)
  abline(v=mean_x1,col='forestgreen',lwd=3)

}
x <- rnorm(100,V_min,1)
x1 <- rnorm(100,V_max,1)
y <- hist(x,plot=FALSE,breaks = 20)
y1 <- hist(x1, plot=FALSE,breaks=20)

base_plot_fun(x = x, x1 = x1, y = y, y1 = y1)

dev.off()
</code>```

I want to achieve a similar graph but for rlnorm

```<code>x <- rlnorm(100, meanlog = V_min, sdlog = 1)
 x1 <- rlnorm(100, meanlog = V_max, sdlog = 1)
</code>```

to what values do I have to change V_min , V_max (these can be changed) to achieve a graph with similar histograms and the distance between them as in plot1. I don't know how to do it so I'm asking for help.

Title: R the change of rnorm is rlnorm

Body:
I have my code that present my histogram correctly for rnorm:

pdf("plot1.pdf")
V_max=10
V_min=0
H=1
n=1

x_lim_min=-1
x_lim_max=13

par(mfrow=c(length(C)+1,1), mar = c(2,0,2,0),oma = c(1,5,0,0))

base_plot_fun <- function(x, x1, y, y1) {
  mean_x <- mean(x)
  mean_x1 <- mean(x1)

  # initialize the plot
  plot(
    0,
    0,
    ylim = range(c(y$counts, y1$counts)),
    xlim = range(c(y$breaks, y1$breaks)),
    xlab = "x",
    ylab = "counts",
    type = "n"

  )

  corners <- par('usr') # get the corners of the plots

  x_left <- corners[1]
  x_right <- quantile(x, 0.95) # at 95 percentile, change as needed

  x1_left <- x_right
  x1_right <- quantile(x1, 0.05) # at 5th percentile, change if needed

  rect(
    xleft = x_left,
    xright = x_right,
    ybottom = corners[3],
    ytop = corners[4],
    col = 'lightblue',
    density = 100
  )
  rect(
    xleft = x1_left,
    xright = x1_right,
    ybottom = corners[3],
    ytop = corners[4],
    col = 'pink',
    density = 100
  )

  plot(y, col='gray48',add=T,xlim=c(x_lim_min,x_lim_max))
  plot(y1, col='gray48',add=T,xlim=c(x_lim_min,x_lim_max))

  abline(v=x_right,col='steelblue',lwd=3)
  abline(v=x1_right,col='firebrick',lwd=3)
  abline(v=mean_x,col='forestgreen',lwd=3)
  abline(v=mean_x1,col='forestgreen',lwd=3)

}
x <- rnorm(100,V_min,1)
x1 <- rnorm(100,V_max,1)
y <- hist(x,plot=FALSE,breaks = 20)
y1 <- hist(x1, plot=FALSE,breaks=20)

base_plot_fun(x = x, x1 = x1, y = y, y1 = y1)

dev.off()

I want to achieve a similar graph but for rlnorm

x <- rlnorm(100, meanlog = V_min, sdlog = 1)
 x1 <- rlnorm(100, meanlog = V_max, sdlog = 1)

to what values do I have to change V_min , V_max (these can be changed) to achieve a graph with similar histograms and the distance between them as in plot1. I don't know how to do it so I'm asking for help.


问:
Spring Boot - how to process JSON data with nested objects?
I'm trying to make a recipe app and I have these models:

Recipe

```<code>public class Recipe {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;

    private String title;

    private Integer prepTime;

    private Integer cookTime;

    @OneToMany(fetch = FetchType.LAZY)
    private ArrayList<Ingredient> ingredients;

    private String instructions;

    private String notes;

    public Recipe(String title, Integer prepTime, Integer cookTime, ArrayList<Ingredient> ingredients, String instructions, String notes) {
        this.title = title;
        this.prepTime = prepTime;
        this.cookTime = cookTime;
        this.ingredients = ingredients;
        this.instructions = instructions;
        this.notes = notes;
    }
</code>```

Ingredient

```<code>public class Ingredient {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "product_id")
    private Product product;

    private Integer quantity;

    private Integer price;

    public Ingredient(Product product, int quantity, Integer price) {
        if (product != null) {
            this.product = product;
        }
        this.quantity = quantity;
        this.price = Objects.requireNonNullElseGet(price, () -> this.quantity * this.product.getPricePerUnit());
    }
</code>```

Product

```<code>public class Product {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;

    private String name;

    private String unit;

    private Integer pricePerUnit;

    public Product(String name, String unit, Integer price) {
        this.name = name;
        this.unit = unit;
        this.pricePerUnit = price;
    }
</code>```

I'm trying to create a new recipe and ingredients using existing products in my database, so I need to:

Get product ids from the JSON

Look up the product ids in the ProductRepository and return the relevant Product

Use those products in the Ingredients constructor to create a list of ingredients

Pass that list of ingredients to the Recipe constructor

My problem is how to reflect all this in my Recipe controller:

```<code>@PostMapping("/add")
    public void addRecipe(@RequestBody ??? data)
</code>```

This is my Json data for testing:

```<code>{
    "title": "Test Recipe",
    "prepTime": 20,
    "cookTime": 50,
    "ingredients": [
        {
            "product": 1,
            "quantity": 30
        }
    ],
    "instructions": "blah blah",
    "notes": "etc"
}
</code>```

Ideally I'd like to pass multiple parameters to @RequestBody (the list of product ids, the values for the remaining Ingredient fields, and the values for the remaining Recipe fields). Then I could proceed from step 2 above. The problem is that @RequestBody can't accept more than 1 parameter. Is there any way to make my controller find the product IDs first and create the Ingredients before trying to create a Recipe?

I have seen a potentially linked question here but it doesn't deal with where/how I can look up the Product id and get the Product before creating the Ingredient.

Body:
I'm trying to make a recipe app and I have these models:

Recipe

public class Recipe {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;

    private String title;

    private Integer prepTime;

    private Integer cookTime;

    @OneToMany(fetch = FetchType.LAZY)
    private ArrayList<Ingredient> ingredients;

    private String instructions;

    private String notes;

    public Recipe(String title, Integer prepTime, Integer cookTime, ArrayList<Ingredient> ingredients, String instructions, String notes) {
        this.title = title;
        this.prepTime = prepTime;
        this.cookTime = cookTime;
        this.ingredients = ingredients;
        this.instructions = instructions;
        this.notes = notes;
    }

Ingredient

public class Ingredient {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "product_id")
    private Product product;

    private Integer quantity;

    private Integer price;

    public Ingredient(Product product, int quantity, Integer price) {
        if (product != null) {
            this.product = product;
        }
        this.quantity = quantity;
        this.price = Objects.requireNonNullElseGet(price, () -> this.quantity * this.product.getPricePerUnit());
    }

Product

public class Product {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;

    private String name;

    private String unit;

    private Integer pricePerUnit;

    public Product(String name, String unit, Integer price) {
        this.name = name;
        this.unit = unit;
        this.pricePerUnit = price;
    }

I'm trying to create a new recipe and ingredients using existing products in my database, so I need to:

Get product ids from the JSON

Look up the product ids in the ProductRepository and return the relevant Product

Use those products in the Ingredients constructor to create a list of ingredients

Pass that list of ingredients to the Recipe constructor

My problem is how to reflect all this in my Recipe controller:

@PostMapping("/add")
    public void addRecipe(@RequestBody ??? data)

This is my Json data for testing:

{
    "title": "Test Recipe",
    "prepTime": 20,
    "cookTime": 50,
    "ingredients": [
        {
            "product": 1,
            "quantity": 30
        }
    ],
    "instructions": "blah blah",
    "notes": "etc"
}

Ideally I'd like to pass multiple parameters to @RequestBody (the list of product ids, the values for the remaining Ingredient fields, and the values for the remaining Recipe fields). Then I could proceed from step 2 above. The problem is that @RequestBody can't accept more than 1 parameter. Is there any way to make my controller find the product IDs first and create the Ingredients before trying to create a Recipe?

I have seen a potentially linked question here but it doesn't deal with where/how I can look up the Product id and get the Product before creating the Ingredient.


问:
Questions About AST Validation
I’m writing a transpiler and came accross the topic of validating the input. I have some questions, but would also like to double-check if I understood everything correctly. To my understanding, there are 3 main validations you have to do when transpiling (or compiling) a programming language:

Syntax/grammar validation. This is done in my case by ANTLR which makes sure the input respects the BNF grammar.

Context validation. ANTLR only makes sure the input respects the grammar, but the grammar is context-free: for example the grammar of Java allows public, private, protected access modifiers on a class, but it will allow a class to have all 3 of them, it doesn’t know that a class should only have one of them. So this second validation makes sure that, for example, a class does not have more than one access modifier - I imagine I can do this as a visitor pattern on my AST, right?

Dependencies/references validation. Check that we have, for example, all the classes which are declared as import statements in the current compilation unit - this also seems fairly easy, but what do you do about method references/calls to 3rd party classes? Say, for example, your code calls a class from JDK – how do you check that a reference to that class is correct, do you need to also compile that class and add it to your AST?

For example, you can use java.util.List in Kotlin. How does the Kotlin compiler know to tell you if you are using a String instead of an Integer when calling List.get(int index)? Does the Kotlin compiler also compile the java.util.List interface?

Thank you for reading, any response is appreciated.

Title: Questions About AST Validation


问:
Regarding fltk installation
I am new to c++ and overall programming. I tried reading one book by Bjarne Stroustrup he mentioned in the very first chapter to first install fltk and write the code. Should I install fltk or use online compiler. If I should install fltk then please tell how as I am unable to do so. Thank you.

I tried downloading and unzipping the fltk file two times. It got unzipped but the fltk.snl file is getting opened by visual studios but othing is happening since I am unable to run c++ code in VS.

Title: Regarding fltk installation


问:
How to build with maven inside docker container using dependency on a docker image?
I have 2 spring boot projects, one of them is the "core" which is used as a dependency by the second, called here "sascar".

I have a Dockerfile to generate the core image:

```<code>FROM maven:3.3-jdk-8

WORKDIR /opt/ivr-engine-core

ADD ./engine-core/. /opt/engine-core

RUN ls -la /opt/engine-core

RUN mvn clean install

</code>```

Then I run to build the image:

```<code>docker build . -t engine-core
</code>```

Then I start a docker container with the image just created using the main project (engine-sascar inside the app folder) and enter in the bash:

```<code>docker run -it --rm -w /app -v "$PWD/engine-sascar:/app" engine-core:latest bash
</code>```

When inside the container I try to run the maven command to package or install, the point is, this main project can´t reach the core project to use its classes:

```<code>mvn clean package
</code>```

Resulting in:

```<code>[INFO] Compiling 35 source files to /app/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /app/src/main/java/com/app/sascar/StepOne.java:[8,33] package com.engine.core does not exist
</code>```

How could I make this maven project inside this container "see" those classes inside the image I created before?

Body:
I have 2 spring boot projects, one of them is the "core" which is used as a dependency by the second, called here "sascar".

I have a Dockerfile to generate the core image:

FROM maven:3.3-jdk-8

WORKDIR /opt/ivr-engine-core

ADD ./engine-core/. /opt/engine-core

RUN ls -la /opt/engine-core

RUN mvn clean install

Then I run to build the image:

docker build . -t engine-core

Then I start a docker container with the image just created using the main project (engine-sascar inside the app folder) and enter in the bash:

docker run -it --rm -w /app -v "$PWD/engine-sascar:/app" engine-core:latest bash

When inside the container I try to run the maven command to package or install, the point is, this main project can´t reach the core project to use its classes:

mvn clean package

Resulting in:

[INFO] Compiling 35 source files to /app/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /app/src/main/java/com/app/sascar/StepOne.java:[8,33] package com.engine.core does not exist

How could I make this maven project inside this container "see" those classes inside the image I created before?


问:
Window.onblur or Window.onfocus not working in Android Studio
I implemented a simple Javascript function, which allows the audio to be paused or start depending on if the window where the script runs is focused on or not, and it works on the web.

However, I noticed an issue when I try to implement it in android studio, even after enabling the JS as seen in the screenshot. Indeed, when I get out of the app, the sound is still running whether I click on the back or the home button.

I'd like to add as well that I'm a total beginner in the android studio IDE, but I wanted to know if I could maybe find an answer here. How to make my Javascript-script work in the android environment ?

Thanks in advance

Audio Initialization

Javascript function for window.onblur and window.onfocus

Enabled Javascript in MainActivity.Java


问:
want to click the menu bar to display relevant forms in the active tabs and tabs should be dynamically added as of firefox and chrome
```<code><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <link type="text/css" href="themes/base/jquery.ui.all.css" rel="stylesheet" />
    <script type="text/javascript" src="jquery-1.4.2.js"></script>
    <script type="text/javascript" src="ui/jquery.ui.core.js"></script>
    <script type="text/javascript" src="ui/jquery.ui.widget.js"></script>
    <script type="text/javascript" src="ui/jquery.ui.button.js"></script>
    <script type="text/javascript" src="ui/jquery.ui.tabs.js"></script>
    <script type="text/javascript" src="ui/jquery.ui.dialog.js"></script>
<link rel=stylesheet href=css/itemstyle.css type=text/css>

<link rel="stylesheet" href="menubar.css" type="text/css" />
<script type="text/javascript" src="menubar.js"></script>

    <link type="text/css" href="demos.css" rel="stylesheet" />

    <style type="text/css">

        #tabs { margin-top: 1em; }
        #tabs li .ui-icon-close { float: right; margin: 0.4em 0.2em 0 0; cursor: pointer; }
            #tabs li .ui-icon-open { float: left; margin: 0.4em 0.2em 0 0; cursor: hand; }
        #add_tab { cursor: pointer; }
    </style>

    <script type="text/javascript">
    $(function() {
        var $tab_title_input = $('#tab_title'), $tab_content_input = $('#tab_content');
        var tab_counter = 0;

        // tabs init with a custom tab template and an "add" callback filling in the content
        var $tabs = $('#tabs').tabs({
            tabTemplate: '<li><a href="#{href}">#{label}</a> <span class="ui-icon ui-icon-close">Remove Tab</span> <span class="ui-icon ui-icon-open">Add Tab</span></li> ',
            add: function(event, ui) {
                var tab_content = $tab_content_input.val() || 'Tab '+tab_counter+' content.';
                $(ui.panel).append('<p>'+tab_content+'</p>');

            }
        });

        // actual addTab function: adds new tab using the title input from the form above

 $('#tabs span.ui-icon-open').live('click', function() {
var tab_title = $tab_title_input.val() || 'Tab '+tab_counter;
            $tabs.tabs('add', '#tabs-'+tab_counter, tab_title);
            tab_counter++;
        });

        // close icon: removing the tab on click

        $('#tabs span.ui-icon-close').live('click', function() {
            var index = $('li',$tabs).index($(this).parent());
            $tabs.tabs('remove', index);
        });
    });
    </script>
</head>
<body>
    <ul class="menu" id="menu">
    <li><a href="#" class="menulink" >HOME</a>
        <ul>
            <li><a href="#">HOME</a></li>
            <li>
                <a href="#" class="sub">DashBoard</a>
                <ul>
                    <li class="topline"><a href="#">HOME</a></li>
                    <li><a href="#">DashBoard</a></li>
                    <li><a href="#">Navigation Item 3</a></li>
                    <li><a href="#">Navigation Item 4</a></li>
                    <li><a href="#">Navigation Item 5</a></li>
                </ul>
            </li>
            <li>
                <a href="#" class="sub">Navigation Item 3</a>
                <ul>
                    <li class="topline"><a href="#">HOME</a></li>
                    <li><a href="#">DashBoard</a></li>
                    <li>
                        <a href="#" class="sub">Navigation Item 3</a>
                        <ul>
                            <li class="topline"><a href="#">HOME</a></li>
                            <li><a href="#">DashBoard</a></li>
                            <li><a href="#">Navigation Item 3</a></li>
                            <li><a href="#">Navigation Item 4</a></li>
                            <li><a href="#">Navigation Item 5</a></li>
                            <li><a href="#">Navigation Item 6</a></li>
                        </ul>
                    </li>
                    <li><a href="#">Navigation Item 4</a></li>
                </ul>
            </li>
            <li><a href="#">Navigation Item 4</a></li>
            <li><a href="#">Navigation Item 5</a></li>
        </ul>
    </li>
    <li><a href="#" class="menulink">SALES</a></li>
    <li>
        <a href="#" class="menulink">PURCHASE</a>
        <ul>
            <li><a href="#">HOME</a></li>
            <li>
                <a href="#" class="sub">DashBoard</a>
                <ul>
                    <li class="topline"><a href="#">HOME</a></li>
                    <li><a href="#">DashBoard</a></li>
                    <li><a href="#">Navigation Item 3</a></li>
                </ul>
            </li>
        </ul>
    </li>
    <li>
        <a href="#" class="menulink">USERDEFINED</a>
        <ul>
            <li><a href="#">HOME</a></li>
            <li><a href="#">DashBoard</a></li>
            <li><a href="#">Navigation Item 3</a></li>
            <li><a href="#">Navigation Item 4</a></li>
            <li><a href="#">Navigation Item 5</a></li>

        </ul>
    </li>
</ul>

    <div id="tabs">
        <ul>
            <li><a href="#tabs-1">Item Group</a> <span class="ui-icon ui-icon-close">Remove Tab</span>

            <span class="ui-icon ui-icon-open">add tab</span> </li>

        </ul>
        <div id="tabs-1">

    </div>

</div>

 <script type="text/javascript">
    var menu=new menu.dd("menu");
    menu.init("menu","menuhover");
</script>
</body>
</html>
</code>```

ContentLicense: CC BY-SA 3.0

Body:
<!DOCTYPE html>

    <meta charset="UTF-8" />
    <link type="text/css" href="themes/base/jquery.ui.all.css" rel="stylesheet" />

<link rel=stylesheet href=css/itemstyle.css type=text/css>

<link rel="stylesheet" href="menubar.css" type="text/css" />

    <link type="text/css" href="demos.css" rel="stylesheet" />

HOME

HOME

                DashBoard

HOME

DashBoard

Navigation Item 3

Navigation Item 4

Navigation Item 5

                Navigation Item 3

HOME

DashBoard

                        Navigation Item 3

HOME

DashBoard

Navigation Item 3

Navigation Item 4

Navigation Item 5

Navigation Item 6

Navigation Item 4

Navigation Item 4

Navigation Item 5

SALES

        PURCHASE

HOME

                DashBoard

HOME

DashBoard

Navigation Item 3

        USERDEFINED

HOME

DashBoard

Navigation Item 3

Navigation Item 4

Navigation Item 5

Item Group Remove Tab

            add tab


问:
How to debug SQL error correctly on DBeaver, if details are only related to JAVA error messages
Is there a better way to debug SQL code, instead of being struggling with JAVA error messages on DBeaver Client v22?

In this scenario SQL execution has returned an error in the UNION statement, which is related to an unidentified query.

SQL script has 1023 lines, and around 20 queries containing UNION.
AS I don't want to run every query isolated...

How would I narrow down and detail further the SQL error. which line is it? what query?

what are the last lines from the stack?


问:
'AggsProxy' object is not callable error on Python when trying to access ES aggregations
I am trying to query elasticsearch from pyton. What I want to do is first search the keyword and then I want to count of the each keyword after the match query.Here's my code:

```<code>from elasticsearch import Elasticsearch
from elasticsearch_dsl import Search, Q, A
from elasticsearch_dsl.query import Match
import pandas as pd #for analyzing the data
#Created a client here
print("keyword?)
keyword= input()
q = (Q("match", myfield=keyword))
a = A("terms", field="myfield")
s = Search(using=client, index="myindex").query(q)
s.aggs(a)
response=s.execute()
bucket_results = response.aggregations.bucket
for key, value in bucket_results.items():
     print(key, value)
</code>```

Match query works just fine but when I tried to add aggregations part I get this error:
s.aggs(a)
TypeError: 'AggsProxy' object is not callable bucket_results = response.aggregations.bucket() instead of attribute

I also tried to access aggregations with method bucket_results = response.aggregations.bucket() instead of attribute but that doesn't seem to work also. What should I do? Why this error occurred?

p.s: I am connected to a remote server. Is it possible that I am not allowed to do aggs?

Body:
I am trying to query elasticsearch from pyton. What I want to do is first search the keyword and then I want to count of the each keyword after the match query.Here's my code:

from elasticsearch import Elasticsearch
from elasticsearch_dsl import Search, Q, A
from elasticsearch_dsl.query import Match
import pandas as pd #for analyzing the data
#Created a client here
print("keyword?)
keyword= input()
q = (Q("match", myfield=keyword))
a = A("terms", field="myfield")
s = Search(using=client, index="myindex").query(q)
s.aggs(a)
response=s.execute()
bucket_results = response.aggregations.bucket
for key, value in bucket_results.items():
     print(key, value)

Match query works just fine but when I tried to add aggregations part I get this error:
s.aggs(a)
TypeError: 'AggsProxy' object is not callable bucket_results = response.aggregations.bucket() instead of attribute

I also tried to access aggregations with method bucket_results = response.aggregations.bucket() instead of attribute but that doesn't seem to work also. What should I do? Why this error occurred?

p.s: I am connected to a remote server. Is it possible that I am not allowed to do aggs?


问:
Incompatible shapes error when running VGG16 model
I'm getting the following error and for the life of me I cant figure out how to make the input compatible.

```<code>    File "/usr/local/lib/python3.8/dist-packages/keras/losses.py", line 139, in __call__
        losses = call_fn(y_true, y_pred)
    File "/usr/local/lib/python3.8/dist-packages/keras/losses.py", line 243, in call  **
        return ag_fn(y_true, y_pred, **self._fn_kwargs)
    File "/usr/local/lib/python3.8/dist-packages/keras/losses.py", line 1787, in categorical_crossentropy
        return backend.categorical_crossentropy(
    File "/usr/local/lib/python3.8/dist-packages/keras/backend.py", line 5119, in categorical_crossentropy
        target.shape.assert_is_compatible_with(output.shape)

    ValueError: Shapes (None, None) and (None, 7, 7, 2) are incompatible
</code>```

Where did I go wrong?

img_size=(224,224)
channels=3
batch_size=20
img_shape=(img_size[0], img_size[1], channels)

gen=ImageDataGenerator(ImageDataGenerator(rescale = 1./255))

train_gen=gen.flow_from_directory(directory = train, target_size=img_size, class_mode='categorical',
                                    color_mode='rgb', shuffle=True, batch_size=batch_size)

test_gen=gen.flow_from_directory(directory = test, target_size=img_size, class_mode='categorical',
                                    color_mode='rgb', shuffle=False, batch_size=batch_size)

valid_gen=gen.flow_from_directory(directory = val, target_size=img_size, class_mode='categorical',
                                    color_mode='rgb', shuffle=True, batch_size=batch_size)

model_name='VGG16'
base_model = tf.keras.applications.VGG16(input_shape=img_shape,
                                                include_top=False, weights="imagenet")
base_model.trainable = False
x=base_model.output
x=keras.layers.BatchNormalization(axis=-1, momentum=0.99, epsilon=0.001 )(x)
x = Dense(256, kernel_regularizer = regularizers.l2(l = 0.016),activity_regularizer=regularizers.l1(0.006),
                bias_regularizer=regularizers.l1(0.006) ,activation='relu')(x)
x=Dropout(rate=.45, seed=123)(x)
output=Dense(2, activation='softmax', name="pred")(x)
model=Model(inputs=base_model.input, outputs=output)
model.compile(Adamax(learning_rate=.001), loss='categorical_crossentropy', metrics=['accuracy',f1_score])
```

EDIT: Added more of the traceback

Body:
I'm getting the following error and for the life of me I cant figure out how to make the input compatible.

    File "/usr/local/lib/python3.8/dist-packages/keras/losses.py", line 139, in __call__
        losses = call_fn(y_true, y_pred)
    File "/usr/local/lib/python3.8/dist-packages/keras/losses.py", line 243, in call  **
        return ag_fn(y_true, y_pred, **self._fn_kwargs)
    File "/usr/local/lib/python3.8/dist-packages/keras/losses.py", line 1787, in categorical_crossentropy
        return backend.categorical_crossentropy(
    File "/usr/local/lib/python3.8/dist-packages/keras/backend.py", line 5119, in categorical_crossentropy
        target.shape.assert_is_compatible_with(output.shape)

    ValueError: Shapes (None, None) and (None, 7, 7, 2) are incompatible

Where did I go wrong?

img_size=(224,224)
channels=3
batch_size=20
img_shape=(img_size[0], img_size[1], channels)

gen=ImageDataGenerator(ImageDataGenerator(rescale = 1./255))

train_gen=gen.flow_from_directory(directory = train, target_size=img_size, class_mode='categorical',
                                    color_mode='rgb', shuffle=True, batch_size=batch_size)

test_gen=gen.flow_from_directory(directory = test, target_size=img_size, class_mode='categorical',
                                    color_mode='rgb', shuffle=False, batch_size=batch_size)

valid_gen=gen.flow_from_directory(directory = val, target_size=img_size, class_mode='categorical',
                                    color_mode='rgb', shuffle=True, batch_size=batch_size)

model_name='VGG16'
base_model = tf.keras.applications.VGG16(input_shape=img_shape,
                                                include_top=False, weights="imagenet")
base_model.trainable = False
x=base_model.output
x=keras.layers.BatchNormalization(axis=-1, momentum=0.99, epsilon=0.001 )(x)
x = Dense(256, kernel_regularizer = regularizers.l2(l = 0.016),activity_regularizer=regularizers.l1(0.006),
                bias_regularizer=regularizers.l1(0.006) ,activation='relu')(x)
x=Dropout(rate=.45, seed=123)(x)
output=Dense(2, activation='softmax', name="pred")(x)
model=Model(inputs=base_model.input, outputs=output)
model.compile(Adamax(learning_rate=.001), loss='categorical_crossentropy', metrics=['accuracy',f1_score])

EDIT: Added more of the traceback


问:
Rust to Python FFI erroring with "invalid pointer"
I'm building a Rust to python FFI using libc and I am encountering a "invalid pointer" error. On the python side of things, I'm doing:

print(CDLL("./libshared.so").print_stuff(c_char_p("test".encode("utf-8")), 4))
```
<p>...which does print the intended value but then errors with:</p>
```munmap_chunk(): invalid pointer
Fatal Python error: Aborted

Current thread 0x00007eff895ee740 (most recent call first):
  File <FILE>, line 7 in <module>
Aborted
```
<p>I'm assuming that this is occurring because a pointer has been freed by Rust, but C does not know that. Hence, I'm trying to free this pointer by using <code>libc::free</code>. In order to do this, I need to somehow convert the <code>String</code> type to <code>*mut _</code> that the method can receive as an argument. I've tried coersion and transmutation, but neither would be possible. Below is my Rust code.</p>
<pre class="lang-rs prettyprint-override"><code>unsafe {
        let string = String::from_raw_parts(array as *mut u8, length, 5);
        println!("{:?}", string);
        libc::free(/* variable string somehow converted to type c_void **/);
};
</code>```

Body:
I'm building a Rust to python FFI using libc and I am encountering a "invalid pointer" error. On the python side of things, I'm doing:

print(CDLL("./libshared.so").print_stuff(c_char_p("test".encode("utf-8")), 4))

...which does print the intended value but then errors with:

munmap_chunk(): invalid pointer
Fatal Python error: Aborted

Current thread 0x00007eff895ee740 (most recent call first):
  File <FILE>, line 7 in <module>
Aborted

I'm assuming that this is occurring because a pointer has been freed by Rust, but C does not know that. Hence, I'm trying to free this pointer by using libc::free. In order to do this, I need to somehow convert the String type to *mut _ that the method can receive as an argument. I've tried coersion and transmutation, but neither would be possible. Below is my Rust code.

unsafe {
        let string = String::from_raw_parts(array as *mut u8, length, 5);
        println!("{:?}", string);
        libc::free(/* variable string somehow converted to type c_void **/);
};


问:
Jenkins 2.361.2 |Is it possible to hide nodes?
I have a Jenkins Server on version 2.361.2.
I have 2 users: test and test1
I have 2 jobs: job and job1
I have 2 nodes : node0 and node01

So, my user test can see job called job and my user test1 can only see job call job1

But users test and test1 can see all node:
The Result..

And, I see that my user test can only see node called node0 and my user test1 can only see node called node01
like that:
What I  want

I have installed the following plugin:

Authorized plugin

Restrict job

job-restriction

I have configure job restriction, but nodes are KO


问:
Android App Bundle: Google Play 150MB limit for xamarin project
Problem: When uploading my .aab to google, I'm told that certain configurations will result in a build over the 150MB limit.

i have tried in project cleared obj and bin files and clean the solution.


问:
how to change the background images according to the slide using swiper.js
How can I create a Swiper.js slider with full-width images in the background, but with three sliders per view? Here is an example of what I want it to look like: https://stinna-it.nl/alle-projecten.
I have tried to update the images from an array through Swiper.js, called "images", but it is not updating.

var images = [
  {
    id: "1",
    img: "https://i.im.ge/2022/12/15/dfE2sy.aura-blobb.png",
  },
  {
    id: "2",
    img: "https://i.im.ge/2022/12/15/df3XIx.almond-key.jpg",
  },
  {
    id: "3",
    img: "https://i.im.ge/2022/12/15/dfE2sy.aura-blobb.png",
  },
  {
    id: "4",
    img: "https://i.im.ge/2022/12/15/dfE2sy.aura-blobb.png",
  },
  {
    id: "5",
    img: "https://i.im.ge/2022/12/15/dfE2sy.aura-blobb.png",
  },
];
const img = document.querySelector(".prjctbg");
// for (i = 0; i < images.length; i++) {
//   console.log(images[i].img);
//   img.src = images[i].img;
// }
var swiper = new Swiper(".swiper-container", {
  pagination: {
    el: ".swiper-pagination",
    clickable: true,
  },
  spaceBetween: 1,
  slidesPerView: 2.5,
  centeredSlides: true,
  roundLengths: true,
  loop: true,
  loopAdditionalSlides: 30,
  navigation: {
    nextEl: ".swiper-button-next",
    prevEl: ".swiper-button-prev",
  },
  on: {
    slideChangeTransitionStart: function () {
      var imgElement = document.querySelector(".prjctbg");

      // Get the current slide index
      var slideIndex = this.realIndex;
      imgElement.src = images[slideIndex].img;
    },
  },
});```
<pre class="snippet-code-css lang-css prettyprint-override"><code>.projectSlider {
  width: 100vw;
  height: 100vh;
  position: relative;
  .prjctbg {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(8px);
    -webkit-filter: blur(8px);
    z-index:-1;
  }
}
.swiper-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.swiper-slide {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 200ms cubic-bezier(0.165, 0.84, 0.44, 1);
  transform: scale(0.8);
  text-align: center;
  //   transition: cubic-bezier(0.165, 0.84, 0.44, 1);
  p {
    overflow: hidden;
    color: #fff;
    span {
      transform: translateY(100px);
      transition: transform 1000ms cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s,
        transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s;
      display: block;
    }
  }
  h1 {
    color: #fff;
    font-size: 3em;
    line-height: 100%;
    transition: transform 1000ms cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s,
      transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s;
    margin: 0px;
    transform: scale(0.5);
  }
  &.swiper-slide-active {
    p {
      opacity: 1;
      transition-delay: 0.5s;
      span {
        transition: transform 1000ms cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s,
          transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s;
        transform: translateY(0px);
        display: block;
      }
    }
    h1 {
      transition: transform 1000ms cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s,
        transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s;
      transition-delay: 0.15s;
      transform: scale(1);
    }
    transform: scale(1);
  }
}</code>```

      <link
      rel="stylesheet"
      href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.2.0/css/swiper.css"
    />

                  Audiovisual

                  Design

                   Video Installation

                  Exhibition

                  Design

                   Multimedia Exhibition

                  Texts and

                  Images

                   website + Print Magazine

                  Material and

                  Light

                   Short Video

                  Dimension

                  Design

                   Rendered Image

                  App

                  Design

                   Sustainability App

        ```

Body:
How can I create a Swiper.js slider with full-width images in the background, but with three sliders per view? Here is an example of what I want it to look like: https://stinna-it.nl/alle-projecten.
I have tried to update the images from an array through Swiper.js, called "images", but it is not updating.

var images = [
  {
    id: "1",
    img: "https://i.im.ge/2022/12/15/dfE2sy.aura-blobb.png",
  },
  {
    id: "2",
    img: "https://i.im.ge/2022/12/15/df3XIx.almond-key.jpg",
  },
  {
    id: "3",
    img: "https://i.im.ge/2022/12/15/dfE2sy.aura-blobb.png",
  },
  {
    id: "4",
    img: "https://i.im.ge/2022/12/15/dfE2sy.aura-blobb.png",
  },
  {
    id: "5",
    img: "https://i.im.ge/2022/12/15/dfE2sy.aura-blobb.png",
  },
];
const img = document.querySelector(".prjctbg");
// for (i = 0; i < images.length; i++) {
//   console.log(images[i].img);
//   img.src = images[i].img;
// }
var swiper = new Swiper(".swiper-container", {
  pagination: {
    el: ".swiper-pagination",
    clickable: true,
  },
  spaceBetween: 1,
  slidesPerView: 2.5,
  centeredSlides: true,
  roundLengths: true,
  loop: true,
  loopAdditionalSlides: 30,
  navigation: {
    nextEl: ".swiper-button-next",
    prevEl: ".swiper-button-prev",
  },
  on: {
    slideChangeTransitionStart: function () {
      var imgElement = document.querySelector(".prjctbg");

      // Get the current slide index
      var slideIndex = this.realIndex;
      imgElement.src = images[slideIndex].img;
    },
  },
});

.projectSlider {
  width: 100vw;
  height: 100vh;
  position: relative;
  .prjctbg {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(8px);
    -webkit-filter: blur(8px);
    z-index:-1;
  }
}
.swiper-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.swiper-slide {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 200ms cubic-bezier(0.165, 0.84, 0.44, 1);
  transform: scale(0.8);
  text-align: center;
  //   transition: cubic-bezier(0.165, 0.84, 0.44, 1);
  p {
    overflow: hidden;
    color: #fff;
    span {
      transform: translateY(100px);
      transition: transform 1000ms cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s,
        transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s;
      display: block;
    }
  }
  h1 {
    color: #fff;
    font-size: 3em;
    line-height: 100%;
    transition: transform 1000ms cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s,
      transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s;
    margin: 0px;
    transform: scale(0.5);
  }
  &.swiper-slide-active {
    p {
      opacity: 1;
      transition-delay: 0.5s;
      span {
        transition: transform 1000ms cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s,
          transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s;
        transform: translateY(0px);
        display: block;
      }
    }
    h1 {
      transition: transform 1000ms cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s,
        transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s;
      transition-delay: 0.15s;
      transform: scale(1);
    }
    transform: scale(1);
  }
}

      <link
      rel="stylesheet"
      href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.2.0/css/swiper.css"
    />

                  Audiovisual

                  Design

                   Video Installation

                  Exhibition

                  Design

                   Multimedia Exhibition

                  Texts and

                  Images

                   website + Print Magazine

                  Material and

                  Light

                   Short Video

                  Dimension

                  Design

                   Rendered Image

                  App

                  Design

                   Sustainability App


问:
Flutter dart get continuous data from on changed function using future provider
I want to add search functionality from Api. It is a backend search, so I get data continuous when clicked on on-changed function. I use future provider to get data. Please tell how can I achieve that.
Here Is my design what I want to do. Ui Image Demo

Also Here Is my code demo

`

```<code>class SearchPage extends StatelessWidget {
  const SearchPage({super.key});

  @override
  Widget build(BuildContext context) {
    return MultiProvider(
      providers: [
        ChangeNotifierProvider(create: (context) => SearchProvider()),
      ],
      child: Consumer<SearchProvider>(
        builder: (context, value, child) => Scaffold(
          appBar: BuildSearchAppBar(),
          body: Body()
        ),
      ),
    );
  }
}
</code>```
```<code>class BuildSearchAppBar extends StatelessWidget with PreferredSizeWidget {
  BuildSearchAppBar({super.key});

  @override
  Size get preferredSize => const Size.fromHeight(kToolbarHeight);

  @override
  Widget build(BuildContext context) {
    SearchProvider provider = Provider.of<SearchProvider>(context);

    return AppBar(
      title: TextField(
        controller: provider.textEditingController,
        decoration: InputDecoration(
          alignLabelWithHint: true,
          floatingLabelBehavior: FloatingLabelBehavior.never,
          border: OutlineInputBorder(
            borderRadius: BorderRadius.circular(6.r),
          ),
          constraints: BoxConstraints.tight(Size(1.sw, 40.h)),
          labelText: "Search",
          prefixIcon: Icon(
            Icons.search,
            size: 20.r,
          ),
          labelStyle: TextStyle(fontSize: 15.sp, fontStyle: FontStyle.italic),
        ),
        onChanged: (value) {
          provider.showProductSuggetion();
        },
      ),
      actions: [
        IconButton(
          onPressed: () {
            provider.textEditingController.clear();
          },
          icon: const Icon(Icons.clear),
        ),
      ],
    );
  }
}
</code>```
```<code>class SearchProvider with ChangeNotifier {
  bool isClicked = false;
  final TextEditingController textEditingController = TextEditingController();

  void showProductSuggetion()  {
     isClicked = true;
    FutureProvider(
        create: (_) => searchSuggestionService(textEditingController.text),
        initialData: SearchSuggetionModel());

    notifyListeners();
  }

  Future<SearchSuggetionModel> searchSuggestionService(String keyword) async {
    Map<String, Map<String, Object>> singleProductVariable = {
      "productPrams": {"search": keyword, "visibility": true, "approved": true}
    };
    QueryResult queryResult = await qlclient.query(
      QueryOptions(
          document: gql(QueryDocument.searchSuggestion),
          variables: singleProductVariable),
    );

    var data = queryResult.data as Map<String, dynamic>;
    print(data);
    var body = SearchSuggetionModel.fromJson(data);
    notifyListeners();
    return body;
  }
}
</code>```

I want to implement backend search with continues data fetching using provider.

Body:
I want to add search functionality from Api. It is a backend search, so I get data continuous when clicked on on-changed function. I use future provider to get data. Please tell how can I achieve that.
Here Is my design what I want to do. Ui Image Demo

Also Here Is my code demo

`

class SearchPage extends StatelessWidget {
  const SearchPage({super.key});

  @override
  Widget build(BuildContext context) {
    return MultiProvider(
      providers: [
        ChangeNotifierProvider(create: (context) => SearchProvider()),
      ],
      child: Consumer<SearchProvider>(
        builder: (context, value, child) => Scaffold(
          appBar: BuildSearchAppBar(),
          body: Body()
        ),
      ),
    );
  }
}

class BuildSearchAppBar extends StatelessWidget with PreferredSizeWidget {
  BuildSearchAppBar({super.key});

  @override
  Size get preferredSize => const Size.fromHeight(kToolbarHeight);

  @override
  Widget build(BuildContext context) {
    SearchProvider provider = Provider.of<SearchProvider>(context);

    return AppBar(
      title: TextField(
        controller: provider.textEditingController,
        decoration: InputDecoration(
          alignLabelWithHint: true,
          floatingLabelBehavior: FloatingLabelBehavior.never,
          border: OutlineInputBorder(
            borderRadius: BorderRadius.circular(6.r),
          ),
          constraints: BoxConstraints.tight(Size(1.sw, 40.h)),
          labelText: "Search",
          prefixIcon: Icon(
            Icons.search,
            size: 20.r,
          ),
          labelStyle: TextStyle(fontSize: 15.sp, fontStyle: FontStyle.italic),
        ),
        onChanged: (value) {
          provider.showProductSuggetion();
        },
      ),
      actions: [
        IconButton(
          onPressed: () {
            provider.textEditingController.clear();
          },
          icon: const Icon(Icons.clear),
        ),
      ],
    );
  }
}

class SearchProvider with ChangeNotifier {
  bool isClicked = false;
  final TextEditingController textEditingController = TextEditingController();

  void showProductSuggetion()  {
     isClicked = true;
    FutureProvider(
        create: (_) => searchSuggestionService(textEditingController.text),
        initialData: SearchSuggetionModel());

    notifyListeners();
  }

  Future<SearchSuggetionModel> searchSuggestionService(String keyword) async {
    Map<String, Map<String, Object>> singleProductVariable = {
      "productPrams": {"search": keyword, "visibility": true, "approved": true}
    };
    QueryResult queryResult = await qlclient.query(
      QueryOptions(
          document: gql(QueryDocument.searchSuggestion),
          variables: singleProductVariable),
    );

    var data = queryResult.data as Map<String, dynamic>;
    print(data);
    var body = SearchSuggetionModel.fromJson(data);
    notifyListeners();
    return body;
  }
}

I want to implement backend search with continues data fetching using provider.


问:
How to store many Images to use on a Vue js website
I'm creating a vue js quiz website where every question will be connected to an image. I have a lot of questions for different quiz types and since every question will have an image I will end up with more than 1000 images. Now I store all images in the assets folder and I'm just testing with one quiz which has around 30 images and the app already loads quite slow. My question is, is there a way to store the images separately and just identify each image with an image path that is fetched from my backend?


问:
Adj.rand.index gives NaN values
My dataset is way too big so I show a dummy example that also works for my question.

I want to compute the similarity between two cluster results. Furthermore, if I have four clusters (A,B,C,D) for each result, I want to check not only the overall similarity of result 1 and result 2 but also the individual cluster similarity (A1 vs A2, B1 vs B2...)

To do it, let's say now I want to compare cluster A between the two results. For it, I create a vector for each result where, if 1 appears, a data point has been clustered to A, and 0 if not.

```<code>c1 <- c(0,0,0,0,0,0,0,1,1,0)
c2 <- c(0,0,1,0,1,1,0,1,0,0)
</code>```

Then I used the rand.index function

```<code>rand.index(c1,c2)
adj.rand.index(c1,c2)
</code>```

In this example, I get a rand.index of 0.46 and a adj.rand.index of NaN

if I change a bit c1 vector

```<code>c1 <- c(0,0,0,0,1,0,0,1,1,0)
c2 <- c(0,0,1,0,1,1,0,1,0,0)
</code>```

The rand.index goes up to 0.53, and the adj.rand.index is 1.

Can somebody help me and explain why I get these weird results with adj.rand.index?

Thanks in advance

Title: Adj.rand.index gives NaN values

Body:
My dataset is way too big so I show a dummy example that also works for my question.

I want to compute the similarity between two cluster results. Furthermore, if I have four clusters (A,B,C,D) for each result, I want to check not only the overall similarity of result 1 and result 2 but also the individual cluster similarity (A1 vs A2, B1 vs B2...)

To do it, let's say now I want to compare cluster A between the two results. For it, I create a vector for each result where, if 1 appears, a data point has been clustered to A, and 0 if not.

c1 <- c(0,0,0,0,0,0,0,1,1,0)
c2 <- c(0,0,1,0,1,1,0,1,0,0)

Then I used the rand.index function

rand.index(c1,c2)
adj.rand.index(c1,c2)

In this example, I get a rand.index of 0.46 and a adj.rand.index of NaN

if I change a bit c1 vector

c1 <- c(0,0,0,0,1,0,0,1,1,0)
c2 <- c(0,0,1,0,1,1,0,1,0,0)

The rand.index goes up to 0.53, and the adj.rand.index is 1.

Can somebody help me and explain why I get these weird results with adj.rand.index?

Thanks in advance


问:
Keyset Pagination for Nvarchar(max) column in sql server
Is it possible to do a key set pagination for nvarchar(max) column in sql server
I understand that its possible for int, dates as we can check < value or > value

Suppose I have a table

Someid
Name

1
Abc

2
Cde

Currently its written something like this

```<code>SELECT * FROM table
WHERE 'somelogic'
Order by Name Asc Offset 1 fetch 1

</code>```

The problem is its currently ordered by Name because thats the requirement
In page number 100th its taking a lot of time to fetch the result

Edit: Currently there is no condition present on filtering the result based on Name (where Name='somename' -- this is not present) only its being orderd by Name Asc. This is offset pagination if I am not wrong. I want to know if I can do a Keyset pagination for that.

Body:
Is it possible to do a key set pagination for nvarchar(max) column in sql server
I understand that its possible for int, dates as we can check < value or > value

Suppose I have a table

Someid
Name

1
Abc

2
Cde

Currently its written something like this

SELECT * FROM table
WHERE 'somelogic'
Order by Name Asc Offset 1 fetch 1

The problem is its currently ordered by Name because thats the requirement
In page number 100th its taking a lot of time to fetch the result

Edit: Currently there is no condition present on filtering the result based on Name (where Name='somename' -- this is not present) only its being orderd by Name Asc. This is offset pagination if I am not wrong. I want to know if I can do a Keyset pagination for that.


问:
How do I use each value of a dataframe column in a loop?
I want to scrape twitter through a series of longitude and latitude values.

I have those values loaded as a dataframe table:

worksheet = gc.open('LA Grid').sheet1

# get_all_values gives a list of rows.
rows = worksheet.get_all_values()
print(rows)

import pandas as pd
pd.DataFrame.from_records(rows)
```
<p>And then I need to run this loop:</p>
<pre class="lang-py prettyprint-override"><code>total = []
for index, row in df.iterrows():
    tloc = ' 34.052235, -118.243683, 30km'
df_coord = pd.DataFrame(itertools.islice(sntwitter.TwitterSearchScraper(
    'parking lot geocode:"{}"'.format(loc)).get_items(), 50))[['date', 'content']]

df_coord.head()
</code>```

How can I replace the longitude and latitude values for each of the rows in my table?

This is the original code:

```<code>pip install snscrape
import pandas as pd
import snscrape.modules.twitter as sntwitter
import itertools
loc = '34.052235, -118.243683, 30km'
df_coord = pd.DataFrame(itertools.islice(sntwitter.TwitterSearchScraper(
    'parking lot geocode:"{}"'.format(loc)).get_items(), 50))[['date', 'content']]

df_coord.head()
</code>```

Body:
I want to scrape twitter through a series of longitude and latitude values.

I have those values loaded as a dataframe table:

worksheet = gc.open('LA Grid').sheet1

# get_all_values gives a list of rows.
rows = worksheet.get_all_values()
print(rows)

import pandas as pd
pd.DataFrame.from_records(rows)

And then I need to run this loop:

total = []
for index, row in df.iterrows():
    tloc = ' 34.052235, -118.243683, 30km'
df_coord = pd.DataFrame(itertools.islice(sntwitter.TwitterSearchScraper(
    'parking lot geocode:"{}"'.format(loc)).get_items(), 50))[['date', 'content']]

df_coord.head()

How can I replace the longitude and latitude values for each of the rows in my table?

This is the original code:

pip install snscrape
import pandas as pd
import snscrape.modules.twitter as sntwitter
import itertools
loc = '34.052235, -118.243683, 30km'
df_coord = pd.DataFrame(itertools.islice(sntwitter.TwitterSearchScraper(
    'parking lot geocode:"{}"'.format(loc)).get_items(), 50))[['date', 'content']]

df_coord.head()


问:
Flutter is this possible canvas color is transparent but picture recorder image background is another?
Currently, I'm using this package to draw some images. And I'm saving this image. I reviewed package classes and functions and tried many solution to achieve my aim. But I haven't found any solution yet. Maybe I'm trying to do impossible thing so I want to ask this: Can we draw a transparent canvas then our output image background can be another color?

Here's some code snippet:

```<code>  canvas = Canvas(
    recorder,
    Rect.fromPoints(Offset.zero, Offset(size.width, size.height)),
  );

  paint.blendMode = mode;
  ui.Image src = await picture.toImage(size.width.toInt(), size.height.toInt());
  paint.isAntiAlias = true;
  canvas.drawImage(src, Offset.zero, paint);

  picture = recorder.endRecording();

  ui.Image img = await picture.toImage(size.width.toInt(), size.height.toInt());

  ByteData? imgBytes =
      await img.toByteData(format: ui.ImageByteFormat.rawStraightRgba);
</code>```

In above code snippet, we create a canvas and drawImage then we get the image bytes. But in this case, this image's background is transparent. But I want set red color. So when I
add

```<code>canvas.drawColor(Colors.red, BlendMode.src);
</code>```

My image can be created as I want, but this time I see a red canvas in my view. But I want a transparent canvas when I draw it. I only want to see output image's background is red.

Is this possible?

Body:
Currently, I'm using this package to draw some images. And I'm saving this image. I reviewed package classes and functions and tried many solution to achieve my aim. But I haven't found any solution yet. Maybe I'm trying to do impossible thing so I want to ask this: Can we draw a transparent canvas then our output image background can be another color?

Here's some code snippet:

  canvas = Canvas(
    recorder,
    Rect.fromPoints(Offset.zero, Offset(size.width, size.height)),
  );

  paint.blendMode = mode;
  ui.Image src = await picture.toImage(size.width.toInt(), size.height.toInt());
  paint.isAntiAlias = true;
  canvas.drawImage(src, Offset.zero, paint);

  picture = recorder.endRecording();

  ui.Image img = await picture.toImage(size.width.toInt(), size.height.toInt());

  ByteData? imgBytes =
      await img.toByteData(format: ui.ImageByteFormat.rawStraightRgba);

In above code snippet, we create a canvas and drawImage then we get the image bytes. But in this case, this image's background is transparent. But I want set red color. So when I
add

canvas.drawColor(Colors.red, BlendMode.src);

My image can be created as I want, but this time I see a red canvas in my view. But I want a transparent canvas when I draw it. I only want to see output image's background is red.

Is this possible?


问:
Subgraph not found using TFLite runtime interpreter on Raspberry Pi 4 Model B 32-bit
I have converted a trained keras model (ResNet50) and converted it into a TFLite model. However, when I run it in the Raspberry Pi 4 Model B, it returns an error saying "subgraph not found in the model".

Do I have to add anything to the keras model before converting it to a tflite model? What seems to be the problem?


问:
How to: Template class that contains container of it's base class derived objects
I want to establish a template class model that is structured in such a way that there is a base template, which in turn is to be stored in a derived template class as an object in a std::unordered_map.
Each object has a unique key, which can be of different data types (POD, struct, ...).
I don't know how to tell the derived container class to use the type of the key of the passed child class for the key of the unordered_map. Specifically if the objects have been derived from the base class and then are no longer template classes due to specialization.

What I did so far:

```<code>   **  // The base class**
   template <typename IDType> class XRObject {
   public:
    XRObject() : ID_() {
    }

    XRObject( const IDType& id) :
    ID_(id){
    }

    XRObject(const XRObject& other) : ID_(other.ID_)
    {
    }

    virtual ~XRObject() = default;

    IDType getID() const {
      return ID_;
    }
    void setID(const IDType& id) {
      ID_= id;
    };

  private:
    IDType  ID_;
  };

  // The derived container class
  template <class IDType=long, class T=XRObject> class XRObjectContainer : public XRObject<IDType> {
  public:

    using ptr_type = typename std::shared_ptr<T>;
    using container_type = typename std::unordered_map<**IDType of class T**, ptr_type>;

    using iterator = typename container_type::iterator;
    using const_iterator = typename container_type::const_iterator;

    using sorted_containter_type = typename std::multimap<std::wstring, **IDType of class T**>;
    using sorted_iterator = typename sorted_containter_type::const_iterator;

    XRObjectContainer() : XRObject<IDType>() {
    }

    XRObjectContainer(IDType id) {
    }

    XRObjectContainer(const XRObjectContainer& rhs) : XRObject<IDType>(rhs) {
    }

  protected:
    container_type         children_;
    sorted_containter_type sortedbyname_;
  };

  // Concrete class specialisation
  class XRUnit : public XRObject {
  public:

    XRUnit::XRUnit() : XRObjectContainer<long, XRUnit>(), Factor_(0.0, true) {
    }

    XRUnit::XRUnit(long id, double Factor) : XRObjectContainer<long, XRUnit>(id),
      Factor_(Factor) {

    }

  private:
    XRValue<double>     Factor_;

  };

  // The final container class using XRUnit as data members of the internal unordered_map container
  class XRUnits : public XRObjectContainer<std::string, XRUnit> {
  public:

    XRUnits::XRUnits() : XRObjectContainer<std::string, XRUnit>() {
    }

    XRUnits::XRUnits(const std::string& ID) : XRObjectContainer<std::string, XRUnit>(ID) {
    }

  };
</code>```

I don't know how I can get the IDType of class XRUnit automatically determined by the compiler and used in the template class XRUnits as the key type of it's std::unordered_map member? The IDType of the XRObjectType derived class defers from the IDType of the contained unordered_map elements IDType.

Body:
I want to establish a template class model that is structured in such a way that there is a base template, which in turn is to be stored in a derived template class as an object in a std::unordered_map.
Each object has a unique key, which can be of different data types (POD, struct, ...).
I don't know how to tell the derived container class to use the type of the key of the passed child class for the key of the unordered_map. Specifically if the objects have been derived from the base class and then are no longer template classes due to specialization.

What I did so far:

   **  // The base class**
   template <typename IDType> class XRObject {
   public:
    XRObject() : ID_() {
    }

    XRObject( const IDType& id) :
    ID_(id){
    }

    XRObject(const XRObject& other) : ID_(other.ID_)
    {
    }

    virtual ~XRObject() = default;

    IDType getID() const {
      return ID_;
    }
    void setID(const IDType& id) {
      ID_= id;
    };

  private:
    IDType  ID_;
  };

  // The derived container class
  template <class IDType=long, class T=XRObject> class XRObjectContainer : public XRObject<IDType> {
  public:

    using ptr_type = typename std::shared_ptr<T>;
    using container_type = typename std::unordered_map<**IDType of class T**, ptr_type>;

    using iterator = typename container_type::iterator;
    using const_iterator = typename container_type::const_iterator;

    using sorted_containter_type = typename std::multimap<std::wstring, **IDType of class T**>;
    using sorted_iterator = typename sorted_containter_type::const_iterator;

    XRObjectContainer() : XRObject<IDType>() {
    }

    XRObjectContainer(IDType id) {
    }

    XRObjectContainer(const XRObjectContainer& rhs) : XRObject<IDType>(rhs) {
    }

  protected:
    container_type         children_;
    sorted_containter_type sortedbyname_;
  };

  // Concrete class specialisation
  class XRUnit : public XRObject {
  public:

    XRUnit::XRUnit() : XRObjectContainer<long, XRUnit>(), Factor_(0.0, true) {
    }

    XRUnit::XRUnit(long id, double Factor) : XRObjectContainer<long, XRUnit>(id),
      Factor_(Factor) {

    }

  private:
    XRValue<double>     Factor_;

  };

  // The final container class using XRUnit as data members of the internal unordered_map container
  class XRUnits : public XRObjectContainer<std::string, XRUnit> {
  public:

    XRUnits::XRUnits() : XRObjectContainer<std::string, XRUnit>() {
    }

    XRUnits::XRUnits(const std::string& ID) : XRObjectContainer<std::string, XRUnit>(ID) {
    }

  };

I don't know how I can get the IDType of class XRUnit automatically determined by the compiler and used in the template class XRUnits as the key type of it's std::unordered_map member? The IDType of the XRObjectType derived class defers from the IDType of the contained unordered_map elements IDType.


问:
How to display camera stream in Blazor
I would like some advice on how to display video from webcam in div container. I am able to view the video from the camera via the url in webbrowser. Part of the url is the auth parameter, containing access data in base64 (http://192.168.1.12:10800/v1/camera?auth=3690ea86174beb9ca35c43bde5ba7f1cc450ed5=).
The question is, is it possible to display this as part of the me page?

I've tried using the <video> tag and setting the url to the src parameter, but nothing shows up.

Title: How to display camera stream in Blazor


问:
Poco C++ Net Post Request is handled twice
I have a strange issue when sending a Post Request to the Poco HTTP Server.
This is my example Code:

#include <iostream>
#include <Poco/Util/ServerApplication.h>
#include <Poco/Runnable.h>
#include <Poco/Random.h>
#include <Poco/Net/HTTPServerRequest.h>
#include <Poco/Net/HTTPServerResponse.h>
#include <Poco/Net/HTTPRequestHandlerFactory.h>
#include <Poco/Net/HTTPRequestHandler.h>
#include <Poco/Environment.h>
#include <Poco/Net/ServerSocket.h>
#include <Poco/Net/HTTPServer.h>

class ErrorEndpoint : public Poco::Net::HTTPRequestHandler {
public:

  ErrorEndpoint() {}
  void handleRequest(Poco::Net::HTTPServerRequest& request, Poco::Net::HTTPServerResponse& response) {
    response.setStatus(status_);

    std::string answer{ R"({"error":"failed"})" };

    response.setContentLength(answer.length());
    response.setContentType("application/json");

    auto& istream = response.send();
    istream << answer;
  }
private:
  std::string errorMessage_{};
  Poco::Net::HTTPResponse::HTTPStatus status_{};
};

class MyRequestHandlerFactory: public Poco::Net::HTTPRequestHandlerFactory {
public:
  MyRequestHandlerFactory() {}

  Poco::Net::HTTPRequestHandler*
  createRequestHandler(const Poco::Net::HTTPServerRequest& request) override {

    std::cout << request.getURI() << '\n';

    return new ErrorEndpoint;
  }
};

class MetricsSampleApp : public Poco::Util::ServerApplication {

protected:
  void initialize(Poco::Util::Application& app) override {
    loadConfiguration();
    Poco::Util::ServerApplication::initialize(app);
  }

  int main(const std::vector<std::string>& args) override {

    std::string ver = Poco::format("%d.%d.%d",  static_cast<int>(Poco::Environment::libraryVersion() >> 24),
      static_cast<int>((Poco::Environment::libraryVersion() >> 16) & 0xFF),
      static_cast<int>((Poco::Environment::libraryVersion() >> 8) & 0xFF));

    std::cout << ver << '\n';

    Poco::UInt16 port = 8080;
    Poco::Net::ServerSocket svs(port);
    Poco::Net::HTTPServer srv(new MyRequestHandlerFactory(), svs, new Poco::Net::HTTPServerParams());

    srv.start();

    waitForTerminationRequest();

    srv.stop();

    return EXIT_OK;
  }

};

POCO_SERVER_MAIN(MetricsSampleApp)
```
<p>If i'm now running the following command:</p>
```Invoke-RestMethod -Uri "http://localhost:8080/dummy" -H @{"Content-Type" = "application/json"} -Method Post -Body '{"format": "error","node id": "1"}'
```
<p>i get the following output:</p>
```1.12.3
/dummy
"error","node
```

The first line is the Poco Version which is printed after the start of the example Program.
The second is the URI to which i send the POST Request.
The third is printed together with the second and contains parts of the POST Body.

I'm using Poco in Version 1.12.3 on Windows.
Changing Invoke-RestMethod with curl leads to the excat same error.

Body:
I have a strange issue when sending a Post Request to the Poco HTTP Server.
This is my example Code:

#include <iostream>
#include <Poco/Util/ServerApplication.h>
#include <Poco/Runnable.h>
#include <Poco/Random.h>
#include <Poco/Net/HTTPServerRequest.h>
#include <Poco/Net/HTTPServerResponse.h>
#include <Poco/Net/HTTPRequestHandlerFactory.h>
#include <Poco/Net/HTTPRequestHandler.h>
#include <Poco/Environment.h>
#include <Poco/Net/ServerSocket.h>
#include <Poco/Net/HTTPServer.h>

class ErrorEndpoint : public Poco::Net::HTTPRequestHandler {
public:

  ErrorEndpoint() {}
  void handleRequest(Poco::Net::HTTPServerRequest& request, Poco::Net::HTTPServerResponse& response) {
    response.setStatus(status_);

    std::string answer{ R"({"error":"failed"})" };

    response.setContentLength(answer.length());
    response.setContentType("application/json");

    auto& istream = response.send();
    istream << answer;
  }
private:
  std::string errorMessage_{};
  Poco::Net::HTTPResponse::HTTPStatus status_{};
};

class MyRequestHandlerFactory: public Poco::Net::HTTPRequestHandlerFactory {
public:
  MyRequestHandlerFactory() {}

  Poco::Net::HTTPRequestHandler*
  createRequestHandler(const Poco::Net::HTTPServerRequest& request) override {

    std::cout << request.getURI() << '\n';

    return new ErrorEndpoint;
  }
};

class MetricsSampleApp : public Poco::Util::ServerApplication {

protected:
  void initialize(Poco::Util::Application& app) override {
    loadConfiguration();
    Poco::Util::ServerApplication::initialize(app);
  }

  int main(const std::vector<std::string>& args) override {

    std::string ver = Poco::format("%d.%d.%d",  static_cast<int>(Poco::Environment::libraryVersion() >> 24),
      static_cast<int>((Poco::Environment::libraryVersion() >> 16) & 0xFF),
      static_cast<int>((Poco::Environment::libraryVersion() >> 8) & 0xFF));

    std::cout << ver << '\n';

    Poco::UInt16 port = 8080;
    Poco::Net::ServerSocket svs(port);
    Poco::Net::HTTPServer srv(new MyRequestHandlerFactory(), svs, new Poco::Net::HTTPServerParams());

    srv.start();

    waitForTerminationRequest();

    srv.stop();

    return EXIT_OK;
  }

};

POCO_SERVER_MAIN(MetricsSampleApp)

If i'm now running the following command:

Invoke-RestMethod -Uri "http://localhost:8080/dummy" -H @{"Content-Type" = "application/json"} -Method Post -Body '{"format": "error","node id": "1"}'

i get the following output:

1.12.3
/dummy
"error","node

The first line is the Poco Version which is printed after the start of the example Program.
The second is the URI to which i send the POST Request.
The third is printed together with the second and contains parts of the POST Body.

I'm using Poco in Version 1.12.3 on Windows.
Changing Invoke-RestMethod with curl leads to the excat same error.


问:
how to static add openssl with c++ builder?
I am able to use openssl in the source code below, but without the libeay32.dll file, my project does not open. I want to add it static and eliminate the need for dlls. How can I do that ?

```<code>//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include <openssl/bio.h>
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
#pragma comment(lib, "libeay32.lib")
#pragma comment(lib, "ssleay32.lib")
TForm1 *Form1;
void __fastcall TForm1::Button1Click(TObject *Sender)
{
BIO* key;
void* buf;
key=BIO_new_mem_buf(buf,100);
}
//---------------------------------------------------------------------------
</code>```

I tried to compile statically but without success.

Body:
I am able to use openssl in the source code below, but without the libeay32.dll file, my project does not open. I want to add it static and eliminate the need for dlls. How can I do that ?

//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include <openssl/bio.h>
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
#pragma comment(lib, "libeay32.lib")
#pragma comment(lib, "ssleay32.lib")
TForm1 *Form1;
void __fastcall TForm1::Button1Click(TObject *Sender)
{
BIO* key;
void* buf;
key=BIO_new_mem_buf(buf,100);
}
//---------------------------------------------------------------------------

I tried to compile statically but without success.


问:
Lenovo legion 7 slim stuck on boot screen
I need help fixing my laptop. Yesterday I updated some drivers, rebooted my system , saw a black screen which appeared to be updating bios. I rebooted my laptop thinking I did something wrong.

Now my laptop gets stuck on the Legion screen everytime.I have a macrium backup image on my external but don't think that will work. At this point I just want to get into windows then I can restore my disk image from the external. All my data is backed up.

I have performed a system restore and it still gets stuck at the Legion screen. I've run a chkdsk and it doesn't find any issues. When I tried to run bootrec.exe \Rebuildbcd it doesn't locate a windows installation.

I tried going into safe mode and ultimately get a blue screen saying the following:
We've run into a problem and your device needs to be restarted.

Driver pnp watchdog error

I also got a log error for
srtTrail.txt


问:
how to fix a "no entries found error" when building for production with parcel bundler?
```<code>Server running at http://localhost:1234
×  No entries found.
    at Bundler.bundle (C:\Users\USER\AppData\Roaming\npm\node_modules\parcel-bundler\src\Bundler.js:275:17)
    at async Bundler.serve (C:\Users\USER\AppData\Roaming\npm\node_modules\parcel-bundler\src\Bundler.js:842:7)
    at async Command.bundle (C:\Users\USER\AppData\Roaming\npm\node_modules\parcel-bundler\src\cli.js:224:20)
</code>```

parcel-build and server rendering was working just fine until i tried hosting my project via netlify, the site couldn't be deployed by netlify and their Docs suggest to ensure the site is deploying just fine locally, going back to VSCode i tried rendering the page via the terminal using "parcel index.html", the site deploys just fine but when i try "parcel build" above is the error am getting, please help.

Body:
Server running at http://localhost:1234
×  No entries found.
    at Bundler.bundle (C:\Users\USER\AppData\Roaming\npm\node_modules\parcel-bundler\src\Bundler.js:275:17)
    at async Bundler.serve (C:\Users\USER\AppData\Roaming\npm\node_modules\parcel-bundler\src\Bundler.js:842:7)
    at async Command.bundle (C:\Users\USER\AppData\Roaming\npm\node_modules\parcel-bundler\src\cli.js:224:20)

parcel-build and server rendering was working just fine until i tried hosting my project via netlify, the site couldn't be deployed by netlify and their Docs suggest to ensure the site is deploying just fine locally, going back to VSCode i tried rendering the page via the terminal using "parcel index.html", the site deploys just fine but when i try "parcel build" above is the error am getting, please help.


问:
ACF Repeater fields in option pages (Timber)
I made a repeater field in my option pages using ACF Pro, but I can't get the value inside it. It creates an array within an array. I have the impression that it is not the case.

footer.twig:

```<code>{% for item in options.meta('footer_content') %}
    <div class="footer_content">
      <legend>{{item.title}}</legend>
    </div>
 {% endfor %}
</code>```

{{ dump(options) }}:

```<code>"footer" =>array:3 [▼0 =>array:1 [▼
      "title" => "test"
    ]
    1 =>array:1 [▼
      "title" => "test"
    ]
    2 =>array:1 [▼
      "title" => "test"
    ]
  ]
  "text" => "test"
]
</code>```

Does anyone have a solution to this problem of the locator in the option field with Twig and ACF?

Body:
I made a repeater field in my option pages using ACF Pro, but I can't get the value inside it. It creates an array within an array. I have the impression that it is not the case.

footer.twig:

{% for item in options.meta('footer_content') %}

      <legend>{{item.title}}</legend>

 {% endfor %}

{{ dump(options) }}:

"footer" =>array:3 [▼0 =>array:1 [▼
      "title" => "test"
    ]
    1 =>array:1 [▼
      "title" => "test"
    ]
    2 =>array:1 [▼
      "title" => "test"
    ]
  ]
  "text" => "test"
]

Does anyone have a solution to this problem of the locator in the option field with Twig and ACF?


问:
Need help creating an email signature with html/scss
I am a junior developer and I create a signature in html/scss.

When I copy/paste my rendering on gmail or outlook everything works fine but when I paste my rendering on windows email the rendering is distorted. Anyone know where the problem comes from?

Here is my code: https://codepen.io/kevinkotcherga/pen/WNyVdMb

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

table {
  td {
    padding: 0;
    // border: 1px solid black;
  }

  .td-empty-top {
    padding-top: 20px;
  }

  .td-empty-bottom {
    padding-bottom: 20px;
  }

  .td-skip-a-line {
    padding: 5px 0;
  }

  .td-logos {
    text-align: center;
  }

  .td-empty {
    visibility: hidden;
    margin: 0;
    padding: 0;
    line-height: 0;
  }
}

// .margin-right {
//   padding-right: 320px;
// }

.margin-right {
  padding-right: 170px;
}

.margin-right-keryan {
  padding-right: 212px;
}

.dev-in-net {
  width: 130px;
  padding: 0 30px 41px 30px;
}

.bold {
  font-weight: bold;
}

.padding-left {
  padding-left: 50px;
}

.logo {
  height: 20px;
  width: 20px;
  margin-right: 5px;
  margin-top: 2px;
}

.linkedin-devinnet {
  height: 23px;
  width: 23px;
}

.gif {
  width: 100px;
}

.keryan {
  font-size: 25px;
  color: #023047;
}

.font-size {
  font-size: 14px;
  color: #023047;
}

.vertical-divider {
  border-left: 3px solid #FFA033;
  height: 20px;
  margin: 0 10px;
}

a:-webkit-any-link {
  text-decoration: none !important;
}

a {
  text-decoration: none !important;
}

.color-link:-webkit-any-link {
  color: #023047 !important;
  text-decoration: none !important;
}

.center {
  display: flex;
  align-items: center;
}

.min-width-kevin {
  font-family: 'Noto Sans', sans-serif;
  min-width: 573px;
  border-top: solid 0.5px rgb(229, 229, 229);
  border-bottom: solid 0.5px rgb(229, 229, 229);
  min-width: 573px;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code>        <table class="min-width-kevin">
            <tbody>
                <tr>
                    <td class="td-empty-top" colspan="{2}"></td>
                </tr>
                <tr>
                    <td rowspan="8" class="td-img">
                        <img
                            class="dev-in-net"
                            src="https://devinnet.fr/images/images-email/devinnet-image-anime.gif"
                            alt=""
                        />
                    </td>
                    <td class="bold keryan margin-right">Name Surname</td>
                </tr>
                <tr>
                    <td class="font-size">
                        <span class="bold">Company</span>
                        <span class="vertical-divider"></span>Front end developer
                    </td>
                </tr>
                <tr>
                    <td>

                            <img
                                class="logo"
                                src="https://devinnet.fr/images/images-email/logo-www.png"
                                alt=""
                            />

                            <img
                                class="logo"
                                src="https://devinnet.fr/images/images-email/logo-github.png"
                                alt=""
                            />

                            <img
                                class="logo"
                                src="https://devinnet.fr/images/images-email/logo-linkedin.png"
                                alt=""
                            />

                    </td>
                </tr>
                <tr>
                    <td class="td-skip-a-line"></td>
                </tr>
                <tr>
                    <td class="font-size">

                            <span>contact@company.com</span>

                        <span class="vertical-divider"></span>
                         01 01 01 01 01
                    </td>
                </tr>
                <tr>
                    <td class="font-size">24 random street, NY</td>
                </tr>
                <tr>
                    <td class="font-size center">

                            <span>www.company.com</span>

                    </td>
                </tr>
                <tr>
                    <td class="td-empty-bottom" colspan="{2}"></td>
                </tr>
            </tbody>
        </table></code>```

I saw on some examples that developers indent tables in tables, I tried to reproduce the code but I don't understand the logic : https://academind.com/tutorials/build-a-custom-email-signature

Body:
I am a junior developer and I create a signature in html/scss.

When I copy/paste my rendering on gmail or outlook everything works fine but when I paste my rendering on windows email the rendering is distorted. Anyone know where the problem comes from?

Here is my code: https://codepen.io/kevinkotcherga/pen/WNyVdMb

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

table {
  td {
    padding: 0;
    // border: 1px solid black;
  }

  .td-empty-top {
    padding-top: 20px;
  }

  .td-empty-bottom {
    padding-bottom: 20px;
  }

  .td-skip-a-line {
    padding: 5px 0;
  }

  .td-logos {
    text-align: center;
  }

  .td-empty {
    visibility: hidden;
    margin: 0;
    padding: 0;
    line-height: 0;
  }
}

// .margin-right {
//   padding-right: 320px;
// }

.margin-right {
  padding-right: 170px;
}

.margin-right-keryan {
  padding-right: 212px;
}

.dev-in-net {
  width: 130px;
  padding: 0 30px 41px 30px;
}

.bold {
  font-weight: bold;
}

.padding-left {
  padding-left: 50px;
}

.logo {
  height: 20px;
  width: 20px;
  margin-right: 5px;
  margin-top: 2px;
}

.linkedin-devinnet {
  height: 23px;
  width: 23px;
}

.gif {
  width: 100px;
}

.keryan {
  font-size: 25px;
  color: #023047;
}

.font-size {
  font-size: 14px;
  color: #023047;
}

.vertical-divider {
  border-left: 3px solid #FFA033;
  height: 20px;
  margin: 0 10px;
}

a:-webkit-any-link {
  text-decoration: none !important;
}

a {
  text-decoration: none !important;
}

.color-link:-webkit-any-link {
  color: #023047 !important;
  text-decoration: none !important;
}

.center {
  display: flex;
  align-items: center;
}

.min-width-kevin {
  font-family: 'Noto Sans', sans-serif;
  min-width: 573px;
  border-top: solid 0.5px rgb(229, 229, 229);
  border-bottom: solid 0.5px rgb(229, 229, 229);
  min-width: 573px;
}

                    Name Surname

                        Company
                        Front end developer

                            contact@company.com

                         01 01 01 01 01

                    24 random street, NY

                            www.company.com

I saw on some examples that developers indent tables in tables, I tried to reproduce the code but I don't understand the logic : https://academind.com/tutorials/build-a-custom-email-signature