<?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"
	>

<channel>
	<title>Raecoo @ Nothing Impossible</title>
	<atom:link href="http://www.raecoo.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.raecoo.com</link>
	<description>Focus on Web 2.0,Ruby on Rails,Python ... All Web Technology</description>
	<pubDate>Sun, 28 Dec 2008 02:54:18 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
	<language>en</language>
			<item>
		<title>为所有HTML标签添加Hover效果</title>
		<link>http://www.raecoo.com/2008/12/28/add-hover-effect-for-all-html-tags/</link>
		<comments>http://www.raecoo.com/2008/12/28/add-hover-effect-for-all-html-tags/#comments</comments>
		<pubDate>Sun, 28 Dec 2008 02:53:36 +0000</pubDate>
		<dc:creator>Raecoo</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Javascripts]]></category>

		<guid isPermaLink="false">http://www.raecoo.com/?p=177</guid>
		<description><![CDATA[在制作网页时经常会用到onmouseover和onmouseout效果来改善用户体验，最常见的就是在指定Element中添加如下的代码来实现背景色的切换。
onmouseover='this.style.background=#666;' onmouseout="this.style.background=#fff;"
其实到达这个效果有两种方式：Javascript和CSS，上面提到是用JS来完成的，我个人更喜欢用CSS来解决类似问题。
用CSS的hover来解决这个问题，不仅简单高效，关键是低侵入性，页面上不会写太多东西。例如在li上添加这个效果：
li {background:#fff;}
li:hover {background:#666;}
这样的代码看起来简洁且方便日后维护，但也有一个问题就是在IE6下并不是所有HTML标签都支持hover这个属性，还好已经有人为IE做了这个Pacth，只需要添加一下就好了。点击下载csshover
]]></description>
			<content:encoded><![CDATA[<p>在制作网页时经常会用到onmouseover和onmouseout效果来改善用户体验，最常见的就是在指定Element中添加如下的代码来实现背景色的切换。<br />
<code>onmouseover='this.style.background=#666;' onmouseout="this.style.background=#fff;"</code><br />
其实到达这个效果有两种方式：Javascript和CSS，上面提到是用JS来完成的，我个人更喜欢用CSS来解决类似问题。<br />
用CSS的hover来解决这个问题，不仅简单高效，关键是低侵入性，页面上不会写太多东西。例如在li上添加这个效果：<br />
<code>li {background:#fff;}<br />
li:hover {background:#666;}</code><br />
这样的代码看起来简洁且方便日后维护，但也有一个问题就是在IE6下并不是所有HTML标签都支持hover这个属性，还好已经有人为IE做了这个Pacth，只需要添加一下就好了。<a href='http://www.raecoo.com/wp-content/uploads/2008/12/csshover.htc'>点击下载csshover</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.raecoo.com/2008/12/28/add-hover-effect-for-all-html-tags/feed/</wfw:commentRss>
		</item>
		<item>
		<title>custom exceptions in merb</title>
		<link>http://www.raecoo.com/2008/12/27/custom-exceptions-in-merb/</link>
		<comments>http://www.raecoo.com/2008/12/27/custom-exceptions-in-merb/#comments</comments>
		<pubDate>Sat, 27 Dec 2008 14:51:28 +0000</pubDate>
		<dc:creator>Raecoo</dc:creator>
		
		<category><![CDATA[Merb]]></category>

		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://www.raecoo.com/?p=174</guid>
		<description><![CDATA[在开发应用过程中难免需要根据实际情况自定义一些异常处理机制，这方面Merb已经将底部的架子为我们准备好了，我们只需要简单的在此基础上进行扩展就可以搞的很舒服。
Merb默认生成的Application会提供一个Exception的Controller，并包含了两个样版异常NotFound和NotAcceptable。现在我们添加一个自定义的异常在这里，假定名称为NotExists，并为其创建对应的View。
在Action中调用
 def show
product = Product.find(params[:id])
raise NotExists unless product
[...]
end
这时会报错，称并不存在NotExists常量，Google了一下并没有找到合理的解释，直接看了Merb的源代码才发现，自定义异常不是这样的用法。
在Merb里如果要自定义异常，需要将自定义异常继承自一个Merb自身已存的异常，比如这样
class NotExists &#60; Merb::ControllerExceptions::NotFound ; end
并且需要在使用该异常的Controller里进行声明（放在Application里自然会是一个不错的选择），再跑一下上面报错的程序应该就可以得到正确的结果啦~ BTW:为了这个我可查了好一会资料 ：）

以下是Merb对标准Http异常的封装
 class Informational                 &#60; Merb::ControllerExceptions::Base; end
class Continue                   [...]]]></description>
			<content:encoded><![CDATA[<p>在开发应用过程中难免需要根据实际情况自定义一些异常处理机制，这方面Merb已经将底部的架子为我们准备好了，我们只需要简单的在此基础上进行扩展就可以搞的很舒服。<br />
Merb默认生成的Application会提供一个Exception的Controller，并包含了两个样版异常NotFound和NotAcceptable。现在我们添加一个自定义的异常在这里，假定名称为NotExists，并为其创建对应的View。<br />
在Action中调用<br />
<code> def show<br />
product = Product.find(params[:id])<br />
raise NotExists unless product<br />
[...]<br />
end</code><br />
这时会报错，称并不存在NotExists常量，Google了一下并没有找到合理的解释，直接看了Merb的源代码才发现，自定义异常不是这样的用法。</p>
<p>在Merb里如果要自定义异常，需要将自定义异常继承自一个Merb自身已存的异常，比如这样<br />
<code>class NotExists &lt; Merb::ControllerExceptions::NotFound ; end</code><br />
并且需要在使用该异常的Controller里进行声明（放在Application里自然会是一个不错的选择），再跑一下上面报错的程序应该就可以得到正确的结果啦~ BTW:为了这个我可查了好一会资料 ：）<br />
<span id="more-174"></span><br />
以下是Merb对标准Http异常的封装<br />
<code> class Informational                 &lt; Merb::ControllerExceptions::Base; end<br />
class Continue                    &lt; Merb::ControllerExceptions::Informational; self.status = 100; end<br />
class SwitchingProtocols          &lt; Merb::ControllerExceptions::Informational; self.status = 101; end<br />
class Successful                    &lt; Merb::ControllerExceptions::Base; end<br />
class OK                          &lt; Merb::ControllerExceptions::Successful; self.status = 200; end<br />
class Created                     &lt; Merb::ControllerExceptions::Successful; self.status = 201; end<br />
class Accepted                    &lt; Merb::ControllerExceptions::Successful; self.status = 202; end<br />
class NonAuthoritativeInformation &lt; Merb::ControllerExceptions::Successful; self.status = 203; end<br />
class NoContent                   &lt; Merb::ControllerExceptions::Successful; self.status = 204; end<br />
class ResetContent                &lt; Merb::ControllerExceptions::Successful; self.status = 205; end<br />
class PartialContent              &lt; Merb::ControllerExceptions::Successful; self.status = 206; end<br />
class Redirection                   &lt; Merb::ControllerExceptions::Base; end<br />
class MultipleChoices             &lt; Merb::ControllerExceptions::Redirection; self.status = 300; end<br />
class MovedPermanently            &lt; Merb::ControllerExceptions::Redirection; self.status = 301; end<br />
class MovedTemporarily            &lt; Merb::ControllerExceptions::Redirection; self.status = 302; end<br />
class SeeOther                    &lt; Merb::ControllerExceptions::Redirection; self.status = 303; end<br />
class NotModified                 &lt; Merb::ControllerExceptions::Redirection; self.status = 304; end<br />
class UseProxy                    &lt; Merb::ControllerExceptions::Redirection; self.status = 305; end<br />
class TemporaryRedirect           &lt; Merb::ControllerExceptions::Redirection; self.status = 307; end<br />
class ClientError                   &lt; Merb::ControllerExceptions::Base; end<br />
class BadRequest                  &lt; Merb::ControllerExceptions::ClientError; self.status = 400; end<br />
class MultiPartParseError         &lt; Merb::ControllerExceptions::BadRequest; end<br />
class Unauthorized                &lt; Merb::ControllerExceptions::ClientError; self.status = 401; end<br />
class PaymentRequired             &lt; Merb::ControllerExceptions::ClientError; self.status = 402; end<br />
class Forbidden                   &lt; Merb::ControllerExceptions::ClientError; self.status = 403; end<br />
class NotFound                    &lt; Merb::ControllerExceptions::ClientError; self.status = 404; end<br />
class ActionNotFound              &lt; Merb::ControllerExceptions::NotFound; end<br />
class TemplateNotFound            &lt; Merb::ControllerExceptions::NotFound; end<br />
class LayoutNotFound              &lt; Merb::ControllerExceptions::NotFound; end<br />
class MethodNotAllowed            &lt; Merb::ControllerExceptions::ClientError; self.status = 405; end<br />
class NotAcceptable               &lt; Merb::ControllerExceptions::ClientError; self.status = 406; end<br />
class ProxyAuthenticationRequired &lt; Merb::ControllerExceptions::ClientError; self.status = 407; end<br />
class RequestTimeout              &lt; Merb::ControllerExceptions::ClientError; self.status = 408; end<br />
class Conflict                    &lt; Merb::ControllerExceptions::ClientError; self.status = 409; end<br />
class Gone                        &lt; Merb::ControllerExceptions::ClientError; self.status = 410; end<br />
class LengthRequired              &lt; Merb::ControllerExceptions::ClientError; self.status = 411; end<br />
class PreconditionFailed          &lt; Merb::ControllerExceptions::ClientError; self.status = 412; end<br />
class RequestEntityTooLarge       &lt; Merb::ControllerExceptions::ClientError; self.status = 413; end<br />
class RequestURITooLarge          &lt; Merb::ControllerExceptions::ClientError; self.status = 414; end<br />
class UnsupportedMediaType        &lt; Merb::ControllerExceptions::ClientError; self.status = 415; end<br />
class RequestRangeNotSatisfiable  &lt; Merb::ControllerExceptions::ClientError; self.status = 416; end<br />
class ExpectationFailed           &lt; Merb::ControllerExceptions::ClientError; self.status = 417; end<br />
class ServerError                   &lt; Merb::ControllerExceptions::Base; end<br />
class InternalServerError         &lt; Merb::ControllerExceptions::ServerError; self.status = 500; end<br />
class NotImplemented              &lt; Merb::ControllerExceptions::ServerError; self.status = 501; end<br />
class BadGateway                  &lt; Merb::ControllerExceptions::ServerError; self.status = 502; end<br />
class ServiceUnavailable          &lt; Merb::ControllerExceptions::ServerError; self.status = 503; end<br />
class GatewayTimeout              &lt; Merb::ControllerExceptions::ServerError; self.status = 504; end<br />
class HTTPVersionNotSupported     &lt; Merb::ControllerExceptions::ServerError; self.status = 505; end</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.raecoo.com/2008/12/27/custom-exceptions-in-merb/feed/</wfw:commentRss>
		</item>
		<item>
		<title>hack truncate in ruby 1.8.7 compability issue</title>
		<link>http://www.raecoo.com/2008/12/26/hack-truncate-in-ruby-187-compability-issue/</link>
		<comments>http://www.raecoo.com/2008/12/26/hack-truncate-in-ruby-187-compability-issue/#comments</comments>
		<pubDate>Fri, 26 Dec 2008 03:42:03 +0000</pubDate>
		<dc:creator>Raecoo</dc:creator>
		
		<category><![CDATA[Rails]]></category>

		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.raecoo.com/?p=170</guid>
		<description><![CDATA[add follows code into rails app environment.rb and restart the service
# http://rails.lighthouseapp.com/projects/8994/tickets/867-undefined-method-length-for-enumerable

class String
  def chars
    ActiveSupport::Multibyte::Chars.new(self)
  end
  alias_method :mb_chars, :chars
end
##
module ActionView
  module Helpers
    module TextHelper
      def truncate(text, length = 30, truncate_string = "...")
        [...]]]></description>
			<content:encoded><![CDATA[<p>add follows code into rails app environment.rb and restart the service<br />
# http://rails.lighthouseapp.com/projects/8994/tickets/867-undefined-method-length-for-enumerable<br />
<code><br />
class String<br />
  def chars<br />
    ActiveSupport::Multibyte::Chars.new(self)<br />
  end<br />
  alias_method :mb_chars, :chars<br />
end<br />
##<br />
module ActionView<br />
  module Helpers<br />
    module TextHelper<br />
      def truncate(text, length = 30, truncate_string = "...")<br />
        if text.nil? then return end<br />
        l = length - truncate_string.chars.to_a.size<br />
        (text.chars.to_a.size > length ? text.chars.to_a[0...l].join + truncate_string : text).to_s<br />
      end<br />
    end<br />
  end<br />
end</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.raecoo.com/2008/12/26/hack-truncate-in-ruby-187-compability-issue/feed/</wfw:commentRss>
		</item>
		<item>
		<title>process base64 encode in ruby</title>
		<link>http://www.raecoo.com/2008/12/25/process-base64-encode-in-ruby/</link>
		<comments>http://www.raecoo.com/2008/12/25/process-base64-encode-in-ruby/#comments</comments>
		<pubDate>Thu, 25 Dec 2008 09:32:24 +0000</pubDate>
		<dc:creator>Raecoo</dc:creator>
		
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.raecoo.com/?p=166</guid>
		<description><![CDATA[在Ruby世界中,语言本身就支持标准的Base64编码实现,而且还有不止一种实现,一个是类库base64中提供的实现(使用时需要require),一个是Ruby基础数据类型Array提供的,可直接使用.具体使用方法如下:
使用Array的实现
str = "imabase64encode"
base64_str = [str].pack(&#8221;m&#8221;)
original = base64_str.unpack(&#8221;m&#8221;) 
使用Base64的实现
require "base64"
enc   = Base64.encode64('Send reinforcements')
plain = Base64.decode64(enc)
请注意方法pack(&#8217;m')、unpack(&#8217;m')以及encode64和decode64的用法
建议使用Array方式的实现,在Ruby1.9中将会去除Base64这个类库 
]]></description>
			<content:encoded><![CDATA[<p>在Ruby世界中,语言本身就支持标准的Base64编码实现,而且还有不止一种实现,一个是类库base64中提供的实现(使用时需要require),一个是Ruby基础数据类型Array提供的,可直接使用.具体使用方法如下:</p>
<p>使用Array的实现<br />
<code>str = "imabase64encode"<br />
base64_str = [str].pack(&#8221;m&#8221;)<br />
original = base64_str.unpack(&#8221;m&#8221;) </code></p>
<p>使用Base64的实现<br />
<code>require "base64"<br />
enc   = Base64.encode64('Send reinforcements')<br />
plain = Base64.decode64(enc)</code><br />
请注意方法pack(&#8217;m')、unpack(&#8217;m')以及encode64和decode64的用法</p>
<p>建议使用Array方式的实现,在Ruby1.9中将会去除Base64这个类库 <img src='http://www.raecoo.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.raecoo.com/2008/12/25/process-base64-encode-in-ruby/feed/</wfw:commentRss>
		</item>
		<item>
		<title>http authentication</title>
		<link>http://www.raecoo.com/2008/12/25/http-authentication/</link>
		<comments>http://www.raecoo.com/2008/12/25/http-authentication/#comments</comments>
		<pubDate>Thu, 25 Dec 2008 09:20:05 +0000</pubDate>
		<dc:creator>Raecoo</dc:creator>
		
		<category><![CDATA[Default]]></category>

		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://www.raecoo.com/?p=164</guid>
		<description><![CDATA[some information about http authentication :
&#8211;
As for authentication, the HTTP protocol includes the basic access authentication and the digest access authentication protocols, which allow access to a Web page only when the user has provided the correct username and password. If the server requires such credential for granting access to a Web page, the browser [...]]]></description>
			<content:encoded><![CDATA[<p>some information about http authentication :<br />
&#8211;<br />
As for authentication, the HTTP protocol includes the basic access authentication and the digest access authentication protocols, which allow access to a Web page only when the user has provided the correct username and password. If the server requires such credential for granting access to a Web page, the browser requests them to the user; once obtained, the browser stores and uses them also for accessing subsequent pages, without requiring the user to provide them again. From the point of view of the user, the effect is the same as if cookies were used: username and password are only requested once, and from that point on the user is given access to the site. In the basic access authentication protocol, a combination of username and password is sent to the server in every browser request. This means that someone listening in on this traffic can simply read this information and store for later use. This problem is overcome in the digest access authentication protocol, in which the username and password are encrypted using a random nonce created by the server.</p>
<p>see more <a href="http://en.wikipedia.org/wiki/Basic_access_authentication" target='_blank'>http://en.wikipedia.org/wiki/Basic_access_authentication</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.raecoo.com/2008/12/25/http-authentication/feed/</wfw:commentRss>
		</item>
		<item>
		<title>卸载Wine及ies4linux方法</title>
		<link>http://www.raecoo.com/2008/12/21/remove-wine_ies4linux-linux/</link>
		<comments>http://www.raecoo.com/2008/12/21/remove-wine_ies4linux-linux/#comments</comments>
		<pubDate>Sun, 21 Dec 2008 06:28:19 +0000</pubDate>
		<dc:creator>Raecoo</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.raecoo.com/?p=161</guid>
		<description><![CDATA[wine的卸载直接sudo aptitude purge wine
ies4linux直接去家目录下把.ieslinux的目录直接删除就可以了。。
卸载后在菜单栏还有残余的图表，直接去./home/yourdir/.locales/share/applications/下把wine这个目录直接删除。。
]]></description>
			<content:encoded><![CDATA[<p>wine的卸载直接sudo aptitude purge wine<br />
ies4linux直接去家目录下把.ieslinux的目录直接删除就可以了。。<br />
卸载后在菜单栏还有残余的图表，直接去./home/yourdir/.locales/share/applications/下把wine这个目录直接删除。。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raecoo.com/2008/12/21/remove-wine_ies4linux-linux/feed/</wfw:commentRss>
		</item>
		<item>
		<title>修改Linux默认的Shell提示符</title>
		<link>http://www.raecoo.com/2008/12/21/custom-linux-shell-prompt/</link>
		<comments>http://www.raecoo.com/2008/12/21/custom-linux-shell-prompt/#comments</comments>
		<pubDate>Sun, 21 Dec 2008 04:39:50 +0000</pubDate>
		<dc:creator>Raecoo</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://www.raecoo.com/?p=159</guid>
		<description><![CDATA[平时使用本子工作时由于屏幕太小,就恨不能把能不显示的东西全部去掉,这样干起活来才舒服些,特别是在使用Shell时,Ubuntu默认提示符把绝对路径也显示出来,导致输入的命令总会有折行情况,还是按自己想法搞一下,去了这个绝对路径吧,反正还有pwd命令可以用  
Linux系统终端提示符的特征由系统环境变量PS1定义。通过命令echo $PS1查看当前设置。
PS1的值由一系列静态文本或\和转义字符序列组成，如:
PS1=&#8221;\u@\H \w$ &#8221;
比较有用的转义序列有：
\a ASCII 响铃字符（也可以键入 \007）
\d &#8220;Wed Sep 06&#8243; 格式的日期
\e ASCII转义字符
\h 主机名
\H 完整的主机名
\j 在此 shell 中通过按 ^Z 挂起的进程数
\l 此 shell 的终端设备名（如 &#8220;ttyp1&#8243;）
\n 换行符
\r 回车符
\s shell 的名称（如 &#8220;bash&#8221;）
\t 24小时制时间
\T 12小时制时间
\@ 带有 am/pm 的 12 小时制时间
\v bash 的版本（如 2.04）
\V Bash 版本（包括补丁级别）
\u 用户名
\w 当前工作目录（绝对路径）
\w 当前工作目录（basename）
\! 当前命令在历史缓冲区的位置
\$ 如果当前用户是super user，则插入字符#；否则插入字符$
\\ 反斜杠
\[ 出现在不移动光标的字符序列之前
\] 出现在非打印字符之后
\xxx 插入一个用三位数 xxx（用零代替未使用的数字，如 &#8220;\007&#8243;）表示的 ASCII [...]]]></description>
			<content:encoded><![CDATA[<p>平时使用本子工作时由于屏幕太小,就恨不能把能不显示的东西全部去掉,这样干起活来才舒服些,特别是在使用Shell时,Ubuntu默认提示符把绝对路径也显示出来,导致输入的命令总会有折行情况,还是按自己想法搞一下,去了这个绝对路径吧,反正还有pwd命令可以用 <img src='http://www.raecoo.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Linux系统终端提示符的特征由系统环境变量PS1定义。通过命令echo $PS1查看当前设置。</p>
<p>PS1的值由一系列静态文本或\和转义字符序列组成，如:<br />
PS1=&#8221;\u@\H \w$ &#8221;</p>
<p>比较有用的转义序列有：<br />
\a ASCII 响铃字符（也可以键入 \007）<br />
\d &#8220;Wed Sep 06&#8243; 格式的日期<br />
\e ASCII转义字符<br />
\h 主机名<br />
\H 完整的主机名<br />
\j 在此 shell 中通过按 ^Z 挂起的进程数<br />
\l 此 shell 的终端设备名（如 &#8220;ttyp1&#8243;）<br />
\n 换行符<br />
\r 回车符<br />
\s shell 的名称（如 &#8220;bash&#8221;）<br />
\t 24小时制时间<br />
\T 12小时制时间<br />
\@ 带有 am/pm 的 12 小时制时间<br />
\v bash 的版本（如 2.04）<br />
\V Bash 版本（包括补丁级别）<br />
\u 用户名<br />
\w 当前工作目录（绝对路径）<br />
\w 当前工作目录（basename）<br />
\! 当前命令在历史缓冲区的位置<br />
\$ 如果当前用户是super user，则插入字符#；否则插入字符$<br />
\\ 反斜杠<br />
\[ 出现在不移动光标的字符序列之前<br />
\] 出现在非打印字符之后<br />
\xxx 插入一个用三位数 xxx（用零代替未使用的数字，如 &#8220;\007&#8243;）表示的 ASCII 字符</p>
<p>可以通过设置PS1变量使提示符成为彩色。在PS1中设置字符序列颜色的格式为：<br />
\[\e[F;Bm\]<br />
其中&#8220;F&#8221;为字体颜色，编号30~37；&#8220;B&#8221;为背景色，编号40~47。<br />
可通过&#8220;\e[0m''关闭颜色输出；特别的，当B为1时，将显示加亮加粗的文字，详细请看下面的颜色表与代码表。</p>
<p>颜色表</p>
<p>前景 背景 颜色<br />
---------------------------------------<br />
30 40 黑色<br />
31 41 紅色<br />
32 42 綠色<br />
33 43 黃色<br />
34 44 藍色<br />
35 45 紫紅色<br />
36 46 青藍色<br />
37 47 白色</p>
<p>代码 意义<br />
-------------------------<br />
0 OFF<br />
1 高亮显示<br />
4 underline<br />
5 闪烁<br />
7 反白显示<br />
8 不可见</p>
<p>如果想要设置终端提示符的样式只要把$PS1在~/.bahrc指定即可比，比如我的设置如下：<br />
PS1="${debian_chroot:+($debian_chroot)}\u@\h\$"<br />
export PS1<br />
效果：<br />
[raecoo@laptop]$</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raecoo.com/2008/12/21/custom-linux-shell-prompt/feed/</wfw:commentRss>
		</item>
		<item>
		<title>upgrade merb cause nothing to render</title>
		<link>http://www.raecoo.com/2008/12/18/upgrade-merb-cause-nothing-to-render/</link>
		<comments>http://www.raecoo.com/2008/12/18/upgrade-merb-cause-nothing-to-render/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 16:43:21 +0000</pubDate>
		<dc:creator>Raecoo</dc:creator>
		
		<category><![CDATA[Merb]]></category>

		<guid isPermaLink="false">http://www.raecoo.com/?p=156</guid>
		<description><![CDATA[今天看到Merb有版本更新就顺手更新了一下,正好要写一个关于RESTFul的小脚本,随即生成一个新的App,但不知道怎么搞的不管是手工生成的Controller还是用resource生成的资源都无法正确渲染内容.
在测试过程中为Action添加了before,end过滤器,过滤器内中的日志反馈得知前置过滤器正确执行,后置过滤压根没反应,Action里的日志也一样默默无闻,郁闷,找了半天的原因,愣是没发现,后来直接上Maillist发现也有人提类似的问题.有人反馈是merb-action-args引起的问题.随即在dependencies.rb中将它注释掉,重启App发现OK了,问题确实在此.
看起来这个小玩意还不完善,我也顺手把测试环境补在了Maillist里,希望社区尽快有相关的patch出来,以下是测试环境
Ubuntu 8.10
ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]
merb (1.0.6.1)
merb-action-args(1.0.6.1)
]]></description>
			<content:encoded><![CDATA[<p>今天看到Merb有版本更新就顺手更新了一下,正好要写一个关于RESTFul的小脚本,随即生成一个新的App,但不知道怎么搞的不管是手工生成的Controller还是用resource生成的资源都无法正确渲染内容.</p>
<p>在测试过程中为Action添加了before,end过滤器,过滤器内中的日志反馈得知前置过滤器正确执行,后置过滤压根没反应,Action里的日志也一样默默无闻,郁闷,找了半天的原因,愣是没发现,后来直接上Maillist发现也有人提类似的问题.有人反馈是merb-action-args引起的问题.随即在dependencies.rb中将它注释掉,重启App发现OK了,问题确实在此.</p>
<p>看起来这个小玩意还不完善,我也顺手把测试环境补在了Maillist里,希望社区尽快有相关的patch出来,以下是测试环境</p>
<blockquote><p>Ubuntu 8.10<br />
ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]<br />
merb (1.0.6.1)<br />
merb-action-args(1.0.6.1)</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.raecoo.com/2008/12/18/upgrade-merb-cause-nothing-to-render/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ubuntu下Flash中文显示为方块字</title>
		<link>http://www.raecoo.com/2008/12/16/fix-chinese-in-flash-on-ubuntu/</link>
		<comments>http://www.raecoo.com/2008/12/16/fix-chinese-in-flash-on-ubuntu/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 13:31:20 +0000</pubDate>
		<dc:creator>Raecoo</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.raecoo.com/?p=153</guid>
		<description><![CDATA[因为字体设置的缘故,网页中Flash的中文变成了方块字,Google后发现只要删除
/etc/fonts/conf.d/49-sansserif.conf
这个文件就OK了
]]></description>
			<content:encoded><![CDATA[<p>因为字体设置的缘故,网页中Flash的中文变成了方块字,Google后发现只要删除<br />
<code>/etc/fonts/conf.d/49-sansserif.conf</code><br />
这个文件就OK了</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raecoo.com/2008/12/16/fix-chinese-in-flash-on-ubuntu/feed/</wfw:commentRss>
		</item>
		<item>
		<title>使用net/http发送请求</title>
		<link>http://www.raecoo.com/2008/12/15/use-net_https-lib-post-http-request/</link>
		<comments>http://www.raecoo.com/2008/12/15/use-net_https-lib-post-http-request/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 14:42:27 +0000</pubDate>
		<dc:creator>Raecoo</dc:creator>
		
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.raecoo.com/?p=150</guid>
		<description><![CDATA[下面是使用Ruby通过Http请求读取del.icio.us的一个示例.
require 'net/https'
require "rexml/document"
username = "" # your del.icio.us username
password =  "" # your del.icio.us password
resp = href = "";
begin
  http = Net::HTTP.new("api.del.icio.us", 443)
  http.use_ssl = true
  http.start do &#124;http&#124;
    req = Net::HTTP::Get.new("/v1/tags/get", {"User-Agent" =>
        "raecoo.com"})
    req.basic_auth(username, password)
  [...]]]></description>
			<content:encoded><![CDATA[<p>下面是使用Ruby通过Http请求读取del.icio.us的一个示例.<br />
<code>require 'net/https'<br />
require "rexml/document"<br />
username = "" # your del.icio.us username<br />
password =  "" # your del.icio.us password<br />
resp = href = "";<br />
begin<br />
  http = Net::HTTP.new("api.del.icio.us", 443)<br />
  http.use_ssl = true<br />
  http.start do |http|<br />
    req = Net::HTTP::Get.new("/v1/tags/get", {"User-Agent" =><br />
        "raecoo.com"})<br />
    req.basic_auth(username, password)<br />
    response = http.request(req)<br />
    resp = response.body<br />
  end<br />
  #  XML Document<br />
  doc = REXML::Document.new(resp)<br />
  # iterate over each element<br />
  doc.root.elements.each do |elem|<br />
    print elem.attributes['tag']  + &#8221; -> &#8221; +<br />
	elem.attributes['count'] + &#8220;\n&#8221;<br />
  end<br />
rescue SocketError<br />
  raise &#8220;Host &#8221; + host + &#8221; nicht erreichbar&#8221;<br />
rescue REXML::ParseException => e<br />
  print &#8220;error parsing XML &#8221; + e.to_s<br />
end<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.raecoo.com/2008/12/15/use-net_https-lib-post-http-request/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
