校内网好sx

只不过换了一个脑袋,居然不认我了…
你的资料完整度只有70%。

大家都能看出这个是我吧 😉

大家新年快乐!
2008年注定不平凡,2009呢,也一定不平凡。

未知的精彩,不是么?

Adblock屏蔽校内广告

昨晚上校内的时候惊奇的发现好多广告,在使用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)

小游Cornell

今天天气不错,微雪但是有太阳,于是驱车去康奈儿大学(Cornell University)。当然,驱车的不是我,是XY同学。尽管拿了XY同学的车熟悉了一段时间,但离马路杀手还是有点距离。杀手嘛,得保的住自己性命啊。回主题,一路上风景不错,可谓体验了一把美国式的山村小道。途经finger lakers,下去拍了几张小照,湖边好大的风。又经一酒庄,买了几瓶小酒带回来。驱车俩小时,终于到了Ithaca。Ithaca真不大,我们就直奔Cornell。

Cornell校园不小,似乎还分东西南北中五个校区,风景也是不错的,比起我那小小的学校那可是漂亮多了。我们就一路违章停车一路欣赏风景,只可惜是冬天,基本只剩下枯枝了。令人惊奇的是学校里有一瀑布,还非常壮观,一会儿上图便知。

回城之前在Ithaca吃了顿buffet,又一次论证了Pittsburgh不适合居住的命题。

流水帐完毕,上图。

The Elements of Programming Style

抽空读完了传说中经典图书之一的。虽然书是以Fortran和PL/I作为主体语言的,但大多数内容却一点都不过时。书中的大纲如下:

Introduction

  1. Write clearly – don’t be too clever.

Expression

  1. Say what you mean, simply and directly.
  2. Use library functions.
  3. Avoid temporary variables.
  4. Write clearly – don’t sacrifice clarity for ‘efficiency.’
  5. Let the machine do the dirty work.
  6. Replace repetitive expressions by calls to a common function.
  7. Parenthesize to avoid ambiguity.
  8. Choose variable names that won’t be confused.
  9. Avoid the Fortran arithmetic IF.
  10. Avoid unnecessary branches.
  11. Use the good features of a language; avoid the bad ones.
  12. Don’t use conditional branches as a substitute for a logical expression.
  13. Use the ‘telephone test’ for readability.

Control Structure

  1. Use DO-END and indenting to delimit groups of statements.
  2. Use IF-ELSE to emphasize that only one of two actions is to be performed.
  3. Use DO and DO-WHILE to emphasize the presence of loops.
  4. Make your programs read from top to bottom.
  5. Use IF, ELSE IF, ELSE IF, ELSE to implement multi-way branches.
  6. Use the fundamental control flow constructs.
  7. Write first in an easy-to-understand pseudo-language; then translate into whatever language you have to use.
  8. Avoid THEN-IF and null ELSE.
  9. Avoid ELSE GOTO and ELSE RETURN.
  10. Follow each decision as closely as possible with its associated action.
  11. Use data arrays to avoid repetitive control sequences.
  12. Choose a data representation that makes the program simple.
  13. Don’t stop with your first draft.

Program Structure

  1. Modularize. Use subroutines.
  2. Make the coupling between modules visible.
  3. Each module should do one thing well.
  4. Make sure every module hides something.
  5. Let the data structure the program.
  6. Don’t patch bad code – rewrite it.
  7. Write and test a big program in small pieces.
  8. Use recursive procedures for recursively-defined data structures.

Input and Output

  1. Test input for validity and plausibility.
  2. Make sure input cannot violate the limits of the program.
  3. Terminate input by end-of-file or marker, not by count.
  4. Identify bad input; recover if possible.
  5. Treat end of file conditions in a uniform manner.
  6. Make input easy to prepare and output self-explanatory.
  7. Use uniform input formats.
  8. Make input easy to proofread.
  9. Use free-form input when possible.
  10. Use self-identifying input. Allow defaults. Echo both on output.
  11. Localize input and output in subroutines.

Common Blunders

  1. Make sure all variables are initialized before use.
  2. Don’t stop at one bug.
  3. Use debugging compilers.
  4. Initialize constants with DATA statements or INITIAL attributes; initialize variables with executable code.
  5. Watch out for off-by-one errors.
  6. Take care to branch the right way on equality.
  7. Avoid multiple exits from loops.
  8. Make sure your code ‘does nothing’ gracefully.
  9. Test programs at their boundary values.
  10. Program defensively.
  11. 10.0 times 0.1 is hardly ever 1.0.
  12. Don’t compare floating point numbers just for equality.

Efficiency and Instrumentation

  1. Make it right before you make it faster.
  2. Keep it right when you make it faster.
  3. Make it clear before you make it faster.
  4. Don’t sacrifice clarity for small gains in ‘efficiency.’
  5. Let your compiler do the simple optimizations.
  6. Don’t strain to re-use code; reorganize instead.
  7. Make sure special cases are truly special.
  8. Keep it simple to make it faster.
  9. Don’t diddle code to make it faster – find a better algorithm.
  10. Instrument your programs. Measure before making ‘efficiency’ changes.

Documentation

  1. Make sure comments and code agree.
  2. Don’t just echo the code with comments – make every comment count.
  3. Don’t comment bad code – rewrite it.
  4. Use variable names that mean something.
  5. Use statement labels that mean something.
  6. Format a program to help the reader understand it.
  7. Indent to show the logical structure of a program.
  8. Document your data layouts.
  9. Don’t over-comment.

暴好玩的一组机器人

暴好玩的一个机器人对抗赛,虽然是遥控的…… 有的机器人还有出场动作… 国内怎么没这种比赛….

在engadget上看到的,原文地址