Designed for smart programmers

As for Arc, I think you actually get a
better language if you design for smart
programmers. Designed for smart
programmers: C, Smalltalk, Lisp. Designed
for “average” programmers: Cobol, Pascal,
Java. See a pattern here?

Paul Graham
Tuesday, December 18, 2001

2010.04.05 Monday ACHK

Philosophy

.

What philosophy books would you recommend?

I can’t think of any I’d recommend. What I learned from trying to study philosophy is that the place to look is in other fields. If you understand math or history or aeronautical engineering very well, the most abstract of the things you know are what philosophy is supposed to be teaching. Books on philosophy per se are either highly technical stuff that doesn’t matter much, or vague concatenations of abstractions their own authors didn’t fully understand (e.g. Hegel).

— Paul Graham

.

.

.

2010.04.05 Monday ACHK

Pure Maths

Past papers 15

“Past papers” means “past HKCEE/HKAL examination papers”. The topic is for Hong Kong students who are facing HKCEE or HKAL. But the general principles can also be used for tackling other public examinations.

這段改篇自 2010 年 2 月 7 日的對話。

懂不懂讀書方法呀?

(LWT:我都不知道如何讀 …)

如果不是自己先天可以掌握到的科目,你就需要有「讀書方法」。我以前有沒有教過你讀書方法?我應該有教過你。

不如你先試試問我問題。

(LWT:我覺得呢 … Pure Maths(純數學)中,好像每一道題目都有新的做法 …)

無錯 … Pure Maths 就是這樣的 …

(LWT:好像每一道題目都有新的做法。做新的題目時,我不能用我已知的方法技巧,試試可不可以做到。)

其實可以這樣看:Pures Maths 一方面不是好似 Applied Maths(應用數學科)一樣,你大量練習,大量背誦,就會合格;另一方面,它又不是如你所說的那麼極端:「題題都要用新的方法」。

實情是,Pure Maths 的每一課本身可能有十幾個主要的做法技巧。而每次是考你該十幾個技巧的不同組合。你試想想,如果一課有 10 個新的方法,而每題題目也抽其中 5 個來考驗你的話,那就有 252 個組合。因為可能的組合太多,你不察覺該一課所考的,來來去去也是那 10 個方法,導致你以為每題所用的都是新的技巧。

所以,倒轉想一想,你反而要想辦法歸納出每一課背後的那 10 幾個方法技巧。如果你歸納到的話,你在該課就不會有大困難。

(LWT:哪如何歸納呢?是不是讀完一課後,自己就嘗試歸納?)

毋須這樣。你逐題做就可以。你做完每一題就可以立刻歸納。即是這樣,例如,這一題你用了 定理一、定理三、公式五、技巧一 和 技巧四。那你就把它們記錄在你的筆記簿中。第二題又這樣記錄,第三題又這樣記錄,如此類推。每一題做完以後也歸納一些重點。

(LWT:即是記錄自己用過哪幾個技巧?)

無錯。一路記錄下去,到了(例如)第五題時,你會發現有些你要記錄的重點技巧開始重複。到了(例如)第十二題時,你會發現再沒有新的技巧需要記錄。即是話,你已完成了該課的歸納工作。

如果你成功應用這個讀書方法的話,你的 Pure Maths 科就可以起碼達到 C 級的成績。當然,如果你要去到 A 級的層次的話,到你考試做題目時,千萬不可以要很有意識地、慢慢地盤算究竟是用哪幾個技巧。

如果你要去到 A 級的層次的話,你要平時已經歸納好,而且非常純熟到到你考試做題目時,所需要的技巧可以自動彈出來。

— Me@2010.04.04

2010.04.04 Sunday (c) All rights reserved by ACHK

The primordial forces

* Programming in Lisp is like playing with the primordial forces of the universe. It feels like lightning between your fingertips. No other language even feels close.

o Glenn Ehrlich

2010.04.04 Sunday ACHK

Nerd 3

.

As a thirteen-year-old kid, I didn’t have much more experience of the world than what I saw immediately around me. The warped little world we lived in was, I thought, the world. The world seemed cruel and boring, and I’m not sure which was worse.

Because I didn’t fit into this world, I thought that something must be wrong with me. I didn’t realize that the reason we nerds didn’t fit in was that in some ways we were a step ahead. We were already thinking about the kind of things that matter in the real world, instead of spending all our time playing an exacting but mostly pointless game like the others.

— Paul Graham

.

.

.

2010.04.04 Sunday ACHK

Category of small categories

In mathematics, specifically in category theory, the category of small categories, denoted by Cat, is the category whose objects are all small categories and whose morphisms are functors between categories. Cat may actually be regarded as a 2-category with natural transformations serving as 2-morphisms.

The category Cat is itself a large category, and therefore not an object of itself. In order to avoid problems analogous to Russell’s paradox one cannot form the “category of all categories”. But it is possible to form a quasicategory of all categories.

— Wikipedia on Category of small categories

2010.04.03 Saturday ACHK

Product

.

I think the solution is to assume that anything you’ve made is far short of what it could be. Force yourself, as a sort of intellectual exercise, to keep thinking of improvements. Ok, sure, what you have is perfect. But if you had to change something, what would it be?

If your product seems finished, there are two possible explanations: (a) it is finished, or (b) you lack imagination. Experience suggests (b) is a thousand times more likely.

— Paul Graham

.

.

.

2010.04.03 Saturday ACHK

Code refactoring

Code refactoring is the process of changing a computer program’s source code without modifying its external functional behavior in order to improve some of the nonfunctional attributes of the software. Advantages include improved code readability and reduced complexity to improve the maintainability of the source code, as well as a more expressive internal architecture or object model to improve extensibility.

— Wikipedia on Code refactoring

2010.04.02 Friday ACHK

筆墨

.

刀槍能夠殺人,筆墨可以救人,人類的社會因為有了傳媒人類才真正溝通成為一個體系。試想過去人類的歷史社會在未有傳媒的時期,人類的社會是多麼的黑暗,人類的認知是如何單薄。各位傳媒朋友,請繼續你們有建設性的工作,只要你秉承良知,人類的社會就會因傳媒而進步。我懷念你,我會在另一個世界向你揮手。

— 梁幗馨

.

.

.

2010.04.02 Friday ACHK

多次元宇宙 8

色即是空,空即是色」的意思是,雖然「現象」和「本體」是不同的東西,但是,要觀察「本體」,我們只能透過「現象」。正如,雖然「杯的影像」和「杯本身」是不同的東西,但是,要觀察「杯本身」,我們只能透過「杯的影像」。

「色即是空,空即是色」中的「即是」,是指當我們說

我的眼睛接收到,一隻『杯』的『影像』。」時,意思即是

我看到一隻『杯』。」;

而當我們說

我看到一隻『杯』。」時,意思又即是

我的眼睛接收到,一隻『杯』的『影像』。

.

(安:既然是這樣,為什麼我們花,這麼多的時間,去理解「現象」和「本體」的分別呢?)

我們沒有辦法,看到「物自身」。這是一個定義問題——給你「看到」的,就是「現象」,不是「物自身」。

正如我們沒有辦法,直接看到「杯本身」。給你「看到」的,就是「杯的影像」,不是「杯本身」。

既然是這樣,為什麼要去明白,「物自身/本體」的意思呢?為什麼要去明白,「現象」和「本體」的分別呢?

.

知道「物自身」這個概念,可以令我意識到,我所觀察到的「現象」,並不是「物自身」,所引發的唯一「現象」。

正如,知道「杯本身」這個概念,可以令我意識到,我所看到的「杯的投影」,並不是「杯本身」,所引發的唯一「投影」。這是一個圓柱體的杯。我從側面望,會見到一個長方形。但是你從上面望,則會見到一個圓形。

.

「物自身」這個概念,有什麼用處呢?

知道「物自身」這個概念,可以令我意識到,我所觀察到的「現象」,並不是「物自身」,所引發的唯一「現象」。

例如,我們(人類)觀察到的「現象」是,「這杯雪糕是白色的」。這個「現象」的產生,是因為有雪榚的「物自身」,和我們的視覺器官所配合。但是,其他生物可能因為,有不同構造的視覺器官,例如可以接收紅外線,而見到不同於,「這杯雪糕是白色」的「現象」。

又例如,我們見到的「現象」是,「這個世界是彩色的」。但是,同一個世界,因為狗是色盲的,牠們見到的「現象」是,「這個世界是黑白的」。

(那是簡化的講法,因為狗只是「紅綠色盲」,不是「全色盲」。– Me@2023-11-13 12:56:32 PM)

透過「物自身」這個概念,令我們知道還有,我們感受以外的,其他「現象」存在。

(安:這就是「色即是空,空即是色」,最有意思的地方。)

— Me@2010.04.01

.

.

2010.04.01 Thursday (c) All rights reserved by ACHK

Peter Norvig

On practical applications of academic concepts, he mentions that part of the problem is that academics do not see the whole problem and another part is education. If you have a bunch of programmers who don’t understand what a monad is and haven’t taken courses in category theory, there’s a gap.

— Wikipedia on Coders at work

2010.04.01 Thursday ACHK

Small and large categories

A category C is called small if both ob(C) and hom(C) are actually sets and not proper classes, and large otherwise. A locally small category is a category such that for all objects a and b, the hom-class hom(a, b) is a set, called a homset. Many important categories in mathematics (such as the category of sets), although not small, are at least locally small.

— Wikipedia on Category (mathematics)

2010.03.31 Wednesday ACHK

OCD 4

Past papers 14

“Past papers” means “past HKCEE/HKAL examination papers”. The topic is for Hong Kong students who are facing HKCEE or HKAL. But the general principles can also be used for tackling other public examinations.

這段改篇自2010年 1 月 3 日的對話。

(KYH:我考試有時明明某一題做完做對了,但是覺得寫得很混亂,所以會擦掉,重新寫一次。)

那就應該算是「情緒病」,因為你這個問題十分浪費你的考試作答時間。如果那導致你整份試卷損失幾分的話,你該科隨時會低一個 grade(成績等級)。那就是我所講的「實質影響」。

你的問題算是「情緒病」,因為你的問題對你有「實質影響」。

我說我在二十八歲時,可以排除了九成的情緒病。我有很多方法,其中一個方法可能對你有用,可以用來解決你這個問題。

那個方法是:「不要百份百跟足你的感覺行事。」

例如,你的感覺是,你的字體不美,想擦掉,重新寫一次。哪應不應該聽從這個感覺,真的把那些字重新寫一次呢?

完全不聽從的話,心裡會極不舒服。完全聽從的話,又會浪費大量的時間。哪怎麼辦呢?

你可以只聽從一部分,但不聽從全部。例如,感覺是要你擦掉一整頁,重新寫一次。但你堅持只擦掉半頁。一方面,你不是完全聽從感覺,所以你不會浪費太多的時間。另一方面,你不是完全不聽從感覺,你心裡即使有不舒服的感覺,也不會大至不能接受的程度。

還有,你長期這樣做的話,慢慢就會習慣了「只擦掉半頁」。當你「只擦掉半頁」也不會有不舒服的感覺時,你就可以試試「只擦掉四分之一頁」,如此類推。

你會這樣(擦掉,重新寫一次),是因為你不容許自己有不舒服的感覺(覺得寫得很混亂)。我這個方法的原理是,要你容許自己有不舒服的感覺。有時,容許自己有不舒服的感覺,不舒服的感覺反而傷害不到你。

— Me@2010.03.30

2010.03.30 Tuesday (c) All rights reserved by ACHK

Lisp macros

Lisp’s uniform, parenthesized syntax works especially well with macros. Languages of the Lisp family, such as Common Lisp and Scheme, have powerful macro systems because the syntax is simple enough to be parsed easily. Lisp macros transform the program structure itself, with the full language available to express such transformations. Common Lisp and Scheme differ in their macro systems: Scheme’s is based on pattern matching, while Common Lisp macros are functions that explicitly construct sections of the program.

Being able to choose the order of evaluation (see lazy evaluation and non-strict functions) enables the creation of new syntactic constructs (e.g. control structures) indistinguishable from those built into the language. For instance, in a Lisp dialect that has cond but lacks if, it is possible to define the latter in terms of the former using macros.

Macros also make it possible to define data languages that are immediately compiled into code, which means that constructs such as state machines can be implemented in a way that is both natural and efficient.

— Wikipedia on Macro (computer science)

2010.03.30 Tuesday ACHK

多次元宇宙 7

為什麼《心經》說「色『即是』空」?「即是」在這裡,是什麼意思?

(安:暫時也不是很明白。除了說「即是」之外,《心經》還說「不異」:「色不異空,空不異色」。

首先要問,「色」和「空」是不是,同一個意思?

如果不是同一個意思,它們有什麼分別?(「色即是空」這句話是錯誤的。)

如果是同一個意思,《心經》為什麼要,講多一次?(「色即是空」這句話是多餘的。))

.

《心經》說「色『即是』空」,意思是:

我們如何可以,觀察到「本體」呢?

唯有透過「現象」。

「本體」是不能直接,被觀察到的,因為我們不能,『直接看到』「本體」。我們只能透過「現象」,去觀察「本體」。「透過『現象』去觀察『本體』」是「觀察『本體』」的唯一方法。

正如,一隻杯的「本身」是不能直接,被觀察到的,因為我並不能一次過,觀察到那隻杯的「整體」。我每次所看到的,只是那隻杯的某個角度,投射在我視網膜上的,平面影像。在任何一個角度,觀察到的「影像」,都只是其中一個「投影」。任何一個「投影」,都不是那隻杯「本身」。但是,我們除了靠,那隻杯的「影像」外,並沒有任何方法可以,觀察到杯的「本身」。所以,「透過『投影』去觀察『杯本身』」,是「觀察『杯本身』」的唯一方法。

.

色即是空,空即是色」的意思是,雖然「現象」和「本體」是不同的東西,但是,要觀察「本體」,我們只能透過「現象」。正如,雖然「杯的影像」和「杯本身」是不同的東西,但是,要觀察「杯本身」,我們只能透過「杯的影像」。

「色即是空,空即是色」中的「即是」,是指當我們說

我的眼睛接收到,一隻『杯』的『影像』。」時,意思即是

我看到一隻『杯』。」;

而當我們說

我看到一隻『杯』。」時,意思又即是

我的眼睛接收到,一隻『杯』的『影像』。

— Me@2010.03.29

.

.

2010.03.29 Monday (c) All rights reserved by ACHK

Passport

Mainland China and Taiwan

The People’s Republic of China (PRC) and the Republic of China (ROC) do not recognise each other as sovereign states. They both claim themselves as the only legal government representing the whole China.

Consistent with the 1992 Consensus, the PRC and ROC legally consider both citizens in mainland China and Taiwan as their own citizens, but residing in different areas of the same nation. Neither the PRC nor the ROC accepts passports issued by the other as entry documents.

Citizens in Taiwan use identity documents issued by PRC public-security authorities to enter mainland China. Citizens in mainland China entering Taiwan must also use identity documents issued by the ROC authority, and have their mainland documents surrendered. The identity documents cannot be used for international travel, and an endorsement must be obtained separately to enable travel.

The ROC used to require its citizens who intended travel to mainland China to obtain official approval for the travel, and prescribed an administrative fine of NT$20,000 to NT$100,000 for those who did not. However, the fine was often unenforceable because such travel was untraceable by examination of travel documents, except if an ROC citizen lost his ROC passport while on the mainland, and, so, had to report the loss. The official-approval requirement was abolished, except in relation to ROC officials, of whom applications are required.

— Wikipedia on Passport

2010.03.29 Monday ACHK