问:
Adding Asset in Drools Business Central Workbench Fails
I'm playing around with the KIE Business Central Workbench deployed in an air gap environment using their latest docker image. My hope is to leverage it to give my customers the ability to  manage our rules logic (implemented in .drl files) themselves. I started a docker container created from an image I built using the image they provide above. Here's my Dockerfile:

```<code>FROM  quay.io/kiegroup/business-central-workbench:latest
COPY settings.xml /opt/jboss/.m2/settings.xml
USER root
RUN chown jboss:jboss  /opt/jboss/.m2/settings.xml
USER jboss
</code>```

The settings.xml listed above contains a mirror to our locally hosted nexus repository. I added this due to requests in the logs going to maven central which always failed. I then exec'ed into the container and added a user with the admin role, then hit http://localhost:8080/business-central per the second link above. I then added a space, then a project with the space, then attempted to create new assets within the project. Adding any kind of asset yielded the following error:

```<code>Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.default:artifact:jar:1.0.0
        at deployment.business-central.war//org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:282)
        at deployment.business-central.war//org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:198)
        at deployment.business-central.war//org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:202)
        ... 101 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.default:artifact:pom:1.0.0 from/to (https://my.nexus.org/): Connection reset
        at deployment.business-central.war//org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
        at deployment.business-central.war//org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
        at deployment.business-central.war//org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:223)
        at deployment.business-central.war//org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:267)
        ... 103 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.default:artifact:pom:1.0.0 from/to (https://my.nexus.org/): Connection reset
        at deployment.business-central.war//org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:43)
        at deployment.business-central.war//org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:355)
        at deployment.business-central.war//org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:67)
        at deployment.business-central.war//org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:581)
        at deployment.business-central.war//org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:249)
        at deployment.business-central.war//org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:520)
        at deployment.business-central.war//org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:421)
        ... 106 more
</code>```

The name of this dependency (as well as its distinct absence of any artifact by that name here) makes me think this is some kind of KIE artifact which gets created on the fly. The only config change I made was to add the admin user via exec'ing into the container. I'm scratching my head as to why this doesn't seem to work out of the box. Any ideas?

Body:
I'm playing around with the KIE Business Central Workbench deployed in an air gap environment using their latest docker image. My hope is to leverage it to give my customers the ability to  manage our rules logic (implemented in .drl files) themselves. I started a docker container created from an image I built using the image they provide above. Here's my Dockerfile:

FROM  quay.io/kiegroup/business-central-workbench:latest
COPY settings.xml /opt/jboss/.m2/settings.xml
USER root
RUN chown jboss:jboss  /opt/jboss/.m2/settings.xml
USER jboss

The settings.xml listed above contains a mirror to our locally hosted nexus repository. I added this due to requests in the logs going to maven central which always failed. I then exec'ed into the container and added a user with the admin role, then hit http://localhost:8080/business-central per the second link above. I then added a space, then a project with the space, then attempted to create new assets within the project. Adding any kind of asset yielded the following error:

Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.default:artifact:jar:1.0.0
        at deployment.business-central.war//org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:282)
        at deployment.business-central.war//org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:198)
        at deployment.business-central.war//org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:202)
        ... 101 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.default:artifact:pom:1.0.0 from/to (https://my.nexus.org/): Connection reset
        at deployment.business-central.war//org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
        at deployment.business-central.war//org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
        at deployment.business-central.war//org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:223)
        at deployment.business-central.war//org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:267)
        ... 103 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.default:artifact:pom:1.0.0 from/to (https://my.nexus.org/): Connection reset
        at deployment.business-central.war//org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:43)
        at deployment.business-central.war//org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:355)
        at deployment.business-central.war//org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:67)
        at deployment.business-central.war//org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:581)
        at deployment.business-central.war//org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:249)
        at deployment.business-central.war//org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:520)
        at deployment.business-central.war//org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:421)
        ... 106 more

The name of this dependency (as well as its distinct absence of any artifact by that name here) makes me think this is some kind of KIE artifact which gets created on the fly. The only config change I made was to add the admin user via exec'ing into the container. I'm scratching my head as to why this doesn't seem to work out of the box. Any ideas?


来源: stackexchange

问:
Hot Mess: Conditional Statement with strncmp will not Execute
I feel like my code is what the kids would call a hot mess, but more like someone,i.e. me, took a fresh dump on everything. I wrote this in C++ to practice, but things a not happening the way I want it to.

```<code>//validation: check for other values other than three temp units
        } while ((strncmp(temp_data.current_temp, KELVIN, strlen(temp_data.current_temp)) +
            strncmp(temp_data.current_temp, CELSIUS, strlen(temp_data.current_temp)) +
            strncmp(temp_data.current_temp, FAHRENHEIT, strlen(temp_data.current_temp))==0) &&

            (strncmp(local_convert_temp, KELVIN, strlen(local_convert_temp)) +
            strncmp(local_convert_temp, CELSIUS, strlen(local_convert_temp)) +
            strncmp(local_convert_temp, FAHRENHEIT, strlen(local_convert_temp)) == 0));

</code>```

I tried a different iteration using more of a conditional statement instead of simple arithmetic, but that didn't work either. I took the entire statement apart and each strncmp is returning a 0 value when the condition is met; with or without the macro. The situation is the same with this piece of the code:

```<code>strncmp(current_temp, CELSIUS, strlen(current_temp)) + strncmp(convert_temp, KELVIN, strlen(convert_temp)) == 0)
</code>```

I tried taking the statement apart check to see if the in-block statement will execute if the condition is met and that works. The issue arise when I make the conditional statement more complex. What I am expecting is that when both conditions are met the statement will simply execute.

ContentLicense: CC BY-SA 4.0

Body:
I feel like my code is what the kids would call a hot mess, but more like someone,i.e. me, took a fresh dump on everything. I wrote this in C++ to practice, but things a not happening the way I want it to.

//validation: check for other values other than three temp units
        } while ((strncmp(temp_data.current_temp, KELVIN, strlen(temp_data.current_temp)) +
            strncmp(temp_data.current_temp, CELSIUS, strlen(temp_data.current_temp)) +
            strncmp(temp_data.current_temp, FAHRENHEIT, strlen(temp_data.current_temp))==0) &&

            (strncmp(local_convert_temp, KELVIN, strlen(local_convert_temp)) +
            strncmp(local_convert_temp, CELSIUS, strlen(local_convert_temp)) +
            strncmp(local_convert_temp, FAHRENHEIT, strlen(local_convert_temp)) == 0));

I tried a different iteration using more of a conditional statement instead of simple arithmetic, but that didn't work either. I took the entire statement apart and each strncmp is returning a 0 value when the condition is met; with or without the macro. The situation is the same with this piece of the code:

strncmp(current_temp, CELSIUS, strlen(current_temp)) + strncmp(convert_temp, KELVIN, strlen(convert_temp)) == 0)

I tried taking the statement apart check to see if the in-block statement will execute if the condition is met and that works. The issue arise when I make the conditional statement more complex. What I am expecting is that when both conditions are met the statement will simply execute.


问:
Problem using Charts in swift with blinking graph and no chart data available
I'm trying to show a pie chart using cocoapod Charts but I'm basically finding two problems. First of all, when the pie chart is showed for the first time it blinks for a couple of seconds. The chart it's in a tab bar so when I return to it there is no blink.
And secondly it is always showing the text "no chart data available" although the data is show. Please the picture I've attached.

Any suggestion?

```<code>import UIKit
import Charts

class PieChartViewController: UIViewController, ChartViewDelegate{

    @IBOutlet weak var contenedorView: UIView!
    @IBOutlet weak var pieChartView: PieChartView!
    var nombres: [String]!
    var precios: [Double]!

    override func viewDidLoad() {
        super.viewDidLoad()
        pieChartView.delegate = self
        nombres = eventos.devolverNombre()
        precios = eventos.devolverPrecios()
        //Configuramos el gráfico circular
        setChart(dataPoints: nombres, values: precios)
        self.pieChartView.noDataText = "Geen"
    }

    override func viewWillAppear(_ animated: Bool) {
        reloadInputViews()
        self.pieChartView.noDataText = "Geen"
        contenedorView.layer.borderWidth = 2
        contenedorView.layer.borderColor =  UIColor.white.cgColor
        contenedorView.layer.cornerRadius = 10
        self.view.aplicarFondoDegradado()
        }

func setChart(dataPoints: [String], values: [Double]) {
    var dataEntries: [PieChartDataEntry] = []
    for i in 0..<dataPoints.count {
        let dataEntry = PieChartDataEntry(value: Double(i), label: dataPoints[i], data:  dataPoints[i] as AnyObject)
        if dataEntry != nil {
            dataEntries.append(dataEntry)}
    }
    let chartDataSet = PieChartDataSet(entries: dataEntries, label: "PRECIOS POR EVENTO")
    let chartData = PieChartData(dataSet: chartDataSet)
    pieChartView.holeColor = UIColor.black
    pieChartView.data = chartData
    var colors: [UIColor] = []
        for i in 0..<dataPoints.count {
            let red = Double(arc4random_uniform(256))
            let green = Double(arc4random_uniform(256))
            let blue = Double(arc4random_uniform(256))
            let color = UIColor(red: CGFloat(red/255), green: CGFloat(green/255), blue: CGFloat(blue/255), alpha: 1)
                colors.append(color)
            }
    pieChartView.noDataText = ""
    pieChartView.holeRadiusPercent = 0.6
    pieChartView.legend.textColor = UIColor.white
    pieChartView.legend.font = UIFont.systemFont(ofSize: 12)
    pieChartView.drawEntryLabelsEnabled = false
    chartDataSet.colors = colors
}
</code>```

}

Body:
I'm trying to show a pie chart using cocoapod Charts but I'm basically finding two problems. First of all, when the pie chart is showed for the first time it blinks for a couple of seconds. The chart it's in a tab bar so when I return to it there is no blink.
And secondly it is always showing the text "no chart data available" although the data is show. Please the picture I've attached.

Any suggestion?

import UIKit
import Charts

class PieChartViewController: UIViewController, ChartViewDelegate{

    @IBOutlet weak var contenedorView: UIView!
    @IBOutlet weak var pieChartView: PieChartView!
    var nombres: [String]!
    var precios: [Double]!

    override func viewDidLoad() {
        super.viewDidLoad()
        pieChartView.delegate = self
        nombres = eventos.devolverNombre()
        precios = eventos.devolverPrecios()
        //Configuramos el gráfico circular
        setChart(dataPoints: nombres, values: precios)
        self.pieChartView.noDataText = "Geen"
    }

    override func viewWillAppear(_ animated: Bool) {
        reloadInputViews()
        self.pieChartView.noDataText = "Geen"
        contenedorView.layer.borderWidth = 2
        contenedorView.layer.borderColor =  UIColor.white.cgColor
        contenedorView.layer.cornerRadius = 10
        self.view.aplicarFondoDegradado()
        }

func setChart(dataPoints: [String], values: [Double]) {
    var dataEntries: [PieChartDataEntry] = []
    for i in 0..<dataPoints.count {
        let dataEntry = PieChartDataEntry(value: Double(i), label: dataPoints[i], data:  dataPoints[i] as AnyObject)
        if dataEntry != nil {
            dataEntries.append(dataEntry)}
    }
    let chartDataSet = PieChartDataSet(entries: dataEntries, label: "PRECIOS POR EVENTO")
    let chartData = PieChartData(dataSet: chartDataSet)
    pieChartView.holeColor = UIColor.black
    pieChartView.data = chartData
    var colors: [UIColor] = []
        for i in 0..<dataPoints.count {
            let red = Double(arc4random_uniform(256))
            let green = Double(arc4random_uniform(256))
            let blue = Double(arc4random_uniform(256))
            let color = UIColor(red: CGFloat(red/255), green: CGFloat(green/255), blue: CGFloat(blue/255), alpha: 1)
                colors.append(color)
            }
    pieChartView.noDataText = ""
    pieChartView.holeRadiusPercent = 0.6
    pieChartView.legend.textColor = UIColor.white
    pieChartView.legend.font = UIFont.systemFont(ofSize: 12)
    pieChartView.drawEntryLabelsEnabled = false
    chartDataSet.colors = colors
}

}


问:
Neovim dap C++ clangd
I'm having trouble configuring dap in NeoVim - after executing :lua require’dap’.continue() I get this error:

Path to executable: /home/user/Projects/C++/app/E5108: Error executing lua ...l/share/nvim/site/pack/packer/start/nvim-dap/lua/dap.lua:385: ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:1295: Error running /hom
e/user/Devtools/vscode-lldb: EACCES: permission denied
stack traceback:
[C]: in function 'trigger_run'
...l/share/nvim/site/pack/packer/start/nvim-dap/lua/dap.lua:385: in function 'run'
...l/share/nvim/site/pack/packer/start/nvim-dap/lua/dap.lua:319: in function 'cb'
...hare/nvim/site/pack/packer/start/nvim-dap/lua/dap/ui.lua:34: in function 'pick_if_many'
...l/share/nvim/site/pack/packer/start/nvim-dap/lua/dap.lua:313: in function 'select_config_and_run'
...l/share/nvim/site/pack/packer/start/nvim-dap/lua/dap.lua:688: in function 'continue'
[string ":lua"]:1: in main chunk

Directory with vscode-llb - user have full access for it.

drwxrwxr-x 17 user user 4,0K dec 30 07:12pm vscode-lldb

debugging.lua

```<code>require("dap").adapters.lldb = {
    type = "executable",
    command = "/home/user/Devtools/vscode-lldb",
    name = "lldb",
}

local lldb = {
    name = "Launch lldb",
    type = "lldb", -- matches the adapter
    request = "launch", -- could also attach to a currently running process
    program = function()
        return vim.fn.input(
            "Path to executable: ",
            vim.fn.getcwd() .. "/",
            "file"
        )
    end,
    cwd = "${workspaceFolder}",
    stopOnEntry = false,
    args = {},
    runInTerminal = false,
}

local dap = require('dap')
dap.configurations.cpp = {
  {
    name = 'Launch',
    type = 'lldb',
    request = 'launch',
    program = function()
      return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
    end,
    cwd = '${workspaceFolder}',
    stopOnEntry = false,
    args = {},
  },
}

dap.configurations.c = dap.configurations.cpp

</code>```

I can't find a similar problem - so I'm doing something wrong - but what? Anyone have any suggestions.

Change of folder access permissions to application, to vscode-lldb, update of plugins.

Title: Neovim dap C++ clangd

Body:
I'm having trouble configuring dap in NeoVim - after executing :lua require’dap’.continue() I get this error:

Path to executable: /home/user/Projects/C++/app/E5108: Error executing lua ...l/share/nvim/site/pack/packer/start/nvim-dap/lua/dap.lua:385: ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:1295: Error running /hom
e/user/Devtools/vscode-lldb: EACCES: permission denied
stack traceback:
[C]: in function 'trigger_run'
...l/share/nvim/site/pack/packer/start/nvim-dap/lua/dap.lua:385: in function 'run'
...l/share/nvim/site/pack/packer/start/nvim-dap/lua/dap.lua:319: in function 'cb'
...hare/nvim/site/pack/packer/start/nvim-dap/lua/dap/ui.lua:34: in function 'pick_if_many'
...l/share/nvim/site/pack/packer/start/nvim-dap/lua/dap.lua:313: in function 'select_config_and_run'
...l/share/nvim/site/pack/packer/start/nvim-dap/lua/dap.lua:688: in function 'continue'
[string ":lua"]:1: in main chunk

Directory with vscode-llb - user have full access for it.

drwxrwxr-x 17 user user 4,0K dec 30 07:12pm vscode-lldb

debugging.lua

require("dap").adapters.lldb = {
    type = "executable",
    command = "/home/user/Devtools/vscode-lldb",
    name = "lldb",
}

local lldb = {
    name = "Launch lldb",
    type = "lldb", -- matches the adapter
    request = "launch", -- could also attach to a currently running process
    program = function()
        return vim.fn.input(
            "Path to executable: ",
            vim.fn.getcwd() .. "/",
            "file"
        )
    end,
    cwd = "${workspaceFolder}",
    stopOnEntry = false,
    args = {},
    runInTerminal = false,
}

local dap = require('dap')
dap.configurations.cpp = {
  {
    name = 'Launch',
    type = 'lldb',
    request = 'launch',
    program = function()
      return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
    end,
    cwd = '${workspaceFolder}',
    stopOnEntry = false,
    args = {},
  },
}

dap.configurations.c = dap.configurations.cpp

I can't find a similar problem - so I'm doing something wrong - but what? Anyone have any suggestions.

Change of folder access permissions to application, to vscode-lldb, update of plugins.


问:
How to get sanity client on v3 scripts?
I didn't find a way to get client on Sanity v3 script. The old version was getting it from 'part:@sanity/base/client' and it doesn't work for v3.

Well, it's simple:

```<code>import { getCliClient } from 'sanity/cli';

const client = getCliClient().withConfig({ apiVersion: '2022-09-09' });
</code>```

Then you can execute your script this way:
node_modules/.bin/sanity exec path-to/my-script.js --with-user-token

Title: How to get sanity client on v3 scripts?

Body:
I didn't find a way to get client on Sanity v3 script. The old version was getting it from 'part:@sanity/base/client' and it doesn't work for v3.

Well, it's simple:

import { getCliClient } from 'sanity/cli';

const client = getCliClient().withConfig({ apiVersion: '2022-09-09' });

Then you can execute your script this way:
node_modules/.bin/sanity exec path-to/my-script.js --with-user-token


问:
Import everything except one method or import this method with different name
I want to use both C# classes and Python classes in my project. The problem is that some classes have the same name in both Python and C#. Let's say that my class is myClass. I'd like to be able to call the following:

```<code>from namespace import *, myClass as myClassCSharp
</code>```

or

```<code>from namespace import * except myClass
</code>```

Is it possible?

Body:
I want to use both C# classes and Python classes in my project. The problem is that some classes have the same name in both Python and C#. Let's say that my class is myClass. I'd like to be able to call the following:

from namespace import *, myClass as myClassCSharp

or

from namespace import * except myClass

Is it possible?


问:
How to display jtextfield content on jtextarea
this the GUI
I am trying to display the the inputs of my Jtextfield onto the text area but the contents are not displaying
this is my code

```<code>import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class FUEL1 extends JDialog {
    private JPanel panel1;
    private JTextArea tADIS;
    private JTextField TFcom;
    private JTextField TFid;
    private JTextField TFfuel;
    private JButton btnAPP;
    private JButton bTNPRINT;
    private JPanel panel2;

    String cid;
    int amount;
    int tax;

    public void print() {
        String name = TFcom.getText();
        String cid = TFid.getText();
        String amount = TFfuel.getText();

        tADIS.setText(tADIS.getText() + "\n");
        tADIS.setText(tADIS.getText() + "TAX EXEMPTION REPORT" + "\n");
        tADIS.setText(tADIS.getText() + "Customer id:" + cid + "\n");
        tADIS.setText(tADIS.getText() + "Company name:" + name + "\n");
        tADIS.setText(tADIS.getText() + "AMount in liters:" + amount + "\n");
        tADIS.setText(tADIS.getText() + "tax exempted:" + tax + "\n");
    }

    public FUEL1(JFrame parent) {
        super(parent);
        setTitle("home page");
        setContentPane(panel1);
        setMinimumSize(new Dimension(450, 450));
        setModal(true);
        setLocationRelativeTo(parent);
        setVisible(true);
        btnAPP.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                cid = TFid.getText();
                amount = Integer.parseInt(TFfuel.getText());

                if (amount<100000) {
                    tax = 10000;
                } else if (amount > 100000 && amount < 500000) {
                    tax = 110000;
                } else {
                    tax = 200000;
                }
                print();
            }
        });
    }

    public static void main(String[]args) {
        FUEL1 h = new FUEL1(null);
    }
}
</code>```

I tried using settext and gettext expecting that the contents of the textfield will be displayed in the text area

Body:
this the GUI
I am trying to display the the inputs of my Jtextfield onto the text area but the contents are not displaying
this is my code

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class FUEL1 extends JDialog {
    private JPanel panel1;
    private JTextArea tADIS;
    private JTextField TFcom;
    private JTextField TFid;
    private JTextField TFfuel;
    private JButton btnAPP;
    private JButton bTNPRINT;
    private JPanel panel2;

    String cid;
    int amount;
    int tax;

    public void print() {
        String name = TFcom.getText();
        String cid = TFid.getText();
        String amount = TFfuel.getText();

        tADIS.setText(tADIS.getText() + "\n");
        tADIS.setText(tADIS.getText() + "TAX EXEMPTION REPORT" + "\n");
        tADIS.setText(tADIS.getText() + "Customer id:" + cid + "\n");
        tADIS.setText(tADIS.getText() + "Company name:" + name + "\n");
        tADIS.setText(tADIS.getText() + "AMount in liters:" + amount + "\n");
        tADIS.setText(tADIS.getText() + "tax exempted:" + tax + "\n");
    }

    public FUEL1(JFrame parent) {
        super(parent);
        setTitle("home page");
        setContentPane(panel1);
        setMinimumSize(new Dimension(450, 450));
        setModal(true);
        setLocationRelativeTo(parent);
        setVisible(true);
        btnAPP.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                cid = TFid.getText();
                amount = Integer.parseInt(TFfuel.getText());

                if (amount<100000) {
                    tax = 10000;
                } else if (amount > 100000 && amount < 500000) {
                    tax = 110000;
                } else {
                    tax = 200000;
                }
                print();
            }
        });
    }

    public static void main(String[]args) {
        FUEL1 h = new FUEL1(null);
    }
}

I tried using settext and gettext expecting that the contents of the textfield will be displayed in the text area


问:
jQuery- Target specific link with href value where number changes
I have a script here I am trying to target a specific link where href is very specific but issue is there is a number and that number changes depending on number of categories forum has. I don't know any dynamic way to overcome this issue.

Code I have:

```<code>$(document).ready(function() {

    var total_posts = _userdata["user_posts"];
    var minimum_posts = 5;

    if (total_posts < minimum_posts) {
        $('a[href="/post?f=1&mode=newtopic"]').css("pointer-events", "none")
    }

});
</code>```

Pay attention to targeted element. I have f=1, but it can be any number, depending on category. How can I target all possible links with this href no matter what number comes after f?

Body:
I have a script here I am trying to target a specific link where href is very specific but issue is there is a number and that number changes depending on number of categories forum has. I don't know any dynamic way to overcome this issue.

Code I have:

$(document).ready(function() {

    var total_posts = _userdata["user_posts"];
    var minimum_posts = 5;

    if (total_posts < minimum_posts) {
        $('a[href="/post?f=1&mode=newtopic"]').css("pointer-events", "none")
    }

});

Pay attention to targeted element. I have f=1, but it can be any number, depending on category. How can I target all possible links with this href no matter what number comes after f?


问:
Python to Oracle 'ascii' codec can't encode character '\u0130' in position 0: ordinal not in range(128)
I try to load dataframe to oracle but i come across an issue below :
'ascii' codec can't encode character '\u0130' in position 0

This is the dataframe:
Dataframe image

This is the oracle table:
Oracle table

This is my insert code:

```<code>import cx_Oracle
from sqlalchemy import types, create_engine

conn = create_engine('oracle+cx_oracle://user:pass@host:1521/?service_name=db', echo=True,encoding="UTF-8",max_identifier_length=128)
cur = conn.connect()

sql='insert into ACTIVITY.ODS_FLOWCENTERINFO (ACTIVITYID,PROCESSID,DEMANDCOMPLAINTSUBJECT,DEMANDCOMPLAINTDETAILSUBJECT,DEMANDCOMPLAINTID) values (:0,:1,:2,:3,:4,:5)'
df_list = df.values.tolist()
n = 0
for i in df.iterrows():
    cur.execute(sql,df_list[n])
    n += 1

cur.commit()
cur.close
conn.close
</code>```

Body:
I try to load dataframe to oracle but i come across an issue below :
'ascii' codec can't encode character '\u0130' in position 0

This is the dataframe:
Dataframe image

This is the oracle table:
Oracle table

This is my insert code:

import cx_Oracle
from sqlalchemy import types, create_engine

conn = create_engine('oracle+cx_oracle://user:pass@host:1521/?service_name=db', echo=True,encoding="UTF-8",max_identifier_length=128)
cur = conn.connect()

sql='insert into ACTIVITY.ODS_FLOWCENTERINFO (ACTIVITYID,PROCESSID,DEMANDCOMPLAINTSUBJECT,DEMANDCOMPLAINTDETAILSUBJECT,DEMANDCOMPLAINTID) values (:0,:1,:2,:3,:4,:5)'
df_list = df.values.tolist()
n = 0
for i in df.iterrows():
    cur.execute(sql,df_list[n])
    n += 1

cur.commit()
cur.close
conn.close


问:
my node doesn't wait axios call on EC2 enviorment
these days I'm making a web application with react-Node.
My Node gets Some data from another site with Axios and passes it to the front-side.
it works fine in a development environment like below picture. However when I deploy my app
on ec2, suddenly Node doesn't wait until Axios done its job. and just send empty object to the front-side below is console and my codes.
your help will be appreciated, thx for reading :)

in dev environment :)))

in prod environment :(((

```<code>app.post("/main", (req, res) => {

  console.log(req.body)
  let gottendID;
  const ltuid = gottendID || xxxxxxxx;

  (async () => {

      const cookie = `coookiecookie`;
      const dataMachine = axios.create({
        headers: {
          "User-Agent":
            "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36",
          Cookie: cookie,
          Accept: "application/json;charset=utf-8",
          // Referrer: "https://webstatic-sea.mihoyo.com/",
          Referrer: "https://act.hoyolab.com/",
          "x-rpc-language": "ko-kr",
          "x-rpc-client_type": "4",
          "x-rpc-app_version": "1.5.0",
          DS: "",
        },
      });
      dataMachine.interceptors.request.use((config) => {
        config.headers.DS = generateDSToken();
        return config;
      });
      const result = await dataMachine
        .get(
          `https://bbs-api-os.hoyolab.com/game_record/card/wapi/getGameRecordCard?uid=${
            parseCookie(cookie).ltuid
          }`
        )
      .then((res) => res.data.data.list[0])
      .catch((err) => console.log(err));

      const gameRoleId = result.game_role_id;
      const server = result.region;

      let now = new Date();
    let currentMonth = now.getMonth() + 1;
      console.log(`currentMonth : ` + currentMonth);
      const travelerNote = await dataMachine
        .get(
          `https://sg-hk4e-api.hoyolab.com/event/ysledgeros/month_info?month=${currentMonth}&region=os_asia&uid=${gameRoleId}&lang=ko-kr`
        )
        .then((res) => res.data.data);

      let notePrimoRewards = [];
      let i = 1;
      while (true) {
        const detailPrimoNote = await dataMachine
          .get(
            `https://hk4e-api-os.mihoyo.com/event/ysledgeros/month_detail?month=${currentMonth}&current_page=${i}&type=1&region=${server}&uid=${gameRoleId}&lang=ko-kr`
          )
          .then((res) => res.data.data?.list)
        if (!detailPrimoNote) break;
        if (!detailPrimoNote.length) break;
        notePrimoRewards.push(detailPrimoNote);

        i++;
      }
      notePrimoRewards = notePrimoRewards.flat();
      console.log(
        `${currentMonth}월 원석보상 ${notePrimoRewards.length}번 받았음`
    );

    let noteMoraRewards = [];
    let j = 1;
    while (true) {
      const detailMoraNote = await dataMachine
        .get(
          `https://hk4e-api-os.mihoyo.com/event/ysledgeros/month_detail?month=${currentMonth}&current_page=${j}&type=2&region=${server}&uid=${gameRoleId}&lang=ko-kr`
        )
        .then((res) => res.data.data?.list);
      if (!detailMoraNote) break;
      if (!detailMoraNote.length) break;

      noteMoraRewards.push(detailMoraNote);

      j++;
    }
    noteMoraRewards = noteMoraRewards.flat();
    console.log(
      `${currentMonth}월 모라보상 ${noteMoraRewards.length}번 받았음`
    );

      const profile = await dataMachine
        .get(
          `https://bbs-api-os.mihoyo.com/game_record/genshin/api/index?server=${server}&role_id=${gameRoleId};`
        )
        .then((res) => res.data.data);

      const character = await dataMachine
        .post(
          "https://bbs-api-os.mihoyo.com/game_record/genshin/api/character",
          {
            // character_ids: profile.avatars.map(c => c.id),
            role_id: gameRoleId,
            server,
          }
        )
      .then((res) => res.data.data);

      // console.log(character);
      // console.log(character.avatars.find(c => c.name === '베넷').weapon);

      /// this mofu send nothin on production :////
      res.send({
        user: result,
        profile: profile,
        character: character,
        mora: noteMoraRewards,
        primo: notePrimoRewards

      })
    })();

})
</code>```

Body:
these days I'm making a web application with react-Node.
My Node gets Some data from another site with Axios and passes it to the front-side.
it works fine in a development environment like below picture. However when I deploy my app
on ec2, suddenly Node doesn't wait until Axios done its job. and just send empty object to the front-side below is console and my codes.
your help will be appreciated, thx for reading :)

in dev environment :)))

in prod environment :(((

app.post("/main", (req, res) => {

  console.log(req.body)
  let gottendID;
  const ltuid = gottendID || xxxxxxxx;

  (async () => {

      const cookie = `coookiecookie`;
      const dataMachine = axios.create({
        headers: {
          "User-Agent":
            "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36",
          Cookie: cookie,
          Accept: "application/json;charset=utf-8",
          // Referrer: "https://webstatic-sea.mihoyo.com/",
          Referrer: "https://act.hoyolab.com/",
          "x-rpc-language": "ko-kr",
          "x-rpc-client_type": "4",
          "x-rpc-app_version": "1.5.0",
          DS: "",
        },
      });
      dataMachine.interceptors.request.use((config) => {
        config.headers.DS = generateDSToken();
        return config;
      });
      const result = await dataMachine
        .get(
          `https://bbs-api-os.hoyolab.com/game_record/card/wapi/getGameRecordCard?uid=${
            parseCookie(cookie).ltuid
          }`
        )
      .then((res) => res.data.data.list[0])
      .catch((err) => console.log(err));

      const gameRoleId = result.game_role_id;
      const server = result.region;

      let now = new Date();
    let currentMonth = now.getMonth() + 1;
      console.log(`currentMonth : ` + currentMonth);
      const travelerNote = await dataMachine
        .get(
          `https://sg-hk4e-api.hoyolab.com/event/ysledgeros/month_info?month=${currentMonth}&region=os_asia&uid=${gameRoleId}&lang=ko-kr`
        )
        .then((res) => res.data.data);

      let notePrimoRewards = [];
      let i = 1;
      while (true) {
        const detailPrimoNote = await dataMachine
          .get(
            `https://hk4e-api-os.mihoyo.com/event/ysledgeros/month_detail?month=${currentMonth}&current_page=${i}&type=1&region=${server}&uid=${gameRoleId}&lang=ko-kr`
          )
          .then((res) => res.data.data?.list)
        if (!detailPrimoNote) break;
        if (!detailPrimoNote.length) break;
        notePrimoRewards.push(detailPrimoNote);

        i++;
      }
      notePrimoRewards = notePrimoRewards.flat();
      console.log(
        `${currentMonth}월 원석보상 ${notePrimoRewards.length}번 받았음`
    );

    let noteMoraRewards = [];
    let j = 1;
    while (true) {
      const detailMoraNote = await dataMachine
        .get(
          `https://hk4e-api-os.mihoyo.com/event/ysledgeros/month_detail?month=${currentMonth}&current_page=${j}&type=2&region=${server}&uid=${gameRoleId}&lang=ko-kr`
        )
        .then((res) => res.data.data?.list);
      if (!detailMoraNote) break;
      if (!detailMoraNote.length) break;

      noteMoraRewards.push(detailMoraNote);

      j++;
    }
    noteMoraRewards = noteMoraRewards.flat();
    console.log(
      `${currentMonth}월 모라보상 ${noteMoraRewards.length}번 받았음`
    );

      const profile = await dataMachine
        .get(
          `https://bbs-api-os.mihoyo.com/game_record/genshin/api/index?server=${server}&role_id=${gameRoleId};`
        )
        .then((res) => res.data.data);

      const character = await dataMachine
        .post(
          "https://bbs-api-os.mihoyo.com/game_record/genshin/api/character",
          {
            // character_ids: profile.avatars.map(c => c.id),
            role_id: gameRoleId,
            server,
          }
        )
      .then((res) => res.data.data);

      // console.log(character);
      // console.log(character.avatars.find(c => c.name === '베넷').weapon);

      /// this mofu send nothin on production :////
      res.send({
        user: result,
        profile: profile,
        character: character,
        mora: noteMoraRewards,
        primo: notePrimoRewards

      })
    })();

})


问:
Using Next.js Image component is making <title> empty
I have a slider component. Within this component I started using next.js Image components instead of standard image elements. Since making this switch, I have notice my title tags initially change based on the page correctly however, they become empty once the images render. I confirmed this by inspecting the element. Prior to making the switch to next.js Image I did not have this problem and the title tags remained populated based on the page/index. I did some googling and found this issue report Prevent unsetting title from document. I have since removed the title tag from _document.js and I am still having this issue. Any other ideas on how to fix this issue?

Here is my component:

```<code>//ProductSlider.js
import React, { Component } from "react";
import Slider from "react-slick";
import PropTypes from 'prop-types'
import Image from 'next/image'

class ProductSlider extends Component {
  render() {
    const settings = {
      //my setting here
    };
    let slider_data = this.props.slider_data
    let product_array = []
    for (let product in slider_data) {
      product_array.push(
        <div key={product+'product-slider'}>
          <Image
            src={slider_data[product].image}
            alt={slider_data[product].name}
            priority={true}
            width={'95px'}
            height={'95px'}
            className='product-slide'
          />
        </div>
      )
    }
    return (
      <div className="home-slick product-slick">
        <Slider {...settings}>
          {product_array}
        </Slider>
      </div>
    );
  }
}

ProductSlider.propTypes = {
  slider_data: PropTypes.array,
}

export default ProductSlider

</code>```

_document.js:

```<code>//_document.js
import Document, { Html, Head, NextScript } from 'next/document'

class MyDocument extends Document {
  static async getInitialProps(sb) {
    const initialProps = await Document.getInitialProps(sb)
    return { ...initialProps }
  }

  render() {
    return (
      <Html>
        <Head>
          <link rel="apple-touch-icon" href="/favicon.png" />
          <link rel="icon" href="/favicon.png" />
        </Head>
        <body>
          <Main />
          <NextScript />
        </body>
      </Html>
    )
  }
}

export default MyDocument
</code>```

I set all titles for each page using this function:

```<code>function SEO ({ title, description }) {
  return (
    <Helmet
      htmlAttributes={{
        lang,
      }}>
      <title>{title}</title>
      <link rel="manifest" href="/manifest.json" />
      <link rel="apple-touch-icon" href="/assets/images/favicon.png"></link>
      <meta name='description' content={description}/>
    </Helmet>
  )
}
</code>```

Update: I have since discovered that this is caused by priority={true} but have not found a solution since I still want priority to be true.

Body:
I have a slider component. Within this component I started using next.js Image components instead of standard image elements. Since making this switch, I have notice my title tags initially change based on the page correctly however, they become empty once the images render. I confirmed this by inspecting the element. Prior to making the switch to next.js Image I did not have this problem and the title tags remained populated based on the page/index. I did some googling and found this issue report Prevent unsetting title from document. I have since removed the title tag from _document.js and I am still having this issue. Any other ideas on how to fix this issue?

Here is my component:

//ProductSlider.js
import React, { Component } from "react";
import Slider from "react-slick";
import PropTypes from 'prop-types'
import Image from 'next/image'

class ProductSlider extends Component {
  render() {
    const settings = {
      //my setting here
    };
    let slider_data = this.props.slider_data
    let product_array = []
    for (let product in slider_data) {
      product_array.push(

          <Image
            src={slider_data[product].image}
            alt={slider_data[product].name}
            priority={true}
            width={'95px'}
            height={'95px'}
            className='product-slide'
          />

      )
    }
    return (

        <Slider {...settings}>
          {product_array}
        </Slider>

    );
  }
}

ProductSlider.propTypes = {
  slider_data: PropTypes.array,
}

export default ProductSlider

_document.js:

//_document.js
import Document, { Html, Head, NextScript } from 'next/document'

class MyDocument extends Document {
  static async getInitialProps(sb) {
    const initialProps = await Document.getInitialProps(sb)
    return { ...initialProps }
  }

  render() {
    return (

          <link rel="apple-touch-icon" href="/favicon.png" />
          <link rel="icon" href="/favicon.png" />

          <NextScript />

    )
  }
}

export default MyDocument

I set all titles for each page using this function:

function SEO ({ title, description }) {
  return (
    <Helmet
      htmlAttributes={{
        lang,
      }}>
      <title>{title}</title>
      <link rel="manifest" href="/manifest.json" />
      <link rel="apple-touch-icon" href="/assets/images/favicon.png"></link>
      <meta name='description' content={description}/>
    </Helmet>
  )
}

Update: I have since discovered that this is caused by priority={true} but have not found a solution since I still want priority to be true.


问:
Docker multistage build nextjs - why three stage?
I have been looking into optimising our docker images and have been implementing multi stage builds as part of this.

From my understanding the benefit is that the final image can be a streamlined version that simply has all the needed files copied in from the previous build stages, meaning it doesn't need all the various tools and packages involved during the build process.

However all the examples I've seen for building a nextjs docker image seem to have three stages, one to install the node modules, one to build the app, then the final version, for example this one:

    # Stage 1: install dependencies
    FROM node:17-alpine AS deps
    WORKDIR /app
    COPY package*.json .
    ARG NODE_ENV
    ENV NODE_ENV $NODE_ENV
    RUN npm install

    # Stage 2: build
    FROM node:17-alpine AS builder
    WORKDIR /app
    COPY --from=deps /app/node_modules ./node_modules
    COPY src ./src
    COPY public ./public
    COPY package.json next.config.js jsconfig.json ./
    RUN npm run build

    # Stage 3: run
    FROM node:17-alpine
    WORKDIR /app
    COPY --from=builder /app/.next ./.next
    COPY --from=builder /app/public ./public
    COPY --from=builder /app/node_modules ./node_modules
    COPY --from=builder /app/package.json ./
    CMD ["npm", "run", "start"]
```

What does this give you that a two stage doesn't? i.e. why wouldn't you just have the install and build in the same stage, it seems to me that the final image would end up exactly the same either way?

Body:
I have been looking into optimising our docker images and have been implementing multi stage builds as part of this.

From my understanding the benefit is that the final image can be a streamlined version that simply has all the needed files copied in from the previous build stages, meaning it doesn't need all the various tools and packages involved during the build process.

However all the examples I've seen for building a nextjs docker image seem to have three stages, one to install the node modules, one to build the app, then the final version, for example this one:

    # Stage 1: install dependencies
    FROM node:17-alpine AS deps
    WORKDIR /app
    COPY package*.json .
    ARG NODE_ENV
    ENV NODE_ENV $NODE_ENV
    RUN npm install

    # Stage 2: build
    FROM node:17-alpine AS builder
    WORKDIR /app
    COPY --from=deps /app/node_modules ./node_modules
    COPY src ./src
    COPY public ./public
    COPY package.json next.config.js jsconfig.json ./
    RUN npm run build

    # Stage 3: run
    FROM node:17-alpine
    WORKDIR /app
    COPY --from=builder /app/.next ./.next
    COPY --from=builder /app/public ./public
    COPY --from=builder /app/node_modules ./node_modules
    COPY --from=builder /app/package.json ./
    CMD ["npm", "run", "start"]

What does this give you that a two stage doesn't? i.e. why wouldn't you just have the install and build in the same stage, it seems to me that the final image would end up exactly the same either way?


问:
How to get weighted average of systemwide?
This is the data:

```<code>data5 = requests.get('https://data.ny.gov/resource/8mkn-d32t.json?$limit=1000000').text #pulling the data using API
json5 = json.loads(data5) #converting the data to json
cjtp_df = pd.DataFrame(json5) #storing json to dataframe for easier operations`

cjtp_df['month'] = pd.to_datetime(cjtp_df['month']) #converting the month column to datatime
cjtp_df['month'] = cjtp_df['month'].dt.strftime('%Y-%m') #formatting the datetime column as per the requirements
cjtp_df['number_of_customers'] = cjtp_df['number_of_customers'].astype(float)
cjtp_df['additional_bus_stop_time'] = cjtp_df['additional_bus_stop_time'].astype(float)
cjtp_df['additional_travel_time'] = cjtp_df['additional_travel_time'].astype(float)
cjtp_df['customer_journey_time'] = cjtp_df['customer_journey_time'].astype(float)
</code>```

This is what the data looks like

This is the systemwide code for what I have so far:

```<code># create a systemwide set of rows
cjtp_systemwide = cjtp_df.groupby(["month"]).agg(
        { "additional_bus_stop_time" : "sum" , "additional_travel_time" : "sum", "customer_journey_time": "sum" , "number_of_customers": "sum"}
    )
cjtp_systemwide["borough"] = 'Systemwide' #operation for system wide row
cjtp_systemwide['trip_type'] = 'Systemwide' #operation for system wide row
cjtp_systemwide['route_id'] = 'Systemwide' #operation for system wide row
cjtp_systemwide['period'] = 'Systemwide'#operation for system wide row
cjtp_systemwide["additional_bus_stop_time"] = (cjtp_systemwide["additional_bus_stop_time"]* cjtp_systemwide[ "number_of_customers"]) / cjtp_systemwide[ "number_of_customers"]
cjtp_systemwide["additional_travel_time"] = (cjtp_systemwide["additional_travel_time"]* cjtp_systemwide[ "number_of_customers"]) / cjtp_systemwide[ "number_of_customers"]
cjtp_systemwide["customer_journey_time"] = (cjtp_systemwide["customer_journey_time"]* cjtp_systemwide[ "number_of_customers"]) / cjtp_systemwide[ "number_of_customers"]
cjtp_systemwide.reset_index(inplace=True)
cjtp_df = pd.concat([cjtp_df, cjtp_systemwide])
cjtp_df.sort_values(by=["month", "borough", "trip_type"], ascending=[True, True, True], inplace=True)
cjtp = cjtp_df.reset_index(drop=True) #dropping the index
cjtp.tail(60)
</code>```

However the numbers are too large I know for a fact customer_journey_time (the last column) systemwide needs to be 0.698 or close to this

Body:
This is the data:

data5 = requests.get('https://data.ny.gov/resource/8mkn-d32t.json?$limit=1000000').text #pulling the data using API
json5 = json.loads(data5) #converting the data to json
cjtp_df = pd.DataFrame(json5) #storing json to dataframe for easier operations`

cjtp_df['month'] = pd.to_datetime(cjtp_df['month']) #converting the month column to datatime
cjtp_df['month'] = cjtp_df['month'].dt.strftime('%Y-%m') #formatting the datetime column as per the requirements
cjtp_df['number_of_customers'] = cjtp_df['number_of_customers'].astype(float)
cjtp_df['additional_bus_stop_time'] = cjtp_df['additional_bus_stop_time'].astype(float)
cjtp_df['additional_travel_time'] = cjtp_df['additional_travel_time'].astype(float)
cjtp_df['customer_journey_time'] = cjtp_df['customer_journey_time'].astype(float)

This is what the data looks like

This is the systemwide code for what I have so far:

# create a systemwide set of rows
cjtp_systemwide = cjtp_df.groupby(["month"]).agg(
        { "additional_bus_stop_time" : "sum" , "additional_travel_time" : "sum", "customer_journey_time": "sum" , "number_of_customers": "sum"}
    )
cjtp_systemwide["borough"] = 'Systemwide' #operation for system wide row
cjtp_systemwide['trip_type'] = 'Systemwide' #operation for system wide row
cjtp_systemwide['route_id'] = 'Systemwide' #operation for system wide row
cjtp_systemwide['period'] = 'Systemwide'#operation for system wide row
cjtp_systemwide["additional_bus_stop_time"] = (cjtp_systemwide["additional_bus_stop_time"]* cjtp_systemwide[ "number_of_customers"]) / cjtp_systemwide[ "number_of_customers"]
cjtp_systemwide["additional_travel_time"] = (cjtp_systemwide["additional_travel_time"]* cjtp_systemwide[ "number_of_customers"]) / cjtp_systemwide[ "number_of_customers"]
cjtp_systemwide["customer_journey_time"] = (cjtp_systemwide["customer_journey_time"]* cjtp_systemwide[ "number_of_customers"]) / cjtp_systemwide[ "number_of_customers"]
cjtp_systemwide.reset_index(inplace=True)
cjtp_df = pd.concat([cjtp_df, cjtp_systemwide])
cjtp_df.sort_values(by=["month", "borough", "trip_type"], ascending=[True, True, True], inplace=True)
cjtp = cjtp_df.reset_index(drop=True) #dropping the index
cjtp.tail(60)

However the numbers are too large I know for a fact customer_journey_time (the last column) systemwide needs to be 0.698 or close to this


问:
Google Identity Service Sign In with Google button flicker
I am trying to use the Sign In with Google button from the Google Identity Service. Each time I render one of the Sign In with Google buttons the font flickers.

The flickering seems to coincide with style changes of text within the google button. It turns out that the google button has 2 spans that hold identical text for the button label. One of these spans is set to display: none. When toggled to be visible, one can see that the flicker seems to be caused by the switching between these two spans for the label. Google Button on DOM.

The Google default font is Roboto, but after the flicker, the font of the span rendered is:

font-family: Gotham,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Droid Sans,Helvetica Neue,sans-serif;

It looks like the hidden button-label span does  have the Roboto font applied though. Could this have something to do with the fonts?

Is there any known way to resolve this flicker?

I have attempted using useMemo in order to resolve this but, so far I have not had any success.


Title: Data Sorting and filtering (From an Excel File)

Body:
Please refer to the Data Tables Below...

[Input table]

Input Table

TABLE:  Joint Reactions

Joint
LC
F1
F2
F3
M1
M2
M3

Text
Text
KN
KN
KN
KN-m
KN-m
KN-m

1
SF-DL
5.97
4.517
169.179
-2.167
3.249
-0.0042

1
OTH-DL
1.268
0.667
20.592
-0.3083
0.7476
0.0253

1
LL
1.488
1.3
16.341
-0.5738
0.7014
-0.0307

3
SF-DL
5.97
-4.517
169.179
2.167
3.249
0.0042

3
OTH-DL
1.268
-0.667
20.592
0.3083
0.7476
-0.0253

3
LL
1.488
-1.3
16.341
0.5738
0.7014
0.0307

5
SF-DL
1.024
6.039
201.94
-2.1923
0.7081
0.0165

5
OTH-DL
0.373
0.669
31.867
-0.3234
0.2567
0.0234

5
LL
0.2
7.297
28.116
-2.5342
0.1201
-0.021

7
SF-DL
1.024
-6.039
201.94
2.1923
0.7081
-0.0165

7
OTH-DL
0.373
-0.669
31.867
0.3234
0.2567
-0.0234

7
LL
0.2
-7.297
28.116
2.5342
0.1201
0.021

[output table in excel]

Output Table formulae results

TABLE:  Joint Reactions

Joint
LC
F1
F2
F3
M1
M2
M3

Text
Text
KN
KN
KN
KN-m
KN-m
KN-m

1
SF-DL
5.97
4.517
169.179
-2.167
3.249
-0.0042

3
SF-DL
5.97
-4.517
169.179
2.167
3.249
0.0042

5
SF-DL
1.024
6.039
201.94
-2.1923
0.7081
0.0165

7
SF-DL
1.024
-6.039
201.94
2.1923
0.7081
-0.0165

1
OTH-DL
1.268
0.667
20.592
-0.3083
0.7476
0.0253

3
OTH-DL
1.268
-0.667
20.592
0.3083
0.7476
-0.0253

5
OTH-DL
0.373
0.669
31.867
-0.3234
0.2567
0.0234

7
OTH-DL
0.373
-0.669
31.867
0.3234
0.2567
-0.0234

1
LL
1.488
1.3
16.341
-0.5738
0.7014
-0.0307

3
LL
1.488
-1.3
16.341
0.5738
0.7014
0.0307

5
LL
0.2
7.297
28.116
-2.5342
0.1201
-0.021

7
LL
0.2
-7.297
28.116
2.5342
0.1201
0.021

I want to sort and filter The Input Table and put the data in output table format.

I have an excel sheet prepared by my friend....He has done Sorting and Filtering using some formulae and functions....refer output table in excel.

I am new to python...and want to do the same thing in python...

extracting data from excel and saving a data frame in python

filtering and sorting as per output table in python

exporting the output table to excel.

Please help me in this regard.

I am unable to come up with a solution since I am new to python


问:
How to align contact 7 checkbox +Label to center horizontally on the page?
I can't seem to get the checkbox on the contact 7 form in WordPress to align in the center without turning everything in my form centered. I don't know what I'm doing wrong so if anyone could point me in the right direction I would be grateful.

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">

      First Name *<input id="form_name" type="text" name="name" class="form-control" required="required" data-error="name is required.">

      Last Name *<input id="form_name" type="text" name="surname" class="form-control" required="required" data-error="name is required.">

      Email *<input id="form_email" type="email" name="email" class="form-control" required="required" data-error="Valid email is required.">

      Phone Number *<input id="form_phone" type="tel" name="phone" class="form-control">

      Preferred Contact Method[text PreferredContactMethod "Email/Phone"]

      Desired Moving Date[date DesiredMovingDate]

      <position:center>
        Desired Unit Type[checkbox DesiredUnitType use_label_element "Studio" " 1-Bedroom " " 2-Bedroom " "3-Bedroom" "Penthouse"]

    Message[textarea Message]

[submit class:btn class:btn-default class:btn-sm "Send"]

```


问:
Display emoticons and special character in generated PDF from HTML content using wicked_pdf gem
I'd like to show special characters and emoticons in my pdf using wicked gem but the charset of my generated PDF is UTF-8.

pdf gem: https://github.com/mileszs/wicked_pdf

```<code># base_pdf
doctype html
html lang="#{I18n.locale}"
  head
    meta http-equiv="Content-Type" content="text/html" charset="utf-8"
    meta name="viewport" content="width=device-width, initial-scale=1.0"
    = wicked_pdf_stylesheet_link_tag "pdf"
    = wicked_pdf_javascript_include_tag "app"
  body onload="number_pages"
    #content
      = yield
</code>```

I would like emoticons like these (and not blank symbols) to appear in my pdf:

```<code> This is    Hot Dog  Hamburgers
</code>```

I would be grateful for your time.

Body:
I'd like to show special characters and emoticons in my pdf using wicked gem but the charset of my generated PDF is UTF-8.

pdf gem: https://github.com/mileszs/wicked_pdf

# base_pdf
doctype html
html lang="#{I18n.locale}"
  head
    meta http-equiv="Content-Type" content="text/html" charset="utf-8"
    meta name="viewport" content="width=device-width, initial-scale=1.0"
    = wicked_pdf_stylesheet_link_tag "pdf"
    = wicked_pdf_javascript_include_tag "app"
  body onload="number_pages"
    #content
      = yield

I would like emoticons like these (and not blank symbols) to appear in my pdf:

 This is    Hot Dog  Hamburgers

I would be grateful for your time.


问:
How to schedule a time range a rule should run daily on Elastic SIEM
Any idea on how to create time range a rule should run on Elastic SIEM.
For Example between 5:00 pm to 8:00 am daily.

I believe this is possible using DSL time range query, but I need a little help on how to do it.

Thanks

I tried using the DSL time query


问:
Why does my coherence plot show a value of one at frequencies where it should be undefined?
I have the two simple signals, one a cosine and the other a sine. Each is sampled at 1000 Hz for one second. I used Matplotlib to plot the coherence:

```<code>import numpy as np
from matplotlib import pyplot as plt

dt = .001
t = np.arange(0, 1, dt)
fs=int(1/dt)
f0=300

x = np.cos(2 * np.pi * f0 * t)
y = np.sin(2 * np.pi * f0 * t)

plt.cohere(x,y,Fs=fs)
plt.show()
</code>```

What I don't understand is why the values of coherence are shown to be defined and equal to one at frequencies other than 300 Hz. The power spectral densities of the two signals and the cross-spectral density are all zero except at 300 Hz, so the coherence is only defined at 300. (Unless we assume zero divided by zero equals one.) A plot obtained using coherence from scipy.signal produces a similar issue.

Body:
I have the two simple signals, one a cosine and the other a sine. Each is sampled at 1000 Hz for one second. I used Matplotlib to plot the coherence:

import numpy as np
from matplotlib import pyplot as plt

dt = .001
t = np.arange(0, 1, dt)
fs=int(1/dt)
f0=300

x = np.cos(2 * np.pi * f0 * t)
y = np.sin(2 * np.pi * f0 * t)

plt.cohere(x,y,Fs=fs)
plt.show()

What I don't understand is why the values of coherence are shown to be defined and equal to one at frequencies other than 300 Hz. The power spectral densities of the two signals and the cross-spectral density are all zero except at 300 Hz, so the coherence is only defined at 300. (Unless we assume zero divided by zero equals one.) A plot obtained using coherence from scipy.signal produces a similar issue.


问:
Writing a code in sql to find the active pregnant population for a time period of 1year
First i need to find a population where i have to use some diag code to find all the women who are pregnant. For that i need the min start date and the end date but the end date should not be more than 9 months as no one can be pregnant for more than 9 months.
Next i need to add a layer and to identify if someone  had a delivery or mischarrige or abortion and for that time period
then i need to join the 2 tables

*also need to make sure that i am   grabbing the first "end_date" that is closest to the start_date as there can be multiple pregnancies

```<code>with alldata as
(SELECT DISTINCT  Member_Nbr,min(start_date) as start_of_pregnancy,min(end_date) as end_of_pregnancy
                            FROM
                            (SELECT Member_Nbr, START_DATE,end_date,Admit_Diag_Code, Principal_Diag_Code, Diag_Code_2, Diag_Code_3, Diag_Code_4, Diag_Code_5, Diag_Code_6, Diag_Code_7,
                                        Diag_Code_8, Diag_Code_9, Diag_Code_10, Diag_Code_11, Diag_Code_12, Diag_Code_13, Diag_Code_14, Diag_Code_15, Diag_Code_16,
                                        Diag_Code_17, Diag_Code_18, Diag_Code_19, Diag_Code_20, Diag_Code_21, Diag_Code_22, Diag_Code_23, Diag_Code_24, Diag_Code_25
                            FROM [DM_ODS].[dbo].[DM_CLAIM]
                            where Start_Date>'2022-01-01'
                          ) AS A
                            UNPIVOT
                            (Diag FOR Diags IN (Admit_Diag_Code, Principal_Diag_Code, Diag_Code_2, Diag_Code_3, Diag_Code_4, Diag_Code_5, Diag_Code_6, Diag_Code_7,
                                        Diag_Code_8, Diag_Code_9, Diag_Code_10, Diag_Code_11, Diag_Code_12, Diag_Code_13, Diag_Code_14, Diag_Code_15, Diag_Code_16,
                                        Diag_Code_17, Diag_Code_18, Diag_Code_19, Diag_Code_20, Diag_Code_21, Diag_Code_22, Diag_Code_23, Diag_Code_24, Diag_Code_25)
                            ) AS B
                           WHERE Diag LIKE '%z34%' or diag like '%o09%' or diag in ('z33.1','z33.3') /*these codes define memebers who are pregnant */
                    group by member_nbr) ,
        pregdata as
        (
        Select drg_version, drg_code, start_date, Member_Nbr,End_Date as end_of_pregnancy
            from [DM_ODS].[dbo].[DM_CLAIM] D
            WHERE start_date > dateadd(month, -9,  cast(getdate() as date)) and
            (
            (DRG_Version LIKE ('APR%') AND
                (DRG_Code LIKE ('542%') OR DRG_Code LIKE ('521%')OR
                DRG_Code LIKE ('560%') OR DRG_Code LIKE ('541%') OR DRG_Code LIKE ('539%')
                OR DRG_Code LIKE ('566%') OR DRG_Code LIKE ('564%') OR DRG_Code LIKE ('543%')
                OR DRG_Code LIKE ('548%') OR DRG_Code LIKE ('547%') OR DRG_Code LIKE ('561%')
                )
            ) OR
         (DRG_Version LIKE ('MS%') AND
                DRG_CODE IN ('807','806','805','768','796','797','798','788','787','785','786','784','783','776','769','770','779','788')/* these codes define if there has been a delievry or any miscarriage of abortion*/
            ))
            )
    select alldata.member_nbr, alldata.start_of_pregnancy,pregdata.end_of_pregnancy,DRG_Version, pregdata.DRG_Code
    from alldata left join pregdata on alldata.member_nbr=pregdata.member_nbr

</code>```

Body:
First i need to find a population where i have to use some diag code to find all the women who are pregnant. For that i need the min start date and the end date but the end date should not be more than 9 months as no one can be pregnant for more than 9 months.
Next i need to add a layer and to identify if someone  had a delivery or mischarrige or abortion and for that time period
then i need to join the 2 tables

*also need to make sure that i am   grabbing the first "end_date" that is closest to the start_date as there can be multiple pregnancies

with alldata as
(SELECT DISTINCT  Member_Nbr,min(start_date) as start_of_pregnancy,min(end_date) as end_of_pregnancy
                            FROM
                            (SELECT Member_Nbr, START_DATE,end_date,Admit_Diag_Code, Principal_Diag_Code, Diag_Code_2, Diag_Code_3, Diag_Code_4, Diag_Code_5, Diag_Code_6, Diag_Code_7,
                                        Diag_Code_8, Diag_Code_9, Diag_Code_10, Diag_Code_11, Diag_Code_12, Diag_Code_13, Diag_Code_14, Diag_Code_15, Diag_Code_16,
                                        Diag_Code_17, Diag_Code_18, Diag_Code_19, Diag_Code_20, Diag_Code_21, Diag_Code_22, Diag_Code_23, Diag_Code_24, Diag_Code_25
                            FROM [DM_ODS].[dbo].[DM_CLAIM]
                            where Start_Date>'2022-01-01'
                          ) AS A
                            UNPIVOT
                            (Diag FOR Diags IN (Admit_Diag_Code, Principal_Diag_Code, Diag_Code_2, Diag_Code_3, Diag_Code_4, Diag_Code_5, Diag_Code_6, Diag_Code_7,
                                        Diag_Code_8, Diag_Code_9, Diag_Code_10, Diag_Code_11, Diag_Code_12, Diag_Code_13, Diag_Code_14, Diag_Code_15, Diag_Code_16,
                                        Diag_Code_17, Diag_Code_18, Diag_Code_19, Diag_Code_20, Diag_Code_21, Diag_Code_22, Diag_Code_23, Diag_Code_24, Diag_Code_25)
                            ) AS B
                           WHERE Diag LIKE '%z34%' or diag like '%o09%' or diag in ('z33.1','z33.3') /*these codes define memebers who are pregnant */
                    group by member_nbr) ,
        pregdata as
        (
        Select drg_version, drg_code, start_date, Member_Nbr,End_Date as end_of_pregnancy
            from [DM_ODS].[dbo].[DM_CLAIM] D
            WHERE start_date > dateadd(month, -9,  cast(getdate() as date)) and
            (
            (DRG_Version LIKE ('APR%') AND
                (DRG_Code LIKE ('542%') OR DRG_Code LIKE ('521%')OR
                DRG_Code LIKE ('560%') OR DRG_Code LIKE ('541%') OR DRG_Code LIKE ('539%')
                OR DRG_Code LIKE ('566%') OR DRG_Code LIKE ('564%') OR DRG_Code LIKE ('543%')
                OR DRG_Code LIKE ('548%') OR DRG_Code LIKE ('547%') OR DRG_Code LIKE ('561%')
                )
            ) OR
         (DRG_Version LIKE ('MS%') AND
                DRG_CODE IN ('807','806','805','768','796','797','798','788','787','785','786','784','783','776','769','770','779','788')/* these codes define if there has been a delievry or any miscarriage of abortion*/
            ))
            )
    select alldata.member_nbr, alldata.start_of_pregnancy,pregdata.end_of_pregnancy,DRG_Version, pregdata.DRG_Code
    from alldata left join pregdata on alldata.member_nbr=pregdata.member_nbr


问:
Grid View in ASP.net
I have created a Grid view Table in asp.net from Cloud Firestore. First I created a list to push the data in Class then I bind that class to Grid View. I have also implemented Pagging of 10 in the Gridview.

I have 33 rows in my table but when the grid view load after 33 row1 gets autopopulated.

Below is the code.

**Grid View Load : **

```<code> private async void LoadGridView()
    {
    Query qref = fstrore.Collection("User").Document(UID).Collection("Product");
    QuerySnapshot snap = await qref.GetSnapshotAsync();
    foreach (DocumentSnapshot pn in snap)
    {
    ProDetails pro = pn.ConvertTo<ProDetails>();
    ProName.Add(new ProDetails()
    {
    ProductName = pro.ProductName,
    ProductQuantity = pro.ProductQuantity,
    PricePerPiece = pro.PricePerPiece,
    ProductPacket = pro.ProductPacket,
    ProductDistributor = pro.ProductDistributor,
    ProductCategory = pro.ProductCategory,
    ProductExpiryDt = pro.ProductExpiryDt,
    ProductAddDt = pro.ProductAddDt.Date,
    ProductUpdateDt = pro.ProductUpdateDt.Date,
    ProductUpdateFlag = pro.ProductUpdateFlag
    });
    }
    GD1.DataSource = ProName;
    GD1.DataBind();
    }
</code>```

Pagging :

```<code>    {
    GD1.PageIndex = e.NewPageIndex;
    this.LoadGridView();
    }
</code>```

ASPX Code :

```<code><asp:GridView ID="GD1" runat="server" AutoGenerateColumns="false" AllowPaging="true" OnPageIndexChanging="GD1_PageIndexChanging"
    Style="margin-top: 20px; width: 100%; border-inline-width: 0.5px; border-block-width: 0.5px" PagerSettings-FirstPageText="First"
    PagerSettings-LastPageText="Last" PagerSettings-Position="TopAndBottom" PagerStyle-CssClass="pgstyle" PagerSettings-Mode="Numeric"
    HorizontalAlign="NotSet" PagerSettings-NextPageText="Next" PagerSettings-PreviousPageText="Prev" PagerSettings-Visible="True" PagerStyle-BackColor="#EAFAF1" PagerSettings-PageButtonCount="4" RowStyle-Wrap="True">
    <Columns>
    <asp:TemplateField HeaderText="SrNo">
    <ItemTemplate>
    <%# Container.DataItemIndex + 1 %>
    </ItemTemplate>
    </asp:TemplateField>
    <%--Name --%>
    <asp:TemplateField HeaderText="Product Name">
    <ItemTemplate>
    <%#Eval("ProductName") %>
    </ItemTemplate>
    </asp:TemplateField>
    <%--Quantity --%>
    <asp:TemplateField HeaderText="Quantity">
    <ItemTemplate>
    <%#Eval("ProductQuantity")%>
    </ItemTemplate>
    </asp:TemplateField>
    <%--Price --%>
    <asp:TemplateField HeaderText="Price Per Piece">
    <ItemTemplate>
    <%#Eval("PricePerPiece") %>
    </ItemTemplate>
    </asp:TemplateField>
    <%--Packet --%>
    <asp:TemplateField HeaderText="Packet Quantity">
    <ItemTemplate>
    <%#Eval("ProductPacket") %>
    </ItemTemplate>
    </asp:TemplateField>
    <%--Disributor --%>
    <asp:TemplateField HeaderText="Distributor">
    <ItemTemplate>
    <%#Eval("ProductDistributor") %>
    </ItemTemplate>
    </asp:TemplateField>
    <%--Category --%>
    <asp:TemplateField HeaderText="Category">
    <ItemTemplate>
    <%#Eval("ProductCategory") %>
    </ItemTemplate>
    </asp:TemplateField>
    <%--Expiry --%>
    <asp:TemplateField HeaderText="Expiry Date">
    <ItemTemplate>
    <%#Eval("ProductExpiryDt", "{0:dd-MM-yyyy}") %>
    </ItemTemplate>
    </asp:TemplateField>
    <%--Add Date --%>
    <asp:TemplateField HeaderText="Added On">
    <ItemTemplate>
    <%#Eval("ProductAddDt", "{0:dd-MM-yyyy}") %>
    </ItemTemplate>
    </asp:TemplateField>
    <%--Update Date --%>
    <asp:TemplateField HeaderText="Update Date">
    <ItemTemplate>
    <%#Eval("ProductUpdateDt", "{0:dd-MM-yyyy}") %>
    </ItemTemplate>
    </asp:TemplateField>
    <%--Update Flag --%>
    <asp:TemplateField HeaderText="Update Flag">
    <ItemTemplate>
    <%#Eval("ProductUpdateFlag") %>
    </ItemTemplate>
    </asp:TemplateField>
    </Columns>
    <HeaderStyle BackColor="#D4E6F1" CssClass="gdheader" />
    <RowStyle CssClass="gdrow" />
    </asp:GridView>

</code>```

Page 4 where you get row first automatically
Page 1

Please let me know where am i getting this wrong

Title: Grid View in ASP.net

Body:
I have created a Grid view Table in asp.net from Cloud Firestore. First I created a list to push the data in Class then I bind that class to Grid View. I have also implemented Pagging of 10 in the Gridview.

I have 33 rows in my table but when the grid view load after 33 row1 gets autopopulated.

Below is the code.

**Grid View Load : **

 private async void LoadGridView()
    {
    Query qref = fstrore.Collection("User").Document(UID).Collection("Product");
    QuerySnapshot snap = await qref.GetSnapshotAsync();
    foreach (DocumentSnapshot pn in snap)
    {
    ProDetails pro = pn.ConvertTo<ProDetails>();
    ProName.Add(new ProDetails()
    {
    ProductName = pro.ProductName,
    ProductQuantity = pro.ProductQuantity,
    PricePerPiece = pro.PricePerPiece,
    ProductPacket = pro.ProductPacket,
    ProductDistributor = pro.ProductDistributor,
    ProductCategory = pro.ProductCategory,
    ProductExpiryDt = pro.ProductExpiryDt,
    ProductAddDt = pro.ProductAddDt.Date,
    ProductUpdateDt = pro.ProductUpdateDt.Date,
    ProductUpdateFlag = pro.ProductUpdateFlag
    });
    }
    GD1.DataSource = ProName;
    GD1.DataBind();
    }

Pagging :

    {
    GD1.PageIndex = e.NewPageIndex;
    this.LoadGridView();
    }

ASPX Code :

<asp:GridView ID="GD1" runat="server" AutoGenerateColumns="false" AllowPaging="true" OnPageIndexChanging="GD1_PageIndexChanging"
    Style="margin-top: 20px; width: 100%; border-inline-width: 0.5px; border-block-width: 0.5px" PagerSettings-FirstPageText="First"
    PagerSettings-LastPageText="Last" PagerSettings-Position="TopAndBottom" PagerStyle-CssClass="pgstyle" PagerSettings-Mode="Numeric"
    HorizontalAlign="NotSet" PagerSettings-NextPageText="Next" PagerSettings-PreviousPageText="Prev" PagerSettings-Visible="True" PagerStyle-BackColor="#EAFAF1" PagerSettings-PageButtonCount="4" RowStyle-Wrap="True">
    <Columns>
    <asp:TemplateField HeaderText="SrNo">
    <ItemTemplate>
    <%# Container.DataItemIndex + 1 %>
    </ItemTemplate>
    </asp:TemplateField>
    <%--Name --%>
    <asp:TemplateField HeaderText="Product Name">
    <ItemTemplate>
    <%#Eval("ProductName") %>
    </ItemTemplate>
    </asp:TemplateField>
    <%--Quantity --%>
    <asp:TemplateField HeaderText="Quantity">
    <ItemTemplate>
    <%#Eval("ProductQuantity")%>
    </ItemTemplate>
    </asp:TemplateField>
    <%--Price --%>
    <asp:TemplateField HeaderText="Price Per Piece">
    <ItemTemplate>
    <%#Eval("PricePerPiece") %>
    </ItemTemplate>
    </asp:TemplateField>
    <%--Packet --%>
    <asp:TemplateField HeaderText="Packet Quantity">
    <ItemTemplate>
    <%#Eval("ProductPacket") %>
    </ItemTemplate>
    </asp:TemplateField>
    <%--Disributor --%>
    <asp:TemplateField HeaderText="Distributor">
    <ItemTemplate>
    <%#Eval("ProductDistributor") %>
    </ItemTemplate>
    </asp:TemplateField>
    <%--Category --%>
    <asp:TemplateField HeaderText="Category">
    <ItemTemplate>
    <%#Eval("ProductCategory") %>
    </ItemTemplate>
    </asp:TemplateField>
    <%--Expiry --%>
    <asp:TemplateField HeaderText="Expiry Date">
    <ItemTemplate>
    <%#Eval("ProductExpiryDt", "{0:dd-MM-yyyy}") %>
    </ItemTemplate>
    </asp:TemplateField>
    <%--Add Date --%>
    <asp:TemplateField HeaderText="Added On">
    <ItemTemplate>
    <%#Eval("ProductAddDt", "{0:dd-MM-yyyy}") %>
    </ItemTemplate>
    </asp:TemplateField>
    <%--Update Date --%>
    <asp:TemplateField HeaderText="Update Date">
    <ItemTemplate>
    <%#Eval("ProductUpdateDt", "{0:dd-MM-yyyy}") %>
    </ItemTemplate>
    </asp:TemplateField>
    <%--Update Flag --%>
    <asp:TemplateField HeaderText="Update Flag">
    <ItemTemplate>
    <%#Eval("ProductUpdateFlag") %>
    </ItemTemplate>
    </asp:TemplateField>
    </Columns>
    <HeaderStyle BackColor="#D4E6F1" CssClass="gdheader" />
    <RowStyle CssClass="gdrow" />
    </asp:GridView>

Page 4 where you get row first automatically
Page 1

Please let me know where am i getting this wrong


问:
Django Python Link Dropdown Element to Database
I am working on creating a web application that will generate a report for visiting different office locations. I have implemented the choices option in a model and placed all the different offices within the choices. One of the things we have to do is take inventory of the equipment in the office ex. computers in use, computers not in user, monitors in use, monitors not in use, etc. I am wanting to make it so that essentially each inventory report is linked to the correct location based on what the user has selected so that these reports can be called later. I currently do not have a ton of code as I decided to focus on the inventory portion first. But is it even possible to link whatever the user selects as the location as the way to call previous reports? Also, would I need to create a model for each location they would be the same as the below model?

Below is what I have like a said not much

```<code>from django.db import models

OFFICE_CHOICES = (
    ('Akron, OH', 'AKRON'),
    ('Atlanta, GA', 'ATLANTA'),
    ('Austin, TX', 'AUSTIN'),
    ('Birmingham, AL', 'BIRGMINGHAM'),
    ('Boston, MA', 'BOSTON'),
    ('Charleston, SC', 'CHARLESTON_SC'),
    ('Charleston, WV', 'CHARLESTON_WV'),
    ('Charlotte, NC', 'CHARLOTTE'),
    ('Chicago West, IL', 'CHICAGO_WEST'),
    ('Chicago, IL', 'CHICAGO'),
    ('Cleveland, OH', 'CLEVELAND'),
    ('Denver, CO', 'DENVER'),
    ('Dallas, TX', 'DALLAS'),
    ('Evansville, IN', 'EVANSVILLE'),
    ('Fayetteville, AR', 'FAYETTEVILLE'),
    ('Ft Lauderdale, FL', 'FT LAUDERDALE'),
    ('Ft Wayne, IN', 'FT WAYNE'),
    ('Grand Rapids, MI', 'GRAND RAPIDS'),
    ('Greensboro, NC', 'GREENSBORO'),
    ('Greenville, SC', 'GREENVILLE'),
    ('Houston, TX', 'HOUSTON'),
    ('Indianapolis, IN', 'INDIANAPOLIS'),
    ('Jacksonville, FL', 'JACKSONVILLE'),
    ('Kansas City, MO', 'KANSAS CITY'),
    ('Knoxville, TN', 'KNOXVILLE'),
    ('Las Vegas, NV', 'LAS VEGAS'),
    ('Lexington, KY', 'LEXINGTON'),
    ('Louisville, KY', 'LOUISVILLE'),
    ('Memphis, TN', 'MEMPHIS'),
    ('Milwaukee, WI', 'MILWAUKEE'),
    ('Minneapolis, MN', 'MINNEAPOLIS'),
    ('Mobile, AL', 'MOBILE'),
    ('Nashville, TN', 'NASHVILLE'),
    ('New Orleans, LA', 'NEW ORLEANS'),
    ('Orlando, FL', 'ORLANDO'),
    ('Phoenix, AZ', 'PHOENIX'),
    ('Pittsburgh, PA', 'PITTSBURGH'),
    ('Portland, OR', 'PORTLAND'),
    ('Raleigh, NC', 'RALEIGH'),
    ('Richmond, VA', 'RICHMOND'),
    ('Salt Lake City, UT', 'SALT LAKE CITY'),
    ('San Antonio, TX', 'SAN ANTONIO'),
    ('Savannah, GA', 'SAVANNAH'),
    ('St Louis, MO', 'ST LOUIS'),
    ('Tampa, FL', 'TAMPA'),
    ('Toledo, OH', 'TOLEDO'),
)

# class Inventory(models.Model):
#     pcs = models.PositiveIntegerField()
#     laptop = models.PositiveIntegerField()
#     monitors = models.PositiveIntegerField()
#     webcams = models.PositiveIntegerField()
#     phones = models.PositiveIntegerField()
#     headsets = models.PositiveIntegerField()
#     directconnect = models.PositiveIntegerField()
#     workstations = models.PositiveIntegerField()
#     deskchair = models.PositiveIntegerField()
#     wireless_headset = models.PositiveIntegerField()
#     vpn_phone = models.PositiveIntegerField()
#     three_monitor = models.PositiveIntegerField()
#     visitor_station = models.PositiveIntegerField()
#     applicant_station = models.PositiveIntegerField()

class Akron_Inv(models.Model):
    location = models.CharField(max_length=20, choices=OFFICE_CHOICES, default='Select the office')
    description = models.CharField(max_length=30)
    in_use = models.PositiveIntegerField()
    training_room = models.PositiveIntegerField()
    conference_room = models.PositiveIntegerField()
    gsm_office = models.PositiveIntegerField()
    prospecting_station = models.PositiveIntegerField()
    applicant_station = models.PositiveIntegerField()
    visitor_station = models.PositiveIntegerField()
    other = models.PositiveIntegerField()
    spare_on_floor = models.PositiveIntegerField()
    spare_storage = models.PositiveIntegerField()
    total_spare = models.PositiveIntegerField()
    broken = models.PositiveIntegerField()
    total = models.PositiveIntegerField()
</code>```

Hoping to get some guidance on the best way to start this project.

Body:
I am working on creating a web application that will generate a report for visiting different office locations. I have implemented the choices option in a model and placed all the different offices within the choices. One of the things we have to do is take inventory of the equipment in the office ex. computers in use, computers not in user, monitors in use, monitors not in use, etc. I am wanting to make it so that essentially each inventory report is linked to the correct location based on what the user has selected so that these reports can be called later. I currently do not have a ton of code as I decided to focus on the inventory portion first. But is it even possible to link whatever the user selects as the location as the way to call previous reports? Also, would I need to create a model for each location they would be the same as the below model?

Below is what I have like a said not much

from django.db import models

OFFICE_CHOICES = (
    ('Akron, OH', 'AKRON'),
    ('Atlanta, GA', 'ATLANTA'),
    ('Austin, TX', 'AUSTIN'),
    ('Birmingham, AL', 'BIRGMINGHAM'),
    ('Boston, MA', 'BOSTON'),
    ('Charleston, SC', 'CHARLESTON_SC'),
    ('Charleston, WV', 'CHARLESTON_WV'),
    ('Charlotte, NC', 'CHARLOTTE'),
    ('Chicago West, IL', 'CHICAGO_WEST'),
    ('Chicago, IL', 'CHICAGO'),
    ('Cleveland, OH', 'CLEVELAND'),
    ('Denver, CO', 'DENVER'),
    ('Dallas, TX', 'DALLAS'),
    ('Evansville, IN', 'EVANSVILLE'),
    ('Fayetteville, AR', 'FAYETTEVILLE'),
    ('Ft Lauderdale, FL', 'FT LAUDERDALE'),
    ('Ft Wayne, IN', 'FT WAYNE'),
    ('Grand Rapids, MI', 'GRAND RAPIDS'),
    ('Greensboro, NC', 'GREENSBORO'),
    ('Greenville, SC', 'GREENVILLE'),
    ('Houston, TX', 'HOUSTON'),
    ('Indianapolis, IN', 'INDIANAPOLIS'),
    ('Jacksonville, FL', 'JACKSONVILLE'),
    ('Kansas City, MO', 'KANSAS CITY'),
    ('Knoxville, TN', 'KNOXVILLE'),
    ('Las Vegas, NV', 'LAS VEGAS'),
    ('Lexington, KY', 'LEXINGTON'),
    ('Louisville, KY', 'LOUISVILLE'),
    ('Memphis, TN', 'MEMPHIS'),
    ('Milwaukee, WI', 'MILWAUKEE'),
    ('Minneapolis, MN', 'MINNEAPOLIS'),
    ('Mobile, AL', 'MOBILE'),
    ('Nashville, TN', 'NASHVILLE'),
    ('New Orleans, LA', 'NEW ORLEANS'),
    ('Orlando, FL', 'ORLANDO'),
    ('Phoenix, AZ', 'PHOENIX'),
    ('Pittsburgh, PA', 'PITTSBURGH'),
    ('Portland, OR', 'PORTLAND'),
    ('Raleigh, NC', 'RALEIGH'),
    ('Richmond, VA', 'RICHMOND'),
    ('Salt Lake City, UT', 'SALT LAKE CITY'),
    ('San Antonio, TX', 'SAN ANTONIO'),
    ('Savannah, GA', 'SAVANNAH'),
    ('St Louis, MO', 'ST LOUIS'),
    ('Tampa, FL', 'TAMPA'),
    ('Toledo, OH', 'TOLEDO'),
)

# class Inventory(models.Model):
#     pcs = models.PositiveIntegerField()
#     laptop = models.PositiveIntegerField()
#     monitors = models.PositiveIntegerField()
#     webcams = models.PositiveIntegerField()
#     phones = models.PositiveIntegerField()
#     headsets = models.PositiveIntegerField()
#     directconnect = models.PositiveIntegerField()
#     workstations = models.PositiveIntegerField()
#     deskchair = models.PositiveIntegerField()
#     wireless_headset = models.PositiveIntegerField()
#     vpn_phone = models.PositiveIntegerField()
#     three_monitor = models.PositiveIntegerField()
#     visitor_station = models.PositiveIntegerField()
#     applicant_station = models.PositiveIntegerField()

class Akron_Inv(models.Model):
    location = models.CharField(max_length=20, choices=OFFICE_CHOICES, default='Select the office')
    description = models.CharField(max_length=30)
    in_use = models.PositiveIntegerField()
    training_room = models.PositiveIntegerField()
    conference_room = models.PositiveIntegerField()
    gsm_office = models.PositiveIntegerField()
    prospecting_station = models.PositiveIntegerField()
    applicant_station = models.PositiveIntegerField()
    visitor_station = models.PositiveIntegerField()
    other = models.PositiveIntegerField()
    spare_on_floor = models.PositiveIntegerField()
    spare_storage = models.PositiveIntegerField()
    total_spare = models.PositiveIntegerField()
    broken = models.PositiveIntegerField()
    total = models.PositiveIntegerField()

Hoping to get some guidance on the best way to start this project.


问:
fixed Blocked loading mixed active content in firefox because of HTTP
I deployed my react app in netlify and now when I want to login in my app I received

Blocked loading mixed active content

I did a lot search about that and I found out I have to change my request from http to https but now I am not able to do this,is there any other way to address this bug?


问:
RestClient AddFile throwing FileNotFoundException but file is there
I want to upload a file to S3, I have the signedUrl as param

RestClient AddFile throwing FileNotFoundException but the file is there

```<code>    public async Task <string> UploadFile(string signUrl, string fileId, string fileName, string filePath)
    {
        var client = new RestClient(signUrl);
        var request = new RestRequest(signUrl, Method.Put);

        request.AddHeader("accept", "application/json");
        request.AddHeader("content-type", "application/json");
        request.AddFile(fileName, filePath); // Expection here!

        System.Console.WriteLine("File was uploaded");
        // upload the file

        RestResponse response = await client.ExecuteAsync(request);
        return response.Content;
    }
</code>```

from the debugger:

```<code>fileName: "sample-file1.json"

filePath: "/Users/user1/dev/projects/biot-device-sample-csharp/BioT.DeviceSample/BioT.DeviceSample/bin/Debug/netcoreapp3.1/assets"
</code>```

when I do cat command in terminal I can print the file content

Body:
I want to upload a file to S3, I have the signedUrl as param

RestClient AddFile throwing FileNotFoundException but the file is there

    public async Task <string> UploadFile(string signUrl, string fileId, string fileName, string filePath)
    {
        var client = new RestClient(signUrl);
        var request = new RestRequest(signUrl, Method.Put);

        request.AddHeader("accept", "application/json");
        request.AddHeader("content-type", "application/json");
        request.AddFile(fileName, filePath); // Expection here!

        System.Console.WriteLine("File was uploaded");
        // upload the file

        RestResponse response = await client.ExecuteAsync(request);
        return response.Content;
    }

from the debugger:

fileName: "sample-file1.json"

filePath: "/Users/user1/dev/projects/biot-device-sample-csharp/BioT.DeviceSample/BioT.DeviceSample/bin/Debug/netcoreapp3.1/assets"

when I do cat command in terminal I can print the file content


问:
Updating to SQL Server Driver 11.0 in DNS-Less Connection String Not Working
I'm trying to figure out why this driver works:

```<code>stConnect = "ODBC;Driver={SQL Server};Server=" & stServer & ";Database=" & stDatabase & ";Trusted_Connection=True;"
</code>```

...but this updated driver doesn't:

```<code>stConnect = "ODBC;Driver={SQL Server Native Client 11.0};Server=" & stServer & ";Database=" & stDatabase & ";Trusted_Connection=True;"
</code>```

This is Access 365 Version 2211

Is there something on the SQL Server I need to update?

I wouldn't be bothering with this at all except my date data types in SQL server come over as Short Text in Access and I think it's the driver.

Thanks

Body:
I'm trying to figure out why this driver works:

stConnect = "ODBC;Driver={SQL Server};Server=" & stServer & ";Database=" & stDatabase & ";Trusted_Connection=True;"

...but this updated driver doesn't:

stConnect = "ODBC;Driver={SQL Server Native Client 11.0};Server=" & stServer & ";Database=" & stDatabase & ";Trusted_Connection=True;"

This is Access 365 Version 2211

Is there something on the SQL Server I need to update?

I wouldn't be bothering with this at all except my date data types in SQL server come over as Short Text in Access and I think it's the driver.

Thanks