[教學] phpBB3 使用者簽名檔 url 連結加上 rel=”nofollow”
[PHP] 好用 Debug PHP 工具 FirePHP for FireFox on CodeIgniter
[Linux Kernel] built-in vs. module
在編譯 Android Linux Kernel 2.6.29 Driver,常常遇到該把 Driver 用 built-in 或者是編譯成 module 呢?這其實看人習慣,就跟問你編輯器是用 Vim 或者是 emacs 是同樣意思,這兩者是有很大的差異,built-in 用在開機自動讀取載入,所以直接編譯成 uImage 檔案給嵌入式系統,像是 SCSI 或者是 SATA Driver 都建議編譯成 built-in 的方式,反而是一些音效驅動程式,可以編譯成 module,NTFS 就是可以編譯成 module,等您需要的時候在動態載入就可以,這樣可以減少 Kernel Image 的使用空間。 如果不想用 built-in 編譯,開機又需要驅動程式,那就需要透過 initrd 方式來啟動。底下整理兩者差異:
built-in:
開機自動載入,不可移除 Linux Kernel Image 大 需要重新 Compile
module:
可動態載入 Linux Kernel Image 小 不需要重新 Compile reference: [gentoo-user] kernel: built-in vs. module
[Ubuntu/Debian] 使用系統設定全域 http Proxy
如果想讓 Ubuntu/Debian 不管是 http 或者是 ftp 都可以透過 Proxy 去取得資料,就必須要設定系統 Proxy,目前任職公司就必須這樣設定,當然也可以透過其他方式出去(ex. ssh tunnel) 可以搜尋其他文章,底下分成兩種方式設定。 1. 利用 command line 方式設定
export http_proxy=http://username:password@proxyserver.net:port/ export ftp_proxy=http://username:password@proxyserver.netport/寫入 ~/.bashrc
source ~/.bashrc2. 利用 Desktop 介面設定
Settings-> Preference -> Network 系統\偏好設定\代理伺服器reference:
How to use apt-get behind proxy server (Ubuntu/Debian) Ubuntu Proxy的設定
[C/C++] count 1 bits of input value by shifting.
[筆記] iframe 父頁子頁呼叫函式 parent call function
紀錄 iframe 如何呼叫子頁或者是父頁函式,iframe 在現今 Web 2.0 時代已經不流行了,因為有很多問題的存在,例如對於 SEO 搜尋引擎也沒有幫助,但是也是很多人在使用,底下筆記心得,說不定之後會 google 到自己的文章,哈哈。 父頁(主視窗)呼叫子頁函式:
/* iframeID 是 iframe ID*/
window.iframeID.formSubmit();
/* ifr 是 iframe ID */
document.getElementById('ifr').contentWindow.formSubmit();
子頁(iframe)呼叫父頁(主視窗)函式:parent.formSubmit();如果有兩層
parent.parent.formSubmit();注意 timing issue,等 iframe 視窗 load 完之後才可以呼叫 iframe function。至於如果取主視窗跟 iframe 的變數 value,可以利用 jQuery $("#ID") 方式來得到。 reference:
【程式】JS : parent , iframe function call Access child function from iframe
[jQuery] 解決 IE6 PNG 透明背景 (Supersleight jQuery Plugin for Transparent PNGs in IE6)
[C/C++] C語言切割字串函式 strsep,分析 URL GET 參數
今天來簡介 UNIX 內建的 strsep 函式,這在 Windows Dev-C++ 是沒有支援的,在寫 UNIX 分析字串常常需要利用到此函式,大家可以 man strsep 來看如何使用 strsep,假設我們要分析 URL Get 字串:user_command=appleboy&test=1&test2=2,就可以利用兩次 strsep 函式,將字串全部分離,取的個別的 name, value。strsep(stringp, delim) 第一個參數傳入需要分析的字串,第二個參數傳入 delim 符號,假設 stringp 為 NULL 字串,則函式會回傳 NULL,換句話說,strsep 會找到 stringp 字串第一個出現 delim 符號,並將其取代為 \0 符號,然後將 stringp 更新指向到 \0 符號的下一個字串,strsep() function 回傳原來的 stringp 指標。看上面文字敘述,好像不太瞭解,沒關係,底下是 UNIX strsep.c 的原始碼:
| |