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
MySQL 日期类型 | |
MySQL 日期类型:日期格式、所占存储空间、日期范围 比较。 | |
日期类型 存储空间 日期格式 日期范围 | |
------------ --------- --------------------- ----------------------------------------- | |
datetime 8 bytes YYYY-MM-DD HH:MM:SS 1000-01-01 00:00:00 ~ 9999-12-31 23:59:59 | |
timestamp 4 bytes YYYY-MM-DD HH:MM:SS 1970-01-01 00:00:01 ~ 2038 | |
date 3 bytes YYYY-MM-DD 1000-01-01 ~ 9999-12-31 | |
year 1 bytes YYYY 1901 ~ 2155 | |
在 MySQL 中创建表时,对照上面的表格,很容易就能选择到合适自己的数据类型。不过到底是选择 datetime 还是 timestamp,可能会有点犯难。这两个日期时间类型各有优点:datetime 的日期范围比较大;timestamp 所占存储空间比较小,只是 datetime 的一半。 |
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-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="name" content="personcompanylist"> | |
<title>download</title> | |
<style type="text/css"> | |
.box{ | |
text-align: center; | |
} |
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-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
</head> | |
<body> | |
<div id="videoPlayer" style="text-align:center;"> | |
<video height="210" controls poster="http://www.sinaimg.cn/dy/slidenews/1_img/2014_40/43011_490985_109173.jpg"> |
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:迭代变量的名称,用来表示迭代的状态,可以访问到迭代自身的信息。 |
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
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
<?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
常用的数字正则(严格匹配) | |
------------------------------ | |
正则 含义 | |
^[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
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 ; |
NewerOlder