2014年7月8日
摘要: 一、批量删除 delete from table_name where id in #{idItem} View Code注意:你可以传入一个List 实例或者一个数组给MyBatis 作为一个参... 阅读全文
posted @ 2014-07-08 11:27 jian_xie 阅读(168) 评论(0) 推荐(0) 编辑
  2014年7月2日
摘要: 使用java自带的图片处理api,也可以使用(GraphicsMagick + im4j)import java.awt.Image;import java.awt.image.BufferedImage;Image img = ImageIO.read(file.getInputStream())... 阅读全文
posted @ 2014-07-02 17:08 jian_xie 阅读(231) 评论(0) 推荐(0) 编辑
  2014年6月17日
摘要: 一、工具类中使用beanIService service = (IService)ContextLoader.getCurrentWebApplicationContext().getBean(serviceBeanName);View Code 阅读全文
posted @ 2014-06-17 17:37 jian_xie 阅读(124) 评论(0) 推荐(0) 编辑
  2014年5月6日
摘要: 一、按时间点来统计SELECT id,COUNT(1), date_FORMAT(date_Field,'%Y-%m-%d %H:00:00') as dateStrfrom table_namegroup by dateStrView Code 阅读全文
posted @ 2014-05-06 20:03 jian_xie 阅读(156) 评论(0) 推荐(0) 编辑
  2014年4月18日
摘要: 转载请注明出处:http://cantellow.iteye.com/blog/838473第一种(懒汉,线程不安全):Java代码publicclassSingleton{privatestaticSingletoninstance;privateSingleton(){}publicstatic... 阅读全文
posted @ 2014-04-18 23:38 jian_xie 阅读(207) 评论(0) 推荐(0) 编辑
  2014年3月30日
摘要: JSON字符串: var jsonStr='{"fname":"json","fage":1}'JSON对象: var jsonObj={"fname":"json","fage":1}一、JSON字符串转换JSON对象jsonObj = eval('(' + jsonStr + ')');//js自带function parseJSON( strData ){ return (new Function( "retur 阅读全文
posted @ 2014-03-30 11:50 jian_xie 阅读(271) 评论(0) 推荐(0) 编辑
  2014年3月25日
摘要: 转自:http://www.heyria.com/index.php/2014/01/js-object-plus-object/当对象或者数组相加的时候,会产生有点意外的结果。这篇文章主要是解释为什么会产生这种结果。在JavaScript中加号操作的规则比较简单:只能对Number或者String相加,其他的值都会被转化成这两种类型中的一种。为了理解这种转化是怎么工作的,我们首先弄清一些事情,参考ECMA-262v5版本 9.1章节快速复习下,在JavaScript中有两种值:primitives跟objects.原始类型的值有:undefinednullBooleanNumberStrin 阅读全文
posted @ 2014-03-25 14:13 jian_xie 阅读(1913) 评论(0) 推荐(0) 编辑
  2014年3月21日
摘要: 一、基于prototype原型function Person(name){ this.name = name;}Person.prototype.eat="food";function Student(name,eat){ Person.apply(this, arguments);}Student.prototype = new Person();var s1 = new Student("王大", "food");console.log(s1.name);console.log(s1.eat);View Code1、证明proto 阅读全文
posted @ 2014-03-21 11:26 jian_xie 阅读(130) 评论(0) 推荐(0) 编辑
  2014年3月10日
摘要: 两数交换算法public class Demo { private static long n = 1000000000; /** * @param args */ public static void main(String[] args) { int a=10,b=20; long begin = System.currentTimeMillis(); swap1(a, b); long end = System.currentTimeMillis(); System.out.p... 阅读全文
posted @ 2014-03-10 11:03 jian_xie 阅读(172) 评论(0) 推荐(0) 编辑
  2014年3月6日
摘要: 一、冒泡排序/** * [冒泡算法] * @param {[type]} ary [description] * 把最大往上冒 */function BubbleSortArray(ary){ for (var i = 0, len = ary.length; i ary[n + 1]) { var temp; temp = ary[n]; ary[n] = ary[n + 1]; ary[n + 1] = temp; ... 阅读全文
posted @ 2014-03-06 14:50 jian_xie 阅读(214) 评论(0) 推荐(0) 编辑