ITeye博客

lingceng

lingceng · 共 93 篇文章

[置顶] 请移步新的博客地址

这个博客不再更新了,请移步 http://lingceng.github.io/

2013-12-06 13:06 · 评论(0)

[置顶] jquery.column.picker

jquery.column.picker是基于jquery的表格列选取器插件,简单易用,请移步主页: http://lingceng.github.io/jquery.column.picker/

2013-07-09 11:20 · Javascrpt · jQuery · 评论(0)

Hack struts2 json plugin: dynamically set includeProperty

Here is not basic use of struts2 json plugin but how to hack the code to set includeProperty dynamically, in othter words, set with action field not in xml file. Train of thought: I have a demand of changing includeParameter values when different ip request, I wonder whether I could set like this: …

2013-07-26 11:27 · Java · json · 评论(0)

CoffeeScript notes: write less do more

The Little Book on CoffeeScript official site CoffeeScript is a little language that compiles down to JavaScript. The syntax is inspired by Ruby and Python, and implements many features from those two languages. I found some amazing features when using CoffeeScript on my project. Here I have some e…

2013-07-26 10:36 · Javascrpt · web · 评论(0)

JS中Date与字符串的转换

string to date /** * parse date string YYYY-MM-dd to date */ function parseDate(datestr) { var parts = datestr.split('-'); return new Date(parts[0], parts[1] - 1, parts[2]) } /** * format date to YYYY-MM-dd mm:ss format string */ function formatDate(d) { return d.getFullYear() + "-" + (d.getMonth()…

2013-07-22 10:23 · Javascrpt · 评论(0)

简单使用highstock

[url=http://www.highcharts.com/]Highstock[/url] lets you create stock or general timeline charts in pure JavaScript, including sophisticated navigation options like a small navigator series, preset date ranges, date picker, scrolling and panning. 上面是官方解释,我理解的,stock有“股票”的意思,highstock可用于制作股票走势的图表:对大量…

2013-07-22 10:16 · Javascrpt · 评论(0)

使用jslint与qunit保障JS代码质量

使用 jslint 进行语法和风格的检查,可以预防错误。 vim配置如下: " jslint map! lint !D:\jsl-0.3.0\jsl.exe -process % 打开的JS文本中**:lint**便可以运行jslint。 [qunit](http:qunitjs.com)是jquery团队开发的js测试框架,使用很简单。下面是我的项目中用到的一段测试代码: <script src="qunit-1.12.0.js"></script> <script src="jquery-1.7.2.js"></script> <script src="../jquery.column.…

2013-07-09 11:16 · tool · Javascrpt · debug · 评论(0)

Ubuntu常用路径

/var/cache/apt/archives # 下载的包的存放地址 /usr/share/applications # 存放很多应用程序的启动方式 ~/.local/share/ # 历史打开文件记录 ~/.bashrc # 用户级环境变量 /etc/profile # 系统级环境变量 /etc/hosts # hosts

2013-06-02 01:49 · 评论(0)

Calender to Date snip

The format is not stored in the Date. It is stored in the String. The Date#toString() returns a fixed format which is described in its Javadoc. Do the formatting only at the moment you need to display a Date to a human as a String. Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.D…

2013-05-30 10:25 · Java · 评论(0)

jQuery几个实用的方法

有段时间没有碰jQuery,回来继续用的时候,发现几个方法很有用处 find() 查找后代元素 往往是先取到一个div的jquery对象,再在对象上find **index() **返回选中元素第一个元素相对于同辈的位置 简单说就是返回序号,不用傻呵呵地用什么属性标记序号

2013-05-18 15:49 · Javascrpt · web · 评论(0)

vim backup or tempfile

"Put vim files in the temp directory instead of the current directory set dir=%TMP% set backupdir=%TMP%

2013-05-15 09:35 · vim · 评论(0)

github usage

Create a new repository on the command line touch README.md git init git add README.md add all files in current direcory git add . git commit -m "first commit" git remote add origin https://github.com/lingceng/HelloWorld.git git push -u origin master Push an existing repository from the command lin…

2013-05-14 14:51 · 评论(0)

Vim find & replace

Vim find & replace (RT) To find and replace one or more occurrences of a given pattern with a new string, use the s command in vim. The format of the s command is: 代码: :s /{pattern}/{string}/{flags} This command means that for each line in replace a match of {pattern} with {string}. The {string} ca…

2013-04-10 17:59 · tool · reprint · 评论(0)

displaytag的Excel导出实践

前言 Displaytag官网有 1.0 , 1.1 , 1.2 等,注意找到对应的版本。源码和API可以在Maven库中找到。 常规的使用不是问题,这里说说关于Excel导出的问题,中文乱码,使用POI等。我使用的是Displaytag1.1。 基本导出功能 这种情况只需引入displaytag-1.1.jar。 设置column属性media="html"将不会导出,media="excel"不会页面显示,默认既显示又导出。 setProperty也可以写在displaytag.properties中应用于所有表格。 online demo <display:table name="te…

2013-03-01 18:00 · tool · web · 评论(2)

Gson切面日志实践

背景 应用切面做日志记录,记录操作实体详情时可以使用JSON格式,这里是我使用Gson包做切面日志的一些实践,总结了遇到的问题。 软件包和学习方法 这里使用google的Gson包做JSON转换, 这里 是项目的地址,可以查看上面的API和User Guide。务必将源码和API配置好,文档中的记录不是很完善,很多时候需要查看源码。 注意,我使用的是2.2版,因为较早的1.4版本的FieldAttributes类中没有getDeclaringClass()这个方法,这个方法是获取field所属的类,在我的排除策略中会用到。 排除策略 最简单的gson转换可以是这样的,但却没有多少实际的作用。…

2013-02-26 17:47 · tool · Java · Javascrpt · hibernate · 评论(0)