摘要: sql参数化查询已被视为最有效可预防SQL注入攻击(SQL Injection) 的攻击手法的防御方式【参考】http://zh.wikipedia.org/wiki/%E5%8F%82%E6%95%B0%E5%8C%96%E6%9F%A5%E8%AF%A2【参考】http://baike.baidu.com/view/3061939.htm有部份的开发人员可能会认为使用参数化查询,会让程式更不好维护,或者在实作部份功能上会非常不便[来源请求],然而,使用参数化查询造成的额外开发成本,通常都远低于因为SQL隐码攻击漏洞被发现而遭受攻击,所造成的重大损失。除了安全因素,相比起拼接字符串的 SQL 阅读全文
posted @ 2012-05-31 11:30 Sheldon.Dai 阅读(630) 评论(0) 推荐(0) 编辑
摘要: 先上代码 var key = 0; function createVar(){ console.log('hello'); if(key == 1){ createVar = function(){ return 111; } }else if( key ==2 ){ createVar = function(){ return 222; } }else{ cr... 阅读全文
posted @ 2012-05-28 17:05 Sheldon.Dai 阅读(176) 评论(0) 推荐(0) 编辑
摘要: mysql 也可以像bash shell那样,按tab键自动补全表名,字段名$ mysql -uroot -p --auto-rehash【参考】http://www.phpmag.ru/2009/01/28/mysql-how-to-enable-auto-completion/ 阅读全文
posted @ 2012-05-26 00:22 Sheldon.Dai 阅读(483) 评论(0) 推荐(0) 编辑
摘要: 前几天在windows上安装了msysgit,在github上建了个仓库,感觉麻烦的是每次都要输入passphrase ,google了一下,找到时了解决方法$ eval `ssh-agent`$ ssh-add这样就ok了,【参考】http://josephjiang.com/article/understand-ssh-key/ 阅读全文
posted @ 2012-05-26 00:14 Sheldon.Dai 阅读(752) 评论(0) 推荐(0) 编辑
摘要: HTML5新增本地数据库SQLLite,<!DOCTYPE html><html><head> <meta charset="utf-8"></head><body> <script> var db = openDatabase('mydb','1.0','for test',2*1024*1024);//数据库名mydb,版本1.0,描述for test,大小2m db.transaction(function (tx){ tx.execut 阅读全文
posted @ 2012-05-25 10:46 Sheldon.Dai 阅读(783) 评论(0) 推荐(1) 编辑
摘要: 1.sessionStorage两个页面a.html,b.html## a.html<!DOCTYPE html><html><head> <meta charset="utf-8"></head><body> <script> sessionStorage.setItem('msg','hello world'); console.log(sessionStorage.getItem('msg')); </script></ 阅读全文
posted @ 2012-05-25 10:23 Sheldon.Dai 阅读(224) 评论(0) 推荐(0) 编辑
摘要: chrome 插件 Vimium可以像使用vim那样浏览网页,好用。可以 在chrome web store里面搜索安装不会用的话 直接敲 shift+?就会有提示的 阅读全文
posted @ 2012-05-24 12:26 Sheldon.Dai 阅读(162) 评论(0) 推荐(0) 编辑
摘要: [参考]http://perlbrew.pl/Perlbrew-%E4%B8%AD%E6%96%87%E7%B0%A1%E4%BB%8B.htmlperlbrew 的安装请参考上面的链接[需要注意的一点]$ perlbrew switch 5.14.2$ perl -v #结果还是perl 5.8应该这样用$ perlbrew switch 5.14.2$ source ~/perl5/perlbrew/etc/bashrc #根据你使用的bash选择$ perl -v # 5.14.2 ,ok了 阅读全文
posted @ 2012-05-24 11:20 Sheldon.Dai 阅读(488) 评论(0) 推荐(0) 编辑
摘要: eclipse->help->install new software->复制 http://vrapper.sourceforge.net/update-site/stable到workwith里面,回车,然后就开始安装了。试用了一下,感觉 不错,适合习惯了vim编辑器的同学们。【参考】http://vrapper.sourceforge.net/home/ 阅读全文
posted @ 2012-05-23 12:36 Sheldon.Dai 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 在vii上用鼠标粘帖代码时,如果代码中有注释如 #号或* 好时,粘帖的内容从该行起全部加上#号,并且代码缩进全乱了。解决办法是先:set paste,然后在粘帖就ok了。 阅读全文
posted @ 2012-05-20 21:18 Sheldon.Dai 阅读(153) 评论(0) 推荐(0) 编辑