摘要: http://www.cnblogs.com/harrychinese/archive/2012/01/19/change_python_default_encoding.html 今天碰到了 python 编码问题, 报错信息如下Traceback (most recent call last)... 阅读全文
posted @ 2012-03-19 18:43 samlee 阅读(2778) 评论(0) 推荐(1) 编辑
摘要: In [43]: s = 'axxxxxxxxxxxxxxxxxxxxxxxxxxxxx'In [44]: [s[idx:idx+4] for idx in range(len(s)) if idx%4==0]Out[44]: ['axxx', 'xxxx', 'xxxx', 'xxxx', '... 阅读全文
posted @ 2012-03-12 15:59 samlee 阅读(318) 评论(0) 推荐(0) 编辑
摘要: #单个unicode字符串的长度为1, 单个utf-8字符的长度为3 In [3]: u = u"这是一个中文字符串"In [4]: len(u)Out[4]: 9In [5]: utf8str = u.encode("utf-8")In [6]: len(utf8str)Out[6]: 27... 阅读全文
posted @ 2012-03-11 16:32 samlee 阅读(2172) 评论(0) 推荐(0) 编辑
摘要: centos 网管原文:http://wiki.centos.org/TipsAndTricks/NTFS?highlight=%28ntfs%29 只需 yum install fuse, fuse-ntfs-3g 即可 要yum安装这几个包,请确保你安装了rpmforge repo 。要安装r... 阅读全文
posted @ 2011-11-26 15:15 samlee 阅读(303) 评论(0) 推荐(0) 编辑
摘要: div1 div2 this is div1 this is div2 另外, .toggle()也可用于切换元素的可见状态。将可见元素置为隐藏,将隐藏置为可见的。 div1 div2 this is div1 this is div2 ... 阅读全文
posted @ 2011-10-31 22:56 samlee 阅读(326) 评论(0) 推荐(0) 编辑
摘要: 1 2 3 阅读全文
posted @ 2011-10-31 22:35 samlee 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 1. 问题现象, 通过web.input获取Form提交的请求, 发现后台并没有获取请求,并且通过firebug看到的content-length为0 web.py 代码如下: import weburls = ( '/','Index', '/commit', 'Commit'... 阅读全文
posted @ 2011-10-18 00:05 samlee 阅读(1252) 评论(0) 推荐(0) 编辑
摘要: 今天打算开始看jquery,但是刚看就遇到了问题: jQuery(expression,[context]) 这个函数接收一个包含 CSS 选择器的字符串,然后用这个字符串去匹配一组元素。 CSS选择器?什么是CSS选择器?从网上找了一片文章,感觉还不错。记录下来,方便自己以后查看。... 阅读全文
posted @ 2011-09-21 00:15 samlee 阅读(324) 评论(0) 推荐(0) 编辑
摘要: 最近在电脑上安装了64位的centos,安装后发现falsh player无法正常使用。经查原来只有flash player 11才支持64位。下载flashplayer11_b1_install_lin_64_071311.tar.gz,解压后将libflashplayer.so,copy到/us... 阅读全文
posted @ 2011-09-09 23:07 samlee 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 很久没有接触web开发了,今天心血来潮看看jquery, 首先从最简单的hello world入手吧, 直接上代码 1 <html> 2 <head> 3 <meta charset="utf-8"> 4 <script src='jquery-1.6.3.js'/> 5 <title>demo</title> 6 7 </head> 8 <body> 9 <a href = "http:\\jquery.com">jquery&l 阅读全文
posted @ 2011-09-09 23:03 samlee 阅读(140) 评论(0) 推荐(0) 编辑