move codes for ajax from bcm.js to ajax.js.
modify modal.js to behave correctly in IE6.
add table.js to provide scrolling table.
note:
H.M. suggests to add summary rows for sub-total/total. It is a good idea.
2007年9月28日 星期五
2007年9月12日 星期三
終於完成一個 javascript 的 calendar
終於完成了. jscal.js
記得 include 這個 檔案, 並且將 cal.png 放在適當的目錄.
並且在 要使用的 INPUT tag 內, 加上 onfocus="showCal(this)". 這樣就完成了.
順便了解了 如何攔截 適當物件的 event 來隱藏 已彈出來的 calendar div.
還有一些要 tune 的. 整理一下後, 可以開始 建立 公司自己的 javascript library 了.
記得 include 這個 檔案, 並且將 cal.png 放在適當的目錄.
並且在 要使用的 INPUT tag 內, 加上 onfocus="showCal(this)". 這樣就完成了.
順便了解了 如何攔截 適當物件的 event 來隱藏 已彈出來的 calendar div.
還有一些要 tune 的. 整理一下後, 可以開始 建立 公司自己的 javascript library 了.
2007年9月10日 星期一
how to know sybase handle a query
1. set showplan on
test with 'set noexec on/off' (for statment) and 'set fmtonly on/off' (for stored procedure)
2. dbcc traceon(3604,302,310)
3. set statistics io on
http://www.webservertalk.com/archive87-2006-3-1422390.html
http://infocenter.sybase.com/help/topic/com.sybase.dc20022_1251/html/monitoring/X27349.htm
http://infocenter.sybase.com/help/topic/com.sybase.dc20023_1251/html/optimizer/X17067.htm
test with 'set noexec on/off' (for statment) and 'set fmtonly on/off' (for stored procedure)
2. dbcc traceon(3604,302,310)
3. set statistics io on
http://www.webservertalk.com/archive87-2006-3-1422390.html
http://infocenter.sybase.com/help/topic/com.sybase.dc20022_1251/html/monitoring/X27349.htm
http://infocenter.sybase.com/help/topic/com.sybase.dc20023_1251/html/optimizer/X17067.htm
2007年8月22日 星期三
PostgreSQL 的測試 - 3
繼續之前的測試, 這次多了 pc200 (是一台 Dell 的機器)
測試環境及結果:
可以發現, 即使是使用了 4GB 的 ram, 只可以改善 std. dev.
據此可以推論, 會出現 比較大的執行時間, 應該是 os 的 buffer layer 的影響.
另外, noatime 這個 mount 選項並沒有多少改善. (反而延長了時間)
若是讓 rad.py 不列印任何資訊的話(noprint), 可以改善整個測試的時間. 而且是很可觀的.
noprint 表示將程式內的 InfoPrint() 全部 註解 掉. 這除了 不 call time.time() 外, 也不 call hexDump().
若只是讓 rad.py 不執行 hexDump 的話(直接 return 空字串), 可以節省(與noatime比) 40%左右.
測試環境及結果:
| pc26 | nb27 | pc34 | pc200 | |||||||||||||||||||||||||||||||||||||||||||||||||
| OS | 2.6.9-34.EL | 2.6.9-34 .ELsmp | 2.6.9-34 .ELsmp | 2.6.9-42.0 .10.ELsmp | 2.6.20-rc6 #1 SMP | 2.6.20-rc6 #1 SMP | 2.6.9-42.0 .10.ELsmp | 2.6.9-55.ELsmp | ||||||||||||||||||||||||||||||||||||||||||||
| python | 2.3.4 | 2.3.4 | 2.3.4 | 2.3.4 | ||||||||||||||||||||||||||||||||||||||||||||||||
| PostgreSQL | 8.1.8 | 8.1.4 | 8.2.3 | 8.2.3 | 8.1.8 | 8.2.3 | 8.2.3 | 8.2.3 | ||||||||||||||||||||||||||||||||||||||||||||
| PyGresSQL | 3.8.1 | 3.8.1 | 3.8.1 | 3.8.1 | ||||||||||||||||||||||||||||||||||||||||||||||||
| CPU | Intel(R) Pentium(R) 4 CPU 2.80GHz 512 KB Cache (5605.85) | Genuine Intel(R) CPU T2400 @ 1.83GHz 2048 KB Cache (1998.36) (DualCore) | Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz 4096 KB Cache (4819.82) (DualCore) | Intel(R) Xeon(R) CPU 5140 @ 2.33GHz 4096 KB Cache (4657.86) (DualCore x2) | ||||||||||||||||||||||||||||||||||||||||||||||||
| RAM | 1GB | 1GB | 2GB | 4GB | ||||||||||||||||||||||||||||||||||||||||||||||||
| duration | 5:32:36 (22:39:05 - 04:11:41) | 2:28:11 (16:33:14 - 19:01:25) | 2:08:56 (15:11:55 - 17:20:51) | 2:30:14 (17:47:33 - 20:17:48) | 4:20:45 (22:40:28 - 03:01:13) | 3:51:15 | 1:40:30 | 1:24:22 (09:42:26 - 11:06:42) | 1:24:50 (noatime) | 0:10:05 (noatime/ atime, noprint) /0:10:17 | 0:48:35 (noatime, nohexdump) | (noatime, print=time.ctime, nohexdump) | ||||||||||||||||||||||||||||||||||||||||
| average dur./call | 19.956ms | 8.891ms | 7.737ms | 9.015ms | 15.605ms | 13.876ms | 6.030ms | 5.062ms | 5.091ms | 0.605ms 0.617ms | 2.915ms | 1.636ms | ||||||||||||||||||||||||||||||||||||||||
| min dur. /1000call | 11.29sec | 7.23sec | 7.19sec | 7.19sec | 4.54sec | 4.54sec | 5.26sec | 4.963sec | 4.971sec | 0.566sec 0.565sec | 2.854sec | 1.566sec | ||||||||||||||||||||||||||||||||||||||||
| max dur. /1000call | 57.45sec | 20.25sec | 17.72sec | 17.72sec | 33.39sec | 36.68sec | 9.96sec | 5.714sec | 5.700sec | 1.281sec 1.425sec | 3.792sec | 2.313sec | ||||||||||||||||||||||||||||||||||||||||
| mean /1000call | 19.956sec | 8.891sec | 7.737sec | 9.015sec | 15.605sec | 13.876sec | 6.030sec | 5.062sec | 5,091sec | 0.605sec 0.617sec | 2.915sec | 1.636sec | ||||||||||||||||||||||||||||||||||||||||
| std devi. /1000call | 8.35sec | 2.58sec | 0.76sec | 0.31sec | 6.22sec | 6.42sec | 0.91sec | 0.079sec | 0.084sec | 0.059sec 0.071sec | 0.090sec | 0.087sec | ||||||||||||||||||||||||||||||||||||||||
可以發現, 即使是使用了 4GB 的 ram, 只可以改善 std. dev.
據此可以推論, 會出現 比較大的執行時間, 應該是 os 的 buffer layer 的影響.
另外, noatime 這個 mount 選項並沒有多少改善. (反而延長了時間)
若是讓 rad.py 不列印任何資訊的話(noprint), 可以改善整個測試的時間. 而且是很可觀的.
noprint 表示將程式內的 InfoPrint() 全部 註解 掉. 這除了 不 call time.time() 外, 也不 call hexDump().
若只是讓 rad.py 不執行 hexDump 的話(直接 return 空字串), 可以節省(與noatime比) 40%左右.
2007年8月10日 星期五
2007年7月26日 星期四
mark end of tiff file
take time to write a simple program that will chech whether RowsPerStrip or StripByteCounts is 0.
If value of any of these two tags is 0, then mark end-of-tiff before this page, and adjust the number of total pages also.
This program can handle Big-Endian tiff file also. Just for fun.
But I think Dialogic cards will generate Little-Endia tiff file only. (At least for my test).
If value of any of these two tags is 0, then mark end-of-tiff before this page, and adjust the number of total pages also.
This program can handle Big-Endian tiff file also. Just for fun.
But I think Dialogic cards will generate Little-Endia tiff file only. (At least for my test).
2007年7月25日 星期三
VFX test
Recently, the customer requests for a new fax receiving system that will keep the well-received pages, convert into tiff file, and then send to customer as attachment of an e-mail.
Because of the odd T1 signalling, DM/F cards cannot be used for this project.
Jim borrows two type of VFX card from hardware provider.
The result is:
VFX/40ESC-PLUS - only acts as fax channel, not fax resource
VFX/40JCT-LS - acts as fax channel and resource.
Because of the odd T1 signalling, DM/F cards cannot be used for this project.
Jim borrows two type of VFX card from hardware provider.
The result is:
VFX/40ESC-PLUS - only acts as fax channel, not fax resource
VFX/40JCT-LS - acts as fax channel and resource.
2007年7月24日 星期二
現有車機程式與悠遊卡的結合
The python program for tscc card reader is ported to terminal environment in C.
Now there is a script command, say 'tscc', could be used to interact with the card reader.
btw, complete a few script subroutines for script coder's reference.
Now, I can close this task, and do the SIP program again.
Now there is a script command, say 'tscc', could be used to interact with the card reader.
btw, complete a few script subroutines for script coder's reference.
Now, I can close this task, and do the SIP program again.
2007年7月18日 星期三
2007年7月17日 星期二
Display engine
思考如何完成新版 車機 畫面的模擬程式. 主要是希望可以透過 web 來完成. 這樣就可以利用現有的 tool 了.
把 display engine 的功能, 分割一下, 分為 core, wrapper, remote ui.
core: 處理核心, 包含: event handler, command dispatcher, window description interpreter.
wrapper: 包含兩個 link 的處理程式
把 display engine 的功能, 分割一下, 分為 core, wrapper, remote ui.
core: 處理核心, 包含: event handler, command dispatcher, window description interpreter.
wrapper: 包含兩個 link 的處理程式
- ui wrapper: 提供畫面控制的 function, 轉換成 內部的 UI message, 必透過 UI link 送給 remote UI; 或將 remote UI 送來的 按鍵 message, 轉換成 event handler 可以處理的型式.
- msg wrapper: 讓遠端的 message 可以加入 event handler 的 queue, 或將 core 產生的 message 透過 msg link 送出.
- 透過 UI link 連接到 wrapper, 處理 remote message. 或將 按鍵 動作, 轉換成 UI message 送到 wrapper
- 提供 UI, 以便輸入 event,
- 將 msg link 收到的資料, 顯示在 UI 的 log area.
2007年7月13日 星期五
最近待辦事項
1. 研讀 mg1264 的使用手冊, 了解如何在 linux 環境下使用, 並進一步研究如何產生相應的儲存檔案, 即在 windows 上播放的問題.
2. 車機的部分功能待確定: keypad, buzzer, external flash 的更新.
3. LI 的評估工作. 例如, 如何將存下來的資料, streaming 到 client 端. client 端的程式還有多少 effort.
4. 研究 openvpn - (2007/07/14 測試過了, client 端可用)
5. 撰寫 新的 UI 概念測試程式. (2007/07/17 規劃了程式架構)
2. 車機的部分功能待確定: keypad, buzzer, external flash 的更新.
3. LI 的評估工作. 例如, 如何將存下來的資料, streaming 到 client 端. client 端的程式還有多少 effort.
4. 研究 openvpn - (2007/07/14 測試過了, client 端可用)
5. 撰寫 新的 UI 概念測試程式. (2007/07/17 規劃了程式架構)
如何處理 45 TB 的資料
前幾天, 公司有一個案子要報價, 是 150M 用戶的 VMS, 要提供每人 30MB 的容量, 同時會有 26 E1 的接入.
這可是大型的案子. 光硬碟就要 45TB ! 雖然一定做的出來, 但是還是得做一些 survey.
首先得考慮這麼大的容量, 如果不幸沒有正常 umount, 下次要 mount 得執行 fsck 的話, 那得要花多少時間. (i.e. fsck after crash) 選擇使用 journalling filesystem 或多或少可以解決一部分這個問題.
再來, 是萬一真的得徹底執行 fsck 的話, 得多久. (ie. how much time it costs to do a complete fsck), 這就得衡量 filesystem size. 例如: 檢查 4TB 所花的時間, 跟同時檢查兩個 2TB 所花的時間有差多少.
另外一些問題是, 我有哪些 filesystem 可供選擇 ?
經過一番調查, 有幾點要注意 (已經決定使用 linux 了)
1. linux kernel 的 block layer 是否可以 support 這麼大的容量. ([1])
-> 2.6 的 kernel, 可以打開 CONFIG_LBD.
-> linux 使用 sector_t 大小的變數, 來定址某一 block device 上的 sector (512Byte),
for 32bit, sector_t 為 32bit (if CONFIG_LBD not defined, i.e. 2TiB limit), or 64bit (if CONFIG_LBD defined)
for 64bit, sector_t 為 64bit. (i.e. 2^73 = 8 ZiB [2])
所以, 只要確定是使用 linux 2.6, 並且 enable CONFIG_LBD, 這樣就可以使用 大於 2TB 的 disk array.
2. 哪些 filesystem 可以 support 這麼大的容量 ([Comparison of file systems])
我想下列是可以考慮的選擇 ext3, reiserfs3, jfs, xfs.
由於是小檔案 (幾 MB) 居多, 因此還是得確認一下每一個 filesystem 可以儲存的最大檔案數.
3. 由於 acd/acdmgr 會透過 NFS 存取 file server, 所以 NFS 是否 support 這麼大的容量 ? 或者有別的 solution ?
-> 應該只需考慮 filesize. 因為, nfs server 並沒有實際建立一個 filesystem, 而是 export 一個 local filesystem to remote by the lower layer file system.
-> nfs v3 以後, 是使用 64 bit 來 存取 一個file.
-> 在這個應用中, 應該不會有這個問題. (每個人只有 30MB 的空間)
4. performance 的比較
a. ext2/ext3/reiserfs/jfs IBM 的一篇文章, 從不同的角度來看這個問題.
b. xfs 的 performance tweak.
5. LVM / RAID 的考慮
這可是大型的案子. 光硬碟就要 45TB ! 雖然一定做的出來, 但是還是得做一些 survey.
首先得考慮這麼大的容量, 如果不幸沒有正常 umount, 下次要 mount 得執行 fsck 的話, 那得要花多少時間. (i.e. fsck after crash) 選擇使用 journalling filesystem 或多或少可以解決一部分這個問題.
再來, 是萬一真的得徹底執行 fsck 的話, 得多久. (ie. how much time it costs to do a complete fsck), 這就得衡量 filesystem size. 例如: 檢查 4TB 所花的時間, 跟同時檢查兩個 2TB 所花的時間有差多少.
另外一些問題是, 我有哪些 filesystem 可供選擇 ?
經過一番調查, 有幾點要注意 (已經決定使用 linux 了)
1. linux kernel 的 block layer 是否可以 support 這麼大的容量. ([1])
-> 2.6 的 kernel, 可以打開 CONFIG_LBD.
-> linux 使用 sector_t 大小的變數, 來定址某一 block device 上的 sector (512Byte),
for 32bit, sector_t 為 32bit (if CONFIG_LBD not defined, i.e. 2TiB limit), or 64bit (if CONFIG_LBD defined)
for 64bit, sector_t 為 64bit. (i.e. 2^73 = 8 ZiB [2])
所以, 只要確定是使用 linux 2.6, 並且 enable CONFIG_LBD, 這樣就可以使用 大於 2TB 的 disk array.
2. 哪些 filesystem 可以 support 這麼大的容量 ([Comparison of file systems])
我想下列是可以考慮的選擇 ext3, reiserfs3, jfs, xfs.
| file system | max. file size | max. vol. size | max. # of file | max # of inodes | max. # of file in a directory |
|---|---|---|---|---|---|
| ext3 (4KB block) | 2TiB | 16TiB | less than # of inodes | If V is the volume size in bytes, then the default number of inodes is given by V/213 (or the number of blocks, whichever is less), and the minimum by V/223 | |
| ReiserFs3 | 8 TiB | 16 TiB | |||
| jfs | 4 PiB | 32 PiB | |||
| xfs | 8 EiB | 8 EiB |
由於是小檔案 (幾 MB) 居多, 因此還是得確認一下每一個 filesystem 可以儲存的最大檔案數.
3. 由於 acd/acdmgr 會透過 NFS 存取 file server, 所以 NFS 是否 support 這麼大的容量 ? 或者有別的 solution ?
-> 應該只需考慮 filesize. 因為, nfs server 並沒有實際建立一個 filesystem, 而是 export 一個 local filesystem to remote by the lower layer file system.
-> nfs v3 以後, 是使用 64 bit 來 存取 一個file.
-> 在這個應用中, 應該不會有這個問題. (每個人只有 30MB 的空間)
4. performance 的比較
a. ext2/ext3/reiserfs/jfs IBM 的一篇文章, 從不同的角度來看這個問題.
b. xfs 的 performance tweak.
5. LVM / RAID 的考慮
2007年7月10日 星期二
write and SIGPIPE
這兩天把之前懷疑的東西再拿出來看看. (write and SIGPIPE)
現有的 library 都是先呼叫 select(), 確定可以讀/寫的file descriptor list, 而後逐個先執行 read, 再執行 write.
但有一個 glare condition 沒有處理到. 若是在 read() 和 write() 之間, socket 被對端關閉了, 那呼叫 write() 就會產生 SIGPIPE. 如果沒有忽略, 或者處理 SIGPIPE, 那預設的處理方式就是退出程式.
解決的方法, 就是寫一個 dummy 的 signal handler. 當 write() 觸發 SIGPIPE 後, 忽略他. 靠下一次的 read() 來關閉這個鏈路.
至於已經有的程式, 就得逐個檢查了.
現有的 library 都是先呼叫 select(), 確定可以讀/寫的file descriptor list, 而後逐個先執行 read, 再執行 write.
但有一個 glare condition 沒有處理到. 若是在 read() 和 write() 之間, socket 被對端關閉了, 那呼叫 write() 就會產生 SIGPIPE. 如果沒有忽略, 或者處理 SIGPIPE, 那預設的處理方式就是退出程式.
解決的方法, 就是寫一個 dummy 的 signal handler. 當 write() 觸發 SIGPIPE 後, 忽略他. 靠下一次的 read() 來關閉這個鏈路.
至於已經有的程式, 就得逐個檢查了.
2007年4月18日 星期三
DCE/RPC 測試
今天到 A 公司測試 MGC 的 CDR 介面. 一開始對 i5_recLstLength 的意義上有誤解, 以為是接收到的單筆 CDR 的長度. 後來發現是收到資料的總長度. 然後問題就解決了. 算是蠻順利的.
這次的測試算是順利的, 對方也很專業, 整個測試環境早就 ready 了. 很久沒遇到這樣的合作廠商了.
接著就要對 DCE/RPC 的 API 進一步的深入了解. 避免可能的 memory leak. 大部份的 demo 程式, 都不會注重在這些細節. 只能靠自己一個 function 一個 function 去讀, 確認該 free 的東西都 free.
這一版 API 是 blocking mode, 要跟現有的程式框架結合的話, 必須將這一部份放在 thread 中, 並且透過 PIPE/MSG 來傳遞訊息 可能最方便.
這次的測試算是順利的, 對方也很專業, 整個測試環境早就 ready 了. 很久沒遇到這樣的合作廠商了.
接著就要對 DCE/RPC 的 API 進一步的深入了解. 避免可能的 memory leak. 大部份的 demo 程式, 都不會注重在這些細節. 只能靠自己一個 function 一個 function 去讀, 確認該 free 的東西都 free.
這一版 API 是 blocking mode, 要跟現有的程式框架結合的話, 必須將這一部份放在 thread 中, 並且透過 PIPE/MSG 來傳遞訊息 可能最方便.
2007年4月4日 星期三
2007年4月3日 星期二
訂閱:
文章 (Atom)