<?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>cashplk的心路历程 &#187; ubuntu</title>
	<atom:link href="http://cashplk.com/tag/ubuntu/feed/" rel="self" type="application/rss+xml" />
	<link>http://cashplk.com</link>
	<description>学无止境，梦如夏花～</description>
	<lastBuildDate>Sat, 31 Jul 2010 10:15:57 +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>netbeans 6.7 问题</title>
		<link>http://cashplk.com/2009/06/04/netbeans-67-%e9%97%ae%e9%a2%98/</link>
		<comments>http://cashplk.com/2009/06/04/netbeans-67-%e9%97%ae%e9%a2%98/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 15:22:54 +0000</pubDate>
		<dc:creator>cashplk</dc:creator>
				<category><![CDATA[new technology]]></category>
		<category><![CDATA[宋体]]></category>
		<category><![CDATA[乱码]]></category>
		<category><![CDATA[netbeans6.7]]></category>
		<category><![CDATA[openjava]]></category>
		<category><![CDATA[sudo]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://cashplk.com/archives/58</guid>
		<description><![CDATA[中文显示正常，但是字体明显变瘦，不容易辨识。 原因是因为使用了openjava。 netbeans安装目录下的 etc/netbeans.conf里面设定默认使用了openjava 更改为就正常了。 # Default location of JDK, can be overridden by using &#8211;jdkhome : netbeans_jdkhome=&#8221;/usr/lib/jvm/java-6-sun/jre&#8221; 接下来解决乱码问题： 把宋体字拷贝到你的用户目录下，然后执行如下操作： 1、 cd /usr/lib/jvm/java-6-sun-1.6.0.10/jre/lib/fonts 2、sudo mkdir fallback 3、sudo mv ~/simsun.ttc /usr/lib/jvm/java-6-sun-1.6.0.10/jre/lib/fonts/fallback/]]></description>
			<content:encoded><![CDATA[<p>    中文显示正常，但是字体明显变瘦，不容易辨识。<br />
原因是因为使用了openjava。</p>
<p>netbeans安装目录下的 etc/netbeans.conf里面设定默认使用了openjava<br />
更改为就正常了。<br />
# Default location of JDK, can be overridden by using &#8211;jdkhome :<br />
netbeans_jdkhome=&#8221;/usr/lib/jvm/java-6-sun/jre&#8221;</p>
<p>接下来解决乱码问题：</p>
<p>把宋体字拷贝到你的用户目录下，然后执行如下操作：<br />
1、 cd /usr/lib/jvm/java-6-sun-1.6.0.10/jre/lib/fonts</p>
<p>2、sudo mkdir fallback</p>
<p>3、sudo mv ~/simsun.ttc /usr/lib/jvm/java-6-sun-1.6.0.10/jre/lib/fonts/fallback/</p>
]]></content:encoded>
			<wfw:commentRss>http://cashplk.com/2009/06/04/netbeans-67-%e9%97%ae%e9%a2%98/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ruby操作CouchDB</title>
		<link>http://cashplk.com/2009/05/23/ruby%e6%93%8d%e4%bd%9ccouchdb/</link>
		<comments>http://cashplk.com/2009/05/23/ruby%e6%93%8d%e4%bd%9ccouchdb/#comments</comments>
		<pubDate>Sat, 23 May 2009 06:18:44 +0000</pubDate>
		<dc:creator>cashplk</dc:creator>
				<category><![CDATA[Erlang]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[couchdb]]></category>
		<category><![CDATA[irb]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://cashplk.com/?p=44</guid>
		<description><![CDATA[以下是一个简单的使用Ruby操作CouchDB数据库的代码： 新建fromRuby2CouchDB.rb文件，具体内容如下： require 'net/http' &#160; module Couch class Server def initialize&#40;host, port, option = nil&#41; @host = host; @port = port; @option = option; end &#160; def delete&#40;uri&#41; request&#40;Net::HTTP::Delete.new&#40;uri&#41;&#41; end &#160; def get&#40;uri&#41; request&#40;Net::HTTP::Get.new&#40;uri&#41;&#41; end &#160; # put json to request def put&#40;uri, json&#41; req = Net::HTTP::Put.new&#40;uri&#41; req&#91;&#34;content.type&#34;&#93; = &#34;application/json&#34; req.body = json request&#40;req&#41; end [...]]]></description>
			<content:encoded><![CDATA[<p>以下是一个简单的使用Ruby操作CouchDB数据库的代码：</p>
<p>新建fromRuby2CouchDB.rb文件，具体内容如下：</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'net/http'</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">module</span> Couch
  <span style="color:#9966CC; font-weight:bold;">class</span> Server
    <span style="color:#9966CC; font-weight:bold;">def</span> initialize<span style="color:#006600; font-weight:bold;">&#40;</span>host, port, option = <span style="color:#0000FF; font-weight:bold;">nil</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#0066ff; font-weight:bold;">@host</span> = host;
      <span style="color:#0066ff; font-weight:bold;">@port</span> = port;
      <span style="color:#0066ff; font-weight:bold;">@option</span> = option;
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> delete<span style="color:#006600; font-weight:bold;">&#40;</span>uri<span style="color:#006600; font-weight:bold;">&#41;</span>
      request<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#6666ff; font-weight:bold;">Net::HTTP::Delete</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>uri<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> get<span style="color:#006600; font-weight:bold;">&#40;</span>uri<span style="color:#006600; font-weight:bold;">&#41;</span>
      request<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#6666ff; font-weight:bold;">Net::HTTP::Get</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>uri<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># put json to request</span>
    <span style="color:#9966CC; font-weight:bold;">def</span> put<span style="color:#006600; font-weight:bold;">&#40;</span>uri, json<span style="color:#006600; font-weight:bold;">&#41;</span>
      req = <span style="color:#6666ff; font-weight:bold;">Net::HTTP::Put</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>uri<span style="color:#006600; font-weight:bold;">&#41;</span>
      req<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;content.type&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#996600;">&quot;application/json&quot;</span>
      req.<span style="color:#9900CC;">body</span> = json
      request<span style="color:#006600; font-weight:bold;">&#40;</span>req<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> post<span style="color:#006600; font-weight:bold;">&#40;</span>uri, json<span style="color:#006600; font-weight:bold;">&#41;</span>
      req = <span style="color:#6666ff; font-weight:bold;">Net::HTTP::Post</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>uri<span style="color:#006600; font-weight:bold;">&#41;</span>
      req<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;content-type&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#996600;">&quot;application/json&quot;</span>
      req.<span style="color:#9900CC;">body</span> = json
      request<span style="color:#006600; font-weight:bold;">&#40;</span>req<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> request<span style="color:#006600; font-weight:bold;">&#40;</span>req<span style="color:#006600; font-weight:bold;">&#41;</span>
      res = <span style="color:#6666ff; font-weight:bold;">Net::HTTP</span>.<span style="color:#9900CC;">start</span><span style="color:#006600; font-weight:bold;">&#40;</span>@host, <span style="color:#0066ff; font-weight:bold;">@port</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>
        <span style="color:#006600; font-weight:bold;">|</span>http<span style="color:#006600; font-weight:bold;">|</span>http.<span style="color:#9900CC;">request</span><span style="color:#006600; font-weight:bold;">&#40;</span>req<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#006600; font-weight:bold;">&#125;</span>
      <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#9966CC; font-weight:bold;">not</span> res.<span style="color:#9900CC;">kind_of</span>?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#6666ff; font-weight:bold;">Net::HTTPSuccess</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
        handle_error<span style="color:#006600; font-weight:bold;">&#40;</span>req, res<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
      res
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    private
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> handle_error<span style="color:#006600; font-weight:bold;">&#40;</span>req, res<span style="color:#006600; font-weight:bold;">&#41;</span>
      e = <span style="color:#CC00FF; font-weight:bold;">RuntimeError</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;#{res.code}:#{res.message}<span style="color:#000099;">\n</span>METHOD:&quot;</span> <span style="color:#006600; font-weight:bold;">+</span>
&nbsp;
          <span style="color:#996600;">&quot;#{req.method}<span style="color:#000099;">\n</span>URI:#{req.path}<span style="color:#000099;">\n</span>#{res.body}&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#CC0066; font-weight:bold;">raise</span> e
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>在文件路径下，以命令行模式运行：irb，启动ruby编译器：<br />
irb(main):001:0&gt; require &#8220;fromRuby2CouchDB.rb&#8221;<br />
=&gt; true<br />
irb(main):002:0&gt; server = Couch::Server.new(&#8220;127.0.0.1&#8243;,&#8221;5984&#8243;)<br />
=&gt; #&lt;Couch::Server:0xb7bdd258 @option=nil, @port=&#8221;5984&#8243;, @host=&#8221;127.0.0.1&#8243;&gt;<br />
irb(main):003:0&gt; server.get(&#8220;/blog/&#8221;)<br />
会插入一个新的数据库，名为blog。如果不对，会打印出相应的错误。成功后，可以在页面查看是否存在该数据库。</p>
]]></content:encoded>
			<wfw:commentRss>http://cashplk.com/2009/05/23/ruby%e6%93%8d%e4%bd%9ccouchdb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CouchDB初探</title>
		<link>http://cashplk.com/2009/05/23/couchdb%e5%88%9d%e6%8e%a2/</link>
		<comments>http://cashplk.com/2009/05/23/couchdb%e5%88%9d%e6%8e%a2/#comments</comments>
		<pubDate>Sat, 23 May 2009 06:02:34 +0000</pubDate>
		<dc:creator>cashplk</dc:creator>
				<category><![CDATA[DataBase]]></category>
		<category><![CDATA[Erlang]]></category>
		<category><![CDATA[couchdb]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://cashplk.com/?p=38</guid>
		<description><![CDATA[看到InfoQ上关于CouchDB的报道，正好最近也在研究Erlang，就看看。 CouchDB是一个文档形数据库。本身的程序已经实现了基本的管理。和数据库的交互采用的是JS，具体传输的数据是JSON格式的。 下面是Eralng的架构图： 可以看到，中间层完全使用Erlang编写， 底层搜索则是Lucene。 ubuntu下面的安装： sudo apt-get install couchdb OK了之后，直接运行： sudo couchdb 即可运行。 /etc/couchdb/couch.ini，可以对运行的程序参数进行配置。 访问：http://127.0.0.101:5984/_utils/browse/index.html 就可以看到数据库的情况了。 此后的所有操作都可以在界面完成。 假如新建了一个blog的数据库，字段为text. 需要查询数据的时候，直接访问：http://127.0.0.1:5984/blog/1 就可以了。 显示的数据和这个类似： {"_id":"1","_rev":"2166111176","text":"hello,world"｝ 初步使用了一下，觉得还不错，但是还是有几个疑问： 1，对于大规模的操作，性能如何？ 2，直接页面编辑，必须按照JSON格式， 输入字符之类的，要“”补全。不能自动实现此功能，不爽。 3，中文字符似乎处理还不是很好。 Erlang的官方网站：http://couchdb.apache.org/index.html]]></description>
			<content:encoded><![CDATA[<p>看到InfoQ上关于CouchDB的报道，正好最近也在研究Erlang，就看看。</p>
<p>CouchDB是一个文档形数据库。本身的程序已经实现了基本的管理。和数据库的交互采用的是JS，具体传输的数据是JSON格式的。</p>
<p>下面是Eralng的架构图：</p>
<p><img class="alignnone size-full wp-image-39" src="http://cashplk.com/wp-content/uploads/2009/05/erlang-arch.png" alt="erlang-arch" width="292" height="340" /></p>
<p>可以看到，中间层完全使用Erlang编写， 底层搜索则是Lucene。</p>
<p>ubuntu下面的安装：</p>
<p>sudo apt-get install couchdb</p>
<p>OK了之后，直接运行： sudo couchdb 即可运行。</p>
<p>/etc/couchdb/couch.ini，可以对运行的程序参数进行配置。</p>
<p>访问：<a href="http://127.0.0.1:5984/_utils/browse/index.html">http://127.0.0.101:5984/_utils/browse/index.html </a>就可以看到数据库的情况了。</p>
<p>此后的所有操作都可以在界面完成。</p>
<p>假如新建了一个blog的数据库，字段为text.</p>
<p>需要查询数据的时候，直接访问：<a href="http://127.0.0.1:5984/blog/1">http://127.0.0.1:5984/blog/1</a> 就可以了。</p>
<p>显示的数据和这个类似：</p>
<pre>{"_id":"1","_rev":"2166111176","text":"hello,world"｝

初步使用了一下，觉得还不错，但是还是有几个疑问：
1，对于大规模的操作，性能如何？
2，直接页面编辑，必须按照JSON格式， 输入字符之类的，要“”补全。不能自动实现此功能，不爽。
3，中文字符似乎处理还不是很好。</pre>
<p>Erlang的官方网站：<a href="http://couchdb.apache.org/index.html">http://couchdb.apache.org/index.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://cashplk.com/2009/05/23/couchdb%e5%88%9d%e6%8e%a2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->