The “$” Operator

Next to the “.” operator there is another function-oriented operator that you’ll see often in Haskell code. This is the function application operator and it’s defined like this:

f $ x = f x

Weird right? Why does Haskell have this?

In Haskell, normal function application has a higher precedence than any other operator and it’s left-associative:

f g h j x == (((f g) h) j) x

Conversely, “$” has the lowest precedence of all operators and it’s right-associative:

f $ g $ h $ j $ x == f (g (h (j x)))

Using “$” can make Haskell code more readable as an alternative to using parentheses. It has other uses too, more on that later.

— Using the Dropbox API from Haskell

— by Rian on January 02, 2012

2012.05.31 Thursday ACHK

Machinarium

Machinarium is a puzzle point-and-click adventure game developed by Amanita Design.

Development

Machinarium was developed over a period of three years, by seven Czech developers, who financed the project with their own savings. The marketing budget for the game was a scant $1,000.

The game was in development for the Xbox 360 platform for a period of six months; however, Microsoft, whom the developers had approached to publish the title on Xbox Live Arcade, ultimately decided not to do so. Microsoft does not allow games to be released on Xbox Live Arcade without a publisher attached to the title, and the developers were reluctant to approach a third party to publish the game, as this would mean that profits for the developers from sales over Xbox Live Arcade would be greatly reduced.

Subsequently, Amanita Design approached Sony, whose policies do allow for self-publishing on the PlayStation Network platform, and have submitted the game to them for approval, in order to release the game on the PlayStation Network.

— Wikipedia on Machinarium

2012.05.31 Thursday ACHK

閱讀理解 1.1

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

(CYW:做中文科的閱讀理解題目時,我好像答來答去,都答不中要點。)

你比較一下,你的答案和老師的答案相差什麼。看看老師的答案,有沒有道理。知不知道什麼為之「有道理」?

(CYW:事後我會閱讀老師的標準答案。但我通常也不明白,那些答案在說什麼。那些答案的思想,有時是由文章之中,十分間接地歸納出來。坦白說,我覺得有些答案是「穿鑿附會」,只有題目的作者才會答得到。)

如果一份閱讀理解的答案,除了你覺得沒有道理外,你所有同學也覺得沒有道理,而你的老師又解釋不到,那些答案道理何在的話,那些答案就真的是,客觀地「沒有道理」。換句話說,錯不在你,只是那份閱讀理解本身沒有價值。既然是那樣,你就毋須去理會考究它。

— Me@2012.05.31

2012.05.31 Thursday (c) All rights reserved by ACHK

Nikola Tesla

Tesla died on 7 January 1943 at age 86 from heart thrombus, alone in room 3327 of the New Yorker Hotel.

— Wikipedia on Nikola Tesla

Another influential book was a biography of Nikola Tesla, the brilliant Serb scientist; though Tesla’s contributions arguably matched Thomas Edison’s — and his ambitions were grand enough to impress even Page — he died in obscurity.

“I felt like he was a great inventor and it was a sad story,” says Page. “I feel like he could’ve accomplished much more had he had more resources. And he had trouble commercializing the stuff he did. Probably more trouble than he should’ve had.

I think that was a good lesson. I didn’t want to just invent things, I also wanted to make the world better, and in order to do that, you need to do more than just invent things.”

— p. 13

— In the Plex: How Google Thinks, Works, and Shapes Our Lives

— Steven Levy

2012.05.30 Wednesday ACHK

Feynman’s Blackboard, 4

數學教育 2.2 | 種子意念 2.1.7

You cannot teach a man anything, you can only help him to find it for himself.

– Galileo

知識不能傳授,只能靠學生自己發現創造。

老師的角色是引發思考,加速發現創造。

— Me@2011.10.18

What I cannot create, I do not understand.

— On his blackboard at time of death in 1988

— Richard Feynman

Whatever created has context.

So it is difficult to misunderstand or forget.

— Me@2011.10.18

2012.05.30 Wednesday (c) All rights reserved by ACHK

應世守略 2

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

根據自然定律,無品德的人很難會團結。君子和而不同,小人同而不和。所以,即使你的公司有很多「瘋狂人士」,你可能還有足夠的生存空間。

他們有很大機會顧著「邪邪大戰」,互相攻擊,繼而沒有足夠的時間去攻擊你。

— Me@2012.05.30 

2012.05.30 Wednesday (c) All rights reserved by ACHK

Mobile phones

Perhaps most important, information can flow through even the remotest of villages, thanks to the massive increase in mobile telephones across regions that just a few years ago had no phones at all.

Mobile connectivity and the spread of wireless broadband are greatly strengthening rural health systems. In all of the Millennium Villages, and in more and more villages around the continent, lay community workers are bringing health services from the clinics right to the community. Mobile phones are critical in supporting these outreach workers, enabling them to call the doctors and nurses for advice, summon an ambulance or connect to a computerized expert system via text messaging.

— Global health within our grasp, if we don’t give up

— By Jeffrey Sachs, Special to CNN

2012.05.29 Tuesday ACHK

時間紀念碑

如果沒有定期設立「人生里程碑」,

很快會忘記哪一年是哪一年。

— Me@2012.05.28

2012.05.29 Tuesday (c) All rights reserved by ACHK

故事記憶

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

背誦時,有原理的東西,就先記原理。有了原理,就有上文下理,記憶起來會高速而深刻。

沒有原理的東西,唯有「死記」。透過不斷反覆,最終也要背誦下來。

有時,面對沒有原理的背誦材料,你可以運用想像力,創作一些奇幻故事,以減低「死記」的成份。例如,假設你今天學了兩個英文生字「ascending」和「descending」。「ascending」的意思是「遞增」,而「descending」的意思是「遞減」。初學者未必會記得,哪個是「遞增」,哪個是「遞減」。我會建議他們用這個「故事」:

先寫下序列

a, b, c, d

「ascending」的意思是「ascending」,即是由 a 開始,排成「a, b, c, d」。那就正正是「由小至大」。

「descending」的意思是「descending」,即是由 d 開始,排成「d, c, b, a」。那就正正是「由大至小」。

— Me@2012.05.29

2012.05.29 Tuesday (c) All rights reserved by ACHK

What Dreams May Come, 2

Albert, whom the novel identifies as Chris’s guardian angel, explains that Summerland includes many things which inhabitants do not need — such as automobiles — but which exist simply because some people believe they are needed. The particular Heaven of each religion exists somewhere, because that is what members of each religion expect.

— Wikipedia on What Dreams May Come

2012.05.28 Monday ACHK

數學教育 2

種子意念 2.1.6

You cannot teach a man anything, you can only help him to find it for himself.

– Galileo

知識不能傳授,只能靠學生自己發現創造。

老師的角色是引發思考,加速發現創造。

— Me@2011.10.18

To be catalyst is the ambition most appropriate for those who see the world as being in constant change, and who, without thinking that they can control it, wish to influence its direction.

– Theodore Zeldin

2012.05.28 Monday (c) All rights reserved by ACHK

應世守略 1.3

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

只有很少情況,你會防守不到。大部分情況下,你可以選擇不與壞人相處。

會不會有個情況是,某甲一而再、再而三地攻擊你,而你又被迫要和他繼續相處呢?

我想像到的情況是,工作環境。甲是你的其中一位同事。你天天上班,也會見到他。

(安:那怎麼辦呢?)

防守不到的話,要再看「防守不到」到什麼程度。

通常也會防守得到,因為,如果一個人需要靠做壞事,才能生存到的話,智力高極有限,應該不難應付。

當然,你又會再遇到一個問題。那就是因為他是壞人,所以他「可以」用「非法」的手段去攻擊你。而因為你不是壞人,所以你只可以用正當的手段去防守。你可能會處於劣勢。因此,你應該怎樣應付,沒有標準的答案,只能 審時度勢、因時制宜、隨機應變。

如果你有一位極度瘋狂的同事,瘋狂到你防守不到的話,你的公司也不會是一間好公司。健康的公司,絕對不會聘請「極度瘋狂人士」。你在一間沒有前途的公司工作,會令自己也變成,沒有前途的物體。那樣,你就早應另謀高就。

又或者,你的公司可能只有一般瘋狂人士,但是因為「一般瘋狂人士」的數目太大,令你吃力非常。那樣,你也沒有留下來的理由吧?

— Me@2012.05.27 

2012.05.27 Sunday (c) All rights reserved by ACHK

The Matrix

The conspiracy is so thorough that most kids who discover it do so only by discovering internal contradictions in what they’re told. It can be traumatic for the ones who wake up during the operation. Here’s what happened to Einstein:

Through the reading of popular scientific books I soon reached the conviction that much in the stories of the Bible could not be true. The consequence was a positively fanatic freethinking coupled with the impression that youth is intentionally being deceived by the state through lies: it was a crushing impression.

I remember that feeling.

By 15 I was convinced the world was corrupt from end to end. That’s why movies like The Matrix have such resonance. Every kid grows up in a fake world. In a way it would be easier if the forces behind it were as clearly differentiated as a bunch of evil machines, and one could make a clean break just by taking a pill.

— Lies We Tell Kids

— Paul Graham

2012.05.25 Friday ACHK

應世守略 1.2

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

(安:但是,真正可怕的,並不是別人「忘恩」,而是「負義」。正如你上次所講,有一部分地球人,你對他們越好,他們反而會對你越差,甚至加害於你。)

這個不難化解吧?

只要你把那類人,從你的世界刪除便行。換句話說,只要你不和那類人相處,你這個問題就不再存在。

— Me@2012.05.25 

2012.05.25 Friday (c) All rights reserved by ACHK

Quora

Wikipedia, which just recently celebrated its 10th birthday, is astonishing in its breadth and scope, but there’s only so much that any encyclopedia, limited to verifiable facts about discrete nouns, can capture within the entirety of human knowledge. On the other end of the spectrum, sites like Facebook and Twitter allow people to describe their lives and to make personal observations, but on such networks it’s hard to separate the informed opinion from the pure speculation.

The large expanse between the two approaches — the purely objective and the purely subjective — is the terrain that Quora hopes to occupy.

The early leader in social networking, Friendster, had terrible technology. The advertising-heavy MySpace, which dethroned Friendster, was a bit like Yahoo Answers: chaotic and low-rent, prone to spammers and scams. Yet both were immensely popular — until Facebook came along and figured out how to do social networking right.

— Does Quora Really Have All the Answers?

— Wired May 2011

— Gary Rivlin

2012.05.24 Thursday ACHK

Batman Incorporated

After the arrest of Bee Sting, Phoenix Jones and of course the ever-present and looming implications of the Trayvon Martin case, we feel that it’s time to bring the power back where it belongs: The People.

We will be launching a fully functional website on June 1st, in tandem with a physical tour in which we contact each and every PD Community Affairs office and established Block Watch in our respective cities and organize meetings. These meetings will introduce the site, give a tutorial, and drop off our PowerPack… a brief list of solid, low cost resources for initial training and resources to get people started, or to give them momentum to continue their efforts to protect their loved ones and their neighborhoods responsibly.

From there, they can use the website to report crime anonymously, track crime patterns, build block watches, trade skill training between professionals and communicate with each other and their precinct’s Community Affairs offices. In addition, we will be building strong communication and trust between not only ourselves and the community, but as we move from neighborhood to neighborhood, the community itself. As they teach and learn from each other, they will build confidence in themselves and their skills in practical self defense, medical assistance, legalities and most importantly for this kind of work, non-violent communications.

— The Initiative Announces POWER UP TOUR

— Heroes in the Night

— Tea Krulos

2012.05.24 Thursday ACHK

分數中心 2

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

天使要求自己的生活,以自己為中心;魔鬼要求別人的生活,也以自己為中心。天使要求自己的自傳,以自己為主角;魔鬼要求別人的自傳,也以自己為主角。天使要求自己的歷史,以自己為主角;魔鬼要求世界的歷史,也以自己為主角。魔鬼版本的自我中心,才是我們平日所批評的「自我中心」。

為何你會在考試答題時離題,答來答去也答不中要點呢?

那很可能是因為你「自我中心」:你不是在考慮,題目要求你答什麼。你是在考慮,你懂答什麼。 

例如,題目是「蘋果有很多益處,而橙亦有很多優點。請詳加描述橙的功用。」

題目明明是問你「橙的功用」。但是,你卻因為懂得如何答「蘋果益處」,見到那四個字就立刻作答,而沒有看清楚,題目真正想你答的是什麼。

如果我不是以自我為中心,而是以考試為中心的話,題目問我什麼,我就答什麼。題目沒有問我什麼,我就不答什麼。分數多的題目,我就答得詳細一點。分數少的題目,我就答得精簡一點。

— Me@2012.05.24

2012.05.24 Thursday (c) All rights reserved by ACHK