问:
Not able to see the updated values in react after creating a group
I am trying to perform a simple exercise, wherein I am showing the data from the local JSON file saved in my folder, and then reading it to show the data with useState, such that when a user clicks in he can edit the author and location filed and save it.

The issue I get is when I save the data in my group or location it does not populate the new value, however, it just removes the new value, but when I filter and select all values from the dropdown I can see the values in there.

Can anyone please let me know what is the missing part here? I want to achieve the task that when a user updates the value on the author group or location group they should be there with the new group value.

Please the link to the code below and a working demo on codeSandbox

watch the full code and demo here

The source code for the author group component I tried so far;

```<code>    import { useEffect, useState } from "react";
import {
  Container,
  Accordion,
  AccordionSummary,
  AccordionDetails,
  Typography,
  Button
} from "@mui/material";
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
import EditIcon from "@mui/icons-material/Edit";

const Authorsgroup = ({
  posts,
  groupDropdownValue,
  setShowForm,
  setPostId,
  showForm
}) => {

  const authorGroup = posts.reduce((group, authorgroup) => {
    (group[authorgroup.author.replace(/ +/g, "")] =
      group[authorgroup.author.replace(/ +/g, "")] || []).push(authorgroup);
    return group;
  }, {});

  const [authorGroupValues, setAuthorGroupValues] = useState(authorGroup);

  useEffect(() => {
    setAuthorGroupValues(authorGroup);
    console.log(authorGroupValues);
  }, [groupDropdownValue, showForm]);

  return (
    <>
      {/* all gorupby authors  */}

  <Container>
    {/* show group of Tapesh */}
    <Container style={{ marginTop: "3rem" }}>
      {authorGroupValues?.Tapesh.map((post, index) => (
        <Accordion key={index}>
          <AccordionSummary
            expandIcon={<ExpandMoreIcon />}
            aria-controls="panel1a-content"
            id="panel1a-header"
          >
            <Typography variant="h6" style={{ color: "#EB1283" }}>
              {post.id} {post.author} {post.location}
            </Typography>
          </AccordionSummary>
          <AccordionDetails>
            <Typography variant="h4">{post.location}</Typography>
            <Typography>{post.text}</Typography>
            <Button
              variant="outlined"
              onClick={() => {
                setShowForm(!showForm);
                setPostId(post.id);
              }}
              startIcon={<EditIcon />}
            >
              Edit
            </Button>
          </AccordionDetails>
        </Accordion>
      ))}
    </Container>

    {/* show group of HappyManager */}
    <Container style={{ marginTop: "3rem" }}>
      {authorGroupValues?.HappyManager.map((post, index) => (
        <Accordion key={index}>
          <AccordionSummary
            expandIcon={<ExpandMoreIcon />}
            aria-controls="panel1a-content"
            id="panel1a-header"
          >
            <Typography variant="h6" style={{ color: "orange" }}>
              {post.id} {post.author} {post.location}
            </Typography>
          </AccordionSummary>
          <AccordionDetails>
            <Typography variant="h4">{post.location}</Typography>
            <Typography>{post.text}</Typography>
            <Button
              variant="outlined"
              onClick={() => {
                setShowForm(!showForm);
                setPostId(post.id);
              }}
              startIcon={<EditIcon />}
            >
              Edit
            </Button>
          </AccordionDetails>
        </Accordion>
      ))}
    </Container>

    {/* show group of HappyDeveloper */}
    <Container style={{ marginTop: "3rem" }}>
      {authorGroupValues?.HappyDeveloper.map((post, index) => (
        <Accordion key={index}>
          <AccordionSummary
            expandIcon={<ExpandMoreIcon />}
            aria-controls="panel1a-content"
            id="panel1a-header"
          >
            <Typography variant="h6" style={{ color: "green" }}>
              {post.id} {post.author} {post.location}
            </Typography>
          </AccordionSummary>
          <AccordionDetails>
            <Typography variant="h4">{post.location}</Typography>
            <Typography>{post.text}</Typography>
            <Button
              variant="outlined"
              onClick={() => {
                setShowForm(!showForm);
                setPostId(post.id);
              }}
              startIcon={<EditIcon />}
            >
              Edit
            </Button>
          </AccordionDetails>
        </Accordion>
      ))}
    </Container>

    {/* show group of HappyUser */}
    <Container style={{ marginTop: "3rem" }}>
      {authorGroupValues?.HappyUser.map((post, index) => (
        <Accordion key={index}>
          <AccordionSummary
            expandIcon={<ExpandMoreIcon />}
            aria-controls="panel1a-content"
            id="panel1a-header"
          >
            <Typography variant="h6" style={{ color: "red" }}>
              {post.id} {post.author} {post.location}
            </Typography>
          </AccordionSummary>
          <AccordionDetails>
            <Typography variant="h4">{post.location}</Typography>
            <Typography>{post.text}</Typography>
            <Button
              variant="outlined"
              onClick={() => {
                setShowForm(!showForm);
                setPostId(post.id);
              }}
              startIcon={<EditIcon />}
            >
              Edit
            </Button>
          </AccordionDetails>
        </Accordion>
      ))}
    </Container>
  </Container>
</>
  );
};

export default Authorsgroup;
</code>```

Thanks any suggestions or help are really appreciated.

Body:
I am trying to perform a simple exercise, wherein I am showing the data from the local JSON file saved in my folder, and then reading it to show the data with useState, such that when a user clicks in he can edit the author and location filed and save it.

The issue I get is when I save the data in my group or location it does not populate the new value, however, it just removes the new value, but when I filter and select all values from the dropdown I can see the values in there.

Can anyone please let me know what is the missing part here? I want to achieve the task that when a user updates the value on the author group or location group they should be there with the new group value.

Please the link to the code below and a working demo on codeSandbox

watch the full code and demo here

The source code for the author group component I tried so far;

    import { useEffect, useState } from "react";
import {
  Container,
  Accordion,
  AccordionSummary,
  AccordionDetails,
  Typography,
  Button
} from "@mui/material";
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
import EditIcon from "@mui/icons-material/Edit";

const Authorsgroup = ({
  posts,
  groupDropdownValue,
  setShowForm,
  setPostId,
  showForm
}) => {

  const authorGroup = posts.reduce((group, authorgroup) => {
    (group[authorgroup.author.replace(/ +/g, "")] =
      group[authorgroup.author.replace(/ +/g, "")] || []).push(authorgroup);
    return group;
  }, {});

  const [authorGroupValues, setAuthorGroupValues] = useState(authorGroup);

  useEffect(() => {
    setAuthorGroupValues(authorGroup);
    console.log(authorGroupValues);
  }, [groupDropdownValue, showForm]);

  return (
    <>
      {/* all gorupby authors  */}

  <Container>
    {/* show group of Tapesh */}
    <Container style={{ marginTop: "3rem" }}>
      {authorGroupValues?.Tapesh.map((post, index) => (
        <Accordion key={index}>
          <AccordionSummary
            expandIcon={<ExpandMoreIcon />}
            aria-controls="panel1a-content"
            id="panel1a-header"
          >
            <Typography variant="h6" style={{ color: "#EB1283" }}>
              {post.id} {post.author} {post.location}
            </Typography>
          </AccordionSummary>
          <AccordionDetails>
            <Typography variant="h4">{post.location}</Typography>
            <Typography>{post.text}</Typography>
            <Button
              variant="outlined"
              onClick={() => {
                setShowForm(!showForm);
                setPostId(post.id);
              }}
              startIcon={<EditIcon />}
            >
              Edit
            </Button>
          </AccordionDetails>
        </Accordion>
      ))}
    </Container>

    {/* show group of HappyManager */}
    <Container style={{ marginTop: "3rem" }}>
      {authorGroupValues?.HappyManager.map((post, index) => (
        <Accordion key={index}>
          <AccordionSummary
            expandIcon={<ExpandMoreIcon />}
            aria-controls="panel1a-content"
            id="panel1a-header"
          >
            <Typography variant="h6" style={{ color: "orange" }}>
              {post.id} {post.author} {post.location}
            </Typography>
          </AccordionSummary>
          <AccordionDetails>
            <Typography variant="h4">{post.location}</Typography>
            <Typography>{post.text}</Typography>
            <Button
              variant="outlined"
              onClick={() => {
                setShowForm(!showForm);
                setPostId(post.id);
              }}
              startIcon={<EditIcon />}
            >
              Edit
            </Button>
          </AccordionDetails>
        </Accordion>
      ))}
    </Container>

    {/* show group of HappyDeveloper */}
    <Container style={{ marginTop: "3rem" }}>
      {authorGroupValues?.HappyDeveloper.map((post, index) => (
        <Accordion key={index}>
          <AccordionSummary
            expandIcon={<ExpandMoreIcon />}
            aria-controls="panel1a-content"
            id="panel1a-header"
          >
            <Typography variant="h6" style={{ color: "green" }}>
              {post.id} {post.author} {post.location}
            </Typography>
          </AccordionSummary>
          <AccordionDetails>
            <Typography variant="h4">{post.location}</Typography>
            <Typography>{post.text}</Typography>
            <Button
              variant="outlined"
              onClick={() => {
                setShowForm(!showForm);
                setPostId(post.id);
              }}
              startIcon={<EditIcon />}
            >
              Edit
            </Button>
          </AccordionDetails>
        </Accordion>
      ))}
    </Container>

    {/* show group of HappyUser */}
    <Container style={{ marginTop: "3rem" }}>
      {authorGroupValues?.HappyUser.map((post, index) => (
        <Accordion key={index}>
          <AccordionSummary
            expandIcon={<ExpandMoreIcon />}
            aria-controls="panel1a-content"
            id="panel1a-header"
          >
            <Typography variant="h6" style={{ color: "red" }}>
              {post.id} {post.author} {post.location}
            </Typography>
          </AccordionSummary>
          <AccordionDetails>
            <Typography variant="h4">{post.location}</Typography>
            <Typography>{post.text}</Typography>
            <Button
              variant="outlined"
              onClick={() => {
                setShowForm(!showForm);
                setPostId(post.id);
              }}
              startIcon={<EditIcon />}
            >
              Edit
            </Button>
          </AccordionDetails>
        </Accordion>
      ))}
    </Container>
  </Container>
</>
  );
};

export default Authorsgroup;

Thanks any suggestions or help are really appreciated.


来源: stackexchange

问:
how to use <Pagination /> with
 in antd
when i use pagination in Table components like this

```<code><Table
      sticky={true}
      dataSource={sendDataSourcs}
      columns={columns}
      pagination={pagination}
    />
</code>```

the pagination can scroll down to bottom of the table so i try to use Pagination components like

```<code><Table
      sticky={true}
      dataSource={sendDataSourcs}
      columns={columns}
    />

    <Pagination
      current={currentPage}
      onChange={handlePageChange}
      pageSize={pageSize}
      total={sendDataSourcs.length}
    />
</code>```

and when clicking to ChangePage and nothing happen

ContentLicense: CC BY-SA 4.0

Title: how to use <Pagination /> with <Table /> in antd

Body:
when i use pagination in Table components like this

the pagination can scroll down to bottom of the table so i try to use Pagination components like

    <Pagination
      current={currentPage}
      onChange={handlePageChange}
      pageSize={pageSize}
      total={sendDataSourcs.length}
    />

and when clicking to ChangePage and nothing happen


问:
How can I solve the problem does not satify the constraint 'keyof ISession'
At the begenning my jhipster appliation was compiling without problem and after some time..I have started getting this error

```<code> Error: src/main/webapp/app/entities/collaborateur/collaborateur.model.ts:17:29 - error TS2344: Type '"id" | "nOM"' does not satisfy the constraint 'keyof ISession'.
Type '"nOM"' is not assignable to type 'keyof ISession'.
17   sessions?: Pick<ISession, 'id' | 'nOM'>[] | null;
</code>```

I am face with this problem for some time and i would like some help me solve it ...thank you very much

Body:
At the begenning my jhipster appliation was compiling without problem and after some time..I have started getting this error

 Error: src/main/webapp/app/entities/collaborateur/collaborateur.model.ts:17:29 - error TS2344: Type '"id" | "nOM"' does not satisfy the constraint 'keyof ISession'.
Type '"nOM"' is not assignable to type 'keyof ISession'.
17   sessions?: Pick<ISession, 'id' | 'nOM'>[] | null;

I am face with this problem for some time and i would like some help me solve it ...thank you very much


问:
GitLab with docker-compose throwing wierd errors
My docker-compose file:

```<code>version: "3.8"
networks:
  traefik_network:
    external: true

services:
  gitlab:
    container_name: gitlab
    image: 'gitlab/gitlab-ee:latest'
    restart: always
    hostname: 'my-server'
    environment:
      GITLAB_HOME: ./srv/gitlab
      # GITLAB_OMNIBUS_CONFIG: |
      #   external_url 'https://my-server'
      #   # Add any other gitlab.rb configuration here, each on its own line
    ports:
      - '3380:80'
      - '3443:443'
      - '3322:22'
    volumes:
      - ./srv/gitlab/config:/etc/gitlab'
      - ./srv/gitlab/logs:/var/log/gitlab'
      - ./srv/gitlab/data:/var/opt/gitlab'
    shm_size: '256m'
    networks:
      - traefik_network
</code>```

I started with this guide as it seemed to be the most recent thing I could find.

https://docs.gitlab.com/ee/install/docker.html#install-gitlab-using-docker-compose

I changed my volume directory after trying chmod and guessing that the issue I was having might be related to file permissions.  Changing my volume to the same directory as the project did not make a difference.  Other than that I am pretty much the same as the default recommended file.  I need to get this to eventually run with SSL and NGINX but I'd like to start with just getting the app running.  Does anyone have a working docker file or know what is causing my errors?

This is first chunk of my output:

https://pastebin.com/mtzYWFDg

As you can see after it gets through the start up stuff, it begins to loop every second and start complaining about owners and symlinks and execute ruby blocks.  This looping errors won't stop until I kill the container.  The ports are also unreachable.  I have no idea what I could have done to cause any of those errors and I'm pretty lost trying to find answers.

Body:
My docker-compose file:

version: "3.8"
networks:
  traefik_network:
    external: true

services:
  gitlab:
    container_name: gitlab
    image: 'gitlab/gitlab-ee:latest'
    restart: always
    hostname: 'my-server'
    environment:
      GITLAB_HOME: ./srv/gitlab
      # GITLAB_OMNIBUS_CONFIG: |
      #   external_url 'https://my-server'
      #   # Add any other gitlab.rb configuration here, each on its own line
    ports:
      - '3380:80'
      - '3443:443'
      - '3322:22'
    volumes:
      - ./srv/gitlab/config:/etc/gitlab'
      - ./srv/gitlab/logs:/var/log/gitlab'
      - ./srv/gitlab/data:/var/opt/gitlab'
    shm_size: '256m'
    networks:
      - traefik_network

I started with this guide as it seemed to be the most recent thing I could find.

https://docs.gitlab.com/ee/install/docker.html#install-gitlab-using-docker-compose

I changed my volume directory after trying chmod and guessing that the issue I was having might be related to file permissions.  Changing my volume to the same directory as the project did not make a difference.  Other than that I am pretty much the same as the default recommended file.  I need to get this to eventually run with SSL and NGINX but I'd like to start with just getting the app running.  Does anyone have a working docker file or know what is causing my errors?

This is first chunk of my output:

https://pastebin.com/mtzYWFDg

As you can see after it gets through the start up stuff, it begins to loop every second and start complaining about owners and symlinks and execute ruby blocks.  This looping errors won't stop until I kill the container.  The ports are also unreachable.  I have no idea what I could have done to cause any of those errors and I'm pretty lost trying to find answers.


问:
I'm trying to follow a discord bot tutorial and I'm not sure how to fix an invalid syntax ctx error
I'm extremely new to coding, mainly just giving it a shot to attempt to make my own Discord bot. I'm not sure what I'm doing at all, so I've been following different youtube tutorials with varrying degrees of failure. The most recent one keeps saying a I have a syntax error, and I have no idea how to fix this. Here is the code:

```<code>1 import os
2 import discord
3 from discord.ext import commands
4
5 bot = commands.Bot(command_prefix="!", intents = discord.Intents.all()
6
7 @bot.command()
8 async def hello(ctx):
9  await ctx.send("Hello")
10 token = os.environ['TOKEN']
11 bot.run (token)
</code>```

I have already used the secrets function to put the actual token in, and I've done my best to follow the tutorial as closely as possibly, but I am kind of clueless with this stuff so any help would be appreciated.

I've tried editing the text, adding quotations to the hello and removing them when realizing it did nothing to fix the problem. I'm at a loss.

Body:
I'm extremely new to coding, mainly just giving it a shot to attempt to make my own Discord bot. I'm not sure what I'm doing at all, so I've been following different youtube tutorials with varrying degrees of failure. The most recent one keeps saying a I have a syntax error, and I have no idea how to fix this. Here is the code:

1 import os
2 import discord
3 from discord.ext import commands
4
5 bot = commands.Bot(command_prefix="!", intents = discord.Intents.all()
6
7 @bot.command()
8 async def hello(ctx):
9  await ctx.send("Hello")
10 token = os.environ['TOKEN']
11 bot.run (token)

I have already used the secrets function to put the actual token in, and I've done my best to follow the tutorial as closely as possibly, but I am kind of clueless with this stuff so any help would be appreciated.

I've tried editing the text, adding quotations to the hello and removing them when realizing it did nothing to fix the problem. I'm at a loss.


问:
Working of Row Level Security on Apache Superset
I am not clear about the working of Row Level Security on Apache Superset. As we know it will filter the data and return the out put. My doubt is

The filter is applying to the SQL query itself to fetch the data from database?

Or the data set will load all the data based on the inline query, then row level filter will apply on that result set?

Any reference will be greatly appreciated...


问:
The label adapts to the scale of the page
When the data is up to 50, my page is displayed on the x-axis of days one after another. But when the data becomes more than 60, due to responsive design, days start to be skipped and shown after 1.

I figured out that ChartJS still renders as specified in the settings. But due to the scale of the page, the graph adapts and skips days. Can this be fixed?

At 80% page scale, the days go one after the other. But at 100%, the days start to skip and show through 1.


问:
Android emulator wont open in VS Code
I cant get my Android Emulator to open in VS Code. It works in Android studio, I opened it and made sure it wasn't running there. I changed the windows path in the emulator extension to the location of my device, and then I get this error message the following error message.

Error message

Title: Android emulator wont open in VS Code


问:
How to remove text into the editor at current selection in ckeditor5?
let say i have this string
a quick brown fox jumps:

I want to remove colon : from that string

there is a method to remove called "write.remove"
but I don't know how can I use this


问:
Assess clusters stability for each cluster
I have clustered some data points twice and obtained four clusters (A=1,B=2,C=3,D=4) for both of them. I want to assess the overall stability of the clustering, but also assess each cluster individually (cluster A for the first result(A1) vs cluster A for the second result(A2), B1 vs B2, C1 vs C2, and D1 vs D2).

For the overall stability, I am using the adjusted rand index (ARI) function and have no problem. Nevertheless, when I want to assess ex. A1 vs A2, I don't really know how I should proceed.

The clustering results are the following:

```<code>c1 <- c(1, 2, 3, 2, 1, 3, 4, 3, 2, 2, 3, 4, 3, 2, 1, 2, 3, 4, 3, 2, 1, 2, 3, 4, 2, 3, 2, 3, 2, 1, 3, 4, 4, 4, 4, 3, 2, 3, 2, 3, 1, 3, 2, 1, 2, 3, 4, 3, 2, 1, 4, 3, 2, 2, 2, 3, 4, 3, 3, 3, 2, 1, 1, 1, 2)

c2 <- c(1, 2, 4, 4, 1, 3, 4, 2, 2, 2, 3, 4, 1, 2, 1, 2, 3, 4, 3, 2, 1, 2, 2, 4, 2, 3, 2, 3, 2, 1, 3, 3, 4, 3, 4, 3, 2, 3, 2, 3, 1, 1, 1, 1, 2, 3, 4, 3, 2, 1, 4, 3, 2, 2, 2, 3, 4, 3, 3, 3, 2, 1, 1, 1, 2)
</code>```

Is there any good strategy to look between each type of cluster (ex. A1 vs A2)?

Suggestions that require R or python syntax are accepted.

Thanks in advance!

Body:
I have clustered some data points twice and obtained four clusters (A=1,B=2,C=3,D=4) for both of them. I want to assess the overall stability of the clustering, but also assess each cluster individually (cluster A for the first result(A1) vs cluster A for the second result(A2), B1 vs B2, C1 vs C2, and D1 vs D2).

For the overall stability, I am using the adjusted rand index (ARI) function and have no problem. Nevertheless, when I want to assess ex. A1 vs A2, I don't really know how I should proceed.

The clustering results are the following:

c1 <- c(1, 2, 3, 2, 1, 3, 4, 3, 2, 2, 3, 4, 3, 2, 1, 2, 3, 4, 3, 2, 1, 2, 3, 4, 2, 3, 2, 3, 2, 1, 3, 4, 4, 4, 4, 3, 2, 3, 2, 3, 1, 3, 2, 1, 2, 3, 4, 3, 2, 1, 4, 3, 2, 2, 2, 3, 4, 3, 3, 3, 2, 1, 1, 1, 2)

c2 <- c(1, 2, 4, 4, 1, 3, 4, 2, 2, 2, 3, 4, 1, 2, 1, 2, 3, 4, 3, 2, 1, 2, 2, 4, 2, 3, 2, 3, 2, 1, 3, 3, 4, 3, 4, 3, 2, 3, 2, 3, 1, 1, 1, 1, 2, 3, 4, 3, 2, 1, 4, 3, 2, 2, 2, 3, 4, 3, 3, 3, 2, 1, 1, 1, 2)

Is there any good strategy to look between each type of cluster (ex. A1 vs A2)?

Suggestions that require R or python syntax are accepted.

Thanks in advance!


问:
ESP32: How to send a jpg out of SPIFFS via WiFiClient to a python server socket?
I want that my ESP32 takes a picture, stores it in the SPIFFS and then send it via a WiFiClient from WiFi.h. The reciever is a python server socket. The server should store it as a jpg in the local windows filesystem.

So far i can connect the esp to the wifi, take a picture and store it in the SPIFFS. In another project i already send char from the WiFiClientto the python server without any problem. But if i want to send the picture a bytes with WiFiClient.print() it only sends two bytes and that cannot be correct i think.
What i need is help for sending the bytes of the jpg from the esp and decode the recieved bytes from the python socket server and store the bytes as a jpg. If there is a better way then using a the esp32 WiFiClient-class or python socket, feel free to say it.

Here is my ESP code (yes i know. The structure is not the best. Its only an example for me):

```<code>
#include <WiFi.h>

const char* ssid = "xxx";
const char* password = "xxx";

const uint16_t port = xxx;
const char * host = "xxx";

/*********
  Rui Santos
  Complete instructions at https://RandomNerdTutorials.com/esp32-cam-projects-ebook/

  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files.
  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*********/

#include "esp_camera.h"
//#include "SPI.h"
//#include "driver/rtc_io.h"
#include <FS.h>
#include <SPIFFS.h>

#define CAMERA_MODEL_WROVER_KIT

#if defined(CAMERA_MODEL_WROVER_KIT)
  #define PWDN_GPIO_NUM    -1
  #define RESET_GPIO_NUM   -1
  #define XCLK_GPIO_NUM    21
  #define SIOD_GPIO_NUM    26
  #define SIOC_GPIO_NUM    27

  #define Y9_GPIO_NUM      35
  #define Y8_GPIO_NUM      34
  #define Y7_GPIO_NUM      39
  #define Y6_GPIO_NUM      36
  #define Y5_GPIO_NUM      19
  #define Y4_GPIO_NUM      18
  #define Y3_GPIO_NUM       5
  #define Y2_GPIO_NUM       4
  #define VSYNC_GPIO_NUM   25
  #define HREF_GPIO_NUM    23
  #define PCLK_GPIO_NUM    22
#else
  #error "Camera model not selected"
#endif

// Photo File Name to save in SPIFFS
#define FILE_PHOTO "/photo.jpg"

File file;
camera_fb_t * fb;

WiFiClient client;

void setup() {
  //WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); //disable brownout detector

  Serial.begin(115200);
  Serial.println();

  // Connect to Wi-Fi
  WiFi.begin(ssid, password);
  Serial.print("Connecting to WiFi...");
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println();

  if (!SPIFFS.begin(true)) {
    Serial.println("An Error has occurred while mounting SPIFFS");
    ESP.restart();
  }
  else {
    delay(500);
    Serial.println("SPIFFS mounted successfully");
  }

  // Print ESP32 Local IP Address
  Serial.print("IP Address: http://");
  Serial.println(WiFi.localIP());

  camera_config_t config;
  config.ledc_channel = LEDC_CHANNEL_0;
  config.ledc_timer = LEDC_TIMER_0;
  config.pin_d0 = Y2_GPIO_NUM;
  config.pin_d1 = Y3_GPIO_NUM;
  config.pin_d2 = Y4_GPIO_NUM;
  config.pin_d3 = Y5_GPIO_NUM;
  config.pin_d4 = Y6_GPIO_NUM;
  config.pin_d5 = Y7_GPIO_NUM;
  config.pin_d6 = Y8_GPIO_NUM;
  config.pin_d7 = Y9_GPIO_NUM;
  config.pin_xclk = XCLK_GPIO_NUM;
  config.pin_pclk = PCLK_GPIO_NUM;
  config.pin_vsync = VSYNC_GPIO_NUM;
  config.pin_href = HREF_GPIO_NUM;
  config.pin_sscb_sda = SIOD_GPIO_NUM;
  config.pin_sscb_scl = SIOC_GPIO_NUM;
  config.pin_pwdn = PWDN_GPIO_NUM;
  config.pin_reset = RESET_GPIO_NUM;
  config.xclk_freq_hz = 20000000;
  config.pixel_format = PIXFORMAT_JPEG;

  if(psramFound()){
    config.frame_size = FRAMESIZE_UXGA;
    config.jpeg_quality = 10;
    config.fb_count = 2;
  } else {
    config.frame_size = FRAMESIZE_SVGA;
    config.jpeg_quality = 12;
    config.fb_count = 1;
  }

  // Initialize camera
  esp_err_t err = esp_camera_init(&config);
  if (err != ESP_OK) {
    Serial.printf("Camera init failed with error 0x%x", err);
    return;
  }

}

void loop()
{

  if (!client.connect(host, port)) {

    Serial.println("Connection to host failed");

    delay(1000);
    return;
  }

  Serial.println("Connected to server successful!");
  fb = NULL; // pointer
  bool ok = 0; // Boolean indicating if the picture has been taken correctly

  do {
    // Take a photo with the camera
    Serial.println("Taking a photo...");

    fb = esp_camera_fb_get();
    if (!fb) {
      Serial.println("Camera capture failed");
      return;
    }

    // Photo file name
    Serial.printf("Picture file name: %s\n", FILE_PHOTO);
    file = SPIFFS.open(FILE_PHOTO, FILE_WRITE);

    // Insert the data in the photo file
    if (!file) {
      Serial.println("Failed to open file in writing mode");
    }
    else {
      file.write(fb->buf, fb->len); // payload (image), payload length
      Serial.print("The picture has been saved in ");
      Serial.print(FILE_PHOTO);
      Serial.print(" - Size: ");
      Serial.print(file.size());
      Serial.println(" bytes");
    }

    // check if file has been correctly saved in SPIFFS
    ok = checkPhoto(SPIFFS);
  } while ( !ok );
    while(file.available()){
      Serial.println(client.print(file.read()));
    }

    // Close the file
    file.close();
    esp_camera_fb_return(fb);

    delay(1000);

}

// Check if photo capture was successful
bool checkPhoto( fs::FS &fs ) {
  File f_pic = fs.open( FILE_PHOTO );
  unsigned int pic_sz = f_pic.size();
  return ( pic_sz > 100 );
}

</code>```

and this is my python code:

```<code>import socket
s = socket.socket()

s.bind(('yyy', yyy ))
s.listen(0)

while True:
    try:
        print("-------------------------------------------------------------------")
        client, addr = s.accept()
        print("Accepted a connection request from %s:%s"%(addr[0], addr[1]));
        while True:
            content = client.recv(131072)
            if len(content) ==0:
                break
            else:
                msg_recieved = content
                msg_recieved_decode = content.decode()
                print(msg_recieved)
                print("Message decoded recieved: " + msg_recieved_decode)
                f = open("demofile.jpg", "wb")
                f.write(msg_recieved)
                f.close()
        print("Client closed")
        client.close()
    except Exception as e:
        print("===================================================================")
        print("Something went wrong")
        print(e)
        print("===================================================================")
</code>```

Body:
I want that my ESP32 takes a picture, stores it in the SPIFFS and then send it via a WiFiClient from WiFi.h. The reciever is a python server socket. The server should store it as a jpg in the local windows filesystem.

So far i can connect the esp to the wifi, take a picture and store it in the SPIFFS. In another project i already send char from the WiFiClientto the python server without any problem. But if i want to send the picture a bytes with WiFiClient.print() it only sends two bytes and that cannot be correct i think.
What i need is help for sending the bytes of the jpg from the esp and decode the recieved bytes from the python socket server and store the bytes as a jpg. If there is a better way then using a the esp32 WiFiClient-class or python socket, feel free to say it.

Here is my ESP code (yes i know. The structure is not the best. Its only an example for me):

#include <WiFi.h>

const char* ssid = "xxx";
const char* password = "xxx";

const uint16_t port = xxx;
const char * host = "xxx";

/*********
  Rui Santos
  Complete instructions at https://RandomNerdTutorials.com/esp32-cam-projects-ebook/

  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files.
  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*********/

#include "esp_camera.h"
//#include "SPI.h"
//#include "driver/rtc_io.h"
#include <FS.h>
#include <SPIFFS.h>

#define CAMERA_MODEL_WROVER_KIT

#if defined(CAMERA_MODEL_WROVER_KIT)
  #define PWDN_GPIO_NUM    -1
  #define RESET_GPIO_NUM   -1
  #define XCLK_GPIO_NUM    21
  #define SIOD_GPIO_NUM    26
  #define SIOC_GPIO_NUM    27

  #define Y9_GPIO_NUM      35
  #define Y8_GPIO_NUM      34
  #define Y7_GPIO_NUM      39
  #define Y6_GPIO_NUM      36
  #define Y5_GPIO_NUM      19
  #define Y4_GPIO_NUM      18
  #define Y3_GPIO_NUM       5
  #define Y2_GPIO_NUM       4
  #define VSYNC_GPIO_NUM   25
  #define HREF_GPIO_NUM    23
  #define PCLK_GPIO_NUM    22
#else
  #error "Camera model not selected"
#endif

// Photo File Name to save in SPIFFS
#define FILE_PHOTO "/photo.jpg"

File file;
camera_fb_t * fb;

WiFiClient client;

void setup() {
  //WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); //disable brownout detector

  Serial.begin(115200);
  Serial.println();

  // Connect to Wi-Fi
  WiFi.begin(ssid, password);
  Serial.print("Connecting to WiFi...");
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println();

  if (!SPIFFS.begin(true)) {
    Serial.println("An Error has occurred while mounting SPIFFS");
    ESP.restart();
  }
  else {
    delay(500);
    Serial.println("SPIFFS mounted successfully");
  }

  // Print ESP32 Local IP Address
  Serial.print("IP Address: http://");
  Serial.println(WiFi.localIP());

  camera_config_t config;
  config.ledc_channel = LEDC_CHANNEL_0;
  config.ledc_timer = LEDC_TIMER_0;
  config.pin_d0 = Y2_GPIO_NUM;
  config.pin_d1 = Y3_GPIO_NUM;
  config.pin_d2 = Y4_GPIO_NUM;
  config.pin_d3 = Y5_GPIO_NUM;
  config.pin_d4 = Y6_GPIO_NUM;
  config.pin_d5 = Y7_GPIO_NUM;
  config.pin_d6 = Y8_GPIO_NUM;
  config.pin_d7 = Y9_GPIO_NUM;
  config.pin_xclk = XCLK_GPIO_NUM;
  config.pin_pclk = PCLK_GPIO_NUM;
  config.pin_vsync = VSYNC_GPIO_NUM;
  config.pin_href = HREF_GPIO_NUM;
  config.pin_sscb_sda = SIOD_GPIO_NUM;
  config.pin_sscb_scl = SIOC_GPIO_NUM;
  config.pin_pwdn = PWDN_GPIO_NUM;
  config.pin_reset = RESET_GPIO_NUM;
  config.xclk_freq_hz = 20000000;
  config.pixel_format = PIXFORMAT_JPEG;

  if(psramFound()){
    config.frame_size = FRAMESIZE_UXGA;
    config.jpeg_quality = 10;
    config.fb_count = 2;
  } else {
    config.frame_size = FRAMESIZE_SVGA;
    config.jpeg_quality = 12;
    config.fb_count = 1;
  }

  // Initialize camera
  esp_err_t err = esp_camera_init(&config);
  if (err != ESP_OK) {
    Serial.printf("Camera init failed with error 0x%x", err);
    return;
  }

}

void loop()
{

  if (!client.connect(host, port)) {

    Serial.println("Connection to host failed");

    delay(1000);
    return;
  }

  Serial.println("Connected to server successful!");
  fb = NULL; // pointer
  bool ok = 0; // Boolean indicating if the picture has been taken correctly

  do {
    // Take a photo with the camera
    Serial.println("Taking a photo...");

    fb = esp_camera_fb_get();
    if (!fb) {
      Serial.println("Camera capture failed");
      return;
    }

    // Photo file name
    Serial.printf("Picture file name: %s\n", FILE_PHOTO);
    file = SPIFFS.open(FILE_PHOTO, FILE_WRITE);

    // Insert the data in the photo file
    if (!file) {
      Serial.println("Failed to open file in writing mode");
    }
    else {
      file.write(fb->buf, fb->len); // payload (image), payload length
      Serial.print("The picture has been saved in ");
      Serial.print(FILE_PHOTO);
      Serial.print(" - Size: ");
      Serial.print(file.size());
      Serial.println(" bytes");
    }

    // check if file has been correctly saved in SPIFFS
    ok = checkPhoto(SPIFFS);
  } while ( !ok );
    while(file.available()){
      Serial.println(client.print(file.read()));
    }

    // Close the file
    file.close();
    esp_camera_fb_return(fb);

    delay(1000);

}

// Check if photo capture was successful
bool checkPhoto( fs::FS &fs ) {
  File f_pic = fs.open( FILE_PHOTO );
  unsigned int pic_sz = f_pic.size();
  return ( pic_sz > 100 );
}

and this is my python code:

import socket
s = socket.socket()

s.bind(('yyy', yyy ))
s.listen(0)

while True:
    try:
        print("-------------------------------------------------------------------")
        client, addr = s.accept()
        print("Accepted a connection request from %s:%s"%(addr[0], addr[1]));
        while True:
            content = client.recv(131072)
            if len(content) ==0:
                break
            else:
                msg_recieved = content
                msg_recieved_decode = content.decode()
                print(msg_recieved)
                print("Message decoded recieved: " + msg_recieved_decode)
                f = open("demofile.jpg", "wb")
                f.write(msg_recieved)
                f.close()
        print("Client closed")
        client.close()
    except Exception as e:
        print("===================================================================")
        print("Something went wrong")
        print(e)
        print("===================================================================")


问:
Matplotlib does not free up RAM memory after closing a function
I'm coding a Python script which makes many plots. These plots are called from a main program which calls them recursively (by this, I mean hundreds of times).

As the main function runs, I see how my computer's RAM memory fills up during the execution. Furthermore, even after the main function finishes, the RAM memory usage is still much much higher than before the main program execution. Sometimes it can even completely fill the RAM memory.

I tried to delete the heaviest variables and use garbage collector but the net RAM memory usage is always higher. Why this is happening?

I attached a simple (and exaggerated) example of one of my functions and I used memory profiler to see line-by-line the memory usage.

```<code>Line #    Mem usage    Increment  Occurrences   Line Contents
=============================================================
    15  100.926 MiB  100.926 MiB           1   @profile
    16                                         def my_func():
    17  108.559 MiB    7.633 MiB           1    a = [1] * (10 ** 6)
    18  261.148 MiB  152.590 MiB           1    b = [2] * (2 * 10 ** 7)
    19  421.367 MiB  160.219 MiB           1    c = a + b
    20  428.609 MiB    7.242 MiB           1    plt.figure(dpi=10000)
    21  430.328 MiB    1.719 MiB           1    plt.plot(np.random.rand(1000),np.random.rand(1000))
    22  487.738 MiB   57.410 MiB           1    plt.show()
    23  487.738 MiB    0.000 MiB           1    plt.close('all')
    24  167.297 MiB -320.441 MiB           1    del a,b,c
    25  118.922 MiB  -48.375 MiB           1    print(gc.collect())
</code>```

I tried to delete the heaviest variables and use garbage collector but the net RAM memory usage is always higher.

Body:
I'm coding a Python script which makes many plots. These plots are called from a main program which calls them recursively (by this, I mean hundreds of times).

As the main function runs, I see how my computer's RAM memory fills up during the execution. Furthermore, even after the main function finishes, the RAM memory usage is still much much higher than before the main program execution. Sometimes it can even completely fill the RAM memory.

I tried to delete the heaviest variables and use garbage collector but the net RAM memory usage is always higher. Why this is happening?

I attached a simple (and exaggerated) example of one of my functions and I used memory profiler to see line-by-line the memory usage.

Line #    Mem usage    Increment  Occurrences   Line Contents
=============================================================
    15  100.926 MiB  100.926 MiB           1   @profile
    16                                         def my_func():
    17  108.559 MiB    7.633 MiB           1    a = [1] * (10 ** 6)
    18  261.148 MiB  152.590 MiB           1    b = [2] * (2 * 10 ** 7)
    19  421.367 MiB  160.219 MiB           1    c = a + b
    20  428.609 MiB    7.242 MiB           1    plt.figure(dpi=10000)
    21  430.328 MiB    1.719 MiB           1    plt.plot(np.random.rand(1000),np.random.rand(1000))
    22  487.738 MiB   57.410 MiB           1    plt.show()
    23  487.738 MiB    0.000 MiB           1    plt.close('all')
    24  167.297 MiB -320.441 MiB           1    del a,b,c
    25  118.922 MiB  -48.375 MiB           1    print(gc.collect())

I tried to delete the heaviest variables and use garbage collector but the net RAM memory usage is always higher.


问:
How to apply limit on Google Forms to answer only 2 Question (Max)
I need to create a Google Form to get response from participants in which TWO games, out of 7, they want to participate. The questions are written in Radio Button and upon selection any option I'm displaying a section to add players name.

Problem:

Currently users can select all seven option.

I want to limit it to Min 1 and Max 2.

Example:

Question 1: Arm Wrestling?
Option: Yes

Question 2: 8 Ball?
Option: Yes

Question 3: Table Tennis?
Option: Yes

and so on.


问:
How do i move the dock / Zorder by 1
Lets say there are 4 panels

```<code>Panel 1
Panel 2
Panel 3
Panel 4
</code>```

And I want to move Panel 3 up by one, and only by 1.
How do I actually do this? It seems the only options are all the way up or all the way down in Z order. Or should I just use something other then docking when making this type of thing?

https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/zorder-method

Title: How do i move the dock / Zorder by 1

Body:
Lets say there are 4 panels

Panel 1
Panel 2
Panel 3
Panel 4

And I want to move Panel 3 up by one, and only by 1.
How do I actually do this? It seems the only options are all the way up or all the way down in Z order. Or should I just use something other then docking when making this type of thing?

https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/zorder-method


问:
Prometheus target showing down
Please note: my prometheus is running using ubuntu terminal and my springboot application is running on windows.  Seems like my ubuntu is not able to connect with the localhost of windows.

I have created springboot metrics using "actuator" and my metrics are being exposed at "http/localhost:8080/actuator/prometheus".

My application.yml configuration in my springboot application looks like this:

```<code>management:
  endpoints:
    web:
      exposure:
        include: prometheus

The configuration file of prometheus i.e. prometheus.yml is as below:
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from
this config.
  - job_name: "services"
    static_configs:
      - targets: ["localhost:8080"]
    metrics_path: '/actuator/prometheus'
</code>```

Despite this configuration, i see "target" as down in prometheus interface. It says Get "http://localhost:8080/actuator/prometheus": dial tcp 127.0.0.1:8080: connect: connection refused . Why is prometheus not able to pick the metrics at localhost?

Title: Prometheus target showing down

Body:
Please note: my prometheus is running using ubuntu terminal and my springboot application is running on windows.  Seems like my ubuntu is not able to connect with the localhost of windows.

I have created springboot metrics using "actuator" and my metrics are being exposed at "http/localhost:8080/actuator/prometheus".

My application.yml configuration in my springboot application looks like this:

management:
  endpoints:
    web:
      exposure:
        include: prometheus

The configuration file of prometheus i.e. prometheus.yml is as below:
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from
this config.
  - job_name: "services"
    static_configs:
      - targets: ["localhost:8080"]
    metrics_path: '/actuator/prometheus'

Despite this configuration, i see "target" as down in prometheus interface. It says Get "http://localhost:8080/actuator/prometheus": dial tcp 127.0.0.1:8080: connect: connection refused . Why is prometheus not able to pick the metrics at localhost?


问:
Can an Alfresco process branch out to subworkflows based on the document uploaded?
We have a requirement to create a main workflow with sub-workflows for every document uploaded.Also we should be able to end the sub-workflow separartely without ending the main worflow. The main workflow should end only after all the subworkflows have compelted.

We are familiar with creating sub-processes but we need the sub process to be trigerred for each docuemtn that we upload.

Can we achieve this?

Kindly advise

Thanks.


问:
framer motion : different animation for mobile and desktop
Trying to make a different animation when on mobile or on desktop, to do so I'm using a useMediaQueryHoook and changing the variant in function of it. But the init animation seems to always assume that I'm on desktop. I guess because the useMediaQueryHook doesn't have time to actualise before the anim is launch. How can I deal with that issue ?

Btw I'm on nextjs :)

Here is my code :

```<code>  const onMobile = useMediaQuery("(min-width : 428px)");

  const wishCardVariant = {
    hidden: (onMobile) => ({
      opacity: 0,
      y: onMobile ? "100%" : 0,
      x: onMobile ? 0 : "100%",
      transition,
    }),
    visible: (onMobile) => ({
      opacity: 1,
      x: 0,
      y: 0,
    }),
  };
</code>```

here is the hook :

```<code>import react, { useState, useEffect } from "react";

export default function useMediaQuery(query) {
  const [matches, setMatches] = useState(false);

  useEffect(() => {
    const media = window.matchMedia(query);
    if (media.matches !== matches) {
      setMatches(media.matches);
    }
    const listener = () => {
      setMatches(media.matches);
    };
    media.addListener(listener);
    return () => media.removeListener(listener);
  }, [matches, query]);

  return matches;
}

</code>```

Body:
Trying to make a different animation when on mobile or on desktop, to do so I'm using a useMediaQueryHoook and changing the variant in function of it. But the init animation seems to always assume that I'm on desktop. I guess because the useMediaQueryHook doesn't have time to actualise before the anim is launch. How can I deal with that issue ?

Btw I'm on nextjs :)

Here is my code :

  const onMobile = useMediaQuery("(min-width : 428px)");

  const wishCardVariant = {
    hidden: (onMobile) => ({
      opacity: 0,
      y: onMobile ? "100%" : 0,
      x: onMobile ? 0 : "100%",
      transition,
    }),
    visible: (onMobile) => ({
      opacity: 1,
      x: 0,
      y: 0,
    }),
  };

here is the hook :

import react, { useState, useEffect } from "react";

export default function useMediaQuery(query) {
  const [matches, setMatches] = useState(false);

  useEffect(() => {
    const media = window.matchMedia(query);
    if (media.matches !== matches) {
      setMatches(media.matches);
    }
    const listener = () => {
      setMatches(media.matches);
    };
    media.addListener(listener);
    return () => media.removeListener(listener);
  }, [matches, query]);

  return matches;
}


问:
Apollo gateway caching
I have service Test-Service which provides some data via graphql and Apollo Gateway. And I would like to cache requests on Apollo gateway, but it doesn't work, I still see in logs of Test-Service that it receives requests. Here is code of Apollo Gateway

```<code>import {ApolloServer} from'@apollo/server'
import {ApolloGateway, IntrospectAndCompose} from '@apollo/gateway'
import {hiveApollo} from'@graphql-hive/client'
import {KeyvAdapter} from"@apollo/utils.keyvadapter"
import {ApolloServerPluginCacheControl} from"@apollo/server/plugin/cacheControl"
import {startStandaloneServer} from'@apollo/server/standalone'
// const Keyv = require("keyv");
import {InMemoryLRUCache} from "@apollo/utils.keyvaluecache"
import responseCachePlugin from '@apollo/server-plugin-response-cache';

const gateway = new ApolloGateway({
    supergraphSdl: new IntrospectAndCompose({
        subgraphs: [
            {name: 'test-service', url: 'http://test-service-svc/graphql'}
        ],
        pollIntervalInMs: 5000
    })
})

async function startApolloServer() {
    const server = new ApolloServer({
        gateway,
        plugins: [
            responseCachePlugin()
        ],
        // cache: new KeyvAdapter(new Keyv({
        //         url: "redis://graphql-gateway-redis:6379",
        //         sentinels: [
        //             {host: "graphql-gateway-redis", port: 26379}
        //         ]
        //     })
        // )
        cache: new InMemoryLRUCache(),
        cacheControl: {
            defaultMaxAge: 50,
        },
    });

    const {url} = await startStandaloneServer(server, {
        listen: {port: 4000}
    })

    console.log(`  Server ready at: ${url}`)
}

startApolloServer();
</code>```

As you can see I also tried using redis. And here is example schema:

```<code>type Query {
    getInfo(
        userId: Int
    ): [Response]

    getInfoCached(
        userId: Int
    ): [Response] @cacheControl(maxAge: 30)
}

type Response @cacheControl(maxAge: 30) {
    id: Int,
    createdAt: DateTime, @cacheControl(maxAge: 10),
    firstName: String
}
</code>```

Title: Apollo gateway caching

Body:
I have service Test-Service which provides some data via graphql and Apollo Gateway. And I would like to cache requests on Apollo gateway, but it doesn't work, I still see in logs of Test-Service that it receives requests. Here is code of Apollo Gateway

import {ApolloServer} from'@apollo/server'
import {ApolloGateway, IntrospectAndCompose} from '@apollo/gateway'
import {hiveApollo} from'@graphql-hive/client'
import {KeyvAdapter} from"@apollo/utils.keyvadapter"
import {ApolloServerPluginCacheControl} from"@apollo/server/plugin/cacheControl"
import {startStandaloneServer} from'@apollo/server/standalone'
// const Keyv = require("keyv");
import {InMemoryLRUCache} from "@apollo/utils.keyvaluecache"
import responseCachePlugin from '@apollo/server-plugin-response-cache';

const gateway = new ApolloGateway({
    supergraphSdl: new IntrospectAndCompose({
        subgraphs: [
            {name: 'test-service', url: 'http://test-service-svc/graphql'}
        ],
        pollIntervalInMs: 5000
    })
})

async function startApolloServer() {
    const server = new ApolloServer({
        gateway,
        plugins: [
            responseCachePlugin()
        ],
        // cache: new KeyvAdapter(new Keyv({
        //         url: "redis://graphql-gateway-redis:6379",
        //         sentinels: [
        //             {host: "graphql-gateway-redis", port: 26379}
        //         ]
        //     })
        // )
        cache: new InMemoryLRUCache(),
        cacheControl: {
            defaultMaxAge: 50,
        },
    });

    const {url} = await startStandaloneServer(server, {
        listen: {port: 4000}
    })

    console.log(`  Server ready at: ${url}`)
}

startApolloServer();

As you can see I also tried using redis. And here is example schema:

type Query {
    getInfo(
        userId: Int
    ): [Response]

    getInfoCached(
        userId: Int
    ): [Response] @cacheControl(maxAge: 30)
}

type Response @cacheControl(maxAge: 30) {
    id: Int,
    createdAt: DateTime, @cacheControl(maxAge: 10),
    firstName: String
}


问:
Android Studio design tokens
There are JSON with colors how to convert it to XML file

Context:
Figma has colors (design tokens) that have been converted to JSON and we want to import them into Android Studio

Title: Android Studio design tokens


问:
Cannot initialize a variable of type 'double (*)[x]' with an rvalue of type 'double (*)[z]
I have a vector of doubles that I am passing to a lib https://github.com/llohse/libnpy in order to read a numpy file:

```<code>std::vector<unsigned long> shape {};
bool fortran_order;
std::vector<double> dataNpy;

const std::string path {"/home/ubuntu/template.npy"};
npy::LoadArrayFromNumpy(path, shape, fortran_order, dataNpy);
</code>```

I will need to further process this data and have been instructed to use arrays since vector copy is not optimal.

So this data should be a matrix but the lib reads it as linear.
That is why I want to create a pointer to a 2D table with a given size for rows and columns like this with the data from the vector

```<code> double (*template_data)[12] = (double (*)[12]) dataNpy.data();
</code>```

When I do it by explicitly putting the size, like above the compiler is ok with it, however, when I do it like the code below i get an error:

```<code>int sizeRows = 12, sizeColumns=12;
double (*template_data)[sizeRows] = (double (*)[sizeColumns]) dataNpy.data();
</code>```

Cannot initialize a variable of type 'double ( * )[sizeRows]' with an rvalue of type 'double ( * )[sizeColumns]'

Could you explain to me why that is?

Body:
I have a vector of doubles that I am passing to a lib https://github.com/llohse/libnpy in order to read a numpy file:

std::vector<unsigned long> shape {};
bool fortran_order;
std::vector<double> dataNpy;

const std::string path {"/home/ubuntu/template.npy"};
npy::LoadArrayFromNumpy(path, shape, fortran_order, dataNpy);

I will need to further process this data and have been instructed to use arrays since vector copy is not optimal.

So this data should be a matrix but the lib reads it as linear.
That is why I want to create a pointer to a 2D table with a given size for rows and columns like this with the data from the vector

 double (*template_data)[12] = (double (*)[12]) dataNpy.data();

When I do it by explicitly putting the size, like above the compiler is ok with it, however, when I do it like the code below i get an error:

int sizeRows = 12, sizeColumns=12;
double (*template_data)[sizeRows] = (double (*)[sizeColumns]) dataNpy.data();

Cannot initialize a variable of type 'double ( * )[sizeRows]' with an rvalue of type 'double ( * )[sizeColumns]'

Could you explain to me why that is?


问:
I want to connect to my server with jenkinsfile to execute some command
I want to connect to my server and then clone the project from my repo to the server in question and do a docker build. Could you show me a template? Because with my own code it only does the build on jenkins. It doesn't connect to the server to do the pull.

`

```<code>pipeline {
    agent any

    stages {

        stage('Pulling our project') {
            steps{
                withCredentials([gitUsernamePassword(credentialsId: 'GitlabCred')]) {
                    sh 'git pull origin jks'
                }
            }
        }

        stage('Building our project') {
            agent any
            steps {
                sh 'docker compose up -d --build'
            }
        }
   }
}
</code>```

`

Body:
I want to connect to my server and then clone the project from my repo to the server in question and do a docker build. Could you show me a template? Because with my own code it only does the build on jenkins. It doesn't connect to the server to do the pull.

`

pipeline {
    agent any

    stages {

        stage('Pulling our project') {
            steps{
                withCredentials([gitUsernamePassword(credentialsId: 'GitlabCred')]) {
                    sh 'git pull origin jks'
                }
            }
        }

        stage('Building our project') {
            agent any
            steps {
                sh 'docker compose up -d --build'
            }
        }
   }
}

`


问:
Can I make Signin modal with Spring security?
```<code>@Bean
    public SecurityFilterChain securityFilterChain (HttpSecurity http) throws Exception {
        http.csrf().disable();
        http.formLogin()
            .loginProcessingUrl("/")
            .defaultSuccessUrl("/")
        .and()
            .logout()
            .logoutRequestMatcher(new AntPathRequestMatcher("/logout"))
            .logoutSuccessUrl("/")
            .invalidateHttpSession(true);
</code>```

I made SecurityConfigure Class in my project.
but i want with new page, only Modal

```<code>@GetMapping("/signin")
    public void signIn() {
    }

@PostMapping("/signin")
@ResponseBody
    public String signIn() {
    }
</code>```

and I made controller

```<code><a class="w3-bar-item w3-button w3-right btn nav-link" data-bs-toggle="modal"
            id="btnSignIn" href="#staticBackdrop" role="button"
            style="font-size:medium; margin-top:25px; margin-right:20px;">SignIn</a>
</code>```

i tried to login my self, but i don't think about token.

i can't find about Modal with it. so i think i must use Security basic(?) login system.

i want to know how to use Security login system on Modal.

Body:
@Bean
    public SecurityFilterChain securityFilterChain (HttpSecurity http) throws Exception {
        http.csrf().disable();
        http.formLogin()
            .loginProcessingUrl("/")
            .defaultSuccessUrl("/")
        .and()
            .logout()
            .logoutRequestMatcher(new AntPathRequestMatcher("/logout"))
            .logoutSuccessUrl("/")
            .invalidateHttpSession(true);

I made SecurityConfigure Class in my project.
but i want with new page, only Modal

@GetMapping("/signin")
    public void signIn() {
    }

@PostMapping("/signin")
@ResponseBody
    public String signIn() {
    }

and I made controller

SignIn

i tried to login my self, but i don't think about token.

i can't find about Modal with it. so i think i must use Security basic(?) login system.

i want to know how to use Security login system on Modal.


问:
Is it possible to link a detail summary in such a way that it opens the detail when clicking the link?
I'm new to writing documentation in Markdown and working on end user documentation. I want to include some written-out steps for processes in details that are closed by default. I've anchored the summaries of these details and link to them from inside the same doc. Is there a way to format the link so that it shows you the content of the detail when you click it?

Putting the anchor on the first word of the detail didn't work.


问:
Show Unity View inside Native Android App Or Integrating Unity as library inside Native Android Application
I was following steps from this tutorial Medium but after syncing, I got the issue as mention below:

Could not find :VuforiaEngine:.

Required by:

project :app > project :unityLibrary

Failed to resolve: :VuforiaEngine

Affected Modules: app

Helping Hands Required.

Solution or step I am missing to incorporate (UaaL) Unity as library in android application.


问:
MobaXterm not sshing into server/VM, instead linking with my PC and can't close terminal window without shutting down PC
This is a strange one, I've had it occur a few too many times and it's difficult to give a title to, but recently on a number of occasions when I try to open one of my existing sessions (VM or  Server doesn't matter) the session doesn't open, it's just a black terminal screen with nothing on it, but my Windows task bar disappears, sometimes it ends up in the MobaXterm terminal window sometimes it doesn't. But if I then try to close the MobaXterm window I get a pop up on my PC for a shutdown, and the only way to close this window is to shut down my PC.

I am running a windows 11 PC, with MobaXterm Home Edition 22.2, and have seen this in 22.1 also. Not sure which earlier versions I was running before I encountered this problem or which version it started with.

Is this a known bug, another of my colleagues has encountered this also? Is there some setup I'm missing that could prevent this?


问:
(React.JS)Youtube Api nextpagetoken intermittent return duplicated video
when I use "GET https://www.googleapis.com/youtube/v3/search" with nextpagetoken,

intermittent return duplicate video

for instance,

maxResult:5

first call(without nextpagetoken)

get  {videoID : a} , {videoID : b} , {videoID : c} , {videoID : d}  , {videoID : e}

and than

second call (with nextpagetoken)

get {videoID : d} , {videoID : f} , {videoID : g} , {videoID : h} , {videoID : i}

I expect {videoID : f} , {videoID : g} , {videoID : h} , {videoID : i} , {videoID : j}

this is the problem!!

I wanted the list to constructed like [a,b,c,d,e,f,g,h,i,j]

but

list constructed like [a,b,c,d,e,d,f,g,h,i]

At first I thought a problem comes up when I set called api data on List.

but duplicate data has been called! and already duplicate data on List.

and also This problem does not always occur, but it often happens.

Am I write something wrong code to cause this problem(intermittent return duplicate result)?

Thanks to read long and rough question.


问:
How to made select option selected in react js / javascript
I should have dropdown with 2 options, and based on a configuration option one should be selected with an event handler in JavaScript.

I tried the below code :

```<code>const $select = document.querySelector('#mySelect');
$select.value = 'steve'
</code>```

Body:
I should have dropdown with 2 options, and based on a configuration option one should be selected with an event handler in JavaScript.

I tried the below code :

const $select = document.querySelector('#mySelect');
$select.value = 'steve'


问:
Multiple errors when I run npm install for a Vue proj
When I try to run npm install for my application, multiple of errors appear and I can't seem to find what's the problem. I've tried changing the policies with Windows PowerShelll, reinstalling node and vue and still when I run it, the errors appear.
Is there something I'm missing or I did something wrong?</p>
```<code>PS C:\Users\jorda\VueProjects\catering-project-front-main\catering-project-front-main> npm install
npm WARN cleanup Failed to remove some directories [
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\jorda\\VueProjects\\catering-project-front-main\\catering-project-front-main\\node_modules\\@babel',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\jorda\VueProjects\catering-project-front-main\catering-project-front-main\node_modules\@babel\generator\node_modules\@jridgewell\gen-mapping'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Users\\jorda\\VueProjects\\catering-project-front-main\\catering-project-front-main\\node_modules\\@babel\\generator\\node_modules\\@jridgewell\\gen-mapping'
npm WARN cleanup     }
npm WARN cleanup   ]
npm WARN cleanup ]
npm ERR! code 1
npm ERR! path C:\Users\jorda\VueProjects\catering-project-front-main\catering-project-front-main\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: C:\Program Files\nodejs\node.exe C:\Users\jorda\VueProjects\catering-project-front-main\catering-project-front-main\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
npm ERR! gyp verb cli   'C:\\Users\\jorda\\VueProjects\\catering-project-front-main\\catering-project-front-main\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm ERR! gyp verb cli   'rebuild',
npm ERR! gyp verb cli   '--verbose',
npm ERR! gyp verb cli   '--libsass_ext=',
npm ERR! gyp verb cli   '--libsass_cflags=',
npm ERR! gyp verb cli   '--libsass_ldflags=',
npm ERR! gyp verb cli   '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@8.4.1
npm ERR! gyp info using node@19.3.0 | win32 | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb find Python Python is not set from command line or npm configuration
npm ERR! gyp verb find Python Python is not set from environment variable PYTHON
npm ERR! gyp verb find Python checking if "python3" can be used
npm ERR! gyp verb find Python - executing "python3" to get executable path
npm ERR! gyp verb find Python - "python3" is not in PATH or produced an error
npm ERR! gyp verb find Python checking if "python" can be used
npm ERR! gyp verb find Python - executing "python" to get executable path
npm ERR! gyp verb find Python - executable path is "C:\Users\jorda\AppData\Local\Programs\Python\Python311\python.exe"
npm ERR! gyp verb find Python - executing "C:\Users\jorda\AppData\Local\Programs\Python\Python311\python.exe" to get version
npm ERR! gyp verb find Python - version is "3.11.1"
npm ERR! gyp info find Python using Python version 3.11.1 found at "C:\Users\jorda\AppData\Local\Programs\Python\Python311\python.exe"
npm ERR! gyp verb get node dir no --target version specified, falling back to host node version: 19.3.0
npm ERR! gyp verb command install [ '19.3.0' ]
npm ERR! gyp verb install input version string "19.3.0"
npm ERR! gyp verb install installing version: 19.3.0
npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed
npm ERR! gyp verb install version is already installed, need to check "installVersion"
npm ERR! gyp verb got "installVersion" 9
npm ERR! gyp verb needs "installVersion" 9
npm ERR! gyp verb install version is good
npm ERR! gyp verb get node dir target node version installed: 19.3.0
npm ERR! gyp verb build dir attempting to create "build" dir: C:\Users\jorda\VueProjects\catering-project-front-main\catering-project-front-main\node_modules\node-sass\build
npm ERR! gyp verb build dir "build" dir needed to be created? Yes
npm ERR! gyp verb find VS msvs_version not set from command line or npm config
npm ERR! gyp verb find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp verb find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details
npm ERR! gyp verb find VS looking for Visual Studio 2015
npm ERR! gyp verb find VS - not found
npm ERR! gyp verb find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack     at VisualStudioFinder.fail (C:\Users\jorda\VueProjects\catering-project-front-main\catering-project-front-main\node_modules\node-gyp\lib\find-visualstudio.js:122:47)
npm ERR! gyp ERR! stack     at C:\Users\jorda\VueProjects\catering-project-front-main\catering-project-front-main\node_modules\node-gyp\lib\find-visualstudio.js:75:16
npm ERR! gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (C:\Users\jorda\VueProjects\catering-project-front-main\catering-project-front-main\node_modules\node-gyp\lib\find-visualstudio.js:363:14)
npm ERR! gyp ERR! stack     at C:\Users\jorda\VueProjects\catering-project-front-main\catering-project-front-main\node_modules\node-gyp\lib\find-visualstudio.js:71:14
npm ERR! gyp ERR! stack     at C:\Users\jorda\VueProjects\catering-project-front-main\catering-project-front-main\node_modules\node-gyp\lib\find-visualstudio.js:384:16
npm ERR! gyp ERR! stack     at C:\Users\jorda\VueProjects\catering-project-front-main\catering-project-front-main\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack     at C:\Users\jorda\VueProjects\catering-project-front-main\catering-project-front-main\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:427:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1098:16)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:304:5)
npm ERR! gyp ERR! System Windows_NT 10.0.22000
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\jorda\\VueProjects\\catering-project-front-main\\catering-project-front-main\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd C:\Users\jorda\VueProjects\catering-project-front-main\catering-project-front-main\node_modules\node-sass
npm ERR! gyp ERR! node -v v19.3.0
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\jorda\AppData\Local\npm-cache\_logs\2022-12-16T10_25_28_499Z-debug-0.log
</code>```

Body:
When I try to run npm install for my application, multiple of errors appear and I can't seem to find what's the problem. I've tried changing the policies with Windows PowerShelll, reinstalling node and vue and still when I run it, the errors appear.
Is there something I'm missing or I did something wrong?

PS C:\Users\jorda\VueProjects\catering-project-front-main\catering-project-front-main> npm install
npm WARN cleanup Failed to remove some directories [
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\jorda\\VueProjects\\catering-project-front-main\\catering-project-front-main\\node_modules\\@babel',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\jorda\VueProjects\catering-project-front-main\catering-project-front-main\node_modules\@babel\generator\node_modules\@jridgewell\gen-mapping'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Users\\jorda\\VueProjects\\catering-project-front-main\\catering-project-front-main\\node_modules\\@babel\\generator\\node_modules\\@jridgewell\\gen-mapping'
npm WARN cleanup     }
npm WARN cleanup   ]
npm WARN cleanup ]
npm ERR! code 1
npm ERR! path C:\Users\jorda\VueProjects\catering-project-front-main\catering-project-front-main\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: C:\Program Files\nodejs\node.exe C:\Users\jorda\VueProjects\catering-project-front-main\catering-project-front-main\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
npm ERR! gyp verb cli   'C:\\Users\\jorda\\VueProjects\\catering-project-front-main\\catering-project-front-main\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm ERR! gyp verb cli   'rebuild',
npm ERR! gyp verb cli   '--verbose',
npm ERR! gyp verb cli   '--libsass_ext=',
npm ERR! gyp verb cli   '--libsass_cflags=',
npm ERR! gyp verb cli   '--libsass_ldflags=',
npm ERR! gyp verb cli   '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@8.4.1
npm ERR! gyp info using node@19.3.0 | win32 | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb find Python Python is not set from command line or npm configuration
npm ERR! gyp verb find Python Python is not set from environment variable PYTHON
npm ERR! gyp verb find Python checking if "python3" can be used
npm ERR! gyp verb find Python - executing "python3" to get executable path
npm ERR! gyp verb find Python - "python3" is not in PATH or produced an error
npm ERR! gyp verb find Python checking if "python" can be used
npm ERR! gyp verb find Python - executing "python" to get executable path
npm ERR! gyp verb find Python - executable path is "C:\Users\jorda\AppData\Local\Programs\Python\Python311\python.exe"
npm ERR! gyp verb find Python - executing "C:\Users\jorda\AppData\Local\Programs\Python\Python311\python.exe" to get version
npm ERR! gyp verb find Python - version is "3.11.1"
npm ERR! gyp info find Python using Python version 3.11.1 found at "C:\Users\jorda\AppData\Local\Programs\Python\Python311\python.exe"
npm ERR! gyp verb get node dir no --target version specified, falling back to host node version: 19.3.0
npm ERR! gyp verb command install [ '19.3.0' ]
npm ERR! gyp verb install input version string "19.3.0"
npm ERR! gyp verb install installing version: 19.3.0
npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed
npm ERR! gyp verb install version is already installed, need to check "installVersion"
npm ERR! gyp verb got "installVersion" 9
npm ERR! gyp verb needs "installVersion" 9
npm ERR! gyp verb install version is good
npm ERR! gyp verb get node dir target node version installed: 19.3.0
npm ERR! gyp verb build dir attempting to create "build" dir: C:\Users\jorda\VueProjects\catering-project-front-main\catering-project-front-main\node_modules\node-sass\build
npm ERR! gyp verb build dir "build" dir needed to be created? Yes
npm ERR! gyp verb find VS msvs_version not set from command line or npm config
npm ERR! gyp verb find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp verb find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details
npm ERR! gyp verb find VS looking for Visual Studio 2015
npm ERR! gyp verb find VS - not found
npm ERR! gyp verb find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack     at VisualStudioFinder.fail (C:\Users\jorda\VueProjects\catering-project-front-main\catering-project-front-main\node_modules\node-gyp\lib\find-visualstudio.js:122:47)
npm ERR! gyp ERR! stack     at C:\Users\jorda\VueProjects\catering-project-front-main\catering-project-front-main\node_modules\node-gyp\lib\find-visualstudio.js:75:16
npm ERR! gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (C:\Users\jorda\VueProjects\catering-project-front-main\catering-project-front-main\node_modules\node-gyp\lib\find-visualstudio.js:363:14)
npm ERR! gyp ERR! stack     at C:\Users\jorda\VueProjects\catering-project-front-main\catering-project-front-main\node_modules\node-gyp\lib\find-visualstudio.js:71:14
npm ERR! gyp ERR! stack     at C:\Users\jorda\VueProjects\catering-project-front-main\catering-project-front-main\node_modules\node-gyp\lib\find-visualstudio.js:384:16
npm ERR! gyp ERR! stack     at C:\Users\jorda\VueProjects\catering-project-front-main\catering-project-front-main\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack     at C:\Users\jorda\VueProjects\catering-project-front-main\catering-project-front-main\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:427:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1098:16)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:304:5)
npm ERR! gyp ERR! System Windows_NT 10.0.22000
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\jorda\\VueProjects\\catering-project-front-main\\catering-project-front-main\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd C:\Users\jorda\VueProjects\catering-project-front-main\catering-project-front-main\node_modules\node-sass
npm ERR! gyp ERR! node -v v19.3.0
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\jorda\AppData\Local\npm-cache\_logs\2022-12-16T10_25_28_499Z-debug-0.log


问:
How to get url string from url using resolve django for RBAC
I have used extract_views_from_urlpatterns method of show_urls management command in django-extenstion package for populating system urls into the DB. Now whenever user requesting to server it will intercept in middleware there i want to check if requested URL found in URLMaster model(all system URL store) but it didn't match due to the requested url not found here I am attaching the code.

Populating the URL's

```<code>urlconf = __import__(settings.ROOT_URLCONF)
urls = Command().extract_views_from_urlpatterns(urlconf.urls.urlpatterns)
for view, url, url_name in urls:
    if url_name is None:
        URLMaster.objects.get_or_create(url=url, defaults=dict(view_name=view.__qualname__, url_name=url_name))

</code>```

Now currently i am check that URL in view further will check in middleware.

```<code>from django.contrib.admindocs.views import simplify_regex # for simplifying regex
from src.core.models import URLMaster # model has all the url's

request_url = request._request.resolver_match.route
print(request_url) # will print 'rough/packet-split/(?P<pk>[^/.]+)/packet-list/$'

# simplifying the URL
print(simplify_regex(request_url)) # will print '/rough/packet-split/<pk>/packet-list/'

# The same url I have saved in DB
url_master_url = URLMaster.objects.get(id=1216).url
print(url_master_url) # will print 'rough/^packet-split/(?P<pk>[^/.]+)/packet-list\\.(?P<format>[a-z0-9]+)/?$'

# now simplifying the URL
print(simplify_regex(url_master_url)) # will print '/rough/packet-split/<pk>/packet-list\\.<format>/'

# now i am comparing is it the same like
simplify_regex(url_master_url) == simplify_regex(request_url) # returning false due to the url mismatched
</code>```

I am binding the permission to particular URL. But didn't match therefor Is there any approach to comparing or saving URL to DB

Body:
I have used extract_views_from_urlpatterns method of show_urls management command in django-extenstion package for populating system urls into the DB. Now whenever user requesting to server it will intercept in middleware there i want to check if requested URL found in URLMaster model(all system URL store) but it didn't match due to the requested url not found here I am attaching the code.

Populating the URL's

urlconf = __import__(settings.ROOT_URLCONF)
urls = Command().extract_views_from_urlpatterns(urlconf.urls.urlpatterns)
for view, url, url_name in urls:
    if url_name is None:
        URLMaster.objects.get_or_create(url=url, defaults=dict(view_name=view.__qualname__, url_name=url_name))

Now currently i am check that URL in view further will check in middleware.

from django.contrib.admindocs.views import simplify_regex # for simplifying regex
from src.core.models import URLMaster # model has all the url's

request_url = request._request.resolver_match.route
print(request_url) # will print 'rough/packet-split/(?P<pk>[^/.]+)/packet-list/$'

# simplifying the URL
print(simplify_regex(request_url)) # will print '/rough/packet-split/<pk>/packet-list/'

# The same url I have saved in DB
url_master_url = URLMaster.objects.get(id=1216).url
print(url_master_url) # will print 'rough/^packet-split/(?P<pk>[^/.]+)/packet-list\\.(?P<format>[a-z0-9]+)/?$'

# now simplifying the URL
print(simplify_regex(url_master_url)) # will print '/rough/packet-split/<pk>/packet-list\\.<format>/'

# now i am comparing is it the same like
simplify_regex(url_master_url) == simplify_regex(request_url) # returning false due to the url mismatched

I am binding the permission to particular URL. But didn't match therefor Is there any approach to comparing or saving URL to DB


问:
How do I Solve Multi-Variable Differential Equation?
I am trying to find 5 optimized values for f(x1,x2,x3,x4,x5)
I know how to solve the x value that minimizes f(x) by using scipy.minimize or odeint,
but how do I solve it when there are 5 different variables?

I tried finding optimized values by assuming that the other 4 values are constant,
but it isn't.
The final equation is so complicated that it is so hard to calculate by myself.
I want to find the optimized values which makes global minimum.


问:
mongosync fails while synchronising data between source and destination sharded cluster
I am trying to synchronize data from source cluster to the destination cluster using mongosync however hitting the below error.
{"level":"fatal","serverID":"891fbc43","mongosyncID":"myShard_0","error":"(InvalidOptions) The 'clusteredIndex' option is not supported for namespace mongosync_reserved_for_internal_use.lastWriteStates.footballdb","time":"2022-12-16T02:21:15.209841065-08:00","message":"Error during replication"}

source cluster details:-

3 shards where each shard is a single node replicaset

Dataset: one database with one collection sharded across shards

destination cluster details:-

3 shards where each shard is a single node replicaset

No user data

All the mongosync pre-reqs including RBAC are verified successfully.

I am unable to diagnose the error here - The 'clusteredIndex' option is not supported for namespace mongosync_reserved_for_internal_use.lastWriteStates.footballdb

I tried the same usecase with same dataset for N node replicaset source(without shard) and destination cluster and the synchronisation worked fine.


问:
How to add time zone in react-cron-generator
I'm using react-cron-generator  in my react app, and i don't have any information about timezone ,How can i know which time zone in react-cron-generator.
Versions :
"react": "^17.0.2",
"react-cron-generator": "^1.3.5",</p>


问:
Eslint in angular placing = in incorrect place
I am setting up eslint in an agular project.  In my html files, it will see something like this:

`

```<code>*ngIf="
  config.inputType == 'string' ||
  config.inputType == 'url' ||
  config.inputType == 'number' ||
  config.inputType == 'text'
"
</code>```

`

It it yells at me with a red line under the == since it breaks the @angular-eslint/recommended/eqeqeq rule.

And change it to this (this change happens if I do it in my IDE or by running the ng lint --fix command).

`

```<code>          *ngIf="
            config.inputType == 'string' ||
=            config.inputType == 'url' ||
            config.inputType == 'number' ||
            config.inputType == 'text'
          "
</code>```

`

You can see that it has put the additional = at the beginning of the next line and not where it is needed.

This seems to only be happening when or (||) or and (&&) is involved.

Here is what my .eslintrc.json file looks like:

`

```<code>{
  "root": true,
  "ignorePatterns": ["projects/**/*", "**/node_modules", "**/.angular/**"],
  "overrides": [
    {
      "files": ["*.ts"],
      "parserOptions": {
        "project": ["tsconfig.json", "e2e/tsconfig.json"],
        "createDefaultProgram": true
      },
      "extends": [
        "eslint:recommended",
        "plugin:@typescript-eslint/recommended",
        "plugin:@angular-eslint/recommended",
        "plugin:@angular-eslint/recommended--extra",
        "plugin:@angular-eslint/template/process-inline-templates"
      ],
      "rules": {
        "@angular-eslint/component-selector": [
          "error",
          {
            "prefix": "app",
            "style": "kebab-case",
            "type": "element"
          }
        ],
        "@angular-eslint/no-output-native": [
          "off",
          {
            "prefix": "app",
            "style": "kebab-case",
            "type": "element"
          }
        ],
        "@angular-eslint/directive-selector": [
          "error",
          {
            "prefix": "app",
            "style": "camelCase",
            "type": "attribute"
          }
        ]
      }
    },
    {
      "files": ["*.html"],
      "extends": ["plugin:@angular-eslint/template/recommended"],
      "rules": {}
    },
    {
      "files": ["*.html"],
      "excludedFiles": ["*inline-template-*.component.html"],
      "extends": ["plugin:prettier/recommended"],
      "rules": {
        "prettier/prettier": ["error", { "parser": "angular" }]
      }
    }
  ]
}
</code>```

`

I have tried changing around my .eslintrc.json file with no affect.

Body:
I am setting up eslint in an agular project.  In my html files, it will see something like this:

`

*ngIf="
  config.inputType == 'string' ||
  config.inputType == 'url' ||
  config.inputType == 'number' ||
  config.inputType == 'text'
"

`

It it yells at me with a red line under the == since it breaks the @angular-eslint/recommended/eqeqeq rule.

And change it to this (this change happens if I do it in my IDE or by running the ng lint --fix command).

`

          *ngIf="
            config.inputType == 'string' ||
=            config.inputType == 'url' ||
            config.inputType == 'number' ||
            config.inputType == 'text'
          "

`

You can see that it has put the additional = at the beginning of the next line and not where it is needed.

This seems to only be happening when or (||) or and (&&) is involved.

Here is what my .eslintrc.json file looks like:

`

{
  "root": true,
  "ignorePatterns": ["projects/**/*", "**/node_modules", "**/.angular/**"],
  "overrides": [
    {
      "files": ["*.ts"],
      "parserOptions": {
        "project": ["tsconfig.json", "e2e/tsconfig.json"],
        "createDefaultProgram": true
      },
      "extends": [
        "eslint:recommended",
        "plugin:@typescript-eslint/recommended",
        "plugin:@angular-eslint/recommended",
        "plugin:@angular-eslint/recommended--extra",
        "plugin:@angular-eslint/template/process-inline-templates"
      ],
      "rules": {
        "@angular-eslint/component-selector": [
          "error",
          {
            "prefix": "app",
            "style": "kebab-case",
            "type": "element"
          }
        ],
        "@angular-eslint/no-output-native": [
          "off",
          {
            "prefix": "app",
            "style": "kebab-case",
            "type": "element"
          }
        ],
        "@angular-eslint/directive-selector": [
          "error",
          {
            "prefix": "app",
            "style": "camelCase",
            "type": "attribute"
          }
        ]
      }
    },
    {
      "files": ["*.html"],
      "extends": ["plugin:@angular-eslint/template/recommended"],
      "rules": {}
    },
    {
      "files": ["*.html"],
      "excludedFiles": ["*inline-template-*.component.html"],
      "extends": ["plugin:prettier/recommended"],
      "rules": {
        "prettier/prettier": ["error", { "parser": "angular" }]
      }
    }
  ]
}

`

I have tried changing around my .eslintrc.json file with no affect.


问:
Button to download a single file downloads it twice with one click
I have a simple button which allows users to download a single PDF file. But when I click on it, it downloads the same file twice.

```<code><a class="btn" href="[my_pdf_link]" download>Download</a>
</code>```

The client is Chrome, but it seems that it works normally on Firefox (one file downloaded).

How can I correct this ?

Body:
I have a simple button which allows users to download a single PDF file. But when I click on it, it downloads the same file twice.

Download

The client is Chrome, but it seems that it works normally on Firefox (one file downloaded).

How can I correct this ?


问:
What's Another Alternative To Reloading A Webpage When Navigating Back or Forth To It?
Below is the Javascript that I'm using on my website. I used it to get the background of the menu bar to freeze (make it so that it doesn't move/isn't scrollable) when it's open on a mobile browser.

```<code> document.getElementById('cp_toggle03').onchange = function() {
 if (document.getElementById('cp_toggle03').checked) {
 document.body.style.overflow = "hidden";
  } else {
 document.body.style.overflow = "";
  }
}

</code>```

This Javascript works well except when I navigate back or forward to a page that I've previously viewed where the menu bar was open. In such instances, the Javascript is completely ignored and the background is scrollable. To stop this from happening, I added another script to refresh a page when I navigate back or forth to it. However, with the script, I get a flash of unstyled content that appears for about a second or so when navigating between a page.

```<code>if(performance.getEntriesByType("navigation")[0].type == "back_forward"){
    location.reload();

debugger;

}
</code>```

How can I get the first bit of Javascript to work even navigating back or forth to a webpage on a mobile browser after having opened the menu bar? Is setting the webpage so that it refreshes the webpage the best option? Is there a better alternative? Any knowledge that you could share with me would be much appreciated.

Body:
Below is the Javascript that I'm using on my website. I used it to get the background of the menu bar to freeze (make it so that it doesn't move/isn't scrollable) when it's open on a mobile browser.

 document.getElementById('cp_toggle03').onchange = function() {
 if (document.getElementById('cp_toggle03').checked) {
 document.body.style.overflow = "hidden";
  } else {
 document.body.style.overflow = "";
  }
}

This Javascript works well except when I navigate back or forward to a page that I've previously viewed where the menu bar was open. In such instances, the Javascript is completely ignored and the background is scrollable. To stop this from happening, I added another script to refresh a page when I navigate back or forth to it. However, with the script, I get a flash of unstyled content that appears for about a second or so when navigating between a page.

if(performance.getEntriesByType("navigation")[0].type == "back_forward"){
    location.reload();

debugger;

}

How can I get the first bit of Javascript to work even navigating back or forth to a webpage on a mobile browser after having opened the menu bar? Is setting the webpage so that it refreshes the webpage the best option? Is there a better alternative? Any knowledge that you could share with me would be much appreciated.


问:
Rounded corners for a boxplot using ggplot2
I tried to find anything that would help me to round the corners of my ggplot2 boxplots but nothing matches my needs.

I found ggchicklet package with geom_chicklet function but it seems that it only accepts geom_col and geom_bar. That is why my question is there any other ways to make my boxplots' corners round?


问:
How to extend spring security config and spring authorisation server in eclipse?
I can port spring authorisation server into Eclipse via the gradle project, but I am stumped on how to also add spring security config as a code dependency so that I can update the config classes.

I am unsure how to link the 2 projects as in Eclipse it is using a library classpath built from gradle config.

I have tried adding spring security as a implementation project and adding a projectdir but it fails as it cannot classes and plugins to build the classpath.

Any ideas? Tried contacting the development team but no response so far.

Tried contacting the developers

adding project dependency


问:
How do I get toast notification information using winrt? (Windows 10)
I have a small script that is able to retrieve Windows toast notifications. However, so far I have only been able to get the notification's ID, Title, and Text. I am wondering how to get other information like images and the link when you click on the notification?

This may be a helpful resource: https://learn.microsoft.com/en-us/uwp/api/windows.ui.notifications.notification?view=winrt-22621

Thusfar I have not been able to do this so I hope someone here can help me. Thank you in advance!

Here is my code thusfar:

```<code>from winrt_clone.windows.ui.notifications.management import UserNotificationListener
from winrt_clone.windows.ui.notifications import NotificationKinds, KnownNotificationBindings
import asyncio

async def get_notis():
    global notificationsnotifications = await listener.get_notifications_async(NotificationKinds.TOAST)

notifications = []
listener = None

async def loop_over_notifications():
    global listenerlistener = UserNotificationListener.get_current()
    await get_notis()

    for i in notifications: # i is UserNotification
        text_sequence = i.notification.visual.get_binding(KnownNotificationBindings.get_toast_generic()).get_text_elements()
        it = iter(text_sequence)

        try:
            notification_title = it.current.text
            while True:
                next(it, None)
                if it.has_current:
                    notification_text = it.current.text
                else:
                    notification_text = it.text
                    break
        except:
            pass

        return notification_title, notification_text
</code>```

Body:
I have a small script that is able to retrieve Windows toast notifications. However, so far I have only been able to get the notification's ID, Title, and Text. I am wondering how to get other information like images and the link when you click on the notification?

This may be a helpful resource: https://learn.microsoft.com/en-us/uwp/api/windows.ui.notifications.notification?view=winrt-22621

Thusfar I have not been able to do this so I hope someone here can help me. Thank you in advance!

Here is my code thusfar:

from winrt_clone.windows.ui.notifications.management import UserNotificationListener
from winrt_clone.windows.ui.notifications import NotificationKinds, KnownNotificationBindings
import asyncio

async def get_notis():
    global notificationsnotifications = await listener.get_notifications_async(NotificationKinds.TOAST)

notifications = []
listener = None

async def loop_over_notifications():
    global listenerlistener = UserNotificationListener.get_current()
    await get_notis()

    for i in notifications: # i is UserNotification
        text_sequence = i.notification.visual.get_binding(KnownNotificationBindings.get_toast_generic()).get_text_elements()
        it = iter(text_sequence)

        try:
            notification_title = it.current.text
            while True:
                next(it, None)
                if it.has_current:
                    notification_text = it.current.text
                else:
                    notification_text = it.text
                    break
        except:
            pass

        return notification_title, notification_text


问:
Can we send signal from client to publisher in openTok?
I am using vonage open tok api in order to do video conferencing. In it, I am using signals to send some events from publisher to the client. But when I try to send some signal from client to publisher, I am unable to do so.
my question is that does openTok allow client to send signal back to publisher?
If yes, then how?

I tried to send signal form client to publisher, but the signal is not reciving on publisher end I want to recieve that signal so that I will be able to update something on publisher screan.