August 19, 2004

REST, rest, ReST, RESTful, REST-based

Oh, guys!
Please check the dictionary first when next time you coined one more acronym, or you will be fighting it the rest of your life

Posted by bruce at 03:26 PM | Comments (0)

April 28, 2004

关于Perl

From The Tao of Mac - Tech Made Simple


Oh, I forget. Pretty much all of the Perl and PHP code I've written still works. And the Perl bits are likely to last for centuries, even if due to subsequent developer's fears of changing a single comma. But then, Perl isn't as sexy as C#?, mostly in the same way a camel isn't even remotely as cool as a monkey.

呵呵, 我最怕Perl的地方就是什么时候改错一个字符程序就罢工了, 而且程序通常还可以运行, 只是结果不是你想要的 :P

Posted by bruce at 05:12 PM | Comments (0)

February 05, 2004

The Zen of Python (by Tim Peters)

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

from Python Humor

Posted by bruce at 03:03 PM | Comments (0)

January 15, 2004

在vim中局部排序

今天又学会一招

VIM里面, 如果你要把从当前行以下10行按字母顺序排序

只要输入:.,+10!sort
怎么样,很简单吧

Posted by bruce at 01:48 PM | Comments (0)

November 12, 2003

Win2k命令行自动完成(Autocomplete)的设置

  1. 打开regedit
  2. 找到HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor
  3. 将里面的CompletionChar和PathCompletionChar都改成09(TAB键的ASCII码)
  4. 退出regedit

好了,等你再打开cmd窗口的时候就可以用TAB键来自动完成文件名或者目录路径了
例如:输入

cd doc
按TAB键就会变成
cd "Documents and Settings"

相关连接:
Techy: Autocompletion in Win2k

Windows 2000 Tweaks

Posted by bruce at 01:26 PM | Comments (2)

November 05, 2003

UI Patterns

Patterns in UI Interactive Design
一个关于网站、GUI应用界面互动设计的模式的网站。做Web或者传统GUI程序开发的都应该读一读

其他相关链接:
UI Patterns and Techniques
Patterns from the book "A Pattern Approach to Interaction Design" (PAID)
by Jan Borchers

刚好可以拿来用,呵呵

Posted by bruce at 10:50 AM | Comments (0)

October 28, 2003

MVP & TDD

GUI开发初看起来很简单,直接把buttons/listbox等等往屏幕上一堆、写几句响应事件的代码就完了(典型的VB逻辑 :p)。但真正做起来才知道还有很多问题要考虑,要真正做好就更不容易了。如果你的form上有几十个控件同时存在,那么单单组织不同的单击、右键、节点选择等等的事件就是一场灾难了。

显然我需要把表现和实现分开,以前开发Java的时候对MVC模式印象深刻,在Google的帮助下,找到了MVC的改进版Model-View-Presenter, 似乎这个比较符合我的需要。

另外也找到一篇关于在dotNet下应用TDD的文章Test-Driven Development in .NET里面对GUI进行unit test的做法以及使用mock object 的方法给我很大启发


Posted by bruce at 05:47 PM | Comments (0)