2008年12月17日 星期三

CNN Top news - Passengers saved from dangling gondolas after tower snaps

Passengers have been rescued from a gondola dangling over a freezing creek after the tower snapped in half Tuesday at a ski resort near Whistler, British Columbia.

在Whistler附近的滑雪場纜車支柱於週二發生倒塌意外,一台纜車懸掛在結冰的河川上,上面的乘客已經被救出。


gondola [] n. 纜車

dangle[] v.i. 懸蕩
His keys dangled from a chain.

snap [] v.t. 咬;折斷
The dog snapped my leg.
He snapped the stick in two.


為什麼我馬上想到貓纜呢......科科

2008年12月15日 星期一

CNN Top news - Iraqi journalist throws shoes at Bush in Baghdad

"Hurling shoes at someone, or sitting so that the bottom of a shoe faces another person, is considered an insult among Muslims."

對於回教徒來說,往人身上丟鞋子,或是坐著將鞋底朝著人,都是一種侮辱。


hurl [] v.t. 猛力投擲
He hurled all the books out of the window.

insult [] n. 侮辱
Your sympathy for me is an insult to my pride.

布希去巴格達友善訪問,被一個記者丟鞋......
原來回教徒不能忍受別人的鞋底啊(筆記)

參考新聞

2008年12月9日 星期二

On the house

這句片語呢,跟字面上的意思完全無關!!
會提到這句片語,是因為魔獸世界裡面有一個NPC有一句台詞,而台灣的智XD翻譯成

"這是在屋頂上的"

下一句是

"既然是免費的......"

大家應該都覺得上下文完全無關吧...囧rz

第一句的英文原文是 "This is on the house"
而on the house絕對不是在屋頂上......應該是免費的意思!

These drinks are on the house.
這些飲料是免費的。

C/C++ Name mangling

相信常在使用一些C library的人,常常會在標頭檔看到以下的程式碼

#ifdef __cplusplus
extern "C" {
#endif

簡單講,這是為了避免C++的name mangling造成linker無法link到正確的symbol。

C++支援function overloading,所以下列兩個function可以同時存在

void foo(int a);
void foo(double a);

這是因為C++ compiler會將function name"變形",例如:

void func_int(int a);
void func_double(double a);

這樣就沒有衝突的情形了。
但是用C compiler所編譯出來的object,裡面的symbol可是沒有什麼name mangling的
所以linker當然就沒辦法找到C++變形過後的symbol,就出現unresolved symbol的error了
因此,C++提供了extern "C"這個辦法,只要用extern "C"包起來的,compiler就知道裡面的symbol都是"unmangled"的,例如:

extern "C"
{
#include "c_library.h"
}

如此一來,就可以順利link C compiler所編出的object了

另外,各家compiler實做name mangling的方式也不一樣
所以用VC編好的library,沒辦法直接拿去跟gcc的一起link喔,不過這總比因為不相容造成一堆奇怪的問題好多了

參考資料 http://en.wikipedia.org/wiki/Name_mangling

2008年10月17日 星期五

Psalms chapter 90, 10-17

The measure of our life is seventy years; and if through strength it may be eighty years, its pride is only trouble and sorrow, for it comes to an end and we are quickly gone.

Who has knowledge of the power of your wrath, or who takes note of the weight of your passion?

So give us knowledge of the number of our days, that we may get a heart of wisdom.

Come back, O Lord; how long? let your purpose for your servants be changed.

In the morning give us your mercy in full measure; so that we may have joy and delight all our days.

Make us glad in reward for the days of our sorrow, and for the years in which we have seen evil.

Make your work clear to your servants, and your glory to their children.

Let the pleasure of the Lord our God be on us: O Lord, give strength to the work of our hands.

2008年9月24日 星期三

容易緊張

從小就很容易緊張,尤其是月考的那一天,都會緊張的很想大便。
我是不懂心理緊張跟胃腸有什麼關係,但是說不定就是這樣常緊張,才導致我胃腸不好。

長大之後,緊張不會再讓我肚子痛了,但是還是常常"窮緊張"。
明明就是小事,或是根本無法預測會怎樣的事,我還是會心臟跳很快的緊張。
馬太福音六章34節:『不要為明天憂慮,因為明天自有明天的憂慮;一天的難處一天當就夠了。』
人真的是常常想太多的動物,明明就對未來沒有絕對的決定權,想那麼多幹嘛?
舉例來說,有時候今天決定程式要這樣寫,明天老闆一句話就沒有道理的否決你,你又能怎樣?
做好每一天的事就好,讓心臟跳慢一點,也可以活久一點......

2008年9月16日 星期二

頭腦不靈光了

剛剛跟老闆討論事情,腦袋走往錯誤的方向卻完全不知道
還要被人家戳破才知道......真的很糗啊

最近常常這樣呢,遇到要即時思考的情況,都會覺得腦袋很亂
亂轉亂轉找到一個可能的出口之後,就會往那個出口出去,然後思考邏輯就被那個出口合理化了
不知道有沒有人聽的懂,反正就是應該講對的事情,不經思索講成錯的
這種弱點在應徵工作面試的時候,應該會被電得很慘吧Q.Q