how to add the interface to Wireshark
the commands work for me with Wireshark 1.6.2 on Ubuntu Server 11.10 (64-bit):
$ sudo apt-get install wireshark
$ sudo dpkg-reconfigure wireshark-common
$ sudo usermod -a -G wireshark $USER
$ sudo reboot
$ sudo apt-get install wireshark
$ sudo dpkg-reconfigure wireshark-common
$ sudo usermod -a -G wireshark $USER
$ sudo reboot
IllegalArgumentException,所以如果你看到别的教程没有以 / 结束,那么多半是直接从Retrofit 1.X 照搬过来的。sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.5 mysql-client-core-5.5
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean
How to install
- sudo apt-get update
- sudo apt-get install mysql-server
- mysql --version
You'll see some output like this:mysql Ver 14.14 Distrib 5.7.17, for Linux (x86_64) using EditLine wrapper
If you're using version 5.7.6 or later, you should usemysqld --initializeinstead.
However, if you installed version 5.7 from the Debian distribution, like in step one, the data directory was initialized automatically, so you don't have to do anything.
- service mysql status
You'll see the following output (with a different PID).mysql start/running, process 2689
If MySQL isn't running, you can start it with sudo service mysql start.mysqladmin tool, which is a client that lets you run administrative commands. For example, this command says to connect to MySQL as root (-u root), prompt for a password (-p), and return the version.
- mysqladmin -p -u root version
You should see output similar to this:mysqladmin Ver 8.42 Distrib 5.5.47, for debian-linux-gnu on x86_64
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Server version 5.5.47-0ubuntu0.14.04.1
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /var/run/mysqld/mysqld.sock
Uptime: 4 min 15 sec
Threads: 1 Questions: 602 Slow queries: 0 Opens: 189 Flush tables: 1
Open tables: 41 Queries per second avg: 2.360
This means MySQL is up and running.bind-address = 192.168.0.5
sudo systemctl restart mysql.service
sudo dpkg-reconfigure mysql-server-5.5
lsb_release -a ▸ exact release name, version etc.cat /etc/issue ▸ formal release namecat /etc/issue.net ▸ cleaner version of previous onecat /etc/debian_version ▸ will give you the Debian code namecat /proc/version ▸ will give you quite a lot of info about your kernel, when was it compiled, which gcc version has been used etc.uname -a ▸ will tell you about your kernel info, plus arch (i386 ▸ 32 bit, x86_64 ▸ 64 bit)gnome-system-monitor
application should give you more than enough info. Release name,
architecture variant, cores in the system, RAM available, and the space
available on the root file system.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
| package com.lixiyu.bean;public class CalculatorBean { double numberOne,numberTwo,result;//数字1、数字2、结果 String operator="+";//操作 //setxxx和getxxx public void setNumberOne(double n) { numberOne=n; } public double getNumberOne() { return numberOne; } public void setNumberTwo(double n) { numberTwo=n; } public double getNumberTwo() { return numberTwo; } public void setOperator(String s) { operator=s.trim();; } public String getOperator() { return operator; } public void setResult(double r) { result=r; } public double getResult() { return result; }} |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
| public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { CalculatorBean dataBean = null; HttpSession session = request.getSession(true); try { dataBean = (CalculatorBean) session.getAttribute("ok"); if (dataBean == null) { dataBean = new CalculatorBean(); // 创建Javabean对象 session.setAttribute("ok", dataBean);// 将dataBean存储到session对象中 } } catch (Exception exp) { dataBean = new CalculatorBean(); // 创建Javabean对象 session.setAttribute("ok", dataBean);// 将dataBean存储到session对象中 } double numberOne = Double .parseDouble(request.getParameter("numberOne")); double numberTwo = Double .parseDouble(request.getParameter("numberTwo")); String operator = request.getParameter("operator"); double result = 0; if (operator.equals("+")) { result = numberOne + numberTwo; } else if (operator.equals("-")) { result = numberOne - numberTwo; } else if (operator.equals("*")) { result = numberOne * numberTwo; } else if (operator.equals("/")) { result = numberOne / numberTwo; } dataBean.setNumberOne(numberOne); // 将数据存储在dataBean中 dataBean.setNumberTwo(numberTwo); dataBean.setOperator(operator); dataBean.setResult(result); RequestDispatcher dispatcher = request .getRequestDispatcher("showResult.jsp"); dispatcher.forward(request, response);// 请求showResult.jsp显示dataBean中的数据 } |
在web.xml中注册servlet及实现映射:
inputNumber.jsp(主要代码):
|