This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Drop file upload</title> | |
<style> | |
#dropdiv{ | |
margin: 40px auto; | |
width: 900px; | |
height: 400px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//分割 | |
public static void splitFile(String path,int count) { | |
try { | |
RandomAccessFile raf = new RandomAccessFile(path, "r"); | |
//文件总大小 | |
long length = raf.length(); | |
//每份文件大小 | |
long maxSize = length / count; | |
//最后一份文件大小 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) throws Exception { | |
Class.forName("com.mysql.jdbc.Driver"); | |
Connection conn = DriverManager.getConnection("jdbc:mysql:///kaishengit_db", "root", "root"); | |
String sql = "insert into t_test(username,address) values('vv','china')"; | |
Statement stat = conn.createStatement(); | |
stat.execute(sql, Statement.RETURN_GENERATED_KEYS); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELIMITER // | |
CREATE PROCEDURE insert_test(IN uname VARCHAR(50),IN uaddress VARCHAR(50)) | |
BEGIN | |
INSERT INTO t_test(username,address) VALUES(uname,uaddress); | |
END// | |
DELIMITER ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
常用的数字正则(严格匹配) | |
------------------------------ | |
正则 含义 | |
^[1-9]\d*$ 匹配正整数 | |
^-[1-9]\d*$ 匹配负整数 | |
^-?[1-9]\d*$ 匹配整数 | |
^[1-9]\d*|0$ 匹配非负整数(正整数 + 0) | |
^-[1-9]\d*|0$ 匹配非正整数(负整数 + 0) | |
^[1-9]\d*\.\d*|0\.\d*[1-9]\d*$ 匹配正浮点数 | |
^-([1-9]\d*\.\d*|0\.\d*[1-9]\d*)$ 匹配负浮点数 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<books> | |
<book ISBN="5197-5742-5657"> | |
<name>Java编程思想</name> | |
<price>91.5</price> | |
<authors> | |
<author> | |
<name>汤姆斯</name> | |
<nation>美国</nation> | |
</author> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HttpClient client = null; | |
try { | |
client = new DefaultHttpClient(); | |
HttpGet get = new HttpGet("http://www.youdao.com/smartresult-xml/search.s?type=id&q="+code); | |
HttpResponse response = client.execute(get); | |
InputStream stream = response.getEntity().getContent(); | |
BufferedReader reader = new BufferedReader(new InputStreamReader(stream,"GBK")); | |
StringBuilder sb = new StringBuilder(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.jxl.tool; | |
import java.io.File; | |
import javax.xml.parsers.DocumentBuilder; | |
import javax.xml.parsers.DocumentBuilderFactory; | |
import javax.xml.transform.TransformerFactory; | |
import javax.xml.transform.dom.DOMSource; | |
import javax.xml.transform.stream.StreamResult; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JSTL的c:forEach标签(${status.index}) | |
2011-01-19 16:55:34| 分类: Jsp / Servlet | 标签:jstl jsp |举报|字号 订阅 | |
<c:forEach>标签具有以下一些属性: | |
var:迭代参数的名称。在迭代体中可以使用的变量的名称,用来表示每一个迭代变量。类型为String。 | |
items:要进行迭代的集合。对于它所支持的类型将在下面进行讲解。 | |
varStatus:迭代变量的名称,用来表示迭代的状态,可以访问到迭代自身的信息。 |