2008年3月6日 星期四

A Cross-platform Packer For Executables(跨平台的執行檔壓縮工具)

在 Lazarus 網站的 FAQ 中提到,可使用 UPX 這個工具,加上移除 GNU debugger 的 symbols(使用 strip)使得 freepascal 編譯出的 windows 執行檔變小。

經測試壓縮效率比 PECompact 差一些,不過差別在於:
  • UPX 為 GPL。
  • UPX 跨平台。
  • UPX 支援許多不同平台的執行檔格式。(win32, linux, linux kernel, mac, even Playstation 1 !)
以下轉貼自原始網站 http://upx.sourceforge.net/

UPX is a versatile executable packer with the following features:

  • excellent compression ratio: typically compresses better than WinZip/zip/gzip, use UPX to decrease the size of your distribution !

  • very fast decompression: ~10 MB/sec on an ancient Pentium 133, ~200 MB/sec on an Athlon XP 2000+.

  • no memory overhead for your compressed executables because of in-place decompression.

  • safe: you can list, test and unpack your executables. Also, a checksum of both the compressed and uncompressed file is maintained internally.

  • universal: UPX can pack a number of executable formats.

  • portable: UPX is written in portable endian-neutral C++

  • extendable: because of the class layout it's very easy to add new executable formats or new compression algorithms

  • free: UPX is distributed with full source code under the GNU General Public License, and may be used freely even with commercial programs.

You probably understand now why we call UPX the "Ultimate Packer for eXecutables".

UPX is based on experience with our previous packers DJP and lzop and uses the NRV compression library.

Pascal Tutorial

http://www.taoyue.com/tutorials/pascal/
Pascal 的入門教學。

2008年2月14日 星期四

隨身碟病毒 - kavo kava tavo tava etc.

最近家中電腦感染了隨身碟病毒,起先沒有發現(Norton 2005)。notebook 中安裝的是 Avira Antivir Personal Edition 才偵測出隨身碟已受到感染。參考了幾篇文章之後動手清除。其中比較有價值的文章分別是:

  1. 行政院資安論壇中的一個討論串。其中有一篇說明 kavo virus 的詳細清除步驟。甚至提到病毒會自我更新病毒碼!
  2. 台灣論壇中的一篇文章。包括其他的隨身碟病毒的各種名稱:tava/kava/avpa/amva/mmva/mnsa。但解法不如 1. 的完整。
  3. 您不可不知的KAVO病毒與解法。內有提到使用 HiJackThis 工具,來掃瞄並修復系統。此項工具可從趨勢網站下載。
系統是 XP Home,步驟與資安論壇中的文章類似但略有不同,紀錄如下:

  1. 關閉系統還原。
  2. 關閉網路。不一定要進入安全模式。
  3. 修復登錄檔,把顯示隱藏檔案的功能打開。執行 regedit 把 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\SHOWALL 值改成 1。
  4. 移除 HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2
  5. 執行 cmd.exe 用工作管理員把 explorer.exe 這個 process 殺掉,之後在 cmd 視窗下再執行 explorer。因為其中有 kavox.dll 會被 explorer 調用。
  6. 在 cmd 視窗下執行 explorer 以開啟 explorer,如:explorer c:。將資料夾選項中的隱藏檔案功能取消,如此可看到病毒寫入的隱藏檔案,將之清除。如:
    1. 根目錄下面的 autorun.inf, ntdelect.com (NOT ntdetect.com!), 數字/亂碼.bat/com。這些檔案不一定都存在。
    2. C:\windows\system32\kavo.exe
    3. C:\windows\system32\kavo1.dll
    4. C:\windows\help 下也要檢查。(?)
  7. 使用 cmd 視窗進入使用者的家目錄下的 Local Settings 之後執行 "rd /s /q Temp" 清除暫存目錄下的檔案。
  8. 每個磁碟根目錄都用 cmd 視窗下執行 explorer 磁碟機代號清除病毒檔案。
  9. 最後用 HiJackThis scan 之後勾選 kava/tava/等等 將之修復。
  10. 重新開機。

2008年1月27日 星期日

Binary Logistirc Regression (SPSS)

基本算式: Ln (Odd) = Ln (Y'/1-Y') = a + bX
Y' represents the predicted probability of the event which is coded with 1 (one).

For dichomotous variables, the calculated odds ration (OR) of a logistic model is

  • (the odd in favor of the event coded with 1) / (the odd in favor the event coded with 0)
筆記:
  • Continuous variables in a logistic regression model - the importance of the "scale" - description 對應的某單位變動的勝算比,使用的單位不同,勝算比也不同。如:早產兒的體重使用 1 gram vs. 1 kilogram,odds ratio 有不同的大小。

參考資料:
  1. 生物谷的教學
  2. Multivariate Analysis with SPSS - 一個教學資訊豐富的網頁,包括如何使用 spss 做 binary logistic regression analysis。

2008年1月9日 星期三

Firefox 的 Menuitem 問題。

不知為何在瀏覽器的視窗下面出現了一排紅色的 menuitem 錯誤。Google 之後發現是 JAVA 寫入語系的時候「寫錯了」。

修改 C:\Program Files\Mozilla Firefox\extensions\{CAFEEFAC-0016-0000-0001-ABCDEFFEDCBA}\chrome.manifest 這個檔案,先關閉 firefox,再把 zh_TW 改成 zh-TW 之後重新啟動 firefox 即可解決。

2007年12月30日 星期日

投資金律 (The Four Pillars of Investing)

I. The First Pillar - Investing Theory


Risk and Reward


Growth stock vs. value stock