Skip to content

Instantly share code, notes, and snippets.

@MaySnow
MaySnow / table.html
Created October 2, 2012 04:18
合并表格
<table>
<th>
<td>1</td>
<td>2</td>
<td>3</td>
</th>
<tr>
<td colspan = "2" >a</td>
<td>b</td>
@MaySnow
MaySnow / gist:3824749
Created October 3, 2012 03:14
eclipse|myeclipse 中如何清除断点
点击Window--->show View-->Debug-->Breakpoints点击
在出现的breakpoints界面中如果有内容证明有断点 否则没有没有断点
如果有断点:直接点击右键 删除所有断点(Remove ALL)即可。
@MaySnow
MaySnow / home.html
Created October 3, 2012 09:21
公用的jsp页面
<jsp:include page="include/top.jsp">
<jsp:param value="new" name="tag"/>
</jsp:include>
@MaySnow
MaySnow / url.java
Created October 4, 2012 12:08
url参数含中文,乱码
name = new String(name.getBytes("ISO8859-1"),"UTF-8");
@MaySnow
MaySnow / json.java
Created October 6, 2012 08:39
Gson
public String showJson() throws IOException {
user = new User();
user.setId(1001);
user.setPassword("000000");
user.setUsername("tom");
response.setContentType("application/json;charset=UTF-8");
Gson gson = new Gson();
PrintWriter out = response.getWriter();
out.print(gson.toJson(user));
@MaySnow
MaySnow / history.js
Created October 7, 2012 08:26
改变地址栏,不跳转
var href = "<%=basePath %>contact/findByTag.action?tagName=" + tagName;//需要改变的地址名称
history.pushState({ path: this.path }, '', href);
@MaySnow
MaySnow / checkbox.js
Created October 7, 2012 09:15
checkbox
//根据选中的长度来判断是否有选中的,真是个不错的办法
if($(".check:checked").length == 0) {
hideChoose();
} else {
showChoose();
}
$(".check:checked")//所有选中的复选框
@MaySnow
MaySnow / gson.js
Created October 9, 2012 01:46
gson 解析 javascript
var date = [{"name":"不错"},{"name":"全选"},{"name":"还好"},{"name":"你好"}]
for(var i = 0 ; i < date.length; i ++) {
date[i].name//得到每个name值
}
@MaySnow
MaySnow / random.java
Created October 9, 2012 06:02
随机产生字符串
package com.kaishengit;
import java.util.Random;
import java.util.TimeZone;
import com.kaishengit.pojo.User;
import com.kaishengit.util.DateUtil;
import hirondelle.date4j.DateTime;
@MaySnow
MaySnow / prover.js
Created October 10, 2012 08:21
点击body隐藏某个模块,并防止事件冒泡
$("body").live("click",function(){
$(".toptask").hide();
});
//新建任务的模块防止事件冒泡
$(".toptask").live("click",function(event){
event.stopPropagation();
});