December 31, 2008 / Kyle Sun / 1 Comment
只不过换了一个脑袋,居然不认我了…
你的资料完整度只有70%。
大家都能看出这个是我吧 😉
大家新年快乐!
2008年注定不平凡,2009呢,也一定不平凡。
未知的精彩,不是么?
December 31, 2008 / Kyle Sun / 0 Comments
昨晚上校内的时候惊奇的发现好多广告,在使用adblock并订阅了若干列表之后这是一件很不可思议的事情。google到这篇文章,试验了一下,相当有效。从此和xiaonei广告say 88了。
新加的Rules:
http://gg.xiaonei.com/*
xiaonei.com#div(ad-bar)
xiaonei.com#div(beta-bar)
xiaonei.com#div(blank-holder)
xiaonei.com#div(class*=selected)
xiaonei.com#div(zidou_music)
December 31, 2008 / Kyle Sun / 1 Comment
今天天气不错,微雪但是有太阳,于是驱车去康奈儿大学(Cornell University)。当然,驱车的不是我,是XY同学。尽管拿了XY同学的车熟悉了一段时间,但离马路杀手还是有点距离。杀手嘛,得保的住自己性命啊。回主题,一路上风景不错,可谓体验了一把美国式的山村小道。途经finger lakers,下去拍了几张小照,湖边好大的风。又经一酒庄,买了几瓶小酒带回来。驱车俩小时,终于到了Ithaca。Ithaca真不大,我们就直奔Cornell。
Cornell校园不小,似乎还分东西南北中五个校区,风景也是不错的,比起我那小小的学校那可是漂亮多了。我们就一路违章停车一路欣赏风景,只可惜是冬天,基本只剩下枯枝了。令人惊奇的是学校里有一瀑布,还非常壮观,一会儿上图便知。
回城之前在Ithaca吃了顿buffet,又一次论证了Pittsburgh不适合居住的命题。
流水帐完毕,上图。
December 29, 2008 / Kyle Sun / 0 Comments
抽空读完了传说中经典图书之一的。虽然书是以Fortran和PL/I作为主体语言的,但大多数内容却一点都不过时。书中的大纲如下:
Introduction
- Write clearly – don’t be too clever.
Expression
- Say what you mean, simply and directly.
- Use library functions.
- Avoid temporary variables.
- Write clearly – don’t sacrifice clarity for ‘efficiency.’
- Let the machine do the dirty work.
- Replace repetitive expressions by calls to a common function.
- Parenthesize to avoid ambiguity.
- Choose variable names that won’t be confused.
- Avoid the Fortran arithmetic IF.
- Avoid unnecessary branches.
- Use the good features of a language; avoid the bad ones.
- Don’t use conditional branches as a substitute for a logical expression.
- Use the ‘telephone test’ for readability.
Control Structure
- Use DO-END and indenting to delimit groups of statements.
- Use IF-ELSE to emphasize that only one of two actions is to be performed.
- Use DO and DO-WHILE to emphasize the presence of loops.
- Make your programs read from top to bottom.
- Use IF, ELSE IF, ELSE IF, ELSE to implement multi-way branches.
- Use the fundamental control flow constructs.
- Write first in an easy-to-understand pseudo-language; then translate into whatever language you have to use.
- Avoid THEN-IF and null ELSE.
- Avoid ELSE GOTO and ELSE RETURN.
- Follow each decision as closely as possible with its associated action.
- Use data arrays to avoid repetitive control sequences.
- Choose a data representation that makes the program simple.
- Don’t stop with your first draft.
Program Structure
- Modularize. Use subroutines.
- Make the coupling between modules visible.
- Each module should do one thing well.
- Make sure every module hides something.
- Let the data structure the program.
- Don’t patch bad code – rewrite it.
- Write and test a big program in small pieces.
- Use recursive procedures for recursively-defined data structures.
Input and Output
- Test input for validity and plausibility.
- Make sure input cannot violate the limits of the program.
- Terminate input by end-of-file or marker, not by count.
- Identify bad input; recover if possible.
- Treat end of file conditions in a uniform manner.
- Make input easy to prepare and output self-explanatory.
- Use uniform input formats.
- Make input easy to proofread.
- Use free-form input when possible.
- Use self-identifying input. Allow defaults. Echo both on output.
- Localize input and output in subroutines.
Common Blunders
- Make sure all variables are initialized before use.
- Don’t stop at one bug.
- Use debugging compilers.
- Initialize constants with DATA statements or INITIAL attributes; initialize variables with executable code.
- Watch out for off-by-one errors.
- Take care to branch the right way on equality.
- Avoid multiple exits from loops.
- Make sure your code ‘does nothing’ gracefully.
- Test programs at their boundary values.
- Program defensively.
- 10.0 times 0.1 is hardly ever 1.0.
- Don’t compare floating point numbers just for equality.
Efficiency and Instrumentation
- Make it right before you make it faster.
- Keep it right when you make it faster.
- Make it clear before you make it faster.
- Don’t sacrifice clarity for small gains in ‘efficiency.’
- Let your compiler do the simple optimizations.
- Don’t strain to re-use code; reorganize instead.
- Make sure special cases are truly special.
- Keep it simple to make it faster.
- Don’t diddle code to make it faster – find a better algorithm.
- Instrument your programs. Measure before making ‘efficiency’ changes.
Documentation
- Make sure comments and code agree.
- Don’t just echo the code with comments – make every comment count.
- Don’t comment bad code – rewrite it.
- Use variable names that mean something.
- Use statement labels that mean something.
- Format a program to help the reader understand it.
- Indent to show the logical structure of a program.
- Document your data layouts.
- Don’t over-comment.
December 25, 2008 / Kyle Sun / 1 Comment
暴好玩的一个机器人对抗赛,虽然是遥控的…… 有的机器人还有出场动作… 国内怎么没这种比赛….
在engadget上看到的,原文地址