问:
Why can't I return true? am I making a mistake in the database query part?
I have tried all kinds of combinations since morning but I can't return any true value. The information I entered is completely correct.

Help me pls why can't I return true? am I making a mistake in the database query part?

import com.mysql.jdbc.Connection;
import com.mysql.jdbc.Statement;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import java.sql.ResultSet;
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author seyme
 */
public class para_ekle extends javax.swing.JFrame {

    private boolean ahmet;

    /**
     * Creates new form para_ekle
     */
    public para_ekle() {
        initComponents();
    }
    static boolean ekle = false;
public void kontrol() throws SQLException{

        Connection connect = null;
        dbbaglanti db = new dbbaglanti();
        connect = db.getConnection();
        Statement oku = ( Statement) connect.createStatement();

          String cekilenid = idtext4.getText();
          int cevrilenid = Integer.parseInt(cekilenid);
          String sifrebilgisi = sifretext4.getText();
          String tutarbilgisi = idtext4.getText();
          int cevrilentutar = Integer.parseInt(tutarbilgisi);
        try {

        }catch(Exception e){
            JOptionPane.showMessageDialog(null, "Bilgilerde Bir Hata Bulunuyor!");
        }
         ResultSet rs;
        rs = oku.executeQuery("SELECT count(id) as \"giris\" FROM dbkullanici.kullanicilar WHERE id ="+ cevrilenid +" && sifre = '"+sifrebilgisi+"'" +";");
         while (rs.next()) {
            int id = rs.getInt("giris");
           if(id == 1){ boolean ahmet = ekle == true; } else if (id == 0 ){boolean ahmet = ekle == false;}
         }
         if(ahmet == true){
         erortext.setText("verilerdogru");
         }else if(ahmet == false){

         erortext.setText("Bilgileriniz Veritabanımızda ki veriler ile eşleşmedi");

        }

    }
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        idtext4 = new javax.swing.JTextField();
        sifretext4 = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jLabel3 = new javax.swing.JLabel();
        tutartext = new javax.swing.JTextField();
        erortext = new javax.swing.JLabel();
        jButton2 = new javax.swing.JButton();
        jLabel4 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setFont(new java.awt.Font("Segoe UI Black", 1, 36)); // NOI18N
        jLabel1.setText("ISSEY FİNANS SİSTEMİ");

        jLabel2.setFont(new java.awt.Font("Ink Free", 1, 14)); // NOI18N
        jLabel2.setText("ISSEY ile paralarınız daha değerli");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap(37, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 428, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(32, 32, 32))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 214, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(128, 128, 128))))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jLabel5.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel5.setText("Hesap Şifreniz: ");

        jLabel6.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel6.setText("Hesap İd Numaranızı Yazınız: ");

        idtext4.setText("jTextField1");

        sifretext4.setText("jTextField2");

        jLabel7.setText("İd Numaranızı Bilmiyorsanız Kullanıcı listeleme panelinden görüntüleyebilirsiniz.");

        jButton1.setText("Ana Menü'ye Dön");

        jLabel3.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jLabel3.setText("Eklemek İstediğiniz Tutar");

        tutartext.setText("jTextField1");

        erortext.setForeground(new java.awt.Color(255, 0, 0));

        jButton2.setText("Para Ekle");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jLabel4.setForeground(new java.awt.Color(102, 102, 102));
        jLabel4.setText(" Para Eklemi işlemi için tüm bilgileri büyük küçük harf ve boşluk dahil doğru girmelisiniz.");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(erortext, javax.swing.GroupLayout.PREFERRED_SIZE, 390, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(55, 55, 55))
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jLabel7)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addGroup(layout.createSequentialGroup()
                                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                                        .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                        .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 188, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addGap(26, 26, 26)
                                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                                    .addComponent(idtext4)
                                                    .addComponent(sifretext4)
                                                    .addComponent(tutartext, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                            .addGroup(layout.createSequentialGroup()
                                                .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                        .addGap(8, 8, 8)))
                                .addGap(61, 61, 61))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 408, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(23, 23, 23))))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel7)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(idtext4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(sifretext4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(tutartext, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel4)
                .addGap(16, 16, 16)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(erortext, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
        try {
            kontrol();
        } catch (SQLException ex) {
            Logger.getLogger(para_ekle.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(para_ekle.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(para_ekle.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(para_ekle.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(para_ekle.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new para_ekle().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify
    private javax.swing.JLabel erortext;
    private javax.swing.JTextField idtext4;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JTextField sifretext4;
    private javax.swing.JTextField tutartext;
    // End of variables declaration
}
```


来源: stackexchange

问:
is there any R function for finding the index of an element in a vector?
In R, I have an element x and a vector v. I want to find the first index of an element in v that is equal to x. I know that one way to do this is: which(x == v)[[1]], but that seems excessively inefficient. Is there a more direct way to do it?

For bonus points, is there a function that works if x is a vector? That is, it should return a vector of indices indicating the position of each element of x in v.

its not an difficult task

ContentLicense: CC BY-SA 4.0


问:
How to get list of specific implementation based on the condition at runtime
I have 2 interfaces with a list of implementations for each interface like this.

Now I want to call any interface implementations on runtime based on the user input. For e.g. if the user selects file then FileAImpl, FileBImpl, FileCImpl should be executed.
So I created a parent interface

And added conditions for each case

```<code>public class IsFileCondition implements Condition {
    @Override
    public boolean matches(final ConditionContext context, final AnnotatedTypeMetadata metadata) {
        return ...;
    }
}
</code>```

And then created a configuration

```<code>@Configuration
@AllArgsConstructor

    public class CustomBeanService {

        private final List<FileInterface> fileInterface;

        private final List<DbInterface> dbInterface;

        @Bean
        @Conditional(IsFileCondition.class)
        public List<? extends ConverterInterface> fileInterface() {
            return fileInterface;
        }

        @Bean
        @Conditional(IsProdEnvCondition.class)
        public List<? extends ConverterInterface> dbInterface() {
            return dbInterface;
        }
    }
</code>```

And then use it like this

```<code>@SpringBootApplication

    @Autowired
    private List<? extends ConverterInterface> convert;
</code>```

But the list of convert here gives me all the implementation and not the specific selection.

Body:
I have 2 interfaces with a list of implementations for each interface like this.

Now I want to call any interface implementations on runtime based on the user input. For e.g. if the user selects file then FileAImpl, FileBImpl, FileCImpl should be executed.
So I created a parent interface

And added conditions for each case

public class IsFileCondition implements Condition {
    @Override
    public boolean matches(final ConditionContext context, final AnnotatedTypeMetadata metadata) {
        return ...;
    }
}

And then created a configuration

@Configuration
@AllArgsConstructor

    public class CustomBeanService {

        private final List<FileInterface> fileInterface;

        private final List<DbInterface> dbInterface;

        @Bean
        @Conditional(IsFileCondition.class)
        public List<? extends ConverterInterface> fileInterface() {
            return fileInterface;
        }

        @Bean
        @Conditional(IsProdEnvCondition.class)
        public List<? extends ConverterInterface> dbInterface() {
            return dbInterface;
        }
    }

And then use it like this

@SpringBootApplication

    @Autowired
    private List<? extends ConverterInterface> convert;

But the list of convert here gives me all the implementation and not the specific selection.


问:
Failed to execute 'toBlob' for canvas converting to file
i want to convert my cropped canvas to file,this is my code in order to do that:

```<code> const canvas = previewCanvasRef.current;
 canvas?.toBlob((blob) => {
     const file = new File([blob], 'fileName.jpg', { type: 'image/jpeg' });
 }
</code>```

but when i try to do that i get this error message:

Uncaught SecurityError: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported

i've done some reasearch and find out the root of problem is img cross origin, since i get img data from  url, so i changed it to

```<code><img crossorigin="anonymous" />
</code>```

but after that, i get different error message that is:

has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

what can i do in order to solve this problem?

Body:
i want to convert my cropped canvas to file,this is my code in order to do that:

 const canvas = previewCanvasRef.current;
 canvas?.toBlob((blob) => {
     const file = new File([blob], 'fileName.jpg', { type: 'image/jpeg' });
 }

but when i try to do that i get this error message:

Uncaught SecurityError: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported

i've done some reasearch and find out the root of problem is img cross origin, since i get img data from  url, so i changed it to

but after that, i get different error message that is:

has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

what can i do in order to solve this problem?


问:
Named Argument Not Found Compile Error - VBA
```<code>Sub NCR_Orders()
'
' NCR_Orders Macro
'

'
    ActiveSheet.ListObjects("Tracker").AutoFilter.ShowAllData
    Columns("C:AZ").Select
    Selection.EntireColumn.Hidden = False
    Range("C:T,W:W,Z:Z,AB:AB,AD:AD,AG:AL,AN:AN,AU:AU").Select
    Selection.EntireColumn.Hidden = True
    ActiveSheet.ListObjects("Tracker").AutoFilter Field:=19, Criteria1:="WON"
    ActiveSheet.ListObjects("Tracker").AutoFilter Field:=48, Criteria2:="NCR"
    ActiveWindow.ScrollColumn = 1
End Sub
</code>```

The Compile error is highlighting the first Auto Filter statement.

Please Help......................

Body:
Sub NCR_Orders()
'
' NCR_Orders Macro
'

'
    ActiveSheet.ListObjects("Tracker").AutoFilter.ShowAllData
    Columns("C:AZ").Select
    Selection.EntireColumn.Hidden = False
    Range("C:T,W:W,Z:Z,AB:AB,AD:AD,AG:AL,AN:AN,AU:AU").Select
    Selection.EntireColumn.Hidden = True
    ActiveSheet.ListObjects("Tracker").AutoFilter Field:=19, Criteria1:="WON"
    ActiveSheet.ListObjects("Tracker").AutoFilter Field:=48, Criteria2:="NCR"
    ActiveWindow.ScrollColumn = 1
End Sub

The Compile error is highlighting the first Auto Filter statement.

Please Help......................


问:
React/NextJS {" "} before an element
I am using VS Code with Prettier but when I save:

```<code>Hello: <Name>World<//Name>
</code>```

It changes to:

```<code>Hello:{" "}
<Name>World</Name>
</code>```

It also does it when I have just:

```<code>Hello <Name>World<//Name>
</code>```

Somehow it does not do it here though:

```<code><h1 className={styles.title}>
    Welcome to <a href="https://nextjs.org">Next.js!</a>
</h1>
</code>```

The Hello World examples are surrounding by a
 element.

Why and what are the purposes of this?

Title: React/NextJS {" "} before an element

Body:
I am using VS Code with Prettier but when I save:

Hello: <Name>World<//Name>

It changes to:

Hello:{" "}
<Name>World</Name>

It also does it when I have just:

Hello <Name>World<//Name>

Somehow it does not do it here though:

    Welcome to Next.js!

The Hello World examples are surrounding by a
 element.

Why and what are the purposes of this?


问:
How to Recover API Test Case in TOSCA in case of authentication failure?
I am working on a hybrid framework having UI as well API test steps in TOSCA, I am facing an issue where my API Test Steps fails intermittently due to 401 Authentication failure.
I want to retry this failure 3 times before termination my script as it works on retry.

I have added Do loop in my test step, in the loop part i have added my Request and Response and in the response i am capturing Response Code in buffer.
In the codition i am verifying that ResponseCode is != 200 OK then run the loop for 3 times.

Now i am facing this problem as in case of failure the loop response itself fails due to other parameters not getting found in the response and my loop is not running again.
Please help how to resolve this issue, so that in case of any failure other than 200 OK the steps will retry for 3 times.

PFA screenshot of scratchbook where it is failing.
enter image description here


问:
How to use 'ng-table-virtual-scroll' if there are millions of records
I am using 'ng-table-virtual-scroll' package for my angular (13 version) project. If my database table has 100k records then how I use this count to add virtual scroll.

Can I use this package without making dummy array of 100k items and just use count, because its giving error in angular that maximum stack increased.


问:
How to get link of first search result and also save first image in google using chrome or MS edge or IE?
I want to search a list of EANs on google using chrome/MS edge. VBA Macro should search each EAN on google and save the first link to the excel file. Also if possible, if it returns the search link, I want to save the first searched image of the product to a local drive.

The code should be written as VBA / Excel code. I am using below code, it opens the chrome browser and even searches the records, but I can't fetch the link of first search result and the image.

```<code>chpth="This variable will have full path of browser.exe"
    cnt = WorksheetFunction.CountA(Range("a:a"))
      For i = 2 To cnt
       ea = Range("A" & i).Value
       surl = "https://www.google.com/search?q=" & ea
       Shell (chpth & " -url https://www.google.com/search?q=" & ea)
    next
</code>```

I even tried the code on below link.. but it shows Object Required Error at the debug.print line
How to get the first search result link of a google search using VBA?

Body:
I want to search a list of EANs on google using chrome/MS edge. VBA Macro should search each EAN on google and save the first link to the excel file. Also if possible, if it returns the search link, I want to save the first searched image of the product to a local drive.

The code should be written as VBA / Excel code. I am using below code, it opens the chrome browser and even searches the records, but I can't fetch the link of first search result and the image.

chpth="This variable will have full path of browser.exe"
    cnt = WorksheetFunction.CountA(Range("a:a"))
      For i = 2 To cnt
       ea = Range("A" & i).Value
       surl = "https://www.google.com/search?q=" & ea
       Shell (chpth & " -url https://www.google.com/search?q=" & ea)
    next

I even tried the code on below link.. but it shows Object Required Error at the debug.print line
How to get the first search result link of a google search using VBA?


问:
How to add Adobe Myungjo font in react-pdf?
I'm using pdfjs(Document) to preview pdf in my site. (not a react-pdf/renderer)

But I can't see some paragraphs with adobe fonts.

How to add options to show adobe font in react-pdf?

(There is solution to add 'standard-fonts', but I need a solution for adobe fonts)

https://react-pdf.org/fonts


问:
Can't connect with Huginn login page
I already deployed Huginn on my linux server with Docker.

Huginn on Github: link

But when I ran docker run -it -p 3000:3000 huginn/huginn, and I wanted to connect Huginn login page with Http://myserverIP:3000 on my browser, it doesn't respond.

Browser response

How could I fix this problem? Or did I miss any details?

Title: Can't connect with Huginn login page


问:
Custom _error page with Sentry for error catching does not work in Next.js v13
Q: How to make a custom _error page with Sentry to catch all 404 and other errors?

Versions:

Next.js v13.1

Node v16.16.0

Typescript Version 4.7.3

The custom _error page does not catch any errors.

I have followed this guide from Sentry for Next.js: https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#create-a-custom-_error-page

My _error.tsx page:

/**
 * NOTE: This requires `@sentry/nextjs` version 7.3.0 or higher.
 *
 * This page is loaded by Nextjs:
 *  - on the server, when data-fetching methods throw or reject
 *  - on the client, when `getInitialProps` throws or rejects
 *  - on the client, when a React lifecycle method throws or rejects, and it's
 *    caught by the built-in Nextjs error boundary
 *
 * See:
 *  - https://nextjs.org/docs/basic-features/data-fetching/overview
 *  - https://nextjs.org/docs/api-reference/data-fetching/get-initial-props
 *  - https://reactjs.org/docs/error-boundaries.html
 */

import * as Sentry from '@sentry/nextjs';
import type { NextPage } from 'next';
import type { ErrorProps } from 'next/error';
import NextErrorComponent from 'next/error';

const CustomErrorComponent: NextPage<ErrorProps> = (props) => {
  // If you're using a Nextjs version prior to 12.2.1, uncomment this to
  // compensate for https://github.com/vercel/next.js/issues/8592
  // Sentry.captureUnderscoreErrorException(props);

  return <NextErrorComponent statusCode={props.statusCode} />;
};

CustomErrorComponent.getInitialProps = async (contextData) => {
  // In case this is running in a serverless function, await this in order to give Sentry
  // time to send the error before the lambda exits
  await Sentry.captureUnderscoreErrorException(contextData);
  console.log('getInitialProps in _error.tsx')

  // This will contain the status code of the response
  return NextErrorComponent.getInitialProps(contextData);
};

export default CustomErrorComponent;
```
<p>My <code>next.config.js</code> file:</p>
<pre class="lang-js prettyprint-override"><code>const { withSentryConfig } = require('@sentry/nextjs');

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  env: {
    ENV_FLAVOR: process.env.ENV_FLAVOR,
  },
  sentry: {
    // Use `hidden-source-map` rather than `source-map` as the Webpack `devtool`
    // for client-side builds. (This will be the default starting in
    // `@sentry/nextjs` version 8.0.0.) See
    // https://webpack.js.org/configuration/devtool/ and
    // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#use-hidden-source-map
    // for more information.
    hideSourceMaps: true,
  },
  // Use the CDN in production and localhost for development.
  assetPrefix: '[redacted]',
  eslint: {
    dirs: ['pages', 'components', 'utils', 'hooks', 'server'],
  },
  images: {
    domains: [
      '[redacted]',
    ],
  },
  output: 'standalone',

  // https://www.npmjs.com/package/@svgr/webpack
  // SVGR - enables to write .svg files as components with className, etc. - <Icon className='' {...props} />
  webpack(config) {
    config.module.rules.push({
      test: /\.svg$/i,
      issuer: /\.(ts|tsx|js|jsx)$/,
      use: [
        {
          loader: '@svgr/webpack',
          options: {
            typescript: true,
            icon: true,
          },
        },
      ],
    });

    return config;
  },
};

const sentryWebpackPluginOptions = {
  enabled: true,
  // Additional config options for the Sentry Webpack plugin. Keep in mind that
  // the following options are set automatically, and overriding them is not
  // recommended:
  //   release, url, org, project, authToken, configFile, stripPrefix,
  //   urlPrefix, include, ignore
  org: '[redacted]',
  project: '[redacted]',
  url: 'https://sentry.[redacted]',
  authToken: process.env.SENTRY_AUTH_TOKEN,
  debug: true,
  silent: false, // Suppresses all logs
  // For all available options, see:
  // https://github.com/getsentry/sentry-webpack-plugin#options.
};

module.exports = withSentryConfig(nextConfig, sentryWebpackPluginOptions)

</code>```

My sentry.client.config.js file:

// This file configures the initialization of Sentry on the browser.
// The config you add here will be used whenever a page is visited.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/

import * as Sentry from '@sentry/nextjs';

const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN;

Sentry.init({
  enabled: true,
  dsn: SENTRY_DSN || 'https://[redacted]@sentry.[redacted]/[redacted]',
  environment: process.env.ENV_FLAVOR || process.env.NODE_ENV,
  // Adjust this value in production, or use tracesSampler for greater control
  tracesSampleRate: 1.0,
  debug: true,
  silent: false, // Suppresses all logs

  // ...
  // Note: if you want to override the automatic release value, do not set a
  // `release` value here - use the environment variable `SENTRY_RELEASE`, so
  // that it will also get attached to your source maps
});
```
<p>My <code>sentry.server.config.js</code> file:</p>
<pre class="lang-js prettyprint-override"><code>// This file configures the initialization of Sentry on the server.
// The config you add here will be used whenever the server handles a request.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/

import * as Sentry from '@sentry/nextjs';

const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN;

Sentry.init({
  enabled: true,
  dsn: SENTRY_DSN || 'https://[redacted]@sentry.[redacted]/[redacted]',
  // Adjust this value in production, or use tracesSampler for greater control
  tracesSampleRate: 1.0,
  debug: true
  silent: false, // Suppresses all logs

  // ...
  // Note: if you want to override the automatic release value, do not set a
  // `release` value here - use the environment variable `SENTRY_RELEASE`, so
  // that it will also get attached to your source maps
});
</code>```

Run yarn dev log:

```<code>[07:09:41] Starting compilation in watch mode...

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info  - Loaded env from /[redacted]/.env
[Sentry Webpack Plugin] DRY Run Mode
[Sentry Webpack Plugin] DRY Run Mode
[Sentry Webpack Plugin] DRY Run Mode
[Sentry Webpack Plugin] DEBUG: Injecting release code
[Sentry Webpack Plugin] DEBUG: Loaders:
 [
  '<unknown loader>',
  '<unknown loader>',
  '<unknown loader>',
  '<unknown loader>',
  'next-image-loader',
  '<unknown loader>',
  '@svgr/webpack',
  '/[redacted]/node_modules/@sentry/nextjs/cjs/config/loaders/valueInjectionLoader.js',
  '/[redacted]/node_modules/@sentry/nextjs/cjs/config/loaders/valueInjectionLoader.js',
  '/[redacted]/node_modules/@sentry/webpack-plugin/src/sentry.loader.js'
]
[Sentry Webpack Plugin] DEBUG: Added loaders:
 [
  '/[redacted]/node_modules/@sentry/webpack-plugin/src/sentry.loader.js'
]
[Sentry Webpack Plugin] DEBUG: Removed loaders:
 []
[Sentry Webpack Plugin] DEBUG: Entry:

[Sentry Webpack Plugin] DEBUG: Added entry:
 []
[Sentry Webpack Plugin] DEBUG: Removed entry:
 []
[Sentry Webpack Plugin] DEBUG: Injecting release code
[Sentry Webpack Plugin] DEBUG: Loaders:
 [
  '<unknown loader>',
  '<unknown loader>',
  '<unknown loader>',
  '<unknown loader>',
  'next-image-loader',
  '@svgr/webpack',
  '/[redacted]/node_modules/@sentry/nextjs/cjs/config/loaders/valueInjectionLoader.js',
  '/[redacted]/node_modules/@sentry/nextjs/cjs/config/loaders/valueInjectionLoader.js',
  '/[redacted]/node_modules/@sentry/nextjs/cjs/config/loaders/proxyLoader.js',
  '/[redacted]/node_modules/@sentry/webpack-plugin/src/sentry.loader.js'
]
[Sentry Webpack Plugin] DEBUG: Added loaders:
 [
  '/[redacted]/node_modules/@sentry/webpack-plugin/src/sentry.loader.js'
]
[Sentry Webpack Plugin] DEBUG: Removed loaders:
 []
[Sentry Webpack Plugin] DEBUG: Entry:

[Sentry Webpack Plugin] DEBUG: Added entry:
 []
[Sentry Webpack Plugin] DEBUG: Removed entry:
 []
[Sentry Webpack Plugin] DEBUG: Injecting release code
[Sentry Webpack Plugin] DEBUG: Loaders:
 [
  '<unknown loader>',
  'next-middleware-asset-loader',
  'next-middleware-wasm-loader',
  '<unknown loader>',
  '<unknown loader>',
  '<unknown loader>',
  '<unknown loader>',
  'next-image-loader',
  '<unknown loader>',
  '@svgr/webpack',
  '/[redacted]/node_modules/@sentry/nextjs/cjs/config/loaders/valueInjectionLoader.js',
  '/[redacted]/node_modules/@sentry/nextjs/cjs/config/loaders/valueInjectionLoader.js',
  '/[redacted]/node_modules/@sentry/nextjs/cjs/config/loaders/proxyLoader.js',
  '/[redacted]/node_modules/@sentry/webpack-plugin/src/sentry.loader.js'
]
[Sentry Webpack Plugin] DEBUG: Added loaders:
 [
  '/[redacted]/node_modules/@sentry/webpack-plugin/src/sentry.loader.js'
]
[Sentry Webpack Plugin] DEBUG: Removed loaders:
 []
[Sentry Webpack Plugin] DEBUG: Entry:

[Sentry Webpack Plugin] DEBUG: Added entry:
 []
[Sentry Webpack Plugin] DEBUG: Removed entry:
 []
[Sentry Webpack Plugin] Creating new release:
 'development'
[Sentry Webpack Plugin] Calling upload-sourcemaps with:
 {
  finalize: true,
  rewrite: true,
  include: [
    {
      paths: [
        '/[redacted]/.next/static/chunks/pages'
      ],
      urlPrefix: '~/_next/static/chunks/pages'
    }
  ],
  ignore: [],
  configFile: 'sentry.properties',
  stripPrefix: [ 'webpack://_N_E/' ],
  urlPrefix: '~/_next',
  entries: [Function: entries],
  release: 'development',
  dryRun: true,
  enabled: true,
  org: '[redacted]',
  project: '[redacted]',
  url: 'https://sentry./[redacted]',
  environment: 'development',
  authToken: '[redacted]',
  debug: true,
  silent: false
}
[Sentry Webpack Plugin] Finalizing release:
 'development'
[Sentry Webpack Plugin] Creating new release:
 'development'
[Sentry Webpack Plugin] Calling upload-sourcemaps with:
 {
  finalize: true,
  rewrite: true,
  include: [
    {
      paths: [
        '/[redacted]/.next/server/pages/'
      ],
      urlPrefix: '~/_next/server/pages'
    },
    {
      paths: [
        '/[redacted]/.next/server/chunks/'
      ],
      urlPrefix: '~/_next/server/chunks'
    }
  ],
  ignore: [],
  configFile: 'sentry.properties',
  stripPrefix: [ 'webpack://_N_E/' ],
  urlPrefix: '~/_next',
  entries: [Function: entries],
  release: 'development',
  dryRun: true,
  enabled: true,
  org: '[redacted]',
  project: '[redacted]',
  url: 'https://sentry./[redacted]',
  environment: 'development',
  authToken: '[redacted]',
  debug: true,
  silent: false
}
[Sentry Webpack Plugin] Finalizing release:
 'development'
[Sentry Webpack Plugin] Creating new release:
 'development'
[Sentry Webpack Plugin] Calling upload-sourcemaps with:
 {
  finalize: true,
  rewrite: true,
  include: [
    {
      paths: [
        '/[redacted]/.next/server/pages/'
      ],
      urlPrefix: '~/_next/server/pages'
    },
    {
      paths: [
        '/[redacted]/.next/server/chunks/'
      ],
      urlPrefix: '~/_next/server/chunks'
    }
  ],
  ignore: [],
  configFile: 'sentry.properties',
  stripPrefix: [ 'webpack://_N_E/' ],
  urlPrefix: '~/_next',
  entries: [Function: entries],
  release: 'development',
  dryRun: true,
  enabled: true,
  org: '[redacted]',
  project: '[redacted]',
  url: 'https://sentry./[redacted]',
  environment: 'development',
  authToken: '[redacted]',
  debug: true,
  silent: false
}
[Sentry Webpack Plugin] Finalizing release:
 'development'
event - compiled client and server successfully in 3.6s (689 modules)
[07:09:47] Found 0 errors. Watching for file changes.

wait  - compiling /middleware (client and server)...
[Sentry Webpack Plugin] Creating new release:
 'development'
[Sentry Webpack Plugin] Calling upload-sourcemaps with:
 {
  finalize: true,
  rewrite: true,
  include: [
    {
      paths: [
        '/[redacted]/.next/server/pages/'
      ],
      urlPrefix: '~/_next/server/pages'
    },
    {
      paths: [
        '/[redacted]/.next/server/chunks/'
      ],
      urlPrefix: '~/_next/server/chunks'
    }
  ],
  ignore: [],
  configFile: 'sentry.properties',
  stripPrefix: [ 'webpack://_N_E/' ],
  urlPrefix: '~/_next',
  entries: [Function: entries],
  release: 'development',
  dryRun: true,
  enabled: true,
  org: '[redacted]',
  project: '[redacted]',
  url: 'https://sentry./[redacted]',
  environment: 'development',
  authToken: '[redacted]',
  debug: true,
  silent: false
}
[Sentry Webpack Plugin] Finalizing release:
 'development'
event - compiled successfully in 161 ms (41 modules)
wait  - compiling /_error (client and server)...
[Sentry Webpack Plugin] Creating new release:
 'development'
[Sentry Webpack Plugin] Calling upload-sourcemaps with:
 {
  finalize: true,
  rewrite: true,
  include: [
    {
      paths: [
        '/[redacted]/.next/static/chunks/pages'
      ],
      urlPrefix: '~/_next/static/chunks/pages'
    }
  ],
  ignore: [],
  configFile: 'sentry.properties',
  stripPrefix: [ 'webpack://_N_E/' ],
  urlPrefix: '~/_next',
  entries: [Function: entries],
  release: 'development',
  dryRun: true,
  enabled: true,
  org: '[redacted]',
  project: '[redacted]',
  url: 'https://sentry./[redacted]',
  environment: 'development',
  authToken: '[redacted]',
  debug: true,
  silent: false
}
[Sentry Webpack Plugin] Finalizing release:
 'development'
[Sentry Webpack Plugin] Creating new release:
 'development'
[Sentry Webpack Plugin] Calling upload-sourcemaps with:
 {
  finalize: true,
  rewrite: true,
  include: [
    {
      paths: [
        '/[redacted]/.next/server/pages/'
      ],
      urlPrefix: '~/_next/server/pages'
    },
    {
      paths: [
        '/[redacted]/.next/server/chunks/'
      ],
      urlPrefix: '~/_next/server/chunks'
    }
  ],
  ignore: [],
  configFile: 'sentry.properties',
  stripPrefix: [ 'webpack://_N_E/' ],
  urlPrefix: '~/_next',
  entries: [Function: entries],
  release: 'development',
  dryRun: true,
  enabled: true,
  org: '[redacted]',
  project: '[redacted]',
  url: 'https://sentry./[redacted]',
  environment: 'development',
  authToken: '[redacted]',
  debug: true,
  silent: false
}
[Sentry Webpack Plugin] Finalizing release:
 'development'
event - compiled client and server successfully in 501 ms (689 modules)
Sentry Logger [log]: Initializing SDK...
Sentry Logger [log]: Integration installed: InboundFilters
Sentry Logger [log]: Integration installed: FunctionToString
Sentry Logger [log]: Integration installed: Console
Sentry Logger [log]: Integration installed: Http
Sentry Logger [log]: Integration installed: OnUncaughtException
Sentry Logger [log]: Integration installed: OnUnhandledRejection
Sentry Logger [log]: Integration installed: ContextLines
Sentry Logger [log]: Integration installed: Context
Sentry Logger [log]: Integration installed: Modules
Sentry Logger [log]: Integration installed: RequestData
Sentry Logger [log]: Integration installed: LinkedErrors
Sentry Logger [log]: Integration installed: Postgres
Sentry Logger [log]: Integration installed: RewriteFrames
Sentry Logger [log]: SDK successfully initialized
warn  - You have added a custom /_error page without a custom /404 page. This prevents the 404 page from being auto statically optimized.
See here for info: https://nextjs.org/docs/messages/custom-error-no-custom-404
Sentry Logger [log]: [Tracing] starting http.server transaction - /_error
Sentry Logger [log]: [Tracing] Starting 'function.nextjs' span on transaction '/_error' (aa456f6d383caa73).
getInitialProps in _error.tsx
Sentry Logger [log]: [Tracing] Finishing 'function.nextjs' span on transaction '/_error' (aa456f6d383caa73).
Sentry Logger [log]: [Tracing] Finishing http.server transaction: /_error.
Sentry Logger [log]: Flushing events...
Sentry Logger [log]: Done flushing events
Sentry Logger [log]: [Tracing] Continuing trace 7a3dfcb765b743ac893c35809336ad1b.
Sentry Logger [log]: [Tracing] starting http.server transaction - GET /api/auth/session
Sentry Logger [log]: [Tracing] Continuing trace 7a3dfcb765b743ac893c35809336ad1b.
Sentry Logger [log]: [Tracing] starting http.server transaction - GET /api/auth/session
wait  - compiling /api/auth/[...nextauth] (client and server)...
[Sentry Webpack Plugin] Creating new release:
 'development'
[Sentry Webpack Plugin] Calling upload-sourcemaps with:
 {
  finalize: true,
  rewrite: true,
  include: [
    {
      paths: [
        '/[redacted]/.next/server/pages/'
      ],
      urlPrefix: '~/_next/server/pages'
    },
    {
      paths: [
        '/[redacted]/.next/server/chunks/'
      ],
      urlPrefix: '~/_next/server/chunks'
    }
  ],
  ignore: [],
  configFile: 'sentry.properties',
  stripPrefix: [ 'webpack://_N_E/' ],
  urlPrefix: '~/_next',
  entries: [Function: entries],
  release: 'development',
  dryRun: true,
  enabled: true,
  org: '[redacted]',
  project: '[redacted]',
  url: 'https://sentry./[redacted]',
  environment: 'development',
  authToken: '[redacted]',
  debug: true,
  silent: false
}
[Sentry Webpack Plugin] Finalizing release:
 'development'
event - compiled successfully in 186 ms (156 modules)
[Sentry Webpack Plugin] Creating new release:
 'development'
[Sentry Webpack Plugin] Calling upload-sourcemaps with:
 {
  finalize: true,
  rewrite: true,
  include: [
    {
      paths: [
        '/[redacted]/.next/server/pages/'
      ],
      urlPrefix: '~/_next/server/pages'
    },
    {
      paths: [
        '/[redacted]/.next/server/chunks/'
      ],
      urlPrefix: '~/_next/server/chunks'
    }
  ],
  ignore: [],
  configFile: 'sentry.properties',
  stripPrefix: [ 'webpack://_N_E/' ],
  urlPrefix: '~/_next',
  entries: [Function: entries],
  release: 'development',
  dryRun: true,
  enabled: true,
  org: '[redacted]',
  project: '[redacted]',
  url: 'https://sentry./[redacted]',
  environment: 'development',
  authToken: '[redacted]',
  debug: true,
  silent: false
}
[Sentry Webpack Plugin] Finalizing release:
 'development'
Sentry Logger [log]: [Tracing] Continuing trace 7a3dfcb765b743ac893c35809336ad1b.
Sentry Logger [log]: [Tracing] starting http.server transaction - GET /api/auth/[...nextauth]
Sentry Logger [log]: [Tracing] Continuing trace 7a3dfcb765b743ac893c35809336ad1b.
Sentry Logger [log]: [Tracing] starting http.server transaction - GET /api/auth/[...nextauth]
query: SELECT * FROM current_schema()
Sentry Logger [log]: [Tracing] Starting 'db' span on transaction 'GET /api/auth/[...nextauth]' (ab9317efe6069f6b).
Sentry Logger [log]: [Tracing] Finishing 'db' span on transaction 'GET /api/auth/[...nextauth]' (ab9317efe6069f6b).
query: SHOW server_version;
Sentry Logger [log]: [Tracing] Starting 'db' span on transaction 'GET /api/auth/[...nextauth]' (ab9317efe6069f6b).
Sentry Logger [log]: [Tracing] Finishing 'db' span on transaction 'GET /api/auth/[...nextauth]' (ab9317efe6069f6b).
query: SELECT "user"."id" AS "user_id", "user"."name" AS "user_name", "user"."email" AS "user_email", "user"."profile_picture" AS "user_profile_picture", "user"."created_at" AS "user_created_at", "user"."updated_at" AS "user_updated_at", "user"."bio" AS "user_bio", "user"."job_title" AS "user_job_title", "user"."linkedin_url" AS "user_linkedin_url", "user"."twitter_url" AS "user_twitter_url", "user"."website" AS "user_website", "user"."company_name" AS "user_company_name", "user"."company_size" AS "user_company_size", "socials"."id" AS "socials_id", "socials"."name" AS "socials_name", "socials"."nickname" AS "socials_nickname", "socials"."profile_picture" AS "socials_profile_picture", "socials"."email" AS "socials_email", "socials"."provider" AS "socials_provider", "socials"."userId" AS "socials_userId", "votes"."id" AS "votes_id", "votes"."vote_type" AS "votes_vote_type", "votes"."session_id" AS "votes_session_id", "votes"."created_at" AS "votes_created_at", "votes"."updated_at" AS "votes_updated_at", "votes"."user_id" AS "votes_user_id", "votes"."article_id" AS "votes_article_id" FROM "users" "user" LEFT JOIN "social_accounts" "socials" ON "socials"."userId"="user"."id"  LEFT JOIN "article_votes" "votes" ON "votes"."user_id"="user"."id" WHERE "user"."email" = $1 -- PARAMETERS: ["[redacted]"]
Sentry Logger [log]: [Tracing] Starting 'db' span on transaction 'GET /api/auth/[...nextauth]' (a471a31253c2516e).
Sentry Logger [log]: [Tracing] Finishing 'db' span on transaction 'GET /api/auth/[...nextauth]' (a471a31253c2516e).
query: SELECT "user"."id" AS "user_id", "user"."name" AS "user_name", "user"."email" AS "user_email", "user"."profile_picture" AS "user_profile_picture", "user"."created_at" AS "user_created_at", "user"."updated_at" AS "user_updated_at", "user"."bio" AS "user_bio", "user"."job_title" AS "user_job_title", "user"."linkedin_url" AS "user_linkedin_url", "user"."twitter_url" AS "user_twitter_url", "user"."website" AS "user_website", "user"."company_name" AS "user_company_name", "user"."company_size" AS "user_company_size", "socials"."id" AS "socials_id", "socials"."name" AS "socials_name", "socials"."nickname" AS "socials_nickname", "socials"."profile_picture" AS "socials_profile_picture", "socials"."email" AS "socials_email", "socials"."provider" AS "socials_provider", "socials"."userId" AS "socials_userId", "votes"."id" AS "votes_id", "votes"."vote_type" AS "votes_vote_type", "votes"."session_id" AS "votes_session_id", "votes"."created_at" AS "votes_created_at", "votes"."updated_at" AS "votes_updated_at", "votes"."user_id" AS "votes_user_id", "votes"."article_id" AS "votes_article_id" FROM "users" "user" LEFT JOIN "social_accounts" "socials" ON "socials"."userId"="user"."id"  LEFT JOIN "article_votes" "votes" ON "votes"."user_id"="user"."id" WHERE "user"."email" = $1 -- PARAMETERS: ["[redacted]"]
Sentry Logger [log]: [Tracing] Starting 'db' span on transaction 'GET /api/auth/[...nextauth]' (ab9317efe6069f6b).
Sentry Logger [log]: [Tracing] Finishing http.server transaction: GET /api/auth/[...nextauth].
Sentry Logger [log]: Flushing events...
Sentry Logger [log]: [Tracing] Finishing 'db' span on transaction 'GET /api/auth/[...nextauth]' (ab9317efe6069f6b).
Sentry Logger [log]: [Tracing] Finishing http.server transaction: GET /api/auth/[...nextauth].
Sentry Logger [log]: Flushing events...
Sentry Logger [log]: Done flushing events
Sentry Logger [log]: Done flushing events
Sentry Logger [log]: [Tracing] Continuing trace 7a3dfcb765b743ac893c35809336ad1b.
Sentry Logger [log]: [Tracing] starting http.server transaction - /some-non-existing-page
Sentry Logger [log]: Initializing SDK...
Sentry Logger [log]: SDK already initialized
Sentry Logger [log]: [Tracing] starting http.server transaction - /_error
Sentry Logger [log]: [Tracing] Starting 'function.nextjs' span on transaction '/_error' (a3bef10759093a80).
getInitialProps in _error.tsx
Sentry Logger [log]: [Tracing] Finishing 'function.nextjs' span on transaction '/_error' (a3bef10759093a80).
Sentry Logger [log]: [Tracing] Finishing http.server transaction: /_error.
Sentry Logger [log]: Flushing events...
Sentry Logger [log]: Done flushing events
Sentry Logger [log]: [Tracing] Finishing http.server transaction: /_error.
</code>```

Rendered page:

A workaround I don't want to use:

Just a note here that I don't want to use return { notFound: true } (ref: https://nextjs.org/docs/api-reference/data-fetching/get-static-props#notfound) in all pages because it logs a weird error in Sentry that doesn't say anything.

Body:
Q: How to make a custom _error page with Sentry to catch all 404 and other errors?

Versions:

Next.js v13.1

Node v16.16.0

Typescript Version 4.7.3

The custom _error page does not catch any errors.

I have followed this guide from Sentry for Next.js: https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#create-a-custom-_error-page

My _error.tsx page:

/**
 * NOTE: This requires `@sentry/nextjs` version 7.3.0 or higher.
 *
 * This page is loaded by Nextjs:
 *  - on the server, when data-fetching methods throw or reject
 *  - on the client, when `getInitialProps` throws or rejects
 *  - on the client, when a React lifecycle method throws or rejects, and it's
 *    caught by the built-in Nextjs error boundary
 *
 * See:
 *  - https://nextjs.org/docs/basic-features/data-fetching/overview
 *  - https://nextjs.org/docs/api-reference/data-fetching/get-initial-props
 *  - https://reactjs.org/docs/error-boundaries.html
 */

import * as Sentry from '@sentry/nextjs';
import type { NextPage } from 'next';
import type { ErrorProps } from 'next/error';
import NextErrorComponent from 'next/error';

const CustomErrorComponent: NextPage<ErrorProps> = (props) => {
  // If you're using a Nextjs version prior to 12.2.1, uncomment this to
  // compensate for https://github.com/vercel/next.js/issues/8592
  // Sentry.captureUnderscoreErrorException(props);

  return <NextErrorComponent statusCode={props.statusCode} />;
};

CustomErrorComponent.getInitialProps = async (contextData) => {
  // In case this is running in a serverless function, await this in order to give Sentry
  // time to send the error before the lambda exits
  await Sentry.captureUnderscoreErrorException(contextData);
  console.log('getInitialProps in _error.tsx')

  // This will contain the status code of the response
  return NextErrorComponent.getInitialProps(contextData);
};

export default CustomErrorComponent;

My next.config.js file:

const { withSentryConfig } = require('@sentry/nextjs');

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  env: {
    ENV_FLAVOR: process.env.ENV_FLAVOR,
  },
  sentry: {
    // Use `hidden-source-map` rather than `source-map` as the Webpack `devtool`
    // for client-side builds. (This will be the default starting in
    // `@sentry/nextjs` version 8.0.0.) See
    // https://webpack.js.org/configuration/devtool/ and
    // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#use-hidden-source-map
    // for more information.
    hideSourceMaps: true,
  },
  // Use the CDN in production and localhost for development.
  assetPrefix: '[redacted]',
  eslint: {
    dirs: ['pages', 'components', 'utils', 'hooks', 'server'],
  },
  images: {
    domains: [
      '[redacted]',
    ],
  },
  output: 'standalone',

  // https://www.npmjs.com/package/@svgr/webpack
  // SVGR - enables to write .svg files as components with className, etc. - <Icon className='' {...props} />
  webpack(config) {
    config.module.rules.push({
      test: /\.svg$/i,
      issuer: /\.(ts|tsx|js|jsx)$/,
      use: [
        {
          loader: '@svgr/webpack',
          options: {
            typescript: true,
            icon: true,
          },
        },
      ],
    });

    return config;
  },
};

const sentryWebpackPluginOptions = {
  enabled: true,
  // Additional config options for the Sentry Webpack plugin. Keep in mind that
  // the following options are set automatically, and overriding them is not
  // recommended:
  //   release, url, org, project, authToken, configFile, stripPrefix,
  //   urlPrefix, include, ignore
  org: '[redacted]',
  project: '[redacted]',
  url: 'https://sentry.[redacted]',
  authToken: process.env.SENTRY_AUTH_TOKEN,
  debug: true,
  silent: false, // Suppresses all logs
  // For all available options, see:
  // https://github.com/getsentry/sentry-webpack-plugin#options.
};

module.exports = withSentryConfig(nextConfig, sentryWebpackPluginOptions)

My sentry.client.config.js file:

// This file configures the initialization of Sentry on the browser.
// The config you add here will be used whenever a page is visited.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/

import * as Sentry from '@sentry/nextjs';

const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN;

Sentry.init({
  enabled: true,
  dsn: SENTRY_DSN || 'https://[redacted]@sentry.[redacted]/[redacted]',
  environment: process.env.ENV_FLAVOR || process.env.NODE_ENV,
  // Adjust this value in production, or use tracesSampler for greater control
  tracesSampleRate: 1.0,
  debug: true,
  silent: false, // Suppresses all logs

  // ...
  // Note: if you want to override the automatic release value, do not set a
  // `release` value here - use the environment variable `SENTRY_RELEASE`, so
  // that it will also get attached to your source maps
});

My sentry.server.config.js file:

// This file configures the initialization of Sentry on the server.
// The config you add here will be used whenever the server handles a request.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/

import * as Sentry from '@sentry/nextjs';

const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN;

Sentry.init({
  enabled: true,
  dsn: SENTRY_DSN || 'https://[redacted]@sentry.[redacted]/[redacted]',
  // Adjust this value in production, or use tracesSampler for greater control
  tracesSampleRate: 1.0,
  debug: true
  silent: false, // Suppresses all logs

  // ...
  // Note: if you want to override the automatic release value, do not set a
  // `release` value here - use the environment variable `SENTRY_RELEASE`, so
  // that it will also get attached to your source maps
});

Run yarn dev log:

[07:09:41] Starting compilation in watch mode...

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info  - Loaded env from /[redacted]/.env
[Sentry Webpack Plugin] DRY Run Mode
[Sentry Webpack Plugin] DRY Run Mode
[Sentry Webpack Plugin] DRY Run Mode
[Sentry Webpack Plugin] DEBUG: Injecting release code
[Sentry Webpack Plugin] DEBUG: Loaders:
 [
  '<unknown loader>',
  '<unknown loader>',
  '<unknown loader>',
  '<unknown loader>',
  'next-image-loader',
  '<unknown loader>',
  '@svgr/webpack',
  '/[redacted]/node_modules/@sentry/nextjs/cjs/config/loaders/valueInjectionLoader.js',
  '/[redacted]/node_modules/@sentry/nextjs/cjs/config/loaders/valueInjectionLoader.js',
  '/[redacted]/node_modules/@sentry/webpack-plugin/src/sentry.loader.js'
]
[Sentry Webpack Plugin] DEBUG: Added loaders:
 [
  '/[redacted]/node_modules/@sentry/webpack-plugin/src/sentry.loader.js'
]
[Sentry Webpack Plugin] DEBUG: Removed loaders:
 []
[Sentry Webpack Plugin] DEBUG: Entry:

[Sentry Webpack Plugin] DEBUG: Added entry:
 []
[Sentry Webpack Plugin] DEBUG: Removed entry:
 []
[Sentry Webpack Plugin] DEBUG: Injecting release code
[Sentry Webpack Plugin] DEBUG: Loaders:
 [
  '<unknown loader>',
  '<unknown loader>',
  '<unknown loader>',
  '<unknown loader>',
  'next-image-loader',
  '@svgr/webpack',
  '/[redacted]/node_modules/@sentry/nextjs/cjs/config/loaders/valueInjectionLoader.js',
  '/[redacted]/node_modules/@sentry/nextjs/cjs/config/loaders/valueInjectionLoader.js',
  '/[redacted]/node_modules/@sentry/nextjs/cjs/config/loaders/proxyLoader.js',
  '/[redacted]/node_modules/@sentry/webpack-plugin/src/sentry.loader.js'
]
[Sentry Webpack Plugin] DEBUG: Added loaders:
 [
  '/[redacted]/node_modules/@sentry/webpack-plugin/src/sentry.loader.js'
]
[Sentry Webpack Plugin] DEBUG: Removed loaders:
 []
[Sentry Webpack Plugin] DEBUG: Entry:

[Sentry Webpack Plugin] DEBUG: Added entry:
 []
[Sentry Webpack Plugin] DEBUG: Removed entry:
 []
[Sentry Webpack Plugin] DEBUG: Injecting release code
[Sentry Webpack Plugin] DEBUG: Loaders:
 [
  '<unknown loader>',
  'next-middleware-asset-loader',
  'next-middleware-wasm-loader',
  '<unknown loader>',
  '<unknown loader>',
  '<unknown loader>',
  '<unknown loader>',
  'next-image-loader',
  '<unknown loader>',
  '@svgr/webpack',
  '/[redacted]/node_modules/@sentry/nextjs/cjs/config/loaders/valueInjectionLoader.js',
  '/[redacted]/node_modules/@sentry/nextjs/cjs/config/loaders/valueInjectionLoader.js',
  '/[redacted]/node_modules/@sentry/nextjs/cjs/config/loaders/proxyLoader.js',
  '/[redacted]/node_modules/@sentry/webpack-plugin/src/sentry.loader.js'
]
[Sentry Webpack Plugin] DEBUG: Added loaders:
 [
  '/[redacted]/node_modules/@sentry/webpack-plugin/src/sentry.loader.js'
]
[Sentry Webpack Plugin] DEBUG: Removed loaders:
 []
[Sentry Webpack Plugin] DEBUG: Entry:

[Sentry Webpack Plugin] DEBUG: Added entry:
 []
[Sentry Webpack Plugin] DEBUG: Removed entry:
 []
[Sentry Webpack Plugin] Creating new release:
 'development'
[Sentry Webpack Plugin] Calling upload-sourcemaps with:
 {
  finalize: true,
  rewrite: true,
  include: [
    {
      paths: [
        '/[redacted]/.next/static/chunks/pages'
      ],
      urlPrefix: '~/_next/static/chunks/pages'
    }
  ],
  ignore: [],
  configFile: 'sentry.properties',
  stripPrefix: [ 'webpack://_N_E/' ],
  urlPrefix: '~/_next',
  entries: [Function: entries],
  release: 'development',
  dryRun: true,
  enabled: true,
  org: '[redacted]',
  project: '[redacted]',
  url: 'https://sentry./[redacted]',
  environment: 'development',
  authToken: '[redacted]',
  debug: true,
  silent: false
}
[Sentry Webpack Plugin] Finalizing release:
 'development'
[Sentry Webpack Plugin] Creating new release:
 'development'
[Sentry Webpack Plugin] Calling upload-sourcemaps with:
 {
  finalize: true,
  rewrite: true,
  include: [
    {
      paths: [
        '/[redacted]/.next/server/pages/'
      ],
      urlPrefix: '~/_next/server/pages'
    },
    {
      paths: [
        '/[redacted]/.next/server/chunks/'
      ],
      urlPrefix: '~/_next/server/chunks'
    }
  ],
  ignore: [],
  configFile: 'sentry.properties',
  stripPrefix: [ 'webpack://_N_E/' ],
  urlPrefix: '~/_next',
  entries: [Function: entries],
  release: 'development',
  dryRun: true,
  enabled: true,
  org: '[redacted]',
  project: '[redacted]',
  url: 'https://sentry./[redacted]',
  environment: 'development',
  authToken: '[redacted]',
  debug: true,
  silent: false
}
[Sentry Webpack Plugin] Finalizing release:
 'development'
[Sentry Webpack Plugin] Creating new release:
 'development'
[Sentry Webpack Plugin] Calling upload-sourcemaps with:
 {
  finalize: true,
  rewrite: true,
  include: [
    {
      paths: [
        '/[redacted]/.next/server/pages/'
      ],
      urlPrefix: '~/_next/server/pages'
    },
    {
      paths: [
        '/[redacted]/.next/server/chunks/'
      ],
      urlPrefix: '~/_next/server/chunks'
    }
  ],
  ignore: [],
  configFile: 'sentry.properties',
  stripPrefix: [ 'webpack://_N_E/' ],
  urlPrefix: '~/_next',
  entries: [Function: entries],
  release: 'development',
  dryRun: true,
  enabled: true,
  org: '[redacted]',
  project: '[redacted]',
  url: 'https://sentry./[redacted]',
  environment: 'development',
  authToken: '[redacted]',
  debug: true,
  silent: false
}
[Sentry Webpack Plugin] Finalizing release:
 'development'
event - compiled client and server successfully in 3.6s (689 modules)
[07:09:47] Found 0 errors. Watching for file changes.

wait  - compiling /middleware (client and server)...
[Sentry Webpack Plugin] Creating new release:
 'development'
[Sentry Webpack Plugin] Calling upload-sourcemaps with:
 {
  finalize: true,
  rewrite: true,
  include: [
    {
      paths: [
        '/[redacted]/.next/server/pages/'
      ],
      urlPrefix: '~/_next/server/pages'
    },
    {
      paths: [
        '/[redacted]/.next/server/chunks/'
      ],
      urlPrefix: '~/_next/server/chunks'
    }
  ],
  ignore: [],
  configFile: 'sentry.properties',
  stripPrefix: [ 'webpack://_N_E/' ],
  urlPrefix: '~/_next',
  entries: [Function: entries],
  release: 'development',
  dryRun: true,
  enabled: true,
  org: '[redacted]',
  project: '[redacted]',
  url: 'https://sentry./[redacted]',
  environment: 'development',
  authToken: '[redacted]',
  debug: true,
  silent: false
}
[Sentry Webpack Plugin] Finalizing release:
 'development'
event - compiled successfully in 161 ms (41 modules)
wait  - compiling /_error (client and server)...
[Sentry Webpack Plugin] Creating new release:
 'development'
[Sentry Webpack Plugin] Calling upload-sourcemaps with:
 {
  finalize: true,
  rewrite: true,
  include: [
    {
      paths: [
        '/[redacted]/.next/static/chunks/pages'
      ],
      urlPrefix: '~/_next/static/chunks/pages'
    }
  ],
  ignore: [],
  configFile: 'sentry.properties',
  stripPrefix: [ 'webpack://_N_E/' ],
  urlPrefix: '~/_next',
  entries: [Function: entries],
  release: 'development',
  dryRun: true,
  enabled: true,
  org: '[redacted]',
  project: '[redacted]',
  url: 'https://sentry./[redacted]',
  environment: 'development',
  authToken: '[redacted]',
  debug: true,
  silent: false
}
[Sentry Webpack Plugin] Finalizing release:
 'development'
[Sentry Webpack Plugin] Creating new release:
 'development'
[Sentry Webpack Plugin] Calling upload-sourcemaps with:
 {
  finalize: true,
  rewrite: true,
  include: [
    {
      paths: [
        '/[redacted]/.next/server/pages/'
      ],
      urlPrefix: '~/_next/server/pages'
    },
    {
      paths: [
        '/[redacted]/.next/server/chunks/'
      ],
      urlPrefix: '~/_next/server/chunks'
    }
  ],
  ignore: [],
  configFile: 'sentry.properties',
  stripPrefix: [ 'webpack://_N_E/' ],
  urlPrefix: '~/_next',
  entries: [Function: entries],
  release: 'development',
  dryRun: true,
  enabled: true,
  org: '[redacted]',
  project: '[redacted]',
  url: 'https://sentry./[redacted]',
  environment: 'development',
  authToken: '[redacted]',
  debug: true,
  silent: false
}
[Sentry Webpack Plugin] Finalizing release:
 'development'
event - compiled client and server successfully in 501 ms (689 modules)
Sentry Logger [log]: Initializing SDK...
Sentry Logger [log]: Integration installed: InboundFilters
Sentry Logger [log]: Integration installed: FunctionToString
Sentry Logger [log]: Integration installed: Console
Sentry Logger [log]: Integration installed: Http
Sentry Logger [log]: Integration installed: OnUncaughtException
Sentry Logger [log]: Integration installed: OnUnhandledRejection
Sentry Logger [log]: Integration installed: ContextLines
Sentry Logger [log]: Integration installed: Context
Sentry Logger [log]: Integration installed: Modules
Sentry Logger [log]: Integration installed: RequestData
Sentry Logger [log]: Integration installed: LinkedErrors
Sentry Logger [log]: Integration installed: Postgres
Sentry Logger [log]: Integration installed: RewriteFrames
Sentry Logger [log]: SDK successfully initialized
warn  - You have added a custom /_error page without a custom /404 page. This prevents the 404 page from being auto statically optimized.
See here for info: https://nextjs.org/docs/messages/custom-error-no-custom-404
Sentry Logger [log]: [Tracing] starting http.server transaction - /_error
Sentry Logger [log]: [Tracing] Starting 'function.nextjs' span on transaction '/_error' (aa456f6d383caa73).
getInitialProps in _error.tsx
Sentry Logger [log]: [Tracing] Finishing 'function.nextjs' span on transaction '/_error' (aa456f6d383caa73).
Sentry Logger [log]: [Tracing] Finishing http.server transaction: /_error.
Sentry Logger [log]: Flushing events...
Sentry Logger [log]: Done flushing events
Sentry Logger [log]: [Tracing] Continuing trace 7a3dfcb765b743ac893c35809336ad1b.
Sentry Logger [log]: [Tracing] starting http.server transaction - GET /api/auth/session
Sentry Logger [log]: [Tracing] Continuing trace 7a3dfcb765b743ac893c35809336ad1b.
Sentry Logger [log]: [Tracing] starting http.server transaction - GET /api/auth/session
wait  - compiling /api/auth/[...nextauth] (client and server)...
[Sentry Webpack Plugin] Creating new release:
 'development'
[Sentry Webpack Plugin] Calling upload-sourcemaps with:
 {
  finalize: true,
  rewrite: true,
  include: [
    {
      paths: [
        '/[redacted]/.next/server/pages/'
      ],
      urlPrefix: '~/_next/server/pages'
    },
    {
      paths: [
        '/[redacted]/.next/server/chunks/'
      ],
      urlPrefix: '~/_next/server/chunks'
    }
  ],
  ignore: [],
  configFile: 'sentry.properties',
  stripPrefix: [ 'webpack://_N_E/' ],
  urlPrefix: '~/_next',
  entries: [Function: entries],
  release: 'development',
  dryRun: true,
  enabled: true,
  org: '[redacted]',
  project: '[redacted]',
  url: 'https://sentry./[redacted]',
  environment: 'development',
  authToken: '[redacted]',
  debug: true,
  silent: false
}
[Sentry Webpack Plugin] Finalizing release:
 'development'
event - compiled successfully in 186 ms (156 modules)
[Sentry Webpack Plugin] Creating new release:
 'development'
[Sentry Webpack Plugin] Calling upload-sourcemaps with:
 {
  finalize: true,
  rewrite: true,
  include: [
    {
      paths: [
        '/[redacted]/.next/server/pages/'
      ],
      urlPrefix: '~/_next/server/pages'
    },
    {
      paths: [
        '/[redacted]/.next/server/chunks/'
      ],
      urlPrefix: '~/_next/server/chunks'
    }
  ],
  ignore: [],
  configFile: 'sentry.properties',
  stripPrefix: [ 'webpack://_N_E/' ],
  urlPrefix: '~/_next',
  entries: [Function: entries],
  release: 'development',
  dryRun: true,
  enabled: true,
  org: '[redacted]',
  project: '[redacted]',
  url: 'https://sentry./[redacted]',
  environment: 'development',
  authToken: '[redacted]',
  debug: true,
  silent: false
}
[Sentry Webpack Plugin] Finalizing release:
 'development'
Sentry Logger [log]: [Tracing] Continuing trace 7a3dfcb765b743ac893c35809336ad1b.
Sentry Logger [log]: [Tracing] starting http.server transaction - GET /api/auth/[...nextauth]
Sentry Logger [log]: [Tracing] Continuing trace 7a3dfcb765b743ac893c35809336ad1b.
Sentry Logger [log]: [Tracing] starting http.server transaction - GET /api/auth/[...nextauth]
query: SELECT * FROM current_schema()
Sentry Logger [log]: [Tracing] Starting 'db' span on transaction 'GET /api/auth/[...nextauth]' (ab9317efe6069f6b).
Sentry Logger [log]: [Tracing] Finishing 'db' span on transaction 'GET /api/auth/[...nextauth]' (ab9317efe6069f6b).
query: SHOW server_version;
Sentry Logger [log]: [Tracing] Starting 'db' span on transaction 'GET /api/auth/[...nextauth]' (ab9317efe6069f6b).
Sentry Logger [log]: [Tracing] Finishing 'db' span on transaction 'GET /api/auth/[...nextauth]' (ab9317efe6069f6b).
query: SELECT "user"."id" AS "user_id", "user"."name" AS "user_name", "user"."email" AS "user_email", "user"."profile_picture" AS "user_profile_picture", "user"."created_at" AS "user_created_at", "user"."updated_at" AS "user_updated_at", "user"."bio" AS "user_bio", "user"."job_title" AS "user_job_title", "user"."linkedin_url" AS "user_linkedin_url", "user"."twitter_url" AS "user_twitter_url", "user"."website" AS "user_website", "user"."company_name" AS "user_company_name", "user"."company_size" AS "user_company_size", "socials"."id" AS "socials_id", "socials"."name" AS "socials_name", "socials"."nickname" AS "socials_nickname", "socials"."profile_picture" AS "socials_profile_picture", "socials"."email" AS "socials_email", "socials"."provider" AS "socials_provider", "socials"."userId" AS "socials_userId", "votes"."id" AS "votes_id", "votes"."vote_type" AS "votes_vote_type", "votes"."session_id" AS "votes_session_id", "votes"."created_at" AS "votes_created_at", "votes"."updated_at" AS "votes_updated_at", "votes"."user_id" AS "votes_user_id", "votes"."article_id" AS "votes_article_id" FROM "users" "user" LEFT JOIN "social_accounts" "socials" ON "socials"."userId"="user"."id"  LEFT JOIN "article_votes" "votes" ON "votes"."user_id"="user"."id" WHERE "user"."email" = $1 -- PARAMETERS: ["[redacted]"]
Sentry Logger [log]: [Tracing] Starting 'db' span on transaction 'GET /api/auth/[...nextauth]' (a471a31253c2516e).
Sentry Logger [log]: [Tracing] Finishing 'db' span on transaction 'GET /api/auth/[...nextauth]' (a471a31253c2516e).
query: SELECT "user"."id" AS "user_id", "user"."name" AS "user_name", "user"."email" AS "user_email", "user"."profile_picture" AS "user_profile_picture", "user"."created_at" AS "user_created_at", "user"."updated_at" AS "user_updated_at", "user"."bio" AS "user_bio", "user"."job_title" AS "user_job_title", "user"."linkedin_url" AS "user_linkedin_url", "user"."twitter_url" AS "user_twitter_url", "user"."website" AS "user_website", "user"."company_name" AS "user_company_name", "user"."company_size" AS "user_company_size", "socials"."id" AS "socials_id", "socials"."name" AS "socials_name", "socials"."nickname" AS "socials_nickname", "socials"."profile_picture" AS "socials_profile_picture", "socials"."email" AS "socials_email", "socials"."provider" AS "socials_provider", "socials"."userId" AS "socials_userId", "votes"."id" AS "votes_id", "votes"."vote_type" AS "votes_vote_type", "votes"."session_id" AS "votes_session_id", "votes"."created_at" AS "votes_created_at", "votes"."updated_at" AS "votes_updated_at", "votes"."user_id" AS "votes_user_id", "votes"."article_id" AS "votes_article_id" FROM "users" "user" LEFT JOIN "social_accounts" "socials" ON "socials"."userId"="user"."id"  LEFT JOIN "article_votes" "votes" ON "votes"."user_id"="user"."id" WHERE "user"."email" = $1 -- PARAMETERS: ["[redacted]"]
Sentry Logger [log]: [Tracing] Starting 'db' span on transaction 'GET /api/auth/[...nextauth]' (ab9317efe6069f6b).
Sentry Logger [log]: [Tracing] Finishing http.server transaction: GET /api/auth/[...nextauth].
Sentry Logger [log]: Flushing events...
Sentry Logger [log]: [Tracing] Finishing 'db' span on transaction 'GET /api/auth/[...nextauth]' (ab9317efe6069f6b).
Sentry Logger [log]: [Tracing] Finishing http.server transaction: GET /api/auth/[...nextauth].
Sentry Logger [log]: Flushing events...
Sentry Logger [log]: Done flushing events
Sentry Logger [log]: Done flushing events
Sentry Logger [log]: [Tracing] Continuing trace 7a3dfcb765b743ac893c35809336ad1b.
Sentry Logger [log]: [Tracing] starting http.server transaction - /some-non-existing-page
Sentry Logger [log]: Initializing SDK...
Sentry Logger [log]: SDK already initialized
Sentry Logger [log]: [Tracing] starting http.server transaction - /_error
Sentry Logger [log]: [Tracing] Starting 'function.nextjs' span on transaction '/_error' (a3bef10759093a80).
getInitialProps in _error.tsx
Sentry Logger [log]: [Tracing] Finishing 'function.nextjs' span on transaction '/_error' (a3bef10759093a80).
Sentry Logger [log]: [Tracing] Finishing http.server transaction: /_error.
Sentry Logger [log]: Flushing events...
Sentry Logger [log]: Done flushing events
Sentry Logger [log]: [Tracing] Finishing http.server transaction: /_error.

Rendered page:

A workaround I don't want to use:

Just a note here that I don't want to use return { notFound: true } (ref: https://nextjs.org/docs/api-reference/data-fetching/get-static-props#notfound) in all pages because it logs a weird error in Sentry that doesn't say anything.


问:
no PostgreSQL user name specified in startup packet
```<code>   ^
no PostgreSQL user name specified in startup packet```
```
```const { Pool } = require('pg');

const pool = new Pool({
  connectionString: process.env.DATABASE_URL
});

console.log('ok connected')

pool.query('SELECT * FROM todo', (error, result) => {
  if (error) {
    throw error.message;
  }
  console.log(result.rows);
});

process.on('SIGINT', () => {
  pool.end();
});

```
<p>Iam using postgresql with express js , trying to connect to database but its show this error</p>
```i am using ElephantSQL service for this project
```

Body:
   ^
no PostgreSQL user name specified in startup packet```

const { Pool } = require('pg');

const pool = new Pool({
  connectionString: process.env.DATABASE_URL
});

console.log('ok connected')

pool.query('SELECT * FROM todo', (error, result) => {
  if (error) {
    throw error.message;
  }
  console.log(result.rows);
});

process.on('SIGINT', () => {
  pool.end();
});

Iam using postgresql with express js , trying to connect to database but its show this error

i am using ElephantSQL service for this project


问:
I have a question about MongoServerError: bad auth : authentication failed (AtlasError / HandshakeError / ResetPool)
First of all, please understand that there may be some difficulties in delivering the contents due to my poor English skills.

When I want to run nodemon, termial showed this error.

```<code>MongoServerError: bad auth : authentication failed
    at Connection.onMessage (C:\Users\twinc\Desktop\230102\server\node_modules\mongodb\lib\cmap\connection.js:230:30)
    at MessageStream.<anonymous> (C:\Users\twinc\Desktop\230102\server\node_modules\mongodb\lib\cmap\connection.js:61:60)
    at MessageStream.emit (node:events:527:28)
    at processIncomingData (C:\Users\twinc\Desktop\230102\server\node_modules\mongodb\lib\cmap\message_stream.js:125:16)
    at MessageStream._write (C:\Users\twinc\Desktop\230102\server\node_modules\mongodb\lib\cmap\message_stream.js:33:9)
    at writeOrBuffer (node:internal/streams/writable:389:12)
    at _write (node:internal/streams/writable:330:10)
    at MessageStream.Writable.write (node:internal/streams/writable:334:10)
    at TLSSocket.ondata (node:internal/streams/readable:754:22)
    at TLSSocket.emit (node:events:527:28) {
  ok: 0,
  code: 8000,
  codeName: 'AtlasError',
  connectionGeneration: 0,
  [Symbol(errorLabels)]: Set(2) { 'HandshakeError', 'ResetPool' }

</code>```

In Postman, it showed like this.

```<code>{
    "success": false,
    "err": {}
}

</code>```

This is what I wrote. (index.js)
I covered some personal information to show you.

```<code>const express = require('express')
const app = express()
const port = 3000
const bodyParser = require('body-parser');
const { User } = require('./model/User');

app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());

const mongoose = require('mongoose')

mongoose.set("strictQuery", false);

mongoose.connect('mongodb+srv://name:password@cluster0.xxx.mongodb.net/myFirstDatabase', {
}).then(() => console.log('MongoDB Connected...'))
  .catch(arr => console.log(arr))

app.get('/', (req, res) => {
  res.send('Hello, Express!')
})

app.post('/register', (req, res) => {
  const user = new User(req.body);

  user.save((err, userInfo) => {
    if(err) return res.json({ success: false, err});
    return res.status(200).json({
      success: true,
    });
  });
});

app.listen(port, () => {
  console.log(`Example app listening on port ${port}!`)
})
</code>```

This is User.js file.

```<code>const mongoose = require('mongoose');

const userSchema = mongoose.Schema({
    name: {
        type: String,
        maxLength: 50,
    },
    email: {
        type: String,
        trim: true,
        unique: 1,
    },
    password: {
        type: String,
        minLength: 50,
    },
    role: {
        type: Number,
        default: 0,
    },
    image: String,
    token: {
        type: String,
    },
    tokenExp: {
        type: Number,
    },
})

const User = mongoose.model('User', userSchema)

module.exports = { User }
</code>```

I hope I can get

```<code>{
      success: true,
    }
</code>```

Body:
First of all, please understand that there may be some difficulties in delivering the contents due to my poor English skills.

When I want to run nodemon, termial showed this error.

MongoServerError: bad auth : authentication failed
    at Connection.onMessage (C:\Users\twinc\Desktop\230102\server\node_modules\mongodb\lib\cmap\connection.js:230:30)
    at MessageStream.<anonymous> (C:\Users\twinc\Desktop\230102\server\node_modules\mongodb\lib\cmap\connection.js:61:60)
    at MessageStream.emit (node:events:527:28)
    at processIncomingData (C:\Users\twinc\Desktop\230102\server\node_modules\mongodb\lib\cmap\message_stream.js:125:16)
    at MessageStream._write (C:\Users\twinc\Desktop\230102\server\node_modules\mongodb\lib\cmap\message_stream.js:33:9)
    at writeOrBuffer (node:internal/streams/writable:389:12)
    at _write (node:internal/streams/writable:330:10)
    at MessageStream.Writable.write (node:internal/streams/writable:334:10)
    at TLSSocket.ondata (node:internal/streams/readable:754:22)
    at TLSSocket.emit (node:events:527:28) {
  ok: 0,
  code: 8000,
  codeName: 'AtlasError',
  connectionGeneration: 0,
  [Symbol(errorLabels)]: Set(2) { 'HandshakeError', 'ResetPool' }

In Postman, it showed like this.

{
    "success": false,
    "err": {}
}

This is what I wrote. (index.js)
I covered some personal information to show you.

const express = require('express')
const app = express()
const port = 3000
const bodyParser = require('body-parser');
const { User } = require('./model/User');

app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());

const mongoose = require('mongoose')

mongoose.set("strictQuery", false);

mongoose.connect('mongodb+srv://name:password@cluster0.xxx.mongodb.net/myFirstDatabase', {
}).then(() => console.log('MongoDB Connected...'))
  .catch(arr => console.log(arr))

app.get('/', (req, res) => {
  res.send('Hello, Express!')
})

app.post('/register', (req, res) => {
  const user = new User(req.body);

  user.save((err, userInfo) => {
    if(err) return res.json({ success: false, err});
    return res.status(200).json({
      success: true,
    });
  });
});

app.listen(port, () => {
  console.log(`Example app listening on port ${port}!`)
})

This is User.js file.

const mongoose = require('mongoose');

const userSchema = mongoose.Schema({
    name: {
        type: String,
        maxLength: 50,
    },
    email: {
        type: String,
        trim: true,
        unique: 1,
    },
    password: {
        type: String,
        minLength: 50,
    },
    role: {
        type: Number,
        default: 0,
    },
    image: String,
    token: {
        type: String,
    },
    tokenExp: {
        type: Number,
    },
})

const User = mongoose.model('User', userSchema)

module.exports = { User }

I hope I can get

{
      success: true,
    }


问:
RSI values above candles, and value color change
I have implemented original lines of code from Vitruvius.

```<code>vt_rsi     = ta.rsi(close,14)
//dispv      = input.bool(defval=true, title="Display RSI Values?") //i wanted to add the option to switch on and off, got stuck.
vt_rsi_str = str.format("{0,number,#.##}", vt_rsi)
label1     = label.new(bar_index, high, text=vt_rsi_str, style=label.style_circle, size=size.tiny, color=#00000000, textcolor=#ffffffa4)
label.set_xloc(label1, time, xloc.bar_time)
label.set_y(label1, high)
label.set_text(label1, vt_rsi_str)
</code>```

I would like to know if the following updates is possible with this code, and if so how can I change or add to this code to achieve the following.

Is it possible to have the values show above the candle when price is moving up, and below the candles when price is moving down?

Have the value change colors above the bars in green, and values below the bars red?

Color change for extremes, when value is above candle and value above 70 = color x, and then when value is below candles and below 20 = color y

Thank you for the assistance.

I have no have previous experience with the "str.format" so I tried the following for color change:
//textc   = vt_rsi_str >= 60 ? color.green : vt_rsi_str <= 40 ? color.green : na

I have no idea how to get the values below the bars for down moves.

Body:
I have implemented original lines of code from Vitruvius.

vt_rsi     = ta.rsi(close,14)
//dispv      = input.bool(defval=true, title="Display RSI Values?") //i wanted to add the option to switch on and off, got stuck.
vt_rsi_str = str.format("{0,number,#.##}", vt_rsi)
label1     = label.new(bar_index, high, text=vt_rsi_str, style=label.style_circle, size=size.tiny, color=#00000000, textcolor=#ffffffa4)
label.set_xloc(label1, time, xloc.bar_time)
label.set_y(label1, high)
label.set_text(label1, vt_rsi_str)

I would like to know if the following updates is possible with this code, and if so how can I change or add to this code to achieve the following.

Is it possible to have the values show above the candle when price is moving up, and below the candles when price is moving down?

Have the value change colors above the bars in green, and values below the bars red?

Color change for extremes, when value is above candle and value above 70 = color x, and then when value is below candles and below 20 = color y

Thank you for the assistance.

I have no have previous experience with the "str.format" so I tried the following for color change:
//textc   = vt_rsi_str >= 60 ? color.green : vt_rsi_str <= 40 ? color.green : na

I have no idea how to get the values below the bars for down moves.


问:
Remove php extension remove then I add / in url
www.example.com/about.php
url i want to change this url
www.example.com/about/

I want to .php extension remove then I add / in url


问:
how to find size of objects/json in bytes in JSON
Suppose we have 10mb of data in a table, with select query I am storing all those data in resultset object. Now I have to iterate over the resultset and convert it to specific json format.

I have to store only 1mb of data in that json message so that i can publish 1mb json message into kafka topic.
SO how to check the size of json message in bytes?

jsonObject.toString().getBytes().length;
is this correct?


问:
Change properties of a foreign key field in default django table
I am trying to use an existing database with django ORM.

I have created the models for the tables that I want to use.
python manage.py makemigrations ran without any problem.
python manage.py migrate returns the error

File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
raise errorclass(errno, errval)
django.db.utils.OperationalError: (1005, 'Can't create table site_db.django_admin_log (errno: 150 "Foreign key constraint is incorrectly formed")')

I had read that the FOREIGN KEY references in MySQL is that both columns of the constraint must the same column definition.

So I checked and the DataType of primary key of user table is int(11) unsigned and the user_id in django_admin_log table is bigint(20).

And I think the problem is due to that.

Is there a way to override LogEntry which is responsible for the django_admin_log table and change the user_id field properties or is there anything else that can be done.

Need your insight on this one.
Thanks for your time...


问:
JQuery scroll panel by mouse position
I've built a CSS select box recreation. How would the div container be scrolled by mouse position. I have seen this before somewhere, and it is also very similar to how the standard select box works on Mac Safari.

Any ideas?

Marvellous

ContentLicense: CC BY-SA 3.0

Title: JQuery scroll panel by mouse position


问:
Is there a machine learning model in Python for prediction of the next set of "random" numbers in a sequence?
I have a dataset with three columns, each has a number 0-9. There are ~6700 rows in the set. I am wondering if it is possible to create a machine learning model to predict the next set of three numbers (one in each column)? If this is possible, how difficult is it and what type of a model would you recommend?

I am newer to machine learning so any help would be great!

Thank you!

I have tried using different kinds of LSTMs using tensorflow, but the results appeared to be averages rather than predictions.

Here is one of the attempts I made:

```<code>import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

df = pd.read_excel('Numbers1.xlsx', sheet_name='midday training')
dataset_train = df.iloc[:, 1:]
dataset_train = dataset_train.iloc[::-1]
time_series_data = np.array(df)
training_set = time_series_data[:, 1:4]

from sklearn.preprocessing import MinMaxScaler
sc = MinMaxScaler(feature_range=(0, 1))
training_set_scaled = sc.fit_transform(training_set)

x_train = []
y_train = []
for i in range(1, 6003):
    x_train.append(training_set_scaled[i-1:i, :3])
    y_train.append(training_set_scaled[i, :3])
x_train, y_train = np.array(x_train), np.array(y_train)

x_train = np.reshape(x_train, (6002,1,3))

from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from keras.layers import Dropout

regressor = Sequential()

regressor.add(LSTM(units = 50, return_sequences = True, input_shape = (x_train.shape[1], 3)))
regressor.add(Dropout(.2))
regressor.add(LSTM(units = 50, return_sequences = True))
regressor.add(Dropout(.2))
regressor.add(LSTM(units = 50, return_sequences = True))
regressor.add(Dropout(.2))
regressor.add(LSTM(units = 50))
regressor.add(Dropout(.2))

regressor.add(Dense(units = 3))

regressor.compile(optimizer = 'adam', loss = 'mean_squared_error')

regressor.fit(x_train, y_train, epochs = 20, batch_size = 32)

dataset_test = pd.read_excel('Numbers1.xlsx', sheet_name='midday')
dataset_test = dataset_test.iloc[:, 1:]
dataset_test = dataset_test.iloc[::-1]
real = dataset_test

dataset_total = pd.concat((dataset_train, dataset_test), axis = 0)
inputs = dataset_total[len(dataset_total) - len(dataset_test) - 1:].values
inputs = sc.transform(inputs)
x_test = []

for i in range(1, 6734):
    x_test.append(inputs[i-1:i, :3])
x_test = np.array(x_test)
x_test = np.reshape(x_test, (6733,1,3))
predicted = regressor.predict(x_test)
predicted = sc.inverse_transform(predicted)
</code>```

Body:
I have a dataset with three columns, each has a number 0-9. There are ~6700 rows in the set. I am wondering if it is possible to create a machine learning model to predict the next set of three numbers (one in each column)? If this is possible, how difficult is it and what type of a model would you recommend?

I am newer to machine learning so any help would be great!

Thank you!

I have tried using different kinds of LSTMs using tensorflow, but the results appeared to be averages rather than predictions.

Here is one of the attempts I made:

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

df = pd.read_excel('Numbers1.xlsx', sheet_name='midday training')
dataset_train = df.iloc[:, 1:]
dataset_train = dataset_train.iloc[::-1]
time_series_data = np.array(df)
training_set = time_series_data[:, 1:4]

from sklearn.preprocessing import MinMaxScaler
sc = MinMaxScaler(feature_range=(0, 1))
training_set_scaled = sc.fit_transform(training_set)

x_train = []
y_train = []
for i in range(1, 6003):
    x_train.append(training_set_scaled[i-1:i, :3])
    y_train.append(training_set_scaled[i, :3])
x_train, y_train = np.array(x_train), np.array(y_train)

x_train = np.reshape(x_train, (6002,1,3))

from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from keras.layers import Dropout

regressor = Sequential()

regressor.add(LSTM(units = 50, return_sequences = True, input_shape = (x_train.shape[1], 3)))
regressor.add(Dropout(.2))
regressor.add(LSTM(units = 50, return_sequences = True))
regressor.add(Dropout(.2))
regressor.add(LSTM(units = 50, return_sequences = True))
regressor.add(Dropout(.2))
regressor.add(LSTM(units = 50))
regressor.add(Dropout(.2))

regressor.add(Dense(units = 3))

regressor.compile(optimizer = 'adam', loss = 'mean_squared_error')

regressor.fit(x_train, y_train, epochs = 20, batch_size = 32)

dataset_test = pd.read_excel('Numbers1.xlsx', sheet_name='midday')
dataset_test = dataset_test.iloc[:, 1:]
dataset_test = dataset_test.iloc[::-1]
real = dataset_test

dataset_total = pd.concat((dataset_train, dataset_test), axis = 0)
inputs = dataset_total[len(dataset_total) - len(dataset_test) - 1:].values
inputs = sc.transform(inputs)
x_test = []

for i in range(1, 6734):
    x_test.append(inputs[i-1:i, :3])
x_test = np.array(x_test)
x_test = np.reshape(x_test, (6733,1,3))
predicted = regressor.predict(x_test)
predicted = sc.inverse_transform(predicted)


问:
Change environment in sentry at runtime
In my flutter App I can change the environment dynamically. Therefore I would like to change the environment accordingly for the crash tracking with sentry.

Is there a way to change the environment at runtime?

I just found SentryFlutter.init(...), but that doesn't seem to make sense to me to update the environment.

Title: Change environment in sentry at runtime


问:
cygwin x86_64 __x86_64__ definition issues
I was using Cygwin 32bit.
I recently had a problem with my PC and I'm trying to reinstall Cygwin 32bit.
"cygwin is not supported on 32-bit windows"
Couldn't install with message.

So, I installed Cygwin 64bit and built my project.
However, an error occurred at line 102 of the usr/include/cygwin/signal.h file.
It looks like the problem is that x86_64 is not defined, how can I fix it?

Answers I'll wait.

hello!
I was using Cygwin 32bit.
I recently had a problem with my PC and I'm trying to reinstall Cygwin 32bit.
"cygwin is not supported on 32-bit windows"
Couldn't install with message.

So, I installed Cygwin 64bit and built my project.
However, an error occurred at line 102 of the usr/include/cygwin/signal.h file.
It looks like the problem is that x86_64 is not defined, how can I fix it?

Answers I'll wait.


问:
Can't display unicode on title bar in WIN32
I have been trying to create a Window whose title bar could be in any language. But I am getting something like ▯*. I writing as escape characters as of now. I am attesting the entirity of the code.

```<code>#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <string>

LRESULT CALLBACK WindowProc(HWND Window, UINT Message, WPARAM WParam, LPARAM LParam) {
    switch(Message) {
        case WM_KEYDOWN: {
            switch(WParam) {
                case 'O': {
                    DestroyWindow(Window);
                } break;
            }
        } break;
        case WM_DESTROY: {
            PostQuitMessage(0);
        } break;
        default: {
            return DefWindowProc(Window, Message, WParam,  LParam);
        }
    }
    return 0;
}

int WINAPI WinMain(HINSTANCE Instance, HINSTANCE PrevInstance, PSTR CmdLine, int CmdShow) {

    WNDCLASSW WindowClass = {0};
    const wchar_t* ClassName = L"MyWindowClass";

    WindowClass.lpfnWndProc = WindowProc;
    WindowClass.hInstance = Instance;
    WindowClass.lpszClassName = ClassName;
    WindowClass.hCursor = LoadCursor(NULL, IDC_CROSS);
    MessageBoxW(0, L"\u0906\u092a", L"\u0906\u092a", 0);

    if(!RegisterClassW(&WindowClass)) {
        MessageBoxW(0, L"RegisterClass failed", 0, 0);
        return GetLastError();
    }

    HWND Window = CreateWindowExW(0, ClassName, L"\u0906\u092a",
                                 WS_OVERLAPPEDWINDOW|WS_VISIBLE,
                                 CW_USEDEFAULT, CW_USEDEFAULT,
                                 CW_USEDEFAULT, CW_USEDEFAULT,
                                 0, 0, Instance, 0);

    if(!Window) {
        MessageBoxW(0, L"CreateWindowEx failed", 0, 0);
        return GetLastError();
    }

    int Running = 1;

    while(Running) {
        MSG Message;
        while(GetMessageW(&Message, NULL, 0, 0)) {
            if(Message.message == WM_QUIT) Running = 0;
            TranslateMessage(&Message);
            DispatchMessage(&Message);
        }
    }

    return 0;
}
</code>```

I was expecting the title bar to be something like 'आप'

Body:
I have been trying to create a Window whose title bar could be in any language. But I am getting something like ▯*. I writing as escape characters as of now. I am attesting the entirity of the code.

#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <string>

LRESULT CALLBACK WindowProc(HWND Window, UINT Message, WPARAM WParam, LPARAM LParam) {
    switch(Message) {
        case WM_KEYDOWN: {
            switch(WParam) {
                case 'O': {
                    DestroyWindow(Window);
                } break;
            }
        } break;
        case WM_DESTROY: {
            PostQuitMessage(0);
        } break;
        default: {
            return DefWindowProc(Window, Message, WParam,  LParam);
        }
    }
    return 0;
}

int WINAPI WinMain(HINSTANCE Instance, HINSTANCE PrevInstance, PSTR CmdLine, int CmdShow) {

    WNDCLASSW WindowClass = {0};
    const wchar_t* ClassName = L"MyWindowClass";

    WindowClass.lpfnWndProc = WindowProc;
    WindowClass.hInstance = Instance;
    WindowClass.lpszClassName = ClassName;
    WindowClass.hCursor = LoadCursor(NULL, IDC_CROSS);
    MessageBoxW(0, L"\u0906\u092a", L"\u0906\u092a", 0);

    if(!RegisterClassW(&WindowClass)) {
        MessageBoxW(0, L"RegisterClass failed", 0, 0);
        return GetLastError();
    }

    HWND Window = CreateWindowExW(0, ClassName, L"\u0906\u092a",
                                 WS_OVERLAPPEDWINDOW|WS_VISIBLE,
                                 CW_USEDEFAULT, CW_USEDEFAULT,
                                 CW_USEDEFAULT, CW_USEDEFAULT,
                                 0, 0, Instance, 0);

    if(!Window) {
        MessageBoxW(0, L"CreateWindowEx failed", 0, 0);
        return GetLastError();
    }

    int Running = 1;

    while(Running) {
        MSG Message;
        while(GetMessageW(&Message, NULL, 0, 0)) {
            if(Message.message == WM_QUIT) Running = 0;
            TranslateMessage(&Message);
            DispatchMessage(&Message);
        }
    }

    return 0;
}

I was expecting the title bar to be something like 'आप'


问:
How to highlight ranges of lines in different colors in vscode extension development?
I'm trying to develop a vscode extension which would read some data from a file and based on that data, highlight ranges of lines in different colors. eg: lines 1 to 10 in red color, lines 20 to 40 in green, lines 50 to 100 in yellow. If that isn't possible I could also do the highlighting in the gutter. However, I've not been able to find anything in the vscode extension development docs that would allow me to do this. I was expecting there to be an API like vscode.editor.background(1, 10, 'red')