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) · jQuery · JavaScript · table · column

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. [b]Train of thought:[/b] I have a demand of changing includeParameter values when different ip request, I wonder whether I could set like…

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

CoffeeScript notes: write less do more

[url=http://arcturo.github.io/library/coffeescript/01_introduction.html]The Little Book on CoffeeScript[/url] [url=http://coffeescript.org/]official site[/url] [quote] CoffeeScript is a little language that compiles down to JavaScript. The syntax is inspired by Ruby and Python, and implements many …

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

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) · JavaScript

简单使用highstock

[quote] [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. [/quote] 上面是官方解释,我理解的,stock有“股票”的意思,highstoc…

2013-07-22 10:16 · Javascrpt · 评论(0) · 企业应用 · JavaScript

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

使用[url=http://www.javascriptlint.com/download.htm]jslint[/url]进行语法和风格的检查,可以预防错误。 vim配置如下: [code="vimrc"] " jslint map! lint !D:\jsl-0.3.0\jsl.exe -process % [/code] 打开的JS文本中[b]:lint[/b]便可以运行jslint。 [url=http:qunitjs.com]qunit[/url]是jquery团队开发的js测试框架,使用很简单。下面是我的项目中用到的一段测试代码: [code="javascript"] [/co…

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

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) · Java

jQuery几个实用的方法

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

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

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) · vim · backup

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) · Git

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[ubstitute] command in vim. The format of the s[ubstitute] command is: 代码: :[rang]s[ubstitute] /{pattern}/{string}/{flags} [count] This command means that for each line in [rang] repla…

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

displaytag的Excel导出实践

[b][size=large]前言[/size][/b] Displaytag官网有[url=http://www.displaytag.org/10/]1.0[/url], [url=http://www.displaytag.org/11/]1.1[/url], [url=http://www.displaytag.org/1.2/]1.2[/url]等,注意找到对应的版本。源码和API可以在Maven库中找到。 常规的使用不是问题,这里说说关于Excel导出的问题,中文乱码,使用POI等。我使用的是Displaytag1.1。 [b][size=large]基本导出功能[/size][…

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

Gson切面日志实践

[b][size=large]背景[/size][/b] 应用切面做日志记录,记录操作实体详情时可以使用JSON格式,这里是我使用Gson包做切面日志的一些实践,总结了遇到的问题。 [b][size=large]软件包和学习方法[/size][/b] 这里使用google的Gson包做JSON转换,[url=https://code.google.com/p/google-gson/]这里[/url]是项目的地址,可以查看上面的API和User Guide。务必将源码和API配置好,文档中的记录不是很完善,很多时候需要查看源码。 注意,我使用的是2.2版,因为较早的1.4版本的FieldAt…

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