<?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/"
	xmlns:georss="http://www.georss.org/georss">

<channel>
	<title>Here comes the Sun</title>
	<atom:link href="http://sunng.info/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://sunng.info/blog</link>
	<description>Life ramblings</description>
	<lastBuildDate>Thu, 02 Sep 2010 12:29:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>ls my python packages</title>
		<link>http://sunng.info/blog/2010/09/ls-my-python-packages/</link>
		<comments>http://sunng.info/blog/2010/09/ls-my-python-packages/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 12:29:07 +0000</pubDate>
		<dc:creator>Sunng</dc:creator>
				<category><![CDATA[装备]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/2010/09/ls-my-python-packages/</guid>
		<description><![CDATA[在豆瓣上看到一个无聊的秀gems的活动，我也无聊一下，秀一下eggs。 ls /usr/local/lib/python2.6/dist-packages/ &#124; grep .egg &#124; sed &#8216;s/\(.*\)/&#60;li&#62;\1&#60;\/li&#62;/&#8217; amqplib-0.6.1-py2.6.egg argparse-1.1-py2.6.egg-info AuthKit-0.4.5-py2.6.egg avro-1.3.3-py2.6.egg Beaker-1.3-py2.6.egg Beaker-1.5.4-py2.6.egg beanstalkc-0.2.0-py2.6.egg bottle-0.8.1-py2.6.egg bottle-0.8.3-py2.6.egg bpython-0.9.6.2-py2.6.egg bson-0.1.2-py2.6.egg CherryPy-3.1.2-py2.6.egg CouchDB-0.6-py2.6.egg coverage-3.2-py2.6-linux-i686.egg Cython-0.12.1-py2.6-linux-i686.egg decorator-3.0.0-py2.6.egg distribute-0.6.14-py2.6.egg Django-1.0.2_final-py2.6.egg Django-1.1-py2.6.egg Django-1.2-py2.6.egg django_sphinx-2.2.3-py2.6.egg docutils-0.6-py2.6.egg Editra-0.4.95-py2.6.egg Editra-0.5.05-py2.6.egg Editra-0.5.72-py2.6.egg elementtree-1.2.7_20070827_preview-py2.6.egg eventlet-0.9.9-py2.6.egg Fabric-0.9.1-py2.6.egg fapws3-0.5.dev-py2.6-linux-i686.egg FormEncode-1.2.1-py2.6.egg GeoAlchemy-0.1-py2.6.egg Geohash-1.0rc1-py2.6.egg gevent-0.13.0.egg-info greenlet-0.3.1-py2.6-linux-i686.egg gunicorn-0.10.0-py2.6.egg gunicorn-0.11.0-py2.6.egg gunicorn-0.8.1-py2.6.egg httplib2-0.5.0-py2.6.egg ipython-0.10-py2.6.egg ipython-0.9.1-py2.6.egg Jinja2-2.5-py2.6.egg Mako-0.2.4-py2.6.egg Mako-0.3.4-py2.6.egg Markdoc-0.6.4-py2.6.egg-info Markdown-2.0.3-py2.6.egg Markdown-2.0.3-py2.6.egg-info [...]]]></description>
			<content:encoded><![CDATA[<p>在豆瓣上看到一个无聊的<a href="http://www.douban.com/online/10544092/">秀gems的活动</a>，我也无聊一下，秀一下eggs。</p>
<p><i>ls /usr/local/lib/python2.6/dist-packages/ | grep .egg | sed &#8216;s/\(.*\)/&lt;li&gt;\1&lt;\/li&gt;/&#8217;</i></p>
<ul>
<li>amqplib-0.6.1-py2.6.egg</li>
<li>argparse-1.1-py2.6.egg-info</li>
<li>AuthKit-0.4.5-py2.6.egg</li>
<li>avro-1.3.3-py2.6.egg</li>
<li>Beaker-1.3-py2.6.egg</li>
<li>Beaker-1.5.4-py2.6.egg</li>
<li>beanstalkc-0.2.0-py2.6.egg</li>
<li>bottle-0.8.1-py2.6.egg</li>
<li>bottle-0.8.3-py2.6.egg</li>
<li>bpython-0.9.6.2-py2.6.egg</li>
<li>bson-0.1.2-py2.6.egg</li>
<li>CherryPy-3.1.2-py2.6.egg</li>
<li>CouchDB-0.6-py2.6.egg</li>
<li>coverage-3.2-py2.6-linux-i686.egg</li>
<li>Cython-0.12.1-py2.6-linux-i686.egg</li>
<li>decorator-3.0.0-py2.6.egg</li>
<li>distribute-0.6.14-py2.6.egg</li>
<li>Django-1.0.2_final-py2.6.egg</li>
<li>Django-1.1-py2.6.egg</li>
<li>Django-1.2-py2.6.egg</li>
<li>django_sphinx-2.2.3-py2.6.egg</li>
<li>docutils-0.6-py2.6.egg</li>
<li>Editra-0.4.95-py2.6.egg</li>
<li>Editra-0.5.05-py2.6.egg</li>
<li>Editra-0.5.72-py2.6.egg</li>
<li>elementtree-1.2.7_20070827_preview-py2.6.egg</li>
<li>eventlet-0.9.9-py2.6.egg</li>
<li>Fabric-0.9.1-py2.6.egg</li>
<li>fapws3-0.5.dev-py2.6-linux-i686.egg</li>
<li>FormEncode-1.2.1-py2.6.egg</li>
<li>GeoAlchemy-0.1-py2.6.egg</li>
<li>Geohash-1.0rc1-py2.6.egg</li>
<li>gevent-0.13.0.egg-info</li>
<li>greenlet-0.3.1-py2.6-linux-i686.egg</li>
<li>gunicorn-0.10.0-py2.6.egg</li>
<li>gunicorn-0.11.0-py2.6.egg</li>
<li>gunicorn-0.8.1-py2.6.egg</li>
<li>httplib2-0.5.0-py2.6.egg</li>
<li>ipython-0.10-py2.6.egg</li>
<li>ipython-0.9.1-py2.6.egg</li>
<li>Jinja2-2.5-py2.6.egg</li>
<li>Mako-0.2.4-py2.6.egg</li>
<li>Mako-0.3.4-py2.6.egg</li>
<li>Markdoc-0.6.4-py2.6.egg-info</li>
<li>Markdown-2.0.3-py2.6.egg</li>
<li>Markdown-2.0.3-py2.6.egg-info</li>
<li>MarkupSafe-0.9.2-py2.6-linux-i686.egg</li>
<li>meinheld-0.3.1-py2.6-linux-i686.egg</li>
<li>Ming-0.2-py2.6.egg</li>
<li>mock-0.6.0-py2.6.egg</li>
<li>mocker-0.10.1-py2.6.egg</li>
<li>MySQL_python-1.2.3c1-py2.6-linux-i686.egg</li>
<li>networkx-1.0rc1-py2.6.egg</li>
<li>nose-0.10.4-py2.6.egg</li>
<li>numpy-1.4.1-py2.6-linux-i686.egg</li>
<li>Paste-1.7.2-py2.6.egg</li>
<li>PasteDeploy-1.3.3-py2.6.egg</li>
<li>PasteScript-1.7.3-py2.6.egg</li>
<li>pip-0.4-py2.6.egg</li>
<li>pip-0.8-py2.6.egg</li>
<li>progressbar-2.2-py2.6.egg</li>
<li>psycopg2-2.2.2-py2.6-linux-i686.egg</li>
<li>pycurl-7.19.0-py2.6-linux-i686.egg</li>
<li>pyev-0.5.3_3.8-py2.6-linux-i686.egg</li>
<li>Pygments-1.0-py2.6.egg</li>
<li>Pygments-1.3.1-py2.6.egg</li>
<li>pygooglechart-0.2.1-py2.6.egg</li>
<li>PyGreSQL-4.0-py2.6-linux-i686.egg</li>
<li>Pylons-0.9.7-py2.6.egg</li>
<li>Pylons-1.0-py2.6.egg</li>
<li>pymongo-1.6-py2.6-linux-i686.egg</li>
<li>pymongo-1.7-py2.6-linux-i686.egg</li>
<li>pymongo-1.8-py2.6-linux-i686.egg</li>
<li>pysal-1.0.0.egg-info</li>
<li>python_cjson-1.0.5-py2.6-linux-i686.egg</li>
<li>python_memcached-1.45-py2.6.egg</li>
<li>python_openid-2.2.5-py2.6.egg</li>
<li>PyXML-0.8.4-py2.6-linux-i686.egg</li>
<li>PyYAML-3.09-py2.6.egg-info</li>
<li>RDFobject-0.1.4-py2.6.egg</li>
<li>Rocket-1.1.1-py2.6.egg</li>
<li>Routes-1.10.3-py2.6.egg</li>
<li>Routes-1.12.3-py2.6.egg</li>
<li>Rtree-0.6.0-py2.6.egg</li>
<li>ruffus-2.2-py2.6.egg</li>
<li>scipy-0.8.0-py2.6-linux-i686.egg</li>
<li>setuptools-0.6c11-py2.6.egg-info</li>
<li>setuptools-0.6c9-py2.6.egg</li>
<li>setuptools-0.6c9-py2.6.egg.OLD.1283177768.67</li>
<li>Shapely-1.0.12-py2.6.egg</li>
<li>Shapely-1.2-py2.6.egg</li>
<li>simplejson-2.0.8-py2.6.egg</li>
<li>Spawning-0.9.3rc2-py2.6.egg</li>
<li>Sphinx-1.0b2-py2.6.egg</li>
<li>SQLAlchemy-0.6.3-py2.6.egg</li>
<li>Tempita-0.2-py2.6.egg</li>
<li>threadpool-1.2.7-py2.6.egg</li>
<li>tornado-0.2-py2.6.egg</li>
<li>twill-0.9-py2.6.egg</li>
<li>Twisted-10.1.0-py2.6-linux-i686.egg</li>
<li>vimpdb-0.3.8-py2.6.egg</li>
<li>virtualenv-1.3.3-py2.6.egg</li>
<li>WebError-0.10.1-py2.6.egg</li>
<li>WebHelpers-0.6.4-py2.6.egg</li>
<li>WebOb-0.9.6.1-py2.6.egg</li>
<li>web.py-0.32-py2.6.egg-info</li>
<li>web.py-0.34-py2.6.egg</li>
<li>WebTest-1.1-py2.6.egg</li>
<li>Werkzeug-0.6.2-py2.6.egg</li>
<li>whizzer-0.2.egg-info</li>
</ul>
<p>话说用sed能不能让开头重复的行不输出呢？或者什么命令能实现？</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/ls-my-python-packages/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Open for a new job</title>
		<link>http://sunng.info/blog/2010/08/open-for-a-new-job/</link>
		<comments>http://sunng.info/blog/2010/08/open-for-a-new-job/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 14:15:28 +0000</pubDate>
		<dc:creator>Sunng</dc:creator>
				<category><![CDATA[广告]]></category>
		<category><![CDATA[job]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/2010/08/open-for-a-new-job/</guid>
		<description><![CDATA[I am about to leave current company and looking for a new challenge for future. If you are interested, and also looking for a Java or Python developer, please check the hot baked resume: en zh Actually, I am not good at documenting myself. So if you need more details, feel free to get connected [...]]]></description>
			<content:encoded><![CDATA[<p>I am about to leave current company and looking for a new challenge for future. If you are interested, and also looking for a Java or Python developer, please check the hot baked resume:</p>
<ul>
<li><a href="http://sunng.info/resume_en.html">en</a></li>
<li><a href="http://sunng.info/resume_cn.html">zh</a></li>
</ul>
<p>Actually, I am not good at documenting myself. So if you need more details, feel free to get connected with email: classicning[at]gmail.com </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/open-for-a-new-job/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>周记</title>
		<link>http://sunng.info/blog/2010/08/%e5%91%a8%e8%ae%b0/</link>
		<comments>http://sunng.info/blog/2010/08/%e5%91%a8%e8%ae%b0/#comments</comments>
		<pubDate>Sat, 28 Aug 2010 15:22:54 +0000</pubDate>
		<dc:creator>Sunng</dc:creator>
				<category><![CDATA[自话]]></category>
		<category><![CDATA[bason]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/2010/08/%e5%91%a8%e8%ae%b0/</guid>
		<description><![CDATA[先讲个笑话，然后回顾一下这个星期。 这个星期从周四晚上开始，和一位外国朋友一位台湾女士聊天。第一次经历这样的场面，忐忑得很，起初还尝试和大家说英文的，奈何我的口语和听力实在是难以支撑，最后不知不觉间大家都平滑过渡到中文了。后来我想着听力还可以通过看InfoQ上的会议录像什么的练习一下，口语就鲜有机会和场合提升了。进而又想到长期在一个小环境里做重复的事情，有些能力的退化你甚至都感觉不到，更不要说原先不具备的能力了，你甚至都不能觉察到自己缺乏某一方面的训练。 今天下午又和原先在IBM实习的同事聚会，正好在五角场附近转转。比起张江这种近乎边缘的生活环境，五角场实在是强太多了，更难能可贵的是如果你在附近转一转，询问一下房租，那里的生活成本实际上并不比张江高，生活质量实在是没法比。这是为什么呢？不理解。另外今天看到了samson理解不了的沃尔玛，还有传说中那一片Oracle / EMC / eBao / 百度。上海真是大，地铁走几站就是一个完全不同的世界。 从同事那里了解到了团购网站的一些事情，这年头，好像不做个团购网站都不好意思跟人打招呼似的。于是有了这种东西，又是一窝蜂，这就是我们的互联网，你有什么意见呢。 昨天本想写一个对 Continuous Deployment 的理解来着，结果不料电脑过热死机了。什么原因呢，原来是浏览器里开着一个崔永元的网站，一个基于flash的网站，你懂的，CPU一直占满。这么明显的、严重的、高能耗的问题，这么多年了，Adobe一点动作都没有。另外我发现今天禁用了Adobe的Flashplayer居然Firefox的Ctrl+C/Ctrl+T等等几个快捷键突然恢复了，对于这种情况还是不说什么吧。最近听说开源的实现gnash已经可以播放Youtube的视频了（当然严格地说这事跟咱们没什么关系），一会写完blog我决定配置一下试试。 这周另一个重要的事情是Kindle 3上市了，第一次对一个手持设备产生这么强烈的兴趣。而且尤其是发现你没有那么容易的渠道能够买到它的时候，这种兴趣膨胀得更厉害了。半年前电子墨水的电子书都还在2000人民币以上，这次6寸不带3G的Kindle 3只要139美元，折合人民币连950都不到，这个领域很快又要炸开锅了。 最后，我把Bason放到Sonatype的OSS Repository上了。Sonatype提供了一个免费的Maven仓库，你可以把自己的开源项目deploy到这个仓库中方便分发。详情您可以去看sonatype提供的文档。 The post is brought to you by lekhonee v0.7]]></description>
			<content:encoded><![CDATA[<p>先讲个<a href="http://www.douban.com/group/topic/13651452/">笑话</a>，然后回顾一下这个星期。</p>
<p>这个星期从周四晚上开始，和一位外国朋友一位台湾女士聊天。第一次经历这样的场面，忐忑得很，起初还尝试和大家说英文的，奈何我的口语和听力实在是难以支撑，最后不知不觉间大家都平滑过渡到中文了。后来我想着听力还可以通过看InfoQ上的会议录像什么的练习一下，口语就鲜有机会和场合提升了。进而又想到长期在一个小环境里做重复的事情，有些能力的退化你甚至都感觉不到，更不要说原先不具备的能力了，你甚至都不能觉察到自己缺乏某一方面的训练。</p>
<p>今天下午又和原先在IBM实习的同事聚会，正好在五角场附近转转。比起张江这种近乎边缘的生活环境，五角场实在是强太多了，更难能可贵的是如果你在附近转一转，询问一下房租，那里的生活成本实际上并不比张江高，生活质量实在是没法比。这是为什么呢？不理解。另外今天看到了<a href="http://blog.samsonis.me/2010/08/update-41-%E6%9C%89%E4%BA%9B%E4%BA%8B%E6%83%85%E6%88%91%E8%BF%98%E7%9C%9F%E4%B8%8D%E7%90%86%E8%A7%A3/">samson理解不了的沃尔玛</a>，还有传说中那一片Oracle / EMC / eBao / 百度。上海真是大，地铁走几站就是一个完全不同的世界。</p>
<p>从同事那里了解到了团购网站的一些事情，这年头，好像不做个团购网站都不好意思跟人打招呼似的。于是有了<a href="http://www.zuitu.com/">这种东西</a>，又是一窝蜂，这就是我们的互联网，你有什么意见呢。</p>
<p>昨天本想写一个对 Continuous Deployment 的理解来着，结果不料电脑过热死机了。什么原因呢，原来是浏览器里开着一个崔永元的网站，一个基于flash的网站，你懂的，CPU一直占满。这么明显的、严重的、高能耗的问题，这么多年了，Adobe一点动作都没有。另外我发现今天禁用了Adobe的Flashplayer居然Firefox的Ctrl+C/Ctrl+T等等几个快捷键突然恢复了，对于这种情况还是不说什么吧。最近听说开源的实现<a href="http://digitizor.com/2010/08/23/gnash-0-88-released-100-youtube-compatible-now/">gnash已经可以播放Youtube的视频</a>了（当然严格地说这事跟咱们没什么关系），一会写完blog我决定配置一下试试。</p>
<p>这周另一个重要的事情是Kindle 3上市了，第一次对一个手持设备产生这么强烈的兴趣。而且尤其是发现你没有那么容易的渠道能够买到它的时候，这种兴趣膨胀得更厉害了。半年前电子墨水的电子书都还在2000人民币以上，这次6寸不带3G的Kindle 3只要139美元，折合人民币连950都不到，这个领域很快又要炸开锅了。</p>
<p>最后，我把Bason放到Sonatype的<a href="https://oss.sonatype.org/content/repositories/snapshots/info/sunng/bason/"></a>OSS Repository上了。Sonatype提供了一个免费的Maven仓库，你可以把自己的开源项目deploy到这个仓库中方便分发。详情您可以去看<a href="https://docs.sonatype.org/display/repository/sonatype+oss+maven+repository+usage+guide">sonatype提供的文档</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/08/%e5%91%a8%e8%ae%b0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bason: A BSON Serialization Code Generator</title>
		<link>http://sunng.info/blog/2010/08/bason-a-bson-serialization-code-generator/</link>
		<comments>http://sunng.info/blog/2010/08/bason-a-bson-serialization-code-generator/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 15:40:01 +0000</pubDate>
		<dc:creator>Sunng</dc:creator>
				<category><![CDATA[广告]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[opensource]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/2010/08/bason-a-bson-serialization-code-generator/</guid>
		<description><![CDATA[Bason is a code generator for object to bson serialization and deserialization. Different from tranditional reflection way, bason uses an annotation processor to generate serialization manager at compile time. You just add Bason as compilation dependency and drop it in the runtime. To use Bason, you simply add annotation to JavaBeans: /** &#160;* &#160;*/ package [...]]]></description>
			<content:encoded><![CDATA[<p>Bason is a code generator for object to bson serialization and deserialization. Different from tranditional reflection way, bason uses an annotation processor to generate serialization manager at compile time. You just add Bason as compilation dependency and drop it in the runtime.</p>
<p>To use Bason, you simply add annotation to JavaBeans:</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
&nbsp;* <br />
&nbsp;*/</span><br />
<span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">info.sunng.bason.example</span><span style="color: #339933;">;</span><br />
<br />
<br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Date</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">info.sunng.bason.annotations.BsonAlias</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">info.sunng.bason.annotations.BsonDocument</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">info.sunng.bason.annotations.BsonIgnore</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
&nbsp;* @author SunNing<br />
&nbsp;*<br />
&nbsp;* @since Aug 18, 2010<br />
&nbsp;*/</span><br />
@BsonDocument<br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Passenger <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">double</span> packageWeight<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">long</span> ticketId<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> name<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adate+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Date</span></a> createdDate<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> Flight flight<span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
&nbsp; &nbsp; &nbsp;* @return the packageWeight<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; @BsonIgnore<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">double</span> getPackageWeight<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> packageWeight<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
&nbsp; &nbsp; &nbsp;* @param packageWeight the packageWeight to set<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setPackageWeight<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">double</span> packageWeight<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">packageWeight</span> <span style="color: #339933;">=</span> packageWeight<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
&nbsp; &nbsp; &nbsp;* @return the ticketId<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; @BsonAlias<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ticket&quot;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">long</span> getTicketId<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> ticketId<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
&nbsp; &nbsp; &nbsp;* @param ticketId the ticketId to set<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setTicketId<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">long</span> ticketId<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">ticketId</span> <span style="color: #339933;">=</span> ticketId<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
&nbsp; &nbsp; &nbsp;* @return the name<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> getName<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> name<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
&nbsp; &nbsp; &nbsp;* @param name the name to set<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setName<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> name<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">name</span> <span style="color: #339933;">=</span> name<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
&nbsp; &nbsp; &nbsp;* @param createdDate the createdDate to set<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setCreatedDate<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adate+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Date</span></a> createdDate<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">createdDate</span> <span style="color: #339933;">=</span> createdDate<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
&nbsp; &nbsp; &nbsp;* @return the createdDate<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adate+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Date</span></a> getCreatedDate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> createdDate<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
&nbsp; &nbsp; &nbsp;* @param flight the flight to set<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setFlight<span style="color: #009900;">&#40;</span>Flight flight<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">flight</span> <span style="color: #339933;">=</span> flight<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
&nbsp; &nbsp; &nbsp;* @return the flight<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> Flight getFlight<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> flight<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #009900;">&#125;</span></div></div>
<ul>
<li>@BsonDocument marks this bean to be processed by bason processor. Serialization and deserialization support for this bean will be added to the manager. The bean must follow the Java Bean specification that has a getter and a setter for each property.</li>
<li>@BsonAlias on the getter allows user the specify a name for bson document instead of the default java bean property name.</li>
<li>@BsonIgnore on the getter marks a property to be transient when serialization and deserialization.</li>
</ul>
<p>Then you need a <i>bason.properties</i> at the root of classpath which looks like</p>
<div class="codecolorer-container properties default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="properties codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000080; font-weight:bold;">bason.managerClassName</span><span style="color: #000000;">=</span><span style="color: #008000; font-weight:bold;">info.sunng.bason.BasonManager</span></div></div>
<p>You specify the manager class name here. This name can not be duplicated if you use Bason in multiple modules.</p>
<p>Take maven configuration as an example:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependencies<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>info.sunng.bason<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>bason-annotation<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;scope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>compile<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/scope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>info.sunng.bason<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>bason-internal<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;scope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>compile<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/scope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.mongodb<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>mongo-java-driver<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependencies<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;build<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;finalName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>${project.artifactId}<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/finalName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;plugins<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;plugin<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.apache.maven.plugins<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>maven-compiler-plugin<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;source<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1.6<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/source<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1.6<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;compilerArguments<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;processor<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>info.sunng.bason.internal.BasonProcessor<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/processor<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/compilerArguments<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/plugin<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/plugins<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/build<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>when everything is ready, run <i>mvn compile</i> to generate the manager source file. By default, in a standard maven project, the generated file will be placed at:<br />
<i>/bason-example/target/generated-sources/annotations/</i></p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">info.sunng.bason</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.bson.*</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.annotation.Generated</span><span style="color: #339933;">;</span><br />
@Generated<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">&quot;info.sunng.bason.BasonManager&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000000; font-weight: bold;">class</span> BasonManager<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> BSONObject toBson<span style="color: #009900;">&#40;</span>info.<span style="color: #006633;">sunng</span>.<span style="color: #006633;">bason</span>.<span style="color: #006633;">example</span>.<span style="color: #006633;">Passenger</span> o<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>o <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Anullpointerexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">NullPointerException</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; BSONObject bson <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> BasicBSONObject<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; bson.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ticket&quot;</span>,o.<span style="color: #006633;">getTicketId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; bson.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;name&quot;</span>,o.<span style="color: #006633;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; bson.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;createdDate&quot;</span>,o.<span style="color: #006633;">getCreatedDate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; bson.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;flight&quot;</span>,toBson<span style="color: #009900;">&#40;</span>o.<span style="color: #006633;">getFlight</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> bson<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> info.<span style="color: #006633;">sunng</span>.<span style="color: #006633;">bason</span>.<span style="color: #006633;">example</span>.<span style="color: #006633;">Passenger</span> fromBson<span style="color: #009900;">&#40;</span>info.<span style="color: #006633;">sunng</span>.<span style="color: #006633;">bason</span>.<span style="color: #006633;">example</span>.<span style="color: #006633;">Passenger</span> o, BSONObject bson<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>o <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span> <span style="color: #339933;">||</span> bson <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Anullpointerexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">NullPointerException</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; o.<span style="color: #006633;">setTicketId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>java.<span style="color: #006633;">lang</span>.<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Along+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Long</span></a><span style="color: #009900;">&#41;</span>bson.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ticket&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; o.<span style="color: #006633;">setName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>java.<span style="color: #006633;">lang</span>.<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a><span style="color: #009900;">&#41;</span>bson.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;name&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; o.<span style="color: #006633;">setCreatedDate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>java.<span style="color: #006633;">util</span>.<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adate+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Date</span></a><span style="color: #009900;">&#41;</span>bson.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;createdDate&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; o.<span style="color: #006633;">setFlight</span><span style="color: #009900;">&#40;</span>fromBson<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> info.<span style="color: #006633;">sunng</span>.<span style="color: #006633;">bason</span>.<span style="color: #006633;">example</span>.<span style="color: #006633;">Flight</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, <span style="color: #009900;">&#40;</span>BSONObject<span style="color: #009900;">&#41;</span>bson.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;flight&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> o<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> BSONObject toBson<span style="color: #009900;">&#40;</span>info.<span style="color: #006633;">sunng</span>.<span style="color: #006633;">bason</span>.<span style="color: #006633;">example</span>.<span style="color: #006633;">Flight</span> o<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>o <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Anullpointerexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">NullPointerException</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; BSONObject bson <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> BasicBSONObject<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; bson.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;company&quot;</span>,o.<span style="color: #006633;">getCompany</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; bson.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;flightId&quot;</span>,o.<span style="color: #006633;">getFlightId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> bson<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> info.<span style="color: #006633;">sunng</span>.<span style="color: #006633;">bason</span>.<span style="color: #006633;">example</span>.<span style="color: #006633;">Flight</span> fromBson<span style="color: #009900;">&#40;</span>info.<span style="color: #006633;">sunng</span>.<span style="color: #006633;">bason</span>.<span style="color: #006633;">example</span>.<span style="color: #006633;">Flight</span> o, BSONObject bson<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>o <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span> <span style="color: #339933;">||</span> bson <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Anullpointerexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">NullPointerException</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; o.<span style="color: #006633;">setCompany</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>java.<span style="color: #006633;">lang</span>.<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a><span style="color: #009900;">&#41;</span>bson.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;company&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; o.<span style="color: #006633;">setFlightId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>java.<span style="color: #006633;">lang</span>.<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a><span style="color: #009900;">&#41;</span>bson.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;flightId&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> o<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>The project is hosted at<br />
<a href="http://github.com/sunng87/bason">http://github.com/sunng87/bason</a></p>
<p>If you have any ideas, just let me know.</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/bason-a-bson-serialization-code-generator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introduction to Amoeba</title>
		<link>http://sunng.info/blog/2010/08/introduction-to-amoeba/</link>
		<comments>http://sunng.info/blog/2010/08/introduction-to-amoeba/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 09:22:26 +0000</pubDate>
		<dc:creator>Sunng</dc:creator>
				<category><![CDATA[广告]]></category>
		<category><![CDATA[amoeba]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/2010/08/introduction-to-amoeba/</guid>
		<description><![CDATA[Amoeba is a distributed database middleware works as mysql proxy, provides sharding and high availability support for large scale applications using multiple mysql servers as backend. Compatible with mysql protocol, Amoeba is fully transparent to any client using standard mysql drivers, which means, to use Amoeba you don&#8217;t have to modify any code of database [...]]]></description>
			<content:encoded><![CDATA[<p>Amoeba is a distributed database middleware works as mysql proxy, provides sharding and high availability support for large scale applications using multiple mysql servers as backend.</p>
<p>Compatible with mysql protocol, Amoeba is fully transparent to any client using standard mysql drivers, which means, to use Amoeba you don&#8217;t have to modify any code of database connector. You just configure rules for amoeba, then the client request will automatically route to certain mysql instance. Amoeba has a flexible set of configuration rules that can satisfy your requirements.</p>
<p>Amoeba is written in Java, and deployed on Linux server in most cases. The IO module is built on the top of Java nonblocking IO, which keeps communication between client, Amoeba and mysql at a high performance. </p>
<p>The project is initialized in 2008. Stable release 1.2.1-GA have been available since July, 2010 . It is now serving on the production environment of the social networks <a href="http://t.sdo.com/">http://t.sdo.com/</a></p>
<p>Project home:<br />
<a href="http://code.google.com/p/amoeba/">http://code.google.com/p/amoeba/</a></p>
<p>Development logs:<br />
<a href="http://amoeba.meidusa.com/wordpress/">http://amoeba.meidusa.com/wordpress/</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/08/introduction-to-amoeba/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>geb for browser functional testing</title>
		<link>http://sunng.info/blog/2010/08/geb-for-browser-functional-testing/</link>
		<comments>http://sunng.info/blog/2010/08/geb-for-browser-functional-testing/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 14:42:14 +0000</pubDate>
		<dc:creator>Sunng</dc:creator>
				<category><![CDATA[装备]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/2010/08/geb-for-browser-functional-test/</guid>
		<description><![CDATA[虽然现在不做前段了，但是发现好的工具还是很兴奋。今天在twitter上看到Grails in Action的作者 @pledbrook 转了一个geb 0.4的消息，顺带看了一下这个工具 http://geb.codehaus.org geb项目旨在创造一套groovy dsl帮助人们进行webapp的functional test。它是对selenium的封装，举例： @Grapes&#40;&#91; &#160; &#160; @Grab&#40;'org.seleniumhq.selenium:selenium-firefox-driver:latest.release'&#41;, &#160; &#160; @Grab&#40;'org.codehaus.geb:geb-core:latest.release'&#41; &#93;&#41; import geb.* println &#34;Dependencies downloaded, ready for testing&#34; Browser.drive&#40;'http://sunng.info:8000/Pacajus'&#41;&#123; &#160; &#160; assert title== 'Pacajus' &#160; &#160; assert $&#40;&#34;p&#34;, 3&#41;.text&#40;&#41; == 'Population: 41558' &#125; println &#34;Tested, bye&#34; 打开页面，执行断言。如果断言失败，driver方法会报null： Caught: geb.error.DriveException: null 只要在命令行用groovy执行即可，grapes会搞定依赖关系。 很方便吧，文档上说还可以跟grails / junit等等集成，快去看看吧 http://geb.codehaus.org/manual/latest/index.html The post [...]]]></description>
			<content:encoded><![CDATA[<p>虽然现在不做前段了，但是发现好的工具还是很兴奋。今天在twitter上看到Grails in Action的作者 @pledbrook 转了一个geb 0.4的消息，顺带看了一下这个工具</p>
<p>http://geb.codehaus.org</p>
<p>geb项目旨在创造一套groovy dsl帮助人们进行webapp的functional test。它是对selenium的封装，举例：</p>
<div class="codecolorer-container groovy default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="groovy codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">@Grapes<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span><br />
&nbsp; &nbsp; @Grab<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'org.seleniumhq.selenium:selenium-firefox-driver:latest.release'</span><span style="color: #66cc66;">&#41;</span>,<br />
&nbsp; &nbsp; @Grab<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'org.codehaus.geb:geb-core:latest.release'</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><br />
<a href="http://www.google.de/search?q=site%3Adocs.codehaus.org/%20import"><span style="color: #000000; font-weight: bold;">import</span></a> <span style="color: #a1a100;">geb.*</span><br />
<br />
<a href="http://www.google.de/search?q=site%3Adocs.codehaus.org/%20println"><span style="color: #993399;">println</span></a> <span style="color: #ff0000;">&quot;Dependencies downloaded, ready for testing&quot;</span><br />
Browser.<span style="color: #006600;">drive</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'http://sunng.info:8000/Pacajus'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <a href="http://www.google.de/search?q=site%3Adocs.codehaus.org/%20assert"><span style="color: #000000; font-weight: bold;">assert</span></a> title<span style="color: #66cc66;">==</span> <span style="color: #ff0000;">'Pacajus'</span><br />
<br />
&nbsp; &nbsp; <a href="http://www.google.de/search?q=site%3Adocs.codehaus.org/%20assert"><span style="color: #000000; font-weight: bold;">assert</span></a> $<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;p&quot;</span>, <span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">text</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">==</span> <span style="color: #ff0000;">'Population: 41558'</span><br />
<span style="color: #66cc66;">&#125;</span><br />
<a href="http://www.google.de/search?q=site%3Adocs.codehaus.org/%20println"><span style="color: #993399;">println</span></a> <span style="color: #ff0000;">&quot;Tested, bye&quot;</span></div></div>
<p>打开页面，执行断言。如果断言失败，driver方法会报null：<br />
Caught: geb.error.DriveException: null</p>
<p>只要在命令行用groovy执行即可，grapes会搞定依赖关系。</p>
<p>很方便吧，文档上说还可以跟grails / junit等等集成，快去看看吧<br />
<a href="http://geb.codehaus.org/manual/latest/index.html">http://geb.codehaus.org/manual/latest/index.html</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/08/geb-for-browser-functional-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Next to Richard Stallman</title>
		<link>http://sunng.info/blog/2010/08/next-to-richard-stallman/</link>
		<comments>http://sunng.info/blog/2010/08/next-to-richard-stallman/#comments</comments>
		<pubDate>Fri, 13 Aug 2010 06:23:50 +0000</pubDate>
		<dc:creator>Sunng</dc:creator>
				<category><![CDATA[自话]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/2010/08/next-to-richard-stallman/</guid>
		<description><![CDATA[我这个人一般不八卦，你知道的。但是个别时候实在是情难以堪。 Bug 626593 &#8211; Gnome ate my boyfriend! Help! https://bugzilla.gnome.org/show_bug.cgi?id=626593 这位女士在GNOME bugzilla上提交bug，bug提交在empathy项目下。（注 dict empathy: 心意相通） 先不看正文，备注信息就极具幽默感： Status: RESOLVED INVALID Product: empathy Component: User Guide Version: unspecified OS: Windows Importance: Normal critical 是不是真的RESOLVED就不知道了。 事情的直接原因是上周海牙GUADEC，此男cancel了周末和这位reporter的约会。此女不堪长期忍受此男、Linux、Maemo、C等等，彻底爆发了。 He even tried to put Linux on my computer and I simply could not take it. I came home from work one [...]]]></description>
			<content:encoded><![CDATA[<p>我这个人一般不八卦，你知道的。但是个别时候实在是情难以堪。</p>
<p>Bug 626593 &#8211; Gnome ate my boyfriend! Help!<br />
<a href="https://bugzilla.gnome.org/show_bug.cgi?id=626593">https://bugzilla.gnome.org/show_bug.cgi?id=626593</a></p>
<p>这位女士在GNOME bugzilla上提交bug，bug提交在empathy项目下。（注 dict empathy: 心意相通）</p>
<p>先不看正文，备注信息就极具幽默感：<br />
Status:  	 RESOLVED INVALID<br />
Product: 	empathy<br />
Component: 	User Guide<br />
Version: 	unspecified<br />
OS: 	Windows<br />
Importance:  	Normal critical </p>
<p>是不是真的RESOLVED就不知道了。</p>
<p>事情的直接原因是上周海牙GUADEC，此男cancel了周末和这位reporter的约会。此女不堪长期忍受此男、Linux、Maemo、C等等，彻底爆发了。</p>
<p>He even tried to put Linux on my computer and I simply could not take it.  I came home from work one day and my computer said &#8220;UNIX&#8221; all over it!<br />
这句有力的证明了我曾经看到的一句箴言，给女生装linux，对她们、对电脑、对linux都是一种折磨。</p>
<p>接下来搞笑开始了。一楼就是一位极缺乏幽默感的大叔：<br />
Akhil Laddha      2010-08-11 06:45:46 UTC<br />
This is a GNOME bug tracking system, not any family consultancy.</p>
<p>二楼是位好心人，提出了一个Linux week计划，还一厢情愿整了个交易计划：<br />
for each bug you report, he has to spend one night with you without the computer.</p>
<p>八楼精华：<br />
 David Liang      2010-08-12 08:53:16 UTC<br />
不得不顶</p>
<p>九楼亮出一个家属俱乐部的邮件列表：<br />
gnome-women-list@gnome.org，说你要是在家属圈子里麻将打得无敌手，自然你的boyfriend就崇拜你了，到时你就是爷了</p>
<p>高潮在十楼出现了，“你不说这男的是谁我们怎么帮你？”</p>
<p>紧接着十一楼一位神秘人士笑而不语。</p>
<p>十四楼比较直接<br />
#apt-get remove boyfriend &#8211;purge</p>
<p>十九楼知道宁拆十座庙的道理，建议先查看一下情况再说：<br />
cat /dev/boyfriend | grep love</p>
<p>最冷的是十六楼说咱们有这么个项目的：<br />
<a href="http://projects.gnome.org/outreach/women/">http://projects.gnome.org/outreach/women/</a></p>
<p>你以为故事就这么结束了，你错了。<br />
没想到男主人公的网站被我不经意间人肉出来了：<br />
<a href="http://zachgoldberg.com">http://zachgoldberg.com</a></p>
<p>一上来第一篇就说这事：<br />
<a href="http://zachgoldberg.com/2010/08/12/help-my-girlfriend-learned-how-to-use-a-bug-tracker/">HELP! My Girlfriend Learned How To Use A Bug Tracker</a></p>
<p>I never thought it would happen.</p>
<p>此男字字珠玑：<br />
It all started one night when I got home very late from work (where I get to play with Linux all day… who would ever go home?).  I got the usual “you need to pay more attention to me” and “Linux will never have sex with you!”.  I sat through it all and when it was over she went to sleep and I…. opened up my Laptop (running Ubuntu Linux, of course) and started hacking.  All is right with the world.</p>
<p>于是他发现自己上了LWN的Quote of the Week，和RMS的新闻并列，然后又被转载到hacker news, geek.com, slashdot。他感叹道 I never imagined my entry into the “slashdot number of zero” (think Erdos or Kevin Bacon) club would happen in this way.</p>
<p>最后他说他要开一个bugs.zachgoldberg.com专门解决这类的问题，If you want your own component in the bugtracker to help you and your loved one vent your problems all you need to do is ask!</p>
<p>哈哈哈哈</p>
<p>补充个精华链接：http://www.reddit.com/r/linux/comments/d02j6/bug_626593_gnome_ate_my_boyfriend/</p>
<p>最后daf同学总结性地指出，她不会学习使用bug tracker。</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/next-to-richard-stallman/feed/</wfw:commentRss>
		<slash:comments>7</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 以上版本。 通过以下命令启动即可 beanstalkd -d -p &#60;PORT&#62; 协议 Beanstalkd在各方面都继承memcached的风格，协议也与memcached类似，同样是基于文本的： 命令 参数 [参数...] [命令体字节数]\r\n [命令体]\r\n beanstalkd很多命令的返回是yaml格式，但是系统对命令体的格式并没有限制。 客户端 Beanstalkd协议见简单，有各种语言的客户端实现。python有一个非常简单的beanstalkc，可以通过easy_install安装。不过，这个客户端缺少断线重连机制，正式发布的0.2.0版本也有一些严重的bug。可以从github上下载源代码安装，并在使用时控制重连。 The [...]]]></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>0</slash:comments>
		</item>
		<item>
		<title>近况</title>
		<link>http://sunng.info/blog/2010/08/%e8%bf%91%e5%86%b5-2/</link>
		<comments>http://sunng.info/blog/2010/08/%e8%bf%91%e5%86%b5-2/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 13:36:16 +0000</pubDate>
		<dc:creator>Sunng</dc:creator>
				<category><![CDATA[自话]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/2010/08/%e8%bf%91%e5%86%b5-2/</guid>
		<description><![CDATA[Exaile豆瓣电台插件发布一个多月，github和googlecode的下载量加载一起大约有190次左右。考虑的这两个用户群的交集有限，这个数字应该算是超乎期望了，呵呵。等下载量超过500的时候，我。。。 本来计划三周做完的项目，后台服务调用的中间件，做了刚一周整个流程刚跑通就被砍了。最近工作得很不顺心，公司各种产品之间结构松散，模型各不相同，想要all in one谈何容易。不愉快就容易萌生去意，可是看了JavaEye robbin的这篇，就彷徨了。 上面一节原本写了不少，但考虑到说出来不太合适，就删了。你懂的。 最近听豆瓣电台非常喜欢苏阳、野孩子这些西北味的歌，我毕竟还是干旱地区的人，听着就有共鸣。苏阳的长在银川我很喜欢，我喜欢这种带着地名的歌。有西北的味道，能让我想起小时候。“我的家住在，同心路边上” ，如果有机会，能去考察一下就太他妈好了。 今天图灵把八月份的新书列出来，发现这么一本《我编程，我快乐》。本来评价不错的书，起这么个名字，你说谁还敢买，买了还不被同事鄙视死。编辑同志您做到了！ 最近某公司的电子书宣传力度很大，连CEO都请自上阵的（请注意右侧第二条）。我突然想买个Kindle，上周五在Amazon.com上订了到了最后一步，结果是地址不能邮寄。看来还得想其他办法，今天貌似关于国际网购邮寄有了新的规定。 The post is brought to you by lekhonee v0.7]]></description>
			<content:encoded><![CDATA[<ol>
<li>Exaile豆瓣电台插件发布一个多月，github和googlecode的下载量加载一起大约有190次左右。考虑的这两个用户群的交集有限，这个数字应该算是超乎期望了，呵呵。等下载量超过500的时候，我。。。</li>
<li>本来计划三周做完的项目，后台服务调用的中间件，做了刚一周整个流程刚跑通就被砍了。最近工作得很不顺心，公司各种产品之间结构松散，模型各不相同，想要all in one谈何容易。不愉快就容易萌生去意，可是看了JavaEye robbin的<a href="http://robbin.javaeye.com/blog/730223">这篇</a>，就彷徨了。</li>
<li>上面一节原本写了不少，但考虑到说出来不太合适，就删了。你懂的。</li>
<li>最近听豆瓣电台非常喜欢苏阳、野孩子这些西北味的歌，我毕竟还是干旱地区的人，听着就有共鸣。苏阳的<a href="http://www.douban.com/artist/suyang/download?song_id=10027">长在银川</a>我很喜欢，我喜欢这种带着地名的歌。有西北的味道，能让我想起小时候。“我的家住在，<a href="http://j.map.baidu.com/8n8f">同心路</a>边上” ，如果有机会，能去考察一下就太他妈好了。</li>
<li>今天图灵把<a href="http://www.turingbook.com/Data/Newswire/d3aaad02-1af3-47df-8e87-d06e0a88672e/Asset/Newsletter_201008.html">八月份的新书</a>列出来，发现这么一本《我编程，我快乐》。本来评价不错的书，起这么个名字，你说谁还敢买，买了还不被同事鄙视死。编辑同志您做到了！</li>
<li>最近某公司的电子书宣传力度很大，连<a href="http://www.cnbeta.com/articles/118806.htm">CEO都请自上阵</a>的（请注意右侧第二条）。我突然想买个Kindle，上周五在Amazon.com上订了到了最后一步，结果是地址不能邮寄。看来还得想其他办法，今天貌似关于国际网购邮寄有了新的<a href="http://finance.ce.cn/rolling/201008/09/t20100809_16064224.shtml">规定</a>。</li>
</ol>
<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/%e8%bf%91%e5%86%b5-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Exaile-doubanfm-plugin for exaile 0.3.2</title>
		<link>http://sunng.info/blog/2010/08/exaile-doubanfm-plugin-for-exaile-0-3-2/</link>
		<comments>http://sunng.info/blog/2010/08/exaile-doubanfm-plugin-for-exaile-0-3-2/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 14:23:50 +0000</pubDate>
		<dc:creator>Sunng</dc:creator>
				<category><![CDATA[广告]]></category>
		<category><![CDATA[Douban]]></category>
		<category><![CDATA[exaile]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/?p=640</guid>
		<description><![CDATA[Ubuntu 10.04的Exaile还停留在0.3.1，而Fedora 13上已经升级到0.3.2了。为此我更新了豆瓣电台插件，现在这个版本可以在0.3.2上正常工作。 可以到github的下载页面获取 doubanfm-0.0.3a-exaile032.tar.gz http://github.com/sunng87/exaile-doubanfm-plugin/downloads 此外for exaile 0.3.1的版本也有一个优化和bugfix release, Ubuntu用户可以获取 doubanfm-0.0.3-exaile031.tar.gz 接下来三周又有项目了，难度比较大，估计豆瓣插件近期不会有什么新的惊喜了。 The post is brought to you by lekhonee v0.7]]></description>
			<content:encoded><![CDATA[<p>Ubuntu 10.04的Exaile还停留在0.3.1，而Fedora 13上已经升级到0.3.2了。为此我更新了豆瓣电台插件，现在这个版本可以在0.3.2上正常工作。</p>
<p>可以到github的下载页面获取 doubanfm-0.0.3a-exaile032.tar.gz<br />
<a href="http://github.com/sunng87/exaile-doubanfm-plugin/downloads">http://github.com/sunng87/exaile-doubanfm-plugin/downloads</a></p>
<p>此外for exaile 0.3.1的版本也有一个优化和bugfix release, Ubuntu用户可以获取<br />
doubanfm-0.0.3-exaile031.tar.gz</p>
<p>接下来三周又有项目了，难度比较大，估计豆瓣插件近期不会有什么新的惊喜了。</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/exaile-doubanfm-plugin-for-exaile-0-3-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
