Strong Guarantee using Transaction
Posted on April 29th, 2008 at 23:24 by fr3@K

Abrahams Guarantees

在 C++ 的世界裡, 正確的 exception handling 是專業的 C++ programmer 不可或缺的技巧. 雖然它的概念並不困難, 但實作起來卻常不見得那麼容易.

要做到正確的 exception handling, 首先必須要了解什麼是 exception safety. 一個需要與 exception 打交道的 component 可在其介面實作人稱 Abrahams guarantees 的三種 exception safety 保證之一:

  1. The basic guarantee
  2. 允許操作失敗時改變物件的狀態, 但不能有 resource leak. 且該物件的狀態必須是可靠的仍然可以被解構, 操作失敗後該物件的狀態可以是不完全能被預測的.

  3. The strong guarantee
  4. 操作後的狀態只能是成功完成, 或是將該物件回復到操作之前的狀態並拋出一個 exception.

  5. The no-throw guarantee
  6. 操作不會拋出 exception.

(more…)

del.icio.us:Strong Guarantee using Transaction digg:Strong Guarantee using Transaction spurl:Strong Guarantee using Transaction newsvine:Strong Guarantee using Transaction furl:Strong Guarantee using Transaction Y!:Strong Guarantee using Transaction 黑米共享書籤:Strong Guarantee using Transaction 推推王:Strong Guarantee using Transaction
re: Socket Programming in C 常犯的錯誤
Posted on April 22nd, 2008 at 12:25 by fr3@K

昨天在網上閒逛, 在樂多上看到篇名為 “Socket Programming in C 常犯的錯誤” 的短文. 這短文作者的動機很好, 指出常見到的錯誤並提供個人看法與可能較好的作法. 這樣的行為很值得鼓勵. 但極可惜的是, 結果卻是很不理想的. 容我說句重話, 如果是考試的話該文是得不到我的分數的.
(more…)

del.icio.us:re: Socket Programming in C 常犯的錯誤 digg:re: Socket Programming in C 常犯的錯誤 spurl:re: Socket Programming in C 常犯的錯誤 newsvine:re: Socket Programming in C 常犯的錯誤 furl:re: Socket Programming in C 常犯的錯誤 Y!:re: Socket Programming in C 常犯的錯誤 黑米共享書籤:re: Socket Programming in C 常犯的錯誤 推推王:re: Socket Programming in C 常犯的錯誤
Video made for Microsoft’s sales team
Posted on April 21st, 2008 at 2:53 by fr3@K

很好笑的一段影片, 在 news.com 的 Microsoft 1, blogosphere 0 看到的.

del.icio.us:Video made for Microsoft's sales team digg:Video made for Microsoft's sales team spurl:Video made for Microsoft's sales team newsvine:Video made for Microsoft's sales team furl:Video made for Microsoft's sales team Y!:Video made for Microsoft's sales team 黑米共享書籤:Video made for Microsoft's sales team 推推王:Video made for Microsoft's sales team
Virtualization != 虛擬作業系統
Posted on April 18th, 2008 at 0:01 by fr3@K

首先我得說清楚我對 virtualization 這個題目沒有研究, 單純是個享福的使用者. 從很久 (8/9 年?) 以前在 MacOS 7.x (or 8.x?) 上用 Virtual PC 跑 Win95, 到近幾年的主要在 GNU/Linux 上用 QEMU 跑 Win2K 與 Minix 3.

一個不懂 virtualization 確切定義與技術細節的人, 一個使用過 Virtual PC, VMWare (player/workstation), QEMU, VirtaulBox 等 virtualization application 的人如我. 在使用過上述任何一種 virtualization application 後很容易就會知道, 把 virtual machine 開啟後首先會看到 POST (Power-on self-test) 畫面. 如果沒有其他如 boot image 等的設置, 接下來什麼也不會發生. 不會看到屬於某個 OS 的 shell 或是 desktop manager 的提示畫面, 使用者什麼事都做不了.
(more…)

del.icio.us:Virtualization != 虛擬作業系統 digg:Virtualization != 虛擬作業系統 spurl:Virtualization != 虛擬作業系統 newsvine:Virtualization != 虛擬作業系統 furl:Virtualization != 虛擬作業系統 Y!:Virtualization != 虛擬作業系統 黑米共享書籤:Virtualization != 虛擬作業系統 推推王:Virtualization != 虛擬作業系統
The Free Launch is Back
Posted on April 15th, 2008 at 16:08 by fr3@K

From the main page of MCSTL:

The Multi-Core Standard Template Library (MCSTL) is a parallel implementation of the standard C++ library. It makes use of multiple processors and/or multiple cores of a processor with shared memory. It blends in transparently and there is in principle no change necessary in the program itself.

(more…)

del.icio.us:The Free Launch is Back digg:The Free Launch is Back spurl:The Free Launch is Back newsvine:The Free Launch is Back furl:The Free Launch is Back Y!:The Free Launch is Back 黑米共享書籤:The Free Launch is Back 推推王:The Free Launch is Back
不是李白也能 C++
Posted on April 13th, 2008 at 3:16 by fr3@K

除了語法上的困難, 另一個 C++ 常被人嫌的特性就是不如 C#(.Net)/Java/Python 之流般擁有大量標準的 library 或針對特定功能的準標準 library. 寫上一篇 (五種寫 For Loop 的方法) 時, 突然體會到這樣的現象似乎是源自 C++ 的設計與演化, 很可能是難以避免的結果.
(more…)

del.icio.us:不是李白也能 C++ digg:不是李白也能 C++ spurl:不是李白也能 C++ newsvine:不是李白也能 C++ furl:不是李白也能 C++ Y!:不是李白也能 C++ 黑米共享書籤:不是李白也能 C++ 推推王:不是李白也能 C++
五種寫 For Loop 的方法
Posted on April 11th, 2008 at 6:23 by fr3@K

同樣是寫一個迭代的 loop, 至少有下面兩種標準 (C++98), 兩種半標準 (Boost), 以及一種未來式 (C++0x) 的寫法.
(more…)

del.icio.us:五種寫 For Loop 的方法 digg:五種寫 For Loop 的方法 spurl:五種寫 For Loop 的方法 newsvine:五種寫 For Loop 的方法 furl:五種寫 For Loop 的方法 Y!:五種寫 For Loop 的方法 黑米共享書籤:五種寫 For Loop 的方法 推推王:五種寫 For Loop 的方法
Knock Knock, You’ve Been Hacked!
Posted on April 6th, 2008 at 7:31 by fr3@K

I received an email yesterday afternoon, informing me this blog has been hacked:

Regarding fsfoundry.org,

This email is not an April’s fools email and it has been sent to notify you that your blog’s version is old and needs to be updated ASAP as it was hacked.

While tracking some Viagra spammers I have come accross several links coming from your blog and, after testing it, it appears your blog is 2.1.* generation hence vulnerable to SQL injection blind-fishing attacks. Search Google to learn more. In a few words: spammers can take full control of your blog in a matter of minutes and deface it at will.

These attacks are as serious as they can get as the spammers have full access to your blog and add hidden HTML elements to mask their links.

You MUST update your blog to the latest official WordPress version and manually clean your last 5-10 posts of the parasite links which you will only see in HTML view.

Not doing so may attract severe search engine penalties as you are currently linking to sites with VERY bad reputation.

Hoping you will take required action,
A.S.S. (Anonymous Security Specialist)

PS: I got your email address from your Dashboard / Users Management Section. I have warned many during the past months regarding the vulnerable blogs, being a blogger myself, but it seems I haven’t warned everyone. Lateste WordPress is secure.

PPS: Your login name is XXXX and password hash is XXXXXXXXXXXXXXXXXX

(more…)

del.icio.us:Knock Knock, You've Been Hacked! digg:Knock Knock, You've Been Hacked! spurl:Knock Knock, You've Been Hacked! newsvine:Knock Knock, You've Been Hacked! furl:Knock Knock, You've Been Hacked! Y!:Knock Knock, You've Been Hacked! 黑米共享書籤:Knock Knock, You've Been Hacked! 推推王:Knock Knock, You've Been Hacked!
Mistake in IBM’s developerWorks
Posted on April 3rd, 2008 at 22:47 by fr3@K

Some months ago, I came across a mistake in Kernel command using Linux system calls, published by IBM’s developerWorks.
(more…)

del.icio.us:Mistake in IBM's developerWorks digg:Mistake in IBM's developerWorks spurl:Mistake in IBM's developerWorks newsvine:Mistake in IBM's developerWorks furl:Mistake in IBM's developerWorks Y!:Mistake in IBM's developerWorks 黑米共享書籤:Mistake in IBM's developerWorks 推推王:Mistake in IBM's developerWorks
懷舊: WRC 2001 Teaser
Posted on April 3rd, 2008 at 22:23 by fr3@K

這世界上還有比把自己的性命托付給不要命的 WRC 駕駛, 坐在他的旁邊當他的副駕駛來得更瘋狂的事情嗎?

聽著這首 Linkin ParkIn The End… 呵呵… 是啊~ 那一年, 我也開著一部 Impreza.

del.icio.us:懷舊: WRC 2001 Teaser digg:懷舊: WRC 2001 Teaser spurl:懷舊: WRC 2001 Teaser newsvine:懷舊: WRC 2001 Teaser furl:懷舊: WRC 2001 Teaser Y!:懷舊: WRC 2001 Teaser 黑米共享書籤:懷舊: WRC 2001 Teaser 推推王:懷舊: WRC 2001 Teaser

Page 1 of 2[ 1 ]2»