问:
Java pong can't move both paddles at once
I want to create a pong game where players move 2 paddles with w-s and up-down keys

I'm creating a pong game in java with swing and the graphics. My idea is that two players play game one on the same keyboard with the W-S and UP-DOWN keys to move the racket left and right respectively. When implementing it I got stuck since the two rackets cannot be moved at the same time, if you press W the racket on the left moves but the one on the right cannot be moved until you release the w, the same happens with the buttons on the shovel on the right I put the rackets in 2 different threads but the problem continues and it seems to me that it is because of the KeyListener.

I leave you the important parts of the shovel and window class.

Key listener:

```<code>public Ventana() {
        setSize(600, 400);
        setResizable(false);
        setLocationRelativeTo(null);
        setTitle("Pong");
        setDefaultCloseOperation(EXIT_ON_CLOSE);

        jugador1 = new Raqueta(this, Raqueta.JUGADOR1);
        jugador2 = new Raqueta(this, Raqueta.JUGADOR2);

        jugador1.start();
        jugador2.start();

        addKeyListener(this);
    }

    @Override
    public void paint(Graphics g) {
        g.setColor(Color.BLACK);
        g.fillRect(0, 0, getWidth(), getHeight());

        g.setColor(Color.WHITE);
        jugador1.dibujar(g);
        jugador2.dibujar(g);
    }

    @Override
    public void keyTyped(KeyEvent e) {}

    @Override
    public void keyPressed(KeyEvent e) {
        switch (e.getKeyCode()) {
            case KeyEvent.VK_W:
                jugador1.moverY(Raqueta.SUBIR);
                break;
            case KeyEvent.VK_S:
                jugador1.moverY(Raqueta.BAJAR);
                break;
            case KeyEvent.VK_UP:
                jugador2.moverY(Raqueta.SUBIR);
                break;
            case KeyEvent.VK_DOWN:
                jugador2.moverY(Raqueta.BAJAR);
                break;
        }

        repaint();
    }

    @Override
    public void keyReleased(KeyEvent e) {
        switch (e.getKeyCode()) {
            case KeyEvent.VK_W:
            case KeyEvent.VK_S:
                jugador1.moverY(Raqueta.PARAR);
            case KeyEvent.VK_UP:
            case KeyEvent.VK_DOWN:
                jugador2.moverY(Raqueta.PARAR);
        }
    }

</code>```

The racket:

```<code>public class Raqueta extends Thread{
    private int x, y, anchura, altura;
    private byte direccion;
    public final static byte BAJAR = 0;
    public final static byte SUBIR = 1;
    public final static byte PARAR = -1;
    public final static byte JUGADOR1 = 1;
    public final static byte JUGADOR2 = 2;

    public void setDireccion(byte direccion) {
        this.direccion = direccion;
    }

    @Override
    public void run() {
        try {
            while (true) {
                moverY(direccion);
                Thread.sleep(5);
            }
        } catch (InterruptedException ex) {
            System.exit(0);
        }
    }

    public void moverY(byte x) {
        if (x == BAJAR){
            this.y = y + 10;
        } else if (x == SUBIR){
            this.y = y - 10;
        }
    }

    public void dibujar(Graphics g){
        g.fillRect(getX(), getY(), getAnchura(), getAltura());
    }
}
</code>```

Body:
I want to create a pong game where players move 2 paddles with w-s and up-down keys

I'm creating a pong game in java with swing and the graphics. My idea is that two players play game one on the same keyboard with the W-S and UP-DOWN keys to move the racket left and right respectively. When implementing it I got stuck since the two rackets cannot be moved at the same time, if you press W the racket on the left moves but the one on the right cannot be moved until you release the w, the same happens with the buttons on the shovel on the right I put the rackets in 2 different threads but the problem continues and it seems to me that it is because of the KeyListener.

I leave you the important parts of the shovel and window class.

Key listener:

public Ventana() {
        setSize(600, 400);
        setResizable(false);
        setLocationRelativeTo(null);
        setTitle("Pong");
        setDefaultCloseOperation(EXIT_ON_CLOSE);

        jugador1 = new Raqueta(this, Raqueta.JUGADOR1);
        jugador2 = new Raqueta(this, Raqueta.JUGADOR2);

        jugador1.start();
        jugador2.start();

        addKeyListener(this);
    }

    @Override
    public void paint(Graphics g) {
        g.setColor(Color.BLACK);
        g.fillRect(0, 0, getWidth(), getHeight());

        g.setColor(Color.WHITE);
        jugador1.dibujar(g);
        jugador2.dibujar(g);
    }

    @Override
    public void keyTyped(KeyEvent e) {}

    @Override
    public void keyPressed(KeyEvent e) {
        switch (e.getKeyCode()) {
            case KeyEvent.VK_W:
                jugador1.moverY(Raqueta.SUBIR);
                break;
            case KeyEvent.VK_S:
                jugador1.moverY(Raqueta.BAJAR);
                break;
            case KeyEvent.VK_UP:
                jugador2.moverY(Raqueta.SUBIR);
                break;
            case KeyEvent.VK_DOWN:
                jugador2.moverY(Raqueta.BAJAR);
                break;
        }

        repaint();
    }

    @Override
    public void keyReleased(KeyEvent e) {
        switch (e.getKeyCode()) {
            case KeyEvent.VK_W:
            case KeyEvent.VK_S:
                jugador1.moverY(Raqueta.PARAR);
            case KeyEvent.VK_UP:
            case KeyEvent.VK_DOWN:
                jugador2.moverY(Raqueta.PARAR);
        }
    }

The racket:

public class Raqueta extends Thread{
    private int x, y, anchura, altura;
    private byte direccion;
    public final static byte BAJAR = 0;
    public final static byte SUBIR = 1;
    public final static byte PARAR = -1;
    public final static byte JUGADOR1 = 1;
    public final static byte JUGADOR2 = 2;

    public void setDireccion(byte direccion) {
        this.direccion = direccion;
    }

    @Override
    public void run() {
        try {
            while (true) {
                moverY(direccion);
                Thread.sleep(5);
            }
        } catch (InterruptedException ex) {
            System.exit(0);
        }
    }

    public void moverY(byte x) {
        if (x == BAJAR){
            this.y = y + 10;
        } else if (x == SUBIR){
            this.y = y - 10;
        }
    }

    public void dibujar(Graphics g){
        g.fillRect(getX(), getY(), getAnchura(), getAltura());
    }
}


来源: stackexchange

问:
is Aegir Drupal10 compatible?
I believe that Aegir is not compatible with Drupal10.
Aegir Release Notes

Is it planned and for when ?

ContentLicense: CC BY-SA 4.0

Title: is Aegir Drupal10 compatible?


Title: (Pegas) Use sample names instead of haplotype names as labels in the haplotype network

Body:
In the network below, each sample is it's own unique haplotype. So I would like to label each circle with its sample name (D20B1 would replace VIII for example). It makes it much easier to read and you then you don't need a legend.
I can fine tune the size of the circles and other scales, so don't be concerned about that.

This is how I generated it:

plot(net, size=attr(net, "freq"),scale.ratio = 1, cex = 1, labels=T,
     pie = ft, font=3, fast=T, threshold=0, show.mutation = 3, legend=F
     )

y_coord = ( par("usr")[4]) - (par("usr")[4]*0.01)
legend_coord = c((par("usr")[1]), y_coord)
#plot the legend
legend(x=legend_coord[1], y=legend_coord[2], unique(sort(sites$site)),
       fill=rainbow(length(unique(sites$site))), bty="n", cex=1)

Here is my network object (net):

structure(c(5, 6, 7, 8, 9, 11, 7, 13, 2, 3, 10, 12, 3, 3, 3,
3, 3, 3, 4, 7, 1, 1, 4, 4, 2, 2, 2, 2, 2, 2, 2, 3, 4, 4, 4, 7,
0.997829760277465, 0.997829760277465, 0.997829760277465, 0.997829760277465,
0.997829760277465, 0.997829760277465, 0.997829760277465, 0.996746407283241,
0.995664230495361, 0.995664230495361, 0.995664230495361, 0.992424744601474
), dim = c(12L, 4L), dimnames = list(NULL, c("", "", "step",
"Prob")), freq = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L), labels = c("I", "II", "III", "IV", "V", "VI", "VII",
"VIII", "IX", "X", "XI", "XII", "XIII"), alter.links = structure(c(6,
7, 8, 11, 7, 8, 9, 11, 8, 9, 11, 11, 5, 6, 7, 8, 11, 4, 5, 6,
8, 9, 11, 9, 10, 9, 11, 13, 13, 13, 13, 13, 13, 13, 4, 9, 7,
11, 10, 10, 10, 10, 10, 11, 13, 12, 5, 5, 5, 5, 6, 6, 6, 6, 7,
7, 7, 8, 1, 1, 1, 1, 1, 3, 4, 4, 4, 4, 4, 5, 6, 8, 9, 3, 4, 5,
6, 8, 9, 11, 1, 1, 2, 2, 3, 5, 7, 8, 9, 10, 1, 10, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7,
0.997829760277465, 0.997829760277465, 0.997829760277465, 0.997829760277465,
0.997829760277465, 0.997829760277465, 0.997829760277465, 0.997829760277465,
0.997829760277465, 0.997829760277465, 0.997829760277465, 0.997829760277465,
0.995664230495361, 0.995664230495361, 0.995664230495361, 0.995664230495361,
0.995664230495361, 0.995664230495361, 0.995664230495361, 0.995664230495361,
0.995664230495361, 0.995664230495361, 0.995664230495361, 0.995664230495361,
0.995664230495361, 0.995664230495361, 0.995664230495361, 0.994583228636722,
0.994583228636722, 0.994583228636722, 0.994583228636722, 0.994583228636722,
0.994583228636722, 0.994583228636722, 0.99350340043119, 0.99350340043119,
0.99350340043119, 0.99350340043119, 0.99350340043119, 0.99350340043119,
0.99350340043119, 0.99350340043119, 0.99350340043119, 0.99350340043119,
0.992424744601474, 0.992424744601474), dim = c(46L, 4L), dimnames = list(
    NULL, c("", "", "step", "Prob"))), class = "haploNet")

And here is the sites object

structure(list(sample = c("D20B3", "D20B7", "D8B6", "D20B1",
"D8B3", "D8B8", "D8B7", "D20B8", "D8B67", "D20B40", "D8B2", "D8B1",
"D8B9"), site = c("D20B3", "D20B7", "D8B6", "D20B1", "D8B3",
"D8B8", "D8B7", "D20B8", "D8B67", "D20B40", "D8B2", "D8B1", "D8B9"
), haplotype = c("D20B3", "D20B7", "D8B6", "D20B1", "D8B3", "D8B8",
"D8B7", "D20B8", "D8B67", "D20B40", "D8B2", "D8B1", "D8B9")), class = "data.frame", row.names = c(NA,
-13L))

ft was generated like this:

ft <- table(sites[3:2])
> ft
         site
haplotype D20B1 D20B3 D20B40 D20B7 D20B8 D8B1 D8B2 D8B3 D8B6 D8B67 D8B7 D8B8 D8B9
   D20B1      1     0      0     0     0    0    0    0    0     0    0    0    0
   D20B3      0     1      0     0     0    0    0    0    0     0    0    0    0
   D20B40     0     0      1     0     0    0    0    0    0     0    0    0    0
   D20B7      0     0      0     1     0    0    0    0    0     0    0    0    0
   D20B8      0     0      0     0     1    0    0    0    0     0    0    0    0
   D8B1       0     0      0     0     0    1    0    0    0     0    0    0    0
   D8B2       0     0      0     0     0    0    1    0    0     0    0    0    0
   D8B3       0     0      0     0     0    0    0    1    0     0    0    0    0
   D8B6       0     0      0     0     0    0    0    0    1     0    0    0    0
   D8B67      0     0      0     0     0    0    0    0    0     1    0    0    0
   D8B7       0     0      0     0     0    0    0    0    0     0    1    0    0
   D8B8       0     0      0     0     0    0    0    0    0     0    0    1    0
   D8B9       0     0      0     0     0    0    0    0    0     0    0    0    1


问:
POSTMAN CURL File input corrupted
```<code>curl --location --request **PUT** 'https://REMOTE_SERVER/1177.png?v=3f75572bc00587e6104ed42d2e16a8f69656fdc63d50be78fb685266a2358340' --header 'Content-Length: 6137' --form 'File=@"/home/user/Documents/1177.png"'
</code>```

im using postman / php code which creates the above curl , the issue I'm facing is it uploading all type of files but all the files seems to be corrupted and unable to open or load in the browser, following is set up as a remote server
https://modules.prosody.im/mod_http_upload_external.html

only PUT is  allowed here to upload files

in case of .txt file it looks good but it addes below code so it looks to me its because of some headers im missing or what not sure can you please help ?

--------------------     SOLUTION    ---------------------

```<code> $curl = curl_init();
        curl_setopt_array($curl, [
            CURLOPT_URL => "$remoteSever$fileName?v=$secretAuthToken",
            // CURLOPT_UPLOAD => true,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_ENCODING => "",
            CURLOPT_FOLLOWLOCATION => false,
            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
            //  CURLOPT_BINARYTRANSFER => true,
            //  CURLOPT_HEADER => false,
            // CURLOPT_CUSTOMREQUEST => 'PUT',
            CURLOPT_PUT => true,
            CURLOPT_INFILE => fopen($file->getRealPath(), 'rb'),
            CURLOPT_INFILESIZE => $fileSize,
            CURLOPT_SSL_VERIFYPEER => false,
//            CURLOPT_POSTFIELDS => [
//              'File'=> new \CURLFile($request->file('media_file'))
//              //  'File'=> $request->file('media_file')
//            ],
//            CURLOPT_HTTPHEADER => [
//                "Content-Length: $fileSize",
//                "Content-Type: $fileMimeType"
//            ],
        ]);

        $output = curl_exec($curl);
        curl_close($curl);
</code>```

Title: POSTMAN CURL File input corrupted

Body:
curl --location --request **PUT** 'https://REMOTE_SERVER/1177.png?v=3f75572bc00587e6104ed42d2e16a8f69656fdc63d50be78fb685266a2358340' --header 'Content-Length: 6137' --form 'File=@"/home/user/Documents/1177.png"'

im using postman / php code which creates the above curl , the issue I'm facing is it uploading all type of files but all the files seems to be corrupted and unable to open or load in the browser, following is set up as a remote server
https://modules.prosody.im/mod_http_upload_external.html

only PUT is  allowed here to upload files

in case of .txt file it looks good but it addes below code so it looks to me its because of some headers im missing or what not sure can you please help ?

--------------------     SOLUTION    ---------------------

 $curl = curl_init();
        curl_setopt_array($curl, [
            CURLOPT_URL => "$remoteSever$fileName?v=$secretAuthToken",
            // CURLOPT_UPLOAD => true,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_ENCODING => "",
            CURLOPT_FOLLOWLOCATION => false,
            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
            //  CURLOPT_BINARYTRANSFER => true,
            //  CURLOPT_HEADER => false,
            // CURLOPT_CUSTOMREQUEST => 'PUT',
            CURLOPT_PUT => true,
            CURLOPT_INFILE => fopen($file->getRealPath(), 'rb'),
            CURLOPT_INFILESIZE => $fileSize,
            CURLOPT_SSL_VERIFYPEER => false,
//            CURLOPT_POSTFIELDS => [
//              'File'=> new \CURLFile($request->file('media_file'))
//              //  'File'=> $request->file('media_file')
//            ],
//            CURLOPT_HTTPHEADER => [
//                "Content-Length: $fileSize",
//                "Content-Type: $fileMimeType"
//            ],
        ]);

        $output = curl_exec($curl);
        curl_close($curl);


问:
OpenCV recoverPose returns few inliers (sometimes 0) for about 30% of cases
I try to triangulate key points around the camera but only a few points reach OpenCV method triangulatePoints() as inliers through pipeline. I use OpenCV 4.5.0.

My pipeline is:

i'm creating the feature detector using SURF, which detects the keypoints and computes the descriptors

```<code>detector_ = cv::xfeatures2d::SURF::create(400, 4, 2, false, false);
detector_->detectAndCompute(img, cv::noArray(), keyPoints, descriptors);
</code>```

i'm matching the keypoints from two adjacent images using 2 candidates and filtering out those of them where two candidates are too close.

i'm using fundamental matrix to find essential because using of findEssentialMat leads to strange results at the end of the pipeline and i read somewhere about 5-points algorithm unreliability.

```<code>for (int i = 0; i < (int) goodMatches.size(); i++) {
    prevSurvivors.push_back(keyPoints1[goodMatches[i].queryIdx].pt);
    curSurvivors.push_back(keyPoints2[goodMatches[i].trainIdx].pt);
}

fundamental_matrix_ = cv::findFundamentalMat(prevSurvivors, curSurvivors, outputMask, cv::FM_RANSAC);
</code>```

i'm removing those points from prevSurvivors and curSurvivors for which outputMask has 0. After that i'm calculating essential matrix

```<code>essential_matrix_ = INTRINSICS.t() * fundamental_matrix_ * INTRINSICS;
</code>```

Finally i'm checking the rank of the essential matrix and calling the recoverPose method.

```<code>bool hasEssentialMatGoodRank = hasEssentialMatrixAppropriateRank();

if (hasEssentialMatGoodRank) {
    outputMask.release();
    cv::recoverPose(essential_matrix_, prevSurvivors, curSurvivors, INTRINSICS, R, t, outputMask);
}
</code>```

What i see is the outputMask which may have 50 inliers for frames N and N+1, but 0 for frames N+1 and N+2. It breaks my pipeline and i can't understand why.

Frames N, N+1 and N+2

N and N+1
N+1 and N+2

The questions are:

what i'm doing wrong with pipeline or

which options, algorithms or methods i should change to get better results

Body:
I try to triangulate key points around the camera but only a few points reach OpenCV method triangulatePoints() as inliers through pipeline. I use OpenCV 4.5.0.

My pipeline is:

i'm creating the feature detector using SURF, which detects the keypoints and computes the descriptors

detector_ = cv::xfeatures2d::SURF::create(400, 4, 2, false, false);
detector_->detectAndCompute(img, cv::noArray(), keyPoints, descriptors);

i'm matching the keypoints from two adjacent images using 2 candidates and filtering out those of them where two candidates are too close.

i'm using fundamental matrix to find essential because using of findEssentialMat leads to strange results at the end of the pipeline and i read somewhere about 5-points algorithm unreliability.

for (int i = 0; i < (int) goodMatches.size(); i++) {
    prevSurvivors.push_back(keyPoints1[goodMatches[i].queryIdx].pt);
    curSurvivors.push_back(keyPoints2[goodMatches[i].trainIdx].pt);
}

fundamental_matrix_ = cv::findFundamentalMat(prevSurvivors, curSurvivors, outputMask, cv::FM_RANSAC);

i'm removing those points from prevSurvivors and curSurvivors for which outputMask has 0. After that i'm calculating essential matrix

essential_matrix_ = INTRINSICS.t() * fundamental_matrix_ * INTRINSICS;

Finally i'm checking the rank of the essential matrix and calling the recoverPose method.

bool hasEssentialMatGoodRank = hasEssentialMatrixAppropriateRank();

if (hasEssentialMatGoodRank) {
    outputMask.release();
    cv::recoverPose(essential_matrix_, prevSurvivors, curSurvivors, INTRINSICS, R, t, outputMask);
}

What i see is the outputMask which may have 50 inliers for frames N and N+1, but 0 for frames N+1 and N+2. It breaks my pipeline and i can't understand why.

Frames N, N+1 and N+2

N and N+1
N+1 and N+2

The questions are:

what i'm doing wrong with pipeline or

which options, algorithms or methods i should change to get better results


问:
STM F767 Read SDRAM with FMC
I try to write 1 byte and then read 1 byte from SDRAM IS42S81600F. It's connected to FMC pins of Nucleo-F767 board. In debug mode program goes to hard fault handler after reading. I'm using FMC configuration from CubeMX and initialization code found in some tutorial. Is it a problem in writing and reading code or in initialization? HCLK is set to 96 MHz.

This is how i try to write and read:

```<code>  *(__IO uint8_t*) (SDRAM_ADDRESS_START) = (uint8_t) 0x55; //SDRAM_ADDRESS_START is 0xC0000000
  byte = *(__IO uint16_t*) (SDRAM_ADDRESS_START);
</code>```

Initialization:

```<code>__IO uint32_t tmpmrd =0;
      command.CommandMode = FMC_SDRAM_CMD_CLK_ENABLE;
      command.CommandTarget = FMC_SDRAM_CMD_TARGET_BANK1;
      command.AutoRefreshNumber = 1;
      command.ModeRegisterDefinition = 0;
      hal_stat = HAL_SDRAM_SendCommand(&hsdram1, &command, SDRAM_TIMEOUT);
      HAL_Delay(1);
      command.CommandMode = FMC_SDRAM_CMD_PALL;
      command.CommandTarget = FMC_SDRAM_CMD_TARGET_BANK1;
      command.AutoRefreshNumber = 1;
      command.ModeRegisterDefinition = 0;
      hal_stat = HAL_SDRAM_SendCommand(&hsdram1, &command, SDRAM_TIMEOUT);
      HAL_Delay(1);
      command.CommandMode = FMC_SDRAM_CMD_AUTOREFRESH_MODE;
      command.CommandTarget = FMC_SDRAM_CMD_TARGET_BANK1;
      command.AutoRefreshNumber = 8;
      command.ModeRegisterDefinition = 0;
      hal_stat = HAL_SDRAM_SendCommand(&hsdram1, &command, SDRAM_TIMEOUT);
      HAL_Delay(1);
      tmpmrd = (uint32_t)SDRAM_MODEREG_BURST_LENGTH_1          |

                           SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL   |

                           SDRAM_MODEREG_CAS_LATENCY_2           |

                           SDRAM_MODEREG_OPERATING_MODE_STANDARD |

                           SDRAM_MODEREG_WRITEBURST_MODE_SINGLE;

        command.CommandMode = FMC_SDRAM_CMD_LOAD_MODE;
        command.CommandTarget = FMC_SDRAM_CMD_TARGET_BANK1;
        command.AutoRefreshNumber = 1;
        command.ModeRegisterDefinition = tmpmrd;
        hal_stat = HAL_SDRAM_SendCommand(&hsdram1, &command, SDRAM_TIMEOUT);
        /* Step 8: Set the refresh rate counter */
       /* (15.62 us x Freq) — 20 */
       /* Set the device refresh counter */
        HAL_SDRAM_ProgramRefreshRate(&hsdram1, 1480);
</code>```

I've tried to change timings and clock settings in CubeMX configurator, but with no luck.

Title: STM F767 Read SDRAM with FMC

Body:
I try to write 1 byte and then read 1 byte from SDRAM IS42S81600F. It's connected to FMC pins of Nucleo-F767 board. In debug mode program goes to hard fault handler after reading. I'm using FMC configuration from CubeMX and initialization code found in some tutorial. Is it a problem in writing and reading code or in initialization? HCLK is set to 96 MHz.

This is how i try to write and read:

  *(__IO uint8_t*) (SDRAM_ADDRESS_START) = (uint8_t) 0x55; //SDRAM_ADDRESS_START is 0xC0000000
  byte = *(__IO uint16_t*) (SDRAM_ADDRESS_START);

Initialization:

__IO uint32_t tmpmrd =0;
      command.CommandMode = FMC_SDRAM_CMD_CLK_ENABLE;
      command.CommandTarget = FMC_SDRAM_CMD_TARGET_BANK1;
      command.AutoRefreshNumber = 1;
      command.ModeRegisterDefinition = 0;
      hal_stat = HAL_SDRAM_SendCommand(&hsdram1, &command, SDRAM_TIMEOUT);
      HAL_Delay(1);
      command.CommandMode = FMC_SDRAM_CMD_PALL;
      command.CommandTarget = FMC_SDRAM_CMD_TARGET_BANK1;
      command.AutoRefreshNumber = 1;
      command.ModeRegisterDefinition = 0;
      hal_stat = HAL_SDRAM_SendCommand(&hsdram1, &command, SDRAM_TIMEOUT);
      HAL_Delay(1);
      command.CommandMode = FMC_SDRAM_CMD_AUTOREFRESH_MODE;
      command.CommandTarget = FMC_SDRAM_CMD_TARGET_BANK1;
      command.AutoRefreshNumber = 8;
      command.ModeRegisterDefinition = 0;
      hal_stat = HAL_SDRAM_SendCommand(&hsdram1, &command, SDRAM_TIMEOUT);
      HAL_Delay(1);
      tmpmrd = (uint32_t)SDRAM_MODEREG_BURST_LENGTH_1          |

                           SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL   |

                           SDRAM_MODEREG_CAS_LATENCY_2           |

                           SDRAM_MODEREG_OPERATING_MODE_STANDARD |

                           SDRAM_MODEREG_WRITEBURST_MODE_SINGLE;

        command.CommandMode = FMC_SDRAM_CMD_LOAD_MODE;
        command.CommandTarget = FMC_SDRAM_CMD_TARGET_BANK1;
        command.AutoRefreshNumber = 1;
        command.ModeRegisterDefinition = tmpmrd;
        hal_stat = HAL_SDRAM_SendCommand(&hsdram1, &command, SDRAM_TIMEOUT);
        /* Step 8: Set the refresh rate counter */
       /* (15.62 us x Freq) — 20 */
       /* Set the device refresh counter */
        HAL_SDRAM_ProgramRefreshRate(&hsdram1, 1480);

I've tried to change timings and clock settings in CubeMX configurator, but with no luck.


问:
Unable to open HID device in MacOS With Electron Universal macOS applications(Packaging with Electron Builder)
I used the HidAPI hid_open_path() function in V8 C++ to open the device for Node.js on the Electron platform,

HidAPI function:from here

First, execute the program in Debug Mode, and the device can be turned on successfully
The recipient uses Electron Builder to package this solution into an app file on the Universal platform

When reaches this step, after opening the packaged APP and opening the permission through Input Monitoring, the specified device cannot be opened, and it cannot be opened on the x86 (Intel) or arm64(M1)platform.

This only happens if Electron-Builder is packaged into an universal file, but if Electron is packaged separately into x86 (Intel) and arm64 (Apple) or if VSCode is used for debugging, the function of hid_open_path() can be successfully opened. ( The above app all have permission to open through Input Monitoring of macOS)

We have also used Electron-Packager for @electron/universal, but the result is still unable to open the device.

May I ask if I want to package it into one universal file, what can I do to be able to succesfully open it?

Here are the build information in package.json:

```<code>    "build": {
        "appId": "com.Myapp.application",
        "productName": "Myapp",
        "artifactName": "${productName}-Setup-${version}.${ext}",
        "copyright": "Copyright © 2020 Myapp",
        "asarUnpack": [
            "./database"
        ],
        "mac": {
            "category": "com.Myapp.application",
            "target": {
                "target": "default",
                "arch": "universal"
            },
            "icon": "./image/icon.icns",
            "identity": "identity",
            "darkModeSupport": true,
            "hardenedRuntime": true,
            "gatekeeperAssess": false,
            "artifactName": "${productName}.${ext}"
        },
        "directories": {
            "buildResources": "release",
            "output": "Myapp"
        }
    },
</code>```

There needs to be a way that the App on the Universal platform packaged in Electron-Builder by using HidAPI to open the device

Body:
I used the HidAPI hid_open_path() function in V8 C++ to open the device for Node.js on the Electron platform,

HidAPI function:from here

First, execute the program in Debug Mode, and the device can be turned on successfully
The recipient uses Electron Builder to package this solution into an app file on the Universal platform

When reaches this step, after opening the packaged APP and opening the permission through Input Monitoring, the specified device cannot be opened, and it cannot be opened on the x86 (Intel) or arm64(M1)platform.

This only happens if Electron-Builder is packaged into an universal file, but if Electron is packaged separately into x86 (Intel) and arm64 (Apple) or if VSCode is used for debugging, the function of hid_open_path() can be successfully opened. ( The above app all have permission to open through Input Monitoring of macOS)

We have also used Electron-Packager for @electron/universal, but the result is still unable to open the device.

May I ask if I want to package it into one universal file, what can I do to be able to succesfully open it?

Here are the build information in package.json:

    "build": {
        "appId": "com.Myapp.application",
        "productName": "Myapp",
        "artifactName": "${productName}-Setup-${version}.${ext}",
        "copyright": "Copyright © 2020 Myapp",
        "asarUnpack": [
            "./database"
        ],
        "mac": {
            "category": "com.Myapp.application",
            "target": {
                "target": "default",
                "arch": "universal"
            },
            "icon": "./image/icon.icns",
            "identity": "identity",
            "darkModeSupport": true,
            "hardenedRuntime": true,
            "gatekeeperAssess": false,
            "artifactName": "${productName}.${ext}"
        },
        "directories": {
            "buildResources": "release",
            "output": "Myapp"
        }
    },

There needs to be a way that the App on the Universal platform packaged in Electron-Builder by using HidAPI to open the device


问:
GDB Pretty Printer: How to convert integral value to pointer to dereference
I am about to write custom GDB pretty printer to print out my custom implementation of unique_ptr<>.

Here comes the extract out of the unique_ptr<> itself, valid from pretty printing perspective:

```<code>template<typename T, typename DELETER = default_deleter<T>>
class unique_ptr {
public:
    using pointer = T *;
    using element_type = T;
    using deleter_type = DELETER;
    using raw_type = uintptr_t;

private:
    /* Underlying raw pointer being managed by unique_ptr */
    raw_type m_ptr;
    /* Associated deleter */
    [[no_unique_address]] deleter_type m_deleter;
</code>```

The goal is to implement a Python pretty printer to either print out the raw pointer value (the value of m_ptr in hexadecimal) and then the dereferenced value it points to.

Here is my initial version of the printer:

```<code>class unique_ptr_printer:
"""Print unique_ptr<> smart pointer"""

def __init__( self, value ) -> None:
    self.value = value

def to_string (self):
    return ( 'ReVolta::unique_ptr<{}>'.format( str( self.value.type.template_argument( 0 ) ) ) )

def children( self ):
    if self.value['m_ptr'] != 0x0:
        yield 'value', self.value['m_ptr'].cast( gdb.lookup_type( str( self.value.type.template_argument( 0 ) ) ) )
    else:
        yield 'value', 'nullptr'
</code>```

All of my trouble comes on the line:

```<code>yield 'value', self.value['m_ptr'].cast( gdb.lookup_type( str( self.value.type.template_argument( 0 ) ) ) )
</code>```

in which I try to return/yield the value pair

```<code>{value = { /* the content of pointing to object */ } }
</code>```

It is not gonna work. The self.value['m_ptr'] by itself just prints out the address in decimal (not in hex as preferred).

Once trying to dereference it:

```<code>yield 'value', self.value['m_ptr'].dereference()
</code>```

it reports the error: Python Exception <class 'gdb.error'>: Attempt to take contents of a non-pointer value.

The casting as in the example casts correctly to the given type, but the content is a nonsese as it takes the pointer value itself rather than the dereferenced value casted...

Any right direction kicker would be highly appreciated as I cannot move forward...thanks in advance

Body:
I am about to write custom GDB pretty printer to print out my custom implementation of unique_ptr<>.

Here comes the extract out of the unique_ptr<> itself, valid from pretty printing perspective:

template<typename T, typename DELETER = default_deleter<T>>
class unique_ptr {
public:
    using pointer = T *;
    using element_type = T;
    using deleter_type = DELETER;
    using raw_type = uintptr_t;

private:
    /* Underlying raw pointer being managed by unique_ptr */
    raw_type m_ptr;
    /* Associated deleter */
    [[no_unique_address]] deleter_type m_deleter;

The goal is to implement a Python pretty printer to either print out the raw pointer value (the value of m_ptr in hexadecimal) and then the dereferenced value it points to.

Here is my initial version of the printer:

class unique_ptr_printer:
"""Print unique_ptr<> smart pointer"""

def __init__( self, value ) -> None:
    self.value = value

def to_string (self):
    return ( 'ReVolta::unique_ptr<{}>'.format( str( self.value.type.template_argument( 0 ) ) ) )

def children( self ):
    if self.value['m_ptr'] != 0x0:
        yield 'value', self.value['m_ptr'].cast( gdb.lookup_type( str( self.value.type.template_argument( 0 ) ) ) )
    else:
        yield 'value', 'nullptr'

All of my trouble comes on the line:

yield 'value', self.value['m_ptr'].cast( gdb.lookup_type( str( self.value.type.template_argument( 0 ) ) ) )

in which I try to return/yield the value pair

{value = { /* the content of pointing to object */ } }

It is not gonna work. The self.value['m_ptr'] by itself just prints out the address in decimal (not in hex as preferred).

Once trying to dereference it:

yield 'value', self.value['m_ptr'].dereference()

it reports the error: Python Exception <class 'gdb.error'>: Attempt to take contents of a non-pointer value.

The casting as in the example casts correctly to the given type, but the content is a nonsese as it takes the pointer value itself rather than the dereferenced value casted...

Any right direction kicker would be highly appreciated as I cannot move forward...thanks in advance


问:
PKCS#7 signing Base64 string and add signer info openssl
There is problem found while signing Nonce(Base64 string) with PKCS#7 using openssl
the problem is when i decode the signature the nonce is trimmed (get 4 char  and the expected is 8 char)

Here is the code.

```<code>int main(int argc, char *argv[])
{
    QString nonce = "Jd0VAO74";
    QDateTime dateTime = QDateTime::fromString("2022-12-15T13:51:46Z", Qt::ISODateWithMs);
    unsigned char*signature = signNonce(nonce, dateTime);
    qDebug() << signature;
    return 0;
}
unsigned char* signNonce(nonce, dateTime){

  QContentInfo                  contentInfo = QContentInfo(QByteArray::fromBase64(nonce.toLatin1()));
  auto                          signedCms   = QSignedCms(contentInfo);
  QOpenssl::QOpensslCertificate qOpensslCertificate(getCertificate());
  QCmsSigner                    cmsSigner = QCmsSigner(qOpensslCertificate);

  cmsSigner.setDigestType(QOpenssl::DigestType::SHA256);
  cmsSigner.setPkcs9SigningTime(serverDateTime);
  signedCms.computeSignatureNew(cmsSigner);

 auto l_pSignedCms = PKCS7_PTR(PKCS7_new(),::PKCS7_free);

  // set certificate and private key in a signer info.
  QSignerInfo        qsignerInfo;
  PKCS7_SIGNER_INFO* signerInfo = PKCS7_SIGNER_INFO_new();
  X509_PTR           pX509      = cmsSigner.getCertificate().getCertificate();
  EVP_PKEY_PTR       pKey       = cmsSigner.getCertificate().getPrivateKey();
  const EVP_MD*      pMD        =  EVP_sha256();

  PKCS7_SIGNER_INFO_set(signerInfo, pX509.get(), pKey.get(), pMD);
  // set signing time attribute.
  ASN1_TIME* pSigningTime = ASN1_TIME_set(nullptr, cmsSigner.getPkcs9SigningTime().toTime_t());
  PKCS7_add0_attrib_signing_time(signerInfo, pSigningTime);
  qsignerInfo.setPkcs9SigningTime(cmsSigner.getPkcs9SigningTime());

  // set message digest attribute.
  QCryptographicHash::Algorithm algo = cmsSigner.getDigestType() == DigestType::SHA256
                                           ? QCryptographicHash::Algorithm::Sha256
                                           : QCryptographicHash::Algorithm::Sha1;

  QByteArray  hash  = QCryptographicHash::hash(m_ContentInfo.getContent(), algo);
  const auto* pHash = reinterpret_cast<const unsigned char*>(hash.constData());
  PKCS7_add1_attrib_digest(signerInfo, pHash, m_ContentInfo.getContent().length());
  qsignerInfo.setDigestType(cmsSigner.getDigestType());
  qsignerInfo.setHash(hash);

  // set content type attribute.
  PKCS7_add_attrib_content_type(signerInfo, OBJ_nid2obj(NID_pkcs7_data));

  // sign signerinfo.
  if(PKCS7_SIGNER_INFO_sign(signerInfo) <= 0) {
    qCritical() << ERR_error_string(ERR_get_error(), nullptr);
    return;
  }

  // add signer info to cms.
  PKCS7_add_signer(l_pSignedCms.get(), signerInfo);

  // set data to cms.
  // set certificate to cms.
  PKCS7_add_certificate(l_pSignedCms.get(), pX509.get());

  // set certificate chain
  for(const QOpensslCertificate& cert : cmsSigner.getCertificate().getCertificateChain()) {
    if(!cert.isSelfSigned())
      PKCS7_add_certificate(l_pSignedCms.get(), cert.getCertificate().get());
  }

  // set content data.
  BIO_PTR pContent = BIO_PTR(BIO_new(BIO_s_mem()), ::BIO_free);
  BIO_puts(pContent.get(), m_ContentInfo.getContent().constData());

  m_pSignedCms = PKCS7_PTR(
              PKCS7_sign(pX509.get(), pKey.get(), nullptr, pContent.get(), 0),
              ::PKCS7_free);

  unsigned char* pSignedValue = nullptr;
  int            result       = i2d_PKCS7(m_pSignedCms.get(), &pSignedValue);
return pSignedValue ;

}
</code>```

after decodeing online decoder the signature, we found nonce in hex 0x25 DD 15
the nonce only contains 4 char Jd0V

any one has a clue ?

I try to figure out why the decoded signature only contains 4 char not 8

Body:
There is problem found while signing Nonce(Base64 string) with PKCS#7 using openssl
the problem is when i decode the signature the nonce is trimmed (get 4 char  and the expected is 8 char)

Here is the code.

int main(int argc, char *argv[])
{
    QString nonce = "Jd0VAO74";
    QDateTime dateTime = QDateTime::fromString("2022-12-15T13:51:46Z", Qt::ISODateWithMs);
    unsigned char*signature = signNonce(nonce, dateTime);
    qDebug() << signature;
    return 0;
}
unsigned char* signNonce(nonce, dateTime){

  QContentInfo                  contentInfo = QContentInfo(QByteArray::fromBase64(nonce.toLatin1()));
  auto                          signedCms   = QSignedCms(contentInfo);
  QOpenssl::QOpensslCertificate qOpensslCertificate(getCertificate());
  QCmsSigner                    cmsSigner = QCmsSigner(qOpensslCertificate);

  cmsSigner.setDigestType(QOpenssl::DigestType::SHA256);
  cmsSigner.setPkcs9SigningTime(serverDateTime);
  signedCms.computeSignatureNew(cmsSigner);

 auto l_pSignedCms = PKCS7_PTR(PKCS7_new(),::PKCS7_free);

  // set certificate and private key in a signer info.
  QSignerInfo        qsignerInfo;
  PKCS7_SIGNER_INFO* signerInfo = PKCS7_SIGNER_INFO_new();
  X509_PTR           pX509      = cmsSigner.getCertificate().getCertificate();
  EVP_PKEY_PTR       pKey       = cmsSigner.getCertificate().getPrivateKey();
  const EVP_MD*      pMD        =  EVP_sha256();

  PKCS7_SIGNER_INFO_set(signerInfo, pX509.get(), pKey.get(), pMD);
  // set signing time attribute.
  ASN1_TIME* pSigningTime = ASN1_TIME_set(nullptr, cmsSigner.getPkcs9SigningTime().toTime_t());
  PKCS7_add0_attrib_signing_time(signerInfo, pSigningTime);
  qsignerInfo.setPkcs9SigningTime(cmsSigner.getPkcs9SigningTime());

  // set message digest attribute.
  QCryptographicHash::Algorithm algo = cmsSigner.getDigestType() == DigestType::SHA256
                                           ? QCryptographicHash::Algorithm::Sha256
                                           : QCryptographicHash::Algorithm::Sha1;

  QByteArray  hash  = QCryptographicHash::hash(m_ContentInfo.getContent(), algo);
  const auto* pHash = reinterpret_cast<const unsigned char*>(hash.constData());
  PKCS7_add1_attrib_digest(signerInfo, pHash, m_ContentInfo.getContent().length());
  qsignerInfo.setDigestType(cmsSigner.getDigestType());
  qsignerInfo.setHash(hash);

  // set content type attribute.
  PKCS7_add_attrib_content_type(signerInfo, OBJ_nid2obj(NID_pkcs7_data));

  // sign signerinfo.
  if(PKCS7_SIGNER_INFO_sign(signerInfo) <= 0) {
    qCritical() << ERR_error_string(ERR_get_error(), nullptr);
    return;
  }

  // add signer info to cms.
  PKCS7_add_signer(l_pSignedCms.get(), signerInfo);

  // set data to cms.
  // set certificate to cms.
  PKCS7_add_certificate(l_pSignedCms.get(), pX509.get());

  // set certificate chain
  for(const QOpensslCertificate& cert : cmsSigner.getCertificate().getCertificateChain()) {
    if(!cert.isSelfSigned())
      PKCS7_add_certificate(l_pSignedCms.get(), cert.getCertificate().get());
  }

  // set content data.
  BIO_PTR pContent = BIO_PTR(BIO_new(BIO_s_mem()), ::BIO_free);
  BIO_puts(pContent.get(), m_ContentInfo.getContent().constData());

  m_pSignedCms = PKCS7_PTR(
              PKCS7_sign(pX509.get(), pKey.get(), nullptr, pContent.get(), 0),
              ::PKCS7_free);

  unsigned char* pSignedValue = nullptr;
  int            result       = i2d_PKCS7(m_pSignedCms.get(), &pSignedValue);
return pSignedValue ;

}

after decodeing online decoder the signature, we found nonce in hex 0x25 DD 15
the nonce only contains 4 char Jd0V

any one has a clue ?

I try to figure out why the decoded signature only contains 4 char not 8


问:
Wordpress deletes contents of PHP file
I have a website running Wordpress, with a customized theme (that was not developed by me). Yesterday I have attempted a routine modification of a file called header-home.php, via the web interface, and unfortunately Wordpress saves the file as blank after I click on "update". And it keeps saving as blank every time I try: now the file is empty and my site is broken! Luckily I have a copy of this file, but I don't see how to restore it.

Is there a workaround for this bug?

Thank you so much. This is quite distressing.

Pierre

PS Wordpress offers to update to 6.1.1 and I do not dare to update, for fear that things will get even worse...

Title: Wordpress deletes contents of PHP file


问:
Update all columns on duplicate in Insert on select
I have two tables (say t1 and t2). I want to insert all records from t2 to t1. I can do this by using the query  -

```<code>Insert into t1 select * from t2
</code>```

While inserting, there might be duplicates. How to update all columns in table t1 from the t2 table in case of duplicates. We can do it this way -

```<code>Insert into t1 select * from t2 on duplicate update t1.a=t2.a...
</code>```

But there are more than 60 columns in table t2. Is there any way to update all columns at once?

Body:
I have two tables (say t1 and t2). I want to insert all records from t2 to t1. I can do this by using the query  -

Insert into t1 select * from t2

While inserting, there might be duplicates. How to update all columns in table t1 from the t2 table in case of duplicates. We can do it this way -

Insert into t1 select * from t2 on duplicate update t1.a=t2.a...

But there are more than 60 columns in table t2. Is there any way to update all columns at once?


问:
Can we access inner links, buttons and other interactive components in a ag-grid?
We have implemented AG-grid in our app and we want to access the inner links and buttons loaded in the AG-Grid with the help of key-board. Is it possible for AG-Grid keyboard accessibility?enter image description here

Want to access the marked elements to be accessed with the help of keyoar.


问:
Is there any better way for me to find the (Mean & Standard Deviation) for Spreads Price
I have this set of data (e.g):

data =

How can i get the ( standard deviation) for spreads (1x2,1x3, 1x4,.....etc) in matrix form by using pandas please ?

I manage to get the results by doing the following:

```<code># numpy is import as py ; #panda is import as pd

DM=data.apply(py.mean).values

SprdMean = DM \* 100 - DM \* 100)\[:, py.newaxis\]

SprdMean = pd.DataFrame(SprdMean, columns='1y','2y'...etc, index=1y','2y'...etc)

SprdMean.T.round(decimals=0)
</code>```

However for Standard Deviation, the above 'MEAN' method can't be applied,

What can i do to obtain / modify to obtain the below results in matrix format please,

#Beginner here, thanks

Body:
I have this set of data (e.g):

data =

How can i get the ( standard deviation) for spreads (1x2,1x3, 1x4,.....etc) in matrix form by using pandas please ?

I manage to get the results by doing the following:

# numpy is import as py ; #panda is import as pd

DM=data.apply(py.mean).values

SprdMean = DM \* 100 - DM \* 100)\[:, py.newaxis\]

SprdMean = pd.DataFrame(SprdMean, columns='1y','2y'...etc, index=1y','2y'...etc)

SprdMean.T.round(decimals=0)

However for Standard Deviation, the above 'MEAN' method can't be applied,

What can i do to obtain / modify to obtain the below results in matrix format please,

#Beginner here, thanks


问:
Spinning circle doesn't disappear after process is finished
Apex 20.1

I have an interactive report which has one clickable column that I used to download a file from Apex to the user's computer.

Originally I had the link call an application process which worked beautifully. However I found that larger files would take time to download, and there was no "spinning circle" to indicate that the user should keep waiting, or that anything was happening.

So I put the download code in an "After Submit" process with a "Request=" server-side condition.

The link from my interactive report now calls the process with a URL thus:

javascript:var submit =apex.submit({request:"FETCH_ATTACHMENT",  showWait:true, set:{"P4_MESSAGE_ID":#MESSAGE_ID#, "P4_PART_ID":#PART_ID#, "P4_PART_NAME":"#PART_NAME#"}});
The "showWait" works beautifully now, I get a spinning circle, except now I have the opposite problem. After the download is finished, the page is still greyed-out with the spinning circle. The only way to bring it back is to refresh the page.

I would like the spinning circle to go away once the file is downloaded and control to be returned back to the page.

Here is the code, it's still in dev so excuse the debug untidiness!

```<code>DECLARE
  vclob   CLOB;
  vclobtmp  CLOB;
  vblob   BLOB;
  vmimetype VARCHAR2(1000);
  v_position INTEGER;
  v_progress VARCHAR2(100);
  v_error  varchar2(1000);
  FUNCTION Clobfromblob (p_blob BLOB)
  RETURN CLOB
  IS
   l_clob     CLOB;
   l_dest_offsset INTEGER := 1;
   l_src_offsset INTEGER := 1;
   l_lang_context INTEGER := dbms_lob.default_lang_ctx;
   l_warning   INTEGER;
  BEGIN
    IF p_blob IS NULL THEN
     RETURN NULL;
    END IF;

    dbms_lob.Createtemporary(lob_loc => l_clob, CACHE => FALSE);

    dbms_lob.Converttoclob(dest_lob => l_clob, src_blob => p_blob,
    amount => dbms_lob.lobmaxsize, dest_offset => l_dest_offsset,
    src_offset => l_src_offsset, blob_csid => dbms_lob.default_csid,
    lang_context => l_lang_context, warning => l_warning);

    RETURN l_clob;
  END;
BEGIN

  --raise_application_error(-20000,'P4_MESSAGE_ID '||:P4_MESSAGE_ID||' P4_PART_ID '||:P4_PART_ID||' :P4_PART_NAME '||:P4_PART_NAME);

  delete from apps.barry_debug;
  insert into apps.barry_debug(time,debug) values (sysdate, 'start1'); commit;

  dbms_lob.Createtemporary(lob_loc => vclob, CACHE => TRUE,
  dur => dbms_lob.call);

  dbms_lob.Createtemporary(lob_loc => vclobtmp, CACHE => TRUE,
  dur => dbms_lob.call);

  dbms_lob.Createtemporary(lob_loc => vblob, CACHE => TRUE,
  dur => dbms_lob.call);

  SELECT part_data,
      Substr(part_type, 1, Instr(part_type, ';') - 1)
  INTO  vblob, vmimetype
  FROM  source_data
  WHERE message_id = :P4_MESSAGE_ID --APEX_APPLICATION.g_x01
      AND part_id = :P4_PART_ID --APEX_APPLICATION.g_x02
      ;

  v_progress := 'blob to clob';

  insert into apps.barry_debug(time,debug) values (sysdate, 'clob1'); commit;
  vclobtmp := Clobfromblob(vblob);

  --Strip the header from the attachment data
  v_position := dbms_lob.Instr(vclobtmp, 'Content-Transfer-Encoding: base64',
         1, 1
         )
         + 33;

  dbms_lob.Copy(vclob, vclobtmp, dbms_lob.Getlength(vclobtmp), 1, v_position);

  v_progress := 'decodebase64';
  insert into apps.barry_debug(time,debug) values (sysdate, 'decodebase'); commit;

  vblob := apex_web_service.Clobbase642blob(vclob);
  --vblob := apps.P_Base64.DecodeToBlob (vClob);

  sys.htp.init;

  v_progress := 'mime_header';

  sys.owa_util.Mime_header(vmimetype /*'application/octet-stream'*/, FALSE
  /*,'UTF-8' */);

  sys.htp.P('Content-length: '
       || sys.dbms_lob.Getlength(vblob));

  sys.htp.P('Content-Disposition: attachment; filename="'
       ||:P4_PART_NAME
       ||'"');

  sys.owa_util.http_header_close;

  v_progress := 'download_file';

  insert into apps.barry_debug(time,debug) values (sysdate, 'download'); commit;
  sys.wpg_docload.Download_file(vblob);

  insert into apps.barry_debug(time,debug) values (sysdate, 'release1'); commit;
  dbms_lob.Freetemporary (vblob); --do not forget!!
  insert into apps.barry_debug(time,debug) values (sysdate, 'release2'); commit;
  dbms_lob.Freetemporary (vclob); --do not forget!!
  insert into apps.barry_debug(time,debug) values (sysdate, 'release3'); commit;
  dbms_lob.Freetemporary (vclobtmp); --do not forget!!

  apex_application.stop_apex_engine; --this is needed to download file in background. But it raises an exception below.

  insert into apps.barry_debug(time,debug) values (sysdate, 'finished'); commit;

EXCEPTION
  when apex_application.e_stop_apex_engine then
    raise; -- raise again the stop Application Express engine exception
  WHEN no_data_found THEN
   NULL;
  when others then
    --raise_application_error(-20000,'Error-fetch-attachment-'||v_progress||' '||sqlerrm);
    v_error := sqlerrm;
    insert into apps.barry_debug(time,debug) values (sysdate, 'Error-fetch-attachment-'||v_progress||'*'||v_error);
END;
</code>```

The Debugging table shows that processing ends after the engine is stopped. (If I take this out nothing downloads at all).

P.S I have tried to ask the question on Oracle community help and got one answer which was to
paste this code into the Function and Global Variable Declarations. No difference.

```<code>$(document).ajaxComplete(function(){
    var overlay$ = $("#apex_wait_overlay"),
        processing$ = $(".u-Processing");

    if(overlay$.length || processing$.length){
    overlay$.remove();
    processing$.remove();
    }
});
</code>```

Body:
Apex 20.1

I have an interactive report which has one clickable column that I used to download a file from Apex to the user's computer.

Originally I had the link call an application process which worked beautifully. However I found that larger files would take time to download, and there was no "spinning circle" to indicate that the user should keep waiting, or that anything was happening.

So I put the download code in an "After Submit" process with a "Request=" server-side condition.

The link from my interactive report now calls the process with a URL thus:

javascript:var submit =apex.submit({request:"FETCH_ATTACHMENT",  showWait:true, set:{"P4_MESSAGE_ID":#MESSAGE_ID#, "P4_PART_ID":#PART_ID#, "P4_PART_NAME":"#PART_NAME#"}});
The "showWait" works beautifully now, I get a spinning circle, except now I have the opposite problem. After the download is finished, the page is still greyed-out with the spinning circle. The only way to bring it back is to refresh the page.

I would like the spinning circle to go away once the file is downloaded and control to be returned back to the page.

Here is the code, it's still in dev so excuse the debug untidiness!

DECLARE
  vclob   CLOB;
  vclobtmp  CLOB;
  vblob   BLOB;
  vmimetype VARCHAR2(1000);
  v_position INTEGER;
  v_progress VARCHAR2(100);
  v_error  varchar2(1000);
  FUNCTION Clobfromblob (p_blob BLOB)
  RETURN CLOB
  IS
   l_clob     CLOB;
   l_dest_offsset INTEGER := 1;
   l_src_offsset INTEGER := 1;
   l_lang_context INTEGER := dbms_lob.default_lang_ctx;
   l_warning   INTEGER;
  BEGIN
    IF p_blob IS NULL THEN
     RETURN NULL;
    END IF;

    dbms_lob.Createtemporary(lob_loc => l_clob, CACHE => FALSE);

    dbms_lob.Converttoclob(dest_lob => l_clob, src_blob => p_blob,
    amount => dbms_lob.lobmaxsize, dest_offset => l_dest_offsset,
    src_offset => l_src_offsset, blob_csid => dbms_lob.default_csid,
    lang_context => l_lang_context, warning => l_warning);

    RETURN l_clob;
  END;
BEGIN

  --raise_application_error(-20000,'P4_MESSAGE_ID '||:P4_MESSAGE_ID||' P4_PART_ID '||:P4_PART_ID||' :P4_PART_NAME '||:P4_PART_NAME);

  delete from apps.barry_debug;
  insert into apps.barry_debug(time,debug) values (sysdate, 'start1'); commit;

  dbms_lob.Createtemporary(lob_loc => vclob, CACHE => TRUE,
  dur => dbms_lob.call);

  dbms_lob.Createtemporary(lob_loc => vclobtmp, CACHE => TRUE,
  dur => dbms_lob.call);

  dbms_lob.Createtemporary(lob_loc => vblob, CACHE => TRUE,
  dur => dbms_lob.call);

  SELECT part_data,
      Substr(part_type, 1, Instr(part_type, ';') - 1)
  INTO  vblob, vmimetype
  FROM  source_data
  WHERE message_id = :P4_MESSAGE_ID --APEX_APPLICATION.g_x01
      AND part_id = :P4_PART_ID --APEX_APPLICATION.g_x02
      ;

  v_progress := 'blob to clob';

  insert into apps.barry_debug(time,debug) values (sysdate, 'clob1'); commit;
  vclobtmp := Clobfromblob(vblob);

  --Strip the header from the attachment data
  v_position := dbms_lob.Instr(vclobtmp, 'Content-Transfer-Encoding: base64',
         1, 1
         )
         + 33;

  dbms_lob.Copy(vclob, vclobtmp, dbms_lob.Getlength(vclobtmp), 1, v_position);

  v_progress := 'decodebase64';
  insert into apps.barry_debug(time,debug) values (sysdate, 'decodebase'); commit;

  vblob := apex_web_service.Clobbase642blob(vclob);
  --vblob := apps.P_Base64.DecodeToBlob (vClob);

  sys.htp.init;

  v_progress := 'mime_header';

  sys.owa_util.Mime_header(vmimetype /*'application/octet-stream'*/, FALSE
  /*,'UTF-8' */);

  sys.htp.P('Content-length: '
       || sys.dbms_lob.Getlength(vblob));

  sys.htp.P('Content-Disposition: attachment; filename="'
       ||:P4_PART_NAME
       ||'"');

  sys.owa_util.http_header_close;

  v_progress := 'download_file';

  insert into apps.barry_debug(time,debug) values (sysdate, 'download'); commit;
  sys.wpg_docload.Download_file(vblob);

  insert into apps.barry_debug(time,debug) values (sysdate, 'release1'); commit;
  dbms_lob.Freetemporary (vblob); --do not forget!!
  insert into apps.barry_debug(time,debug) values (sysdate, 'release2'); commit;
  dbms_lob.Freetemporary (vclob); --do not forget!!
  insert into apps.barry_debug(time,debug) values (sysdate, 'release3'); commit;
  dbms_lob.Freetemporary (vclobtmp); --do not forget!!

  apex_application.stop_apex_engine; --this is needed to download file in background. But it raises an exception below.

  insert into apps.barry_debug(time,debug) values (sysdate, 'finished'); commit;

EXCEPTION
  when apex_application.e_stop_apex_engine then
    raise; -- raise again the stop Application Express engine exception
  WHEN no_data_found THEN
   NULL;
  when others then
    --raise_application_error(-20000,'Error-fetch-attachment-'||v_progress||' '||sqlerrm);
    v_error := sqlerrm;
    insert into apps.barry_debug(time,debug) values (sysdate, 'Error-fetch-attachment-'||v_progress||'*'||v_error);
END;

The Debugging table shows that processing ends after the engine is stopped. (If I take this out nothing downloads at all).

P.S I have tried to ask the question on Oracle community help and got one answer which was to
paste this code into the Function and Global Variable Declarations. No difference.

$(document).ajaxComplete(function(){
    var overlay$ = $("#apex_wait_overlay"),
        processing$ = $(".u-Processing");

    if(overlay$.length || processing$.length){
    overlay$.remove();
    processing$.remove();
    }
});


问:
Wordpress wp_trash_post hooks not working as expected
This applies to all the hooks associated with wp_trash_post(); pre_trash_post, wp_trash_post, trashed_post and the transition hooks, eg publish_to_trash. All behave in exactly the same way.

I have a piece of code to run on this hook;

```<code>function to_fire_on_hook($post_id) {

 ... do stuff

// Get the slug of the $post_id above - the post being trashed

    $slug = $post->post_name;

... more stuff that then
    do_something(..., $slug, ...);

    // doesn't work unless I put
    die; //here

  }
}

add_action('wp_trashed_post', 'to_fire_on_hook');
</code>```

if I put die in the function, it completes OK, if I remove it the function doesn't complete.

I thought it might be to do with the fact that putting the post in the trash appends _trash to its name but appending that to $slug doesn't make any difference (neither does using the post ID).

I have swapped out all variables for static values and the result is the same. If the execution stops with die or wp_die() the last function executes, if not it doesn't.

Using echo statements before the die shows the correct values.

Any light on what could cause this behaviour?

Body:
This applies to all the hooks associated with wp_trash_post(); pre_trash_post, wp_trash_post, trashed_post and the transition hooks, eg publish_to_trash. All behave in exactly the same way.

I have a piece of code to run on this hook;

function to_fire_on_hook($post_id) {

 ... do stuff

// Get the slug of the $post_id above - the post being trashed

    $slug = $post->post_name;

... more stuff that then
    do_something(..., $slug, ...);

    // doesn't work unless I put
    die; //here

  }
}

add_action('wp_trashed_post', 'to_fire_on_hook');

if I put die in the function, it completes OK, if I remove it the function doesn't complete.

I thought it might be to do with the fact that putting the post in the trash appends _trash to its name but appending that to $slug doesn't make any difference (neither does using the post ID).

I have swapped out all variables for static values and the result is the same. If the execution stops with die or wp_die() the last function executes, if not it doesn't.

Using echo statements before the die shows the correct values.

Any light on what could cause this behaviour?


问:
How to get string[] array from database with EF core
I got one big question.

Below is the code I used to store string[] arrays in database, but I cannot Get them from database.

my Model:

```<code>public class TokenTransaction
{
    [Key]
    public int Id { get; set; }
    public string Token { get; set; }
    public string[] baskets { get; set; }
}
</code>```

and MydbContext.cs:

```<code>protected override void OnModelCreating(ModelBuilder modelBuilder)
{
    modelBuilder.Entity<TokenTransaction>()
        .Property(a => a.baskets).HasConversion(
            t => string.Join(';', t),
            t => t.Split(';', StringSplitOptions.RemoveEmptyEntries));
}
</code>```

The code I used to get a database record for that model is:

```<code> public TokenTransaction GetTokenTransaction(string InvoiceID)
{
   return  _Context.TokenTransactions
        .FirstOrDefault(t => t.CodePeygiry == InvoiceID);
}
</code>```

Error in:

SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.) -

I don't know why this error appears. Could you please help me to retrieve data from the database?

Body:
I got one big question.

Below is the code I used to store string[] arrays in database, but I cannot Get them from database.

my Model:

public class TokenTransaction
{
    [Key]
    public int Id { get; set; }
    public string Token { get; set; }
    public string[] baskets { get; set; }
}

and MydbContext.cs:

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
    modelBuilder.Entity<TokenTransaction>()
        .Property(a => a.baskets).HasConversion(
            t => string.Join(';', t),
            t => t.Split(';', StringSplitOptions.RemoveEmptyEntries));
}

The code I used to get a database record for that model is:

 public TokenTransaction GetTokenTransaction(string InvoiceID)
{
   return  _Context.TokenTransactions
        .FirstOrDefault(t => t.CodePeygiry == InvoiceID);
}

Error in:

SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.) -

I don't know why this error appears. Could you please help me to retrieve data from the database?


问:
I get "SQLSTATE[HY000] [2002] Connection refused" when i use remote container on VScode
Laravel project works fine using php artisan serve and xampp but i get "SQLSTATE[HY000] [2002] Connection refused" when i use remote container on VScode.

docker-compose.yml:

```<code>mysql:
        image: 'mysql/mysql-server:8.0'
        ports:
            - '${FORWARD_DB_PORT:-3306}:3306'
        environment:
            MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
            MYSQL_ROOT_HOST: "${DB_HOST}"
            MYSQL_DATABASE: '${DB_DATABASE}'
            MYSQL_USER: '${DB_USERNAME}'
            MYSQL_PASSWORD: '${DB_PASSWORD}'
            MYSQL_ALLOW_EMPTY_PASSWORD: 1
</code>```

.env:

```<code>DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laragigs
DB_USERNAME=root
DB_PASSWORD=11111
</code>```

I used this to install the project.

```<code>curl -s "https://laravel.build/example-app?with=mysql,redis&devcontainer" | bash
</code>```

I was hoping to send it to a colleague and be able to open it on another pc without a problem using the remote container on vscode. Thanks in advance!

Body:
Laravel project works fine using php artisan serve and xampp but i get "SQLSTATE[HY000] [2002] Connection refused" when i use remote container on VScode.

docker-compose.yml:

mysql:
        image: 'mysql/mysql-server:8.0'
        ports:
            - '${FORWARD_DB_PORT:-3306}:3306'
        environment:
            MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
            MYSQL_ROOT_HOST: "${DB_HOST}"
            MYSQL_DATABASE: '${DB_DATABASE}'
            MYSQL_USER: '${DB_USERNAME}'
            MYSQL_PASSWORD: '${DB_PASSWORD}'
            MYSQL_ALLOW_EMPTY_PASSWORD: 1

.env:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laragigs
DB_USERNAME=root
DB_PASSWORD=11111

I used this to install the project.

curl -s "https://laravel.build/example-app?with=mysql,redis&devcontainer" | bash

I was hoping to send it to a colleague and be able to open it on another pc without a problem using the remote container on vscode. Thanks in advance!


问:
How to change Selenium configuration Chrome Web Driver to Microsoft Edge Driver?
I want to change the configuration for Selenium Web Driver from Chrome Driver to Microsoft Web Driver.

Here is the Selenium Chrome Web Driver:

```<code>        WebDriverManager.chromedriver().clearResolutionCache();
        WebDriverManager.chromedriver().setup();

        List<String> optionArguments = new ArrayList<>();
        // allow big enough screen for visibility of elements
        optionArguments.add("window-size=1044,784");
        optionArguments.add("--disable-gpu");
        optionArguments.add("--disable-browser-side-navigation");
        if (GraphicsEnvironment.isHeadless()) {
            optionArguments.add("--headless");
        }
        // prevent unknown WebDriver errors
        optionArguments.add("--disable-dev-shm-usage");
        optionArguments.add("--no-sandbox");
        // backend is insecure by default
        optionArguments.add("--allow-insecure-localhost");
        ChromeOptions chromeOptions = new ChromeOptions();
        chromeOptions.addArguments(optionArguments);
        chromeOptions = chromeOptions.setAcceptInsecureCerts(true);

        dvr = new ChromeDriver(chromeOptions);
        return dvr;
</code>```

And here is my Selenium Microsoft Edge Web Driver:

```<code>            WebDriverManager.edgedriver().clearResolutionCache();
            WebDriverManager.edgedriver().setup();

            EdgeOptions edgeOptions = new EdgeOptions();

            edgeOptions.setCapability("disable-gpu","disable-gpu");
            edgeOptions.setCapability("disable-browser","side-navigation");
            edgeOptions.setCapability("window-size","1044,784");
            edgeOptions.setCapability("allow-insecure","localhost");
            edgeOptions.setCapability("headless", "headless");
            edgeOptions.setCapability("no-sandbox", "no-sandbox");
            edgeOptions.setCapability("disable-dev-shm-usage","disable-dev-shm-usage");

            dvr = new EdgeDriver(edgeOptions);//ChromeDriver(chromeOptions);
            return dvr;
</code>```

Does I edit right as the default of Chrome Web Driver. If not, please guide me how to fix it. Thank a lot for your support.

Body:
I want to change the configuration for Selenium Web Driver from Chrome Driver to Microsoft Web Driver.

Here is the Selenium Chrome Web Driver:

        WebDriverManager.chromedriver().clearResolutionCache();
        WebDriverManager.chromedriver().setup();

        List<String> optionArguments = new ArrayList<>();
        // allow big enough screen for visibility of elements
        optionArguments.add("window-size=1044,784");
        optionArguments.add("--disable-gpu");
        optionArguments.add("--disable-browser-side-navigation");
        if (GraphicsEnvironment.isHeadless()) {
            optionArguments.add("--headless");
        }
        // prevent unknown WebDriver errors
        optionArguments.add("--disable-dev-shm-usage");
        optionArguments.add("--no-sandbox");
        // backend is insecure by default
        optionArguments.add("--allow-insecure-localhost");
        ChromeOptions chromeOptions = new ChromeOptions();
        chromeOptions.addArguments(optionArguments);
        chromeOptions = chromeOptions.setAcceptInsecureCerts(true);

        dvr = new ChromeDriver(chromeOptions);
        return dvr;

And here is my Selenium Microsoft Edge Web Driver:

            WebDriverManager.edgedriver().clearResolutionCache();
            WebDriverManager.edgedriver().setup();

            EdgeOptions edgeOptions = new EdgeOptions();

            edgeOptions.setCapability("disable-gpu","disable-gpu");
            edgeOptions.setCapability("disable-browser","side-navigation");
            edgeOptions.setCapability("window-size","1044,784");
            edgeOptions.setCapability("allow-insecure","localhost");
            edgeOptions.setCapability("headless", "headless");
            edgeOptions.setCapability("no-sandbox", "no-sandbox");
            edgeOptions.setCapability("disable-dev-shm-usage","disable-dev-shm-usage");

            dvr = new EdgeDriver(edgeOptions);//ChromeDriver(chromeOptions);
            return dvr;

Does I edit right as the default of Chrome Web Driver. If not, please guide me how to fix it. Thank a lot for your support.


问:
How does mybatis execute the select operation before the update operation
I need to update a record now, but I want mybatis to automatically generate a select query before performing the update. Is it possible?

i don't know how to do


问:
`userToken` must be provided while running on client-side please make sure to call client.setUser" in getstream io
Im working on the getstream io feed api integration.But am getting this error
userToken` must be provided while running on client-side please make sure to call client.setUser"
when i call this method,

final userToken = await client.frontendToken(uId);

How can i fix this?
Please help..


问:
restore db postgres - format .gz
I am trying to restore a database on my local machine. I downloaded this database from the server in file.gz format. Inside this archive is the file file.out. How can I restore the entire structure on my computer through
pg_admin or via console?

If I understand correctly, you need to use the pg_restore command. But all my attempts end with a syntax error.

Title: restore db postgres - format .gz


问:
Webpack Springboot because its MIME type ('application/json') is not executable, and strict MIME type checking is enabled
I have an issue with SpringBoot and Webpack. I need your help cause i don't know how to resolve it.

   ...
   output:
        path: path.resolve(__dirname,'./src/main/resources/templates/built' ),
        filename: 'bundle.[contenthash].js',
        clean: true,
   },
   plugins:[
    new HtmlWebpackPlugin({
      excludeChunks: [ 'dev-helper' ],
      filename: path.resolve(__dirname, "./src/main/resources/templates/index.html"),
      template: path.resolve(__dirname, './src/main/resources/react/index.html' ),
      minify: true,
      inject: 'body', // I inject all scripts in body
      minifyJS: true,
      removeComments: true,
      removeEmptyAttributes: true,
    })
   ]

[![because its MIME type ('application/json') is not executable, and strict MIME type checking is enabled.][1]][1]

  [1]: https://i.stack.imgur.com/xImbf.png
```


问:
Map ORM model to foreign database table
This is a follow-up question to this one.
In my Typo3 plugin I have a model:

<?php

namespace Homeinfo\SysMon2\Domain\Model;

use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;

class CheckResults extends AbstractEntity
{
    /**
     * @var int $id
     */
    public $id;

    /**
     * @var DateTime $timestamp
     */
    public $timestamp;

    /**
     * @var int $system
     */
    public $system;

    /**
     * @var bool $icmp_request
     */
    public $icmp_request;

    /**
     * @var string $ssh_login
     */
    public $ssh_login ;

    /**
     * @var string $http_request
     */
    public $http_request;

    /**
     * @var string $application_state
     */
    public $application_state;

    /**
     * @var string $smart_check
     */
    public $smart_check;

    /**
     * @var string $baytrail_freeze
     */
    public $baytrail_freeze;

    /**
     * @var string $fsck_repair
     */
    public $fsck_repair;

    /**
     * @var bool $application_version
     */
    public $application_version;

    /**
     * @var int $ram_total
     */
    public $ram_total;

    /**
     * @var int $ram_free
     */
    public $ram_free;

    /**
     * @var int $ram_available
     */
    public $ram_available;

    /**
     * @var string $efi_mount_ok
     */
    public $efi_mount_ok;

    /**
     * @var int $download
     */
    public $download;

    /**
     * @var int $upload
     */
    public $upload;

    /**
     * @var string $root_not_ro
     */
    public $root_not_ro;

    /**
     * @var string $sensors
     */
    public $sensors;

    /**
     * @var bool $in_sync
     */
    public $in_sync;

    /**
     * @var int $recent_touch_events
     */
    public $recent_touch_events;

    /**
     * @var DateTime $offline_since
     */
    public $offline_since;

    /**
     * @var DateTime $blackscreen_since
     */
    public $blackscreen_since;
}
```
<p>Which represents a table of a foreign database.
I configured that database via:</p>
<pre class="lang-php prettyprint-override"><code>        'Default' => [
                ...
        ],
        'Sysmon' => [
                'charset' => 'utf8mb4',
                'dbname' => 'sysmon',
                'driver' => 'mysqli',
                'host' => 'REDACTED',
                'password' => 'REDACTED',
                'port' => 3306,
                'tableoptions' => [
                    'charset' => 'utf8mb4',
                    'collate' => 'utf8mb4_general_ci',
                ],
                'user' => 'sysmon_ro',
            ],
    ],
    'TableMapping' => [
            'checkresults' => 'Sysmon',
            'offlinehistory' => 'Sysmon',
    ],
</code>```

How do I let Typo3 know, that the 'checkresults' => 'Sysmon' mapping should use the aforementioned model class?
The official documentation does not mention how to do this.

Title: Map ORM model to foreign database table

Body:
This is a follow-up question to this one.
In my Typo3 plugin I have a model:

<?php

namespace Homeinfo\SysMon2\Domain\Model;

use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;

class CheckResults extends AbstractEntity
{
    /**
     * @var int $id
     */
    public $id;

    /**
     * @var DateTime $timestamp
     */
    public $timestamp;

    /**
     * @var int $system
     */
    public $system;

    /**
     * @var bool $icmp_request
     */
    public $icmp_request;

    /**
     * @var string $ssh_login
     */
    public $ssh_login ;

    /**
     * @var string $http_request
     */
    public $http_request;

    /**
     * @var string $application_state
     */
    public $application_state;

    /**
     * @var string $smart_check
     */
    public $smart_check;

    /**
     * @var string $baytrail_freeze
     */
    public $baytrail_freeze;

    /**
     * @var string $fsck_repair
     */
    public $fsck_repair;

    /**
     * @var bool $application_version
     */
    public $application_version;

    /**
     * @var int $ram_total
     */
    public $ram_total;

    /**
     * @var int $ram_free
     */
    public $ram_free;

    /**
     * @var int $ram_available
     */
    public $ram_available;

    /**
     * @var string $efi_mount_ok
     */
    public $efi_mount_ok;

    /**
     * @var int $download
     */
    public $download;

    /**
     * @var int $upload
     */
    public $upload;

    /**
     * @var string $root_not_ro
     */
    public $root_not_ro;

    /**
     * @var string $sensors
     */
    public $sensors;

    /**
     * @var bool $in_sync
     */
    public $in_sync;

    /**
     * @var int $recent_touch_events
     */
    public $recent_touch_events;

    /**
     * @var DateTime $offline_since
     */
    public $offline_since;

    /**
     * @var DateTime $blackscreen_since
     */
    public $blackscreen_since;
}

Which represents a table of a foreign database.
I configured that database via:

        'Default' => [
                ...
        ],
        'Sysmon' => [
                'charset' => 'utf8mb4',
                'dbname' => 'sysmon',
                'driver' => 'mysqli',
                'host' => 'REDACTED',
                'password' => 'REDACTED',
                'port' => 3306,
                'tableoptions' => [
                    'charset' => 'utf8mb4',
                    'collate' => 'utf8mb4_general_ci',
                ],
                'user' => 'sysmon_ro',
            ],
    ],
    'TableMapping' => [
            'checkresults' => 'Sysmon',
            'offlinehistory' => 'Sysmon',
    ],

How do I let Typo3 know, that the 'checkresults' => 'Sysmon' mapping should use the aforementioned model class?
The official documentation does not mention how to do this.


问:
How to do kerberos authentication for Clickhouse HDFS disk?
In clickhouse documentation it is explained how to add hdfs disk by providing URL

```<code><clickhouse>
    <storage_configuration>
        <disks>
            <hdfs>
                <type>hdfs</type>
                <endpoint>hdfs://hdfs1:9000/clickhouse/</endpoint>
            </hdfs>
        </disks>
        ...
    </storage_configuration>
</clickhouse>
</code>```

However, HDFS only supports kerberos authentication, it is not possible to auth with URL.
Clickhouse also explains how to set up kerberos auth for HDFS engine here.

```<code><!-- Global configuration options for HDFS engine type -->
  <hdfs>
    <hadoop_kerberos_keytab>/tmp/keytab/clickhouse.keytab</hadoop_kerberos_keytab>
    <hadoop_kerberos_principal>clickuser@TEST.CLICKHOUSE.TECH</hadoop_kerberos_principal>
    <hadoop_security_authentication>kerberos</hadoop_security_authentication>
  </hdfs>

  <!-- Configuration specific for user "root" -->
  <hdfs_root>
    <hadoop_kerberos_principal>root@TEST.CLICKHOUSE.TECH</hadoop_kerberos_principal>
  </hdfs_root>
</code>```

How to configure kerberos for HDFS disk in MergeTree engine?

Body:
In clickhouse documentation it is explained how to add hdfs disk by providing URL

<clickhouse>
    <storage_configuration>
        <disks>
            <hdfs>
                <type>hdfs</type>
                <endpoint>hdfs://hdfs1:9000/clickhouse/</endpoint>
            </hdfs>
        </disks>
        ...
    </storage_configuration>
</clickhouse>

However, HDFS only supports kerberos authentication, it is not possible to auth with URL.
Clickhouse also explains how to set up kerberos auth for HDFS engine here.

  <hdfs>
    <hadoop_kerberos_keytab>/tmp/keytab/clickhouse.keytab</hadoop_kerberos_keytab>
    <hadoop_kerberos_principal>clickuser@TEST.CLICKHOUSE.TECH</hadoop_kerberos_principal>
    <hadoop_security_authentication>kerberos</hadoop_security_authentication>
  </hdfs>

  <hdfs_root>
    <hadoop_kerberos_principal>root@TEST.CLICKHOUSE.TECH</hadoop_kerberos_principal>
  </hdfs_root>

How to configure kerberos for HDFS disk in MergeTree engine?


问:
How can i get data from form request with Nuxt 3
I want to get the form data information from the request by submitting a simple form page.

Form page:

```<code>    <form action="http://localhost:3000" method="post">
    <input name="name_lastname" value="Ercan Kaval">
    <button>Submit</button>
    </form>
</code>```

I want to get the name_lastname information from here.

I'm trying to meet the post request at the end of payment.

Body:
I want to get the form data information from the request by submitting a simple form page.

Form page:

    <form action="http://localhost:3000" method="post">
    <input name="name_lastname" value="Ercan Kaval">
    <button>Submit</button>
    </form>

I want to get the name_lastname information from here.

I'm trying to meet the post request at the end of payment.


问:
Can an app with same bundle id be in testing track and production at the same time in google play console?
App is only accessible to the users whose emails are added in testing emails. It is not accessible to everyone on play store.

I was trying to public an app in some specific countries and want to have it in testing track as well for testing purpose.


问:
Add a card to favourites tab using a button on the card, and using the same button I want to remove the card from the favourites tab
Using a 'like button(class="heart")', I want to add a 'whole card(id="drag1")' to a 'Favourites Tab(class="dropzone")', which is also a section in my website. And from the click on the like button, I want to remove the card from it's original position(class="section_3") too. And also I want to do this in reverse using the same 'like button'(removing the card from the favourites tab and moving back it to it's original position).
{This card is also designed to do the drag & drop to the 'favourites tab' too. It's already applied}</p>
```<code>html
</code>```
```<code>  <div class="drop section_2">
    <div class="dropzone" id="div1" ondrop="drop(event)" ondragover="allowDrop(event)"> </div>
    <div id="title"></div>
  </div>

  <div class="section_3" id="div2" ondrop="drop(event)" ondragover="allowDrop(event)">

    <!-- card 1 -->
    <article class="card draggable" id="drag1" draggable="true" ondragstart="drag(event)">
      <div class="card__wrapper">

        <figure class="card__feature">
          <img src="./img1.jpg" class="card__img" alt="Estates" width="275" height="240">
        </figure>

        <div class="card__box">

          <header class="card__item card__header">
            <h6 class="card__item card__item--small card__label">Featured</h6>
            <h2 class="card__item card__item--small card__title">Blue Ocean Waves Crash</h2>
          </header>

          <hr class="card__item card__divider">

          <section class="card__item card__body">
            <p>See the beautiful oceans of the Pacific coast where the water is so clean you can see the sand.</p>
          </section>

          <div class="card_btns">
            <svg xmlns="http://www.w3.org/2000/svg" id="eye" fill="none" viewBox="0 0 24 24">
              <path stroke-linecap="round" stroke-linejoin="round" d="M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z" />
              <path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
            </svg>
            <svg xmlns="http://www.w3.org/2000/svg" class="heart" viewBox="0 0 24 24" onclick="addToCart(drag1)">
              <path stroke-linejoin="round" d="M21 8.25c0-2.485-2.099-4.5-4.688-4.5-1.935 0-3.597 1.126-4.312 2.733-.715-1.607-2.377-2.733-4.313-2.733C5.1 3.75 3 5.765 3 8.25c0 7.22 9 12 9 12s9-4.78 9-12z" />
            </svg>
          </div>

        </div>

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

Body:
Using a 'like button(class="heart")', I want to add a 'whole card(id="drag1")' to a 'Favourites Tab(class="dropzone")', which is also a section in my website. And from the click on the like button, I want to remove the card from it's original position(class="section_3") too. And also I want to do this in reverse using the same 'like button'(removing the card from the favourites tab and moving back it to it's original position).
{This card is also designed to do the drag & drop to the 'favourites tab' too. It's already applied}

html

Featured

Blue Ocean Waves Crash

See the beautiful oceans of the Pacific coast where the water is so clean you can see the sand.

            <svg xmlns="http://www.w3.org/2000/svg" id="eye" fill="none" viewBox="0 0 24 24">
              <path stroke-linecap="round" stroke-linejoin="round" d="M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z" />
              <path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
            </svg>
            <svg xmlns="http://www.w3.org/2000/svg" class="heart" viewBox="0 0 24 24" onclick="addToCart(drag1)">
              <path stroke-linejoin="round" d="M21 8.25c0-2.485-2.099-4.5-4.688-4.5-1.935 0-3.597 1.126-4.312 2.733-.715-1.607-2.377-2.733-4.313-2.733C5.1 3.75 3 5.765 3 8.25c0 7.22 9 12 9 12s9-4.78 9-12z" />
            </svg>