故事連線 1.1.1

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

攻讀博士學位的最大問題是,你花得最多時間的,將會是那些「技術細節」和「沉悶工序」。而大部分的「技術細節」和「沉悶工序」,偏偏沒有所謂的「學術價值」,導致不能寫進博士論文當中。

例如,你花了大約一個月,才千辛萬苦地為實驗室訂購到,你研究題目全部所需的實驗儀器。另外,做實驗時,其中一部電腦壞了,你花了一整天去修理。

然後,你再發現,實驗所用的其中一個電腦程式有嚴重錯誤,導致實驗不能繼續。但是,那個程式不是你編寫的,而原作者又已在很久前,離開了實驗室。他有留下的源程式碼(source code)。可惜,那堆源程式碼共有二萬多行,而中間又沒有任何說明文件,指引你如何修改。你花了一星期,終於聯絡到原作者。

但是,他說,那程式是他在三年前寫下的,細節已經忘記了。於是,你企圖說服你博士論文的指導教授,原本的實驗是可以避免的,因為你想到一個有類似效果的實驗,而又可以避開那個有嚴重錯誤的程式。不幸,教授堅持,原本的實驗至關重要,無論如何,一定要完成。結果,由於教授的「無論如何」,你要再花三個月的時間,由零開始,寫過一個全新的程式,去代替原本的程式。

中途,你還要為本科生準備導修課和批改功課。只要你稍為有良知,要為那些導修課,維持最起碼的質素,你就已經要投放,全部工作時間中的,至少五份之一。

除了做研究和指導本科生外,你還有自己的課要上,自己的試要考。

試想想,以上的劇情,你又怎可以寫進博士論文呢?

— Me@2012.08.17

2012.08.17 Friday (c) All rights reserved by ACHK

Open source

Right-Click -> View Source is what made the web so successful and it’s awesome that we now have this for 3D graphics as well.

— Dominic Szablewski

2012.08.14 Tuesday ACHK

統治機器

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

我看了維基百科有關中國三十年代的文章。文章中說,1927 年至 1937 年間的那段時期,稱為「黃金十年」。那時,國民政府的「統治機器」,已經大致可以運作正常。

這裡「統治機器」的意思,其實就即是「作業系統(程式)」(operating system software)。表面上,「機器」是硬件。實際上,「機器」同時是軟件,而且軟件的「成份」多於硬件。試想想,當我們說「這裡有一部機器」時,並不是指「這裡有一堆金屬」,而是指「這裡有一堆金屬,以一個特別的方式來排列,繼而運作,有一個指定的用途。」

記住,「機器」是軟件。

— Me@2012.08.14

2012.08.14 Tuesday (c) All rights reserved by ACHK

Anthropic principle, 2.4

The correct version of anthropic principle should be called the anti-anthropic principle.

— Me@2011.11.10

The reasonable version of anthropic principle should not be called as “anthropic principle” at all, but “multi-verse natural selection”.

— Me@2011.10.23

2012.08.13 Monday (c) All rights reserved by ACHK

Negative reaction

IsaacL 286 days ago | link

Maybe it doesn’t apply so much for visual design, but I often find that a negative reaction to a new concept or piece of software is better than a “meh” reaction. One example: I made a browser game a few years back, one of the early players posted a huge rant about how frustrating the game was, I fixed the design issues they raised, they grew to love the game.

So I tend to think that a negative reaction is often a sign you have something good, but flawed. You don’t want people saying “yeah, that’s kinda cool”, you want them saying “OMG THIS THING SUCKS I’M TRYING TO GET IT TO DO X BUT I CANT BECAUSE IT DOESNT HAVE FEATURE Y” – at least in the second case you know you have something they want, and you know how to fix it.

— Hacker News

2012.08.13 Monday ACHK

Functional programming 6

A central concept in functional languages is that the result of a function is determined by its input, and only by its input. There are no side-effects! 

— Why Haskell matters

My question is, if a function makes changes only within its local environment, and returns the result, how can it interact with a database or a file system? By definition, wouldn’t that be accessing what is in effect a global variable or global state?

What is the most common pattern used to get around or address this?
   
— edited Dec 7 ’11 at 2:10, Matt Fenwick
   
— asked Dec 6 ’11 at 20:18, juwiley

The most common pattern for dealing with side-effects and impurity in functional languages is:

  •     be pragmatic, not a purist
  •     provide built-ins that allow impure code and side-effects
  •     use them as little as possible!

Examples:

  •     Lisp/Scheme: set!
  •     Clojure: refs, and using mutating methods on java objects
  •     Scala: creating variables with var
  •     ML: not sure of specifics, but Wikipedia says it allows some impurity

Haskell cheats a little bit — its solution is that for functions that access the file system, or the database, the state of the entire universe at that instant, including the state of the filesystem/db, will be passed in to the function.(1) Thus, if you can replicate the state of the entire universe at that instant, then you can get the same results twice from such a function. Of course, you can’t replicate the state of the entire universe at that instant, and so the functions return different values …

But Haskell’s solution, IMHO, is not the most common.

(1) Not sure of the specifics here. Thanks to CAMcCann for pointing out that this metaphor is overused and maybe not all that accurate.   

— edited Dec 7 ’11 at 2:11

— answered Dec 6 ’11 at 22:00, Matt Fenwick

— Stack Overflow

2012.08.12 Sunday ACHK

Earn respect

Prisons: How do you earn more respect in prison?

James Houston, inmate San Quentin

There was a time when I believed respect was about others seeing me as a tough guy. Over the years with maturity as well as help from programs like the TRUST and The Last Mile, my belief system has been challenged and as a direct result, my belief system has changed.

Now I see in prison, as well as in the free world, respect starts with self. Since my belief system has changed, the way I interact in my environment has changed, and the way my environment interacts with me has also changed. I no longer hide or run away from how I really feel. I don’t gossip or talk about people behind their back. I try as best I can to remain fair and impartial.

I can’t say that it gains respect with everyone. I can say it gains my respect with those who have respect for themselves.

All communications between inmates and external channels are facilitated by approved volunteers since inmates do not have access to the internet. This program with Quora is part of The Last Mile San Quentin. Twitter: @TLM
Post ‧ 9:57 on Thu Aug 02 2012

http://www.quora.com/Prisons/How-do-you-earn-more-respect-in-prison

2012.08.12 Sunday ACHK

個人客觀科學 3

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

正如,你上次問我,如果你有一個缺點是,每逢走近麵包店,就會瘋狂地購買過多麵包的話,你應該怎麼辦,才能去除這個缺點。我的答覆是,不要走近麵包店。那樣,你就從來也不會遇到「瘋狂購買麵包」這隻怪獸。你就從來也毋須去處理牠。

你想一想的話,就會發現,這個根本是一個邏輯定律。如果你在走近麵包店之前,都說服不到自己,不要走近麵包店的話,你走近了麵包店時,就更加說服不到自己,不要購買過多的麵包。

有很多惡習的成因,都是基於這個邏輯結構,例如吸煙。吸煙成癮的主因是,吸煙者以為自己,有一個凌駕於自然定律的自由意志:「我吸一點煙不會有什麼事。而且我可以隨時不吸。」問題是,這個是一個邏輯問題。如果你在從來沒有吸煙之時,都說服不到自己,不要吸第一支煙的話,你在吸了第一支煙後,你又怎會說服到自己,不要吸第二支煙呢?

相反,如果知道自己和萬物蒼生一樣,同樣受制於自然定律的話,你就會了解到,即使自己誓神劈願,戒煙同樣會異常困難。那樣,你就從來也不肯吸第一口煙。

「戒煙」的最好方法是,從來不要吸煙。

地球人往往以為,自己有一個凌駕於自然定律的自由意志,其實沒有。人(或者宇宙中的任何東西)只有受制於自然定律的自由意志。或者說,自由意志建基於自然定律。

想要在這個宇宙間呼風喚雨,就要極度詳細地,掌握各種自然定律,從而善加利用。讀理科有助瞭解「物理定律」;讀文科則有助瞭解「人情定律」。兩門定律缺一不可。

— Me@2012.08.12

Knowledge is power. — Sir Francis Bacon

The power is in the principles. — Stephen R. Covey

權力來自於對自然定律的了解和運用。 — Me@2012-08-12 9:56:20 AM

2012.08.12 Sunday (c) All rights reserved by ACHK

Wheeler–DeWitt equation, 6

John Wheeler is also a co-father of the Wheeler-DeWitt equation, the vanishing Hamiltonian constraint applied to the “wave function of the Universe” in quantum gravity that is expected to replace the equations of motion as soon as it is properly formulated. The Hartle-Hawking wave function remains the most famous solution of the WDW equation.

— John Wheeler: 1911-2008

— Lubos Motl

2012.08.11 Saturday ACHK

Meaningful 7

upgrade path

有出路

— Me@2012-08-06 8:28:47 AM

Somewhere in the course of doing Viaweb, someone gave me a very useful piece of advice: users always want an upgrade path, even though as a rule they’ll never take it. Rtml was our upgrade path. If you wanted to, you could get absolute control over everything on your pages.

— Lisp in Web-Based Applications

— Paul Graham

2012.08.11 Saturday (c) All rights reserved by ACHK

Before Sunrise

Before Sunrise is a 1995 romantic drama film directed by Richard Linklater and written by Linklater and Kim Krizan.

The plot is minimalist, since aside from walking and talking, not much happens. The two characters’ ideas and perspectives on life and love are detailed.

The film received high critical praise at the time of its release and has received a rare perfect 100% rating of positive reviews on Rotten Tomatoes and a 77 metascore on Metacritic.

— Wikipedia on Before Sunrise

.

情留半天 Before Sunrise (1995)

日落巴黎 Before Sunset (2004)

情約半生 Before Midnight (2013)

.

2012.08.10 Friday ACHK

個人客觀科學 2.3

真相客觀程式 3.3

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

(安:絕大部分人也不會研究「自己科學」。他們也不會以「自己」為「科學」研究的對象。換句話說,平常人對自己不夠客觀。他們會覺得自己有「自由意志」,例如「我要早上六時起床,就自然可以六時起到床。」

實情則不是那麼簡單。能否在六時正成功起床,除了意願外,還取決於你在之前一晚何時開始睡、身體狀態的好壞 和 當時起床後需不需要上班 等等。)

無錯。大部分人以為,物件和動物需要遵守自然定律,而人,尤其是自己,則可以任意違反自然定律,而毋須承受任何報應惡果。他們忘記了,自己也是人,人也是動物,動物也是物件,同樣受物理定律、化學定律 和 生物定律 的主宰。

例如,想六時起床,就必須設定好「六時起床」的所有先決條件:要保持身體健康,即是不要在平日累積太多的疲勞、之前一晚要早一點睡 和 調校好鬧鐘 等等。又例如,要別人信任你,你就要在長年累月地保持誠信。

所以,所有人都應該受科學的訓練。科學教育的最重點,不在於培養未來的科學家,而在於潛移默化,使大部分未來人,也知道這個世界有「自然定律」,從而習慣事事「以自然定律為中心」。

— Me@2012.08.10

2012.08.10 Friday (c) All rights reserved by ACHK

Tricki

Sir William Timothy Gowers, FRS (born 20 November 1963, Wiltshire) is a British mathematician. In 1998 he received the Fields Medal for his research connecting the fields of functional analysis and combinatorics.

Tricki

Tricki.org is a Wikipedia-style project collecting methods of mathematical problem solving conceived in 2008 and launched by Gowers, Olof Sisask and Alex Frolkin in March 2009. Terence Tao and Ben Green are among those to have contributed articles.

The Cost of Knowledge

In January 2012 Gowers made a post on his personal blog which initiated a project called The Cost of Knowledge. The blog post called for a boycott of Elsevier. The Cost of Knowledge is a petition for change in which researchers commit to discontinue support for Elsevier journals. As a result, Gowers has been credited with starting the Academic Spring.

— Wikipedia on Timothy Gowers

2012.08.09 Thursday ACHK

理智與感情

.

The good life is one inspired by love and guided by knowledge.

– What I Believe (1925), Bertrand Russell

.

發乎情 止乎禮 –

.

恰如其份的感性,是理性的極致。

— Me@2011.11.02

.

.

2012.08.09 Thursday (c) All rights reserved by ACHK

巴士原理

背誦製成品 8

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

除非考試課程範圍有要求,否則,有很多公式或者現成的方法,你可以立刻使用,而毋須百分百追求它們的來源出處。千萬不要有一個心態:我要百分百明白一樣東西,才肯使用它。有著這個心態的話,莫講話讀書考試,就連日常生活,你也會過不到,例如:

甲:你不是趕時間的嗎?為什麼不肯上那輛巴士(公共汽車)?

乙:因為我想來想不通,那輛巴士運作原理。為什麼它可以高速行走的呢?

甲:……

這個雖然是一個荒誕笑話。但是,有很多年青人,正正是抱著這個荒誕的心態去讀書。我年青時都是那樣,節外生枝後再節外生枝,導致浪費了極多的讀書時間。

留意,我並不是叫你在讀書時,每每不求甚解。我的意思是,「百分百明白」並不是合理的期望,因為你沒有無限的時間。學習任何一樣東西時,明白到一定的程度後,你就要立刻練習使用,而不應節外生枝。

至於要明白到什麼程度,則要視乎上文下理。例如,如果你是巴士乘客,你只要明白如何付款、在那個站上車 和 在那個站下車。即使你是巴士司機,你亦毋須明白太多巴士的機械原理。你只要明白如何安全地駕駛那輛巴士就可以。如果你是修理巴士的師傅,你就真的要明白,為何巴士可以行走。

— Me@2012.08.09

2012.08.09 Thursday (c) All rights reserved by ACHK

Ring circuit

The ring circuit came about because Britain had to embark on a massive rebuilding programme following World War II. There was an acute shortage of copper, and it was necessary to devise a scheme that used less copper than would normally be the case.

— Wikipedia on Ring circuit

2012.08.08 Wednesday ACHK