Lisp macros 2

People complain macros are difficult to understand. Macros are easy. If you can understand a program that concatenates lists to make a new list, you can understand a macro. Macros are quite literally ‘just lisp code’.

— ohyes 2 weeks ago

— Lisp is Too Powerful

— Hacker News

2012.01.07 Saturday ACHK

Past papers 25.1

這段改編自 2010 年 5 月 19 日的對話。

至於需要做多少年的 past paper(歷屆試題),那因人而異,並沒有一定的答案。但是,你至少要做最近五年的題目。

對於按課題(topic by topic)所做的 past paper,什麼年份的都可以做。只要在課程範圍內,即使是「遠古」時候的題目,也可以對你有很大得益。對於按年份(year by year)所做的,大部分人做大概十年左右就足夠。

我建議,最近五年的試題,你暫時不要做。那樣,你就可以在 study leave(試前休假)時,拿它們來做 mock 卷(模擬試題)。

— Me@2012.01.06

2012.01.06 Friday (c) All rights reserved by ACHK

因緣和合

種子論起點 2

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

.

電影通常「無中生有」;現實通常「有中生情」。你所追求的東西,可能一直在你身邊,只是你沒有留意。

情形就有如,「發明」的過程。Paul Graham 所舉的例子是飛機。建造飛機所需 原材料、原科學 和 原技術,早於發明飛機前的幾十年,就已經存在。只是,那幾十年的時間中,還未有一個人,有足夠大的學養,去掌握建造飛機所需的,所有原技術。所以,那時,並沒有人知道,竟然可以把那堆原技術放在一起。更加沒有人知道,那堆原技術放在一起後,會變成魔法般的作品。

(安:這是來自 Paul Graham 的哪一篇文章?我好像沒有這個印象。)

我的記憶是:「The materials and technologies needed for making airplanes had existed long before the invention of airplane. What it lacked was someone who had enough knowledge to put them together.」

至於這一句是來自,他的哪一篇文章,我已經忘記了。甚至,是不是真的是他所說的,我也不敢肯定。但是,那不重要。真正重要的是,這一句是否正確 和 有沒有見地。

— Me@2012.01.04

.

* Philosophy is like trying to open a safe with a combination lock: each little adjustment of the dials seems to achieve nothing, only when everything is in place does the door open.

* Philosophical problems can be compared to locks on safes, which can be opened by dialing a certain word or number, so that no force can open the door until just this word has been hit upon, and once it is hit upon any child can open it.

– Ludwig Wittgenstein

.

.

2012.01.04 Wednesday (c) All rights reserved by ACHK

學問自傳 1.4

Presentation 基本原理 1.1.3

這段改編自 2010 年 5 月 19 日的對話。

有時,你有些東西不明白。但是,如果你把那些東西教給別人,導致別人明白的話,你自己之後就一定會十分明白,而且會永遠記得。知不知為什麼有這個現象?

原因是,那些知識原本是以別人的語言來表達。教導別人的過程中,無可避免地,你會把那堆知識翻譯成自己的語言。既然是自己創造的東西,你就當然會明白記得。

自己思考和教導別人的最大分別是:自己思考時,往往會因為同一時刻有超過一個意念彈了出來,而導致一片混亂;教導別人時,則要被迫每次只講一個要點。學生明白了一個思考步驟後,你才可以講下一個。所以,教導別人的主要副作用是,自己的思想會「突然」清晰了很多,甚至自己原本不明白的東西都會「無故」明白。

如果沒有同學可以假扮你的學生,你可以自己假扮。或者說,讀書,其實就是一個自己教導自己的過程。製作「魔法筆記」,就是把別人的語言,翻譯成自己的語言。

— Me@2012.01.03

2012.01.03 Tuesday (c) All rights reserved by ACHK

原來是你

種子論起點

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

.

我最近領悟到,何解尋找戀愛對象那麼困難。原來那是因為現實的情況,並不如電影的情節。

電影的情節,往往是男主角原本沒有對象,然後因為編劇的安排,發生了一些特別的事情,從而邂逅到女主角,從此就開始有戀愛對象,二人過著幸福快樂的生活。

現實的情況,則往往是男女主角,本來就認識對方。但是,長久以來,他們都沒有發現,原來對方是自己一直,想找到的另一半。然後,他們有一天,感情深厚到一定程度時,就會突然驚覺:「竟然是你!」。

電影通常「無中生有」;現實通常「有中生情」。你所追求的東西,可能一直在你身邊,只是你沒有留意。

— Me@2009.04.05

— Me@2012.01.01

.

.

2012.01.01 Sunday (c) All rights reserved by ACHK

Literate programming 2

The Haskell programming language has native support for semi-literate programming, inspired by CWEB but with a simpler implementation. When aiming for TeX output, one writes a plain LaTeX file where source code is marked by a given surrounding environment; LaTeX can be set up to handle that environment, while the Haskell compiler looks for the right markers to identify Haskell statements to compile, removing the TeX documentation as if they were comments. However, as described above, this is not literate programming in the sense intended by Knuth. Haskell’s functional, modular nature makes literate programming directly in the language somewhat easier, but it is not nearly as powerful as one of the WEB tools where “tangle” can reorganize in arbitrary ways.

— Wikipedia on Literate programming

2012.01.01 Sunday ACHK

pLaY

Work as intensely as you play and play as intensely as you work.

For true hackers, the boundaries between “play”, “work”, “science” and “art” all tend to disappear, or to merge into a high-level creative playfulness.

– Eric S. Raymond

In academia, a “hacker” is a person who follows a spirit of playful cleverness and enjoys programming.

– Wikipedia on Hacker (academia)

2008.02.05 Tuesday ACHK

遺失魔法筆記

學問自傳 1.3 | 種子意念 2.3.4

這段改編自 2010 年 5 月 19 日的對話。

記住,人最終只會記得自己的思想。不是自己創造的東西,有如橫財,只會悄悄的來悄悄的去。或者說,別人製作的歸納筆記,只是一本「歸納筆記」;自己製作的歸納筆記,才是一本「魔法筆記」。

所以,即使你的同學偷了你的「魔法筆記」,也會得物無所用。當然,你亦千萬不要遺失自己每科的那一本。遺失了的話,一方面,你借同學的那一本筆記來也沒有大用;另一方面,你亦沒有可能在短時間內,重新建構你的「魔法筆記」。

我建議你在平時就用手提電話的數碼相機,把魔法筆記的每一頁也拍下來。萬一遺失時,你都可以有一個存檔。額外的一個好處是,即使你沒有遺失魔法筆記,你亦可以隨時隨地,拿手提電話中的版本來閱讀背誦。

— Me@2011.12.30

2011.12.30 Friday (c) All rights reserved by ACHK

魔間傳奇 11

快樂之道 3

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

我發覺我二十歲時的智力,或者境界,和現在幾乎沒有分別。唯一的主要分別,就是現在的自己對世事的理解,因為掌握多了具體的資料,而深刻了很多。那些資料中,最重要的一個環節是:

現實世界的人所能達到的愚蠢程度,比我能夠想像的最極端情況,還要大很多。

“The secret of happiness is to face the fact that the world is horrible, horrible, horrible. “

哲學家羅素(Bertrand Russell)講過:「快樂之道,在於認清現實世界的恐怖。」

我對這句的詮釋是,正如馬克吐溫(Mark Twain)所言,如果你知道世人都是瘋狂的話,你會發現,世間上很多原本不能解釋的事情,都可以解釋到。當你開始明白了一些原本不能明白的東西時,你的應世技巧自然大大提升,世人很難可以再傷害到你。

比喻說,當你不知道世上有電腦病毒時,即使自己的電腦中了毒,你也不知道。相反,當你認清世上不單有電腦病毒,而且有極多時,你就會有所防範,例如安裝防毒程式,從而大大減低了中毒的機會。

留意,瘋狂的世人,包括你自己。

— Me@2011.12.28

2011.12.28 Wednesday (c) All rights reserved by ACHK

Braid

時空幻境

Braid is a platform and puzzle video game developed by independent software developer Jonathan Blow.

The game features traditional aspects of the platform genre while integrating various powers of time-manipulation.

Blow designed the game as a personal critique of contemporary trends in game development. He funded the three-year project with his own money.

— Wikipedia on Braid (video game)

2011.12.28 Wednesday ACHK