我的外部記憶區

2005年10月31日星期一

Linux Filesystem

ext2 是一個舊的 Linux 檔案系統,沒有日誌功能. 啟用的時間通常需要很久。目前有許多 日誌型態 的檔案系統可以以更快的速度及更好的 效率完成系統啟用和檢查。

ext3 為 ext2 的日誌版,提供了 metadata 日誌系統 並且可以快速地使用日誌系統復原。ext3 是個相當不錯並且可靠的檔案系統. 它有額外的 hashed b-tree 索引功能將會開啟幾乎在任何情況內的狀態為高效能。簡單來說,ext3 是一個很棒的檔案系統。

ReiserFS 整體來說是個相當不錯的系統,它處理小型檔案(少於4kb)時效能會比 ext2 和 ext3 來的好。他使用的是 B*-tree 為基礎的 檔案系統. 另外也能很有效率地處理大型檔案。Linux 核心版本 2.4.18+ 後,ReiserFS 是一個相當有值得推薦的系統, 從很少, 到很多檔案。ReiserFS 都可以處理的非常好。開機分割區並不建議使用此檔案系統。

XFS 是一個 metadata 日誌系統,並且擁有完整的功能及針對延展性最佳化。如果您使用高速 SCSI 或是纖維的儲存裝置,並且有持續 不斷的電源供應,我們才推薦您使用 XFS。 如果沒有,請使用其他檔案系統。因為 XFS 大量的將要轉送的資料快取在記憶體中, 設計不好的程式(的確有一些程式在寫入磁碟時不做一般的預防措施)可能當系統意外斷電時損失大量的資料。
JFS 是 IBM 發展的高效能日誌系統。目前雖然已經可以算是個完成品,關於他的穩地度並沒有太多的優點及缺點。

2005年10月28日星期五

Why is the DOS path character "\"?

From: http://blogs.msdn.com/larryosterman/archive/2005/06/24/432386.aspx Many, many months ago, Declan Eardly asked why the \ character was chosen as the path separator. The answer's from before my time, but I do remember the original reasons. It all stems from Microsoft's relationship with IBM. For [[DOS]] 1.0, [[DOS]] only supported floppy disks. Many of the DOS utilities (except for command.com) were written by IBM, and they used the "/" character as the "switch" character for their utilities (the "switch" character is the character that's used to distinguish command line switches - on *nix, it's the "-" character, on most DEC operating systems (including [[VMS]], the DECSystem-20 and DECSystem-10), it's the "/" character" (note: I'm grey on whether the "/" character came from IBM or from Microsoft - several of the original MS-DOS developers were old-hand DEC-20 developers, so it's possible that they carried it forward from their DEC background). The fact that the "/" character conflicted with the path character of another relatively popular operating system wasn't particularly relevant to the original developers - after all, DOS didn't support directories, just files in a single root directory. Then along came [[DOS]] 2.0. DOS 2.0 was tied to the [[PC/XT]], whose major feature was a 10M hard disk. IBM asked the Microsoft to add support for hard disks, and the MS-DOS developers took this as an opportunity to add support for modern file APIs - they added a whole series of handle based APIs to the system (DOS 1.0 relied on an application controlled structure called an FCB). They also had to add support for hierarchical paths. Now historically there have been a number of different mechanisms for providing hierarchical paths. The DecSystem-20, for example represented directories as:

 ":"<"[.">"FileName.Extension[,Version]" ("PS:MONITR.EXE,4") 
VMS used a similar naming scheme, but instead of <> characters it used [ and ] (and VMS used ";" to differentiate between versions of files). *nix defines hierarchical paths with a simple hierarchy rooted at "/" - in *nix's naming hierarchy, there's no way of differentiating between files and directories, etc (this isn't bad, btw, it just is). For MS-DOS 2.0, the designers of [[DOS]] chose a hybrid version - they already had support for drive letters from [[DOS]] 1.0, so they needed to continue using that. And they chose to use the *nix style method of specifying a hierarchy - instead of calling the directory out in the filename (like [[VMS]] and the DEC-20), they simply made the directory and filename indistinguishable parts of the path. But there was a problem. They couldn't use the [[Unix|*nix]] form of path separator of "/", because the "/" was being used for the switch character. So what were they to do? They could have used the "." character like the DEC machines, but the "." character was being used to differentiate between file and extension. So they chose the next best thing - the "\" character, which was visually similar to the "/" character. And that's how the "\" character was chosen. Here's a little known secret about MS-DOS. The DOS developers weren't particularly happy about this state of affairs - heck, they all used Xenix machines for email and stuff, so they were familiar with the *nix command semantics. So they coded the OS to accept either "/" or "\" character as the path character (this continues today, btw - try typing "notepad c:/boot.ini" on an [[Windows XP|XP]] machine (if you're an admin)). And they went one step further. They added an undocumented system call to change the switch character. And updated the utilities to respect this flag. And then they went and finished out the scenario: They added a config.sys option, SWITCHAR= that would let you set the switch character to "-". Which flipped MS-DOS into a *nix style system where command lines used "-switch", and paths were / delimited. I don't know the fate of the switchar API, it's been long gone for many years now. So that's why the path character is "\". It's because "/" was taken. Edit: Fixed title - it's been bugging me all week.


2005年10月27日星期四

鮮味薯塊

薯仔不再單調

Newsgroups: mnb.personal.pigpig

From: "豬扒"

馬鈴薯澱粉質含量高,用來炸薯條、做焗薯,略嫌單調。若配搭其他含纖維及蛋白質的食物,便是一道營養齊全的食譜。就如「鮮味薯塊」,除了主角馬鈴薯外,還有含豐富植物蛋白質的豆腐、含纖維及幫助消化酵素的菠蘿,加上健康美味的番茄,色香味俱佳。從此,馬鈴薯食譜再不沉悶。

材料

馬鈴薯1杯、豆腐1/2杯、紫菜1張、番茄1/4杯、菠蘿1/4杯

調味料

天然醬油1/2茶匙、鹽1/2茶匙、粟粉2.5湯匙

製法

  1. 馬鈴薯洗淨,蒸熟後去皮,切成細粒。番茄用沸水略燙,剝皮切細粒。
  2. 紫菜撕成碎片,菠蘿切幼粒,豆腐弄碎,備用。
  3. 把所有材料及調味料置於容器中,攪拌均勻,分成均等分量。
  4. 放入預熱的不黏鑊內,煎至兩面呈金黃色,盛碟。


2005年10月26日星期三

生食,真的健康嗎?

康健雜誌81期

文.黃惠鈴 設計攝影.邱瑞金

生食真的能養生,還是迷思?常生吃的高麗菜、苜蓿芽、胡蘿蔔、紫萵苣、番茄、堅果……,藏有什麼你不知道的玄機?


自從火點亮了人類文明史後,熟食成為主流,人類擺脫「食草木之食、茹毛飲血」的生活。

但最近卻有不少人回過頭來追求生食飲食(raw-foods diet),為了健康,樂當「摩登原始人」,尤其不乏慢性、重症病人,奉生食療法為一線生機。

生食真的能健康養生,還是迷思?有什麼該注意的?

典型的生食以不經烹煮(或非常低溫、不超過約攝氏46度)的方式,料理蔬菜、水果、堅果和種籽等,以保存食物中的酵素和營養素。

提倡生食者主張,烹調會破壞食物中幫助消化的酵素。但美國《消費者報告雜誌》(Consumers' Research Magazine)、《健康》雜誌(Health)都曾為文指出,蔬菜中的酵素主要供植物所用,烹煮過程中破壞的酵素跟人體健康沒有多大關連。人類的消化 系統本身就能製造消化食物所需的酵素。

不過,加熱的確會破壞食物的一些營養素。台北榮總營養部臨床營養組組長楊雀戀告訴《康健》,富含維生素C的水果,對熱敏感,的確不利於加熱烹煮。「水果入菜,不見得好,」她說。

要避免營養素流失,必須懂得利用方法料理食材。

不是蔬果都可生食

但相對地,烹煮也有好處,有些蔬果根本不宜生食。

例如,在生鮮階段含有毒性的食材。

「有些食物無法生食,烹煮可以讓食物去毒性,」林口長庚醫院毒物科主任林杰樑提醒《康健》讀者。

例如,黃豆、荷蘭豆、扁豆、四季豆等豆類食物含豆類皂素,生金針含秋水仙素,生樹薯含天然氰化物,這些食材都必須經過加熱破壞,否則會引起腸胃發炎、腹瀉。

有些有益健康的蔬果含有毒性,像菠菜、紫蘇等含高量的草酸,如果生吃,會引發急性腎衰竭。另外,草酸會阻礙鈣質吸收,引發低血鈣症,且會嚴重危及腎肝功能,林杰樑提醒。