ideas for indie game


What languages fix...搞.. - [coding]
Tag:

原文地址:http://www.paulgraham.com/fix.html

Algol: Assembly language is too low-level.

Pascal: Algol doesn't have enough data types.

Modula: Pascal is too wimpy for systems programming.

Simula: Algol isn't good enough at simulations.

Smalltalk: Not everything in Simula is an object.

Fortran: Assembly language is too low-level.

Cobol: Fortran is scary.

PL/1: Fortran doesn't have enough data types.

Ada: Every existing language is missing something.

Basic: Fortran is scary.

APL: Fortran isn't good enough at manipulating arrays.

J: APL requires its own character set.

C: Assemby language is too low-level.

C++: C is too low-level.

Java: C++ is a kludge. And Microsoft is going to crush us.

C#: Java is controlled by Sun.

Lisp: Turing Machines are an awkward way to describe computation.

Scheme: MacLisp is a kludge.

T: Scheme has no libraries.

Common Lisp: There are too many dialects of Lisp.

Dylan: Scheme has no libraries, and Lisp syntax is scary.

Perl: Shell scripts/awk/sed are not enough like programming languages.

Python: Perl is a kludge.

Ruby: Perl is a kludge, and Lisp syntax is scary.

Prolog: Programming is not enough like logic.


Posted by beck917 at 13:56:14 | Read more | Comments (0) | Trackback (0) | Edit |

很有意思的一个python库,Pamie - [coding]
Tag:python PAMIE

很有意思的一个python库,Pamie,准备用它写点东西,也可能用不到,直接获取剪切板数据,:-)

 这是前辈limodou的一篇文章

 http://blog.donews.com/limodou/archive/2005/02/15/277637.aspx

 

不过现在库升级到2.0了..例子有点变动,如下

# To use Pamie you must first create a new script or text file that you can saveas mytest.py.

# This will import the cPAMIE class file so you can use it's methods

from cPAMIE import PAMIE

# create a new instance of the PAMIE object

ie = PAMIE( )

# Lets navigate to google - this methods takes a string as the URL

ie.navigate("www.google.com" )

 

用ie打开google主页,:-) 

 


Posted by beck917 at 21:30:04 | Read more | Comments (1) | Trackback (0) | Edit |

[版本更新]豆瓣好友跟踪 --桌面提醒程序v0.2.1发布DbFriendsTracks v0.2.1 - [coding]

也算是经过了一天一夜吧,终于基本完成了0.1版,alpha???beta??管他呢,可能连alpha版本都算不上,先放出来再说,现在是基本上能用了,也不白费我一天一夜的心血啊

话说真是一番周折,用py2exe编译为exe的时候遇到了一些问题,先是gdata和douban service是用egg安装的不行,后来自己手动复制的py文件,然后是xml库的缺少,而正好cxml的库没有windows平台下2.5版的,我又不得不把本本上的py2.5降到2.4版,然后重新安装了老多东西才好

此程序是基于wxpython,python,还有douban,gdata的api的,源代码可以在googlecode上下载,http://code.google.com/p/dbfriendstrack/source

不过代码基本上没有优化,比较乱....郁闷..

windows下有exe版本,在这里下载

http://dbfriendstrack.googlecode.com/files/DbFriendsTracks-0.2.1.rar

使用说明:

本程序是在桌面下用类似msn上线提醒,gtalk/outlook邮件提醒的方式,当你的好友有新看的书,电影,听的音乐时,会提示你..

当然现在功能很简单,并没有好友的头像,书籍音乐的封面等等...后续版本会完善

最重要的是目录下有个setup.ini,打开它,然后将beck917替换为你自己的豆瓣帐号,注意这是url中的,不是你的用户名.

比如我的url是http://www.douban.com/people/beck917/,那么就在steup.ini里填写beck917,不用有空格和换行

第一次使用需要花一定的时间存储好友以前的数据..

2008/01/02 update:更新了中文用户名显示,加上了好友所加条目的日期显示

ps:运行程序是 DbFriendsTracks .exe,不是w9xopen.exe~~:-)

2008/01/03 update:修改了可能因为超过1分钟请求40次的显示被豆瓣封掉的可能,现在是请求36次.:-) 


Posted by beck917 at 15:14:37 | Read more | Comments (3) | Trackback (0) | Edit |

用python写了个编码转化的程序 - [coding]
Tag:

因为平时文件编码总是不确定,到最后做完了上面又说转成xxx编码.转来转去的,烦了,干脆自己写个自动转换的程序,想必大家也有此痛苦的经历吧

 不过不只是这个用途的,以前我用palm系统的treo650看电子书的时候,有些html文档下载下来都是utf-8的,palm系统是不支持这个的,要转换为gb,当然主要是些英文技术文档...以前用软件转过,虽说也是批量,但为了这点小事装个那么大的软件,感觉系统又乱七八糟的..不爽...呵呵

现在只是放出python写的脚本源代码,等有空的时候方便大家将脚本嵌入c++编译成exe档的.当然用py2exe可以直接转换,但是那样修改转换编码就不是很方便了,或者我必须再搞一个ini的配置文件...嵌入c++的好处是大家可以直接修改脚本.呵呵:-)

放在你要批量转换的文件和文件夹的根目录下就可以了

下面是code:

"""
Put this file in the dir which you want to change file encode
    OK, Les's begin
"""
import os
import glob

#set your file dir
FILE_ENCODE_DIR = ""
FILE_ENCODE_DIR_LIST = ["",]
_dir_list_all = [".",]

#specify file list
_specify_file_list = []

#encode & decode setting
DECODE = "shift_jis" #current encode
ENCODE = "utf-8" #your wanna encode

def main(dir_list):
    global _specify_file_list

    get_dir_son_list(dir_list)
    #print _dir_list_all
    for dir in _dir_list_all:
        specify_file_list = glob.glob("%s/*.html"%(dir))
        _specify_file_list.extend(specify_file_list)

    encode_file(_specify_file_list)

#get the dir list
def get_dir_son_list(dir_list):
    global _dir_list_all
    for dir in dir_list:
        dir_son_list = [os.path.join(dir, f)
                        for f in os.listdir(dir)
                            if os.path.isdir(os.path.join(dir, f))]
        #print dir_son_list--add all dir into _dir_list_all
        _dir_list_all.extend(dir_son_list)
        #recursion
        get_dir_son_list(dir_son_list)

def encode_file(specify_file_list):
    for file in specify_file_list:
        f = open(file)
        f.seek(0, 0)
        f_content = f.read()

        try:
            f_content_encode = f_content.decode(DECODE).encode(ENCODE)
   
            try:
                f_write = open(file,"w")
                f_write.write(f_content_encode)
                f_write.close()
           
            except IOError:
                print "%s:read only; "% file;
           
        except  Exception, e:
            print "%s:There is not right encoding"% file;
        f.close()

main(FILE_ENCODE_DIR_LIST)
print "Encoding end"


Posted by beck917 at 11:13:07 | Read more | Comments (1) | Trackback (0) | Edit |

无聊写了一个blogbus的日志备份程序 - [coding]
Tag:

基本上就是把页面全部抓下来...这样可以备份评论...还有模板,图片..

推荐用firefox离线浏览比较好...

解压后点击运行main.exe

比如beck917.blogbus.com,你只需要在弹出的dos对话框中输入beck917,然后点击回车...用了多线程,所以速度还算可以...

点击此处下载


Posted by beck917 at 17:11:25 | Read more | Comments (4) | Trackback (0) | Edit |


Page共1页 1
© Powered by BlogBus.Com. 2002-, All Rights Reserved.