Brain | Computer

Modern computer chips handle data at the mind-blowing rate of some 10^13 bits per second. Neurons, by comparison, fire at a rate of around 100 times per second or so. And yet the brain outperforms the best computers in numerous tasks.

One reason for this is way computations take place. In computers, calculations occur in strict pipelines, one at a time.

In the brain, however, many calculations take place at once. Each neuron communicates with up to 1000 other neurons at any one time. And since the brain consists of billions neurons, the potential for parallel calculating is clearly huge.

— Massively Parallel Computer Built From Single Layer of Molecules

2011.10.30 Sunday ACHK

Computer

Steven Paul “Steve” Jobs (February 24, 1955 – October 5, 2011)

= Apple Inc. + Pixar Animation Studios

Dennis MacAlistair Ritchie (b. September 9, 1941; found dead October 12, 2011)

= the C programming language + the UNIX operating system

John McCarthy (September 4, 1927 – October 24, 2011)

= Artificial Intelligence (AI) + the LISP programming language

— Me@2011.10.27

2011.10.27 Thursday (c) All rights reserved by ACHK

Palm

sp332 414 days ago | link

You can still set rules. “All first-party Microsoft software will take 5 clicks to install. More than 5 and you need a sign-off from a VP.” Palm had a rule that it should take 3 taps to get anywhere on the system. They had a guy whose full-time job was to count taps for various actions.

2011.10.23 Sunday ACHK

Read more slowly

(安:Paul Graham 的文章中,間中會出現一些我原先不懂,有關寫程式的技術細節。但是,不知何故,我最後也能看懂那些文章。)

主要的原因是,你肯花額外的時間去鑽研。遇到技術細節時,只要肯讀得慢一點,你明白的機會就會非常高。

這個方法,不單適用於「間中出現技術細節」的文章。對於整篇也是技術細節的「文章」,例如電腦程式碼,也同樣適用。Joel Spolsky 講過,一個程式員之所以不能理解其他人所寫的程式碼,往往是因為閱讀得太快:期望以閱讀文章的速度,去閱讀程式碼。

一般文章的一行一句,你可能在十秒內就能讀完。但是,你不能那樣對待程式碼。「程式碼」之所以叫做「碼」,是因為它們是「密碼」:並不是一般人在日常溝通所用的語言。閱讀程式碼,就好像破解密碼一樣。既然是破解密碼,你又怎能期望,十秒內就可以完成到一行呢?

這一點在閱讀數學書時,也要同樣留意。不能期望,可以以閱讀一般文章的速度,去理解數學公式。

— Me@2011.10.22

Ramon Garcia Fernandez writes:

    … but it is difficult to read code written by another programmer.

My response:

    I think the best way to read somebody else’s code is just to SLOW DOWN… it’s like deciphering a code, not like reading. Most people have trouble reading code because their eyes are used to reading at a certain speed from reading text written in human languages.
   
— Joel on Software

— by Joel Spolsky

2011.10.22 Saturday (c) All rights reserved by ACHK

Class projects

1. The programs you write in classes differ in three critical ways from the ones you’ll write in the real world: they’re small; you get to start from scratch; and the problem is usually artificial and predetermined. In the real world, programs are bigger, tend to involve existing code, and often require you to figure out what the problem is before you can solve it.

2. That leads to our second difference: the way class projects are measured. Professors will tend to judge you by the distance between the starting point and where you are now. If someone has achieved a lot, they should get a good grade. But customers will judge you from the other direction: the distance remaining between where you are now and the features they need. The market doesn’t [care] how hard you worked. Users just want your software to do what they need, and you get a zero otherwise.

3. There seem to be two big things missing in class projects: (1) an iterative definition of a real problem and (2) intensity.

– Paul Graham

2011.09.04 Sunday ACHK

Windows 2.4

時間定義 11.4

現在任何一件事的發生,都不只建基於過去的某一件事。「Windows XP 的存在」並不是「Windows Vista 存在」的唯一先決條件。 Windows Vista 除了建基於 Windows XP 的源程式碼之外,還有不少外加元素。所以,把它們標籤為「同一個程式」的兩個版本,並非因為必然,而是為了商業上的便利,讓 Windows Vista 可以承繼 Windows XP 在市場上的身份。

試想想,如果 Microsoft(Windows 的製作公司)不把 Windows Vista 叫做「Windows Vista」,而把它叫做「Doors Vista」的話,後果會是怎麼樣? Microsoft 會損失慘重: 大眾根本不知道「Doors Vista」是什麼,哪會有人敢購買?

把 Windows Vista 和 Windows XP 標籤為同一個程式的兩個版本,尚算「正常」,因為 Windows Vista 的確是建基於 Windows XP。至起碼,Windows Vista 有運用和修改過大量 Windows XP 的源程式碼。但是,有時候,會有一些「反常」的標籤出現。沒有關係的兩個程式,由於起了相似的名字,令人誤以為它們是同一個程式的兩個版本。看看這條時間線:

Windows 95 –> Windows 98 –> Windows 2000 –> Windows XP –> …

驟眼看來,有部分人以為, Windows 2000 是 Windows 98 的後續版本。實情是,它們除了外表介面相似以外,就幾乎沒有任何關係。如果不理外表和名字,只看它們的源程式碼的話,你會發覺,它們是沒有「血緣關係」的。我估計,它們只有少於 1% 的源程式碼是相同的,因為它們根本來自兩個不同的程式系列(Windows 9x 系 和 Windows NT 系)。正正是因為那樣,有部分在 Windows 98 運行到的電腦遊戲程式,並不能在 Windows 2000 上存活。

真正的「族譜」應該是:

Windows 9x

    * Windows 4.0 (Windows 95) –> Windows 4.1 (Windows 98) –> Windows 4.9 (Windows Me)

Windows NT

    * Windows NT 3.51 –> Windows NT 4.0 –> Windows NT 5.0 (Windows 2000) –> Windows NT 5.1 (Windows XP)

— Me@2011.08.24

2011.08.24 Wednesday (c) All rights reserved by ACHK

Bootstrapping 3

Self-hosting 3

Bootstrapping is a term used in computer science to describe the techniques involved in writing a compiler (or assembler) in the target programming language which it is intended to compile. Applying this technique leads to a self-hosting compiler.

— Wikipedia on Bootstrapping (compilers)

2011.08.20 Saturday ACHK

Wikipedia 3

Name: Jimmy “Jimbo” Wales
Job: Founder, Wikipedia
Passion: Information for everyone      
Turning Point: An operation that saved his daughter’s life taught him the need to stockpile rare knowledge such as her doctor’s

He wipes it off and begins haltingly.

“At the end of the procedure, I realized how precious the doctor’s knowledge was. It occurred to me that no one other than this doctor would ever know about this whole thing. There had to be a way”. And that is how Wikipedia came about.

— Daddy has Kira to Thank

— by Subroto Bagchi | Jun 5, 2009

2011.08.17 Wednesday ACHK

Windows 2.3

時間定義 11.3

我的「時間標籤論」是指,例如 Windows XP 和 Windows Vista 是應該被視為同一個程式的兩個版本,還是兩個不同的程式,我們有一定的自由度。但是,「時間標籤論」暫時仍未能解決「記憶問題」:既然 Windows Vista 有 Windows XP 的記憶,為何你仍然堅持,我們有自由度把它們標籤為兩個不同的程式呢?

我的「時間標籤論」要完備的話,就一定要修正這個漏洞。但是,我暫時想不到辦法。你有何高見?

我突然想通了:那其實即是一個「因果問題」。根據我們之前的講法,「原因」即是「先決條件」。以上所講,「時間標籤論」的漏洞,其實就即是以下的質疑:

Windows Vista 是建基於 Windows XP 編寫而成的。Windows XP 是 Windows Vista 的先決條件。沒有 Windows XP,就沒有 Windows Vista。所以,我們應該把它們標籤為同一個程式的兩個版本。Windows XP 應該被視為 Windows Vista 的「過去」。我們沒有權力,或者自由度,把它們標籤為兩個不同的程式。

對於這個質疑,我的反駁是,Windows Vista 除了建基於 Windows XP 的源程式碼之外,還有不少外加元素。而那些外加元素,是來自於 Windows XP 以外的源程式碼的。試想想,Windows Vista 有很多內置程式,是在 Windows XP 中,從來沒有出現過的。所以,Windows Vista 之所以存在的先決條件,並不只是有 Windows XP 一個。換句話說,除了 Windows XP 外,Windows Vista 還有其他的「過去」。

假設,總體而言,Windows Vista 建基於 Windows XP、程式甲、程式乙 和 程式丙。如果你質疑我「為何有你自由度把 Windows XP 和 Windows Vista 標籤為兩個不同程式」的話,我亦可以質疑你,為何有你自由度把 Windows XP 和 Windows Vista 標籤為同一個程式的兩個版本?還有,我可以再質疑你,為何你不把「程式甲」和 Windows Vista 標籤為同一個程式的兩個版本?

要化解「時間標籤論」的「記憶問題」,我們要留意,Windows Vista 除了有 Windows XP 的記憶外,還會有 Windows XP 以外的記憶。正如「2010 安」除了有「2005 安」的記憶外,還會有其他人的記憶。例如,「2010 安」在 2010 年之前閱讀過 愛因斯坦 的自傳的話,「2010 安」就會有 愛因斯坦 的部分記憶。又例如,「2010 安」在 2010 年之前跟過「老師甲」學習過唱歌的話,「2010 安」就會有 老師甲 的唱歌技巧記憶。

— Me@2011.08.16

2011.08.16 Tuesday (c) All rights reserved by ACHK

時間姓名

Windows 2.2 | 時間定義 11.2

究竟應該把「2000安」、「2005安」和「2010安」看成三個不同的人,用不同的名字,還是把他們看成同一個人的三個不同「時間版本」,用同一個名字呢?

那要視乎情況而定:看看哪一種標籤方法,最適合個人生活,最方便社會運作。

究竟應該把 Windows XP、Windows Vista 和 Windows 7 看成三個不同的程式,用不同的名字(XP、Vista 和 7),還是把他們看成同一個程式的三個不同版本,用同一個名字,都叫做「Windows」呢?

那沒有一定的答案:一方面,不是完全任意;另一方面,我們又有一定的自由度。

但是,如果我們選擇把「2005安」和「2010安」看成兩個不同的人的話,你怎樣可以解釋,為何「2010安」會有「2005安」的記憶?既然他們是不同的人,就不應會有對方的記憶。

對應於 Windows 例子的類似問題是:如果我們選擇把 Windows Vista 和 Windows 7 看成兩個不同的程式的話,你怎樣可以解釋,為何 Windows 7 有部分程式碼,會與 Windows Vista 的相同?

還有,即使是不相同的部分,有很大程度上,都是建基於 Windows Vista 的:由原本在 Windows Vista 的源程式碼修改加工而成。既然 Windows Vista 和 Windows 7 是不同的程式,Windows 7 就不應會有 Windows Vista 的記憶。

我的「時間標籤論」是指,例如 Windows Vista 和 Windows 7 是應該被視為同一個程式的兩個版本,還是兩個不同的程式,我們有一定的自由度。但是,「時間標籤論」暫時仍未能解決「記憶問題」:既然 Windows 7 有 Windows Vista 的記憶,為何你仍然堅持,我們有自由度把它們標籤為兩個不同的程式呢?

我的「時間標籤論」要完備的話,就一定要修正這個漏洞。但是,我暫時想不到辦法。你有何高見?

— Me@2011.08.13

2011.08.13 Saturday (c) All rights reserved by ACHK

Windows 2.1

時間定義 11.1

對於「時間」的定義,我最近想到一個淺白的例子。

如果你堅持 Windows XP、Windows Vista 和 Windows 7 是「同一樣」東西的話,它們就有時間上的關係。Windows XP 是 Windows Vista 的「過去」; Windows 7 是 Windows Vista 的「未來」。

但是,你不一定要將它們看成「同一個」程式的三個不同版本。你可以把它們三個不同的程式。那樣,它們就沒有時間上的關係。

這個例子,比我上次所用的「『2000 安』和『2010 安』是否『同一』個人」,更為精簡易明。

(安:這個我不是太明白 …)

上次提到,既然「2000 安」和「2010 安」有那麼多不同的性質,為何我們可以把他們看成「同一」個人,把他們都標籤為「阿安」呢?

只要加入「時間」概念便行。我們把「2000 安」和「2010 安」看成「同一」個人的兩個不同的「時間版本」。「2000 安」和「2010 安」有不同的性質,是因為「2010 安」是由「2000 安」逐漸變化而成的。「2000 安」是「2010 安」的「過去」;「2010 安」是「2000 安」的「將來」。

當然,我們亦有權把「2000 安」和「2010 安」定義為「兩個人」,給予他不同的名子。但是,在日常生活中,大部分情況下,把「2000 安」和「2010 安」標籤為「同一個人」的兩個版本,遠比把他們標籤為「兩個人」方便得多。

「阿安」例子和今次例子的對應是:

2000 安 Windows XP;

2005 安 Windows Vista; 

2010 安 Windows 7

Windows XP、Windows Vista 和 Windows 7 有很多不同的性質,為何我們可以把他們看成「同一」個程式,把他們都標籤為「Windows」呢?

那是因為 Windows 隨時間而變化。Windows 由 XP 變化成 Vista,然後再由 Vista 變化成 7。Windows XP 是 Windows Vista 的「過去」; Windows 7 是 Windows Vista 的「未來」。

— Me@2011.08.09

2011.08.09 Tuesday (c) All rights reserved by ACHK

Category Theory | Lisp, 4

這段改編自 2010 年 3 月 6 日的對話。

我在前晚發現,我一直在研究的兩個課題,原來在某個角度之下,是同一樣東西。

(安:哪兩樣東西呢?)

一個就是 Paul Graham 強烈推介的 Lisp programming language(Lisp 編程語言)。另一個就是 John Baez 強烈推介的 Category Theory(範疇論)。

利用「範疇論」,我們可以將「相對論」的數學語言和「量子力學」的數學語言,統一成一套數學語言。留意,我不是指統一「相對論」和「量子力學」本身,而是指統一它們的數學語言。「相對論」所用的數學語言是 differential geometry(微分幾何)。「量子力學」所用的數學語言是 representation theory(表示論)。

Lisp 和「範疇論」都是我幾年前就開始關心的課題。最近才發現,它們竟然是「同一樣」東西,令我十分驚奇。幾天前,我還正正考慮著,好不好暫時放棄其中一門,因為我沒有時間同時深入研究 Lisp 和「範疇論」。現在,問題突然消失。

彷彿是同時愛上了兩位女仕,最終要二擇其一。正當面臨痛苦決擇之際,發現她們,竟然是同一個人。

— Me@2011.08.03

2011.08.03 Thursday (c) All rights reserved by ACHK

Clojure

Rich Hickey developed Clojure because he wanted a modern Lisp for functional programming, symbiotic with the established Java platform, and designed for concurrency.

Clojure’s approach to concurrency is characterized by the concept of identities, which represent a series of immutable states over time. Since states are immutable values, any number of workers can operate on them in parallel, and concurrency becomes a question of managing changes from one state to another. For this purpose, Clojure provides several mutable reference types, each having well-defined semantics for the transition between states.

— Wikipedia on Clojure

2011.08.03 Wednesday ACHK