<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-10430755083050582</id><updated>2011-12-11T00:45:15.645+08:00</updated><category term='Python'/><category term='KDE'/><category term='Lighttpd'/><category term='CMake'/><category term='Talk'/><category term='Shell_Script'/><category term='Debian'/><category term='Design_Pattern'/><category term='en_US'/><category term='首都機能移轉'/><category term='C'/><category term='VirtualBox'/><category term='Opera'/><category term='Programing'/><category term='Qt_Jambi'/><category term='PicKing'/><category term='Khopper'/><category term='FreeBSD'/><category term='Windows'/><category term='Java'/><category term='Prolog'/><category term='糟糕'/><category term='IDE'/><category term='GNU_Linux'/><category term='Regular_Expression'/><category term='FoolproofProject'/><category term='C++'/><category term='PHP'/><category term='Assembly'/><category term='zh_TW'/><category term='Git'/><category term='Kubuntu'/><category term='KomiX'/><category term='Django'/><category term='Eclipse'/><category term='FFmpeg'/><category term='戲言'/><category term='Qt'/><category term='ACG'/><category term='Visual_Studio'/><category term='歌詞'/><category term='JavaScript'/><category term='CSIE'/><category term='Boost'/><category term='靠北文'/><title type='text'>「　」</title><subtitle type='html'>へんじがない、ただのしかばねのようだ</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default?start-index=101&amp;max-results=100'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>345</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-4975177756805372275</id><published>2011-11-15T16:43:00.001+08:00</published><updated>2011-11-15T17:20:30.789+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GNU_Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='VirtualBox'/><title type='text'>Setting host-only adapter on Linux host</title><summary type='text'>
在虛擬機器上我一直是 VirtualBox 的支持者, 儘管我並不賞識 Sun 或是 Oracle.
要讓 host OS 和 guest OS 可以透過網路互相溝通, 比較簡單的方式是使用 bridged adapter, 而用這種方式拿到的 guest IP 會跟 host IP 處在同一個網域. 也就是說和 host 處在同一個區網的其他機器都看得到這個 guest, 如果本來的用途就是要分享給區網使用, 那這就是最直接的方法.
但如果你只希望 guest OS 只被 host 看到, 那就得用點迂迴的方式, 那就是在 guest 使用兩個網路卡介面, 一個使用 NAT, 另一個使用 Host-only adapter.




NAT 的概念就不多說了, 總之對外連線時會經由 host 的介面轉換為 host adapter 的封包, 對外來說就只看得到 host, </summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/4975177756805372275/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2011/11/setting-host-only-adapter-on-linux-host.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4975177756805372275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4975177756805372275'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2011/11/setting-host-only-adapter-on-linux-host.html' title='Setting host-only adapter on Linux host'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-2065064294424826867</id><published>2011-11-08T15:06:00.000+08:00</published><updated>2011-11-08T15:06:20.768+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GNU_Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='en_US'/><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='Qt'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>QNetworkAccessManager can not determine file size from Pure-FTPd</title><summary type='text'>
If you are using QNetworkAccessManager to download files from a Pure-FTPd server, the file sizes are always -1. This is cause by Qt, Pure-FTPd, and the FTP RFC spec.




Let's start from FTP RFC documentation. The very first FTP spec. is describe in RFC-959, and it doesn't describe how to retrieve size of files. The SIZE and MLSD command are describe in RFC-3659. Some FTP server may not support </summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/2065064294424826867/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2011/11/qnetworkaccessmanager-can-not-determine.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/2065064294424826867'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/2065064294424826867'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2011/11/qnetworkaccessmanager-can-not-determine.html' title='QNetworkAccessManager can not determine file size from Pure-FTPd'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-8392417229733163616</id><published>2011-10-01T16:51:00.000+08:00</published><updated>2011-10-08T23:44:32.739+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='Qt'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Threads in Qt</title><summary type='text'>
Threads, Events and QObjects | Qt Wiki


寫出好用的泛型程式碼需要天份, 寫出具有異常安全性的程式碼需要細心, 而要寫出完全多緒安全的程式碼, 你需要的是新鮮的肝.




基本上這篇文章最大的重點就是, 如無必要不需繼承 QThread, 因為如果你這麼做, 事情通常不會像你想的那樣運作.
QThread 的設計意圖是作為一個管理 thread 的物件, 它並不代表 thread 本身, 所以你應該做的是建立一個 QThread 物件, 然後使用 QObject::moveToThread 把你需要在該 thread 上執行的 QObject 移到 QThread. QThread 一旦執行完畢就無法再次啟動, 如果還要使用 thread 必須要建立另一個 QThread.


我整理一下 QObject 和 thread 之間的關係:

每個</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/8392417229733163616/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2011/10/threads-in-qt.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/8392417229733163616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/8392417229733163616'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2011/10/threads-in-qt.html' title='Threads in Qt'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-1433587506810243035</id><published>2011-07-24T00:43:00.003+08:00</published><updated>2011-07-30T23:28:08.665+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='KDE'/><category scheme='http://www.blogger.com/atom/ns#' term='GNU_Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Debian'/><category scheme='http://www.blogger.com/atom/ns#' term='Kubuntu'/><title type='text'>Reuse existing KSnapshot on press PrintScreen</title><summary type='text'>在 Debian 或 Kubuntu 的預設設定, 按下 PrintScreen 鍵會啟動 KSnapshot, 若再按下一次 PrintScreen, 則會再喚起一個 KSnapshot. 但這不是我想要的行為, 當我按下 PrintScreen 時就代表我想抓圖了, 不停地開啟新的 KSnapshot 有點蠢. 幸好 KSnapshot 有提供足夠的 D-Bus 介面, 這讓我們可以寫一個 script 操作已存在的 KSnapshot.
#! /bin/sh

PID=`pidof -s ksnapshot`

if [ -z ${PID} ] ; then
    `which ksnapshot` -caption KSnapshot &amp;
    exit 0
fi

DBUS_SERVICENAME="org.kde.ksnapshot-${PID}"
DBUS_PATH='</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/1433587506810243035/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2011/07/reuse-existing-ksnapshot-on-press.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/1433587506810243035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/1433587506810243035'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2011/07/reuse-existing-ksnapshot-on-press.html' title='Reuse existing KSnapshot on press PrintScreen'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='https://lh3.googleusercontent.com/-p06OClTVoFc/TjQccJveB0I/AAAAAAAAAc0/82eq1Qc7UtU/s72-c/snapshot8.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-1505417628865454041</id><published>2011-07-12T22:13:00.001+08:00</published><updated>2011-07-12T22:14:09.883+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GNU_Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Git'/><category scheme='http://www.blogger.com/atom/ns#' term='Debian'/><category scheme='http://www.blogger.com/atom/ns#' term='Lighttpd'/><title type='text'>Configure gitweb with lighttpd on Debian</title><summary type='text'>很久之前從 gitosis 的範例改寫的, 筆記於此:
server.modules  += (
  "mod_setenv",
)

url.redirect += (
  "^/gitweb$" =&gt; "/gitweb/",
)
alias.url += (
  "/gitweb/" =&gt; "/usr/share/gitweb/",
)

$HTTP["url"] =~ "^/gitweb/" {
  setenv.add-environment = (
    "GITWEB_CONFIG" =&gt; "/srv/gitosis/gitweb/gitweb.conf",
  )
  cgi.assign = ( ".cgi" =&gt; "" )
  server.indexfiles = ( "gitweb.cgi" )
}
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/1505417628865454041/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2011/07/configure-gitweb-with-lighttpd-on.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/1505417628865454041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/1505417628865454041'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2011/07/configure-gitweb-with-lighttpd-on.html' title='Configure gitweb with lighttpd on Debian'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-2637826486903302732</id><published>2011-06-23T15:00:00.000+08:00</published><updated>2011-06-23T15:00:11.678+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><title type='text'>Download attachment file with JavaScript</title><summary type='text'>
AJAX 回應回來的內容會被 JavaScript 拿到, 而不是直接顯示在網頁上. 當你希望瀏覽器跳出下載對話框, 可以這麼做:

window.location.href = 'download.cgi';

是的, 根本不需要 AJAX.
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/2637826486903302732/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2011/06/download-attachment-file-with.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/2637826486903302732'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/2637826486903302732'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2011/06/download-attachment-file-with.html' title='Download attachment file with JavaScript'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-3118350680419462786</id><published>2011-06-23T00:19:00.000+08:00</published><updated>2011-06-23T00:19:33.575+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GNU_Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Django'/><category scheme='http://www.blogger.com/atom/ns#' term='Debian'/><category scheme='http://www.blogger.com/atom/ns#' term='Lighttpd'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><category scheme='http://www.blogger.com/atom/ns#' term='Kubuntu'/><title type='text'>Configure Django with Lighttpd on Debian/Ubuntu</title><summary type='text'>
網路上找到的資料都有點不完全, 最近在逃避現實的過程中找到了一個比較簡單的方式, 供有需要的人參考.




首先當然要安裝 Django 和 Lighttpd:

# aptitude install python-django python-flup lighttpd

不裝 python-flup 就不能啟動 Django.


在 /usr/share/doc/python-django/examples 裡有兩個檔案: initscript 和 default:

# cp initscript /etc/init.d/django
# chmod a+x /etc/init.d/django
# cp default /etc/default/django

initscript 幫助你讓 Django 成為系統服務, default 的內容則是一些變數設定. </summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/3118350680419462786/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2011/06/configure-django-with-lighttpd-on.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/3118350680419462786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/3118350680419462786'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2011/06/configure-django-with-lighttpd-on.html' title='Configure Django with Lighttpd on Debian/Ubuntu'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-4222124886912131511</id><published>2011-05-27T19:23:00.001+08:00</published><updated>2011-05-27T19:24:24.408+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Khopper'/><category scheme='http://www.blogger.com/atom/ns#' term='FoolproofProject'/><title type='text'>Khopper 0.4.2 is out!</title><summary type='text'>
安裝方式
使用手冊


v0.4.2：

修正 Windows 平台開檔時會直接清空檔案的問題
新增 Windows Installer 方便安裝

v0.4.1：

修正 YouTube 抓取失敗的問題
增加 Ubuntu Natty 的套件

v0.4.0：

加入 FreeDB 支援
加入 YouTube 支援
加入多緒轉檔功能支援
儘可能消除 Phonon 對不同格式的影響
Ubuntu 安裝使用 PPA 來源





為什麼會跳過 v0.4.0 從 v0.4.2 發佈呢 ... 不要問, 很恐怖 = =

</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/4222124886912131511/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2011/05/khopper-042-is-out.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4222124886912131511'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4222124886912131511'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2011/05/khopper-042-is-out.html' title='Khopper 0.4.2 is out!'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-4338013260929898836</id><published>2011-05-23T03:53:00.000+08:00</published><updated>2011-05-23T03:53:49.356+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><title type='text'>JavaScript function binding: arguments only</title><summary type='text'>
Function.bind -- MDC Docs


既然 JavaScript 1.8.5 已經有 bind 可以用, 為什麼不用它呢? 因為它有一個小問題, 就是它非得 bind 一個 instance 給 this, 但很多時候你是不想動到原本 this 所指向的 instance, 比方說某些 library 會要求 event handler 的 this 必須要指向某個 DOM Element. 於是當你只想 bind arguments 時, 這個無法忽略的第一個參數實在很惱人, 我自己試過丟 undefined 或 null 進去, 但結果 this 都被 bind 到 window 上. 幸好這個要求在 JavaScript 並不難實作, 我就自己刻了一個.




function bind( fn ) {
    var args = </summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/4338013260929898836/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2011/05/javascript-function-binding-arguments.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4338013260929898836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4338013260929898836'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2011/05/javascript-function-binding-arguments.html' title='JavaScript function binding: arguments only'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-1284106068569089904</id><published>2011-05-08T21:34:00.000+08:00</published><updated>2011-05-08T21:34:03.827+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Qt_Jambi'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='Qt'/><title type='text'>Use Qt Jambi community with Eclipse</title><summary type='text'>
Qt Jambi 原本的 Eclipse plugin 己經不能用在新版的 Qt Jambi 上了，所以我們需要自己做點苦工。



設置 Qt Jambi 的 classpath
這是比較簡單的部分，在 Preference -&gt; Java -&gt; Build Path -&gt; User Libraries 裡新增一個新的 library，把 qtjambi-4.x.x.jar 和 qtjambi-(platform spec).jar 加入，然後在專案的頁面加入這個自訂的 library 就好。
Qt Designer
這有點麻煩，因為就我的經驗，社羣版給的 designer 啟動器都是不能用的，但還好 Qt Jambi 用的 jui 檔案和原本的 ui 檔案格式差不多，所以用原本 C++ 的 QtDeigner 就可以了，只要手動做些小修改：

副檔名改成 jui
&lt;qt&gt;那個 </summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/1284106068569089904/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2011/05/use-qt-jambi-community-with-eclipse.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/1284106068569089904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/1284106068569089904'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2011/05/use-qt-jambi-community-with-eclipse.html' title='Use Qt Jambi community with Eclipse'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-3767917144549182662</id><published>2011-04-23T17:23:00.001+08:00</published><updated>2011-04-29T15:40:54.548+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='Qt'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Single Instance of Qt</title><summary type='text'>
某些時候你會希望你的程式在同一時間內只會被執行一次，這需要使用 IPC 的技巧實作：第一個被執行的實體先留下某個溝通的管道，第二個以後被執行的實體就去連結這個管道，並自行決定要留下哪個實體。




最方便的方法就是用 Qt Solutions 內的元件：QtSingleApplication。但 Qt 己經不再繼續更新 Qt Solutions 了，且最近我使用它時碰到了一些詭異問題。另外要一提的是，去年我寫的 Export the symbols of QtSingleApplication 一文，現在其取得方式及編譯方式都有變動。由於其細節與本文無關，請自行參照該文。
QtSingleApplication 的使用方式如下：

#include &lt;QtSingleApplication&gt;

int main( int argc, char * argv[] ) {
    </summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/3767917144549182662/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2011/04/single-instance-of-qt.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/3767917144549182662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/3767917144549182662'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2011/04/single-instance-of-qt.html' title='Single Instance of Qt'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-6527226159738754654</id><published>2011-04-09T23:28:00.000+08:00</published><updated>2011-04-09T23:28:27.635+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual_Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Lambda expression issue in VC10</title><summary type='text'>

class A {
public:
    A() {
        ( [&amp;](){
            A::dummy; // VC10 compile error
        } )();
    }
private:
    static const int dummy = 0;
};



我也不知道怎麼解釋, 看起來是它搞混了實體存取和全域存取, 也就是說它不知道該不該自動補完成 this-&gt;A::dummy. 但如果使用 namespace 強制修飾成 ::A::dummy, 或是不使用 wildcard capture 就不會有問題.
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/6527226159738754654/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2011/04/lambda-expression-issue-in-vc10.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6527226159738754654'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6527226159738754654'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2011/04/lambda-expression-issue-in-vc10.html' title='Lambda expression issue in VC10'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-4271690773950619060</id><published>2011-04-01T22:51:00.002+08:00</published><updated>2011-04-03T01:24:52.269+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='CSIE'/><category scheme='http://www.blogger.com/atom/ns#' term='Design_Pattern'/><title type='text'>Another Observer Pattern implementation in Java</title><summary type='text'>
由於實在不喜歡 Swing 的 listener 方式，因此我嘗試使用 Java 內建的 Observer 和 Observable 來套用 Observer Pattern，但它比我想像中地還不靈活，原因有三：

必須要呼叫 Observable.setChanged 才會讓 Observable.notifyObservers 生效，而 Observable.setChanged 是 protected，這意味著你至少必須繼承 Observable 類別，這對於不允許多重繼承的 Java 來說很要命，因為 host class 很有可能來自另一繼承體系。
你沒辦法透過 composition 繞過這個限制，因為 Observer.update 帶有一個型態為 Observable 的參數，語義上這個參數必須要是發出事件的物件，但若是使用 composition 持有 </summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/4271690773950619060/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2011/04/another-observer-pattern-implementation.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4271690773950619060'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4271690773950619060'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2011/04/another-observer-pattern-implementation.html' title='Another Observer Pattern implementation in Java'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-3494134179728351490</id><published>2011-03-25T15:09:00.000+08:00</published><updated>2011-03-25T15:09:19.616+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Khopper'/><category scheme='http://www.blogger.com/atom/ns#' term='FoolproofProject'/><title type='text'>Khopper 0.4 Release Candidate is out</title><summary type='text'>
安裝方式
使用手冊


重要改變：

加入 FreeDB 支援
加入 YouTube 支援
加入多緒轉檔功能支援
儘可能消除 Phonon 對不同格式的影響
Ubuntu 安裝使用 PPA 來源





如果沒什麼問題就會是最後釋出版。

</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/3494134179728351490/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2011/03/khopper-04-release-candidate-is-out.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/3494134179728351490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/3494134179728351490'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2011/03/khopper-04-release-candidate-is-out.html' title='Khopper 0.4 Release Candidate is out'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-9004692362828921509</id><published>2011-03-04T16:35:00.003+08:00</published><updated>2011-03-04T17:08:06.400+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ACG'/><title type='text'>I tried to be merciful!</title><summary type='text'>
Leliana Character Video



這是 Dragon Age: Origin 上市前的一段小短片, 介紹遊戲中的 NPC 隊員 Leliana, 以下是劇情對話的略譯:

士兵: 喲~~看看我們遇到誰了
Alister: 這看起來不太妙 orz
Leliana: 紳士們, 冷靜點, 我們不需要在這裡製造麻煩吧
士兵: 滾開, 修女! 妳庇護了這些背叛者, 妳就是他們的同伙 ...
Leliana: 我試過對你們仁慈了! (碰碰碰)
主角: (X! 妳把他們全宰了啊!)
Leliana: (滿身是血) 讓我自我介紹, 我是 Leliana, 你是來這裡對抗 darkspawn 的對吧? 這也是我的目的
主角: (他X的血噴到我身上啦! 還有妳在那裡冷靜地自我介紹個屁啊!)
... (影片過場) ...
Alister: 更多怪人? 我以為我們隊伍已經夠多了



</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/9004692362828921509/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2011/03/i-tried-to-be-merciful.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/9004692362828921509'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/9004692362828921509'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2011/03/i-tried-to-be-merciful.html' title='I tried to be merciful!'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-4784434348641173079</id><published>2011-02-24T00:17:00.004+08:00</published><updated>2011-02-24T00:28:54.117+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual_Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Nested capturing in lambda expression</title><summary type='text'>
其實這是早已踩過的 bug, 單純留著當紀錄.



int i = 0;
( [&amp;i]() {
    // capture once
    ++i;
    ( [&amp;i]() {
        // capture twice
        ++i;
    } )();
} )();
std::cout &lt;&lt; i &lt;&lt; std::endl; // 2


來猜猜看上述程式用哪個 compiler 會出錯?



好吧, 應該不用猜也知道, 又是 Visual C++. 因為不明的原因[?], 它的 lambda expression 不能巢狀地 capture 變數名稱, 要用 std::bind 繞過去, 但因為前述的 bug, 這會讓程式碼變得又臭又長, 失去原本用 lambda expression 的意義.


據說這個 bug 也因為 vote 數不夠而不會修正(</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/4784434348641173079/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2011/02/nested-capturing-in-lambda-expression.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4784434348641173079'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4784434348641173079'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2011/02/nested-capturing-in-lambda-expression.html' title='Nested capturing in lambda expression'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-4340326203179780306</id><published>2011-02-02T03:18:00.003+08:00</published><updated>2011-02-24T00:30:37.456+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CSIE'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual_Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='zh_TW'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Lambda binding issue in VC10</title><summary type='text'>
VC10 的 lambda expression 的 bug 還真多 ... 這應該是我第三次踩到相關的 bug 了吧。


auto f( std::bind( []( int a, int b )-&gt;int {
    return a + b;
}, std::placeholders::_1, 2 ) );

f( 1 ); // returns 3



以上的範例定義一個接受二個 int 的 lambda expression, 回傳相加後的值，並把第二個參數綁定為 2，因此可以視為一個只接受一個 int 的函式，回傳和 2 相加的結果。
在 GCC 4.5 是沒問題的，但 VC10 就不行。因為 lambda expression 是 C++0x 的規格，在型別推導時應使用 decltype 來推導，但 VC10 的實作依然使用 C++03 TR1 時代的 trait </summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/4340326203179780306/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2011/02/lambda-binding-issue-in-vc10.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4340326203179780306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4340326203179780306'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2011/02/lambda-binding-issue-in-vc10.html' title='Lambda binding issue in VC10'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-8083595922359051670</id><published>2011-01-23T18:53:00.002+08:00</published><updated>2011-02-24T00:26:10.174+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='CSIE'/><category scheme='http://www.blogger.com/atom/ns#' term='Qt'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Use pyside-uic to compile ui files automatically</title><summary type='text'>
PySide 可以用 pyside-uic 來轉換 *.ui 到 python code，但每次都要手動弄這個真的很煩。所以我把所有的 ui 檔案集中放到一個資料夾內作為 package，並在 __init__.py 上動點手腳：




import os, sys

__uicPath__ = os.path.join( sys.prefix, 'Scripts', 'pyside-uic' ) if os.name == 'nt' else 'pyside-uic'

for root, dirs, files in os.walk( __path__[0] ):
    for file in files:
        name, ext = os.path.splitext( file )
        if ext != '.ui':
            </summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/8083595922359051670/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2011/01/use-pyside-uic-to-compile-ui-files.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/8083595922359051670'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/8083595922359051670'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2011/01/use-pyside-uic-to-compile-ui-files.html' title='Use pyside-uic to compile ui files automatically'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-5583702336361339035</id><published>2011-01-09T21:00:00.002+08:00</published><updated>2011-02-24T00:27:33.347+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GNU_Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='en_US'/><category scheme='http://www.blogger.com/atom/ns#' term='CSIE'/><category scheme='http://www.blogger.com/atom/ns#' term='Debian'/><category scheme='http://www.blogger.com/atom/ns#' term='Kubuntu'/><title type='text'>Embed external viewers into Firefox</title><summary type='text'>

# aptitude install mozplugger



Then Firefox will open your default external viewers with tabs, instead of external windows.
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/5583702336361339035/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2011/01/embed-external-viewers-into-firefox.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/5583702336361339035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/5583702336361339035'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2011/01/embed-external-viewers-into-firefox.html' title='Embed external viewers into Firefox'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-1470213785698764529</id><published>2010-12-29T18:09:00.001+08:00</published><updated>2010-12-29T18:09:28.832+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Talk'/><category scheme='http://www.blogger.com/atom/ns#' term='CSIE'/><title type='text'>Mozilla Add-On 要求使用者更改密碼以策安全</title><summary type='text'>
昨天 MAO 寄了封信, 大意是他們在 12/17 發生了被第三方使用者洩漏密碼的事件, 因此 MAO 為了安全性把所有使用者的密碼都砍掉了, 必須要用忘記密碼的方式重設才能啟用帳號.
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/1470213785698764529/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2010/12/mozilla-add-on.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/1470213785698764529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/1470213785698764529'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2010/12/mozilla-add-on.html' title='Mozilla Add-On 要求使用者更改密碼以策安全'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-4079321819292551648</id><published>2010-12-20T20:04:00.000+08:00</published><updated>2010-12-20T20:04:32.481+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='KDE'/><category scheme='http://www.blogger.com/atom/ns#' term='GNU_Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Kubuntu'/><title type='text'>im-switch dialog in Kubuntu 10.10</title><summary type='text'>
im-switch 在有 X Server 的狀況下會使用圖形介面的對話框，但是很遺憾的是它固定呼叫的是 zenity，而沒有提供 kdialog 或是 dialog 之類的支援。Kubuntu 預設也不會裝 zenity，因此你只能瞪著它吐出錯誤訊息。
等等，你有除了安裝 zenity 之外的方式，那就是假裝你沒有 X Server:

$ DISPLAY= im-switch -c

這個方法會讓 im-switch 以為目前沒有 X Server，從而使用傳統的設定方式。現在你可以享受你的文字介面了。
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/4079321819292551648/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2010/12/im-switch-dialog-in-kubuntu-1010.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4079321819292551648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4079321819292551648'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2010/12/im-switch-dialog-in-kubuntu-1010.html' title='im-switch dialog in Kubuntu 10.10'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-6886191126596133136</id><published>2010-11-25T01:03:00.001+08:00</published><updated>2011-02-24T00:31:15.650+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>你永遠料不到自己有多蠢</title><summary type='text'>
最近某個作品在開啟檔案時會不定期當掉 ... 原本一直找不出原因, 直到我在除另一個不相關的 bug 時發現這個函式:

const char * fromURI( const QUrl &amp; uri ) {
    QByteArray tmp( uri.toString().toUtf8() );
#ifdef Q_OS_WIN
    if( uri.scheme() == "file" ) {
        tmp.prepend( 'w' );
    }
#endif
    return tmp;
}





看不出來嗎? 我提示一下, QByteArray 有一個 operator const char *() const 成員讓它自動轉型成 const char * , 效果和 std::string::c_str() 一樣.
沒錯, 我回傳了暫時物件裡的 </summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/6886191126596133136/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2010/11/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6886191126596133136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6886191126596133136'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2010/11/blog-post.html' title='你永遠料不到自己有多蠢'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-5262903543744351951</id><published>2010-11-11T13:51:00.000+08:00</published><updated>2010-11-11T13:51:46.906+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual_Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='Qt'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Qt 4.7.1 introduced -mp configuration</title><summary type='text'>
在這一篇所針對的是 Qt 4.7.0, 在 Qt 4.7.1 發佈後, 發現多了 -mp 的選項, 顧名思義, 加上之後它就會針對 msvc 開啟 /MP 參數. 在此統整一下我用的參數:

@echo off

SET PREFIX=Z:\Qt\4.7.1

configure ^
    -opensource ^
    -debug-and-release ^
    -mp ^
    -ltcg ^
    -fast ^
    -no-qt3support ^
    -no-dsp ^
    -no-vcproj ^
    -prefix %PREFIX% ^
    -nomake examples ^
    -nomake demos ^
    -nomake translations
MKDIR %PREFIX%\mkspecs
XCOPY /E /K </summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/5262903543744351951/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2010/11/qt-471-introduced-mp-configuration.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/5262903543744351951'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/5262903543744351951'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2010/11/qt-471-introduced-mp-configuration.html' title='Qt 4.7.1 introduced -mp configuration'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-2332201605984989086</id><published>2010-10-11T01:10:00.001+08:00</published><updated>2010-10-12T12:17:40.956+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual_Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='Qt'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Build Qt with Visual C++ 2010</title><summary type='text'>

在開始前要特別一提的是在 configure -help 未提及的參數：

-prefix &lt;path&gt;

指定編譯完成後的安裝路徑，nmake install 時會安裝到這個路徑。

-nomake &lt;libs|tools|examples|demos|docs|translations&gt;

可以指定哪部分不需要編譯。要注意的是如果要關掉多個模組須分開指定。


為了讓編譯程序能夠加快，我對 mkspecs 做了一點手腳。找到 mkspecs\win32-msvc2010\qmake.conf，修改：

-QMAKE_CFLAGS            = -nologo -Zm200 -Zc:wchar_t-
+QMAKE_CFLAGS            = -nologo -Zm200 -Zc:wchar_t- -MP3
-QMAKE_CFLAGS_RELEASE    =</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/2332201605984989086/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2010/10/build-qt-with-visual-c-2010.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/2332201605984989086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/2332201605984989086'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2010/10/build-qt-with-visual-c-2010.html' title='Build Qt with Visual C++ 2010'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-5349986342629324500</id><published>2010-10-06T16:18:00.003+08:00</published><updated>2011-01-15T16:48:05.519+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GNU_Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Debian'/><category scheme='http://www.blogger.com/atom/ns#' term='Kubuntu'/><title type='text'>Fix the jar file association for shared-mime-info</title><summary type='text'>
Java 的 jar 檔案關聯在 Debian 和 Kubuntu 上一直都被視為 application/zip，基本上這不是 KDE 的問題，而是 shared-mime-info 裡面的 /usr/share/mime/packages/freedesktop.org.xml 的判定條件錯誤，它沒有判斷 jar 檔的 PKZIP 表頭。打開這個檔案，找到 &lt;mime-type type="application/x-java-archive"&gt; 的區段，加入：

&lt;magic priority="85"&gt;
  &lt;match value="PK\003\004" type="string" offset="0" /&gt;
&lt;/magic&gt;

再刷新 MIME 資料庫：

# update-mime-database /usr/shared/mime

jar 檔就會被正確判定了。
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/5349986342629324500/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2010/10/fix-jar-file-association-for-shared.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/5349986342629324500'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/5349986342629324500'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2010/10/fix-jar-file-association-for-shared.html' title='Fix the jar file association for shared-mime-info'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-4752211858986366712</id><published>2010-06-12T12:34:00.000+08:00</published><updated>2010-08-06T06:40:03.877+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='zh_TW'/><category scheme='http://www.blogger.com/atom/ns#' term='Qt'/><title type='text'>Phonon with raw PCM</title><summary type='text'>
由於 Phonon 在運作上會把讀到的東西轉交給它的後端，如果你已經有了一個原始的 PCM 資料，那麼在餵給 Phonon 時要記得填上 wav 的 header，才能讓後端辨識並找到合適的方式開啟它。
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/4752211858986366712/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2010/06/phonon-with-raw-pcm.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4752211858986366712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4752211858986366712'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2010/06/phonon-with-raw-pcm.html' title='Phonon with raw PCM'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-8384197288484227081</id><published>2010-05-22T20:12:00.001+08:00</published><updated>2010-08-06T06:40:03.880+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual_Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='zh_TW'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Templates needs no "__dllspec"</title><summary type='text'>
同之前提到的, Visual C++ 要做 export/import symbol 的動作才能連結 dll, 但是 template classes 和 functions 是不需要的 ... 原因很單純, 就是 template 在 Visual C++ 是原地展開的, 不需要再額外做 symbol 的定義[?].
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/8384197288484227081/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2010/05/templates-needs-no-dllspec.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/8384197288484227081'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/8384197288484227081'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2010/05/templates-needs-no-dllspec.html' title='Templates needs no &quot;__dllspec&quot;'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-8237247336944304463</id><published>2010-04-02T17:41:00.004+08:00</published><updated>2011-01-15T16:51:49.283+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='CSIE'/><category scheme='http://www.blogger.com/atom/ns#' term='zh_TW'/><title type='text'>Converting literal</title><summary type='text'>
為了避免荒廢，來貼個廢文充數好了。
上一篇有提到 string literal 的問題，這是把文字轉成 hex 的 C 程式，不過要用 C99 去編譯才行。



#include &lt;stdio.h&gt;

int main() {
  for( char tmp[1024]; fgets( tmp, sizeof( tmp ), stdin ) != NULL; ) {
    for( unsigned char * c = tmp; *c; ++c ) {
      if( *c == '\n' ) {
        printf( "\n" );
      } else {
        printf( "\\x%02X", *c );
      }
    }
  }
  return 0;
}


</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/8237247336944304463/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2010/04/string-literal-hex-c-c99-include-int.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/8237247336944304463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/8237247336944304463'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2010/04/string-literal-hex-c-c99-include-int.html' title='Converting literal'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-3955156166455699715</id><published>2010-03-14T17:25:00.002+08:00</published><updated>2011-01-15T16:48:24.836+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='CSIE'/><category scheme='http://www.blogger.com/atom/ns#' term='zh_TW'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Using UTF-8 literals in source code</title><summary type='text'>
直接在 code 裡打 UTF-8 字元在有的 IDE 會無法辨識，像是 Visual C++ 2005 和 2008 堅持使用 locale 的編碼來解讀 source，導致換 locale 就會編譯失敗。
這種時候沒什麼有效的解決方法，就是用 hex escape 字元啦 ...

/* 正體中文 in UTF-8 */
const char * utf8 = "\xE6\xAD\xA3\xE9\xAB\x94\xE4\xB8\xAD\xE6\x96\x87";

很煩，很難讀，不過至少所有的字元都保證在 C / C++ 的標準字元集裡；只是最好在旁加上註解說明那應該是什麼字，否則很難維護。
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/3955156166455699715/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2010/03/using-utf-8-literals-in-source-code.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/3955156166455699715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/3955156166455699715'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2010/03/using-utf-8-literals-in-source-code.html' title='Using UTF-8 literals in source code'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-6596593950979139716</id><published>2010-03-12T16:02:00.001+08:00</published><updated>2010-08-06T06:40:03.885+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='CSIE'/><category scheme='http://www.blogger.com/atom/ns#' term='zh_TW'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Forward declaration with template parameters</title><summary type='text'>
[39.14] Why can't I put a forward-declared class in a std::vector&lt;&gt;? -- C++ FAQ Lite


在避免編譯時間拉長的時候，forward declaration 是個很好的選擇。但是有一些時候你無法使用 forward declaration，一個是該型別其實是個 typedef 的時候，另一個是當這個型別用在 template parameter 的時候。
由於 template class 經常是 inline 的，所以它可能在 header 就必須要知道 template parameter 的大小或成員這些細節。這導致你必須要 include definition 或是改用 pointer。
你說 smart pointer? 不會吧？（笑）
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/6596593950979139716/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2010/03/forward-declaration-with-template.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6596593950979139716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6596593950979139716'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2010/03/forward-declaration-with-template.html' title='Forward declaration with template parameters'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-2940239262951389103</id><published>2010-03-10T17:12:00.001+08:00</published><updated>2011-04-23T17:36:00.413+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CSIE'/><category scheme='http://www.blogger.com/atom/ns#' term='zh_TW'/><category scheme='http://www.blogger.com/atom/ns#' term='Qt'/><title type='text'>Export the symbols of QtSingleApplication</title><summary type='text'>
現在 Qt Solution 只能在 git 上取得了。
若想要編成 library，在 configure 參數加上 -library 即可：

configure -library
qmake
make # or nmake for MSVC

真正需要的 header 只有 QtSingleApplication, qtsingleapplication.h, qtcoresingleapplication.h。


The following content is obsolete. Latest update: 2011/04/23


Qt Solutions 的慣例似乎是把它內附的 pri include 到 qmake 的專案檔內，直接把原始檔包進去編譯，而不會做出封裝檔[?]。但是這種做法只適用於用 qmake 管理的專案檔內，且編譯時間可能會拉長。如果想弄出封裝檔，</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/2940239262951389103/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2010/03/export-symbols-of-qtsingleapplication.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/2940239262951389103'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/2940239262951389103'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2010/03/export-symbols-of-qtsingleapplication.html' title='Export the symbols of QtSingleApplication'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-6521350980497173223</id><published>2010-02-15T16:06:00.001+08:00</published><updated>2011-04-06T03:47:19.298+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IDE'/><category scheme='http://www.blogger.com/atom/ns#' term='CMake'/><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='CSIE'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual_Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='zh_TW'/><title type='text'>Create source groups in Visual C++ solutions with CMake</title><summary type='text'>
使用 qmake 時，Visual C++ 的方案會自動把產生的檔案(e.g.: ui_*.h, moc_*.cpp ... etc.)歸類到 Generated Files，讓原始碼樹看起來比較清爽。但是 CMake 不會幫你做這件事，專案一大就會讓這些不必修改的檔案佔滿整個專案。




但是 CMake 其實是可以做到的，使用 SOURCE_GROUP 巨集就可以建造一個群組，把原始碼組織起來。過濾的方式有二：使用 regular expression，或是直接指明檔案路徑。以下是範例。


# 明指 moc, rcc, uic, qm 檔案為 Generated Files
source_group("Generated Files" FILES ${MOC_SOURCES} ${RCC_RESOURCES} ${UIC_HEADERS} ${QM_FILES})
# 使用 </summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/6521350980497173223/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2010/02/create-source-groups-in-visual-c.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6521350980497173223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6521350980497173223'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2010/02/create-source-groups-in-visual-c.html' title='Create source groups in Visual C++ solutions with CMake'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-7264387400388694477</id><published>2010-02-13T11:30:00.000+08:00</published><updated>2010-08-06T06:40:03.891+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='IDE'/><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='CSIE'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual_Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='zh_TW'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Multiple processes building with Visual C++</title><summary type='text'>
/MP (Build with Multiple Processes) - MSDN
/MP (使用多處理序建置) - MSDN


MinGW32 的 make 好像還沒實作 --jobs 的功能 ... 反正各平台都有很多狗屁倒灶的鳥事啦。
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/7264387400388694477/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2010/02/multiple-processes-building-with-visual.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/7264387400388694477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/7264387400388694477'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2010/02/multiple-processes-building-with-visual.html' title='Multiple processes building with Visual C++'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-231480495827460717</id><published>2009-12-25T01:09:00.001+08:00</published><updated>2010-08-06T06:40:03.899+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GNU_Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='zh_TW'/><category scheme='http://www.blogger.com/atom/ns#' term='Debian'/><category scheme='http://www.blogger.com/atom/ns#' term='Kubuntu'/><title type='text'>Suspend USB devices (turn the power off)</title><summary type='text'>
昨天朋友問我把 USB 裝置停電的實際命令，Google 了一下找到了方法，筆記一下。



首先要知道你的 USB 裝置代號，可以在插入後使用 dmesg 查看[?]。例：

[ 8944.330557] usb 1-8: USB disconnect, address 8
[ 9023.580525] usb 1-8: new high speed USB device using ehci_hcd and address 9
[ 9023.714733] usb 1-8: New USB device found, idVendor=0b27, idProduct=0163
[ 9023.714737] usb 1-8: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 9023.714739] usb 1-8:</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/231480495827460717/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/12/suspend-usb-devices-turn-power-off.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/231480495827460717'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/231480495827460717'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/12/suspend-usb-devices-turn-power-off.html' title='Suspend USB devices (turn the power off)'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-8827319237127779463</id><published>2009-12-18T17:28:00.000+08:00</published><updated>2010-12-29T18:11:01.956+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GNU_Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Talk'/><category scheme='http://www.blogger.com/atom/ns#' term='CSIE'/><category scheme='http://www.blogger.com/atom/ns#' term='zh_TW'/><category scheme='http://www.blogger.com/atom/ns#' term='Debian'/><category scheme='http://www.blogger.com/atom/ns#' term='Kubuntu'/><title type='text'>Ubuntu 又被婊了</title><summary type='text'>
這陣子為了 CMake 嘗試轉用 KDevelop 做為開發平台，不過在其首頁上看到一個聳動的標題：Don’t install Ubuntu 9.10 if you want a stable KDevelop - apaku。究竟 Ubuntu 哪裡惹到 KDevelop 了呢？



原來是 Ubuntu 把 KDevelop 4 beta 5 放進 Karmic 的官方套件庫裡，導致 KDevelop 的 upstream 被一堆重複回報的 bug 淹沒，而且其中還有己在 beta 6 修正的 bug。
其實作者要抱怨的不是這堆實際上沒什麼用的 bug report，而是 Ubuntu 把尚未正式釋出的軟體放到正式釋出的套件庫裡。然後自動回報又設定成回報給 KDevelop upstream，而不是 Ubuntu 的 package maintainer，因此 upstream </summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/8827319237127779463/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/12/ubuntu.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/8827319237127779463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/8827319237127779463'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/12/ubuntu.html' title='Ubuntu 又被婊了'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-4119735096322549022</id><published>2009-12-11T00:00:00.004+08:00</published><updated>2010-08-06T06:40:03.903+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CMake'/><category scheme='http://www.blogger.com/atom/ns#' term='CSIE'/><category scheme='http://www.blogger.com/atom/ns#' term='zh_TW'/><category scheme='http://www.blogger.com/atom/ns#' term='Qt'/><title type='text'>CMake to QMake note</title><summary type='text'>
前幾天腦袋壞掉把手上的 Qt project 全換成 CMake，原因是 QMake 的功能實在是不太夠用。最糟糕的一點是建置的彈性太差，你很難在 qmake 的執行選項裡更改專案的設定，通常你要直接修改 *.pro files。然後是它的 install 和設定相依性的能力也很差，跟前述的問題一樣，都是寫死的。
CMake 做為一個建置系統（應該說前端）就還算是優秀，對於相依性的處理可以自己寫一套 script 來自動設定，找不到也可以讓使用者手動設定，雖然有些聲音認為 pkg-config 的方式較為方便，但是畢竟在 Windows(Mac 我不確定) 上這東西是不流行的，而且也不是每個專案都有附上 *.pc 設定。
以下是我從 QMake 到 CMake 轉換的對應處理：




前置動作

find_package(Qt4 REQUIRED)
include(${</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/4119735096322549022/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/12/cmake-to-qmake-note.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4119735096322549022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4119735096322549022'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/12/cmake-to-qmake-note.html' title='CMake to QMake note'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-6298577270077532312</id><published>2009-11-29T00:46:00.003+08:00</published><updated>2010-08-06T06:40:03.905+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='CSIE'/><category scheme='http://www.blogger.com/atom/ns#' term='zh_TW'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Array IS NOT pointer</title><summary type='text'>
呣，其實我大一的時候也有這種觀念，畢竟那時 pointer 還是個陌生的怪物，那還是個「如果你不會傳 array 就宣告成 global」的時代。
基本上 C 的 array 實在不怎麼討喜，包括它的「陣列大小一定要跟在陣列名稱後面」這種鳥語法，如果再加上 function pointer 那可真是醜斃了。之所以 array 經常和 pointer 混為一談，最大的原因應是 array 會被隱式轉型[?]為 pointer，且 array 變數本身的值就是 array 第一個元素的位址。這讓你可以把陣列丟入如下的函式裡：

void f1( const int * array );

呃，那二維陣列呢？

void f2( const int * * const array );

因為並不存在多維陣列對 pointer 的隱式轉換，因此你無法直接丟進去。




接下來要談談 </summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/6298577270077532312/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/11/array-is-not-pointer.html#comment-form' title='7 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6298577270077532312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6298577270077532312'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/11/array-is-not-pointer.html' title='Array IS NOT pointer'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-2051112336723476347</id><published>2009-11-21T15:09:00.001+08:00</published><updated>2010-08-06T06:40:03.908+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='靠北文'/><category scheme='http://www.blogger.com/atom/ns#' term='IDE'/><category scheme='http://www.blogger.com/atom/ns#' term='CSIE'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual_Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='zh_TW'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Visual C++ Express Edition does not support x64 toolchain</title><summary type='text'>
Visual C++ Editions - MSDN


純筆記
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/2051112336723476347/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/11/visual-c-express-edition-does-not.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/2051112336723476347'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/2051112336723476347'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/11/visual-c-express-edition-does-not.html' title='Visual C++ Express Edition does not support x64 toolchain'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-1456827876174888605</id><published>2009-11-18T17:34:00.006+08:00</published><updated>2010-12-29T18:11:01.957+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='靠北文'/><category scheme='http://www.blogger.com/atom/ns#' term='Talk'/><category scheme='http://www.blogger.com/atom/ns#' term='zh_TW'/><title type='text'>我不喜歡的問題</title><summary type='text'>



由於本篇是純粹的靠北文，如果以下內容你看到覺得我很靠北，可以跟我靠北沒關係。
如果你還沒看過提問的智慧，強烈推薦先看過再往下看。




第一個要說的是，在標題打上「急」之類的字眼：

[問題] XXX 不能用　急！！！！

內文如果打「如題」或「餓死抬頭」的更慘，基本上不會有人理你。你的時間是時間，別人的時間也是時間，用這種倉促的標題會讓人感覺你在催促答案，知道答案的人很可能不想淌混水。講白一點，你急不急其實對其他人來說一點關係也沒有，反而會讓人覺得你「沒有誠意，就只是個要答案的」。


然後是那種會在內文最後寫上「請詳細說明，有附圖文最好」之類的問題。大部分的人看到這個附註都會停下腳步，回頭看看有沒有其他可以回答的問題。基本上這就是要人做白工幫你抓圖幫你上傳還要打個幾百字讓你看到懂。換做是你，你要嗎？


上面還有一種變形，就是加上「我是新手」或是「我很笨」之類的附註。</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/1456827876174888605/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/11/blog-post.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/1456827876174888605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/1456827876174888605'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/11/blog-post.html' title='我不喜歡的問題'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-5007623607150924930</id><published>2009-11-16T20:57:00.002+08:00</published><updated>2010-08-06T06:40:03.912+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='zh_TW'/><category scheme='http://www.blogger.com/atom/ns#' term='Khopper'/><category scheme='http://www.blogger.com/atom/ns#' term='FoolproofProject'/><category scheme='http://www.blogger.com/atom/ns#' term='Qt'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Khopper v0.2.3 released</title><summary type='text'>
Menual
Downloads



修正 flac 在檔案結尾處可能引發無窮迴圈的問題
修正 flac 沒有 seektable 的問題
修正 ogg 的寫入問題
修正 mp3 vbr 的編碼問題，現在可以正確抓到長度了
修正部分資訊讀取錯誤的問題

</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/5007623607150924930/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/11/khopper-v023-released.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/5007623607150924930'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/5007623607150924930'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/11/khopper-v023-released.html' title='Khopper v0.2.3 released'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-6279327685125183951</id><published>2009-11-12T13:46:00.000+08:00</published><updated>2010-08-06T06:40:03.914+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GNU_Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='zh_TW'/><title type='text'>X input device setting</title><summary type='text'>
KDE4 synaptics horizontal scroll


原本在找 Kubuntu 9.10 上如何控制觸控版的解法，意外找到這個好像很好用的設定工具。



首先 xinput list 會列出所有己和 X server 連接上的裝置，找出你要設定的裝置，看它的 id，之後用 xinput list-props id 來列出所有可設定的屬性。注意每個屬性的格式都像是：

簡短說明 (屬性 id): 屬性值

找到你想設定的屬性 id，就可以開始改：

xinput set-int-prop 裝置id 屬性id 8 屬性值（空白分隔）

其中的 8 指的是整數長度。

</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/6279327685125183951/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/11/x-input-device-setting.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6279327685125183951'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6279327685125183951'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/11/x-input-device-setting.html' title='X input device setting'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-6953030987090693952</id><published>2009-11-11T21:50:00.000+08:00</published><updated>2010-08-06T06:40:03.916+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CSIE'/><category scheme='http://www.blogger.com/atom/ns#' term='zh_TW'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Casting function pointers from void * in C++</title><summary type='text'>
Function pointers casting in C++


在拿 DLL 裡的 symbol 時，它會回傳一個 void *，你必須要自己轉型成對應的 function pointer。不過問題是 C++98/03 都把 void * 視為指向某個物件的指標，而不會是一個 function pointer，所以使用 C++ style 轉型會失敗；既然標準沒有定義，就代表這種行為基本上是依賴實作的，為此我們需要一些怪怪的 reinterpret_cast。



作法一，先轉成指標長度的整數，再轉成函式指標。

void * gptr = dlsym( ... );
typedef void ( * fptr )();
fptr my_fptr = reinterpret_cast&lt; fptr &gt;( reinterpret_cast&lt; intptr_t &gt;( gptr ) )</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/6953030987090693952/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/11/casting-function-pointers-from-void-in.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6953030987090693952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6953030987090693952'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/11/casting-function-pointers-from-void-in.html' title='Casting function pointers from void * in C++'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-2895428186219377908</id><published>2009-11-09T21:12:00.001+08:00</published><updated>2010-12-29T18:11:01.959+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='靠北文'/><category scheme='http://www.blogger.com/atom/ns#' term='Talk'/><category scheme='http://www.blogger.com/atom/ns#' term='CSIE'/><category scheme='http://www.blogger.com/atom/ns#' term='zh_TW'/><title type='text'>不 try 一下怎麼會知道呢</title><summary type='text'>

最近用自己定出的編碼器介面寫外掛時, 才發現原本定的介面怪怪的。


首先是 hook 的呼叫順序。由於 libav* 是先開完檔再呼叫寫入 header 的函式，因此我也讓 openResource 在 writeHeader 之前先呼叫。但是其他的編碼器並不一定是這個順序，其實有的根本就沒有分 setupEncoder 和 setupMuxer 的步驟。反正我也沒有檢查每個 hook 要做什麼事，也不可能檢查 ... 所以這倒是沒什麼關係。


第二個問題是我在抽象類別上有定義 buffer 機制，原本是希望可以減輕具象類別的負擔，沒想到現在用起來覺得有點累贅，多了不必要的介面操作。這部分需要在 0.3 修正。


最嚴重的問題是，編碼器似乎不太需要動態載入外掛，應該說不需要和操作它的圖形介面分開發佈。原本的用意是希望降低耦合度，並且讓其他的外掛也有機會使用它，</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/2895428186219377908/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/11/try.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/2895428186219377908'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/2895428186219377908'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/11/try.html' title='不 try 一下怎麼會知道呢'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-3680467162113050907</id><published>2009-11-05T12:34:00.000+08:00</published><updated>2010-08-06T06:40:03.920+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='zh_TW'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>A way to use C++ object in C callback</title><summary type='text'>
前幾天在用 libFLAC 的時候[?]，它要求 client 註冊一個 callback 給它，prototype 長這樣：

typedef FLAC__StreamDecoderWriteStatus
(* FLAC__StreamDecoderWriteCallback)
(const FLAC__StreamDecoder *decoder,
const FLAC__Frame *frame,
const FLAC__int32 *const buffer[],
void *client_data);

看起來很複雜，其實不會，就是個 function pointer 的 typedef 而己[?]。
可以看到最後一個 void * client_data 是用來接受 client 的資料用的，先接 void * 再轉成自己要的型別，算是 C 的老手法了。




Well,</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/3680467162113050907/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/11/way-to-use-c-object-in-c-callback.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/3680467162113050907'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/3680467162113050907'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/11/way-to-use-c-object-in-c-callback.html' title='A way to use C++ object in C callback'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-4097101354991787209</id><published>2009-11-03T11:00:00.001+08:00</published><updated>2010-08-06T06:40:03.923+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GNU_Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='zh_TW'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='FFmpeg'/><category scheme='http://www.blogger.com/atom/ns#' term='Khopper'/><category scheme='http://www.blogger.com/atom/ns#' term='FoolproofProject'/><category scheme='http://www.blogger.com/atom/ns#' term='Debian'/><category scheme='http://www.blogger.com/atom/ns#' term='Qt'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><category scheme='http://www.blogger.com/atom/ns#' term='Kubuntu'/><title type='text'>Khopper v0.2.2 released</title><summary type='text'>
下載頁(win32,Ubuntu,Debian)
說明頁


Changes:

修正 flac 的解碼問題
新增 mp3 cbr 192 bps 的選項
修正部分環境的編譯問題




看起來很少，可是花了我不少時間在 trace 別人的 code ....

</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/4097101354991787209/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/11/khopper-v022-released.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4097101354991787209'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4097101354991787209'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/11/khopper-v022-released.html' title='Khopper v0.2.2 released'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-7036125261737339602</id><published>2009-10-30T14:52:00.001+08:00</published><updated>2010-12-29T18:11:01.961+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='靠北文'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Talk'/><category scheme='http://www.blogger.com/atom/ns#' term='CSIE'/><category scheme='http://www.blogger.com/atom/ns#' term='zh_TW'/><category scheme='http://www.blogger.com/atom/ns#' term='FFmpeg'/><category scheme='http://www.blogger.com/atom/ns#' term='Qt'/><title type='text'>Framework 終究只是 Framework</title><summary type='text'>
最近這個禮拜的 debug 過程又讓我深刻地體會到這點。
從以前到現在我遇到的問題：

Qt Phonon 的 SeekSlider 沒有訂製點，所以我幹了一個自己的
Qt Webkit 沒有 DOM 的存取方法（不過已在 4.6 加入）
Java 的 ZipEntry 不支援 unicode
FFmpeg 可以編 MP3 VBR，但是沒有寫 VBR 用的 header (I dont think we write the optional vbr tag, so its not a bug. by michaelni)
FFmpeg 不能 seek FLAC，解碼出來的時間點也都是垃圾

其他還有很多臨時沒想到的。Framework 只會讓你有機會省一點時間，但是不代表你可以完全依賴它。就跟學了 jQuery 就以為自己懂 AJAX，或是學 Java 就以為不用搞懂指標，</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/7036125261737339602/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/10/framework-framework.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/7036125261737339602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/7036125261737339602'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/10/framework-framework.html' title='Framework 終究只是 Framework'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-6006791680090875312</id><published>2009-10-28T15:34:00.004+08:00</published><updated>2010-08-06T06:40:03.927+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='PicKing'/><category scheme='http://www.blogger.com/atom/ns#' term='zh_TW'/><category scheme='http://www.blogger.com/atom/ns#' term='FoolproofProject'/><title type='text'>PicKing 0.2.1 released</title><summary type='text'>
Jar Download
Repository


Changes:

增加匯出 K3B 清單功能
部分 GUI 改進
獨立檔案庫




說明:
按下 Export to K3B [!]後，就會把大於 4000 MB 的結果匯出至指定資料夾。可以直接用 K3B 開來燒錄。大於多少可以在 Preference 裡調整。或是直接在想要的結果上按右鍵，也可以無視該項設定直接匯出。


Snapshot:


</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/6006791680090875312/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/10/picking-020-released.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6006791680090875312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6006791680090875312'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/10/picking-020-released.html' title='PicKing 0.2.1 released'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_P18gL4LLTKQ/SufzobwcIlI/AAAAAAAAAUo/3yeEPFP59Xg/s72-c/packing1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-8096902749948048451</id><published>2009-10-14T14:41:00.001+08:00</published><updated>2010-08-06T06:40:03.929+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='KomiX'/><category scheme='http://www.blogger.com/atom/ns#' term='zh_TW'/><category scheme='http://www.blogger.com/atom/ns#' term='FoolproofProject'/><category scheme='http://www.blogger.com/atom/ns#' term='Qt'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>KomiX v0.1.0 released</title><summary type='text'>
Source download
Win32 binary download



增加壓縮檔支援（需安裝 7-Zip）
增加逆向移動
Ctrl+滑鼠滾輪可縮放
增加捲動速度調整選項

</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/8096902749948048451/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/10/komix-v010-released.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/8096902749948048451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/8096902749948048451'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/10/komix-v010-released.html' title='KomiX v0.1.0 released'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-1687976547846206112</id><published>2009-10-13T15:32:00.000+08:00</published><updated>2010-08-06T06:40:03.931+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IDE'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual_Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='zh_TW'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='Qt'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Compile Qt 4.5 for Visual Studio, using your multi-core processor</title><summary type='text'>
Compile Qt 4.5 for Visual Studio, using your multi-core processor


Because nmake doesn't support parallel building.
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/1687976547846206112/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/10/compile-qt-45-for-visual-studio-using.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/1687976547846206112'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/1687976547846206112'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/10/compile-qt-45-for-visual-studio-using.html' title='Compile Qt 4.5 for Visual Studio, using your multi-core processor'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-7835239231228137486</id><published>2009-10-07T23:15:00.000+08:00</published><updated>2009-10-07T23:15:19.256+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GNU_Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='en_US'/><category scheme='http://www.blogger.com/atom/ns#' term='VirtualBox'/><category scheme='http://www.blogger.com/atom/ns#' term='Debian'/><title type='text'>Mount any VBox-compatible disk image on the host</title><summary type='text'>
HOWTO: Mount any VBox-compatible disk image on the host






If you encountered this message while building:

.: 32: Can't open /etc/vbox/vbox.cfg

You should add this line

INSTALL_DIR=/usr/lib/virtualbox

to the building script.


If you encountered fuse mount option error while executing, you should patch the source code:

- fuse_opt_add_arg (&amp;fuseArgs, "");
+ fuse_opt_add_arg (&amp;fuseArgs, "</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/7835239231228137486/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/10/mount-any-vbox-compatible-disk-image-on.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/7835239231228137486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/7835239231228137486'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/10/mount-any-vbox-compatible-disk-image-on.html' title='Mount any VBox-compatible disk image on the host'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-679014260352532016</id><published>2009-10-04T04:44:00.001+08:00</published><updated>2009-10-04T13:00:51.670+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GNU_Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Debian'/><category scheme='http://www.blogger.com/atom/ns#' term='Kubuntu'/><title type='text'>Fix the bitmap render of wqy-zenhei</title><summary type='text'>

如果你的文泉驛正黑在升級之後某個 range[?] 的字型變成點陣字，可以用如下方法修正：

# rm /etc/fonts/conf.d/66-wqy-zenhei-sharp.conf

放心，它是個 symbolic link，日後有需要再從 /etc/fonts/conf.avail/66-wqy-zenhei-sharp.conf link 回來就好。


原因？我也不知道，因為 66-wqy-zenhei-sharp.conf 設定的是 12~16 的範圍，不知道為什麼會影響到 8~11 ... 可能是 fontconfig 的 bug 吧。

</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/679014260352532016/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/10/fix-bitmap-render-of-wqy-zenhei.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/679014260352532016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/679014260352532016'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/10/fix-bitmap-render-of-wqy-zenhei.html' title='Fix the bitmap render of wqy-zenhei'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-4550752264749611501</id><published>2009-10-02T14:55:00.003+08:00</published><updated>2009-10-06T14:24:29.750+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='KDE'/><title type='text'>Brief of some KDE4 application, again</title><summary type='text'>
這是繼上次 Brief of some KDE4 application 的更新版，對應 KDE4.3。


Amarok 2.2
評價：二

介面有變漂亮了 ... 這有差嗎？（摔貼紙）
勉強給你加一分，快點把 iPod 的 playlist 做回來啦！

Choqok 1.0
評價：四

目前用起來最順手的 Twitter client。之前的版本會讓 KNotifier 佔滿資源，新版就不會了。

K3B 1.66
評價：二

勉強可以燒東西，但是 bug 一堆。看在是 alpha 的份上就不多說什麼，不過開發進度真的很慢。

Konqueror 4
評價：一

不知所謂的東西。一堆網站不能完整支援，莫名其妙的崩潰，奇異的 wordwrap，還有很多，而且完全沒有改善的跡象。做為一個桌面環境的預設瀏覽器真的很悲哀。

KNetworkManager
評價：三

經歷了三個 </summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/4550752264749611501/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/10/brief-fo-some-kde4-application-again.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4550752264749611501'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4550752264749611501'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/10/brief-fo-some-kde4-application-again.html' title='Brief of some KDE4 application, again'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-709474533612624309</id><published>2009-09-29T16:11:00.000+08:00</published><updated>2010-12-29T18:11:01.962+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Talk'/><title type='text'>爆了</title><summary type='text'>
部落格觀察的貼紙爆了。
我不知道是怎麼回事，也不是很在意。基本上那個 widget 是載入最慢的 widget，我只不過是想把它改成 onload 之後再載入到 DOM，失敗之後 rollback，就變這樣了。
我還是認為 HTML 要有個 post 的機制，讓整個文件 layout 出來之後再載入外部文件。這是為什麼 img 標籤希望你指定圖片的寬高，因為不指定的話就要等圖片載入才能知道大小，然後文件就要重新 render，然後你在看的文件內容就會一直改變位置。
不過這樣就沒計數器了，其實我對排名不是很在意。自己寫一個好像也還好，不過有點麻煩。
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/709474533612624309/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/09/blog-post.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/709474533612624309'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/709474533612624309'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/09/blog-post.html' title='爆了'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-6888711674200387626</id><published>2009-09-18T00:19:00.005+08:00</published><updated>2009-09-18T09:22:52.964+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='戲言'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>如何讓你的程式更難理解(5)</title><summary type='text'>
int uglystrieq( const char * l, const char * r ) {
    while(*l&amp;&amp;*r&amp;&amp;(*l++|32)==(*r++|32));return *l--||*r--||(*l|32)!=(*r|32);
}


Compare the equivalence of two strings. Case insensitive.
[Edit]
This implementation while crash when passing a 0-lengthed string. Another version:


int _(const char*l,const char*O) {
    return ((*l|32)-(*O|32))?1:*l?_(l+1,O+1):0;
}
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/6888711674200387626/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/09/5.html#comment-form' title='3 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6888711674200387626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6888711674200387626'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/09/5.html' title='如何讓你的程式更難理解(5)'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-5663922574020140048</id><published>2009-09-13T01:09:00.002+08:00</published><updated>2009-09-13T01:19:23.909+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GNU_Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='en_US'/><category scheme='http://www.blogger.com/atom/ns#' term='CSIE'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='VirtualBox'/><title type='text'>Install Windows XP on VirtualBox with SATA support</title><summary type='text'>
How to install Windows 2000/XP/2003 guests with SATA support


Briefly in Windows XP:

Download the drivers from Intel

Extract the archive:

Windows: Just extract it. You will get an floppy image named F32.IMA
Linux: Because of it is a self-extract archive, you can use unzip or p7zip to extract f6flpy32.exe and can still get F32.IMA


Mount the floppy image. No bother to use a real floppy.
In </summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/5663922574020140048/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/09/install-windows-xp-on-virtualbox-with.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/5663922574020140048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/5663922574020140048'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/09/install-windows-xp-on-virtualbox-with.html' title='Install Windows XP on VirtualBox with SATA support'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-6724378619543239735</id><published>2009-09-11T15:57:00.000+08:00</published><updated>2009-09-11T15:57:38.755+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GNU_Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='en_US'/><category scheme='http://www.blogger.com/atom/ns#' term='CSIE'/><category scheme='http://www.blogger.com/atom/ns#' term='Debian'/><category scheme='http://www.blogger.com/atom/ns#' term='Opera'/><title type='text'>Packages in Opera's FTP repository</title><summary type='text'>
Opera FTP


There is a deb repository that provides apt service. But packages in that one are still depends on Qt3. Packages which are built with Qt4 are only avaliable in FTP repository. Weird Opera.
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/6724378619543239735/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/09/packages-in-operas-ftp-repository.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6724378619543239735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6724378619543239735'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/09/packages-in-operas-ftp-repository.html' title='Packages in Opera&apos;s FTP repository'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-265306839771077877</id><published>2009-09-01T00:46:00.006+08:00</published><updated>2010-08-06T06:34:09.778+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Shell_Script'/><category scheme='http://www.blogger.com/atom/ns#' term='GNU_Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='en_US'/><title type='text'>Pitfalls in shell scripts</title><summary type='text'>
When you iterate paths and do something with them, you might be tempted write this:
find . -name blah | xargs rm -f

yeah, I know there is a switch -exec in find, I just don't like it.
This command looks fine, but has two problems:

The length of arguments maybe exceeds the limit of the shell. 
The file path may contains some special characters, such like quotes, spaces. 





To solve the first</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/265306839771077877/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/09/pitfalls-in-shell-scripts.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/265306839771077877'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/265306839771077877'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/09/pitfalls-in-shell-scripts.html' title='Pitfalls in shell scripts'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-8210741117956422916</id><published>2009-08-27T21:16:00.002+08:00</published><updated>2009-10-06T14:27:03.888+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GNU_Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='en_US'/><category scheme='http://www.blogger.com/atom/ns#' term='Debian'/><title type='text'>Enable frame buffer in grub2</title><summary type='text'>
With legacy grub, if you want to enable frame buffer built in kernel, the option "vga=xxx" is needed in boot command.
However, grub2 provides a newer way to enable the feature. You should set gfxpayload=1280x1024x32, and insmod vbe manually if needed.
So where to add? I write it to /etc/grub.d/40_custom, as it is an user custom hook script.

cat &lt;&lt;EOF
insmod vbe
set gfxpayload=1280x1024x32
EOF

</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/8210741117956422916/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/08/enable-frame-buffer-in-grub2.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/8210741117956422916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/8210741117956422916'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/08/enable-frame-buffer-in-grub2.html' title='Enable frame buffer in grub2'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-5398868873147856773</id><published>2009-08-23T18:36:00.003+08:00</published><updated>2009-09-13T01:11:49.966+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GNU_Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='en_US'/><category scheme='http://www.blogger.com/atom/ns#' term='VirtualBox'/><category scheme='http://www.blogger.com/atom/ns#' term='Debian'/><title type='text'>Get USB working in Virtualbox under Debian</title><summary type='text'>
Get USB working in Virtualbox under Debian and Ubuntu - jeremy's blog


And do this:

# mount -a

Then you can use USB devices in virtual machines. Of course the Guest Addtions is required.
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/5398868873147856773/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/08/get-usb-working-in-virtualbox-under.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/5398868873147856773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/5398868873147856773'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/08/get-usb-working-in-virtualbox-under.html' title='Get USB working in Virtualbox under Debian'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-2129349528841378594</id><published>2009-08-20T12:07:00.003+08:00</published><updated>2011-04-01T22:06:28.277+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CSIE'/><category scheme='http://www.blogger.com/atom/ns#' term='Design_Pattern'/><title type='text'>Overview of Observer Pattern</title><summary type='text'>
如果想要讓某物件在「發生某事」時通知另一個物件「做某事」，那麼我們會使用 Observer Pattern 來實現。簡單的做法是：

class Sender {
    +__new__() {
        this.listener = []
    }
    +somethingHappend() {
        this.listener.each( lambda( l ) {
            l.refresh( arguments )
        } )
    }
    +addListener( that ) {
        this.listener.append( that )
    }
    -trigger() {
        this.somethingHappend()
    }
}
class Receiver {
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/2129349528841378594/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/08/overview-of-observer-pattern.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/2129349528841378594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/2129349528841378594'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/08/overview-of-observer-pattern.html' title='Overview of Observer Pattern'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-3925841437806031972</id><published>2009-08-13T13:20:00.001+08:00</published><updated>2009-08-14T13:41:39.377+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GNU_Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='en_US'/><category scheme='http://www.blogger.com/atom/ns#' term='Debian'/><category scheme='http://www.blogger.com/atom/ns#' term='Kubuntu'/><title type='text'>Resolve the BADSIG problem when updating apt list</title><summary type='text'>
I recently encounter an update problem during updating sources list:

W: GPG error: SOURCE Release: The following signatures were invalid: BADSIG KEY SENDER

I have no idea how this happened, but have fixed this. First I tried this:

# apt-get clean
# cd /var/lib/apt
# mv lists lists.old
# mkdir -p lists/partial
# apt-get clean
# apt-get update

Well, but no use. So I tried another way:

# </summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/3925841437806031972/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/08/resolve-badsig-problem-when-updating.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/3925841437806031972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/3925841437806031972'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/08/resolve-badsig-problem-when-updating.html' title='Resolve the BADSIG problem when updating apt list'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-2062119186642786348</id><published>2009-08-02T17:42:00.006+08:00</published><updated>2009-08-03T03:11:10.290+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='PicKing'/><category scheme='http://www.blogger.com/atom/ns#' term='FoolproofProject'/><title type='text'>PicKing 0.1.0 released</title><summary type='text'>
下載 jar
原始碼
Licinse: LGPLv3 or later
System require: JRE 6.0


用來挑選能夠塞進指定大小的最多檔案或資料夾。我主要在大量備份時使用。






如上圖，左邊是檔案系統，中間是該資料夾底下的內容，選好之後點 start 就會開始作業，花的時間要看選擇的數量，50 個項目大約會花好幾秒；結果會顯示在右邊。
左下角是設定檔案大小上限，預設是 4483MB，也就是一片 DVD 的容量。
按 F5 可以重新整理檔案系統，比方說你可能多新增一個資料夾或插上新硬碟，可以用來更新。
Ctrl+S 可以儲存跑出來的結果。



備註：
十六個項目以內會使用暴力演算法，跑得出全域最佳解，但是時間和空間複雜度皆是O(2^N)。超過十六個項目則會使用基因演算法，會收斂在局部最佳解，不保證是全域最佳解，但是速度很快。</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/2062119186642786348/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/08/picking-010-released.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/2062119186642786348'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/2062119186642786348'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/08/picking-010-released.html' title='PicKing 0.1.0 released'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_P18gL4LLTKQ/SnVZjbuxBBI/AAAAAAAAATc/cqBoFPOf1ug/s72-c/packing.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-684397306782338100</id><published>2009-08-01T16:03:00.002+08:00</published><updated>2009-08-01T16:18:14.506+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>C++ 的多緒安全性</title><summary type='text'>
《C++0x漫谈》系列之：多线程内存模型


簡單的說，因為標準給編譯器優化的限度太寬鬆，導致編譯器可以很大程度地調換指令的順序，因此 critical section 也有可能無法完全包好。不少人以為 volatile 可以禁止優化，從而確保正確順序，但其實它只保證單緒的順序，多緒的狀況還是無法保證；連鬼才 Andrei Alexandrescu 都在他的神作 Morden C++ Design 裡犯了這個錯誤（我也不認為他示範的 Singleton 真的有 thread-safe）。
也許等 C++0x（呃，可能會變成 C++1X） 釋出之後，可以帶給我們更複雜的 C++ 吧。XD
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/684397306782338100/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/08/c.html#comment-form' title='3 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/684397306782338100'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/684397306782338100'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/08/c.html' title='C++ 的多緒安全性'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-5144174328146679324</id><published>2009-08-01T14:53:00.003+08:00</published><updated>2009-08-01T15:37:20.848+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ACG'/><title type='text'>Demogorgon 還真的滿強的</title><summary type='text'>
剛剛心血來潮查了一下 Bordur's Gate II 裡 Demogorgon 的資料，發現還真是超出規格的強：

Level25
Class惡魔
Party叛逆邪惡
力量25
敏捷20
體質22
智力22
智慧22
魅力18
HP290
防禦等級-17
THAC0-19
攻擊次數5
抗魔90
物理10
火100
電100
冰50
特殊能力攻擊附疾病和等級吸取效果
特殊能力免疫盲目以外的不利狀態
特殊能力會不停地招喚惡魔助陣
特殊能力HP的回復速度很快





對沒什麼概念的朋友解釋一下好了。在 TOB 釋出的當時，傳奇的大法師伊爾明斯特的等級也才 29 ，25 級算是相當高的等級，一般傭兵隊有個七到八級就很強了，崔斯特也才十二到十四級。
六個屬性最大值是 25，普通人約在 10 左右，18 可以說是強者中的強者，也算是天生的極限，可是這傢伙竟然只有魅力是在 20 以下。
生命值 </summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/5144174328146679324/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/08/demogorgon.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/5144174328146679324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/5144174328146679324'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/08/demogorgon.html' title='Demogorgon 還真的滿強的'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-8084383350590019547</id><published>2009-07-28T20:40:00.000+08:00</published><updated>2009-07-28T20:40:37.317+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='en_US'/><title type='text'>Remove a range from java.util.Vector</title><summary type='text'>
There is a method removeRange in AbstractList class, somehow it is protected.
So, if you want to remove a range from a Vector, use subList(which is come from List) instead:

v.subList( 0, 12 ).clear();

The subList method returns a view(or a snapshot) instead of a copy to manipulates original container.
So if you want to do any operation in specific range, use subList.
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/8084383350590019547/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/07/remove-range-from-javautilvector.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/8084383350590019547'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/8084383350590019547'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/07/remove-range-from-javautilvector.html' title='Remove a range from java.util.Vector'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-2184710441364606535</id><published>2009-07-27T12:40:00.000+08:00</published><updated>2009-07-27T12:40:23.742+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='KDE'/><category scheme='http://www.blogger.com/atom/ns#' term='GNU_Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='en_US'/><title type='text'>Mount device on Debian</title><summary type='text'>
PolicyKit (and KDE), Navit and more - CAFEHACK GROUP


If you can't mount NTFS devices on KDE4, this may help.
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/2184710441364606535/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/07/mount-device-on-debian.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/2184710441364606535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/2184710441364606535'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/07/mount-device-on-debian.html' title='Mount device on Debian'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-8187172003165290220</id><published>2009-07-02T10:52:00.002+08:00</published><updated>2009-07-02T11:00:01.272+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GNU_Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='en_US'/><category scheme='http://www.blogger.com/atom/ns#' term='Debian'/><title type='text'>Do not install or upgrade ia32-apt-get</title><summary type='text'>
ia32-libs on 64-bit


ia32-apt-get just breaks your apt repository, it will screw up your package list. So don't upgrade ia32-libs from 2.7 to newer version until it DO fix this mess.
I don't know how can it upload to unstable ... it is just **HORRIBLE**!
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/8187172003165290220/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/07/do-not-install-or-upgrade-ia32-apt-get.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/8187172003165290220'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/8187172003165290220'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/07/do-not-install-or-upgrade-ia32-apt-get.html' title='Do not install or upgrade ia32-apt-get'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-1640236561563731136</id><published>2009-06-28T19:32:00.000+08:00</published><updated>2009-06-28T19:32:22.868+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Qt'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>QtWebkit plus jQuery</title><summary type='text'>
Fancy Browser - Qt Example


新的 Qt 4.5.2 多了一個範例描述如何在 QtWebkit 配合 jQuery 使用。是時候來研究一下了。
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/1640236561563731136/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/06/qtwebkit-plus-jquery.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/1640236561563731136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/1640236561563731136'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/06/qtwebkit-plus-jquery.html' title='QtWebkit plus jQuery'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-6087400912806932519</id><published>2009-06-22T15:06:00.001+08:00</published><updated>2009-06-22T15:07:36.276+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><title type='text'>如何讓你的程式更難理解(4)</title><summary type='text'>
// unique values
var c = [];
// random shuffled keys
var rsk = [];
( function( functor ) {
    jQuery.each( tags, function( key, value ) {
        // random shuffle or just copy. tags -&gt; rsk
        functor( key );
        // unique array to c
        if( jQuery.inArray( value, c ) &lt; 0 ) {
            c.push( value );
        }
    } );
} )( Blog.TagCloud.shuffle ? function( key ) {
    </summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/6087400912806932519/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/06/4.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6087400912806932519'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6087400912806932519'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/06/4.html' title='如何讓你的程式更難理解(4)'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-8647814624284894587</id><published>2009-06-20T01:25:00.000+08:00</published><updated>2009-06-20T01:25:18.194+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GNU_Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Debian'/><title type='text'>Multiboot using Grub2</title><summary type='text'>
最近跟著潮流(?)改成 grub2 做為開機管理程式，但是在我升級之後，它沒抓到存在我電腦裡的另一個作業系統。解決方法很簡單，安裝 os-prober 套件，再重新設定一次 grub2 就好。

# aptitude install os-prober
# dpkg-reconfigure grub-pc

第二步會出現選擇 grub 要安裝的硬碟，選 /boot 掛的那顆就好；這樣它就會自動抓到其他的開機區段了。


os-prober 是 grub-pc 的 Suggest 套件，個人認為應該提上 Recommend 才對的。
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/8647814624284894587/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/06/multiboot-using-grub2.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/8647814624284894587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/8647814624284894587'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/06/multiboot-using-grub2.html' title='Multiboot using Grub2'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-916811728052939851</id><published>2009-06-16T22:04:00.003+08:00</published><updated>2010-12-29T18:11:01.963+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Talk'/><title type='text'>仰角 10 度</title><summary type='text'>
昨天心血來潮問了強者我朋友一些物理問題，中間有提到飛車躍懸崖的狀況。剛剛算了一下這難度有多高。




環境：
假設飛躍的起點和終點高度相同，由於車子在飛出去之後，垂直方向是自由落體，水平方向是等速位移（沒有地面無法施力，故無水平加速度，阻力亦不計），設 Xy 為落下高度，Xx 為水平位移量。


公式：
自由落體：
Xy = 0.5 * g * ( t ^ 2 )，g 為重力常數(m/s^2)，t 為經過秒數(s)
平均速度：
v = Xx / t，t 為秒數(s)，v 為速度(m/s)
可得出：
v = Xx / ( 2 * Xy / g ) ^ 0.5



假設落下高度最大容許到 20cm（考慮輪胎的高度，否則會撞上平台），水平距離 10m，那衝出去的瞬間速度要大於 178 km/hr；這其實也不是不可能的車速，但是電影通常不會飛這麼保守的距離，起碼 20m 起跳吧，</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/916811728052939851/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/06/10.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/916811728052939851'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/916811728052939851'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/06/10.html' title='仰角 10 度'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-3770293804673918040</id><published>2009-06-08T02:47:00.001+08:00</published><updated>2009-09-13T01:12:06.185+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CSIE'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='VirtualBox'/><title type='text'>Uninstall VirtualBox 2.2.0 under Vista</title><summary type='text'>
Ticket #3701 (closed defect: fixed)


在 2.2.2 之後已修正的 bug，原本會造成 Vista 無法移除 VirtualBox。
中文解法：

打開 regedit.exe
找到 HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\DIFxApp\Components
按右鍵匯出，存到某個檔案
編輯該檔案，把所有的 HKEY_CURRENT_USER 代換成 HKEY_LOCAL_MACHINE
匯入修改後的登錄檔

做完就可以正常移除了。似乎是登錄檔沒弄好。
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/3770293804673918040/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/06/uninstall-virtualbox-220-under-vista.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/3770293804673918040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/3770293804673918040'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/06/uninstall-virtualbox-220-under-vista.html' title='Uninstall VirtualBox 2.2.0 under Vista'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-8197927538703239087</id><published>2009-06-07T01:16:00.005+08:00</published><updated>2009-06-07T02:23:24.750+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='CSIE'/><category scheme='http://www.blogger.com/atom/ns#' term='戲言'/><title type='text'>如何讓你的程式更難理解(3)</title><summary type='text'>
alert( ( function( list ) {
    return ( function( functor, nullValue, list ) {
        if( list.length == 0 ) {
            return nullValue;
        }
        var head = list.shift();
        return functor( head, arguments.callee( functor, nullValue, list ) );
    } )( function( head, tail ) {
        return head * head + tail;
    }, 0, list );
} )( [1, 2, 3, 4, 5] ) ); // will alert 55


</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/8197927538703239087/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/06/3.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/8197927538703239087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/8197927538703239087'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/06/3.html' title='如何讓你的程式更難理解(3)'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-639207526960786373</id><published>2009-06-06T17:08:00.000+08:00</published><updated>2009-11-23T02:45:58.456+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CSIE'/><category scheme='http://www.blogger.com/atom/ns#' term='VirtualBox'/><title type='text'>Shrink VDI size</title><summary type='text'>
How To Shrink Your Virtualbox VM And Free Up Space For Your Hard Disk - Make Tech Easier
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/639207526960786373/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/06/shrink-vdi-size.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/639207526960786373'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/639207526960786373'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/06/shrink-vdi-size.html' title='Shrink VDI size'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-44589749968106313</id><published>2009-06-04T10:16:00.000+08:00</published><updated>2009-06-04T10:16:42.392+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Khopper'/><category scheme='http://www.blogger.com/atom/ns#' term='FoolproofProject'/><title type='text'>Khopper v0.2.1 released</title><summary type='text'>
下載頁 - GitHub



修正 flac 的編碼問題
修正 vorbis 的編碼問題
修正亂七八糟的 ogg 選單
重新開放 mp3 vbr 的選項
改善時間軸

</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/44589749968106313/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/06/khopper-v021-released.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/44589749968106313'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/44589749968106313'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/06/khopper-v021-released.html' title='Khopper v0.2.1 released'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-4181990006903773141</id><published>2009-05-26T16:55:00.000+08:00</published><updated>2009-05-26T16:55:04.357+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CSIE'/><category scheme='http://www.blogger.com/atom/ns#' term='FFmpeg'/><title type='text'>MPEG Audio Frame Header</title><summary type='text'>
MPEG Audio Frame Header


FFmpeg 有實作 MP3 的 VBR 編碼，但是竟然沒有寫入能判斷 VBR 長度的 tag，之前還一直以為是我的問題= =。
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/4181990006903773141/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/05/mpeg-audio-frame-header.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4181990006903773141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4181990006903773141'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/05/mpeg-audio-frame-header.html' title='MPEG Audio Frame Header'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-9165235029448363868</id><published>2009-05-25T00:52:00.000+08:00</published><updated>2009-05-25T00:52:01.917+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='戲言'/><title type='text'>死亡フラグ</title><summary type='text'>
死亡フラグ - はてなキーワード


死亡フラグ簡單的說就是死亡的條件，フラグ即 flag，電腦遊戲中標示條件的變數。以下列出比較有趣的部分：



黑道決定金盆洗手時
浪子決定落地生根時
發現戀人懷孕並許下美好的未來後
異常系：
甘草人物突然拿到一整集的戲份
寡言的人突然變多話
嚴格的人突然變溫柔
孤獨的人了解愛和友情，並對他人敞開心胸之後
邪惡的人了解愛和正義，並對叛逃邪惡組織之後
同盟背叛並挾持人質(洗腦除外)，特別是原本在主角隊伍中善良派的同伴背叛的話，必死

和同袍提起往事，特別是主角的兄長，死亡率會急上升
迴避過數次死亡フラグ的角色
不能說的台詞：
「如果我能活著回來，就要向 XXX 告白／結婚」
「我在前面等你」
「看來今天會是炎熱的一天」
「我才不要和殺人犯在一起呢，我要睡我自己的房間」
「我絕對不會讓你死」

突然把重要的東西託付給信任的人，或是說起像遺言的話。</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/9165235029448363868/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/05/blog-post_25.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/9165235029448363868'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/9165235029448363868'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/05/blog-post_25.html' title='死亡フラグ'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-6798070143396475304</id><published>2009-05-21T18:24:00.000+08:00</published><updated>2009-05-21T18:24:37.336+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>苦果</title><summary type='text'>
當初在處理時間時沒想太多，用 double 去存秒數，但是完全沒考慮到浮點數很容易發生誤差，傳一傳值就跑掉了，現在又要對底層動刀...
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/6798070143396475304/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/05/blog-post_21.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6798070143396475304'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6798070143396475304'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/05/blog-post_21.html' title='苦果'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-4436588413907177376</id><published>2009-05-20T21:17:00.000+08:00</published><updated>2009-05-20T21:17:39.610+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ACG'/><category scheme='http://www.blogger.com/atom/ns#' term='戲言'/><title type='text'>佳句</title><summary type='text'>
攻略の鍵はヒロインをひたすらにストーキングすることだそうです。[?]


ロロット @ ティンクル☆くるせいだーす
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/4436588413907177376/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/05/blog-post_20.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4436588413907177376'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4436588413907177376'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/05/blog-post_20.html' title='佳句'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-4381129034910744615</id><published>2009-05-20T17:55:00.000+08:00</published><updated>2009-05-20T17:55:32.847+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Khopper'/><title type='text'>Khopper 0.2.0 released</title><summary type='text'>
說明頁 - GitHub
下載頁 - GitHub
狀況回報 - GitHub


修正：

核心模組以 LGPL 2.1 or later 發佈
若開啟 CUE 的對應檔案失敗，可再選擇另一檔案開啟
時間軸現在會對 CUE 做調整
加強錯誤訊息




原則上和 beta 比起來只是小修正...。整個專案全部移向 GitHub，希望不要被英文嚇到了。

</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/4381129034910744615/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/05/khopper-020-released.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4381129034910744615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4381129034910744615'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/05/khopper-020-released.html' title='Khopper 0.2.0 released'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-2162093508525146467</id><published>2009-05-15T18:21:00.001+08:00</published><updated>2009-05-15T18:22:10.024+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='戲言'/><title type='text'>所以你想說什麼？</title><summary type='text'>

</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/2162093508525146467/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/05/blog-post_15.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/2162093508525146467'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/2162093508525146467'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/05/blog-post_15.html' title='所以你想說什麼？'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_P18gL4LLTKQ/Sg1BjzNFOSI/AAAAAAAAAP4/WB8kJP6qs28/s72-c/sucks.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-8533233345307750641</id><published>2009-05-10T02:52:00.001+08:00</published><updated>2010-12-29T18:11:01.965+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Talk'/><title type='text'>堤防に来て花をくれ</title><summary type='text'>
在遊戲中看到的鬼故事，還滿有趣的。



故事大意上是說，某天一群學生在玩碟仙的時候，得出了下面的訊息：

テイボウニキテハナヲクレ

意思是「把花拿到堤坊上」。
眾人考慮了很久，怕不照指示做會被做崇，就買了供養往生者的花，拿到堤坊上撤入河中。
唸完了祭詞之後，突然，通往堤坊上的鐵梯傳來了"鏘、鏘、鏘"的腳步聲 ... 當然，梯子上根本看不到人 ... ！


其實幽靈給的訊息，也是言靈的一種，預告了接下來發生的事；把字的順序改變一下就是：

テニハボウレイヲキテナク（手には亡霊於きて哭く）

「亡靈表意在於手」，指的就是降靈。

テイボウニキテハナヲクレ（堤防にきて花をくれ）

「把花拿到堤坊上」，便是訊息。

ボクウキテハナヲテニイレ（僕浮きて花を手に入れ）

「我上水來花入手」...

ハレテテイボウナニヲキク（晴れて堤防何を聞く）

「天晴堤上何聲響」...就是最後結局！

</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/8533233345307750641/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/05/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/8533233345307750641'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/8533233345307750641'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/05/blog-post.html' title='堤防に来て花をくれ'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-7368555171480193002</id><published>2009-05-05T01:14:00.002+08:00</published><updated>2009-05-05T16:39:17.414+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ACG'/><title type='text'>夏空少女OP</title><summary type='text'>
夏空少女OP HD


據說這個因為 bug 的關係導致根本無法正常遊戲= =，不過 OP 倒是不錯。
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/7368555171480193002/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/05/op-hd-bug-op.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/7368555171480193002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/7368555171480193002'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/05/op-hd-bug-op.html' title='夏空少女OP'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-1206288436036250212</id><published>2009-05-04T23:04:00.000+08:00</published><updated>2009-05-04T23:04:32.762+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Qt'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Qt Solutions</title><summary type='text'>
Qt Solutions Catalog - Components for Qt version 4



Qt Solutions 是 Qt 的額外組件，在以前是只有買商業授權才能使用。不過在 Qt 4.5 之後，裡面的組件便漸漸地加入了 LGPL 的授權，而我之前就哈很久的 Single Application 組件也終於變成加入 LGPL 了XD。


Single Application 用途就如名字一樣，讓程式同時只能開一個實體，而且可以在實體存在時對己存在的實體發送訊息。基本上只要會 IPC 就可以實作，不過因為各平台的 IPC 技術不同，自己寫起來也是要一番功夫的。

</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/1206288436036250212/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/05/qt-solutions.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/1206288436036250212'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/1206288436036250212'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/05/qt-solutions.html' title='Qt Solutions'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-4645076031753273066</id><published>2009-05-04T13:29:00.000+08:00</published><updated>2009-05-04T13:29:05.361+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='CSIE'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Checked exceptions</title><summary type='text'>
Exception 是一種錯誤處理機制，可以在函式無法處理錯誤時拋出，中斷函式流程，並往上 unwind stack，直到有個 try-catch 述句把它捕捉起來為止。比起 error code 或是 assertion，它相對來說是較新的處理方式，也因為它會中斷流程，因此要達到 exception safe 就會變很困難。一些靜態語言則為了此目的提供了受檢測的異常處理模型，限制函式拋出的異常。



C++ 的寫法：

void f() throw(); // no throw
void f() throw( std::exception, std::runtime_error ); // exception and runtime_error only

不過實際上，就算宣告為 no throw，這個函式還是可以拋出其他異常，編譯器一樣會通過，只是這代表了嚴重錯誤，</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/4645076031753273066/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/05/checked-exceptions.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4645076031753273066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4645076031753273066'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/05/checked-exceptions.html' title='Checked exceptions'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-5337524085072954708</id><published>2009-05-02T02:31:00.003+08:00</published><updated>2009-05-02T02:38:40.028+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Compile C or C++ code from stdin</title><summary type='text'>
偶而你會懶得存檔，因此有方法可以直接編出來：

# for C
gcc -xc -
# for C++
g++ -xc++ -

# for example
echo 'main(){puts("Hello world!");}' | gcc -xc - &amp;&amp; ./a.out

</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/5337524085072954708/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/05/compile-c-or-c-code-from-stdin.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/5337524085072954708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/5337524085072954708'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/05/compile-c-or-c-code-from-stdin.html' title='Compile C or C++ code from stdin'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-4886133696667043531</id><published>2009-05-02T01:32:00.001+08:00</published><updated>2009-05-02T01:39:32.246+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CSIE'/><title type='text'>Down for everyone or just me?</title><summary type='text'>
Down for everyone or just me?


很有趣的網站，根據你輸入的網址去看看是不是只有你連不上。網址形式會是：

http://downforeveryoneorjustme.com/網址

可以把這個網址複製給別人看:P
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/4886133696667043531/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/05/down-for-everyone-or-just-me.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4886133696667043531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/4886133696667043531'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/05/down-for-everyone-or-just-me.html' title='Down for everyone or just me?'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-2847216753691749803</id><published>2009-04-28T00:27:00.000+08:00</published><updated>2009-04-28T00:27:54.596+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Git'/><title type='text'>GitHub introduced issue tracker!</title><summary type='text'>
GitHub Issue Tracker! - GitHub


這下逼我跳到 GitHub 了XD。
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/2847216753691749803/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/04/github-introduced-issue-tracker.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/2847216753691749803'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/2847216753691749803'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/04/github-introduced-issue-tracker.html' title='GitHub introduced issue tracker!'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-6912197869354427159</id><published>2009-04-23T21:26:00.000+08:00</published><updated>2009-04-23T21:26:08.690+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Qt'/><title type='text'>Updates to Qt, Qt Creator released</title><summary type='text'>
Updates to Qt, Qt Creator released 


一次推出 Qt 4.5.1, Qt Creator 1.1, Qt Visual Studio Add-in 1.0 的更新。據說 Qt Creator 有被增強不少，不過我還沒用過。Visual Studio 的整合先前是只有商業授權的 Qt 才能使用，在改 license 之後也開放給 free license 的版本使用，不過 Express 無法使用該 add-in，而 Express 以上的版本要和微軟買。
說起來 Nokia 接手後就一直對開源釋出善意，包括 Qt 4.5 之後的 LGPL，VS add-in，以及開放部分 Qt Solution 的組件，看來以後 Qt 可能會越來越壯大吧XD。
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/6912197869354427159/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/04/updates-to-qt-qt-creator-released.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6912197869354427159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6912197869354427159'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/04/updates-to-qt-qt-creator-released.html' title='Updates to Qt, Qt Creator released'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-6805811370609388147</id><published>2009-04-23T15:30:00.002+08:00</published><updated>2009-04-23T22:17:31.095+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Khopper'/><category scheme='http://www.blogger.com/atom/ns#' term='FoolproofProject'/><title type='text'>Khopper 0.2 beta released</title><summary type='text'>
說明主頁,含載點


現在我會吱吱叫！


好吧，我又很不要臉地先釋出 beta 了。這次的重點在 plugin 的擴充，播放器以及更多格式的支援。事實上 Windows 版的移植也做好了，只是一直很懶得重開機。


Known issues:

CUE的播放不會調整時間
flac的解碼器怪怪的，也許是FFmpeg的問題
ogg似乎不會寫入tag
轉換文字編碼時有機會當掉，尤其是 GB2312
播放器是使用 Phonon，因此能播放的格式取決於 Phonon 使用的 backend，若是遇到不能播放的檔案（比方說ape，ape還有ape等格式），可以換一個 backend

</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/6805811370609388147/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/04/khopper-02-beta-released.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6805811370609388147'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6805811370609388147'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/04/khopper-02-beta-released.html' title='Khopper 0.2 beta released'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-3205478445508197636</id><published>2009-04-15T00:15:00.000+08:00</published><updated>2010-02-13T11:40:08.646+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual_Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Export DLL symbols to LIB</title><summary type='text'>
Importing and Exporting


用 gcc 如果要發佈成 dll，只要編譯器加點選項，就可以發佈給別人連結了。但是 Visual C++ 卻要在每個 symbol 上加上關鍵字 __declspec(dllexport) 才會匯出到 lib，然後才能連結。

__declspec(dllexport) void blah();
class __declspec(dllexport) Blah {};

不管怎麼說，微軟的確是這方面的天才。
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/3205478445508197636/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/04/export-dll-symbols-to-lib.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/3205478445508197636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/3205478445508197636'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/04/export-dll-symbols-to-lib.html' title='Export DLL symbols to LIB'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-558878533411489538</id><published>2009-04-09T18:40:00.003+08:00</published><updated>2010-12-29T18:11:01.966+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Talk'/><category scheme='http://www.blogger.com/atom/ns#' term='CSIE'/><title type='text'>ActionScript小感</title><summary type='text'>
其實我個人比較 prefer ActionScript 3，ActionScript 2 看起來比較亂，不過其他人都還在用 2，只好入境隨俗。
對它導入的型別系統非常不喜歡。第一個原因是這失去了泛型的靈活性[!]。
第二個原因是，它融入了 class-based 物件導向概念，而不是純粹的 prototype-based。這對我來說實在是有點蛇足，因為原本的 ECMAScript 還是有辦法做到 class-based 的功能，只是方式不同罷了。我比較喜歡統一的語法。
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/558878533411489538/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/04/actionscript.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/558878533411489538'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/558878533411489538'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/04/actionscript.html' title='ActionScript小感'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-6385152902441967926</id><published>2009-04-09T16:57:00.006+08:00</published><updated>2009-04-10T03:22:54.780+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><title type='text'>Recursive anonymous function</title><summary type='text'>
JavaScript 在每個 Function 都維持了一個變數叫 arguments，可以取得 context 的有趣資訊。比如說，arguments.callee 可以拿到目前正在執行的這個 Function 的實體，這有什麼用呢？它可以用來自殺(?)，以及實現匿名函式的遞迴。


以自殺來說，比方現在你註冊一個監聽函式，而你需要在某個條件達成後解除監聽，這就很有用了：

ele.addEventListener( 'click', function( e ) {
    // blah blah ...
    this.removeEventListener( 'click', arguments.callee, false );
    // blah blah ...
}, false );



而遞迴就更有趣了，雖然應用上應該很少用到：

alert( ( </summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/6385152902441967926/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/04/recursive-anonymous-function.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6385152902441967926'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/6385152902441967926'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/04/recursive-anonymous-function.html' title='Recursive anonymous function'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-2806530559806232924</id><published>2009-04-03T14:59:00.000+08:00</published><updated>2009-04-03T14:59:47.090+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='靠北文'/><title type='text'>該死的錯誤訊息</title><summary type='text'>
昨天新裝的虛擬機要裝Daemon tools，但是一直出現 Internal error，試過各種方法依然如故，最後只好放棄改用Alcohol 52%。
坦白說我真的很討厭這種錯誤訊息，只知道錯誤但是沒有寫原因，幾乎沒有疑難排解的線索。其他軟體也經常有這種毛病，像是IE8之前的JavaScript錯誤訊息，大部分的圖型介面套件管理程式等。


也許是考慮到使用者不一定看得懂吧，但是某嘴砲曾經說過：

If you think your users are idiots, only idiots will use it.

所以拜託，弄個地球人就能看得懂的錯誤訊息吧。
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/2806530559806232924/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/04/blog-post_03.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/2806530559806232924'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/2806530559806232924'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/04/blog-post_03.html' title='該死的錯誤訊息'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-7871666237331705016</id><published>2009-04-02T14:55:00.001+08:00</published><updated>2010-12-29T18:11:01.968+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Talk'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>太嫩了</title><summary type='text'>
這是上星期我改的某個程式片段：

template&lt; typename ProductCreator &gt;
class CreatorLoader {
public:
    CreatorLoader( const std::string &amp; plugin ) : plugin_( plugin ) {}
    ProductCreator * operator()() {
        plugin::PluginContext pc;
        ProductCreator * c = qobject_cast&lt; ProductCreator * &gt;( pc.load( this-&gt;plugin_.c_str() ) );
        if( !c ) {
            throw Error&lt; RunTime &gt;( "Invalid plugin!" );</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/7871666237331705016/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/04/blog-post_02.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/7871666237331705016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/7871666237331705016'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/04/blog-post_02.html' title='太嫩了'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-8078095293140413469</id><published>2009-04-01T15:10:00.001+08:00</published><updated>2009-04-01T15:16:06.828+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ACG'/><category scheme='http://www.blogger.com/atom/ns#' term='戲言'/><title type='text'>安姆真危險</title><summary type='text'>
前幾天和室友聊天時聊到，安姆應該是整個費倫大陸上最危險的都市！ＸＤ
城門口就有個會用時間暫停和異界之門的巫妖守門。
墓園區有吸血鬼的巢穴和古代巫妖的變性卷軸[?]，晚上還有小孩子的幽靈閒晃。
行政區有暴民在燒黑暗精靈，也有和跟流氓差不多的官員和蒙面法師會。
神殿區有守備莫名地強的豪宅，地下有會挖人眼睛的眼魔邪教，還有奪心魔的家。
大橋區有通往異世界的入口，有剝皮人魔，還有一隊強得不像話的怪隊伍在某間房間開會。
碼頭區有影賊本部，而且還會內鬨，半神巫妖也被關在這，還有個老是想置主角於死地的豎琴手。
商業區有通道通向變態法師的地道，還有個瘋子侏儒想成為新世界的神。
貧民區有個異界法球通往外層界，還有奴隸組織在玩羅馬競技場。


其實柏德之門相對來說也很危險，只是一代還不能放太強的生物。ＸＤ
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/8078095293140413469/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/04/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/8078095293140413469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/8078095293140413469'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/04/blog-post.html' title='安姆真危險'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-2564328716861508657</id><published>2009-03-25T23:04:00.004+08:00</published><updated>2009-04-10T03:14:11.906+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Khopper'/><category scheme='http://www.blogger.com/atom/ns#' term='FoolproofProject'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Khopper 架構說明</title><summary type='text'>
有點久之前和 yen3 提到我想和人共同開發的東西，這裡寫出其中一個，說明架構，也算是留個紀錄吧。
本程式的架構如圖：

上層模組依賴下層模組，下層模組不會使用到上層模組。粗框代表有plugin介面可擴充。
以下就各模組做說明。



Graphic User Interface:
很明顯，就是使用者介面。除了使用Qt之外沒什麼好提的。



Album:
用來描述音軌資料的模組。
主要構成是 Track 和 Index 這兩個 struct。Index 用來表現時間資訊，因為它經常需要單位轉換，運算，故分離出來。Track 則用來裝載音軌的資訊。
CUESheet 則是使用 regex 來解析 cue 檔案的 struct 。
這個模組尷尬的地方在於字串的編碼，因為上層 GUI 的字串統一為 Unicode，但是下層解出來的資訊則是編碼過的字串；</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/2564328716861508657/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/03/khopper.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/2564328716861508657'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/2564328716861508657'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/03/khopper.html' title='Khopper 架構說明'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-9143113315005652393</id><published>2009-03-12T10:52:00.001+08:00</published><updated>2009-03-12T10:53:54.168+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Watch out the destructors of super classes</title><summary type='text'>

在 C++ 中，如果設計者沒有發生失誤的話，通常可以由 destructor 的宣告來判斷該 class 對繼承的態度：


public and non-virtual
此類 class 不打算讓任何 class 繼承它，繼承可能會導致錯誤行為。


public and virtual
此類 class 提供了多型的特性，並且預期到會有 subclasses 的使用；使用指標刪除物件是安全的。


protected and non-virtual
較為少見，此類 class 提供了介面給 subclasses ，但是卻不希望客戶使用 super class 的指標進行刪除，也不希望客戶具現化出 super class 的實體。


private
這個 class 完全是為了戰術應用而生的，如 Singleton 等；它應該要自己解決生命週期的問題。



說是這麼說啦，</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/9143113315005652393/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/03/watch-out-destructors-of-super-classes.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/9143113315005652393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/9143113315005652393'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/03/watch-out-destructors-of-super-classes.html' title='Watch out the destructors of super classes'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-1646646583484041983</id><published>2009-03-10T01:18:00.000+08:00</published><updated>2009-03-10T01:19:16.364+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ACG'/><title type='text'>エルフェンリート--劇場予告風</title><summary type='text'>
【ニコニコ動画】【MAD】 エルフェンリート　【劇場予告風】


比之前我收過的一個偽預告做得還有FU，不過幾乎把重要場面都剪進去了。說起來也太多偽作，連主題曲的完整版都是自己湊出來的...
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/1646646583484041983/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/03/blog-post_10.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/1646646583484041983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/1646646583484041983'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/03/blog-post_10.html' title='エルフェンリート--劇場予告風'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10430755083050582.post-2135563535393689305</id><published>2009-03-08T16:10:00.001+08:00</published><updated>2009-03-08T16:12:38.857+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='靠北文'/><title type='text'>又要我裝防毒軟體</title><summary type='text'>
該怎麼說呢 ... 我一直都是相信「洞」都是使用者自己開的，所以再怎麼強的防毒軟體，只要使用者一根手指就廢了。因此我後來都沒在自己的電腦上裝過防毒軟體，一方面是以前裝的時候它沒幫我擋下多少病毒，反而一直阻撓我連線，另一方面是我使用 Linux 的時間比較長。
現在家裡又要我幫她們裝防毒 ... 實在是提不起勁，反正到時候回來又變得七七八八的。而且新手超幸福的，只要說「我不會」、「我不懂」就好了。以為只要有防毒就天下太平的心態才是一直中招的源頭 ...
我也不會啊 ... 都幾年沒裝過了，還要去找什麼註冊碼，煩死人了。
</summary><link rel='replies' type='application/atom+xml' href='http://legnaleurc.blogspot.com/feeds/2135563535393689305/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://legnaleurc.blogspot.com/2009/03/blog-post.html#comment-form' title='3 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/2135563535393689305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10430755083050582/posts/default/2135563535393689305'/><link rel='alternate' type='text/html' href='http://legnaleurc.blogspot.com/2009/03/blog-post.html' title='又要我裝防毒軟體'/><author><name>ダメ人間</name><uri>http://www.blogger.com/profile/03432164862993744945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/--yBy5GdSoFA/Tl4QijE7dWI/AAAAAAAAAdY/WWh7dWT48zs/s1600/c09a95aedce4acb9d8bc677555668bc0%253Fs%253D512'/></author><thr:total>3</thr:total></entry></feed>
