2012年4月16日

偶尔看到一篇文章《现代软件工程讲义 如何提出靠谱的项目建议》,里面提到关于创新一般分为:incremental innovation 和 disruptive innovation,这个倒是以前没有想到过的。

另外,文中提到关于新的创意的框架 NABC 模型(也许应该是 NABCD 模型):

  • N(Need) 解决用户的什么需求?
  • A(Approach) 如何采用独特的招数解决用户的痛苦?
  • B(Benefit) 产品/服务 会给 用户/客户 带来什么好处?Benefit/Cost ?
  • C(Competitors) 关于竞争对手?
  • D(Delivery) 怎样把你的创新产品交到用户的手中?
posted @ 2012-04-16 16:56 zhaorui 阅读(8) 评论(0) 编辑

2012年4月9日

原文:How to Read a Paper.pdf

reasons

  1. review paper for a conference or a class
  2. keep current in the field
  3. for a literature survey of a new field

three-pass approach

  1. general idea about the paper
  2. grasp the paper's content, not details
  3. understand the paper in depth

the first pass (5-10 min)


quick scan, get a bird's-eye view of the paper. ... decide whether need more passes.

  1. Carefully read the title, abstract, and introduction
  2. Read the section and sub-section headings, but ignore everything else
  3. Read the conclusions
  4. Glance over the references, mentally ticking off the one's you've already read

answer five Cs

  1. Category: What type of paper is this? A measurement paper? An analysis of an existing system? A description of a research prototype?
  2. Context: Which other papers is it related to? Which theoretical bases were used to analyze the problem?
  3. Correctness: Do the assumptions appear to be valid?
  4. Contributions: What are the paper's main contributions?
  5. Clarity: Is the paper well written?

the second pass (60 min)


read the paper with greater care, but ignore details such as proofs. ... jot down the key points, or make comments in the margins.

  1. Look carefully at the figures, diagrams and other illustrations in the paper. Pay special attention to graphs. Are the axes properly labeled? Are results shown with error bars, so that conclusion are statistically significant? 
  2. Remember to mark relevant unread references for further reading (a good way to learn more about the background of the paper)

After this pass, you should be able to grasp the content of the paper. You should be able to summarize the main thrust of the paper, with supporting evidence, to someone else.

Sometimes you won't understand a paper even at the end of the second pass. This may be because the subject matter is new to you, with unfamiliar terminology and acronyms. Or the authors may use a proof or experimental technique that you don't understand, so that the bulk of the paper is incomprehensible. The paper may be poorly written with unsubstantiated assertions and numerous forward references. Or it could just be that it's late a night and you're tired. You can choose to:

  • set the paper aside, hoping you don't need to understand the material to be successful in your career
  • return to the paper later, perhaps after reading background material
  • persevere and go on to the third pass

the third pass (240-300 min for beginners and 60 min for an experienced reader)

fully understand a paper... The key to the third pass is to attempt to virtually re-implement the paper: that is, making the same assumptions as the authors, re-creation with the actual paper, you can easily identify not only a paper's innovations, but also hidden failings and assumptions.

This pass requires great attention to detail. You should identify and challenge every assumption in every statement. Moreover, you should think about how yourself would present a particular idea. This comparison of the actual with the virtual lends a sharp insight into the proof and presentation techniques in the paper and you can very likely add this to your repertoire of tools. During this pass, you should also jot down ideas for future work.

At the end of this pass, you should be able to reconstruct the entire structure of the paper from memory, as well as be able to identify its strong and weak points. In particular, you should be able to pinpoint implicit assumptions, missing citations to relevant work, and potential issues with experimental or analytical techniques.

Doing a literature survey

  1. use an academic search engine and some well-chosen keywords to find three to five recent papers in the area. Do one pass on each paper to get a sense of the work, then read their related work sections. You will find a thumbnail summary of the recent work, and perhaps, if you can find such an survey, you are done. Read the survey... good luck.
  2. find shared citations and repeated author names in the bibliography. these are the key papers and researchers in that area. Download the key papers and set them aside. Then go to the websites of the key researchers and see what they've published recently. That will help you identify the top conferences in that field because the best researchers usually publish in the top conferences.
  3. go to the website for these top conferences and look through their recent proceedings. A quick scan will usually identify recent high-quality related work. These papers, along with the ones you set aside earlier, constitute the first version of your survey. Make two passes through there papers. If they all cite a key paper that you didn't not find earlier, obtain and read it, iterating as necessary.

Related Work

posted @ 2012-04-09 16:15 zhaorui 阅读(17) 评论(0) 编辑

2012年3月19日

今天在网上看到了有 Sample of the Day 这样的栏目,其实每天看一个代码示例,也花费不了多少时间,如果能坚持下来,应该会有收获。

今天看了一下 [Sample of Mar 12th] Check whether a file is in use or not,代码如下:

 1 /// <summary> 
2 /// This function checks whether the file is in use or not.
3 /// </summary>
4 /// <param name="filename">File Name</param>
5 /// <returns>Return True if file in use else false</returns>
6 public static bool IsFileInUse(string filename)
7 {
8 bool locked = false;
9 FileStream fs = null;
10 try
11 {
12 fs =
13 File.Open(filename, FileMode.OpenOrCreate,
14 FileAccess.ReadWrite, FileShare.None);
15 }
16 catch (IOException )
17 {
18 locked = true;
19 }
20 finally
21 {
22 if (fs != null)
23 {
24 fs.Close();
25 }
26 }
27 return locked;
28 }

经常会遇到类似的需要判断文件是否在用的问题,这里给出的方案应该是比较容易使用的。

一开始我有一点疑问,就是如果文件不存在的情况下,那么这个方法可能并不合适。后来,下载完整代码示例,发现示例中在调用 FileInUse.IsFileInUse(fileName) 之前,已经使用 File.Exist 验证过文件是否存在这样问题。

而现有的 FileInUse.IsFileInUse(fileName) 方法,其实更符合每个方法只处理一件事情的原则。

另外一个疑问,是关于 FileInUse.IsFileInUse(fileName) 方法中的异常处理的,我注意到 File.Open() 可能引发的异常除了 Exception.IOException 之外(包括 IO 异常的子类),还有一些 Exception.SystemException 类的异常(包括其子类异常,比如 System.ArgumentException 和 System.ArgumentNullException 等),主要是因为传递的参数(文件路径)有问题。而示例程序中只处理了 System.IOException,这里是否有漏洞呢?

后来再查看 File.Exist(string path) 的返回值,发现关于文件路径为空、或者是文件路径不合法的问题都已经处理过了,方法会返回 false,而且这个方法不会返回异常。

true if the caller has the required permissions and path contains the name of an existing file; otherwise, false. This method also returns false if path is null, an invalid path, or a zero-length string. If the caller does not have sufficient permissions to read the specified file, no exception is thrown and the method returns false regardless of the existence of path.

最后,还注意到这里使用了 try ... catch ... 来组织代码的结构,与常用的 if ... else ... 不太一样(忘记在哪里看到过,最好不要使用 try ... catch ... 来组织代码);仔细想想,如果使用 if ... else ... 结构,那么这段代码会更加的复杂。

这一小段程序写的,还真是滴水不漏啊。

posted @ 2012-03-19 11:41 zhaorui 阅读(16) 评论(0) 编辑

2012年3月11日

第五课

看到 Mehran Sahami 把变量 variable 比做盒子 box,真是让人开心,因为我也是这么想的。

一个变量有三个要素:名字 name,类型 type 和 值 value。

编程语言里面的关键字也不是 key word 而是 reserve word。

Java 中的原类型 primitive type

整型 int (integer),取值范围 minus 2 billion to 2 billion,整型一般用来说明:how many kind value counting

双精度浮点型 double,real-value number,用来说明:how much there is,no next value

这个关于整型和浮点型的解释挺有意思的,比如问,你有多少个孩子?回答应该是整型的;你的体重有多少?回答可以是带小数点的

give variables an initial value when it make sense it is also good software engineering.

在写 C# 程序的时候,遇到整型变量,我还是比较习惯使用默认值“0”;字符型的变量,有时候我会赋初始值 string.Empty。

type name = value;

variable = expression;

You can say, give me a variable that is a box, and the type that the box holds is an object that’s the type of some class, so all classes can actually be used as type means.

the object is receiver who’s receiving or being told to do something.

the name of the variable is the receiver and the method that’s being called is the message.

取余运算符 remainder operator  % : 7 % 2 = 1

posted @ 2012-03-11 20:16 zhaorui 阅读(24) 评论(0) 编辑

第四课

Mehran Sahami 给出了一个简要的计算机发展史:

1800's Charles Babbage 提出了通用计算机的设想(谁要是说算盘就是最早的计算机,蹴鞠就是最早的足球,那我就……)。

Ada Byron  是世界上的第一个程序员,而且还是个女程序员。当时并没有计算机,她只是在Babbage 设想的计算机上编程 。

1930-40's : prototype 原型机

1946: ENIAC Electronic Numerical Integrator and Computer 第一台计算机诞生

1971: 1st microprocessor Intel 4004 第一块微处理器诞生

727px-KL_National_INS4004

学了这么多年的计算机,其实一直没有特别合适的定义给 Computer Science,如果简称为 CS 的话,有时会被误以为是 Counter Strike 。这里给出的定义非常好:

Computer Science: science/study of program solving or computer/computation method.

计算机科学是研究“如何解决问题或者是运算方法”的学科。计算机科学一直以来并不被认为是真正的科学,而更多的是看作工程学科中的分支。维基百科有如下解释:

Computer science designates the scientific and mathematical approach in information technology and computing. A computer scientist is a person who does work at a professional level in computer science and/or has attained a degree in computer science or a related field.

如果按照这个解释,等我毕业了,也可以自称 Computer Scientist 吗?感觉有点奇怪。其实 Computer Engineer 更合我的心意。

machine language is a computer understands or in some sense what the microprocessor understands.

machine language is defined by what chip you have inside your computer … eventually going to boil down into a bunch of ones and zeros.

compilation is done by a compiler.

source code– compiled  –> library – linked –> executable/application

JVM, Java Virtual Machine

JAR, Java Archive

a class just basically an encapsulation of some behavior and data.简单的说,类就是数据和行为的封装

class is template of the object 类是对象的模板

object is instance of class 对象是类的实例

posted @ 2012-03-11 19:49 zhaorui 阅读(21) 评论(0) 编辑

第三课

原来死循环的英文名字不是“Dead Loop”,而是“Infinite Loop”。

Mehran Sahami 讲了一个关于死循环的段子,说曾经有一个芯片公司(名称不可考)号称自己开发出了当时世界上最快的芯片,广告词里说:“……执行一个死循环只需要 2.5 秒……”

而真实情况是,一旦执行死循环,那么芯片的温度会迅速的升高,以至于融掉……

OBOE, off-by-one error/bug is a logic error involving the discrete equivalent of a boundary condition. It often occurs in computer programming when an iterative loop iterates one time too many of or too few. Usually this problem arise when a programmer fails to take into account that a sequence starts at zero rather than one, or makes mistakes such as using “is less than or equal to” where  “is less than” should have been used in a comparison.

… part of good programming style is all of your programs up at the top should have a comment that say what the name of the file is and has a little bit of an explanation about what your program actually does.

以前我也觉得应该写详细的注释,后来的确遇到了维护注释和代码一致性的问题;后来接触了敏捷方法论,开始认为好的代码比注释更能说明问题。不过最近又开始觉得,在写“好”代码的同时,加一些简单明确的注释,应该也是不错的选择。

在程序文件的顶部写清楚文件的名字,代码段所想要完成的功能,前置条件和后置条件,以及修改的人员和名称应该是比较合适的。当然这部分内容可以在版本管理工具中注明,但是感觉上不如直接写在代码文件上更加清晰。

如何分解 decomposition 问题?primitives ,逐步求精stepwise refinement,自顶向下 top down design

其实我一般比较习惯 bottom up design,比如喜欢先把底层的数据库访问代码写好,然后再写业务逻辑层。其实也许自顶向下也是不错的选择,这样可以避免在开始阶段写无用的代码(“以后可能会用的着”)。

Mehran Sahami 说有心理研究表明,从自底向上的思维方式转为自顶向下需要 100 个小时。

one of methods should basically solve one problem

guide line for good methods:

  1. solve 1 program
  2. 1- 15 line per method
  3. good name
  4. comments
posted @ 2012-03-11 19:20 zhaorui 阅读(30) 评论(0) 编辑

最近看了几集斯坦福大学的《编程方法学》公开课,感谢斯坦福,感谢网易,感谢人人字幕组

个人感觉这个课程比较适合编程入门,但是我看了之后也觉得挺有收获。

第二课

在上一课的最后和这一节课之中,见到了 Karel 机器人,这个应该是斯坦福为了编程教学专门开发的一个 Java

教学程序,非常适合用来入门教学。

我没有找到 Karel 机器人单独下载的页面,但是在课程主页上,有包括 Karel 机器人在内的 Stanford Eclipse 下载,还有使用说明

如果使用 Google 搜索的话可以发现更多的关于 Karel 机器人的内容,不过大部分是英文的,主要适用于 Java 的教学。如果早发现这个的话,也许我会喜欢上 Java。

我还发现了 .Net 平台下的 Karel Robot

不知道还有多少人听说过 Visual J#,比较神奇的是在 Visual J#(Visual Studio 2005) 中有一个 Jblmp.exe 命令,可以将 Java 的 .jar 文件,编译成 .Net 平台下的 DLL 文件。后来可能因为授权的问题,没有再出后续的版本(Visual J# 则销声匿迹了)。

在课程中,Mehran Sahami(课程讲师)提了一个问题:

What is the downfall of the modern college student?

揣度良久,后来给出的答案是:SNOOZE!

如果一定要翻译成中文的话,我觉得应该是“拖延症”。早上起床的闹钟,交作业前夜的通宵,考期之前的刻苦……

“算法 Algorithm——其实就是菜谱 recipe”,已经不是一位老师这么说了。不过我做饭的时候,基本上不看菜谱啊,就好像写程序的时候不顾及算法一样。

The program is something that is valid syntactically according to the rules of the language.

其实我觉得语言之间本质上的差别不大,只要了解语法规则的差异,很快就能从一种语言转换到另一种语言。编程本身也没有什么太神奇的地方。

Write programs for people to read, not just for computers to read.

The important thing to realize in programming is programing is not just about writing a program that the computer understands. Programming is about writing programs that people understand.

程序是写给别人看的,这个我倒是明白,不过也是最近几年才明白过来的。

posted @ 2012-03-11 15:59 zhaorui 阅读(35) 评论(0) 编辑

最近看了几集斯坦福大学的《编程方法学》公开课,感谢斯坦福,感谢网易,感谢人人字幕组

个人感觉这个课程比较适合编程入门,但是我看了之后也觉得挺有收获。

第一课

这一课的内容基本上是一个课程介绍,如果你没有编程经验,看过这一课之后应该可以放下顾虑了。

课程中提到了关于“Honor code”的概念,要求学生们“don’t share code”。其实我觉得这个原则,在学习编程的时候非常重要,思路可以讨论交流,但是代码不可以。至于,开放源代码和分享知识,并不属于这个范围。

另外一个引起我注意的地方就是,课程讲师说,差不多每课时需要课后三个小时左右的学习巩固。这个我心有戚戚,我现在也有课在上,但是课后 1:1 的学习时间都很难保证,应改在课堂之外多花费一些时间,只有这样才能学到东西。

课程中间提到了关于“Debug” 这个术语的来历,最近还真是接二连三的看到这个典故。Grace Hopper,又被人称为 Rear Admiral "Amazing Grace" Hopper,美国计算机科学家和海军女军官。美国海军有一艘导弹驱逐舰用她的名字命名 USS Hopper(DDG-70),另外还有一台超级计算机以她为名 Cray XE6 "Hopper" supercomputer

The First Computer Bug

posted @ 2012-03-11 15:20 zhaorui 阅读(35) 评论(0) 编辑

2012年3月9日

大概是五年前,看到有人在网络上讨论看了多少美剧,其中一个美剧达人声称其看过的美剧超过 1000 小时。后来有人回帖说,1000 小时非常小“case”,只要看过《老友记》就已经 200 个小时左右了……

《老友记》,我倒现在可能也没有完整的看过,但是其中的一部分倒是反复看了几次,当时美其名曰“看美剧学英语”来着。

现在回想一下自己看过的美剧,基本上是从 2004 左右开始,不完全统计:

老友记》 10 季 200 小时,虽然没有完整的看过,但是花的时间不少于 200 小时

太空堡垒卡拉狄加》 4 季 75 小时,最好看的美剧之一

24小时》 8 季 192 小时,至少看过两遍,看到最后一集,杰克·鲍尔说,“没想到,这么多年来,你一直陪着我”

豪斯医生》 8 季 168 小时,豪斯毒舌

越狱》 4 季 81小时,最帅的帅哥

绝望的主妇》 8 季 160 小时,第 8 季没有看完,讲了很多有关婚姻生活中的故事

生活大爆炸》 5 季 50 小时;这个还在继续,我也还在跟进,理科生的生活

冰与火之歌》 1 季 10 小时;期待第二季,传奇大片

制毒师》 3 季 46 小时,7 月份会出第 4 季,应该会看完这个最后一季大结局

迷失》6 季 121 小时,我最喜欢第一季,刚开始的时候,介绍各个任务

太平洋战争》 1 季 10 小时

罗马》 2 季 22小时

斯巴达克斯:血与沙》 2 季 20 小时,号称很黄很暴力,不过第 3 季换了主演,也就没有再看下去

无路可退》 1 季 13 小时,可惜第 2 季被砍了

夺命岛》 1 季 13 小时,不知道还有没有

国土安全》 1 季 12 小时,不知道会不会看第 2 季

八卦天后》 5 季 90 小时;看到第 5 季之后觉得没有什么意思,放弃了

英雄》 4 季 50 小时;看到第 3 季之后放弃

单身毒妈》 7 季 60 小时;看到第 5 季之后放弃

……

还有一些零散的美剧,不一一列举,大概总共花在上面有 2000+ 小时吧。

这些美剧当中,有一些非常好看,以后也许还会重看;而更多的则是消磨时光而已。

最近开始看网络上的一些公开课,有时候会琢磨,如果……

posted @ 2012-03-09 23:19 zhaorui 阅读(18) 评论(0) 编辑

2012年3月2日

摘要: 首先声明一下,我不是去挂号的,是去打酱油的,对于挂专家号略有了解。 1. 北医六院每天的专家号大概 60 个左右,而且视当天挂号的情况而定,比如你拿到了36 号,但是前面的人已经把你想要的专家挂满了,那也一样没戏。 2. 北医六院专家号采用了排号制度,每天早上六点开始,由门口传达室的保安负责发号,按先来后到的顺序。 3. 如果想要确保挂到特定的专家号,那么可能五点半之前到达传达室门前排队比较...阅读全文
posted @ 2012-03-02 23:56 zhaorui 阅读(51) 评论(0) 编辑

公告

导航

统计