上一页 1 2 3 4 5 6 7 8 9 ··· 17 下一页
摘要: Nautilus ScriptsNautilus is the official file manager for the GNOME desktop. It has ability to run add-on scripts written in any scripting language (or binary file) without a problem. All add-on scripts must be created and stored at ~/.gnome2/nautilus-scripts ($HOME/.gnome2/nautilus-scripts) locatio 阅读全文
posted @ 2011-03-27 00:03 napoleon_liu 阅读(321) 评论(0) 推荐(0) 编辑
摘要: 最佳vim技巧----------------------------------------# 信息来源----------------------------------------www.vim.org : 官方站点comp.editors : 新闻组http://www.newriders.com/books/opl/ebooks/0735710015.html : Vim书籍http:/... 阅读全文
posted @ 2011-03-19 00:16 napoleon_liu 阅读(38379) 评论(0) 推荐(4) 编辑
摘要: auto_cscope vim 中使用ctag, 设置 ctag变量: set tags=tags; (注意有分号;), 这就vim就可以自动查找 本目录下或上层父目录(或祖先目录)中的 tags文件。Vim 也支持 cscope 插件, 但需要自己 通过 cscope add 命令来添加db.所以我写了这个auto_cscope插件, 来模拟ctags的行为, 使用UpLoadCscope命令可以自动查找目录下或上层父目录(或祖先目录)中的 cscope.out文件并加载.还提供了MakeCscope命令, 来生成 cscope.out 数据库(同时生成 tags文件)。把下面这一行加到你的 阅读全文
posted @ 2011-03-18 18:47 napoleon_liu 阅读(542) 评论(0) 推荐(1) 编辑
摘要: 上编文中讲的 封装, 只实现了 setItem, getItem, removeItem接口。 如果要实现 key()和length 就不行, 也就是说如果你需要遍历的功能,那么需要选择别的方式。 这次我打算损失点性能来模拟。借助 JSON 来保存 对象。 代码 if(!window.localStorage && /MSIE/.test(navigator.userAgent)){ wind... 阅读全文
posted @ 2011-03-17 19:34 napoleon_liu 阅读(556) 评论(0) 推荐(0) 编辑
摘要: 引 所有有垃圾回收的语言,都会遇到个问题, 对象的深拷贝。 可惜的是 Javascript 语言并没有在语言级别提供支持。 JSON 是 WEB中最流行的数据格式,简洁高效(比xml好), 其它如lua和ruby也学习javascript这个优点。要达到这个优势,语言必须要有足够的字面量支持(而不是像C++那样靠库实现各类结构)。 当想到要自己写一个clone方法的时候,就头大,后来想到个简洁的方... 阅读全文
posted @ 2011-03-17 17:10 napoleon_liu 阅读(5298) 评论(0) 推荐(0) 编辑
摘要: 引 chrome, safari, firefox, ie 9都支持 localStorage. 但可恶的是,中国 ie 6 占有最大的比例。 使用 cookie 不但容量有限,而且给我们增加了不少的带宽,也进行影响网站的性能。 所以我写了 localStorage.js 来模拟 localStorage, 这样其它js 就跨浏览器地使用localStorage了. 代码 if(!window.l... 阅读全文
posted @ 2011-03-17 14:37 napoleon_liu 阅读(1767) 评论(0) 推荐(0) 编辑
摘要: 最近在写一个页面,在出了ie6外的所有浏览器中都正常(ie7,8,9, firefox, chrome), IE6下提示 “无法设置selected属性。未指明的错误”。 后来发现是jquery 在 ie6 下操作 select控件有BUG. 我程序中是这样使用的: $("#genre").val(0); 改成: setTimeout(function(){ $("#genre").val(0)... 阅读全文
posted @ 2011-03-14 14:35 napoleon_liu 阅读(2834) 评论(0) 推荐(0) 编辑
摘要: Chrod算法是P2P中的四大算法之一,是有MIT(麻省理工学院)于2001年提出,其他三大算法分别是: CAN Pastry Tapestry Chord的目的是提供一种能在P2P网络快速定位资源的的算法,Cord并不关心资源是如何存储的,只是从算法层面研究资源的取得,因此Chord的API就简单到只有一个set、get。 1、Chord是什么? Chord是一个算法,也是一个协议。作为一个算法... 阅读全文
posted @ 2011-03-10 20:56 napoleon_liu 阅读(1027) 评论(0) 推荐(0) 编辑
摘要: Richard Jones Blog : http://www.metabrew.com/article/libketama-consistent-hashing-algo-memcached-clients In old way, clients mapped keys->servers like this:server = serverlist[hash(key)%serverlist.len... 阅读全文
posted @ 2011-03-10 20:49 napoleon_liu 阅读(1763) 评论(0) 推荐(0) 编辑
摘要: function update_page_list(page_bar, total, cur_page,num__per_page) { page_bar.html(""); if(total<=0) return; var num_page = ~~((total+num__per_page-1)/num__per_page); if(cur_page > 1) { page_bar.... 阅读全文
posted @ 2011-03-09 19:19 napoleon_liu 阅读(3819) 评论(5) 推荐(1) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 17 下一页