2008-05-09

程序员笑话

关键字: 笑话 joke
多少程序员会换灯泡? 无 - 这是个硬件问题。 为什么程序员总是把万圣节和圣诞节搞混? 因为 Oct 31 等于 Dec 25。 这世界只有10种人:知道二进制的和不知道的。 一个程序员在肉店买了1公斤肉,一个小时候后他不高兴的跑回来说老板短了他24克。 一个人正吸着雪茄,吐着烟圈。他女朋友生气了发飙道,“你没看见包装盒上的警告么?吸烟有害健康!” 那人回答道:“我是程序员。我们不关心警告,只关心错误。” 你听过新出的克雷超级计算机么?他超级快,6秒钟就能执行完一个死循环。 两字符串走进一个酒吧坐下,酒保过来,“两位来点什么?” 第一个字符串说,“我要一杯湿啤 fulk ...
2008-04-29

migrate4j:基于java的数据库迁移工具

关键字: java migrate database opensource 数据库迁移
migrate4j是一个基于java的数据库迁移的工具,有点象rails里的db:migrate,通过它可以方便使用java代码来记录数据库的变更和快速的将变更还原到数据库,下面是一个migrate4j的例子: package db.migrations; import static com.eroi.migrate.Define.*; import static com.eroi.migrate.Define.DataTypes.*; import static com.eroi.migrate.Execute.*; import com.eroi.migrate.Migrat ...
2008-04-15

在GAE中生成全局序列号

关键字: gae python googleappengine
gae不能写文件,所以很多操作只能用datastore来实现了。 class Sequence(db.Model): @staticmethod def next(): seq = Sequence() seq.put() id = seq.key().id() seq.delete() return id 使用 print Sequence.next()
2008-04-15

Restful your google app engine applications

关键字: rest restful gae googleappengine python
使用示例: #author:pickerel@gmail.com import wsgiref.handlers from google.appengine.ext import webapp from rest import * class CommentResource(RestResource): def initialize(self): self.response.out.write("comment.initialize:format=%s<br/>" %(self.format)) def index(self, ...
2008-04-15

python 实现动态参数

关键字: python dynamic-arguments
def foo(a, b, c): return a + b + c positionals = (1, 2) keywords = {'c': 3} foo(*positionals, **keywords)
2008-04-11

在GAE中使用django模板

关键字: gae googleappengine django
Google App Engine自带了django框架,开发者可以直接在上面使用django开始web程序,如果你不打算去学django框架,而只是想用它的模板机制,那也是可以的,这里以一个hello, world为例做个演示: 文件:./simple_blog/app.yaml application: simple-blog version: 1 runtime: python api_version: 1 handlers: - url: /.* script: simple_blog.py 文件:./simple_blog/simple_blog.py #!/usr/bin ...
2008-04-11

在GAE中读取yaml的例子

关键字: gae googleappengine yaml
在Google App Engine中内置了yaml文件的验证、解析方法,下面演示一个在GAE中读取yaml的例子 待读取的配置文件 config.yaml 内容如下: blog_name: 我们的博客 allow_comment: False masters: - name: Pickerel Yee account: pickerel@gmail.com - name: 王二 account: wang2@gmail.com 建立配置验证读取文件 config.py #!/usr/bin/env python # -*- coding: utf-8 -*- impor ...
2008-04-09

bug in gae:regex invalid: unbalanced parenthesis

关键字: googleappengine
在windows下运行一个示例工程的时候返回错误 regex invalid: unbalanced parenthesis 修正: 找到 google\appengine\tools\dev_appserver.py 文件,到2369行把以下两行代码 regex = os.path.join(re.escape(regex), '(.*)') path = os.path.join(path, '\\1') 修改为 regex = re.escape(regex) + '/(.*)' path = path + '/\\1' 在 ...
2008-03-29

如何解开一个.deb文件

关键字: extract_deb deb
使用ar命令解开.deb包 ar vx test.deb 解开之后会得到三个文件 debian-binary control.tar.gz data.tar.gz 使用 tar 解开 data.tar.gz 即可得到deb文件中的数据文件 tar -xzvf data.tar.gz
2008-03-27

j2me中发送短信

关键字: sms 短信
三星 SM sm = new SM(); sm.setDestAddress("10086"); sm.setData("hello, world"); SMS.send(sm); 通用 String address = "sms://+10086" MessageConnection conn = (MessageConnection)Connector.open(address); TextMessage msg = (TextMessage)conn.newMessage(MessageConnection.TEXT_MESSAGE); msg.setPayl ...
pickerel
搜索本博客
最近加入圈子
存档
最新评论