我有三个表firm,shipp和supplier.
所有三个列具有相同的列名id,name,city...等.
我在java中编写了一个连接:
String Query = "SELECT s.name Sname,s.city Scity,f.name Fname,f.city Fcity,"
+"su.name Suname,su.city Sucity "
+"FROM `order_details` ot "
+"INNER JOIN `order` o ON ot.odr_id = o.odr_id "
+"INNER JOIN `product` p ON ot.pro_id = p.id "
+"INNER JOIN `firm` f ON o.firm_id = f.id "
+"INNER JOIN `shipp` s ON o.shipp_id = s.id "
+"INNER JOIN `supplier` su ON o.sup_id = su.id ";
Run Code Online (Sandbox Code Playgroud)
product,order …
我喜欢javascript确认的简单性,因此我可以这样做:
if(!confirm("are you sure?"))
return;
Run Code Online (Sandbox Code Playgroud)
在sweetalert你有你的嵌套true一个内码then承诺的功能。
有没有一种方法可以像在JS确认中一样sweetalert返回true/false?
我使用通知API在Chrome 73上显示弹出窗口:
new Notification('', {
icon: "images/transparent.png",
image: res,
requireInteraction: true
});
notification.onclose = function () {
alert('close')
};
notification.onclick= function () {
alert('click')
};
notification.onerror= function () {
alert('error');
};
notification.onnotificationclose = function () {
alert("close")
};
Run Code Online (Sandbox Code Playgroud)
我看到这个弹出窗口:
但是问题是,如果用户单击带有箭头的图标,则会onclose被解雇,但是如果用户单击“关闭”,又名“ ???????” 按钮,不会调用任何处理程序。
我该如何处理?这是Chrome中的错误吗?
I'm currently reading and writing .EPS file to manipulate/add metadata (Keywords and Tags) in the file.
PS: File encoding is Windows-1251 or Cp1251 -Russian-
I'm reading EPS file like this: (String lines; is a global variable)
try (BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(file), "Cp1251"))) {
String line;
while((line = br.readLine()) != null) {
if(line.contains("</xmpTPg:SwatchGroups>")) {
lines.add(line);
lines.add(descriptionKwrds);
}
else
lines.add(line);
System.out.println(line);
}
} catch (FileNotFoundException ex) {
Logger.getLogger(script.class.getName()).log(Level.SEVERE, null, ex);
} catch (UnsupportedEncodingException ex) {
Logger.getLogger(script.class.getName()).log(Level.SEVERE, null, ex); …Run Code Online (Sandbox Code Playgroud) 这是我上一个问题的下一步。
我正在创建一个C#WinForm应用程序,它将显示给定进程(例如:进程名的chrome.exe)的网络活动(接收的字节数/发送的字节数)和该进程生成的兆位/秒的速度。
在使用性能计数器IO Read Bytes/sec并IO Read Bytes/sec显示I / O读写字节而不是“发送和接收字节”时。
PS:I / O计算由进程生成的所有文件,网络和设备I / O字节。但是,我只希望由特定进程生成的网络字节。
我只想检索接收的字节数和发送的字节数。但是,不知道使用什么计数器来获取进程的这些字节。
我已经为此目的搜索了这些链接,但没有用:
这是尝试过的Process的Performance Counter代码:
PerformanceCounter bytesReceived = new PerformanceCounter("Process", "IO Read Bytes/sec");
PerformanceCounter bytesSent = new PerformanceCounter("Process", "IO Write Bytes/sec");
string ProcessName = "chrome";
bytesReceived.InstanceName = ProcessName;
bytesSent.InstanceName = ProcessName;
Run Code Online (Sandbox Code Playgroud)
问题:如何仅获取由进程为网络活动生成的已接收和已发送字节。
我按下按钮时尝试设置ViewState变量,但它只在我第二次单击按钮时才有效.这是代码隐藏:
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack)
{
lblInfo.InnerText = String.Format("Hello {0} at {1}!", YourName, DateTime.Now.ToLongTimeString());
}
}
private string YourName
{
get { return (string)ViewState["YourName"]; }
set { ViewState["YourName"] = value; }
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
YourName = txtName.Text;
}
Run Code Online (Sandbox Code Playgroud)
有什么我想念的吗?这是设计文件的表单部分,就像POC一样非常基本:
<form id="form1" runat="server">
<div>
Enter your name: <asp:TextBox runat="server" ID="txtName"></asp:TextBox>
<asp:Button runat="server" ID="btnSubmit" Text="OK" onclick="btnSubmit_Click" />
<hr />
<label id="lblInfo" runat="server"></label>
</div>
</form>
Run Code Online (Sandbox Code Playgroud)
PS:样本非常简单,"使用txtName.Text而不是ViewState"不是正确答案,我需要将信息放在ViewState中.
我想知道如何删除我的JTabbedPane的和我的JFrame的内容窗格之间,我的JTabbedPane中和其内部的JPanel之间的利润率.我在想要移除的边缘上空盘旋.绿线在这里显示jtabbedpane内的jpanel之间的差距.
我试着查看一些名为setMargin但在JTabbedPane上不存在的方法.我还检查了不同布局上的Hgap和Vgap(两个= 0)(根内容窗格,我的jpanel等).
所以欢迎任何建议.谢谢.
.
我还不能发布图片.
我的.Aspx页面里面有一个TextBox:
<ajax:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<asp:TextBox ID="txtCity" AutoPostBack="true" OnTextChanged="txtCity_TextChanged"
Width="90%" runat="server" ></asp:TextBox>
</ContentTemplate>
</ajax:UpdatePanel>
Run Code Online (Sandbox Code Playgroud)
代码背后:
protected void txtCity_TextChanged(object sender, EventArgs e)
{
lblMessage.Text = "you have typed:" + txtCity.Text;
}
Run Code Online (Sandbox Code Playgroud)
对于lblMessage[在同一个.Aspx页面上]:
<ajax:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="lblMessage" runat="server" Text="" ></asp:Label>
</ContentTemplate>
</ajax:UpdatePanel>
Run Code Online (Sandbox Code Playgroud)
但是当我在TextBox中输入时.lblMessage没有更新.
如何纠正这个?
我有两个使用java打印的代码,如下所示:
第一个准则
for(int i = 0; i < files.length; i++) {
String file = "C:\\images\\colour\\"+files[i].getName();
String filename = file;
PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
DocFlavor flavor = DocFlavor.INPUT_STREAM.GIF;
PrintService printService[] = PrintServiceLookup.lookupPrintServices(flavor, pras);
PrintService defaultService = PrintServiceLookup.lookupDefaultPrintService();
PrintService service = ServiceUI.printDialog(null, 200, 200, printService, defaultService, DocFlavor.INPUT_STREAM.GIF, pras);
if (service != null) {
DocPrintJob job = service.createPrintJob();
PrintJobListener listener = new PrintJobAdapter() {
public void printDataTransferCompleted(PrintJobEvent e) {
System.exit(0);
}
};
job.addPrintJobListener(listener);
FileInputStream fis = new FileInputStream(filename);
DocAttributeSet das = new …Run Code Online (Sandbox Code Playgroud) 我已经为此苦苦挣扎了一段时间。我只是想做的是在我的 android 应用程序和我的 PC 上的 java 程序之间创建一个套接字连接。
我都尝试过 UDP 和 TCP 套接字以及不同类型的 IP 和端口号。
那么,我怎样才能做到这一点?
这是我的(当前代码)与(尝试的)TCP 连接:
服务端代码截图(PC java程序):
try {
DatagramSocket socket = new DatagramSocket(4466);
byte[] buffer = new byte[2048];
DatagramPacket packet = new DatagramPacket(buffer, buffer.length);
socket.receive(packet);
} catch (SocketException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)
以及来自我的 android 应用程序(客户端)的相关片段:
try {
InetAddress host = InetAddress.getByName("192.168.1.255");
DatagramSocket socket = new DatagramSocket (null);
byte[] buffer = new byte[2048];
buffer = "hej hej".getBytes();
DatagramPacket packet=new DatagramPacket (buffer, buffer.length, …Run Code Online (Sandbox Code Playgroud) java ×5
asp.net ×2
javascript ×2
.net ×1
android ×1
c# ×1
eps ×1
events ×1
fetch ×1
file ×1
jdbc ×1
jtabbedpane ×1
margins ×1
metadata ×1
mysql ×1
networking ×1
pointers ×1
postback ×1
printdialog ×1
printers ×1
process ×1
read-write ×1
resultset ×1
sockets ×1
sweetalert ×1
swing ×1
tcp ×1
textbox ×1
viewstate ×1