2010年10月23日

摘要: 请看加粗字体的不同:Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32Type "help", "copyright", "credits" or "license" for more information.>>> from datetime import datetime>>... 阅读全文
posted @ 2010-10-23 15:58 ddper 阅读(204) 评论(0) 推荐(0) 编辑

2010年8月23日

摘要: E:\project>Makespec -F -K -d -w -X -o client_build e:\project\dbclient\E:\project>Build.pyclient_build\dbclient.specchecking Analysisbuilding Analysis because outAnalysis0.toc non existentrunning Ana... 阅读全文
posted @ 2010-08-23 19:36 ddper 阅读(1517) 评论(0) 推荐(0) 编辑

2010年8月15日

摘要: dreampiehttp://dreampie.sourceforge.net/前一段时间一直使用dreampie,好用是好用就是中文支持太差。最近在学习WxPython,在看《wxpython in action》的时候发现了dreampie的替代者:pycrust,dreampie有的它都有,而且支持中文。下载下面的snippet,放到django/core/management/comman... 阅读全文
posted @ 2010-08-15 22:46 ddper 阅读(286) 评论(0) 推荐(0) 编辑

2010年8月14日

摘要: 初看上面这位小女孩的演讲,惊叹于其成熟的思想及自信的演讲能力,所以自然而然的相信了其所宣扬的理论:成年人比小孩更不理性。但是仔细思考一下,会发现其论证的逻辑是错误的。用三个成年人的犯错事例及三个小孩理性的事例来证明这个结论明显是为证明而取证。有更多的事例来证明小孩不如成年人理性或懂事。诚然,小孩有值得成年人学习的地方,但是小孩可以向成年人学习的却是更多的。一个正确的结论平淡的讲出来,会相信的人可能... 阅读全文
posted @ 2010-08-14 22:55 ddper 阅读(131) 评论(0) 推荐(0) 编辑

2010年8月8日

摘要: conn = MySQLdb.connect('localhost', '****', '****', '****', charset='utf-8')Traceback (most recent call last):File "E:\project\wx_in_action\example3_4.py", line 24, in OnMouseDownconn = MySQLdb.connect('localhost', '****', '*****& 阅读全文
posted @ 2010-08-08 19:44 ddper 阅读(455) 评论(1) 推荐(0) 编辑
摘要: Debian下安装Trac,并配置使用Hg 安装:apt-get install tracapt-get install trac-mercurial 建立Trac项目:trac-admin /path/to/projectenv initenv提示版本控制系统类型时输入hg而不是Mercurial 接着会询问版本库的位置,直接输入绝对路即可 启用trac-mercurial插件: 在/path/to/projectenv/conf/trac.ini里添加以下内容:[components]tracext.hg.* = enabled 部署到Apache: 生成部署目录:trac-admin p 阅读全文
posted @ 2010-08-08 16:32 ddper 阅读(417) 评论(0) 推荐(0) 编辑

2010年6月19日

摘要: 启用Apache ssl模块: a2enmod ssl 启用433端口: vim /etc/apache2/ports.conf 添加:Listen 433 将申请证书时获得的四个文件上传到服务器:ca.pem ssl.crt ssl.key sub.class1.server.ca.pem 增加虚拟主机SSL,确保包含以下内容: http://www.startssl.com/?app=21 重定向设置: 启用rewrite模块 a2enmod rewrite 在配置文件中加入以下内容 RewriteEngine on RewriteCond %{SERVER_PORT} !^443$ Re 阅读全文
posted @ 2010-06-19 22:31 ddper 阅读(352) 评论(0) 推荐(0) 编辑

2010年6月12日

摘要: 1, 在Modle中增加新的属性;class Animal(models.Model): name = models.CharField(max_length=20) sound = models.CharField(max_length=20) weight = models.IntegerField() # 新加字段2, 执行python manage.py sql animal (APP名),查看创建表的SQL语句:E:\mysite>python manage.py sql animalsBEGIN;CREATE TABLE `animals_animal` (`i... 阅读全文
posted @ 2010-06-12 22:43 ddper 阅读(2598) 评论(0) 推荐(1) 编辑

2010年6月1日

摘要: #!/usr/bin/python# -*- coding: utf-8 -*-def print_before_exec(func): def _(*args, **kwargs): print "decorated", args[0] return func(*args, **kwargs) return _@print_before_execdef double(x): print 2*xif __name__ == "__main__": double(2) 阅读全文
posted @ 2010-06-01 21:17 ddper 阅读(125) 评论(0) 推荐(0) 编辑

2010年3月31日

摘要: http://superuser.com/questions/68518/installing-mercurial-on-debian-lenny直接使用apt-get安装,所安装的版本为1.0.1 与后来的版本不兼容,使用easy_install安装在编译的时候会出错, 不管是安装最新版本还是easy_install "mercurial=1.3.1" 安装1.3.1。以下是两种安装更新版本的方... 阅读全文
posted @ 2010-03-31 20:57 ddper 阅读(224) 评论(0) 推荐(0) 编辑

导航