2004/07/04

PHP, Java, C , C, Perl, JavaScript 在线美化

PrettyPrinter.de, an online pretty printer for PHP, Java, C , C, Perl, JavaScript

这个站点是G-Mailto的作者推荐给我的。我用它来格式化了gmail的javascript代码,很不错的。

Delicious BLOG上的美味书签

del.icio.us

PeakJink的精彩介绍:

在Isaac Mao的网站上有一个名字好听的书签:“美味”书签(del.icio.us),“美味”之名从何而来不知道,但是这样的一“简单”的网站提供的功能确很实用,并有现在热门的“社会软件”现象之功能。所有的bookmarks和tags均共享,所有的用户和浏览者都可以看到这些信息,并可按tags和url进行索引,这样就把有相同兴趣的人联系到一起,例如刚刚我加了一个photoblogs.org到Blogs Tags中,那么立刻就提示“and 46 others”,点击可查询到所有添加过此URL的信息,这样我就可以找到都有谁在关心这个网站,我可以到这些人的书签中找到更多的相关URL,轻松地获得很多有用的连接。
“美味”书签还有另外一个优秀的功能,就是Tags共享,每个人建立的Tags都会共享出来,相同的Tags的内容将放到一起,这更是一个体现社会化的一个方式。
“美味”书签还提供了popular、Archives、Most Active和RSS,都是方便bookmarker们使用的功能。
del.icio.us被Isaac Mao称之为“美味”书签,我要把它叫做Share bookmarks,感觉这个名字更能体现它的作用,晕~~为什么del.icio.us自己不起一名字,非让bookmarker们自己叫呢!


Delicious首先是一个社会化的BLOG项目,参与者当然也是分成过客和社员,社员以tag方式把自己每天浏览的url Blog起来,而TAG则可以展示一种横向关系,同TAG的有多少社员在加入过此TAG。

很有意思。

2004/07/01

中国特色的IPv9要走出实验室?

中国新一代自研网络技术IPv9即将走出实验室_互联网_科技时代_新浪网

研究报告:十进制网络与数字域名研究进展_互联网_科技时代_新浪网

老外的科幻式IPV9评论:不研究历史的人,注定要重复他。


究竟什么回事,上位者对这个很感兴趣?了解的说说内情吧。

Gmail's What's news!!!

Gmail: Help Center

前几天,我给GMAIL发了个建议:
1,希望能看到反馈的BUG和建议汇总。
2,希望提供一个BLOG或What's news网页,能跟踪GMAIL的进度,知道有什么改进,有什么增加。

很高兴,今天收到GMAIL的信,告知这个连接:

If
your problem is unique or requires further investigation, we will contact
you. Please refer to our list of known bugs at
http://gmail.google.com/support/bin/request.py to learn more about the
most commonly reported problems.

2004/06/30

SUN提供了一个site,保存了各个版本的JDK

Archive: Java[tm] Technology Products Download

今天看到有人找旧版的JDK,好角是1.21,有同志提供了这个网址。Sun还是有心人,把这么多历史版本都保存着,而且是公开的。

2004/06/29

Gmail 的javascript脚本



这是RabidSquirrel的提示:

You can view the GMail javascript code by logging in to GMail and doing a view-source. Inside that source you should see a link near the bottom that looks like this:
/gmail?view=page&name=js&ver=9b13d59dd3d703c3
now just add gmail.google.com in front of that


现在可以一窥GMAIL所写的Javascript了,也可以当作是学习一个顶级的脚本是如何做的。

2004/06/28

推荐一份共笔的GMAIL笔记

Bob Chao/Note Book/Note About Gmail - ErnEstWiki

WiKi 听闻已久了,这有两个层面:
1,是自己架WiKi的服务器,纯在技术面上玩玩,或以此作为CMS,来组建BLOG平台。
2,WiKi真正的价值是全球自由评论自由共笔的方式,有人叫它百科全书,参与进去,成为知识的传播者。
这两个层面我都没有涉足。

今天看到这份Gmail笔记,看它有个编辑的连接,很奇怪地试按一下,竟可以任由访客随便修改,我还未搞清WiKi如何保户不被乱删乱改,估计是有所谓transaction的rollback机制吧,不管怎么说,想建设的应比想破坏的人要多。

WiKi简单的标记语法也很适合专注于内容的人,值得学一下。

这个Gmail笔记,大家可以把自己发现的问题,体会的技巧都追加上去,很好玩的 :)

2004/06/27

Python 脚本转换成WIN EXE的开源工具:Py2EXE

Py2EXE

昨天和今天,为了修改GML,从未接触过Python,硬着头皮干了一个通宵,终于有些感觉,GML再加上今天的完善,功能自觉已很强了。

Python的老家提供的win版,只有一个解释环境,用了一天,有些意思,比perl要爽。为了找个编译器,类似以前的perl2exe,搜了一下,找到这个开源工具,它的大体工作方式是把需要的库打包成ZIP文件,再加一个exe的loader,就成了独立于python解释环境的win exe程序了。

Assuming you have written a python script myscript.py which you want to convert into an executable windows program, able to run on systems without a python installation. If you don't already have written a distutils setup-script, write one, and insert the statement 'import py2exe' before the call to the setup function:

# setup.py
from distutils.core import setup
import py2exe

setup(console=["myscript.py"])

Running

python setup.py py2exe --help

will display all available command-line flags to the py2exe command.

Now you can call the setup script like in this way:

python setup.py py2exe

and a subdirectory dist will be created, containing the files myscript.exe, python23.dll, and library.zip. If your script uses compiled C extension modules, they will be copied here as well, also all dlls needed at runtime.

These files include everything that is needed for your program, and you should distribute the whole directory contents.

The above setup script creates a console program, if you want a GUI program without the console window, simply replace console=["myscript.py"] with windows=["myscript.py"].

py2exe can create more than one exe file in one run, this is useful if you have a couple of related scripts. Pass a list of all scripts in the console and/or windows keyword argument.




2004/06/26

又一个基于mBox格式文件的转信工具:gExodus - a graphical Gmail import tool

redemption in a blog: gExodus - a graphical Gmail import tool

Unix mBox格式,是一种经典的archive 邮件的方式,每一封邮件在编码后按一个个mail box平面堆叠成一个文本文件。由于大多数email client都支持导出成mbox的格式,所以mbox事实上成为了平台转换的中间件了。

Gmail的出现,寻求把历史邮件转移到GMAIL保存的方法成为了迫切的需要,前几天的GML就是把mbox或maildir(这个不知是什么格式)批转到gmail的,但试用后,问题较多,不好用:

1, 部分中文邮件的header没有MIME编码,GML不会在resent时给它编码,这导致了GMAIL里显示中文标题和中文收发人名称成乱码,Gmail把这类邮件都SPAM掉。
2,部分中文邮件没有content-type,GML不会按locale加上缺省charset,导致GMAIL显示中文乱码。
3,发送fail或skip掉的邮件没有记录,fail的邮件又不会重发,不方便断点续送。
4,不知是python的bug还是windows的问题,GML使用python来处理mbox文件,它总是把next msg的首行(from行)的部分字符追加到上一邮件的末尾,而且这个问题,似乎用家都无觉察。
5,可能是python的win引擎不好,经常在发出部份信后,程序无响应,挂起。


今天,又看到一个基于python的Redirect mails工具:gExodus,没有提供源码:

When I saw (and used) Mark Lyon's Mbox & Maildir to Gmail Loader (GML) (I wrote about it), I was inspired to write a GUI version of it (I didn't copy Mark's code, just in case, though it works on the same basis). gExodus is what came out at the end of half a day's work.


3种Mailbox结构示例

メッセージの保存?配布形式

Unix Mbox :

From Tue Apr 15 06:59:55 2003
Received: from ml3.jp.example.com by polar.example.com
with SMTP id PAA96667; Tue, 15 Apr 2003 06:59:55 +0000
Date: Tue, 15 Apr 2003 15:59:48 +0900
From: Taro
Reply-To: greeting@example.com
To: greeting@example.com
Subject: Hello in Japanese
Message-ID: <20030415.150425.518470cc6ef@jp.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-2022-JP
Content-Transfer-Encoding: quoted-printable

=1B$B$3$s$K$A$O!#=1B(B

From Tue Apr 15 11:42:20 2003
Received: from ml2.cn.example.com by polar.example.com
with SMTP id PAA98169; Tue, 15 Apr 2003 11:42:20 +0000
Date: Tue, 15 Apr 2003 19:42:05 +0800
From: Li
Reply-To: greeting@example.com
To: greeting@example.com
Subject: Hello in Chinese
Message-ID: <20030415.193436.274c278069a@cn.example.com>
In-Reply-To: <20030415.150425.518470cc6ef@jp.example.com>
References: <20030415.150425.518470cc6ef@jp.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=GB2312
Content-Transfer-Encoding: base64

xOO6ww0K



eml 文件:

Received: from ml3.jp.example.com by polar.example.com
with SMTP id PAA96667; Tue, 15 Apr 2003 06:59:55 +0000
Date: Tue, 15 Apr 2003 15:59:48 +0900
From: Taro
Reply-To: greeting@example.com
To: greeting@example.com
Subject: Hello in Japanese
Message-ID: <20030415.150425.518470cc6ef@jp.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-2022-JP
Content-Transfer-Encoding: quoted-printable

=1B$B$3$s$K$A$O!#=1B(B


multpart 分卷格式:

Date: Wed, 16 Apr 2003 03:00:05 +0000
From: greeting-admin@example.com
To: Undisclosed recipients:;
Subject: Messages Posted Yesterday
Message-ID: <20030416.030004.0b93d3b234d@example.com>
MIME-Version: 1.0
Content-Type: multipart/digest;
boundary="--------=_NEXTBODYPART-010C11D7AB79F830D3"

----------=_NEXTBODYPART-010C11D7AB79F830D3
Content-Type: message/rfc822

Received: from ml3.jp.example.com by polar.example.com
with SMTP id PAA96667; Tue, 15 Apr 2003 06:59:55 +0000
Date: Tue, 15 Apr 2003 15:59:48 +0900
From: Taro
Reply-To: greeting@example.com
To: greeting@example.com
Subject: Hello in Japanese
Message-ID: <20030415.150425.518470cc6ef@jp.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-2022-JP
Content-Transfer-Encoding: quoted-printable

=1B$B$3$s$K$A$O!#=1B(B

----------=_NEXTBODYPART-010C11D7AB79F830D3
Content-Type: message/rfc822

Received: from ml2.cn.example.com by polar.example.com
with SMTP id PAA98169; Tue, 15 Apr 2003 11:42:20 +0000
Date: Tue, 15 Apr 2003 19:42:05 +0800
From: Li
Reply-To: greeting@example.com
To: greeting@example.com
Subject: Hello in Chinese
Message-ID: <20030415.193436.274c278069a@cn.example.com>
In-Reply-To: <20030415.150425.518470cc6ef@jp.example.com>
References: <20030415.150425.518470cc6ef@jp.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=GB2312
Content-Transfer-Encoding: base64

xOO6ww0K

----------=_NEXTBODYPART-010C11D7AB79F830D3--

python的re模块使用详解

Regular Expression HOWTO

python使用正则表达式的方法和perl有很大的不同,这个文档有助于作初步的理解。