8051 概論

CPU - RAM 128 bytes
Flash 4k
Processor 20Mhz
Interrupt 2
Timer 2
I/O 16 bit
記憶體概圖
+------------+
|Jump begin  |
+------------+
|Jump Timer 0|
+------------+
|Int 0(UART) |
+------------+
|Jump Timer 1|
+------------+
|....        |
|....        |
+------------+
Notice:每顆 51 不一定都一樣
事件發生時, Interrupt 或 Timer 會去向量找到相關的位址,然後 jump 過去.
程式 always 執行中,不會停.
通常 begin 都只有作 initialize.
當 timer 要觸發或被 interrupt 了,才作事.

vsftpd Overview

網址: http://vsftpd.beasts.org
vsftpd 她是目前號稱最安全的 FTP Server.
也是目前 Red Hat 8, Open BSD, Suse 所採用的 ftp server.
最新的版本是 1.1.3.
下載 tarball 以後,解開~
她不需要特別 configure, 只需要 make, make install 就可以了
make會自動安裝到 /usr/local/sbin 下面去~
而 conf 檔,則需要自行把 tarball 內附的 vsftpd.conf 複製到 /etc 去才行.
預設的 Server Type 是 inetd, 而不是 Standalone 型態~
所以你需要用 kill -HUP xinetd-pid
來請求 xinetd 重新載入 configuration.
預設的 Configuration 也很安全,完全不讓人登入,也不讓你寫入….非常的…嗯…安全~
你需要在 vsftpd.conf 裡面修改這幾個設定才能讓一般的使用者能登入並擁有寫入的權限:
local_enable=YES
write_enable=YES
如果要讓他以 Standalone 型態起來,則可以在設定裡面置入
listen=YES
並在 /etc/rc.d/init.d 裡面放 script 就行了
至於其他的設定,可以自行用 man vsftpd.conf 來找到用法.
和 proftpd 比較起來
設定是簡單了許多
蠻有那種樸實無華的味道~
再加上檔案又小~
沒什麼可以挑剔的~
期待 2.0 吧
2.0 的 beta 已經 release 了~
相信正式版應該很快就會 Release.

National Storage Day 2 Digest

Introduction:
一開始
何麗玲,HP現任董事長就出來致詞~
來賓出來拋磚~
大致提到:
Adaptive Storage Infrastructure 一個漸進式的 Storage 架構,而非急進的,意思就是你可以慢慢買,再加上去.
還有 New Storage Architectures 的一些特性,
1.Cheap Storage
2.Fleshing out internet application
3.Storage intensive data types
4.Grow

主要的 issue,
1. Managing risk
2.資料的成長比 Storage 的預期增加速度要快.

“…”表示是抄漏的,到時候要去下載研討會簡報才知道.
ENSA eXtended
接著就是 HP 的Storage處的處長出來介紹 HP 的 ENSA eXtended
蔣先生提到 1998 年 HP 就已經提出 ENSA, 而在這幾年,也都一一實現了
ENSA 主要的定義是:
– Modularity
– Scalability
– Available
而新的 ENSA eXtended 則是
以 an open adaptive storage infrustructure 作為架構,有 Controllable, Resilient(快速復原), Extensible 這三個特性
這裡是我手繪的圖形:
ensaX.jpg
不過畫的不是很好,同樣以後也可以直接參考上面提供的網址去下載簡報來看.
詳情網址: http://www.hp.com/go/ENSAextended/
在即將中午的時候
又有提到 HP Utility Data Center,這個時候已經快睡著了 icon_sad.gif
UDC 有以下的特性:
1.Write Once
2.Resource virtualization
3.Utility Controller
主講人因為有被交代不可以耽誤大家用餐時間,所以講的很快
詳情網址: http://www.hp.com/large/infrastructure/utilitydata/overview/
吃完中餐
就是下午的議程了
下午分成四個 Track: A, B, C, D
我選擇 A1, D2, C3
A1
主要 topic:
1. What’s virtualization?
2. Array level virtualization.
3. Storage Level virtualization.
這邊的大意就是:
把所有的 Storage 集中為一個 pool, 對外只公開一個 Interface, 別人只要透過這個 Interface 就可以取得所需的空間,而增減只在這個 pool 中增減,不影響其他的機器.甚至在這個 Storage pool 和要存取的 Server 中間,再加上適當的 switch, 及佈線,就可以達到互相支援及 Balance 的功能.
好處:
– Increase disk utilization
– Reduce operational burden
– Eliminate costly downtime
– enhance performance
另外有提到 FSAM, 她是一個 Storage vision, 主要討論如何有效集中管理 Storage.
這個 Virtualization 的核心技術就是 SAN, 使用 Server & Storage Technology.
最後有日光星的 CIO 說明為什麼會使用此技術,還有就是主講人提供一個以色列公司的 Flash 動畫,很生動地把她所要說的課題表達出來.
D2. Continuity Plan( Disaster Recovery)
p.s.這堂課很多人去聽,差點擠不進去.
當發生意外狀況時,對 IT 而言是損失設備和資料,對企業而言是 business process.企業這邊他舉了一個榮總的例子,說榮總有一次電腦壞掉,然後一堆人就不會使用人工繼續作業了.
而 Continuity Plan Plan 就是使損失降到最低.
Definition:
HA – High available.
DR – Disaster Recovery
DT – Disaster Tolerance
BC – Business Continuity
BC = HA DR DT
考慮 downtime is not acceptable,最大的原因是企業朝向國際化邁進,因為時差之故,所以不能被接受.要如何減低??
Downtime is controllable.
Perspective:
– Ensure 事件不變成災難.
– 包含 Broad spectrum of business and technology issue.
– 達到最高可用度.
一般而言有十個步驟來練習/規劃,稱
Professional Practice for Continuity Planning:
Step 1~3 是 Preplanning
Step 4~6 Planning
Step 7~10 Post planning
而 Step 9~10 是 Optional 的,視行業及公司狀況而定,或者連絡外面的機構.
Planning Model 和 CMMI Model 相似,但 execution 是在狀況發生時才執行,同樣也是一個 Cycle, 規劃 -> 模擬演練 -> 測試 -> …..
在 Plan 擬訂出來之後,仍要適當的評估,以期能使用最適當的 cost 來得到最好的 benefit.
另外人員的食宿也要考量.
C3.
我有點後悔去聽這堂課,主要介紹 CA ARC Server v9.
不過有把幾個專業名詞抄了下來:
Online storage – always standby 給人存取的 storage.
Nearline storage – 如: MO, 光碟櫃…等,可以 random access, 但並非經常存取,存放在這裡的資料稱作 Inactive Data.
Offline storage – 主要是 tape, autoloader…..
結論:
HP 以及其協力廠商的一個 storage solution show.
相關網址:
National Storage Day 網址:
http://gate.erapr.com/event/hpstorageday/
研討會簡報下載位址:
http://gate.erapr.com/event/hpstorageday/news.html

HashGen

前幾天發現一個有趣的專案: Hashgen, http://www3.sympatico.ca/vladimir.shiryaev/hashgen/
編譯之後
發現它是一個可以把字典檔變成 C/C 的 Hash 搜尋 function / Class.
產生出來的原始碼效率很好!
看過程式以後,了解他首先把字典檔變為陣列,再找出適當的 Hash 大小,並宣告陣列來存放 Hash 的資料,也因此效率很好~~
用法很簡單
1.先建立字典檔.一行一個單字,命名為 mydict,如
the
pencil
pen
keyword

2.執行 hashgen -T testme.c -o myhash.h mydict 之後,就會產生 testme.c 和 myhash.h 了,此時你就可以進行編譯.
如果要產生 C 的 code, 就用 hashgen -T testme.c -l c -o myhash.h mydict
這裡介紹的只是一個簡單的用法,裡面還有更多參數,可以讓你指定 hash value…等等的~
更進階的用法:
你也可以在字典檔中指定 hash value
用法是使用 [ declarations ] 和 [ entries ] 這 2 個 section

[ options ]
entry-struct-name=TokenEntry
[ declarations ]
struct TokenEntry {
const char* name;
const char* value;
};
[ entries ]
pen, “this is my pen”
pencil, “this is my pencil”
book, “this is my book”
限制:
雖說 key 的字串長度,可以無限長,但在此只有前 32 個字元會被用來 hashing.
當 keyset 大於 3000 個的時候,有可能會因此而變慢.
目前還沒有想到比較好的應用方法
似乎只適合用在字典固定的場合,而不適用於動態增加的場合.

VFP Toolkit for Visual Studio.NET

其實他根本就是一個 wrapper
把 .net 的 code 給包裝起來
看起來的確變的很類似 vfp
但實際上宣告變數以及語法仍然遵循 c# 或 vb.net
而非原來的 vfp
不過文件上說的沒錯
他提供了絕大部分的 vfp 函數
可是~
存取資料時
仍然要使用 sqlconnect
而不是 use
也因此沒有索引的功能
但有提供索引搜尋跟切換索引的功能
只是這些東西仍然依存於 .net dataview 元件的能力
換言之
如果要細調其執行效能
恐怕仍然需要了解 .net ado.net
source code 很有幫助,並不是很困難
建議也下載回去看
對上手 .net 有相當的助益

VFP OLEDB Drivers How-To

限制:
以6.0而言,似乎一定要用 ado 來開啟
範例:
OConn = CREATEOBJECT(“ADODB.Connection”)
OConn.ConnectionString = “provider=vfpoledb.1;;
data source=.\testdbc.dbc”
OConn.Open
語法:
Provider = VFPOLEDB
Data Source=cPath
Specifies the path to the Visual FoxPro database or folder containing free tables. For example, d:\vfp7\samples\data\testdata.dbc
Mode=cMode
Specifies one of the following: Read, ReadWrite, Share Deny None (default), Share Deny Read, Share Deny Write, Share Exclusive (inclusive of the previous two modes).
可以丟如下指令
The Visual FoxPro OLE DB Provider supports the native Visual FoxPro language syntax for the following commands:
CREATE TABLE – SQL Command
Creates a table having the specified fields.
DELETE – SQL Command
Marks records for deletion.
DROP TABLE Command
Removes a table from the database specified with the data source and deletes it from disk.
INSERT – SQL Command
Appends a record to the end of a table that contains the specified field values.
SELECT – SQL Command
Retrieves data from one or more tables.
UPDATE – SQL Command
Updates records in a table with new values.
The Visual FoxPro Language Reference contains detailed information about the following supported commands:
ALTER TABLE – SQL Command
Programmatically modifies the structure of a table.
CREATE TABLE – SQL Command
Creates a table having the specified fields.
Using Data Definition Language (DDL)
You cannot include DDL in the following places:
In a batch SQL statement that requires a transaction
Following a previously executed statement that required a transaction if not in auto-commit mode and if your application has not yet called SQLTransact.
For example, if you want to create a temporary table, you should create the table before you begin the statement requiring a transaction. If you include the CREATE TABLE statement in a batch SQL statement that requires a transaction, the provider returns an error message.
DELETE – SQL Command
Marks records for deletion.
DELETE TAG Command
Removes a tag or tags from a compound index (.cdx) file.
DROP TABLE Command
Removes a table from the database specified with the data source and deletes it from disk.
INDEX Command
Creates an index file to display and access table records in a logical order.
INSERT – SQL Command
Appends a record to the end of a table that contains the specified field values.
SELECT – SQL Command
Retrieves data from one or more tables.
The Visual FoxPro OLE DB Provider supports the native Visual FoxPro language syntax for this command.
SET ANSI Command
Determines how comparisons between strings of different lengths are made with the = operator in Visual FoxPro SQL commands.
SET BLOCKSIZE Command
Specifies how disk space is allocated for the storage of memo fields.
SET COLLATE Command
Specifies a collation sequence for character fields in subsequent indexing and sorting operations.
SET DELETED Command
Specifies whether records marked for deletion are processed and whether they are available for use in other commands.
SET EXACT Command
Specifies the rules for comparing two strings of different lengths.
SET EXCLUSIVE Command
Specifies whether table files are opened for exclusive or shared use on a network.
SET NULL Command
Determines how null values are supported by the ALTER TABLE – SQL, CREATE TABLE – SQL, and INSERT – SQL commands.
SET PATH Command
Specifies a path for file searches.
Provider Remarks
If you issue SET PATH in a stored procedure, it will be ignored by the following functions and commands: SELECT, INSERT, UPDATE, DELETE, and CREATE TABLE
If you issue SET PATH in a stored procedure and do not subsequently set the path back to its original state, other connections to the database will use the new path (because SET PATH is not scoped to data sessions).
If you want to create, select, or update tables in a directory other than that specified by the data source, specify the full path of the file with your command.
SET REPROCESS Command
Specifies how many times or for how long to lock a file or record after an unsuccessful locking attempt.
SET UNIQUE Command
Specifies whether records with duplicate index key values are maintained in an index file.
UPDATE – SQL Command
Updates records in a table with new values.

C++ ABI

ABI 是 Application Binary Interface, 它是一種介於使用者 C++ 程式碼和提供實作系統和 library 的物件程式碼.
這包含了 C++ 資料物件的記憶體配置,包含先行定義和使用者定義的資料型態,也包含了內部 Compiler 產生的物件,如: virtual tables.
它也包含了函數呼叫介面,例外處理介面,全域名稱空間和多樣物件程式碼的協定.
GCC 將在 3.2 版以後為編譯器提供此功能~

妄想之一

打開門,居然聽到奇怪的聲音.
那是鞭子打在肉上的聲音,除此之外,居然還帶有呻吟的聲音?!
聲音是從我的房間來的.
我躡著腳步,走到房門口,小心翼翼地探頭往裡面看.
從縫隙裡,我看到了令人驚奇的景象 –
“我”被綁在床上,而我的老婆穿著馬甲,正拿著鞭子抽打我…
那應該很痛吧!
但從”我”的表情看來,卻沒有絲毫痛楚的感覺,反而還有種陶醉的感覺?!
我的天,這是什麼狀況~
我倒抽一口涼氣,退了一步,卻不小心踩到了本書,我低聲的驚呼~
“是誰!”
我的老婆往門外呼暍.
我不敢應聲,趕緊站了起來,往門外走.
“到底是誰,快出聲!!”
她接著應該就會把房門打開了吧,我得快點…
但是有點遲了,她已經打開房門,我被她看到了.
“是你!”
我仍然不答聲,趕緊跑下樓梯.
邊跑的時候,我聽到悉悉嗦嗦的聲音一直在我身後響起~
我一口氣跑到一樓,打開鐵門的時候才回頭看了一下
是頭髮,好多的頭髮,頭髮居然像是有生命似的,像海浪向我撲來.
“啊~~~”
這不是喊”啊”的時候了,趕緊把樓下的鐵門關上,騎上愛車,加速離去.
我騎的很快,呼呼的風從我身邊經過…
我邊想剛剛發生的這一切,
這實在太讓人匪夷所思了.
怎麼會這樣子呢??
頭腦很混亂,沒有辦法做出合理的解釋,我用力地搖搖頭,希望這只是夢境.
一路就這樣騎著,也不知道該去哪兒.
天色越來越黑了,看看錶,已經是十二點了.
肚子不爭氣的餓了起來,也該是停車歇歇,吃吃東西的時候了.
我騎到以前我和老婆常去的牛肉麵店,打算吃碗麵.
才剛踏進門一步,突然,眼前一片黑撲了過來,頓時令我失去了知覺….
=====
“老公…起床啦,已經七點囉.”
“再不起來吃早餐,就來不及送我去上班囉~~”
“喔…嗯…好啦…”
我掙扎著起床去廁所準備盥洗,依照慣例,先上廁所.
於是我拉下馬桶蓋,坐著上廁所(坐著??)
然後盥洗,完了,就喝一大杯的水.
因為時間來不及了,只好先穿衣服.
我彎腰低著頭,穿上胸衣(胸衣??),換上襯衫,穿上絲襪(絲襪??),窄裙(窄裙??)…
等等…好像跟平常的情節有點不太一樣~~
莫非我…變成女人??

炎熱午後的狂想

空氣受到太陽的鼓舞在眼前翻翻騰騰的,
但卻沒有要流動的跡象.
蟬兒彷彿是要拍手叫好似的,
在四周”知了~知了~”地叫著.
雖說已經步入初秋,
天氣卻反常地炎熱~
我常開玩笑地跟朋友說,
“這是因為世界末日快到了,快到神前懺悔吧!”
呵呵~~
這是讓人不得不慵懶的一個下午,
悶熱成這樣,實在是不想出門,
一個人就這樣懶懶的呆在家裡.
平常就不愛吹冷氣的我,
當然沒開冷氣,就讓它熱吧,看能熱到什麼程度.
很平靜的一個下午,不想作什麼,只是躺著~
“叮咚~”
把神遊的我從很遙遠的時空把我拉回來
再一次的”叮咚~~”
不禁開始想,嗯?有誰會來找我?誰會知道我今天下午休假??
高聲的”掛號”,打消了我的疑慮,原來是掛號信.
我匆忙的拿起印章,衝到樓下去領掛號信.
領完,我邊爬樓梯邊看信是誰寫來的.
“Dear:
好久不見了,還記得我嗎??我是艾力卡.
你好嗎??
上次跟你說了一個泡麵與開水的故事,不知道你喜不喜歡??
是的,後來泡麵因為開水不泡她,她非常的傷心.
泡麵不能沒有人泡,而在現在的社會,卻又不太能接受女追男的事情,
所以她決定到比較開放的國外,希望能找到人來泡她.
後來並不順利,又再回到國內繼續她尋覓的旅程.
轉眼過了幾個月,就聽說她要結婚了,對象並不是因為泡她,才讓她心動.
而是因為他也需要泡 – 她的他是泡飯.
很有趣吧~
下次再告訴你別的故事吧.
希望你一切順心.
關心你的艾力卡 yy/mm/dd ”
艾力卡,這小子真是…不知道該怎麼說她才好,只能說好冷.
對這悶熱的下午也是不無小補.
繼續回去神遊吧.
註:
艾力卡是個不錯的漫畫家,如果你對她有興趣,可以去找”沒有真的世界”系列漫畫.
共有三本,我認為她可以算是冷笑話的先驅者!因為在冷笑話流行前,她的這三本漫畫早就上市了.
要不是因為我弟弟,恐怕我不會認識這傢伙.
前一兩年,她結婚了,在此順便祝福她.

好文章-HOWTO Encourage Women in Linux

今天看到一篇很好的文章:HOWTO Encourage Women in Linux. 原文網址是:http://www.nmt.edu/~val/howto.html
當然,顧名思義,這是一篇教導你如何鼓勵你身邊的女人或女性朋友接觸 Linux 的文章.
那有什麼稀奇的呢??
是的,原本我以為這篇文章會帶點揶揄地去探討女人與Linux的關係.但看完之後,我發現這篇文章並非如此.
除了說明為什麼女人不太願意接觸電腦的原因之外,還提出了許多的建議與做法,試圖鼓勵女人去接觸電腦與 Linux,除此之外,還可以帶給許多男人省思與男女平等的觀念.
有機會的話,我想我會徵求筆者同意,把這篇文章翻譯出來.