问:
Update Mysql database using data inserted into Jtable
I want to be able to update my MySQL database through user insertion in a JTable where I display my database, but based off my code right now I get a error:

java.sql.SQLException: Parameter index out of range (0 < 1 )

This error occurs when I click my button to update the database.

This is my main class:

```<code>public class Main{
    public static void main(String[] args) {
        new MyFrame();
    }
}
</code>```

This is my class for my main menu:

```<code>package com.company;

import javax.swing.*;
import java.awt.*;

public class MyFrame extends JFrame{

    JLabel label;
    JMenu Add;
    JMenu remove;
    JMenu items;
    JMenu vendors;
    JMenuBar menuBar;
    JMenuItem addCustomer;
    JMenuItem addVendors;
    JMenuItem addProducts;
    JMenuItem removeCustomer;
    JMenuItem removeProduct;
    JMenuItem removeVendor;

    MyFrame(){
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setLayout(new FlowLayout());

        label = new JLabel("Inventory Software");
        label.setFont(new Font("Comic Sans MS", Font.BOLD, 30));

        menuBar = new JMenuBar();

        Add = new JMenu("Add");
        remove = new JMenu("Edit");
        items = new JMenu("Items");
        vendors = new JMenu("Vendors");

        addCustomer = new JMenuItem("Add Customers");
        addVendors = new JMenuItem("Add Vendors");
        addProducts = new JMenuItem("Add Products");

        removeCustomer = new JMenuItem("Edit Customer");
        removeProduct = new JMenuItem("Edit Product");
        removeVendor = new JMenuItem("Edit Vendor");

        remove.add(removeCustomer);
        remove.add(removeProduct);
        remove.add(removeVendor);

        Add.add(addCustomer);
        Add.add(addProducts);
        Add.add(addVendors);

        menuBar.add(Add);
        menuBar.add(remove);
        menuBar.add(items);
        menuBar.add(vendors);

        addCustomer.addActionListener(new WindowAC());
        addVendors.addActionListener(new WindowAV());
        addProducts.addActionListener(new WindowAP());
        removeCustomer.addActionListener(new WindowRC());
        removeVendor.addActionListener(new WindowRV());
        removeProduct.addActionListener(new WindowRP());

        this.setPreferredSize(new Dimension(550, 300));
        this.setJMenuBar(menuBar);
        this.add(label);
        this.pack();
        this.setVisible(true);
        this.getContentPane().setBackground(Color.WHITE);
        this.setLocationRelativeTo(null);
        this.setTitle("Intact Communications Inventory Software");
    }
}
</code>```

This is my code to edit my customers in my JTable and update them in my database:

```<code>package com.company;

import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.*;

public class WindowRC implements ActionListener {
    public void actionPerformed(ActionEvent e) {
        if ("Edit Customer".equals(e.getActionCommand())) {
            JFrame windowRC = new JFrame();
            JTable table = new JTable();
            JButton button = new JButton("Update Database");

            table.setBounds(268, 52, 283, 198);
            button.setBounds(350, 180, 100, 60);
            button.setFocusable(false);

            windowRC.add(button);
            windowRC.add(new JScrollPane(table));

            windowRC.setSize(750, 750);
            windowRC.getContentPane().setBackground(Color.WHITE);
            windowRC.setTitle("Remove Product Data");
            windowRC.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            windowRC.setVisible(true);
            windowRC.setLocationRelativeTo(null);

            try {
                Class.forName("com.mysql.cj.jdbc.Driver");
                Connection con = DriverManager.getConnection("jdbc:mysql://localhost/inventoryapp", "root", "P@kist@n1");
                Statement st = con.createStatement();
                String query = "SELECT * from addcustomer";
                ResultSet rs = st.executeQuery(query);
                ResultSetMetaData rsmd = rs.getMetaData();
                DefaultTableModel model = (DefaultTableModel) table.getModel();

                int cols = rsmd.getColumnCount();
                String[] colName = new String[cols];
                for (int i = 0; i < cols; i++)
                    colName[i] = rsmd.getColumnName(i + 1);
                model.setColumnIdentifiers(colName);

                String name, address, email, tel, fax;

                while (rs.next()) {
                    name = rs.getString(1);
                    address = rs.getString(2);
                    email = rs.getString(3);
                    tel = rs.getString(4);
                    fax = rs.getString(5);

                    String[] row = {name, address, email, tel, fax};
                    model.addRow(row);
                }
            } catch (ClassNotFoundException | SQLException classNotFoundException) {
                classNotFoundException.printStackTrace();
            }

            if ("Update Database".equals(e.getActionCommand()))
                System.out.println("Update happening!!!");
                button.addActionListener(new ActionListener() {
                    private Object Component;

                    @Override
                    public void actionPerformed(ActionEvent e1) {
                        try {
                            Class.forName("com.mysql.cj.jdbc.Driver");
                            Connection con = DriverManager.getConnection("jdbc:mysql://localhost/inventoryapp", "root", "P@kist@n1");
                            Statement st = con.createStatement();
                            DefaultTableModel model = (DefaultTableModel) table.getModel();
                            int row = table.getSelectedRow();

                            for (int i = 0; i < model.getRowCount(); i++) {
                                String name = (model.getValueAt(i, 0).toString());
                                String address = model.getValueAt(i, 1).toString();
                                String email = model.getValueAt(i, 2).toString();
                                String tel = model.getValueAt(i, 3).toString();
                                String fax = model.getValueAt(i, 4).toString();

                                PreparedStatement updateQuery = con.prepareStatement("UPDATE addcustomer" + "SET Name = ?" + "WHERE Name = ? "+ row);

                                updateQuery.setString(0,name);
                                updateQuery.setString(1,address);
                                updateQuery.setString(2,email);
                                updateQuery.setString(3,tel);
                                updateQuery.setString(4,fax);

                                updateQuery.executeUpdate();

                                st.close();
                                con.close();

                       JOptionPane.showMessageDialog((java.awt.Component) Component, "Data Edited");
                            }
                        } catch (ClassNotFoundException | SQLException classNotFoundException) {
                            classNotFoundException.printStackTrace();
                        }
                    }
                });
        }
    }
}
</code>```

I tried multiple different UPDATE statements, but each time I would get an error or it won't update my database that I connected to.

Body:
I want to be able to update my MySQL database through user insertion in a JTable where I display my database, but based off my code right now I get a error:

java.sql.SQLException: Parameter index out of range (0 < 1 )

This error occurs when I click my button to update the database.

This is my main class:

public class Main{
    public static void main(String[] args) {
        new MyFrame();
    }
}

This is my class for my main menu:

package com.company;

import javax.swing.*;
import java.awt.*;

public class MyFrame extends JFrame{

    JLabel label;
    JMenu Add;
    JMenu remove;
    JMenu items;
    JMenu vendors;
    JMenuBar menuBar;
    JMenuItem addCustomer;
    JMenuItem addVendors;
    JMenuItem addProducts;
    JMenuItem removeCustomer;
    JMenuItem removeProduct;
    JMenuItem removeVendor;

    MyFrame(){
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setLayout(new FlowLayout());

        label = new JLabel("Inventory Software");
        label.setFont(new Font("Comic Sans MS", Font.BOLD, 30));

        menuBar = new JMenuBar();

        Add = new JMenu("Add");
        remove = new JMenu("Edit");
        items = new JMenu("Items");
        vendors = new JMenu("Vendors");

        addCustomer = new JMenuItem("Add Customers");
        addVendors = new JMenuItem("Add Vendors");
        addProducts = new JMenuItem("Add Products");

        removeCustomer = new JMenuItem("Edit Customer");
        removeProduct = new JMenuItem("Edit Product");
        removeVendor = new JMenuItem("Edit Vendor");

        remove.add(removeCustomer);
        remove.add(removeProduct);
        remove.add(removeVendor);

        Add.add(addCustomer);
        Add.add(addProducts);
        Add.add(addVendors);

        menuBar.add(Add);
        menuBar.add(remove);
        menuBar.add(items);
        menuBar.add(vendors);

        addCustomer.addActionListener(new WindowAC());
        addVendors.addActionListener(new WindowAV());
        addProducts.addActionListener(new WindowAP());
        removeCustomer.addActionListener(new WindowRC());
        removeVendor.addActionListener(new WindowRV());
        removeProduct.addActionListener(new WindowRP());

        this.setPreferredSize(new Dimension(550, 300));
        this.setJMenuBar(menuBar);
        this.add(label);
        this.pack();
        this.setVisible(true);
        this.getContentPane().setBackground(Color.WHITE);
        this.setLocationRelativeTo(null);
        this.setTitle("Intact Communications Inventory Software");
    }
}

This is my code to edit my customers in my JTable and update them in my database:

package com.company;

import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.*;

public class WindowRC implements ActionListener {
    public void actionPerformed(ActionEvent e) {
        if ("Edit Customer".equals(e.getActionCommand())) {
            JFrame windowRC = new JFrame();
            JTable table = new JTable();
            JButton button = new JButton("Update Database");

            table.setBounds(268, 52, 283, 198);
            button.setBounds(350, 180, 100, 60);
            button.setFocusable(false);

            windowRC.add(button);
            windowRC.add(new JScrollPane(table));

            windowRC.setSize(750, 750);
            windowRC.getContentPane().setBackground(Color.WHITE);
            windowRC.setTitle("Remove Product Data");
            windowRC.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            windowRC.setVisible(true);
            windowRC.setLocationRelativeTo(null);

            try {
                Class.forName("com.mysql.cj.jdbc.Driver");
                Connection con = DriverManager.getConnection("jdbc:mysql://localhost/inventoryapp", "root", "P@kist@n1");
                Statement st = con.createStatement();
                String query = "SELECT * from addcustomer";
                ResultSet rs = st.executeQuery(query);
                ResultSetMetaData rsmd = rs.getMetaData();
                DefaultTableModel model = (DefaultTableModel) table.getModel();

                int cols = rsmd.getColumnCount();
                String[] colName = new String[cols];
                for (int i = 0; i < cols; i++)
                    colName[i] = rsmd.getColumnName(i + 1);
                model.setColumnIdentifiers(colName);

                String name, address, email, tel, fax;

                while (rs.next()) {
                    name = rs.getString(1);
                    address = rs.getString(2);
                    email = rs.getString(3);
                    tel = rs.getString(4);
                    fax = rs.getString(5);

                    String[] row = {name, address, email, tel, fax};
                    model.addRow(row);
                }
            } catch (ClassNotFoundException | SQLException classNotFoundException) {
                classNotFoundException.printStackTrace();
            }

            if ("Update Database".equals(e.getActionCommand()))
                System.out.println("Update happening!!!");
                button.addActionListener(new ActionListener() {
                    private Object Component;

                    @Override
                    public void actionPerformed(ActionEvent e1) {
                        try {
                            Class.forName("com.mysql.cj.jdbc.Driver");
                            Connection con = DriverManager.getConnection("jdbc:mysql://localhost/inventoryapp", "root", "P@kist@n1");
                            Statement st = con.createStatement();
                            DefaultTableModel model = (DefaultTableModel) table.getModel();
                            int row = table.getSelectedRow();

                            for (int i = 0; i < model.getRowCount(); i++) {
                                String name = (model.getValueAt(i, 0).toString());
                                String address = model.getValueAt(i, 1).toString();
                                String email = model.getValueAt(i, 2).toString();
                                String tel = model.getValueAt(i, 3).toString();
                                String fax = model.getValueAt(i, 4).toString();

                                PreparedStatement updateQuery = con.prepareStatement("UPDATE addcustomer" + "SET Name = ?" + "WHERE Name = ? "+ row);

                                updateQuery.setString(0,name);
                                updateQuery.setString(1,address);
                                updateQuery.setString(2,email);
                                updateQuery.setString(3,tel);
                                updateQuery.setString(4,fax);

                                updateQuery.executeUpdate();

                                st.close();
                                con.close();

                       JOptionPane.showMessageDialog((java.awt.Component) Component, "Data Edited");
                            }
                        } catch (ClassNotFoundException | SQLException classNotFoundException) {
                            classNotFoundException.printStackTrace();
                        }
                    }
                });
        }
    }
}

I tried multiple different UPDATE statements, but each time I would get an error or it won't update my database that I connected to.


来源: stackexchange

问:
How to search for matches from an array of pairs for a certain number of rows in a ListBox?
enter image description hereI want to write a program to analyze the lottery. I want to implement Visual Basic.NET in ListBox. The base of circulations in ListBox will look like this:
1344 - 03 34 12 02 45 21
1345 - 33 10 06 18 19 02
1346 - 39 01 15 27 04 19
I want to make a filter to search for pairs, triplets and units dropped out for a certain number of runs. I thought to implement this through For and then, but I don’t know how to implement such an algorithm. Filtering settings for how many runs I want to search for through NumericUpDown, so that you can change the search conditions. I would be very grateful for your help!</p>

ContentLicense: CC BY-SA 4.0


问:
How to add URL args depending on content in NextJS React web app?
I have a NextJS web app where I'd like to update the current URL without reloading the page.

In NextJS, I've looked doing the following but this will count as another reload:

```<code>import { useRouter } from "next/router"

export default function Home() {
  const router = useRouter()

  console.log("Reload")

  return (
    <button onClick={() => router.push('/home?key1=value1')}>Click</button>
  )
}
</code>```

Ideally, I'd like to have a user navigate to localhost:3000 and given some actions taken on the page, the URL will update with values such as localhost:3000?key1=value1.

Body:
I have a NextJS web app where I'd like to update the current URL without reloading the page.

In NextJS, I've looked doing the following but this will count as another reload:

import { useRouter } from "next/router"

export default function Home() {
  const router = useRouter()

  console.log("Reload")

  return (
    <button onClick={() => router.push('/home?key1=value1')}>Click</button>
  )
}

Ideally, I'd like to have a user navigate to localhost:3000 and given some actions taken on the page, the URL will update with values such as localhost:3000?key1=value1.


问:
Incremental data mapping
How can we efficiently load the data from an incremental CSV file without reading the whole file repetitively?

I have used the timestamp information from the given file to load the data in every 5 minutes but in case the timestamp information is not available how can we make it work?

Title: Incremental data mapping


问:
time format in spring boot
Spring is returning a different time format in swagger from what I have in MYSQL database. I don't know what I did wrongly.
I need help on how to solve it.
I think that my db and the project is not using the same time zone and I don't know how to fix it</p>
```<code>                model class
                @Entity
                @NoArgsConstructor
                @Data
                public class TransactionType {

                    @Id
                    @GeneratedValue(strategy = GenerationType.IDENTITY)
                    private Long id;
                    private Date transactionDate;
                    private double amount;
                    private double currentBalance;
                    private String transactionType;
                    private String description;
                    private String depositorOrWithDrawalName;
                    @ManyToOne
                    @JoinColumn(name = "account_id")
                    private BankAccount bankAccount;
                }

                I have this method that save the information in my Service

                public ResponseEntity<TransactionResponse> deposit(TransactionTypeDto transactionTypeDto, String accountNumber) throws DataNotFoundException, DataNotAcceptableException {
                        BankAccount bankAccount = bankAccountService.getAccountByAccountNumber(accountNumber);
                        double currentBalance = bankAccount.getCurrentBalance();
                        TransactionType transactionType = new TransactionType();
                        if (transactionTypeDto.getAmount()<=0){
                            throw new DataNotAcceptableException("Amount must be greater than zero");
                        }
                        double newBalance = currentBalance+transactionTypeDto.getAmount();
                        transactionType.setAmount(transactionTypeDto.getAmount());
                        transactionType.setBankAccount(bankAccount);
                        transactionType.setCurrentBalance(newBalance);
                        transactionType.setTransactionType("CREDIT");
                        transactionType.setTransactionDate(new Date());
                        transactionType.setDescription(transactionTypeDto.getDescription());
                        transactionType.setDepositorOrWithDrawalName(transactionTypeDto.getDepositorOrWithDrawalName());
                        bankAccountService.updateAccountBalance(bankAccount,newBalance,accountNumber);
                        transactionTypeRepository.save(transactionType);
                        return new ResponseEntity<>(new TransactionResponse("Deposit","Successful","Your Account "+bankAccount.getAccountNumber()+
                                " has been credited with "+transactionTypeDto.getAmount()+" at "+transactionType.getTransactionDate()+" by " +
                                transactionTypeDto.getDepositorOrWithDrawalName()+", your current balance is #"+newBalance), HttpStatus.OK);
                    }

                this is the date in MYSQL database and it's the correct time
                2022-12-25 04:09:30
                but when I retrieved the information in swagger, I got this as the time.
                "transactionDate": "2022-12-25T04:09:30.000+00:00",

</code>```

Title: time format in spring boot

Body:
Spring is returning a different time format in swagger from what I have in MYSQL database. I don't know what I did wrongly.
I need help on how to solve it.
I think that my db and the project is not using the same time zone and I don't know how to fix it

                model class
                @Entity
                @NoArgsConstructor
                @Data
                public class TransactionType {

                    @Id
                    @GeneratedValue(strategy = GenerationType.IDENTITY)
                    private Long id;
                    private Date transactionDate;
                    private double amount;
                    private double currentBalance;
                    private String transactionType;
                    private String description;
                    private String depositorOrWithDrawalName;
                    @ManyToOne
                    @JoinColumn(name = "account_id")
                    private BankAccount bankAccount;
                }

                I have this method that save the information in my Service

                public ResponseEntity<TransactionResponse> deposit(TransactionTypeDto transactionTypeDto, String accountNumber) throws DataNotFoundException, DataNotAcceptableException {
                        BankAccount bankAccount = bankAccountService.getAccountByAccountNumber(accountNumber);
                        double currentBalance = bankAccount.getCurrentBalance();
                        TransactionType transactionType = new TransactionType();
                        if (transactionTypeDto.getAmount()<=0){
                            throw new DataNotAcceptableException("Amount must be greater than zero");
                        }
                        double newBalance = currentBalance+transactionTypeDto.getAmount();
                        transactionType.setAmount(transactionTypeDto.getAmount());
                        transactionType.setBankAccount(bankAccount);
                        transactionType.setCurrentBalance(newBalance);
                        transactionType.setTransactionType("CREDIT");
                        transactionType.setTransactionDate(new Date());
                        transactionType.setDescription(transactionTypeDto.getDescription());
                        transactionType.setDepositorOrWithDrawalName(transactionTypeDto.getDepositorOrWithDrawalName());
                        bankAccountService.updateAccountBalance(bankAccount,newBalance,accountNumber);
                        transactionTypeRepository.save(transactionType);
                        return new ResponseEntity<>(new TransactionResponse("Deposit","Successful","Your Account "+bankAccount.getAccountNumber()+
                                " has been credited with "+transactionTypeDto.getAmount()+" at "+transactionType.getTransactionDate()+" by " +
                                transactionTypeDto.getDepositorOrWithDrawalName()+", your current balance is #"+newBalance), HttpStatus.OK);
                    }

                this is the date in MYSQL database and it's the correct time
                2022-12-25 04:09:30
                but when I retrieved the information in swagger, I got this as the time.
                "transactionDate": "2022-12-25T04:09:30.000+00:00",


问:
While making a Weather app in Android Studio using Java. Its not fetching data from API, it always execute 'onErrorResponse(VolleyError error)' method
I am trying to fetch weather details from weatherapi using Volley for JSON parsing but my code isn't fetching weather details instead it's executing the below code :

```<code>new Response.ErrorListener() {
    @Override
    public void onErrorResponse(VolleyError error) {
        Toast.makeText(MainActivity.this, "Please enter valid city name...", Toast.LENGTH_SHORT).show();
    }
}
</code>```

This is the code(below) I used to fetch weather details from API but becoz of some error that is unknown to me it is executing onErrorResponse() method.

```<code>private void getWeatherInfo(String cityName){

    String url = "http://api.weatherapi.com/v1/forecast.json?key=API_KEY&q="+cityName+"&days=1&aqi=no&alerts=no";
    cityNameTV.setText(cityName);
    RequestQueue requestQueue = Volley.newRequestQueue(MainActivity.this);

    JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() {
        @Override
        public void onResponse(JSONObject response) {
            loadingPB.setVisibility(View.GONE);
            homeRL.setVisibility(View.VISIBLE);
            weatherRVModalArrayList.clear();

            try {
                String temperature = response.getJSONObject("current").getString("temp_c");
                temperatureTV.setText(temperature+"°c");
                int isDay = response.getJSONObject("current").getInt("is_day");
                String condition = response.getJSONObject("current").getJSONObject("condition").getString("text"); //returns the condition of the day mist or sunny or rainy etc
                String conditionIcon = response.getJSONObject("current").getJSONObject("condition").getString("icon");
                Picasso.get().load("http:".concat(conditionIcon)).into(iconIV); //here we are loading the icon in IconImage View
                conditionTV.setText(condition);
                if(isDay==1){

                    Picasso.get().load("https://cdn.dribbble.com/users/925716/screenshots/3333720/attachments/722376/after_noon.png").into(backIV);

                }
                else{
                    Picasso.get().load("https://cdn.dribbble.com/users/925716/screenshots/3333720/attachments/722375/night.png").into(backIV);

                }

                JSONObject forecastObj = response.getJSONObject("forecast");
                JSONObject forecastO = forecastObj.getJSONArray("forecastday").getJSONObject(0);
                JSONArray hourArray = forecastO.getJSONArray("hour");

                for(int i=0; i<hourArray.length(); i++){
                    JSONObject hourObj = hourArray.getJSONObject(i);
                    String time = hourObj.getString("time");
                    String temper = hourObj.getString("temp_c");
                    String img = hourObj.getJSONObject("condition").getString("icon");
                    String wind = hourObj.getString("wind_kph");
                    weatherRVModalArrayList.add(new WeatherRVModal(time, temper, img, wind));

                }
                weatherRVAdapter.notifyDataSetChanged();

            } catch (JSONException e) {
                e.printStackTrace();
            }
        }
    }, new Response.ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {
            Toast.makeText(MainActivity.this, "Please enter valid city name...", Toast.LENGTH_SHORT).show();
        }
    });

    requestQueue.add(jsonObjectRequest);
}
</code>```

Let me know if more details are required regarding this.

Body:
I am trying to fetch weather details from weatherapi using Volley for JSON parsing but my code isn't fetching weather details instead it's executing the below code :

new Response.ErrorListener() {
    @Override
    public void onErrorResponse(VolleyError error) {
        Toast.makeText(MainActivity.this, "Please enter valid city name...", Toast.LENGTH_SHORT).show();
    }
}

This is the code(below) I used to fetch weather details from API but becoz of some error that is unknown to me it is executing onErrorResponse() method.

private void getWeatherInfo(String cityName){

    String url = "http://api.weatherapi.com/v1/forecast.json?key=API_KEY&q="+cityName+"&days=1&aqi=no&alerts=no";
    cityNameTV.setText(cityName);
    RequestQueue requestQueue = Volley.newRequestQueue(MainActivity.this);

    JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() {
        @Override
        public void onResponse(JSONObject response) {
            loadingPB.setVisibility(View.GONE);
            homeRL.setVisibility(View.VISIBLE);
            weatherRVModalArrayList.clear();

            try {
                String temperature = response.getJSONObject("current").getString("temp_c");
                temperatureTV.setText(temperature+"°c");
                int isDay = response.getJSONObject("current").getInt("is_day");
                String condition = response.getJSONObject("current").getJSONObject("condition").getString("text"); //returns the condition of the day mist or sunny or rainy etc
                String conditionIcon = response.getJSONObject("current").getJSONObject("condition").getString("icon");
                Picasso.get().load("http:".concat(conditionIcon)).into(iconIV); //here we are loading the icon in IconImage View
                conditionTV.setText(condition);
                if(isDay==1){

                    Picasso.get().load("https://cdn.dribbble.com/users/925716/screenshots/3333720/attachments/722376/after_noon.png").into(backIV);

                }
                else{
                    Picasso.get().load("https://cdn.dribbble.com/users/925716/screenshots/3333720/attachments/722375/night.png").into(backIV);

                }

                JSONObject forecastObj = response.getJSONObject("forecast");
                JSONObject forecastO = forecastObj.getJSONArray("forecastday").getJSONObject(0);
                JSONArray hourArray = forecastO.getJSONArray("hour");

                for(int i=0; i<hourArray.length(); i++){
                    JSONObject hourObj = hourArray.getJSONObject(i);
                    String time = hourObj.getString("time");
                    String temper = hourObj.getString("temp_c");
                    String img = hourObj.getJSONObject("condition").getString("icon");
                    String wind = hourObj.getString("wind_kph");
                    weatherRVModalArrayList.add(new WeatherRVModal(time, temper, img, wind));

                }
                weatherRVAdapter.notifyDataSetChanged();

            } catch (JSONException e) {
                e.printStackTrace();
            }
        }
    }, new Response.ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {
            Toast.makeText(MainActivity.this, "Please enter valid city name...", Toast.LENGTH_SHORT).show();
        }
    });

    requestQueue.add(jsonObjectRequest);
}

Let me know if more details are required regarding this.


问:
SMF Forum Special character issues: Mixed database latin1 + utf8
I recently recovered from a backup an SMF forum which has half its database in latin1 and the other half in utf8 encoding.

I edit Settings.php

```<code>'''
Code Select
######### Legacy Settings #########
# UTF-8 is now the only character set supported in 2.1.
$db_character_set = 'utf8';
'''
</code>```

Half the forum displays fine

and

```<code>''''
Code Select
######### Legacy Settings #########
# UTF-8 is now the only character set supported in 2.1.
$db_character_set = 'latin1';
''''
</code>```

The other half.

I've tried fixing this on phpmyadmin but failed.

Body:
I recently recovered from a backup an SMF forum which has half its database in latin1 and the other half in utf8 encoding.

I edit Settings.php

'''
Code Select
######### Legacy Settings #########
# UTF-8 is now the only character set supported in 2.1.
$db_character_set = 'utf8';
'''

Half the forum displays fine

and

''''
Code Select
######### Legacy Settings #########
# UTF-8 is now the only character set supported in 2.1.
$db_character_set = 'latin1';
''''

The other half.

I've tried fixing this on phpmyadmin but failed.


问:
Does flurry still be supported in CN1?
I installed the flurry extension and sent my app to the cn1 iOS App store build.

Failed to build it with the errors:

```<code>/Objects-normal/armv7/native_com_codename1_flurry_FlurryNativeImplCodenameOne.o native_com_codename1_flurry_FlurryNativeImplCodenameOne.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
</code>```

Title: Does flurry still be supported in CN1?

Body:
I installed the flurry extension and sent my app to the cn1 iOS App store build.

Failed to build it with the errors:

/Objects-normal/armv7/native_com_codename1_flurry_FlurryNativeImplCodenameOne.o native_com_codename1_flurry_FlurryNativeImplCodenameOne.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler


问:
Error response from daemon: failed to add IPv4 address 172.18.0.1/16 to bridge: file exists
When running with docker compose up to run my docker, it complaints that "Failed to add IPv4 address 172.18.0.1/16 to bridge: file exists":

enter image description here

docker-compose.yml:

enter image description here

Restart the docker with service docker restart but lead to the same result.


问:
Java Spring Generic: Application context getBean -> unchecked assignment
Small question regarding Java Spring and Generic please.

I have a very straightforward interface as such:

```<code>public interface MyInterface<T> {

    <S extends T> Mono<S> save(S entity);

}
</code>```

With some classes implementing it:

```<code>@Repository("redis")
public class MyRedisRepository implements MyInterface<MyPojo> {

@Override
    public <S extends MyPojo> Mono<S> save(S entity) {
        return reactiveRedisOperations.opsForValue().set("someKey", entity.getValue()).map(__ -> entity);
    }
</code>```

And in my code, I am trying to get the correct bean as such:

```<code>final MyInterface<MyPojo> myInterface = applicationContext.getBean("redis", MyInterface.class);
</code>```

While I am able to get the correct bean, there is 100% of the time the warning on applicationContext.getBean Unchecked assignment 'MyInterface' to 'MyInterface<MyPojo>'

Is there a way I can get the bean as 'MyInterface' please?

Thank you

Body:
Small question regarding Java Spring and Generic please.

I have a very straightforward interface as such:

public interface MyInterface<T> {

    <S extends T> Mono<S> save(S entity);

}

With some classes implementing it:

@Repository("redis")
public class MyRedisRepository implements MyInterface<MyPojo> {

@Override
    public <S extends MyPojo> Mono<S> save(S entity) {
        return reactiveRedisOperations.opsForValue().set("someKey", entity.getValue()).map(__ -> entity);
    }

And in my code, I am trying to get the correct bean as such:

final MyInterface<MyPojo> myInterface = applicationContext.getBean("redis", MyInterface.class);

While I am able to get the correct bean, there is 100% of the time the warning on applicationContext.getBean Unchecked assignment 'MyInterface' to 'MyInterface<MyPojo>'

Is there a way I can get the bean as 'MyInterface' please?

Thank you


问:
Can't update docker containers with watchtower . "No basic auth credentials."
I have an EC2 Ubuntu 22.04.1 LTS (Jammy Jellyfish)" which should pull from AWS ECR, replace and restart running docker container whenever there is a new image in ECR.
I found Watchtower for that and tried to configure it, but it didn't work out so far.
It pulls and runs the container only once. For the second attempt it returns error "No basic auth credentials."
Can anyone help or suggest another simple tool to update containers automatically?

I used dockerfile with test ubuntu image and sleep command:

```<code>$ cat Dockerfile
FROM ubuntu
RUN echo "Hi there!"
CMD sleep 2500
</code>```

and my docker-compose.yml file now looks like this. Where ****** is aws account id.

```<code>$ cat docker-compose.yml
version: "3"
services:
  ubuntu:
    image: ******.dkr.ecr.us-east-1.amazonaws.com/mytest:latest
    container_name: mytest

  watchtower:
    image: containrrr/watchtower
    container_name: watchtower
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - .docker/config.json:/home/administrator/.docker/config.json
      - helper:/go/bin
    environment:
      - HOME=/
      - PATH=$PATH:/go/bin
      - AWS_REGION=us-east-1
    command: ['mytest','--schedule','30 * * * * *']
volumes:
  helper:
    external: true
</code>```

My ~/.docker/config.json :

```<code>$ cat ~/.docker/config.json
{
        "credsStore" : "ecr-login",
        "HttpHeaders" : {
        "User-Agent" : "Docker-Client/19.03.1 (XXXXXX)"
        },
        "auths": {
                "******.dkr.ecr.us-east-1.amazonaws.com": {
                        "auth": "Lot of random letters"
                }
        },
        "credHelpers": {
        "******.dkr.ecr.us-east-1.amazonaws.com" : "ecr-login"
        }
}
</code>```

I have installed docker-credential-ecr-login and put it in /go/bin/

```<code>$ ls /go/bin/
docker-credential-ecr-login
</code>```

When I run docker-compose up -d it pulls the image and starts the container normally, but then it can't lookup in the registry for the second time with error: no basic auth credentials
Watchtower logs:

```<code>$ docker logs 27238edee0b1
time="2022-12-24T03:44:02Z" level=info msg="Watchtower 1.5.1"
time="2022-12-24T03:44:02Z" level=info msg="Using no notifications"
time="2022-12-24T03:44:02Z" level=info msg="Only checking containers which name matches \"mytest\""
time="2022-12-24T03:44:02Z" level=info msg="Scheduling first run: 2022-12-24 03:44:30 +0000 UTC"
time="2022-12-24T03:44:02Z" level=info msg="Note that the first check will be performed in 27 seconds"
time="2022-12-24T03:44:30Z" level=info msg="Unable to update container \"/mytest\": Error response from daemon: Head \"https://******.dkr.ecr.us-east-1.amazonaws.com/v2/mytest/manifests/latest\": no basic auth credentials. Proceeding to next."
time="2022-12-24T03:44:30Z" level=info msg="Session done" Failed=0 Scanned=1 Updated=0 notify=no
</code>```

What I've tried:

I Followed instructions from https://containrrr.dev/watchtower/private-registries/

I googled and tried to use suggestions

Updated aws cli to latest aws-cli/2.9.9  as suggested here https://github.com/awslabs/amazon-ecr-credential-helper/issues/76

tried manipulations with  ~/.docker/config.json :

```<code>{
    "credsStore": "ecr-login"
}

</code>```

then

```<code>{
    "auths": {
        "000000000000.dkr.ecr.us-east-1.amazonaws.com": {}
    },
    "credsStore": "ecr-login"
}
</code>```

tried removing ~/.docker/config.json and doing and doing aws ecr get-login-password --region eu-central-1 | docker login --username AWS --password-stdin ******.dkr.ecr.eu-central-1.amazonaws.com  as suggested here  https://jhooq.com/aws-ecr-docker-login-error-credential/

tried using both -- interval or schedule options

Body:
I have an EC2 Ubuntu 22.04.1 LTS (Jammy Jellyfish)" which should pull from AWS ECR, replace and restart running docker container whenever there is a new image in ECR.
I found Watchtower for that and tried to configure it, but it didn't work out so far.
It pulls and runs the container only once. For the second attempt it returns error "No basic auth credentials."
Can anyone help or suggest another simple tool to update containers automatically?

I used dockerfile with test ubuntu image and sleep command:

$ cat Dockerfile
FROM ubuntu
RUN echo "Hi there!"
CMD sleep 2500

and my docker-compose.yml file now looks like this. Where ****** is aws account id.

$ cat docker-compose.yml
version: "3"
services:
  ubuntu:
    image: ******.dkr.ecr.us-east-1.amazonaws.com/mytest:latest
    container_name: mytest

  watchtower:
    image: containrrr/watchtower
    container_name: watchtower
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - .docker/config.json:/home/administrator/.docker/config.json
      - helper:/go/bin
    environment:
      - HOME=/
      - PATH=$PATH:/go/bin
      - AWS_REGION=us-east-1
    command: ['mytest','--schedule','30 * * * * *']
volumes:
  helper:
    external: true

My ~/.docker/config.json :

$ cat ~/.docker/config.json
{
        "credsStore" : "ecr-login",
        "HttpHeaders" : {
        "User-Agent" : "Docker-Client/19.03.1 (XXXXXX)"
        },
        "auths": {
                "******.dkr.ecr.us-east-1.amazonaws.com": {
                        "auth": "Lot of random letters"
                }
        },
        "credHelpers": {
        "******.dkr.ecr.us-east-1.amazonaws.com" : "ecr-login"
        }
}

I have installed docker-credential-ecr-login and put it in /go/bin/

$ ls /go/bin/
docker-credential-ecr-login

When I run docker-compose up -d it pulls the image and starts the container normally, but then it can't lookup in the registry for the second time with error: no basic auth credentials
Watchtower logs:

$ docker logs 27238edee0b1
time="2022-12-24T03:44:02Z" level=info msg="Watchtower 1.5.1"
time="2022-12-24T03:44:02Z" level=info msg="Using no notifications"
time="2022-12-24T03:44:02Z" level=info msg="Only checking containers which name matches \"mytest\""
time="2022-12-24T03:44:02Z" level=info msg="Scheduling first run: 2022-12-24 03:44:30 +0000 UTC"
time="2022-12-24T03:44:02Z" level=info msg="Note that the first check will be performed in 27 seconds"
time="2022-12-24T03:44:30Z" level=info msg="Unable to update container \"/mytest\": Error response from daemon: Head \"https://******.dkr.ecr.us-east-1.amazonaws.com/v2/mytest/manifests/latest\": no basic auth credentials. Proceeding to next."
time="2022-12-24T03:44:30Z" level=info msg="Session done" Failed=0 Scanned=1 Updated=0 notify=no

What I've tried:

I Followed instructions from https://containrrr.dev/watchtower/private-registries/

I googled and tried to use suggestions

Updated aws cli to latest aws-cli/2.9.9  as suggested here https://github.com/awslabs/amazon-ecr-credential-helper/issues/76

tried manipulations with  ~/.docker/config.json :

{
    "credsStore": "ecr-login"
}

then

{
    "auths": {
        "000000000000.dkr.ecr.us-east-1.amazonaws.com": {}
    },
    "credsStore": "ecr-login"
}

tried removing ~/.docker/config.json and doing and doing aws ecr get-login-password --region eu-central-1 | docker login --username AWS --password-stdin ******.dkr.ecr.eu-central-1.amazonaws.com  as suggested here  https://jhooq.com/aws-ecr-docker-login-error-credential/

tried using both -- interval or schedule options


问:
Android Server Socket Chat App Java.net.BindException: bind failed: EADDRINUSE
It is single activity app, user is given 2 options "server" or "client" if user selects server then screen gives 2 fields port and username and then when clicked connect it waits on that screen until a client connects then it moves to chat screen.

I am creating a client server socket chat app in android. Below is my connect button code. When I run the app it gives Java.net.BindException

function is passed viewModel and navHostController, onStatusChanged changes text on button.

```<code>        fun onConnectClicked(
            viewModel: AppViewModel,
            navHostController: NavHostController
        ) {
            if (_ip.value.isNullOrBlank()) {
                // Server
                CoroutineScope(Dispatchers.IO).launch {
                    try {
                        server = ServerSocket(port.value!!.toInt())
                        CoroutineScope(Dispatchers.Main).launch {
                            viewModel.onStatusChanged("The Server is accepting requests")
                        }
                        socket = server!!.accept()
                        CoroutineScope(Dispatchers.Main).launch {
                            viewModel.onStatusChanged("Connection Established with $socket")
                        }
                    } catch (e: Exception) {
                        Log.i("tag", e.toString())
                    }
                }
            }
            else {
                // Client
                CoroutineScope(Dispatchers.Main).launch {
                    try {
                        socket = Socket(ip.value.toString() ,port.value!!.toInt())
                        CoroutineScope(Dispatchers.Main).launch {
                            viewModel.onStatusChanged("Sending request to Server...")
                        }
                        CoroutineScope(Dispatchers.Main).launch{
                            viewModel.onStatusChanged("Connection Established with Server")
                        }
                    }
                    catch (e: BindException) {
                        Log.i("tag",e.toString())
                    }
                }
            }
//        bufferedReader = BufferedReader(InputStreamReader(socket!!.getInputStream()))
//        printWriter = PrintWriter(socket!!.getOutputStream())

            navHostController.navigate(Screen.Chat.route)
        }

</code>```

I am think error is in the coroutine part.

Body:
It is single activity app, user is given 2 options "server" or "client" if user selects server then screen gives 2 fields port and username and then when clicked connect it waits on that screen until a client connects then it moves to chat screen.

I am creating a client server socket chat app in android. Below is my connect button code. When I run the app it gives Java.net.BindException

function is passed viewModel and navHostController, onStatusChanged changes text on button.

        fun onConnectClicked(
            viewModel: AppViewModel,
            navHostController: NavHostController
        ) {
            if (_ip.value.isNullOrBlank()) {
                // Server
                CoroutineScope(Dispatchers.IO).launch {
                    try {
                        server = ServerSocket(port.value!!.toInt())
                        CoroutineScope(Dispatchers.Main).launch {
                            viewModel.onStatusChanged("The Server is accepting requests")
                        }
                        socket = server!!.accept()
                        CoroutineScope(Dispatchers.Main).launch {
                            viewModel.onStatusChanged("Connection Established with $socket")
                        }
                    } catch (e: Exception) {
                        Log.i("tag", e.toString())
                    }
                }
            }
            else {
                // Client
                CoroutineScope(Dispatchers.Main).launch {
                    try {
                        socket = Socket(ip.value.toString() ,port.value!!.toInt())
                        CoroutineScope(Dispatchers.Main).launch {
                            viewModel.onStatusChanged("Sending request to Server...")
                        }
                        CoroutineScope(Dispatchers.Main).launch{
                            viewModel.onStatusChanged("Connection Established with Server")
                        }
                    }
                    catch (e: BindException) {
                        Log.i("tag",e.toString())
                    }
                }
            }
//        bufferedReader = BufferedReader(InputStreamReader(socket!!.getInputStream()))
//        printWriter = PrintWriter(socket!!.getOutputStream())

            navHostController.navigate(Screen.Chat.route)
        }

I am think error is in the coroutine part.


问:
type Queue does not take parameters Queue<Integer> q = new ArrayDeque<>();
```<code>  public static void levelorder(Noden root){
           if(root == null){
               return;
           }
          Queue<Noden> q = new ArrayDeque<>();
           q.add(root);
           q.add(null);
           while(!q.isEmpty()){
               Noden curr = q.remove();
               if(curr==null)
               {
                   System.out.println();
               if(q.isEmpty()){
                   break;
               }else{
                   q.add(null);
               }
               }else{
                   System.out.println(curr.data+" ");
                   if(curr.left!=null){
                       q.add(curr.left);
                   }
                   if(curr.right!=null){
                       q.add(curr.right);
                   }
               }
           }
       }
   }
</code>```

and when i use priorityqueue at the place of queue  throwing nullpointer error

i try to trverse a tree using leveltraversal algorithm
but i stuck!!

Body:
  public static void levelorder(Noden root){
           if(root == null){
               return;
           }
          Queue<Noden> q = new ArrayDeque<>();
           q.add(root);
           q.add(null);
           while(!q.isEmpty()){
               Noden curr = q.remove();
               if(curr==null)
               {
                   System.out.println();
               if(q.isEmpty()){
                   break;
               }else{
                   q.add(null);
               }
               }else{
                   System.out.println(curr.data+" ");
                   if(curr.left!=null){
                       q.add(curr.left);
                   }
                   if(curr.right!=null){
                       q.add(curr.right);
                   }
               }
           }
       }
   }

and when i use priorityqueue at the place of queue  throwing nullpointer error

i try to trverse a tree using leveltraversal algorithm
but i stuck!!


问:
is there a way to pass hoverlabel objects for plotly from holoviews using holoviews Store.add_style_opts
I am trying to get full text of hover displayed using holoviews with plotly backend for plotting. Seems like there is a way to extend holoviews API to directly control the underlying plotting api using  store.add_style_opts() but would like to know if there is a way to mimic fig.update_layout(hoverlabel=dict(namelength = -1)) through holoviews using the  store.add_style_opts()
The following code runs without errors but does not really   do the job of updating plotly figure's layout . I know there is a hooks method to acheive the same functionality but this  extending holoviews api seems more flexible to easily customize details fo display.</p>
```<code>from holoviews import Store

hv.extension('plotly')
Store.add_style_opts(hv.NdOverlay , ['hoverlabel'], backend='plotly')
hv_plot.opts(hoverlabel=dict(namelength = -1)) # show full string in hover label plotly
</code>```

Body:
I am trying to get full text of hover displayed using holoviews with plotly backend for plotting. Seems like there is a way to extend holoviews API to directly control the underlying plotting api using  store.add_style_opts() but would like to know if there is a way to mimic fig.update_layout(hoverlabel=dict(namelength = -1)) through holoviews using the  store.add_style_opts()
The following code runs without errors but does not really   do the job of updating plotly figure's layout . I know there is a hooks method to acheive the same functionality but this  extending holoviews api seems more flexible to easily customize details fo display.

from holoviews import Store

hv.extension('plotly')
Store.add_style_opts(hv.NdOverlay , ['hoverlabel'], backend='plotly')
hv_plot.opts(hoverlabel=dict(namelength = -1)) # show full string in hover label plotly


问:
Customising Categorical axis labels in Bokeh 3 (showing every nth one), or otherwise labeling duration bins sensibly
I have Bokeh histogram plots showing the number of events in duration bins. Basically we're measuring visit durations to a site and they are typically a few minutes, so we've divided the data into 30 second bins labelled like "0:00-0:30", "0:30-1:00", "1:00-1:30" ... etc.

Unfortunately all the labels overlap. I've found rumours tips on how to maybe plot only some of the labels (these are categories but progressive and so it's OK to skip some, like every other one for example).

Now I have found this asked before, numerous times, but the answers all apply to Bokeh versions pre 1.0 and link to pages that are dated and offer solutions that don't work in Bokeh 3. For example:

How to show only evey nth categorical tickers in Bokeh

How to specify n-th ticker for bokeh plot from python side, where n is the number of tickers

Python bokeh show only every second categorical ticker

The tend to link to: http://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html which is not relevant any more.

So I wonder what the Bokeh 3 solution is? Or perhaps there is a non-categorical preference for a histogram binned by durations? Or time of day (I have those too), or month of year, I have those too ... all plotting visit counts in different type of bins. All currently using categorical x values.

As is the wont of our times I tried very hard to solve this with ChatGPT, to no avail, so I asked it write us a poem:

```<code>Oh Bokeh, why must thou be so tough?
With categorical data, we've had enough.
We long to see just every second tick,
But alas, it seems the answer's too quick.

We've tried and tried, but all in vain,
To show just some ticks and hide the rest again.
We've searched high and low, but to no avail,
It seems that this feature is simply unavailable.

We've used CustomJS, tried lists and such,
But still the solution is just out of touch.
It's like we're stuck in a never-ending fight,
With Bokeh, the plotting library of might.

But despite our frustration, we must say,
Bokeh's beauty and power cannot be swayed.
So we'll keep trying, keep pushing on,
Until we find a way to make it dawn.
</code>```

Body:
I have Bokeh histogram plots showing the number of events in duration bins. Basically we're measuring visit durations to a site and they are typically a few minutes, so we've divided the data into 30 second bins labelled like "0:00-0:30", "0:30-1:00", "1:00-1:30" ... etc.

Unfortunately all the labels overlap. I've found rumours tips on how to maybe plot only some of the labels (these are categories but progressive and so it's OK to skip some, like every other one for example).

Now I have found this asked before, numerous times, but the answers all apply to Bokeh versions pre 1.0 and link to pages that are dated and offer solutions that don't work in Bokeh 3. For example:

How to show only evey nth categorical tickers in Bokeh

How to specify n-th ticker for bokeh plot from python side, where n is the number of tickers

Python bokeh show only every second categorical ticker

The tend to link to: http://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html which is not relevant any more.

So I wonder what the Bokeh 3 solution is? Or perhaps there is a non-categorical preference for a histogram binned by durations? Or time of day (I have those too), or month of year, I have those too ... all plotting visit counts in different type of bins. All currently using categorical x values.

As is the wont of our times I tried very hard to solve this with ChatGPT, to no avail, so I asked it write us a poem:

Oh Bokeh, why must thou be so tough?
With categorical data, we've had enough.
We long to see just every second tick,
But alas, it seems the answer's too quick.

We've tried and tried, but all in vain,
To show just some ticks and hide the rest again.
We've searched high and low, but to no avail,
It seems that this feature is simply unavailable.

We've used CustomJS, tried lists and such,
But still the solution is just out of touch.
It's like we're stuck in a never-ending fight,
With Bokeh, the plotting library of might.

But despite our frustration, we must say,
Bokeh's beauty and power cannot be swayed.
So we'll keep trying, keep pushing on,
Until we find a way to make it dawn.


问:
gh command not found, even after installation
I recently have uninstalled Homebrew, as I don't need it anymore, which I previously have installed Github CLI through. I am using WSL2 to re-install Github CLI using the official provided script.

I get no error messages during installation process, however, when I go to use the gh command, I get the following error:

It says it can't find it, where which gh clearly shows it is installed on my system, plus the linuxbrew folder doesn't exist anymore.

Any help to solve this issue would be appreciated!

EDIT: Every time I start a new terminal session, this also happens, if it helps debugging my issue.


问:
Which Jersey version is compatible with Log4j version 2.17.2 and Jdk 1.8?
I am upgrading log4j(from 2.3 --> 2.17.2) version of maven application running on jdk 1.8 and jersey version 1.19 but getting below error

```<code>SEVERE: StandardWrapper.Throwable
java.lang.IllegalArgumentException
    at jersey.repackaged.org.objectweb.asm.ClassReader.<init>(ClassReader.java:170)
    at jersey.repackaged.org.objectweb.asm.ClassReader.<init>(ClassReader.java:153)
    at jersey.repackaged.org.objectweb.asm.ClassReader.<init>(ClassReader.java:424)
    at com.sun.jersey.spi.scanning.AnnotationScannerListener.onProcess(AnnotationScannerListener.java:138)
    at com.sun.jersey.core.spi.scanning.JarFileScanner.scan(JarFileScanner.java:97)
    at com.sun.jersey.spi.scanning.servlet.WebAppResourcesScanner$1.f(WebAppResourcesScanner.java:94)
    at com.sun.jersey.core.util.Closing.f(Closing.java:71)
    at com.sun.jersey.spi.scanning.servlet.WebAppResourcesScanner.scan(WebAppResourcesScanner.java:92)
    at com.sun.jersey.spi.scanning.servlet.WebAppResourcesScanner.scan(WebAppResourcesScanner.java:79)
    at com.sun.jersey.api.core.ScanningResourceConfig.init(ScanningResourceConfig.java:80)
    at com.sun.jersey.api.core.servlet.WebAppResourceConfig.init(WebAppResourceConfig.java:102)
    at com.sun.jersey.api.core.servlet.WebAppResourceConfig.<init>(WebAppResourceConfig.java:89)
    at com.sun.jersey.api.core.servlet.WebAppResourceConfig.<init>(WebAppResourceConfig.java:74)
    at com.sun.jersey.spi.container.servlet.WebComponent.getWebAppResourceConfig(WebComponent.java:668)
    at com.sun.jersey.spi.container.servlet.ServletContainer.getDefaultResourceConfig(ServletContainer.java:435)
    at com.sun.jersey.spi.container.servlet.ServletContainer.getDefaultResourceConfig(ServletContainer.java:602)
    at com.sun.jersey.spi.container.servlet.WebServletConfig.getDefaultResourceConfig(WebServletConfig.java:87)
    at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:699)
    at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:674)
    at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:205)
    at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:394)
    at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:577)
    at javax.servlet.GenericServlet.init(GenericServlet.java:158)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1238)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1151)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1038)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5027)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5337)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1407)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1397)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
</code>```

Can someone help me with what all changes I need to do for successful execution ?

Body:
I am upgrading log4j(from 2.3 --> 2.17.2) version of maven application running on jdk 1.8 and jersey version 1.19 but getting below error

SEVERE: StandardWrapper.Throwable
java.lang.IllegalArgumentException
    at jersey.repackaged.org.objectweb.asm.ClassReader.<init>(ClassReader.java:170)
    at jersey.repackaged.org.objectweb.asm.ClassReader.<init>(ClassReader.java:153)
    at jersey.repackaged.org.objectweb.asm.ClassReader.<init>(ClassReader.java:424)
    at com.sun.jersey.spi.scanning.AnnotationScannerListener.onProcess(AnnotationScannerListener.java:138)
    at com.sun.jersey.core.spi.scanning.JarFileScanner.scan(JarFileScanner.java:97)
    at com.sun.jersey.spi.scanning.servlet.WebAppResourcesScanner$1.f(WebAppResourcesScanner.java:94)
    at com.sun.jersey.core.util.Closing.f(Closing.java:71)
    at com.sun.jersey.spi.scanning.servlet.WebAppResourcesScanner.scan(WebAppResourcesScanner.java:92)
    at com.sun.jersey.spi.scanning.servlet.WebAppResourcesScanner.scan(WebAppResourcesScanner.java:79)
    at com.sun.jersey.api.core.ScanningResourceConfig.init(ScanningResourceConfig.java:80)
    at com.sun.jersey.api.core.servlet.WebAppResourceConfig.init(WebAppResourceConfig.java:102)
    at com.sun.jersey.api.core.servlet.WebAppResourceConfig.<init>(WebAppResourceConfig.java:89)
    at com.sun.jersey.api.core.servlet.WebAppResourceConfig.<init>(WebAppResourceConfig.java:74)
    at com.sun.jersey.spi.container.servlet.WebComponent.getWebAppResourceConfig(WebComponent.java:668)
    at com.sun.jersey.spi.container.servlet.ServletContainer.getDefaultResourceConfig(ServletContainer.java:435)
    at com.sun.jersey.spi.container.servlet.ServletContainer.getDefaultResourceConfig(ServletContainer.java:602)
    at com.sun.jersey.spi.container.servlet.WebServletConfig.getDefaultResourceConfig(WebServletConfig.java:87)
    at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:699)
    at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:674)
    at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:205)
    at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:394)
    at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:577)
    at javax.servlet.GenericServlet.init(GenericServlet.java:158)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1238)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1151)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1038)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5027)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5337)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1407)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1397)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

Can someone help me with what all changes I need to do for successful execution ?


问:
TCPDF to produce same binary output (no realtime dependencies)
I have a server with limited storage. The idea is to store a document as HTML and convert it to PDF only for download purposes, but not store it.

I can create a PDF with TCPDF each time a PDF is needed. The problem arises when this PDF needs also to be digitally signed. For my server, an external web API is used to send a PDF and it returns the signed PDF to my server.

My idea is to have the signed pdf compared with xdiff with the original PDF I created with TCPDF so I can only store the diff in the database, not the entire bulky PDF.

For that to succeed, TCPDF must be able to produce exactly the same output, given similar input. Is there a way to tell TCPDF to not take any real-time dependency (like the current time)?

```<code>function PDFConvert($author,$title,$htmls,$clsid)
{
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', true,false);

$pdf->setHeaderData('',0,'','',array(0,0,0), array(255,255,255) );
$pdf->setFooterData('',0,'','',array(0,0,0), array(255,255,255) );
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);

$pdf->SetCreator($author);
$pdf->SetAuthor($author);
$pdf->SetTitle($title);
$pdf->SetSubject($title);
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->SetKeywords($clsid);
$pdf->SetFont("calibri", '', 12);
$pdf->AddPage();
$pdf->writeHTML($htmls, true, false, true, false, '');
$pdf->lastPage();

$pdfstr = $pdf->Output('1.pdf', 'S');
return $pdfstr;
}
</code>```

Thanks.

Body:
I have a server with limited storage. The idea is to store a document as HTML and convert it to PDF only for download purposes, but not store it.

I can create a PDF with TCPDF each time a PDF is needed. The problem arises when this PDF needs also to be digitally signed. For my server, an external web API is used to send a PDF and it returns the signed PDF to my server.

My idea is to have the signed pdf compared with xdiff with the original PDF I created with TCPDF so I can only store the diff in the database, not the entire bulky PDF.

For that to succeed, TCPDF must be able to produce exactly the same output, given similar input. Is there a way to tell TCPDF to not take any real-time dependency (like the current time)?

function PDFConvert($author,$title,$htmls,$clsid)
{
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', true,false);

$pdf->setHeaderData('',0,'','',array(0,0,0), array(255,255,255) );
$pdf->setFooterData('',0,'','',array(0,0,0), array(255,255,255) );
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);

$pdf->SetCreator($author);
$pdf->SetAuthor($author);
$pdf->SetTitle($title);
$pdf->SetSubject($title);
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->SetKeywords($clsid);
$pdf->SetFont("calibri", '', 12);
$pdf->AddPage();
$pdf->writeHTML($htmls, true, false, true, false, '');
$pdf->lastPage();

$pdfstr = $pdf->Output('1.pdf', 'S');
return $pdfstr;
}

Thanks.


问:
How to pass array values from the terraform to the Helm chart values.yaml file using terraform-provider?
I am using terraform helm provider to pass values to helm values.yaml. I have a json file of field 'test_groups': ['TEST_GROUP_1', 'TEST_GROUP_2']. I am using join function to parse this json and facing an issue with it

set {
  name = "my_test_groups"
  value = "{${join(",", each.value.test_groups)}}"
}
```
<p>My goal is to send this array values to values.yaml file and I am unsure if join is right function to do so. Any suggestions are appreciated</p>
<p>values.yaml</p>
<pre class="lang-yaml prettyprint-override"><code>test_groups: ["TEST_GROUP_1", "TEST_GROUP_2"]
OR
test_groups:
  - TEST_GROUP_1
  - TEST_GROUP_2
</code>```

Body:
I am using terraform helm provider to pass values to helm values.yaml. I have a json file of field 'test_groups': ['TEST_GROUP_1', 'TEST_GROUP_2']. I am using join function to parse this json and facing an issue with it

set {
  name = "my_test_groups"
  value = "{${join(",", each.value.test_groups)}}"
}

My goal is to send this array values to values.yaml file and I am unsure if join is right function to do so. Any suggestions are appreciated

values.yaml

test_groups: ["TEST_GROUP_1", "TEST_GROUP_2"]
OR
test_groups:
  - TEST_GROUP_1
  - TEST_GROUP_2


问:
Updating variables through multiple functions - Python
I am currently in the beginning of writing a program for a text-based adventure in  Python. I am trying to get use to using functions properly as I am a beginner. Below is my current code.

```<code>
rooms = {'A1': {'Down': 'A2', 'Right': 'B1', 'Item': 'Empty'}, 'A2': {'Down': 'A3', 'Up': 'A1', 'Right': 'B2',
                                                                      'Item': 'Potion'},
         'A3': {'Down': 'A4', 'Up': 'A2', 'Right': 'B3', 'Item': 'Food'}, 'A4': {'Up': 'A3', 'Right': 'B4', 'Item':
                                                                                'Sword'},
         'B1': {'Down': 'B2', 'Right': 'C1', 'Left': 'A1', 'Item': 'Empty'}, 'B2': {'Up': 'B1', 'Down': 'B3',
                                                                                'Right': 'C2', 'Left': 'A2',
                                                                                'Item': 'Boss'},
         'B3': {'Up': 'B2', 'Down': 'B4', 'Left': 'A3', 'Right': 'C3', 'Item': 'Start'}, 'B4': {'Up': 'B3', 'Left': 'A4',
                                                                                'Right': 'C4', 'Item':
                                                                                'Food'},
         'C1': {'Down': 'C2', 'Left': 'B1', 'Item': 'Shield'}, 'C2': {'Up': 'C1', 'Down': 'C3', 'Left': 'B2', 'Item':
                                                                      'Potion'},
         'C3': {'Down': 'C4', 'Up': 'C2', 'Left': 'B3', 'Item': 'Food'}, 'C4': {'Up': 'C3', 'Left': 'B4', 'Item':
                                                                                'Empty'}}
current_room = 'C4'
items = []
Alive = True
damage = 10
health = 100
block = 0
boss_health = 100
boss_damage = 20

def update_status():
    print(f"You're currently in {current_room}")
    if rooms[current_room]['Item'] != 'Empty':
        print(f"{rooms[current_room]['Item']} is in this room.")
    else:
        print('There are no items in this room.')
    print(f"Your currently have {items} in your inventory.")
    print(f"You have {health} hitpoints remaining.")

def item_retrieval():
    if rooms[current_room]['Item'] != 'Empty':
        print(f"You have taken the {rooms[current_room]['Item']}.")
        items.append(rooms[current_room]['Item'])
        rooms[current_room]['Item'] = 'Empty'
    else:
        print('This room is empty...')

def moving_rooms(room):
    directions = ['Up', 'Down', 'Left', 'Right']
    room_movement = input("What direction would you like to move? (Up | Down | Left | Right)\n").title()
    if room_movement in rooms[room]:
        room = rooms[room][room_movement]
        return room
    elif room_movement not in directions:
        print(f"Invalid option. Please enter a correct direction {directions}.")
    else:
        print("There is no room in that direction.")

def gameplay():
    while Alive:
        update_status()
        decision = input("Move rooms or pickup items? (Move | Pickup)").lower()
        if decision == 'move':
            moving_rooms(current_room)
        elif decision == 'pickup':
            item_retrieval()
        else:
            print("Invalid option. Please enter ['Move' or 'Pickup'].")

gameplay()
</code>```

The problem I am having when I run gameplay,is that I am staying inside the same room despite entering a direction to move. I believe this is because the variable is not updating. I have been told to avoid assigning variables as global inside functions. I am stumped on what to do. What is the best way to fix this? Also any suggestions to writing better code for this would be appreciated!

Body:
I am currently in the beginning of writing a program for a text-based adventure in  Python. I am trying to get use to using functions properly as I am a beginner. Below is my current code.

rooms = {'A1': {'Down': 'A2', 'Right': 'B1', 'Item': 'Empty'}, 'A2': {'Down': 'A3', 'Up': 'A1', 'Right': 'B2',
                                                                      'Item': 'Potion'},
         'A3': {'Down': 'A4', 'Up': 'A2', 'Right': 'B3', 'Item': 'Food'}, 'A4': {'Up': 'A3', 'Right': 'B4', 'Item':
                                                                                'Sword'},
         'B1': {'Down': 'B2', 'Right': 'C1', 'Left': 'A1', 'Item': 'Empty'}, 'B2': {'Up': 'B1', 'Down': 'B3',
                                                                                'Right': 'C2', 'Left': 'A2',
                                                                                'Item': 'Boss'},
         'B3': {'Up': 'B2', 'Down': 'B4', 'Left': 'A3', 'Right': 'C3', 'Item': 'Start'}, 'B4': {'Up': 'B3', 'Left': 'A4',
                                                                                'Right': 'C4', 'Item':
                                                                                'Food'},
         'C1': {'Down': 'C2', 'Left': 'B1', 'Item': 'Shield'}, 'C2': {'Up': 'C1', 'Down': 'C3', 'Left': 'B2', 'Item':
                                                                      'Potion'},
         'C3': {'Down': 'C4', 'Up': 'C2', 'Left': 'B3', 'Item': 'Food'}, 'C4': {'Up': 'C3', 'Left': 'B4', 'Item':
                                                                                'Empty'}}
current_room = 'C4'
items = []
Alive = True
damage = 10
health = 100
block = 0
boss_health = 100
boss_damage = 20

def update_status():
    print(f"You're currently in {current_room}")
    if rooms[current_room]['Item'] != 'Empty':
        print(f"{rooms[current_room]['Item']} is in this room.")
    else:
        print('There are no items in this room.')
    print(f"Your currently have {items} in your inventory.")
    print(f"You have {health} hitpoints remaining.")

def item_retrieval():
    if rooms[current_room]['Item'] != 'Empty':
        print(f"You have taken the {rooms[current_room]['Item']}.")
        items.append(rooms[current_room]['Item'])
        rooms[current_room]['Item'] = 'Empty'
    else:
        print('This room is empty...')

def moving_rooms(room):
    directions = ['Up', 'Down', 'Left', 'Right']
    room_movement = input("What direction would you like to move? (Up | Down | Left | Right)\n").title()
    if room_movement in rooms[room]:
        room = rooms[room][room_movement]
        return room
    elif room_movement not in directions:
        print(f"Invalid option. Please enter a correct direction {directions}.")
    else:
        print("There is no room in that direction.")

def gameplay():
    while Alive:
        update_status()
        decision = input("Move rooms or pickup items? (Move | Pickup)").lower()
        if decision == 'move':
            moving_rooms(current_room)
        elif decision == 'pickup':
            item_retrieval()
        else:
            print("Invalid option. Please enter ['Move' or 'Pickup'].")

gameplay()

The problem I am having when I run gameplay,is that I am staying inside the same room despite entering a direction to move. I believe this is because the variable is not updating. I have been told to avoid assigning variables as global inside functions. I am stumped on what to do. What is the best way to fix this? Also any suggestions to writing better code for this would be appreciated!


问:
Is there a way to collect the RSC characteristic from the Zwift foot pod
I am trying to collect Running Speed and Cadence (RSC from a Zwift food pod. I have identified the  RSC measurement characteristic 2A53 but there is an additional characteristic listed FF00 which I am not familiar with (see Light Blue images) . I suspect that the foot pod can be used only with the proprietary application. Is there a way to collect the RSC characteristic from this foot pod?


问:
How do you deploy an spa and api in the same server
If i have a spa, maybe like built on react, and routes (get) obviously will get handled in the frontend.

So for every GET i will get in the backend, I will return the same index.html build via react build.

Now suppose I want to deploy an API on the same domain? How I will do that, won't it create a conflict of routes?

```<code>app.get('*', returnreactpage);
// Will never reach
app.get('/posts', handlepost)
</code>```

Ideal thing in my opinion would be to host the API in a subdomain or a route like /api i think? Is there any other way around?

Body:
If i have a spa, maybe like built on react, and routes (get) obviously will get handled in the frontend.

So for every GET i will get in the backend, I will return the same index.html build via react build.

Now suppose I want to deploy an API on the same domain? How I will do that, won't it create a conflict of routes?

app.get('*', returnreactpage);
// Will never reach
app.get('/posts', handlepost)

Ideal thing in my opinion would be to host the API in a subdomain or a route like /api i think? Is there any other way around?


问:
Chrome Extension: How to modify webpage's javascript function by chrome extension?
I am trying to make a Chrome extension that changes the webpage's javascript function. I want my chrome extension to change only some parts of the function because the other parts of it change by user, access time or webpage access method.
The webpage function looks like this:

```<code>function opSubmit(save_type){

            $("input[name=save_type]").val(save_type);

            var confirm_msg = "임시저장 하시겠습니까?";
            var complete_msg = "임시저장 완료하였습니다.";

            if(save_type == "S"){
                confirm_msg = "제출 하시겠습니까?";
                complete_msg = "제출 완료하였습니다.";
            }

            if(isEmpty($("#ssp_seq").val())){
                alert("실습 분과를 선택해주세요");
                return;
            }

            if(!confirm(confirm_msg)){
                return;
            }

            if(isEmpty($("#pfList").val())){
                alert("담당교수를 선택해주세요");
                return;
            }

            if(!isValidDate($("#date").val())){
                alert("날짜를 확인해주세요");
                $("#date").focus();
                return;
            }

            if(!isValidTime($("#start_hour").val(),$("#start_minute").val())){
                alert("시작 시간을 확인해주세요.");
                $("#start_hour").focus();
                return;
            }

            if(!isValidTime($("#end_hour").val(),$("#end_minute").val())){
                alert("종료 시간을 확인해주세요.");
                $("#end_hour").focus();
                return;
            }

            if($("input[name=patient_type]:checked").length == 0){
                alert("환자 유형을 선택해주세요");
                return;
            }

            if(isEmpty($("#patient_name").val())){
                alert("환자이름을 입력해주세요");
                $("#patient_name").focus();
                return;
            }

            if(isEmpty($("#age").val())){
                alert("환자 나이를 입력해주세요");
                $("#age").focus();
                return;
            }

            if(isEmpty($("#gender").val())){
                alert("환자 성별을 선택해주세요");
                return;
            }

            if($("#keywordListAdd p").length == 0){
                alert("실습항목을 하나이상 선택해주세요");
                return;
            }

            var practiceInfo = new Object();
            practiceInfo.date = $("#date").val();
            practiceInfo.start_time = $("#start_hour").val() +":"+$("#start_minute").val();
            practiceInfo.end_time = $("#end_hour").val() +":"+$("#end_minute").val();

            var patientInfo = new Object();
            patientInfo.patient_type = $("input[name=patient_type]:checked").val();
            patientInfo.etc_text = $("#etc_text").val();
            patientInfo.patient_name = $("#patient_name").val().substring(0,1)+"**";
            patientInfo.age = $("#age").val();
            patientInfo.gender = $("#gender").val();

            var patient_num = $("#patient_num").val();
            var patient_num_change = patient_num.substring(0,3);

            for(var i=0; i<patient_num.length-3; i++){
                patient_num_change += "*";
            }

            patientInfo.patient_num = patient_num_change;

            var practice = new Object();

            var practice = new Object();
            practice.info = practiceInfo;
            practice.patientInfo = patientInfo;
            practice.content = $("#froala_editor").froalaEditor('html.get');

            var jsonInfo = JSON.stringify(practice);

            $("input[name=ppr_content]").val(jsonInfo);

            $("#opForm").ajaxForm({
                type: "POST",
                url: "/ajax/st/clinical-training/outpatient/site/modify",
                dataType: "json",
                success: function(data, status){
                    if (data.status == "200") {
                        alert(complete_msg);
                        post_to_url("/st/clinical-training/inpatient/pomr/view",{"ppr_seq":data.ppr_seq, "op_seq" : "725187"});
                    }
                    else if(data.status == "505"){
                        alert(data.msg);
                    }
                    else{
                        alert("저장 실패");
                    }
                },
                error: function(xhr, textStatus) {
                    document.write(xhr.responseText);
                    $.unblockUI();
                },beforeSend:function() {
                    $.blockUI();
                },complete:function() {
                    $.unblockUI();
                }
            });
            $("#opForm").submit();
        }
</code>```

I only want to change this part while leaving other parts to website's default:

```<code>if (data.status == "200") {
                    alert(complete_msg);
                    post_to_url("/st/clinical-training/inpatient/pomr/view",{"ppr_seq":data.ppr_seq, "op_seq" : "725187"});
                }
</code>```

I know how to completely overwrite webpage function, but I don't know whether it's possible to change only some parts of it and leave everything else to default. Is it possible? How can I achieve it? Thanks!

Body:
I am trying to make a Chrome extension that changes the webpage's javascript function. I want my chrome extension to change only some parts of the function because the other parts of it change by user, access time or webpage access method.
The webpage function looks like this:

function opSubmit(save_type){

            $("input[name=save_type]").val(save_type);

            var confirm_msg = "임시저장 하시겠습니까?";
            var complete_msg = "임시저장 완료하였습니다.";

            if(save_type == "S"){
                confirm_msg = "제출 하시겠습니까?";
                complete_msg = "제출 완료하였습니다.";
            }

            if(isEmpty($("#ssp_seq").val())){
                alert("실습 분과를 선택해주세요");
                return;
            }

            if(!confirm(confirm_msg)){
                return;
            }

            if(isEmpty($("#pfList").val())){
                alert("담당교수를 선택해주세요");
                return;
            }

            if(!isValidDate($("#date").val())){
                alert("날짜를 확인해주세요");
                $("#date").focus();
                return;
            }

            if(!isValidTime($("#start_hour").val(),$("#start_minute").val())){
                alert("시작 시간을 확인해주세요.");
                $("#start_hour").focus();
                return;
            }

            if(!isValidTime($("#end_hour").val(),$("#end_minute").val())){
                alert("종료 시간을 확인해주세요.");
                $("#end_hour").focus();
                return;
            }

            if($("input[name=patient_type]:checked").length == 0){
                alert("환자 유형을 선택해주세요");
                return;
            }

            if(isEmpty($("#patient_name").val())){
                alert("환자이름을 입력해주세요");
                $("#patient_name").focus();
                return;
            }

            if(isEmpty($("#age").val())){
                alert("환자 나이를 입력해주세요");
                $("#age").focus();
                return;
            }

            if(isEmpty($("#gender").val())){
                alert("환자 성별을 선택해주세요");
                return;
            }

            if($("#keywordListAdd p").length == 0){
                alert("실습항목을 하나이상 선택해주세요");
                return;
            }

            var practiceInfo = new Object();
            practiceInfo.date = $("#date").val();
            practiceInfo.start_time = $("#start_hour").val() +":"+$("#start_minute").val();
            practiceInfo.end_time = $("#end_hour").val() +":"+$("#end_minute").val();

            var patientInfo = new Object();
            patientInfo.patient_type = $("input[name=patient_type]:checked").val();
            patientInfo.etc_text = $("#etc_text").val();
            patientInfo.patient_name = $("#patient_name").val().substring(0,1)+"**";
            patientInfo.age = $("#age").val();
            patientInfo.gender = $("#gender").val();

            var patient_num = $("#patient_num").val();
            var patient_num_change = patient_num.substring(0,3);

            for(var i=0; i<patient_num.length-3; i++){
                patient_num_change += "*";
            }

            patientInfo.patient_num = patient_num_change;

            var practice = new Object();

            var practice = new Object();
            practice.info = practiceInfo;
            practice.patientInfo = patientInfo;
            practice.content = $("#froala_editor").froalaEditor('html.get');

            var jsonInfo = JSON.stringify(practice);

            $("input[name=ppr_content]").val(jsonInfo);

            $("#opForm").ajaxForm({
                type: "POST",
                url: "/ajax/st/clinical-training/outpatient/site/modify",
                dataType: "json",
                success: function(data, status){
                    if (data.status == "200") {
                        alert(complete_msg);
                        post_to_url("/st/clinical-training/inpatient/pomr/view",{"ppr_seq":data.ppr_seq, "op_seq" : "725187"});
                    }
                    else if(data.status == "505"){
                        alert(data.msg);
                    }
                    else{
                        alert("저장 실패");
                    }
                },
                error: function(xhr, textStatus) {
                    document.write(xhr.responseText);
                    $.unblockUI();
                },beforeSend:function() {
                    $.blockUI();
                },complete:function() {
                    $.unblockUI();
                }
            });
            $("#opForm").submit();
        }

I only want to change this part while leaving other parts to website's default:

if (data.status == "200") {
                    alert(complete_msg);
                    post_to_url("/st/clinical-training/inpatient/pomr/view",{"ppr_seq":data.ppr_seq, "op_seq" : "725187"});
                }

I know how to completely overwrite webpage function, but I don't know whether it's possible to change only some parts of it and leave everything else to default. Is it possible? How can I achieve it? Thanks!


问:
URL Images are not showing on maui windows

App is generated from visual studio 2022 starter for maui

Just added Image with Source="https://picsum.photos/seed/picsum/200"

Image not loading

MainPage.xaml

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="TryingMauiNative.MainPage">

    <ScrollView>
        <VerticalStackLayout
            Spacing="25"
            Padding="30,0"
            VerticalOptions="Center">

            <Image
                Source="dotnet_bot.png"
                SemanticProperties.Description="Cute dot net bot waving hi to you!"
                HeightRequest="200"
                HorizontalOptions="Center" />

            <Button
                x:Name="CounterBtn"
                Text="Click me"
                SemanticProperties.Hint="Counts the number of times you click"
                Clicked="OnCounterClicked"
                HorizontalOptions="Center" />

            <Image
                Source="https://picsum.photos/seed/picsum/200"
                BackgroundColor="#535353"
                HeightRequest="200"
                WidthRequest="200"
                />

        </VerticalStackLayout>
    </ScrollView>

</ContentPage>

```
<p><code>app.manifest</code></p>
<pre class="lang-xml prettyprint-override"><code><?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
  <assemblyIdentity version="1.0.0.0" name="TryingMauiNative.WinUI.app"/>

  <application xmlns="urn:schemas-microsoft-com:asm.v3">
    <windowsSettings>
      <!-- The combination of below two tags have the following effect:
           1) Per-Monitor for >= Windows 10 Anniversary Update
           2) System < Windows 10 Anniversary Update
      -->
      <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
      <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
    </windowsSettings>
  </application>
</assembly>
</code>```

App.xaml

<maui:MauiWinUIApplication
    x:Class="TryingMauiNative.WinUI.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:maui="using:Microsoft.Maui"
    xmlns:local="using:TryingMauiNative.WinUI">

</maui:MauiWinUIApplication>

```
<p><code>Package.appmanifest</code></p>
<pre class="lang-xml prettyprint-override"><code><?xml version="1.0" encoding="utf-8"?>
<Package
  xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
  xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
  xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
  xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
  IgnorableNamespaces="uap rescap">

  <Identity Name="maui-package-name-placeholder" Publisher="CN=User Name" Version="0.0.0.0" />

  <mp:PhoneIdentity PhoneProductId="####hiddenbyme####" PhonePublisherId="####hiddenbyme####"/>

  <Properties>
    <DisplayName>$placeholder$</DisplayName>
    <PublisherDisplayName>User Name</PublisherDisplayName>
    <Logo>$placeholder$.png</Logo>
  </Properties>

  <Dependencies>
    <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
    <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
  </Dependencies>

  <Resources>
    <Resource Language="x-generate" />
  </Resources>

  <Applications>
    <Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$">
      <uap:VisualElements
        DisplayName="$placeholder$"
        Description="$placeholder$"
        Square150x150Logo="$placeholder$.png"
        Square44x44Logo="$placeholder$.png"
        BackgroundColor="transparent">
        <uap:DefaultTile Square71x71Logo="$placeholder$.png" Wide310x150Logo="$placeholder$.png" Square310x310Logo="$placeholder$.png" />
        <uap:SplashScreen Image="$placeholder$.png" />
      </uap:VisualElements>
    </Application>
  </Applications>

  <Capabilities>
      <rescap:Capability Name="runFullTrust" />
  </Capabilities>

</Package>

</code>```

Body:
App is generated from visual studio 2022 starter for maui

Just added Image with Source="https://picsum.photos/seed/picsum/200"

Image not loading

MainPage.xaml

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="TryingMauiNative.MainPage">

    <ScrollView>
        <VerticalStackLayout
            Spacing="25"
            Padding="30,0"
            VerticalOptions="Center">

            <Image
                Source="dotnet_bot.png"
                SemanticProperties.Description="Cute dot net bot waving hi to you!"
                HeightRequest="200"
                HorizontalOptions="Center" />

            <Button
                x:Name="CounterBtn"
                Text="Click me"
                SemanticProperties.Hint="Counts the number of times you click"
                Clicked="OnCounterClicked"
                HorizontalOptions="Center" />

            <Image
                Source="https://picsum.photos/seed/picsum/200"
                BackgroundColor="#535353"
                HeightRequest="200"
                WidthRequest="200"
                />

        </VerticalStackLayout>
    </ScrollView>

</ContentPage>

app.manifest

<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
  <assemblyIdentity version="1.0.0.0" name="TryingMauiNative.WinUI.app"/>

  <application xmlns="urn:schemas-microsoft-com:asm.v3">
    <windowsSettings>

      <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
      <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
    </windowsSettings>
  </application>
</assembly>

App.xaml

<maui:MauiWinUIApplication
    x:Class="TryingMauiNative.WinUI.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:maui="using:Microsoft.Maui"
    xmlns:local="using:TryingMauiNative.WinUI">

</maui:MauiWinUIApplication>

Package.appmanifest

<?xml version="1.0" encoding="utf-8"?>
<Package
  xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
  xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
  xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
  xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
  IgnorableNamespaces="uap rescap">

  <Identity Name="maui-package-name-placeholder" Publisher="CN=User Name" Version="0.0.0.0" />

  <mp:PhoneIdentity PhoneProductId="####hiddenbyme####" PhonePublisherId="####hiddenbyme####"/>

  <Properties>
    <DisplayName>$placeholder$</DisplayName>
    <PublisherDisplayName>User Name</PublisherDisplayName>
    <Logo>$placeholder$.png</Logo>
  </Properties>

  <Dependencies>
    <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
    <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
  </Dependencies>

  <Resources>
    <Resource Language="x-generate" />
  </Resources>

  <Applications>
    <Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$">
      <uap:VisualElements
        DisplayName="$placeholder$"
        Description="$placeholder$"
        Square150x150Logo="$placeholder$.png"
        Square44x44Logo="$placeholder$.png"
        BackgroundColor="transparent">
        <uap:DefaultTile Square71x71Logo="$placeholder$.png" Wide310x150Logo="$placeholder$.png" Square310x310Logo="$placeholder$.png" />
        <uap:SplashScreen Image="$placeholder$.png" />
      </uap:VisualElements>
    </Application>
  </Applications>

  <Capabilities>
      <rescap:Capability Name="runFullTrust" />
  </Capabilities>

</Package>


问:
All my flutter project not running including new flutter template
FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.

Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
Could not load module metadata from C:\Users\HP USER.gradle\caches\modules-2\metadata-2.97\descriptors\io.flutter\armeabi_v7a_debug\1.0.0-8f2221fbef28b478debb78dd233f5250b220ca99\ead07aa8988ba5da5b18b543384da24a\descriptor.bin

I've tried deleting the gradle folder and I've changed the minimum and target sdk  to 20 and 30
and also the compiling sdk to 30

but doing all this the error is still the same


问:
Customize pg_cron return_message
Is there a way to customize the return_message of cron.job_run_details?

I need a more descriptive return_message than just SELECT 1.

In my case, the cron job uses dblink to make a call to functions in other databases:

example:

SELECT * FROM dblink('other_db'::TEXT, $$
   SELECT * FROM some_function(now() - INTERVAL '14 days', now())
$$) t (message text);
```

Title: Customize pg_cron return_message