<?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>Here comes the Sun &#187; foss</title>
	<atom:link href="http://sunng.info/blog/tag/foss/feed/" rel="self" type="application/rss+xml" />
	<link>http://sunng.info/blog</link>
	<description>Homemade Clojure Geek</description>
	<lastBuildDate>Fri, 11 May 2012 02:24:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>GNOME-Shell Extension for Exaile DoubanFM Plugin</title>
		<link>http://sunng.info/blog/2011/05/gnome-shell-extension-for-exaile-doubanfm-plugin/</link>
		<comments>http://sunng.info/blog/2011/05/gnome-shell-extension-for-exaile-doubanfm-plugin/#comments</comments>
		<pubDate>Sat, 07 May 2011 15:19:47 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[手艺]]></category>
		<category><![CDATA[dbus]]></category>
		<category><![CDATA[Douban]]></category>
		<category><![CDATA[exaile]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[gnome-shell]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/2011/05/gnome-shell-extension-for-exaile-doubanfm-plugin/</guid>
		<description><![CDATA[从有这个动机到基本可用，花了整整一天的时间。现在可以通过GNOME-Shell的一个小菜单从外部控制Exaile豆瓣电台了。它的意思就是说如果你使用Gnome-Shell，你可以把Exaile界面扔到一个你不想看到的地方去，比如第n+1个workspace。然后通过左上角的菜单来控制豆瓣电台的播放。见多识广的你不会对此感到太惊奇，其实它和Ubuntu上的Sound Menu Indicator类似，不过是专门给豆瓣电台设计的。 要实现这个功能，需要播放器通过dbus来expose一些接口供外部程序调用，它和Sound Menu是一样的，通过dbus来解耦。开发起来比较困难的是目前GNOME-Shell的API还不成熟，还没有文档，传统的javascript object inspect方法似乎在这个mozjs的环境里也不能用，所以实在是无从知道一些API。更不要提通过gjs来调用dbus了。网上有一些文档起了很大的作用，如果你也感兴趣，这些文章是： 开发GNOME-Shell Extension：http://blog.fpmurphy.com/2011/04/gnome-3-shell-extensions.html gjs调用dbus： blog.roodo.com/rocksaying/archives/14229429.html 支持dbus的exaile-doubanfm-plugin会在stable之后合并到主干供大家使用。现在和gjs一样，它的API也不稳定，所以放在分支中： https://github.com/sunng87/exaile-doubanfm-plugin/tree/dbus gnome-shell extension的代码现在也放在github上（其实还不成熟的东西放到bitbucket比较好的）。有兴趣可以了解： https://github.com/sunng87/exaile-doubanfm-gnome-shell-extension 以上都是unstable，仅供吊胃口之用。]]></description>
			<content:encoded><![CDATA[<p>从有这个动机到基本可用，花了整整一天的时间。现在可以通过GNOME-Shell的一个小菜单从外部控制Exaile豆瓣电台了。它的意思就是说如果你使用Gnome-Shell，你可以把Exaile界面扔到一个你不想看到的地方去，比如第n+1个workspace。然后通过左上角的菜单来控制豆瓣电台的播放。见多识广的你不会对此感到太惊奇，其实它和Ubuntu上的Sound Menu Indicator类似，不过是专门给豆瓣电台设计的。<br />
<a href="http://www.flickr.com/photos/40741608@N08/5696429062/" title="Exaile with doubanfm plugin by 贝小塔, on Flickr"><img src="http://farm6.static.flickr.com/5104/5696429062_7f62a4d7f2.jpg" alt="Exaile with doubanfm plugin" height="313" width="500" /></a></p>
<p>要实现这个功能，需要播放器通过dbus来expose一些接口供外部程序调用，它和Sound Menu是一样的，通过dbus来解耦。开发起来比较困难的是目前GNOME-Shell的API还不成熟，还没有文档，传统的javascript object inspect方法似乎在这个mozjs的环境里也不能用，所以实在是无从知道一些API。更不要提通过gjs来调用dbus了。网上有一些文档起了很大的作用，如果你也感兴趣，这些文章是：</p>
<ul>
<li>开发GNOME-Shell Extension：<a href="http://blog.fpmurphy.com/2011/04/gnome-3-shell-extensions.html">http://blog.fpmurphy.com/2011/04/gnome-3-shell-extensions.html</a></li>
<li>gjs调用dbus： <a href="http://blog.roodo.com/rocksaying/archives/14229429.html">blog.roodo.com/rocksaying/archives/14229429.html</a></li>
</ul>
<p>支持dbus的exaile-doubanfm-plugin会在stable之后合并到主干供大家使用。现在和gjs一样，它的API也不稳定，所以放在分支中：<br />
<a href="https://github.com/sunng87/exaile-doubanfm-plugin/tree/dbus">https://github.com/sunng87/exaile-doubanfm-plugin/tree/dbus</a></p>
<p>gnome-shell extension的代码现在也放在github上（其实还不成熟的东西放到bitbucket比较好的）。有兴趣可以了解：<br />
<a href="https://github.com/sunng87/exaile-doubanfm-gnome-shell-extension">https://github.com/sunng87/exaile-doubanfm-gnome-shell-extension</a></p>
<p>以上都是unstable，仅供吊胃口之用。</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" alt="" src="http://img.zemanta.com/pixy.gif?x-id=a656b959-d8af-8db6-8cbc-e246c779cf1c" /></div>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2011/05/gnome-shell-extension-for-exaile-doubanfm-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Douban is now available as a cover provider of CoverGloobus</title>
		<link>http://sunng.info/blog/2010/12/douban-is-now-available-as-a-cover-provider-of-covergloobus/</link>
		<comments>http://sunng.info/blog/2010/12/douban-is-now-available-as-a-cover-provider-of-covergloobus/#comments</comments>
		<pubDate>Fri, 10 Dec 2010 16:46:59 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[装备]]></category>
		<category><![CDATA[Douban]]></category>
		<category><![CDATA[foss]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/2010/12/douban-is-now-available-as-a-cover-provider-of-covergloobus/</guid>
		<description><![CDATA[This is a feature requested by a douban user, we need a provider for CoverGloobus to retrieve covers from douban.com I just modify the code of exaile-douban-cover, and adapt to CoverGloobus 1.7 API. In 1.7, CoverGloobus has simplfied SPI for &#8230; <a href="http://sunng.info/blog/2010/12/douban-is-now-available-as-a-cover-provider-of-covergloobus/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is a feature requested by <a href="http://www.douban.com/people/4350866/">a douban user</a>, we need a provider for <a href="https://launchpad.net/covergloobus">CoverGloobus</a> to retrieve covers from douban.com</p>
<p>I just modify the code of exaile-douban-cover, and adapt to CoverGloobus 1.7 API. In 1.7, CoverGloobus has simplfied SPI for cover providers, which has much enhancement from 1.6 . So this provider is only compatible with CoverGloobus 1.7 .</p>
<p>The patch is now merged into the bazaar repository, you can find it at:</p>
<p>http://bazaar.launchpad.net/~gloobus-dev/covergloobus/trunk/files/head%3A/src/covers/</p>
<p>Chinese user will benefit from this patch that CoverGloobus will try to download album art if it&#8217;s not available from your music player.</p>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2010/12/douban-is-now-available-as-a-cover-provider-of-covergloobus/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Bash Color Support for Bti</title>
		<link>http://sunng.info/blog/2010/10/bash-color-support-for-bti/</link>
		<comments>http://sunng.info/blog/2010/10/bash-color-support-for-bti/#comments</comments>
		<pubDate>Sun, 31 Oct 2010 02:14:07 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[装备]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[opensource]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/2010/10/bash-color-support-for-bti/</guid>
		<description><![CDATA[Bti is well known as a command line twitter/identica/statusnet client, by Greg Kroah-Hartman. I have been using this tool in CLI environment for a long time, found it difficult for human to parse output by eyes. So I forked it &#8230; <a href="http://sunng.info/blog/2010/10/bash-color-support-for-bti/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://github.com/gregkh/bti">Bti</a> is well known as a command line twitter/identica/statusnet client, by <a href="http://github.com/gregkh">Greg Kroah-Hartman</a>.</p>
<p>I have been using this tool in CLI environment for a long time, found it difficult for human to parse output by eyes. So I forked it and added this bash color support, to provide some highlight on tweets.<br />
<a href="http://www.flickr.com/photos/40741608@N08/5130529830/" title="bti-bash-color by 贝小塔, on Flickr"><img src="http://farm2.static.flickr.com/1346/5130529830_a1f8eaf793.jpg" width="416" height="500" alt="bti-bash-color" /></a></p>
<p>To enable color support, add an option <i>&#8211;auto-color</i> to bti command, or append <i>auto-color=yes</i> to your configuration file($HOME/.bti)</p>
<p>I have sent pull request to Greg, hope the patch can be merged into master. Before approved, you can check out <a href="http://github.com/sunng87/bti">my fork</a> and compile it yourself. (If liboauth not found, find it <a href="http://liboauth.sourceforge.net/">here</a>.)</p>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2010/10/bash-color-support-for-bti/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Douban on Gwibber</title>
		<link>http://sunng.info/blog/2010/10/douban-on-gwibber/</link>
		<comments>http://sunng.info/blog/2010/10/douban-on-gwibber/#comments</comments>
		<pubDate>Tue, 05 Oct 2010 08:52:22 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[装备]]></category>
		<category><![CDATA[Douban]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[gtk]]></category>
		<category><![CDATA[gwibber]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/2010/10/douban-on-gwibber/</guid>
		<description><![CDATA[Now it&#8217;s possible to use Gwibber as a desktop Douban. Setup a douban client in the account dialog: Authorize Gwibber to access private data on Douban (OAuth): Display Douban activities on Gwibber timeline: The code has been uploaded to bitbucket: &#8230; <a href="http://sunng.info/blog/2010/10/douban-on-gwibber/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Now it&#8217;s possible to use Gwibber as a desktop Douban.</p>
<p>Setup a douban client in the account dialog:<br />
<a href="http://www.flickr.com/photos/40741608@N08/5053311735/" title="GwibberDoubanSetup by 贝小塔, on Flickr"><img src="http://farm5.static.flickr.com/4130/5053311735_5fc69747a5.jpg" width="500" height="259" alt="GwibberDoubanSetup" /></a></p>
<p>Authorize Gwibber to access private data on Douban (OAuth):<br />
<a href="http://www.flickr.com/photos/40741608@N08/5053311377/" title="DoubanOAuthAuthorize by 贝小塔, on Flickr"><img src="http://farm5.static.flickr.com/4147/5053311377_43b0a4788e.jpg" width="500" height="394" alt="DoubanOAuthAuthorize" /></a></p>
<p>Display Douban activities on Gwibber timeline:<br />
<a href="http://www.flickr.com/photos/40741608@N08/5053311635/" title="GwibberDouban by 贝小塔, on Flickr"><img src="http://farm5.static.flickr.com/4103/5053311635_ab6716100b.jpg" width="422" height="500" alt="GwibberDouban" /></a></p>
<p>The code has been uploaded to bitbucket:<br />
<a href="https://bitbucket.org/sunng/gwibber-douban/overview">https://bitbucket.org/sunng/gwibber-douban/overview</a></p>
<p>I am currently working on an installation script.</p>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2010/10/douban-on-gwibber/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Visualize call tree of a C function</title>
		<link>http://sunng.info/blog/2010/09/visualize-call-tree-of-a-c-function/</link>
		<comments>http://sunng.info/blog/2010/09/visualize-call-tree-of-a-c-function/#comments</comments>
		<pubDate>Fri, 24 Sep 2010 15:55:19 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[把戏]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[dot]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/2010/09/visualize-call-tree-of-a-c-function/</guid>
		<description><![CDATA[Requirement You want to visualize a call hierarchy of a C function. Solution Utilities you need are listed below: GNU cflow cflow2vcg graphviz Take &#8216;rdbSaveBackground&#8217; (redis/rdb.c) for example: cflow --format=posix --omit-arguments --level-indent='0=\t' --level-indent='1=\t' --level-indent=start='\t' -m 'rdbSaveBackground' ~/osprojects/redis/src/rdb.c &#124; cflow2dot &#124; &#8230; <a href="http://sunng.info/blog/2010/09/visualize-call-tree-of-a-c-function/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3>Requirement</h3>
<p>You want to visualize a call hierarchy of a C function.</p>
<h3>Solution</h3>
<p>Utilities you need are listed below:</p>
<ul>
<li><a href="http://www.gnu.org/software/cflow/">GNU cflow</a></li>
<li><a href="http://cflow2vcg.sourceforge.net/">cflow2vcg</a></li>
<li>graphviz</li>
</ul>
<p>Take &#8216;rdbSaveBackground&#8217; (<a href="http://github.com/antirez/redis/blob/master/src/rdb.c">redis/rdb.c</a>) for example:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cflow <span style="color: #660033;">--format</span>=posix <span style="color: #660033;">--omit-arguments</span> <span style="color: #660033;">--level-indent</span>=<span style="color: #ff0000;">'0=\t'</span> <span style="color: #660033;">--level-indent</span>=<span style="color: #ff0000;">'1=\t'</span> <span style="color: #660033;">--level-indent</span>=<span style="color: #007800;">start</span>=<span style="color: #ff0000;">'\t'</span> <span style="color: #660033;">-m</span> <span style="color: #ff0000;">'rdbSaveBackground'</span> ~<span style="color: #000000; font-weight: bold;">/</span>osprojects<span style="color: #000000; font-weight: bold;">/</span>redis<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>rdb.c <span style="color: #000000; font-weight: bold;">|</span> cflow2dot <span style="color: #000000; font-weight: bold;">|</span> dot <span style="color: #660033;">-Tjpg</span> <span style="color: #660033;">-o</span> rdb.jpg</div></div>
<p>Output:<br />
<a href="http://www.flickr.com/photos/40741608@N08/5020142591/" title="visualization of a call tree by 贝小塔, on Flickr"><img src="http://farm5.static.flickr.com/4111/5020142591_7b34a52e3c.jpg" width="500" height="98" alt="visualization of a call tree" /></a></p>
<p>Source: <a href="http://unixdiary.blogspot.com/2006/05/using-cflow.html">unix diary</a></p>
<p>The post is brought to you by <a href="http://fedorahosted.org/lekhonee">lekhonee</a> v0.7</p>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2010/09/visualize-call-tree-of-a-c-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lua script for Geany to view manpage of functions</title>
		<link>http://sunng.info/blog/2010/09/lua-script-for-geany-to-view-manpage-of-functions/</link>
		<comments>http://sunng.info/blog/2010/09/lua-script-for-geany-to-view-manpage-of-functions/#comments</comments>
		<pubDate>Wed, 22 Sep 2010 07:37:18 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[装备]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[geany]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lua]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/2010/09/lua-script-for-geany-to-view-manpage-of-functions/</guid>
		<description><![CDATA[Requirement When editing when Geany, you need some document of system library functions at hand. So you want to browse manpage at any time. Solution Just two lines: sel=geany.selection&#40;&#41; geany.launch&#40;'rxvt-unicode', '-e', 'man', sel&#41; http://gist.github.com/591279 Install Make sure you have geany-plugin-lua &#8230; <a href="http://sunng.info/blog/2010/09/lua-script-for-geany-to-view-manpage-of-functions/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3>Requirement</h3>
<p>When editing when Geany, you need some document of system library functions at hand. So you want to browse manpage at any time.</p>
<h3>Solution</h3>
<p>Just two lines:</p>
<div class="codecolorer-container lua twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="lua codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sel<span style="color: #66cc66;">=</span>geany<span style="color: #66cc66;">.</span>selection<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
geany<span style="color: #66cc66;">.</span>launch<span style="color: #66cc66;">&#40;</span><span style="color: #ff6666;">'rxvt-unicode'</span><span style="color: #66cc66;">,</span> <span style="color: #ff6666;">'-e'</span><span style="color: #66cc66;">,</span> <span style="color: #ff6666;">'man'</span><span style="color: #66cc66;">,</span> sel<span style="color: #66cc66;">&#41;</span></div></div>
<p><a href="http://gist.github.com/591279">http://gist.github.com/591279</a></p>
<h3>Install</h3>
<p>Make sure you have geany-plugin-lua installed:<br />
<i>sudo apt-get install geany-plugin-lua</i></p>
<p>Create a lua source file named &#8216;ShowMan.lua&#8217; in <i>~/.config/geany/plugins/geanylua/</i>  . If the direcotry does not exist, you should create it first.</p>
<p>Copy two lines of lua code into this file, save and close.</p>
<p>Create a file named hotkeys.cfg in <i>~/.config/geany/plugins/geanylua/</i>, add following content:<br />
<i>ShowMan.lua</i></p>
<p>Restart geany, then open Preferences->Keybindings, Lua Script-> ShowMan, bind a key, for example, Alt+m</p>
<h3>Usage</h3>
<p>Select the function name, and press Alt+m (or from menu Tools->Lua Scripts->ShowMan), then you see the terminal and the manpage.</p>
<p><a href="http://www.flickr.com/photos/40741608@N08/5017060556/" title="geany-lua-manpage by 贝小塔, on Flickr"><img src="http://farm5.static.flickr.com/4127/5017060556_ca89e90517.jpg" width="500" height="313" alt="geany-lua-manpage" /></a></p>
<p>The post is brought to you by <a href="http://fedorahosted.org/lekhonee">lekhonee</a> v0.7</p>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2010/09/lua-script-for-geany-to-view-manpage-of-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GUI Debugging tools</title>
		<link>http://sunng.info/blog/2010/09/gui-debugging-tools/</link>
		<comments>http://sunng.info/blog/2010/09/gui-debugging-tools/#comments</comments>
		<pubDate>Sat, 18 Sep 2010 09:38:34 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[装备]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[gdb]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/2010/09/gui-debugging-tools/</guid>
		<description><![CDATA[想了解一个C程序的运行，打算用gdb来单步看一下流程，发现直接用gdb不太方便，然后模仿偶像用emacs的gdb支持(M-x gdb)。但是境界实在是比不上偶像，emacs的操作都还不熟练。最后选择了geany。geany是一个简单的C/C++ IDE，它有一个geanygdb插件可以帮助你在geany的图形界面里调试。 但是最近安装在仓库里的geanygdb插件有一些问题，会导致很高的CPU占用。不过这个问题被报告在这里，现在已经修复了。因为新版本还没有release，所以如果急着用的话，可以从svn签出代码： svn co https://geany-plugins.svn.sourceforge.net/svnroot/geany-plugins/trunk/geany-plugins 然后执行： cd geany-plugins ./autogen.sh ./configure cd geanygdb make sudo make install 重启geany，打开plugin manager，看到geanygdb的版本已经变成0.20就可以使用了。 geany现在还不支持ctags，是因为它内部有一套自己的tags实现。代码导航可以用过上下文菜单 Go to tag Definition 或者 Go to tag Declaration 实现，最好是到Preference中给这两个命令设置一个快捷键，比如Ctrl+]，再对Navigate back 设置一个Ctrl+t，就如同vim+ctags一样了。 实际上在GNOME桌面还有一个专门的GDB图形界面，叫做Nemiver。Nemiver对gdb的常用命令都有快捷键操作，把鼠标移动到代码上还可以查看变量的值，效果和eclipse调试java程序一样，非常强大。 The post is brought to you &#8230; <a href="http://sunng.info/blog/2010/09/gui-debugging-tools/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>想了解一个C程序的运行，打算用gdb来单步看一下流程，发现直接用gdb不太方便，然后模仿偶像用emacs的gdb支持(M-x gdb)。但是境界实在是比不上偶像，emacs的操作都还不熟练。最后选择了geany。<a href="http://www.geany.org">geany</a>是一个简单的C/C++ IDE，它有一个geanygdb插件可以帮助你在geany的图形界面里调试。</p>
<p>但是最近安装在仓库里的geanygdb插件有一些问题，会导致很高的CPU占用。不过这个问题被报告在<a href="http://sourceforge.net/tracker/?func=detail&amp;aid=3019827&amp;group_id=222729&amp;atid=1056532">这里</a>，现在已经修复了。因为新版本还没有release，所以如果急着用的话，可以从svn签出代码：<br />
<i>svn co https://geany-plugins.svn.sourceforge.net/svnroot/geany-plugins/trunk/geany-plugins</i><br />
然后执行：</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">cd</span> geany-plugins<br />
.<span style="color: #000000; font-weight: bold;">/</span>autogen.sh<br />
.<span style="color: #000000; font-weight: bold;">/</span>configure<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> geanygdb<br />
<span style="color: #c20cb9; font-weight: bold;">make</span><br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></div></div>
<p>重启geany，打开plugin manager，看到geanygdb的版本已经变成0.20就可以使用了。</p>
<p>geany现在还不支持ctags，是因为它内部有一套自己的tags实现。代码导航可以用过上下文菜单 Go to tag Definition 或者 Go to tag Declaration 实现，最好是到Preference中给这两个命令设置一个快捷键，比如Ctrl+]，再对Navigate back 设置一个Ctrl+t，就如同vim+ctags一样了。</p>
<p>实际上在GNOME桌面还有一个专门的GDB图形界面，叫做<a href="http://projects.gnome.org/nemiver/">Nemiver</a>。Nemiver对gdb的常用命令都有快捷键操作，把鼠标移动到代码上还可以查看变量的值，效果和eclipse调试java程序一样，非常强大。</p>
<p>The post is brought to you by <a href="http://fedorahosted.org/lekhonee">lekhonee</a> v0.7</p>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2010/09/gui-debugging-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>beanstalkd</title>
		<link>http://sunng.info/blog/2010/08/beanstalkd/</link>
		<comments>http://sunng.info/blog/2010/08/beanstalkd/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 14:40:54 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[装备]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[opensource]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/2010/08/beanstalkd/</guid>
		<description><![CDATA[beanstalkd是一个极轻量级的消息队列服务，作者的说法叫做Work Queue。 概念 Beanstalkd里包含以下几个概念： Producer Worker Job Tube Producer 与传统的消息队列服务中的概念类似，是Job的生产者。这个角色通过put命令来创建Job。 Worker 即消费者，worker通过reserve / release / bury / delete 等命令操作job的生命周期。 Job 是beanstalkd中的基本单元，一个job包含id和body，从属于一个tube。Job的生命周期是beanstalkd中的核心概念，它包含DELAYED / READY / RESERVED / BURIED / DELETED等状态。beanstalkd文档中的这个图对Job的声明周期进行了说明： http://github.com/kr/beanstalkd/blob/master/doc/protocol.txt#L81 Tube 是类似namespace的概念，Producer在生产Job前通过use指定相应的Tube。而Worker通过watch / Ignore命令来决定从哪些Tube中获得Job。 安装 Beanstalkd 可以通过很多Linux发行版的包管理器直接安装。依赖libevent 1.4.1 以上版本。 通过以下命令启动即可 &#8230; <a href="http://sunng.info/blog/2010/08/beanstalkd/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://kr.github.com/beanstalkd/">beanstalkd</a>是一个极轻量级的消息队列服务，作者的说法叫做Work Queue。</p>
<h3>概念</h3>
<p>Beanstalkd里包含以下几个概念：</p>
<ul>
<li>Producer</li>
<li>Worker</li>
<li>Job</li>
<li>Tube</li>
</ul>
<p>Producer 与传统的消息队列服务中的概念类似，是Job的生产者。这个角色通过put命令来创建Job。</p>
<p>Worker 即消费者，worker通过reserve / release / bury / delete 等命令操作job的生命周期。</p>
<p>Job 是beanstalkd中的基本单元，一个job包含id和body，从属于一个tube。Job的生命周期是beanstalkd中的核心概念，它包含DELAYED / READY / RESERVED / BURIED / DELETED等状态。beanstalkd文档中的这个图对Job的声明周期进行了说明：<br />
<a href="http://github.com/kr/beanstalkd/blob/master/doc/protocol.txt#L81">http://github.com/kr/beanstalkd/blob/master/doc/protocol.txt#L81</a></p>
<p>Tube 是类似namespace的概念，Producer在生产Job前通过use指定相应的Tube。而Worker通过watch / Ignore命令来决定从哪些Tube中获得Job。</p>
<h3>安装</h3>
<p>Beanstalkd 可以通过很多Linux发行版的包管理器直接安装。依赖libevent 1.4.1 以上版本。<br />
通过以下命令启动即可</p>
<p><i>beanstalkd -d -p &lt;PORT&gt;</i></p>
<h3>协议</h3>
<p>Beanstalkd在各方面都继承memcached的风格，协议也与memcached类似，同样是基于文本的：</p>
<p>命令 参数 [参数...] [命令体字节数]\r\n<br />
[命令体]\r\n</p>
<p>beanstalkd很多命令的返回是yaml格式，但是系统对命令体的格式并没有限制。</p>
<h3>客户端</h3>
<p>Beanstalkd协议见简单，有各种语言的客户端实现。python有一个非常简单的beanstalkc，可以通过easy_install安装。不过，这个客户端缺少断线重连机制，正式发布的0.2.0版本也有一些严重的bug。可以从github上下载源代码安装，并在使用时控制重连。</p>
<p>The post is brought to you by <a href="http://fedorahosted.org/lekhonee">lekhonee</a> v0.7</p>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2010/08/beanstalkd/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>用markdown书写文档</title>
		<link>http://sunng.info/blog/2010/07/%e7%94%a8markdown%e4%b9%a6%e5%86%99%e6%96%87%e6%a1%a3/</link>
		<comments>http://sunng.info/blog/2010/07/%e7%94%a8markdown%e4%b9%a6%e5%86%99%e6%96%87%e6%a1%a3/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 11:36:54 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[装备]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/2010/07/%e7%94%a8markdown%e4%b9%a6%e5%86%99%e6%96%87%e6%a1%a3/</guid>
		<description><![CDATA[写文档是头疼事，没人愿意写文档。在word里写文档，时间长了都怀疑自己是不是搞技术的。我阅历有限，在我的印象里就没有用word格式看过什么有价值的东西。只要一打开word想到的就是连篇累牍的废话、码字。word最重要的功能是什么？保存。其次呢？字数统计。我所写过的word文档绝大多数都是“只写”的，通常作为流程里的一个附件，没有人真正去看。 以上是人身攻击，接下来比较实际的问题，word文档不是符合unix哲学的东西。格式不开放，你就没有办法进行diff操作，把word文档放到svn里，只能使用最基本的版本控制，没法查看changeset，只知道改了，不知道改了什么。 为了改变这种情况，我试过用docbook格式。docbook用xml书写，定义了一套复杂的Schema，详细到作者的email都有定义。docbook还有丰富的工具集，可以通过xsl把docbook转换成所有你知道的文档格式。Maven: the Definitive Guide就是用docbook写成的。不过用docbook也存在一些问题，docbook太复杂了，用纯文本编辑器很难处理，作者的学习曲线也比较高，需要所见即所得的编辑器支持。与docbook相类似的DITA，也存在这样的问题，它们是重量级的格式。 轻量级的Wiki格式不错，但是Wiki格式很让人头疼就是没有统一的规范。举例，dokuwiki里顶级标题是6个=，而moinmoin里顶级标题恰恰相反是一个=，不portable，文档维护起来就非常麻烦。 铺垫了这么多，委屈以上格式了，该markdown出场了。markdown是简单的html原型，用来生成html，它的设计目标就是为了KISS，兼容html。看看一些必要的格式吧：（或者直接看Wikipedia） 标题 # 标题 ## 二级标题 &#8230; ###### 六级标题 对于一级标题还可以这么写 headline ======== 二级标题可以 headline &#8212;&#8212;&#8211; 这个怎么输入呢，我想起来前几天看vim hacks里的一组快捷键 yypoVr= yypoVr- 谁用谁知道 段落： 一段文本以两个换行结束。 换行： 一行文本行末两个空格。 图片 ![alternative text](image-url &#8220;image-title&#8221;) 用markdown，图片的alt你不写都不行。 链接 [Linktext](link &#8220;linktitle&#8221;) 列表 &#8230; <a href="http://sunng.info/blog/2010/07/%e7%94%a8markdown%e4%b9%a6%e5%86%99%e6%96%87%e6%a1%a3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>写文档是头疼事，没人愿意写文档。在word里写文档，时间长了都怀疑自己是不是搞技术的。我阅历有限，在我的印象里就没有用word格式看过什么有价值的东西。只要一打开word想到的就是连篇累牍的废话、码字。word最重要的功能是什么？保存。其次呢？字数统计。我所写过的word文档绝大多数都是“只写”的，通常作为流程里的一个附件，没有人真正去看。</p>
<p>以上是人身攻击，接下来比较实际的问题，word文档不是符合unix哲学的东西。格式不开放，你就没有办法进行diff操作，把word文档放到svn里，只能使用最基本的版本控制，没法查看changeset，只知道改了，不知道改了什么。</p>
<p>为了改变这种情况，我试过用<a href="http://www.docbook.org/">docbook</a>格式。docbook用xml书写，定义了一套复杂的Schema，详细到作者的email都有定义。docbook还有丰富的工具集，可以通过xsl把docbook转换成所有你知道的文档格式。<a href="http://www.sonatype.com/products/maven/documentation/book-defguide">Maven: the Definitive Guide</a>就是用docbook写成的。不过用docbook也存在一些问题，docbook太复杂了，用纯文本编辑器很难处理，作者的学习曲线也比较高，需要所见即所得的编辑器支持。与docbook相类似的DITA，也存在这样的问题，它们是重量级的格式。</p>
<p>轻量级的Wiki格式不错，但是Wiki格式很让人头疼就是没有统一的规范。举例，dokuwiki里顶级标题是6个=，而moinmoin里顶级标题恰恰相反是一个=，不portable，文档维护起来就非常麻烦。</p>
<p>铺垫了这么多，委屈以上格式了，该<a href="http://daringfireball.net/projects/markdown/">markdown</a>出场了。markdown是简单的html原型，用来生成html，它的设计目标就是为了KISS，兼容html。看看一些必要的格式吧：（或者直接看<a href="http://en.wikipedia.org/wiki/Markdown">Wikipedia</a>）<br />
标题<br />
# 标题<br />
## 二级标题<br />
&#8230;<br />
###### 六级标题</p>
<p>对于一级标题还可以这么写<br />
headline<br />
========<br />
二级标题可以<br />
headline<br />
&#8212;&#8212;&#8211;<br />
这个怎么输入呢，我想起来前几天看vim hacks里的一组快捷键<br />
yypoVr=<br />
yypoVr-<br />
谁用谁知道</p>
<p>段落：<br />
一段文本以两个换行结束。<br />
换行：<br />
一行文本行末两个空格。</p>
<p>图片<br />
![alternative text](image-url &#8220;image-title&#8221;)<br />
用markdown，图片的alt你不写都不行。</p>
<p>链接<br />
[Linktext](link &#8220;linktitle&#8221;)</p>
<p>列表<br />
ul 无序列表<br />
*<br />
*<br />
ol 有序列表<br />
1.<br />
2.</p>
<p>以上就是主要的格式支持。用标题来划分文档层次，没有多余的格式，没有机会让你五颜六色。</p>
<p>在linux上可以安装markdown的处理脚本：<br />
apt-get install markdown<br />
安装vim的语法文件：</p>
<p>http://www.vim.org/scripts/script.php?script_id=1242</p>
<p>这里是一个简单的例子：</p>
<p>http://github.com/sunng87/exaile-doubanfm-plugin/blob/master/README.mkd</p>
<p>The post is brought to you by <a href="http://fedorahosted.org/lekhonee">lekhonee</a> v0.7</p>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2010/07/%e7%94%a8markdown%e4%b9%a6%e5%86%99%e6%96%87%e6%a1%a3/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Exaile-doubanfm-plugin 0.0.2</title>
		<link>http://sunng.info/blog/2010/07/exaile-doubanfm-plugin-0-0-2/</link>
		<comments>http://sunng.info/blog/2010/07/exaile-doubanfm-plugin-0-0-2/#comments</comments>
		<pubDate>Sun, 04 Jul 2010 14:17:53 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[ANN]]></category>
		<category><![CDATA[Douban]]></category>
		<category><![CDATA[exaile]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[gtk]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/2010/07/exaile-doubanfm-plugin-0-0-2/</guid>
		<description><![CDATA[Exaile doubanfm plugin 0.0.2 预览版，目标是在Linux桌面提供豆瓣电台的完整体验。 目前插件只能运行在Exaile 0.3.1版本上。 0.0.2增加了豆瓣电台专用的视图： 相比第一版通过rating来实现豆瓣电台喜欢、跳过和删除的功能，在专用视图上有专门的按钮来操作。 其他细节更新： 当剩余曲目超过15首时不再增加播放列表 当播放到最后一首歌曲取新播放列表时增加重试机制 修正libdbfm跳过曲目bug一个 安装： 打开Exaile Preference，Plugin页，点击按钮Install Plugin，选择doubanfm.exz即可。如果存在问题，可以执行以下命令： mv doubanfm.exz douban.tar.gz tar xf doubanfm.tar.gz mv doubanfm ~/.local/share/exaile/plugins/ 转到doubanfm设置页面，填写用户名密码重启Exaile。 打开File菜单，选择豆瓣电台频道 选择曲目就可以开始播放了，选择视图中豆瓣电台视图可以切换到豆瓣电台视图。 项目地址： http://github.com/sunng87/exaile-doubanfm-plugin 下载： http://github.com/sunng87/exaile-doubanfm-plugin/downloads 另外，doubancovers插件也有一个针对豆瓣电台的更新可以快速获取豆瓣电台音乐的封面： http://bitbucket.org/sunng/exailedoubancovers/downloads?highlight=9265 The post is brought to &#8230; <a href="http://sunng.info/blog/2010/07/exaile-doubanfm-plugin-0-0-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Exaile doubanfm plugin 0.0.2 预览版，目标是在Linux桌面提供豆瓣电台的完整体验。</p>
<p><strong>目前插件只能运行在Exaile 0.3.1版本上。</strong></p>
<p>0.0.2增加了豆瓣电台专用的视图：<br />
<a href="http://www.flickr.com/photos/40741608@N08/4760493886/" title="screenshot_001 by 贝小塔, on Flickr"><img src="http://farm5.static.flickr.com/4075/4760493886_5e334726cf.jpg" width="408" height="156" alt="screenshot_001" /></a></p>
<p>相比第一版通过rating来实现豆瓣电台喜欢、跳过和删除的功能，在专用视图上有专门的按钮来操作。</p>
<p>其他细节更新：</p>
<ul>
<li>当剩余曲目超过15首时不再增加播放列表</li>
<li>当播放到最后一首歌曲取新播放列表时增加重试机制</li>
<li>修正libdbfm跳过曲目bug一个</li>
</ul>
<p>安装：<br />
打开Exaile Preference，Plugin页，点击按钮Install Plugin，选择doubanfm.exz即可。如果存在问题，可以执行以下命令：<br />
mv doubanfm.exz douban.tar.gz<br />
tar xf doubanfm.tar.gz<br />
mv doubanfm ~/.local/share/exaile/plugins/</p>
<p>转到doubanfm设置页面，填写用户名密码重启Exaile。<br />
<a href="http://www.flickr.com/photos/40741608@N08/4754666940/" title="screenshot_002 by 贝小塔, on Flickr"><img src="http://farm5.static.flickr.com/4141/4754666940_b998d99c4b.jpg" width="500" height="412" alt="screenshot_002" /></a></p>
<p>打开File菜单，选择豆瓣电台频道<br />
<a href="http://www.flickr.com/photos/40741608@N08/4754619030/" title="screenshot_001 by 贝小塔, on Flickr"><img src="http://farm5.static.flickr.com/4094/4754619030_933e00fcfa.jpg" width="500" height="359" alt="screenshot_001" /></a></p>
<p>选择曲目就可以开始播放了，选择视图中豆瓣电台视图可以切换到豆瓣电台视图。</p>
<p>项目地址：<br />
<a href="http://github.com/sunng87/exaile-doubanfm-plugin">http://github.com/sunng87/exaile-doubanfm-plugin</a></p>
<p>下载：<br />
<a href="http://github.com/sunng87/exaile-doubanfm-plugin/downloads">http://github.com/sunng87/exaile-doubanfm-plugin/downloads</a></p>
<p>另外，doubancovers插件也有一个针对豆瓣电台的更新可以快速获取豆瓣电台音乐的封面：<br />
<a href="http://bitbucket.org/sunng/exailedoubancovers/downloads?highlight=9265">http://bitbucket.org/sunng/exailedoubancovers/downloads?highlight=9265</a></p>
<p>The post is brought to you by <a href="http://fedorahosted.org/lekhonee">lekhonee</a> v0.7</p>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2010/07/exaile-doubanfm-plugin-0-0-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

