星期一, 12月 20, 2010

美光推新型記憶體裝置 延長NAND產品壽命

美光推新型記憶體裝置 延長NAND產品壽命
"新款ClearNAND裝置將錯誤管理技術整合在同一個NAND封裝內...", 應該和 eMMC 相同, 只是名稱不同.

星期三, 12月 01, 2010

在 Ubuntu 10.04 下安裝 Canon MP568

今天想到要在 Ubuntu 下安裝 MP568 printer, 用 Google 找了一下,找到了 Canon 自己有出 Linux 下的 driver.
http://support-asia.canon-asia.com/contents/ASIA/EN/0100236502.html
下載解開後有2個檔案,先安裝 cnijfilter-common_3.20-1_i386.deb
再安裝 cnijfilter-mp560series_3.20-1_i386.deb
接著在 系統/管理/列印 下新增 printer,
使用 PPD 檔案,在 cnijfilter-mp560series_3.20-1_i386.deb 中可以用套件安裝程式看到路徑。
可以列印了 :-)

星期一, 11月 08, 2010

Python 使用 subprocess module 呼叫外部程式

# 當呼叫內建的指令,如 dir 時, Popen()裡的 shell 要設為 True
# stdout 可以設成檔案輸出, 如下:
fopen = open('hello.txt','w')
subprocess.Popen('dir',shell = True, stdout = fopen)
fopen.close()

星期二, 10月 26, 2010

將 source code 的原始編排放入 blog 中

使用下列網站:
http://codeformatter.blogspot.com/2009/06/about-code-formatter.html

只要將 source code 貼上, 就會產生對應的 html, 再貼入 blog 中就可以了.

使用 python 呼叫 DLL

使用 BCB 來撰寫 DLL

 extern "C" __declspec(dllexport) int __stdcall ReturnAplusB(int a,int b)  
{
return a+b+1;
}

/* 注意 __stdcall 這個宣告很重要,不然 python 會找不到而出現錯誤訊息 */

使用 python 呼叫 DLL


 from ctypes import *  
def main():
dll = windll.LoadLibrary("DllTest.dll")
c = c_short(1)
d = c_short(3)
a = dll.ReturnAplusB(c,d)
print 'the return value : %d'%a
a = dll.ReturnAplusB(4,6)
print 'the return value : %d'%a
a = dll._Print1()
print 'the return value : %d'%a
if __name__ == '__main__':
main()


## 使用 ctypes module
## 使用 windll, 這個是用來呼叫 windows 中的 DLL.

參考:
http://hi.baidu.com/fangss007/blog/item/461d00f3dc317bc50b46e078.html

星期五, 8月 27, 2010

Install Jdownloader in Ubuntu 10.04

Open the terminal and run the following command
Terminal
sudo add-apt-repository ppa:jd-team/jdownloader
sudo apt-get update
sudo apt-get install jdownloader

星期三, 7月 28, 2010

Ubuntu 上的 Hex Editor

Bless Hex Editor
另外也有 GHex, 但沒有試過。

星期六, 5月 08, 2010

Mount nrg file

使用 kiso 就可以 mount .nrg 檔
安裝方式, 使用 command line:
apt-get install kiso

之後會在"附屬應用程式" 就可找到 Kiso

星期五, 3月 26, 2010

產生 GUID 的方式

使用 BCB compiler

#include "objbase.h"

...
void __fastcall GenerateGUID(void)
{
GUID guid;

CoCreateGuid(&guid); // win32API

AnsiString asGuid = GUIDToString(guid);

}

星期三, 2月 10, 2010

把 chm 檔解開的方式

直接在 dos 視窗下輸入:
hh.exe -decompile extracted_folder filename.chm

非常簡單 !
ref:
http://en.wikipedia.org/wiki/Microsoft_Compiled_HTML_Help#Applications