<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Acelan's Life &#187; Programming</title>
	<atom:link href="http://blog.acelan.idv.tw/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.acelan.idv.tw</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 07 Sep 2011 03:31:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to use gcov/lcov to test the code coverage of choqok plurk plugin</title>
		<link>http://blog.acelan.idv.tw/2011/09/how-to-use-gcovlcov-to-test-the-code-coverage-of-choqok-plurk-plugin/</link>
		<comments>http://blog.acelan.idv.tw/2011/09/how-to-use-gcovlcov-to-test-the-code-coverage-of-choqok-plurk-plugin/#comments</comments>
		<pubDate>Wed, 07 Sep 2011 03:31:36 +0000</pubDate>
		<dc:creator>AceLan</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Choqok]]></category>
		<category><![CDATA[CMake]]></category>
		<category><![CDATA[gcov]]></category>
		<category><![CDATA[lcov]]></category>
		<category><![CDATA[Qt]]></category>

		<guid isPermaLink="false">http://blog.acelan.idv.tw/?p=91</guid>
		<description><![CDATA[我可能很早之前就聽過 gcov[1] 這個工具，但是我沒有去了解或學習它能做些什麼。
今天從朋友的噗那裡又再看到這個工具，而且有了簡單的認識，發覺這真是個好東西，應該要來試試看，就拿現在正在寫的 Choqok Plurk plugin 來試試看吧。
要使用 gcov 其實很簡單，只要在編譯跟連結的時候加上
-fprofile-arcs -ftest-coverage
這兩個 flag 即可。
不過我們的 project 是使用 CMake 所以改法稍微有點不同，下面就是修改的 diff
ubuntu@ubuntu-Vostro-V131 ~/kde/src/choqok (git-svn)-[plurk] % git diff
diff --git a/microblogs/plurk/CMakeLists.txt b/microblogs/plurk/CMakeLists.txt
index 2950374..0fb6cfa 100644
--- a/microblogs/plurk/CMakeLists.txt
+++ b/microblogs/plurk/CMakeLists.txt
@@ -32,7 +32,8 @@ plurklistdialog_base.ui
 kde4_add_plugin(choqok_plurk ${choqok_plurk_SRCS})
-target_link_libraries(choqok_plurk ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} ${QJSON_LIBRARY} ${QTOAUTH_LIBRARY} choqok plurkapihelper)
+add_definitions(-fprofile-arcs -ftest-coverage)
+target_link_libraries(choqok_plurk ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} ${QJSON_LIBRARY} ${QTOAUTH_LIBRARY} choqok plurkapihelper -fprofile-arcs)
 # Install

改完之後重新編譯，我的環境是依照 KDE Build Environment[2] 建立的，所以我是這樣編譯並執行程式的
cs [...]]]></description>
			<content:encoded><![CDATA[<p>我可能很早之前就聽過 gcov[1] 這個工具，但是我沒有去了解或學習它能做些什麼。<br />
今天從朋友的噗那裡又再看到這個工具，而且有了簡單的認識，發覺這真是個好東西，應該要來試試看，就拿現在正在寫的 Choqok Plurk plugin 來試試看吧。</p>
<p>要使用 gcov 其實很簡單，只要在編譯跟連結的時候加上<br />
<code>-fprofile-arcs -ftest-coverage</code><br />
這兩個 flag 即可。<br />
不過我們的 project 是使用 CMake 所以改法稍微有點不同，下面就是修改的 diff<br />
<code>ubuntu@ubuntu-Vostro-V131 ~/kde/src/choqok (git-svn)-[plurk] % git diff<br />
diff --git a/microblogs/plurk/CMakeLists.txt b/microblogs/plurk/CMakeLists.txt<br />
index 2950374..0fb6cfa 100644<br />
--- a/microblogs/plurk/CMakeLists.txt<br />
+++ b/microblogs/plurk/CMakeLists.txt<br />
@@ -32,7 +32,8 @@ plurklistdialog_base.ui<br />
 kde4_add_plugin(choqok_plurk ${choqok_plurk_SRCS})<br />
-target_link_libraries(choqok_plurk ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} ${QJSON_LIBRARY} ${QTOAUTH_LIBRARY} choqok plurkapihelper)<br />
+add_definitions(-fprofile-arcs -ftest-coverage)<br />
+target_link_libraries(choqok_plurk ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} ${QJSON_LIBRARY} ${QTOAUTH_LIBRARY} choqok plurkapihelper -fprofile-arcs)</p>
<p> # Install<br />
</code></p>
<p>改完之後重新編譯，我的環境是依照 KDE Build Environment[2] 建立的，所以我是這樣編譯並執行程式的<br />
<code>cs choqok &#038;&#038; kdebuild &#038;&#038; ~/kde/inst/master/bin/choqok</code><br />
執行時記得每項功能都點一點，這樣才會產生較完整的資料。</p>
<p>最後，我改使用 lcov[3]，而不是 gcov，來產生較漂亮的網頁報表。<br />
<code>ubuntu@ubuntu-Vostro-V131 ~/kde/src/choqok (git-svn)-[plurk] % lcov -d ../../build/choqok/microblogs/plurk/CMakeFiles/choqok_plurk.dir/ -capture -o choqok.info<br />
Capturing coverage data from ../../build/choqok/microblogs/plurk/CMakeFiles/choqok_plurk.dir/<br />
Found gcov version: 4.6.1<br />
Scanning ../../build/choqok/microblogs/plurk/CMakeFiles/choqok_plurk.dir/ for .gcda files ...<br />
Found 19 data files in ../../build/choqok/microblogs/plurk/CMakeFiles/choqok_plurk.dir/<br />
Processing choqok_plurk.dir/plurkaccount.gcda<br />
Processing choqok_plurk.dir/plurkapishowthread.gcda<br />
... ...<br />
Processing choqok_plurk.dir/plurkapisearchtimelinewidget.gcda<br />
Processing choqok_plurk.dir/plurkapimicroblogwidget.gcda<br />
Processing choqok_plurk.dir/choqok_plurk_automoc.gcda<br />
Finished .info-file creation<br />
</code></p>
<p><code>ubuntu@ubuntu-Vostro-V131 ~/kde/src/choqok (git-svn)-[plurk] % genhtml -o results choqok.info<br />
Reading data file choqok.info<br />
Found 104 entries.<br />
Found common filename prefix "/home/ubuntu/kde"<br />
Writing .css and .png files.<br />
Generating output.<br />
Processing file build/choqok/libchoqok/choqokbehaviorsettings.h<br />
Processing file build/choqok/libchoqok/choqokappearancesettings.h<br />
... ...<br />
Processing file /usr/include/qt4/QtGui/qcolor.h<br />
Processing file /usr/include/qt4/QtXml/qdom.h<br />
Writing directory view page.<br />
Overall coverage rate:<br />
  lines......: 37.8% (1369 of 3619 lines)<br />
  functions..: 46.5% (546 of 1173 functions)<br />
  branches...: 27.7% (599 of 2164 branches)<br />
</code></p>
<p><code>ubuntu@ubuntu-Vostro-V131 ~/kde/src/choqok (git-svn)-[plurk] % konqueror results/index.html</code></p>
<p>最後附上其他有使用到的參考資料<br />
<a href="http://www.yuanma.org/data/2006/0613/article_805.htm">http://www.yuanma.org/data/2006/0613/article_805.htm</a><br />
<a href="http://xuwenzhang.org/blog/tag/gcov/">http://xuwenzhang.org/blog/tag/gcov/</a></p>
<p>1. <a href="http://gcc.gnu.org/onlinedocs/gcc/Gcov.html">http://gcc.gnu.org/onlinedocs/gcc/Gcov.html</a><br />
2. <a href="http://techbase.kde.org/Getting_Started/Build/Environment">http://techbase.kde.org/Getting_Started/Build/Environment</a><br />
3. <a href="http://ltp.sourceforge.net/coverage/lcov.php">http://ltp.sourceforge.net/coverage/lcov.php</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.acelan.idv.tw/2011/09/how-to-use-gcovlcov-to-test-the-code-coverage-of-choqok-plurk-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plurk for Choqok</title>
		<link>http://blog.acelan.idv.tw/2011/08/plurk-for-choqok/</link>
		<comments>http://blog.acelan.idv.tw/2011/08/plurk-for-choqok/#comments</comments>
		<pubDate>Wed, 24 Aug 2011 02:11:07 +0000</pubDate>
		<dc:creator>AceLan</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Choqok]]></category>
		<category><![CDATA[Plurk]]></category>

		<guid isPermaLink="false">http://blog.acelan.idv.tw/?p=81</guid>
		<description><![CDATA[I&#8217;m starting a project to add plurk microblog into choqok[1], a KDE micro-blogging client.
The status right now is merely pass the OAuth of plurk and read posts, but not stable, crashes all the time.
Since it&#8217;s not stable yet, so I push the code on github[2] temporally, will trying to merge back to choqok once it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m starting a project to add plurk microblog into choqok[1], a KDE micro-blogging client.<br />
The status right now is merely pass the OAuth of plurk and read posts, but not stable, crashes all the time.</p>
<p>Since it&#8217;s not stable yet, so I push the code on github[2] temporally, will trying to merge back to choqok once it&#8217;s done.<br />
I&#8217;ll try to complete the code for plurk microblog, and I also look forward to anyone of you could send me patches to make it better.</p>
<p>BTW, according to the license of Choqok, the plurk microblog project will following the same license, it&#8217;s GNU GPLv3.</p>
<p>1. <a href="http://choqok.gnufolks.org/">http://choqok.gnufolks.org/</a><br />
2. <a href="https://github.com/acelan/choqok">https://github.com/acelan/choqok</a> plurk branch</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.acelan.idv.tw/2011/08/plurk-for-choqok/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Nested function in C++</title>
		<link>http://blog.acelan.idv.tw/2011/03/nested-function-in-c/</link>
		<comments>http://blog.acelan.idv.tw/2011/03/nested-function-in-c/#comments</comments>
		<pubDate>Tue, 01 Mar 2011 02:36:13 +0000</pubDate>
		<dc:creator>AceLan</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[nested function]]></category>

		<guid isPermaLink="false">http://blog.acelan.idv.tw/?p=75</guid>
		<description><![CDATA[I read some interesting articles about nested function by C[1][2] and thought this is easy to be implemented by C++, so I wrote one C++ version.
1. 在 C 语言中包装函数 — Closure 和 GCC nested function
2. GCC 的 nested function 與 trampoline

#include 〈iostream〉
using namespace std;
typedef int (*func_t)(int arg);
class create_wrap_function
{
public:
        [...]]]></description>
			<content:encoded><![CDATA[<p>I read some interesting articles about nested function by C[1][2] and thought this is easy to be implemented by C++, so I wrote one C++ version.</p>
<p>1. <a href="http://chenyufei.info/blog/2011-02-28/wrap-c-function-closure-gcc-nested-function/">在 C 语言中包装函数 — Closure 和 GCC nested function</a><br />
2. <a href="http://blog.linux.org.tw/~jserv/archives/2010/07/gcc_nested_func.html">GCC 的 nested function 與 trampoline</a></p>
<p><span id="more-75"></span><br />
<code>#include 〈iostream〉</p>
<p>using namespace std;</p>
<p>typedef int (*func_t)(int arg);</p>
<p>class create_wrap_function<br />
{<br />
public:<br />
        create_wrap_function( func_t f):wrapped_func(f){}<br />
        int operator()( int arg)<br />
        {<br />
                cout << "yooo" << endl;<br />
                wrapped_func( arg);<br />
        }<br />
private:<br />
        create_wrap_function();<br />
        func_t wrapped_func;<br />
};</p>
<p>int foo(int a)<br />
{<br />
            return a + 1;<br />
}</p>
<p>int main( void)<br />
{<br />
        create_wrap_function bar( foo);<br />
        cout << bar(2) << endl;<br />
        return 0;<br />
}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.acelan.idv.tw/2011/03/nested-function-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to build a DKMS package</title>
		<link>http://blog.acelan.idv.tw/2010/09/how-to-build-a-dkms-package/</link>
		<comments>http://blog.acelan.idv.tw/2010/09/how-to-build-a-dkms-package/#comments</comments>
		<pubDate>Fri, 03 Sep 2010 12:31:54 +0000</pubDate>
		<dc:creator>AceLan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.acelan.idv.tw/?p=72</guid>
		<description><![CDATA[I&#8217;m trying to log how I built an rtl8190 DKMS package, the info may not correct and only works for me.
tar xf rtl8190p_linux_2.6.0011.1029.2009.tar.gz
sudo mv rtl8190p_linux_2.6.0011.1029.2009 /usr/src/rtl8190p-0011.1029.2009/
Modified the Makefile and copy out the .ko file

        @make -C $(KSRC) SUBDIRS=$(RTL819x_DIR)/HAL/$(HAL_SUB_DIR) modules
+       cp ./HAL/rtl8192/r8190_pci.ko .

Prepare [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m trying to log how I built an rtl8190 DKMS package, the info may not correct and only works for me.</p>
<p><code>tar xf rtl8190p_linux_2.6.0011.1029.2009.tar.gz<br />
sudo mv rtl8190p_linux_2.6.0011.1029.2009 /usr/src/rtl8190p-0011.1029.2009/</code></p>
<p>Modified the Makefile and copy out the .ko file<br />
<code><br />
        @make -C $(KSRC) SUBDIRS=$(RTL819x_DIR)/HAL/$(HAL_SUB_DIR) modules<br />
+       cp ./HAL/rtl8192/r8190_pci.ko .<br />
</code></p>
<p>Prepare files needed, &#8220;dkms.conf&#8221;, &#8220;install.sh&#8221;, &#8220;remove.sh&#8221;<br />
<code>% cat /usr/src/rtl8190p-0011.1029.2009/dkms.conf<br />
PACKAGE_NAME="rtl8190p"<br />
PACKAGE_VERSION="0011.1029.2009"<br />
CLEAN="make clean"<br />
BUILT_MODULE_NAME[0]="r8190"<br />
DEST_MODULE_NAME[0]="r8190"<br />
DEST_MODULE_LOCATION[0]="/updates"<br />
POST_INSTALL="install.sh $dkms_tree/$PACKAGE_NAME/$PACKAGE_VERSION"<br />
POST_REMOVE="remove.sh"<br />
AUTOINSTALL="yes"</code></p>
<p><code>% cat /usr/src/rtl8190p-0011.1029.2009/install.sh<br />
cp -a firmware/RTL8190P /lib/firmware/</code><br />
<code>% cat /usr/src/rtl8190p-0011.1029.2009/remove.sh<br />
rm -rf /lib/firmware/RTL8190P</code><br />
And remember to give them execution permission<br />
<code>sudo chmod a+x /usr/src/rtl8190p-0011.1029.2009/{install,remove}.sh</code></p>
<p>Add this driver into dkms system<br />
<code>% sudo dkms add -m rtl8190p -v 0011.1029.2009</p>
<p>Creating symlink /var/lib/dkms/rtl8190p/0011.1029.2009/source -><br />
                 /usr/src/rtl8190p-0011.1029.2009</p>
<p>DKMS: add Completed.</code></p>
<p>Try to build it<br />
<code>% sudo dkms build -m rtl8190p -v 0011.1029.2009</p>
<p>Kernel preparation unnecessary for this kernel.  Skipping...</p>
<p>Building module:<br />
cleaning build area....<br />
make KERNELRELEASE=2.6.35-19-generic............<br />
cleaning build area....</p>
<p>DKMS: build Completed.</code></p>
<p>No error, so try to install it and see if everything all correct.<br />
<code>% sudo dkms install -m rtl8190p -v 0011.1029.2009</p>
<p>r8190_pci.ko:<br />
Running module version sanity check.<br />
 - Original module<br />
   - No original module exists within this kernel<br />
 - Installation<br />
   - Installing to /lib/modules/2.6.35-19-generic/updates/dkms/</p>
<p>Running post_install:</p>
<p>depmod....</p>
<p>DKMS: install Completed.</code></p>
<p>Now, try to load the module and test the driver<br />
<code>sudo modprobe r8190_pci<br />
dmesg | tail</code></p>
<p>Pack the .deb package<br />
<code>% sudo dkms mkdsc -m rtl8190p -v 0011.1029.2009 --source-only<br />
Using /etc/dkms/template-dkms-mkdsc<br />
copying template...<br />
modifying debian/changelog...<br />
modifying debian/compat...<br />
modifying debian/control...<br />
modifying debian/copyright...<br />
modifying debian/dirs...<br />
modifying debian/postinst...<br />
modifying debian/prerm...<br />
modifying debian/README.Debian...<br />
modifying debian/rules...<br />
copying legacy postinstall template...<br />
Copying source tree...<br />
Building source package... dpkg-source --before-build rtl8190p-dkms-0011.1029.2009<br />
 debian/rules clean<br />
 dpkg-source -b rtl8190p-dkms-0011.1029.2009<br />
dpkg-source: warning: no source format specified in debian/source/format, see dpkg-source(1)<br />
 dpkg-genchanges -S >../rtl8190p-dkms_0011.1029.2009_source.changes<br />
dpkg-genchanges: including full source code in upload<br />
 dpkg-source --after-build rtl8190p-dkms-0011.1029.2009</p>
<p>DKMS: mkdsc Completed.<br />
Moving built files to /var/lib/dkms/rtl8190p/0011.1029.2009/dsc...<br />
Cleaning up temporary files...<br />
</code></p>
<p>You can find the .deb file here<br />
<code>% ls -l /var/lib/dkms/rtl8190p/0011.1029.2009/deb<br />
total 2020<br />
-rw-r--r-- 1 root root 2066436 Sep  3 20:21 rtl8190p-dkms_0011.1029.2009_all.deb<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.acelan.idv.tw/2010/09/how-to-build-a-dkms-package/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check if BIOS supports C2 ~ C3 switch</title>
		<link>http://blog.acelan.idv.tw/2010/09/check-if-bios-supports-c2-c3-switch/</link>
		<comments>http://blog.acelan.idv.tw/2010/09/check-if-bios-supports-c2-c3-switch/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 05:36:28 +0000</pubDate>
		<dc:creator>AceLan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.acelan.idv.tw/?p=69</guid>
		<description><![CDATA[First of all, check how many Cs state your system support.
acelan@acelan-nb ~ % cat /proc/acpi/processor/*/power
active state:            C0
max_cstate:              C8
maximum allowed latency: 749931 usec
states:
    C1:      [...]]]></description>
			<content:encoded><![CDATA[<p>First of all, check how many Cs state your system support.</p>
<p><code>acelan@acelan-nb ~ % cat /proc/acpi/processor/*/power<br />
active state:            C0<br />
max_cstate:              C8<br />
maximum allowed latency: 749931 usec<br />
states:<br />
    C1:                  type[C1] promotion[--] demotion[--] latency[001] usage[00034144] duration[00000000000000000000]<br />
    C2:                  type[C2] promotion[--] demotion[--] latency[001] usage[12402973] duration[00000000041800676364]<br />
active state:            C0<br />
max_cstate:              C8<br />
maximum allowed latency: 749931 usec<br />
states:<br />
    C1:                  type[C1] promotion[--] demotion[--] latency[001] usage[00017168] duration[00000000000000000000]<br />
    C2:                  type[C2] promotion[--] demotion[--] latency[001] usage[14252404] duration[00000000042491108472]</code></p>
<p>Then get fadt(Fixed ACPI Description table) and disassemble it<br />
<code>sudo cat /proc/acpi/fadt > /tmp/fadt.dat</code><br />
<code>acelan@acelan-nb ~ % iasl -d /tmp/fadt.dat</p>
<p>Intel ACPI Component Architecture<br />
AML Disassembler version 20090521 [Jun 30 2009]<br />
Copyright (C) 2000 - 2009 Intel Corporation<br />
Supports ACPI Specification Revision 3.0a</p>
<p>Loading Acpi table from file /tmp/fadt.dat<br />
Acpi Data Table [FACP] decoded, written to "/tmp/fadt.dsl"</code></p>
<p>Check those two values to see if C2 is smaller then 100(0&#215;64) and C3 is smaller then 1000(0&#215;3E8).<br />
<code>acelan@acelan-nb ~ % grep Latency /tmp/fadt.dsl<br />
[060h 0096  2]                   C2 Latency : 0001<br />
[062h 0098  2]                   C3 Latency : 03E9</code></p>
<p>If not, that means BIOS blocks the system switch to C2/C3 state.</p>
<p>In drivers/acpi/processor_idle.c:325 (linux 2.6.35)<br />
<code>        /*<br />
         * FADT specified C2 latency must be less than or equal to<br />
         * 100 microseconds.<br />
         */<br />
        if (acpi_gbl_FADT.C2latency > ACPI_PROCESSOR_MAX_C2_LATENCY) {<br />
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,<br />
                        "C2 latency too large [%d]\n", acpi_gbl_FADT.C2latency));<br />
                /* invalidate C2 */<br />
                pr->power.states[ACPI_STATE_C2].address = 0;<br />
        }</p>
<p>        /*<br />
         * FADT supplied C3 latency must be less than or equal to<br />
         * 1000 microseconds.<br />
         */<br />
        if (acpi_gbl_FADT.C3latency > ACPI_PROCESSOR_MAX_C3_LATENCY) {<br />
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,<br />
                        "C3 latency too large [%d]\n", acpi_gbl_FADT.C3latency));<br />
                /* invalidate C3 */<br />
                pr->power.states[ACPI_STATE_C3].address = 0;<br />
        }<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.acelan.idv.tw/2010/09/check-if-bios-supports-c2-c3-switch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Develop Android apps by Eclipse on Ubuntu</title>
		<link>http://blog.acelan.idv.tw/2010/01/develop-android-apps-by-eclipse-on-ubuntu/</link>
		<comments>http://blog.acelan.idv.tw/2010/01/develop-android-apps-by-eclipse-on-ubuntu/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 07:19:59 +0000</pubDate>
		<dc:creator>AceLan</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[eclipse]]></category>

		<guid isPermaLink="false">http://blog.acelan.idv.tw/?p=57</guid>
		<description><![CDATA[I&#8217;m trying to use eclipse to write a hello android program, but encountered a problem while installing ADT plugin for eclipse.
The following is the solution and from this bug report, the problem is fixed in eclipse (3.5.1+repack~3-0ubuntu1).

1. Open eclipse and Help -> Install New Software&#8230;
Add http://download.eclipse.org/releases/galileo/ to the update sites list
Using the filter to filter [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m trying to use eclipse to write a hello android program, but encountered a problem while installing ADT plugin for eclipse.</p>
<p>The following is the solution and from <a href="https://bugs.launchpad.net/ubuntu/+source/eclipse/+bug/477944">this bug report</a>, the problem is fixed in eclipse (3.5.1+repack~3-0ubuntu1).<br />
<span id="more-57"></span><br />
1. Open eclipse and Help -> Install New Software&#8230;<br />
Add http://download.eclipse.org/releases/galileo/ to the update sites list<br />
Using the filter to filter out WST and install it.</p>
<p>2. Restart eclipse, Help -> Install New Software&#8230;<br />
and install the <a href="http://developer.android.com/intl/zh-TW/sdk/eclipse-adt.html">Android ADT</a> as described on the android website.</p>
<p>3. Window -> Preference -> Android<br />
SDK Location &#8211; given the correct location of the Android SDK.</p>
<p>4. File -> New -> Project<br />
Android -> Android Project &#8211; Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.acelan.idv.tw/2010/01/develop-android-apps-by-eclipse-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apply patch</title>
		<link>http://blog.acelan.idv.tw/2009/11/apply-patch/</link>
		<comments>http://blog.acelan.idv.tw/2009/11/apply-patch/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 03:47:53 +0000</pubDate>
		<dc:creator>AceLan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[zsh]]></category>

		<guid isPermaLink="false">http://blog.acelan.idv.tw/?p=47</guid>
		<description><![CDATA[PATCH=patch_filename ; git am $PATCH &#124;&#124; (git apply --reject $PATCH ; find -name *.rej)
It&#8217;s done, if no .rej files be produced.
If git am failed, it&#8217;ll try to apply the other successful part and produce the .rej files to indicate the failed part.
Edit the failed files then, and using git status to make sure how many [...]]]></description>
			<content:encoded><![CDATA[<p><code>PATCH=patch_filename ; git am $PATCH || (git apply --reject $PATCH ; find -name *.rej)</code></p>
<p>It&#8217;s done, if no .rej files be produced.</p>
<p>If <code>git am</code> failed, it&#8217;ll try to apply the other successful part and produce the .rej files to indicate the failed part.</p>
<p>Edit the failed files then, and using <code>git status</code> to make sure how many files infected and using <code>git add files</code> to add them or using <code> git add -u</code> to add all not updated files.</p>
<p>Finally, <code>git am --resolved</code></p>
<p>Note for the zsh user. (2010/01/12)<br />
I changed my default shell to zsh recently and found the apply patch command is broken. Although zsh claim that it&#8217;s compatible with bash, there are still some difference. But the good news is we can overcome this problem by adding one more line in the .zshrc<br />
<code>setopt GLOB_SUBST</code><br />
More detail, please read <a href="http://zsh.sourceforge.net/Guide/zshguide02.html#l14">this</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.acelan.idv.tw/2009/11/apply-patch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What a stupid thing I did!!</title>
		<link>http://blog.acelan.idv.tw/2009/10/what-a-stupid-thing-i-did/</link>
		<comments>http://blog.acelan.idv.tw/2009/10/what-a-stupid-thing-i-did/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 03:39:43 +0000</pubDate>
		<dc:creator>AceLan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[kernel]]></category>

		<guid isPermaLink="false">http://blog.acelan.idv.tw/?p=30</guid>
		<description><![CDATA[I&#8217;ve been curious who made the test_branch_1 branch on the ubuntu git tree for a long time. And today I checkout that branch and see the amazing log.
acelan@acelan-nb:~/workspace/ubuntu-karmic$ git branch -r             
  origin/HEAD -> origin/master
  origin/arm
  origin/ec2
  origin/fsl-imx51
  [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been curious who made the test_branch_1 branch on the ubuntu git tree for a long time. And today I checkout that branch and see the amazing log.</p>
<p><code>acelan@acelan-nb:~/workspace/ubuntu-karmic$ git branch -r</code>             </p>
<blockquote><p>  origin/HEAD -> origin/master<br />
  origin/arm<br />
  origin/ec2<br />
  origin/fsl-imx51<br />
  origin/master<br />
  origin/mvl-dove<br />
  origin/netbook<br />
  origin/patches-that-need-love<br />
  origin/pending-upstream-patches<br />
  origin/test_branch_1</p></blockquote>
<p><code>acelan@acelan-nb:~/workspace/ubuntu-karmic$ git checkout -b test origin/test_branch_1</code></p>
<blockquote><p>Checking out files: 100% (9533/9533), done.<br />
Branch test set up to track remote branch test_branch_1 from origin.<br />
Switched to a new branch &#8216;test&#8217;</p></blockquote>
<p><code>acelan@acelan-nb:~/workspace/ubuntu-karmic$ git log</code></p>
<blockquote><p>commit a2c978c3ffb96982b3876b37c0a21fcc787234bc<br />
Author: AceLan Kao ＜acelan@ooo.xxx.com><br />
Date:   Fri Jun 12 13:42:45 2009 +0800             </p>
<p>    only for git test</p>
<p>commit fba4b54f8f16a11ff3e57b7ac76d437b5d831695<br />
Author: AceLan ＜acelan@acelan-nb.(none)><br />
Date:   Tue Jun 9 16:17:23 2009 +0800</p>
<p>    UBUNTU: [Upstream]</p>
<p>    Signed-off-by: AceLan ＜acelan@acelan-nb.(none)></p></blockquote>
<p>It was my second day, and I didn&#8217;t know too much about git. Of course, the branch was already been deleted, and nobody will know what I had did. :p</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.acelan.idv.tw/2009/10/what-a-stupid-thing-i-did/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add extra work for kernel package</title>
		<link>http://blog.acelan.idv.tw/2009/10/add-extra-work-for-kernel-package/</link>
		<comments>http://blog.acelan.idv.tw/2009/10/add-extra-work-for-kernel-package/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 02:27:35 +0000</pubDate>
		<dc:creator>AceLan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[packaging]]></category>

		<guid isPermaLink="false">http://blog.acelan.idv.tw/?p=28</guid>
		<description><![CDATA[If you would like to do more extra work while packaging the kernel package, modify this file
debian/rules.d/2-binary-arch.mk
If you would like to do more extra work after installing the kernel package, modify this file
debian/control-scripts/postinst
]]></description>
			<content:encoded><![CDATA[<p>If you would like to do more extra work while packaging the kernel package, modify this file<br />
<code>debian/rules.d/2-binary-arch.mk</code></p>
<p>If you would like to do more extra work after installing the kernel package, modify this file<br />
<code>debian/control-scripts/postinst</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.acelan.idv.tw/2009/10/add-extra-work-for-kernel-package/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My git commands backup</title>
		<link>http://blog.acelan.idv.tw/2009/10/my-git-commands-backup/</link>
		<comments>http://blog.acelan.idv.tw/2009/10/my-git-commands-backup/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 07:26:50 +0000</pubDate>
		<dc:creator>AceLan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[kernel]]></category>

		<guid isPermaLink="false">http://blog.acelan.idv.tw/?p=20</guid>
		<description><![CDATA[On a new installed machine, you have to add your info in the ~/.gitconfig
git config --add user.name "AceLan Kao"
git config --add user.email acelan.kao@ccc.ccc

Clone Jaunty kernel and add my public repository, so that I can publish my modification to public git tree.
git clone --reference linux-2.6 git://kernel.ubuntu.com/ubuntu/ubuntu-jaunty.git
git remote add zinc git+ssh://zinc.ubuntu.com/srv/kernel.ubuntu.com/git/acelan/acelan-jaunty.git
NOTE. The reference git tree(ex. linux-2.6) shouldn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>On a new installed machine, you have to add your info in the ~/.gitconfig<br />
<code>git config --add user.name "AceLan Kao"<br />
git config --add user.email acelan.kao@ccc.ccc<br />
</code></p>
<p>Clone Jaunty kernel and add my public repository, so that I can publish my modification to <a href="http://kernel.ubuntu.com/git">public git tree</a>.<br />
<code>git clone --reference linux-2.6 git://kernel.ubuntu.com/ubuntu/ubuntu-jaunty.git<br />
git remote add zinc git+ssh://zinc.ubuntu.com/srv/kernel.ubuntu.com/git/acelan/acelan-jaunty.git</code><br />
NOTE. The reference git tree(ex. linux-2.6) shouldn&#8217;t be removed under any circumstances, or the reference object will disappear and the git tree will become unusable. The file <code>.git/objects/info/alternates</code> will record the referenced git tree, try to specify an available one, if you removed the original reference tree accidentally.</p>
<p><span id="more-20"></span></p>
<p>We usually cherry pick upstream kernel commit, this is the command.<br />
<code>git cherry-pick -s -e -x aa1812b3e</code></p>
<p>And the request letter format for cherry pick.<br />
<code>git request-pull \<br />
           <lastest SHA before your commit> \<br />
           git://kernel.ubuntu.com/<your_id_on_zinc>/my-jaunty.git \<br />
           > new_branch_1-request-pull.txt</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.acelan.idv.tw/2009/10/my-git-commands-backup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

