Jun 10
When there is ambiguities in writing antlr grammar, there are different ways to solve it.
1. Simply avoid them. This is the ideal way when it’s possible.
2. Turn on backtracking, which is most inefficient way.
3. Use left factoring.
4. Use syntax predicates.
For some samples, check it out at http://www.antlr.org/wiki/display/ANTLR3/How+to+remove+global+backtracking+from+your+grammar
The format of sytnax predicate is close to semantic predicates. There are 3 types of them:
1. Validating semantic predicate, to place constraints on rules. For example
data : ( b += BYTE )+ {$b.size() <= 4}? ;
2. Gated semantic predicate, to turn on some alternatives under runtime condition. For example:
stat: ifState | {allowAssert}?=> assertStat ;
3. Disambiguating semantic predicate, to choose alternatives based on semantic context. For example:
stat: keyIf ID stat | keyCall ID ‘;’ ;
keyIf: {input.LT(1).getText().equals(”if”)}? ID ;
keyCall: {input.LT(1).getText().equals(”call”)}? ID ;
Apr 06
In Firefox, visit:
about:config
Then set network.automatic-ntlm-auth.trusted-uris to your trusted domains, separated by comma.
Apr 02
Some of my thoughts: Unit tests are very important in TDD. It enables you easily refactor code, adhere to customer requirements, and verify logics at earliest points. It also enables Continuously Integration to work brilliantly.
Mar 02
There is a famous Cassandra PPT at SigMod 2008. In one slide, they presented several interesting lessons:
- Add fancy features only when absolutely required
- Many types of failures are possible
- Big systems need proper system-level monitoring
- Value simple designs
These lessons are interestingly useful. 
Feb 06
This is pretty interesting:

The Visualization of Browser War
Feb 05
This should be a good tutorial. I need to look into it:
http://www.ibm.com/developerworks/edu/os-dw-os-ecl-commplgin1.html
I know there is an excellent tutorial in Chinese. It demos how to craft a source code editor using Eclipse JFace Text Framework and a bit ANTLR. The link is here.
Feb 05
Here are some tutorial links for learning antlr v3:
- The Getting Started Tutorial from Official Site is Damn Good!
- ANTLR Works is a damn good tool!
- The Definitive Antlr Reference is a good book
- ANTLR 3.X Tutorials are good video course and introduced a damn good eclipse tool: ANTLR IDE.
Feb 03
After installing Ubuntu 9.10, eclipse became naughty. I tried to create a Java Project. However, mouse-click on Next/Finish buttons didn’t work. The buttons got focused, but no response. So you have to press ENTER or SPACE to actually press the buttons.
A quick fix here: create a shell script. For example, eclipse.sh:
export GDK_NATIVE_WINDOWS=1
/home/frankdu/Developer/eclipse/eclipse
Then add executable permission to the file: chmod +x ./eclipse.sh
Every time you run eclipse.sh to launch eclipse. At least we can be happy for a while. Please see http://www.eclipse.org/forums/index.php?t=msg&goto=498640& for more information.