Monthly Archives: July 2010

对信息的思考

我们这个时代被称之为信息时代。当前,信息具有以下特征:

  1. 传播途径不再受地域和时间的束缚;
  2. 数量急速膨胀,无价值的信息超过知识成为主体;
  3. 影响这个世界的途径越来越广、速度越来越快。

对个人而言,这三个特征引发下列问题:

  1. 什么信息是有价值的?如何取舍?
  2. 怎样有效地获得知识,而不是无价值的信息?
  3. 什么样的知识是本质性的、是能够在其他知识的变化和发展中保持不变的?

我们讨论前两者。第三个也值得思考,但它是另外一个话题。 Continue reading

编写Wireshark协议解析器插件(一)

容易忘事,把解决的问题记下来。只是草稿。

参考资料

wireshark是开源软件,可以在版权许可下进行二次开发。有三种方式为其添加协议解析(protocol dissection)功能:

  • 内置解析器
  • 动态链接库形式的插件解析器
  • Lua或Python语言的插件解析器

Continue reading

Knuth老爷子的一段话

Seibel: 很多人都赞同你所说的,自己写代码更有乐趣。但除了乐趣之外——

Knuth: 不仅仅是乐趣而已。数学家的工作是给出证明,但在你求解数学问题时,几乎找不到某个定理的假设和你求解问题所需的假设恰好一模一样。通常来说,你已经得到了一个类似于书上定理的东西,你要做的就是看看它的证明,然后说,“嗯,为了证明我手头现有的假设,我要这样改动一下这个证明。”所以说,虽然数学书里总是塞满了定理,但你永远找不到严丝合缝的那个。你想看见的还是那个需要改动的证明,因为正好找到你想要的定理的概率只有百分之一。我认为这和软件的情况恰好吻合。

Seibel: Many people will agree with you that, yes, it’s more fun to write the code yourself. But other than the fun—

Knuth: It’s not only fun. The job of a mathematician is to make proofs but almost never, when you’re solving a mathematical problem, do you find a theorem for which the hypotheses are exactly what you need for the problem you’re solving. Almost always you’ve got something that’s sort of like the theorem that’s in the book. So what you do is you look at the proof of that theorem and you say, “Oh, here’s how I have to change that proof in order to prove the hypothesis that I really have.” So mathematical books are packed with theorems, but you never plug in exactly the theorem—you want to see that proof because it’s one time in a hundred when you’ll find just the theorem that you wanted. I think it’s exactly the same with software.

选自:Peter Seibel. Coders at Work : Reflections on the Craft of Programming. APress, 2009。中译本将由人民邮电出版社图灵公司翻译出版。

正好解了自己一段疑惑。