<?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>漂自己的移，让别人都撞墙去吧 &#187; moonfox</title>
	<atom:link href="http://www.gagahappy.com/author/moonfox/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gagahappy.com</link>
	<description>Life is what? Get busy living or get busy dying</description>
	<lastBuildDate>Tue, 07 Feb 2012 10:19:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>rails Rails::OrderedOptions</title>
		<link>http://www.gagahappy.com/rails-railsorderedoptions/</link>
		<comments>http://www.gagahappy.com/rails-railsorderedoptions/#comments</comments>
		<pubDate>Tue, 07 Feb 2012 10:19:21 +0000</pubDate>
		<dc:creator>moonfox</dc:creator>
				<category><![CDATA[程序开发]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.gagahappy.com/?p=3967</guid>
		<description><![CDATA[class Rails::OrderedOptions &#60; Array #:nodoc: def &#91;&#93;=&#40;key, value&#41; key = key.to_sym &#160; if pair = find_pair&#40;key&#41; pair.pop pair &#60;&#60; value else self &#60;&#60; &#91;key, value&#93; end end &#160; def &#91;&#93;&#40;key&#41; pair = find_pair&#40;key.to_sym&#41; pair ? pair.last : nil end &#160; def method_missing&#40;name, *args&#41; if name.to_s =~ /&#40;.*&#41;=$/ self&#91;$1.to_sym&#93; = args.first else self&#91;name&#93; end end &#160; [...]]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> <span style="color:#6666ff; font-weight:bold;">Rails::OrderedOptions</span> <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#CC0066; font-weight:bold;">Array</span> <span style="color:#008000; font-style:italic;">#:nodoc:</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span>=<span style="color:#006600; font-weight:bold;">&#40;</span>key, value<span style="color:#006600; font-weight:bold;">&#41;</span>
    key = key.<span style="color:#9900CC;">to_sym</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">if</span> pair = find_pair<span style="color:#006600; font-weight:bold;">&#40;</span>key<span style="color:#006600; font-weight:bold;">&#41;</span>
      pair.<span style="color:#9900CC;">pop</span>
      pair <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> value
    <span style="color:#9966CC; font-weight:bold;">else</span>
      <span style="color:#0000FF; font-weight:bold;">self</span> <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#006600; font-weight:bold;">&#91;</span>key, value<span style="color:#006600; font-weight:bold;">&#93;</span>
    <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;">def</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#40;</span>key<span style="color:#006600; font-weight:bold;">&#41;</span>
    pair = find_pair<span style="color:#006600; font-weight:bold;">&#40;</span>key.<span style="color:#9900CC;">to_sym</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    pair ? pair.<span style="color:#9900CC;">last</span> : <span style="color:#0000FF; font-weight:bold;">nil</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> method_missing<span style="color:#006600; font-weight:bold;">&#40;</span>name, <span style="color:#006600; font-weight:bold;">*</span>args<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">if</span> name.<span style="color:#9900CC;">to_s</span> =~ <span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#40;</span>.<span style="color:#006600; font-weight:bold;">*</span><span style="color:#006600; font-weight:bold;">&#41;</span>=$<span style="color:#006600; font-weight:bold;">/</span>
      <span style="color:#0000FF; font-weight:bold;">self</span><span style="color:#006600; font-weight:bold;">&#91;</span>$1.<span style="color:#9900CC;">to_sym</span><span style="color:#006600; font-weight:bold;">&#93;</span> = args.<span style="color:#9900CC;">first</span>
    <span style="color:#9966CC; font-weight:bold;">else</span>
      <span style="color:#0000FF; font-weight:bold;">self</span><span style="color:#006600; font-weight:bold;">&#91;</span>name<span style="color:#006600; font-weight:bold;">&#93;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  private
    <span style="color:#9966CC; font-weight:bold;">def</span> find_pair<span style="color:#006600; font-weight:bold;">&#40;</span>key<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">each</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>i<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#0000FF; font-weight:bold;">return</span> i <span style="color:#9966CC; font-weight:bold;">if</span> i.<span style="color:#9900CC;">first</span> == key <span style="color:#006600; font-weight:bold;">&#125;</span>
      <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#0000FF; font-weight:bold;">false</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>您可能感兴趣的文章<ol>
<li><a href='http://www.gagahappy.com/what-is-dup/' rel='bookmark' title='what is dup'>what is dup</a></li>
<li><a href='http://www.gagahappy.com/the-different-between-include-and-extend-in-ruby/' rel='bookmark' title='ruby 中 include 与 extend 区别'>ruby 中 include 与 extend 区别</a></li>
<li><a href='http://www.gagahappy.com/ruby-initialize-back-class-self/' rel='bookmark' title='ruby initialize 返回对象'>ruby initialize 返回对象</a></li>
<li><a href='http://www.gagahappy.com/ruby-install-rmagick/' rel='bookmark' title='ruby 安装 rmagick'>ruby 安装 rmagick</a></li>
<li><a href='http://www.gagahappy.com/rails-redirect_to/' rel='bookmark' title='rails redirect_to'>rails redirect_to</a></li>
<li><a href='http://www.gagahappy.com/try-reconstruction/' rel='bookmark' title='小试重构'>小试重构</a></li>
<li><a href='http://www.gagahappy.com/render-partial/' rel='bookmark' title='render partial'>render partial</a></li>
<li><a href='http://www.gagahappy.com/ri-rails-api/' rel='bookmark' title='使用ri查看Rails的API'>使用ri查看Rails的API</a></li>
<li><a href='http://www.gagahappy.com/belongs-to-primary-key/' rel='bookmark' title='belongs_to 选项中的:primary_key'>belongs_to 选项中的:primary_key</a></li>
<li><a href='http://www.gagahappy.com/add-gem-sources/' rel='bookmark' title='为gem添加源'>为gem添加源</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gagahappy.com/rails-railsorderedoptions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ruby escape</title>
		<link>http://www.gagahappy.com/ruby-escape/</link>
		<comments>http://www.gagahappy.com/ruby-escape/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 02:32:47 +0000</pubDate>
		<dc:creator>moonfox</dc:creator>
				<category><![CDATA[程序开发]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.gagahappy.com/?p=3955</guid>
		<description><![CDATA[require 'cgi' url = 'http://www.gagahappy.com/美食大下' url_escape = CGI::escape&#40;url&#41; url_unescape = CGI::unescape&#40;url_escape&#41; puts url_escape puts url_unescape 您可能感兴趣的文章 ruby p3p协议 Python赢得Tiobe 2010年度语言大奖 rails3.0怪异的数据库密码配置 rails项目开发环境一定要与服务器生产环境一致 ruby 安装 rmagick XPath image_tag validates_inclusion_of 使用ri查看Rails的API strftime函数将时间格式化]]></description>
			<content:encoded><![CDATA[
<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;">'cgi'</span>
url = <span style="color:#996600;">'http://www.gagahappy.com/美食大下'</span>
url_escape = <span style="color:#CC00FF; font-weight:bold;">CGI</span>::escape<span style="color:#006600; font-weight:bold;">&#40;</span>url<span style="color:#006600; font-weight:bold;">&#41;</span>
url_unescape = <span style="color:#CC00FF; font-weight:bold;">CGI</span>::unescape<span style="color:#006600; font-weight:bold;">&#40;</span>url_escape<span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#CC0066; font-weight:bold;">puts</span> url_escape
<span style="color:#CC0066; font-weight:bold;">puts</span> url_unescape</pre></div></div>

<p>您可能感兴趣的文章<ol>
<li><a href='http://www.gagahappy.com/ruby-p3p-def/' rel='bookmark' title='ruby p3p协议'>ruby p3p协议</a></li>
<li><a href='http://www.gagahappy.com/python-tiobe-award/' rel='bookmark' title='Python赢得Tiobe 2010年度语言大奖'>Python赢得Tiobe 2010年度语言大奖</a></li>
<li><a href='http://www.gagahappy.com/rails3-passwd-must-to-be-string-format/' rel='bookmark' title='rails3.0怪异的数据库密码配置'>rails3.0怪异的数据库密码配置</a></li>
<li><a href='http://www.gagahappy.com/rails-dev-production/' rel='bookmark' title='rails项目开发环境一定要与服务器生产环境一致'>rails项目开发环境一定要与服务器生产环境一致</a></li>
<li><a href='http://www.gagahappy.com/ruby-install-rmagick/' rel='bookmark' title='ruby 安装 rmagick'>ruby 安装 rmagick</a></li>
<li><a href='http://www.gagahappy.com/xpath/' rel='bookmark' title='XPath'>XPath</a></li>
<li><a href='http://www.gagahappy.com/image_tag/' rel='bookmark' title='image_tag'>image_tag</a></li>
<li><a href='http://www.gagahappy.com/validates_inclusion_of/' rel='bookmark' title='validates_inclusion_of'>validates_inclusion_of</a></li>
<li><a href='http://www.gagahappy.com/ri-rails-api/' rel='bookmark' title='使用ri查看Rails的API'>使用ri查看Rails的API</a></li>
<li><a href='http://www.gagahappy.com/strftime/' rel='bookmark' title='strftime函数将时间格式化'>strftime函数将时间格式化</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gagahappy.com/ruby-escape/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何理解ruby中的__FILE__？</title>
		<link>http://www.gagahappy.com/ruby-file-name-file/</link>
		<comments>http://www.gagahappy.com/ruby-file-name-file/#comments</comments>
		<pubDate>Sun, 05 Feb 2012 08:03:38 +0000</pubDate>
		<dc:creator>moonfox</dc:creator>
				<category><![CDATA[程序开发]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.gagahappy.com/?p=3963</guid>
		<description><![CDATA[require File.expand_path&#40;__FILE__ + '/../filename'&#41; 您可能感兴趣的文章 如何查看 ActiveRecord::Base.connection.executes 的执行结果？ what is dup ruby class_variable method Python赢得Tiobe 2010年度语言大奖 puts 返回值 ruby 安装 rmagick 小试重构 XPath render partial strftime函数将时间格式化]]></description>
			<content:encoded><![CDATA[
<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:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">expand_path</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">__FILE__</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">'/../filename'</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<p>您可能感兴趣的文章<ol>
<li><a href='http://www.gagahappy.com/activerecordbase-connection-executes/' rel='bookmark' title='如何查看 ActiveRecord::Base.connection.executes 的执行结果？'>如何查看 ActiveRecord::Base.connection.executes 的执行结果？</a></li>
<li><a href='http://www.gagahappy.com/what-is-dup/' rel='bookmark' title='what is dup'>what is dup</a></li>
<li><a href='http://www.gagahappy.com/ruby-class_variable-method/' rel='bookmark' title='ruby class_variable method'>ruby class_variable method</a></li>
<li><a href='http://www.gagahappy.com/python-tiobe-award/' rel='bookmark' title='Python赢得Tiobe 2010年度语言大奖'>Python赢得Tiobe 2010年度语言大奖</a></li>
<li><a href='http://www.gagahappy.com/puts-back-value/' rel='bookmark' title='puts 返回值'>puts 返回值</a></li>
<li><a href='http://www.gagahappy.com/ruby-install-rmagick/' rel='bookmark' title='ruby 安装 rmagick'>ruby 安装 rmagick</a></li>
<li><a href='http://www.gagahappy.com/try-reconstruction/' rel='bookmark' title='小试重构'>小试重构</a></li>
<li><a href='http://www.gagahappy.com/xpath/' rel='bookmark' title='XPath'>XPath</a></li>
<li><a href='http://www.gagahappy.com/render-partial/' rel='bookmark' title='render partial'>render partial</a></li>
<li><a href='http://www.gagahappy.com/strftime/' rel='bookmark' title='strftime函数将时间格式化'>strftime函数将时间格式化</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gagahappy.com/ruby-file-name-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何查看 ActiveRecord::Base.connection.executes 的执行结果？</title>
		<link>http://www.gagahappy.com/activerecordbase-connection-executes/</link>
		<comments>http://www.gagahappy.com/activerecordbase-connection-executes/#comments</comments>
		<pubDate>Sat, 04 Feb 2012 07:59:55 +0000</pubDate>
		<dc:creator>moonfox</dc:creator>
				<category><![CDATA[程序开发]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.gagahappy.com/?p=3959</guid>
		<description><![CDATA[拿mysql2这个gem来说：ActiveRecord::Base.connection.execute执行结果是Mysql2::Result的一个实例，这个类提供很多将执行结果解析出来的方法，例如：to_set、each、collect等，Mysql2::Result这些返回的一般都是数组，直接里面的元素的排序是按照数据库中字段的顺序排列的，按照数组的index直接取。 例如: results = ActiveRecord::Base.connection&#40;&#34;SELECT * FROM `users`&#34;&#41; results.each do &#124;result&#124; &#40;0..&#40;result.size -1&#41; do &#124;index&#124; puts result&#91;index&#93; end end 您可能感兴趣的文章 ruby p3p协议 ruby 中 include 与 extend 区别 rails3.0怪异的数据库密码配置 rails项目开发环境一定要与服务器生产环境一致 rails redirect_to image_tag render partial validates_inclusion_of 使用ri查看Rails的API 为gem添加源]]></description>
			<content:encoded><![CDATA[<p>拿mysql2这个gem来说：ActiveRecord::Base.connection.execute执行结果是Mysql2::Result的一个实例，这个类提供很多将执行结果解析出来的方法，例如：to_set、each、collect等，Mysql2::Result这些返回的一般都是数组，直接里面的元素的排序是按照数据库中字段的顺序排列的，按照数组的index直接取。 例如:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">results = <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>.<span style="color:#9900CC;">connection</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;SELECT * FROM `users`&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
results.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>result<span style="color:#006600; font-weight:bold;">|</span>
   <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">0</span>..<span style="color:#006600; font-weight:bold;">&#40;</span>result.<span style="color:#9900CC;">size</span> <span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>index<span style="color:#006600; font-weight:bold;">|</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> result<span style="color:#006600; font-weight:bold;">&#91;</span>index<span style="color:#006600; font-weight:bold;">&#93;</span>
   <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>您可能感兴趣的文章<ol>
<li><a href='http://www.gagahappy.com/ruby-p3p-def/' rel='bookmark' title='ruby p3p协议'>ruby p3p协议</a></li>
<li><a href='http://www.gagahappy.com/the-different-between-include-and-extend-in-ruby/' rel='bookmark' title='ruby 中 include 与 extend 区别'>ruby 中 include 与 extend 区别</a></li>
<li><a href='http://www.gagahappy.com/rails3-passwd-must-to-be-string-format/' rel='bookmark' title='rails3.0怪异的数据库密码配置'>rails3.0怪异的数据库密码配置</a></li>
<li><a href='http://www.gagahappy.com/rails-dev-production/' rel='bookmark' title='rails项目开发环境一定要与服务器生产环境一致'>rails项目开发环境一定要与服务器生产环境一致</a></li>
<li><a href='http://www.gagahappy.com/rails-redirect_to/' rel='bookmark' title='rails redirect_to'>rails redirect_to</a></li>
<li><a href='http://www.gagahappy.com/image_tag/' rel='bookmark' title='image_tag'>image_tag</a></li>
<li><a href='http://www.gagahappy.com/render-partial/' rel='bookmark' title='render partial'>render partial</a></li>
<li><a href='http://www.gagahappy.com/validates_inclusion_of/' rel='bookmark' title='validates_inclusion_of'>validates_inclusion_of</a></li>
<li><a href='http://www.gagahappy.com/ri-rails-api/' rel='bookmark' title='使用ri查看Rails的API'>使用ri查看Rails的API</a></li>
<li><a href='http://www.gagahappy.com/add-gem-sources/' rel='bookmark' title='为gem添加源'>为gem添加源</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gagahappy.com/activerecordbase-connection-executes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ruby p3p协议</title>
		<link>http://www.gagahappy.com/ruby-p3p-def/</link>
		<comments>http://www.gagahappy.com/ruby-p3p-def/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 02:54:36 +0000</pubDate>
		<dc:creator>moonfox</dc:creator>
				<category><![CDATA[程序开发]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.gagahappy.com/?p=3953</guid>
		<description><![CDATA[def p3p headers&#91;'P3P'&#93; = &#34;policyref=\&#34;/w3c/p3p.xml\&#34;, CP=\&#34;ALL DSP COR CURa ADMa DEVa TAIa OUR BUS IND UNI COM NAV INT\&#34;&#34; end 您可能感兴趣的文章 ruby 中 include 与 extend 区别 Python赢得Tiobe 2010年度语言大奖 ruby 安装 rmagick rails redirect_to XPath render partial validates_inclusion_of 使用ri查看Rails的API 为gem添加源 strftime函数将时间格式化]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  <span style="color:#9966CC; font-weight:bold;">def</span> p3p
    headers<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'P3P'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#996600;">&quot;policyref=<span style="color:#000099;">\&quot;</span>/w3c/p3p.xml<span style="color:#000099;">\&quot;</span>, CP=<span style="color:#000099;">\&quot;</span>ALL DSP COR CURa ADMa DEVa TAIa OUR BUS IND UNI COM NAV INT<span style="color:#000099;">\&quot;</span>&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>您可能感兴趣的文章<ol>
<li><a href='http://www.gagahappy.com/the-different-between-include-and-extend-in-ruby/' rel='bookmark' title='ruby 中 include 与 extend 区别'>ruby 中 include 与 extend 区别</a></li>
<li><a href='http://www.gagahappy.com/python-tiobe-award/' rel='bookmark' title='Python赢得Tiobe 2010年度语言大奖'>Python赢得Tiobe 2010年度语言大奖</a></li>
<li><a href='http://www.gagahappy.com/ruby-install-rmagick/' rel='bookmark' title='ruby 安装 rmagick'>ruby 安装 rmagick</a></li>
<li><a href='http://www.gagahappy.com/rails-redirect_to/' rel='bookmark' title='rails redirect_to'>rails redirect_to</a></li>
<li><a href='http://www.gagahappy.com/xpath/' rel='bookmark' title='XPath'>XPath</a></li>
<li><a href='http://www.gagahappy.com/render-partial/' rel='bookmark' title='render partial'>render partial</a></li>
<li><a href='http://www.gagahappy.com/validates_inclusion_of/' rel='bookmark' title='validates_inclusion_of'>validates_inclusion_of</a></li>
<li><a href='http://www.gagahappy.com/ri-rails-api/' rel='bookmark' title='使用ri查看Rails的API'>使用ri查看Rails的API</a></li>
<li><a href='http://www.gagahappy.com/add-gem-sources/' rel='bookmark' title='为gem添加源'>为gem添加源</a></li>
<li><a href='http://www.gagahappy.com/strftime/' rel='bookmark' title='strftime函数将时间格式化'>strftime函数将时间格式化</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gagahappy.com/ruby-p3p-def/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>《闻香识女人》中的经典探戈</title>
		<link>http://www.gagahappy.com/%e3%80%8a%e9%97%bb%e9%a6%99%e8%af%86%e5%a5%b3%e4%ba%ba%e3%80%8b%e4%b8%ad%e7%9a%84%e7%bb%8f%e5%85%b8%e6%8e%a2%e6%88%88/</link>
		<comments>http://www.gagahappy.com/%e3%80%8a%e9%97%bb%e9%a6%99%e8%af%86%e5%a5%b3%e4%ba%ba%e3%80%8b%e4%b8%ad%e7%9a%84%e7%bb%8f%e5%85%b8%e6%8e%a2%e6%88%88/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 13:28:45 +0000</pubDate>
		<dc:creator>moonfox</dc:creator>
				<category><![CDATA[非常娱乐]]></category>
		<category><![CDATA[娱乐]]></category>

		<guid isPermaLink="false">http://www.gagahappy.com/?p=3949</guid>
		<description><![CDATA[当中校为西门辩论台下掌声雷动的时候,你是否流下感动的泪水，那是生命的尊严.和电影同样出彩的还有那探戈,这是一首典型的阿根廷式探戈，热情浪漫得无以复加。一首曲尽，而脑中的旋律挥之不去，犹如一场没有尽兴的舞蹈，永远只差最后一步 您可能感兴趣的文章 国外公益快闪活动 《暮光之城》情侣被曝今夏完婚 结为现实夫妻 Sunshine Girl现场版 少女时代 gee 现场版 林大钧，天王级编舞 《快乐大本营》之大维 显示器竖着用 少女时代 for entertainments Nobody]]></description>
			<content:encoded><![CDATA[<p>当中校为西门辩论台下掌声雷动的时候,你是否流下感动的泪水，那是生命的尊严.和电影同样出彩的还有那探戈,这是一首典型的阿根廷式探戈，热情浪漫得无以复加。一首曲尽，而脑中的旋律挥之不去，犹如一场没有尽兴的舞蹈，永远只差最后一步</p>
<p><embed src="http://www.tudou.com/v/ccisrcwzwcA/&#038;resourceId=0_05_05_99/v.swf" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" wmode="opaque" width="480" height="400"></embed></p>
<p>您可能感兴趣的文章<ol>
<li><a href='http://www.gagahappy.com/gong-yi-kuai-shan/' rel='bookmark' title='国外公益快闪活动'>国外公益快闪活动</a></li>
<li><a href='http://www.gagahappy.com/kristen-stewart-and-robert-pattinson-in-love/' rel='bookmark' title='《暮光之城》情侣被曝今夏完婚 结为现实夫妻'>《暮光之城》情侣被曝今夏完婚 结为现实夫妻</a></li>
<li><a href='http://www.gagahappy.com/sunshine-girl-live/' rel='bookmark' title='Sunshine Girl现场版'>Sunshine Girl现场版</a></li>
<li><a href='http://www.gagahappy.com/girls-generation-gee-live/' rel='bookmark' title='少女时代 gee 现场版'>少女时代 gee 现场版</a></li>
<li><a href='http://www.gagahappy.com/terrylin/' rel='bookmark' title='林大钧，天王级编舞'>林大钧，天王级编舞</a></li>
<li><a href='http://www.gagahappy.com/da-wei-of-kuai-le-da-ben-ying/' rel='bookmark' title='《快乐大本营》之大维'>《快乐大本营》之大维</a></li>
<li><a href='http://www.gagahappy.com/display-bristling-with-vertical/' rel='bookmark' title='显示器竖着用'>显示器竖着用</a></li>
<li><a href='http://www.gagahappy.com/girls-generation/' rel='bookmark' title='少女时代'>少女时代</a></li>
<li><a href='http://www.gagahappy.com/for-entertainments/' rel='bookmark' title='for entertainments'>for entertainments</a></li>
<li><a href='http://www.gagahappy.com/nobody/' rel='bookmark' title='Nobody'>Nobody</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gagahappy.com/%e3%80%8a%e9%97%bb%e9%a6%99%e8%af%86%e5%a5%b3%e4%ba%ba%e3%80%8b%e4%b8%ad%e7%9a%84%e7%bb%8f%e5%85%b8%e6%8e%a2%e6%88%88/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MacBook 无法开机故障排除</title>
		<link>http://www.gagahappy.com/macbook-fail-to-power-on/</link>
		<comments>http://www.gagahappy.com/macbook-fail-to-power-on/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 02:22:19 +0000</pubDate>
		<dc:creator>moonfox</dc:creator>
				<category><![CDATA[杂七杂八]]></category>
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://www.gagahappy.com/?p=3945</guid>
		<description><![CDATA[问题的表现 如果 MacBook Air 无法开机，您应该尝试一些简单的故障排除步骤。下列情况下使用这些步骤： 您开机后 MacBook Air 显示器没有图片。 打开电脑后听不到任何风扇或硬盘活动声音，而且睡眠灯没有打开。 电脑打开后好像没有加电。 解决 将连接到电脑的所有设备都断开，包括打印机、集线器和第三方键盘或鼠标，然后尝试打开电脑来重新测试。 将 Apple 45W 便携电源适配器从电源插座和 MacBook Air 拔掉。等一分钟。先将适配器插回墙上的电源插座，然后将其插入 MacBook Air。通过插入另一个已知正常的设备（如台灯）来证实电源插座正常。将 MagSafe 接头插入电脑时，电源适配器 LED 应亮绿光或琥珀色光。 将已知正常的适配器和电源线/插头插入已知正常的电源插座。正确插入 MagSafe 接口时，LED 应亮起；否则请检查电脑上的 MagSafe 端口中是否有碎片，如粘到端口中磁铁上的金属物（这可能会使接头无法正常放置）。在适配器一端，查看 DC 接口是否有灰尘或其他碎片并检查针是否缺少、弯曲或粘连。有关清洁适配器的说明，请参阅此文章。 重置 PRAM。（按下电源按钮后，同时按下这些键：Command-Option-P-R，直到您在听到初始启动声后至少又听到一次启动声。） 重置 SMC（电源管理器）。有关说明，请参阅此文章。 如果电脑开着，请将其关闭。 将电源适配器连接到正常的电源。 同时按（左侧）Shift-Control-Option 和电源按钮一次。 注：您必须使用 MacBook Air 键盘左侧的键。 等待 5 秒钟，然后按电源按钮启动 MacBook Air。 尝试给系统加电时，请检查睡眠指示器。如果指示器 LED 短暂亮起，则主板正在获得电量并完成启动周期。有关 MacBook [...]]]></description>
			<content:encoded><![CDATA[<p>问题的表现</p>
<p>如果 MacBook Air 无法开机，您应该尝试一些简单的故障排除步骤。下列情况下使用这些步骤：</p>
<p>    您开机后 MacBook Air 显示器没有图片。<br />
    打开电脑后听不到任何风扇或硬盘活动声音，而且睡眠灯没有打开。<br />
    电脑打开后好像没有加电。<br />
<span id="more-3945"></span><br />
解决</p>
<p>    将连接到电脑的所有设备都断开，包括打印机、集线器和第三方键盘或鼠标，然后尝试打开电脑来重新测试。<br />
    将 Apple 45W 便携电源适配器从电源插座和 MacBook Air 拔掉。等一分钟。先将适配器插回墙上的电源插座，然后将其插入 MacBook Air。通过插入另一个已知正常的设备（如台灯）来证实电源插座正常。将 MagSafe 接头插入电脑时，电源适配器 LED 应亮绿光或琥珀色光。<br />
    将已知正常的适配器和电源线/插头插入已知正常的电源插座。正确插入 MagSafe 接口时，LED 应亮起；否则请检查电脑上的 MagSafe 端口中是否有碎片，如粘到端口中磁铁上的金属物（这可能会使接头无法正常放置）。在适配器一端，查看 DC 接口是否有灰尘或其他碎片并检查针是否缺少、弯曲或粘连。有关清洁适配器的说明，请参阅此文章。<br />
    重置 PRAM。（按下电源按钮后，同时按下这些键：Command-Option-P-R，直到您在听到初始启动声后至少又听到一次启动声。）<br />
    重置 SMC（电源管理器）。有关说明，请参阅此文章。<br />
        如果电脑开着，请将其关闭。<br />
        将电源适配器连接到正常的电源。<br />
        同时按（左侧）Shift-Control-Option 和电源按钮一次。<br />
        注：您必须使用 MacBook Air 键盘左侧的键。<br />
        等待 5 秒钟，然后按电源按钮启动 MacBook Air。<br />
    尝试给系统加电时，请检查睡眠指示器。如果指示器 LED 短暂亮起，则主板正在获得电量并完成启动周期。有关 MacBook Air 电池诊断的更多信息，请参阅此文章。<br />
    在尝试上述每一个步骤之后，如果仍然无法启动电脑，则可能需要将电脑送到 Apple 零售店或 Apple 授权服务提供商以获得更多帮助。</p>
<p>您可能感兴趣的文章<ol>
<li><a href='http://www.gagahappy.com/thanksgiving-day-mac-price/' rel='bookmark' title='感恩节mac价格'>感恩节mac价格</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gagahappy.com/macbook-fail-to-power-on/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>thin 配置</title>
		<link>http://www.gagahappy.com/thin-configuration/</link>
		<comments>http://www.gagahappy.com/thin-configuration/#comments</comments>
		<pubDate>Sun, 25 Dec 2011 13:16:16 +0000</pubDate>
		<dc:creator>moonfox</dc:creator>
				<category><![CDATA[杂七杂八]]></category>
		<category><![CDATA[玩转软件]]></category>
		<category><![CDATA[thin]]></category>

		<guid isPermaLink="false">http://www.gagahappy.com/?p=3936</guid>
		<description><![CDATA[sudo thin config -C /etc/thin/&#60;config-name&#62;.yml -c &#60;rails-app-root-path&#62; --servers &#60;number-of-threads&#62; -e &#60;environment&#62; thin config -C /etc/thin/redmine.yml -c /var/www/redmine --servers 5 -e production thin config -C /etc/thin/myapp.yml -c /var/rails/myapp --servers 5 --socket /tmp/thin.myapp.sock -e production 当执行第一条config命令，可能得到/etc/thin/redmine.yml内容如下 --- address: localhost pid: tmp/pids/thin.pid wait: 30 port: 3000 timeout: 30 log: log/thin.log max_conns: 1024 require: &#91;&#93; &#160; environment: production max_persistent_conns: [...]]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> thin config <span style="color: #660033;">-C</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>thin<span style="color: #000000; font-weight: bold;">/&lt;</span>config-name<span style="color: #000000; font-weight: bold;">&gt;</span>.yml <span style="color: #660033;">-c</span> <span style="color: #000000; font-weight: bold;">&lt;</span>rails-app-root-path<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #660033;">--servers</span> <span style="color: #000000; font-weight: bold;">&lt;</span>number-of-threads<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #660033;">-e</span> <span style="color: #000000; font-weight: bold;">&lt;</span>environment<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">thin config <span style="color: #660033;">-C</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>thin<span style="color: #000000; font-weight: bold;">/</span>redmine.yml <span style="color: #660033;">-c</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>redmine <span style="color: #660033;">--servers</span> <span style="color: #000000;">5</span> <span style="color: #660033;">-e</span> production    
thin config <span style="color: #660033;">-C</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>thin<span style="color: #000000; font-weight: bold;">/</span>myapp.yml <span style="color: #660033;">-c</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>rails<span style="color: #000000; font-weight: bold;">/</span>myapp <span style="color: #660033;">--servers</span> <span style="color: #000000;">5</span> <span style="color: #660033;">--socket</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>thin.myapp.sock <span style="color: #660033;">-e</span> production</pre></div></div>

<p><span id="more-3936"></span></p>
<p>当执行第一条config命令，可能得到/etc/thin/redmine.yml内容如下</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    <span style="color: #660033;">---</span>  
    address: localhost  
    pid: tmp<span style="color: #000000; font-weight: bold;">/</span>pids<span style="color: #000000; font-weight: bold;">/</span>thin.pid  
    <span style="color: #7a0874; font-weight: bold;">wait</span>: <span style="color: #000000;">30</span>  
    port: <span style="color: #000000;">3000</span>  
    timeout: <span style="color: #000000;">30</span>  
    log: log<span style="color: #000000; font-weight: bold;">/</span>thin.log  
    max_conns: <span style="color: #000000;">1024</span>  
    require: <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>  
&nbsp;
    environment: production  
    max_persistent_conns: <span style="color: #000000;">512</span>  
    servers: <span style="color: #000000;">5</span>  
    daemonize: <span style="color: #c20cb9; font-weight: bold;">true</span>  
    chdir: <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>redmine</pre></div></div>

<p>启动应用<br />
sevice thin start<br />
将会启动3000~3004共5个端口。<br />
如果你有Nginx就可以设置一个代理转发了 </p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.gagahappy.com/thin-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>rails 加载schema到指定环境</title>
		<link>http://www.gagahappy.com/rails-load-schema/</link>
		<comments>http://www.gagahappy.com/rails-load-schema/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 16:06:23 +0000</pubDate>
		<dc:creator>moonfox</dc:creator>
				<category><![CDATA[程序开发]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.gagahappy.com/?p=3943</guid>
		<description><![CDATA[rake db:schema:load RAILS_ENV=production 您可能感兴趣的文章 rails 页面缓存路径 ruby 中 include 与 extend 区别 rails3.0 安装mysql2 失败，发生lmysqlclient 错误 rails3.0怪异的数据库密码配置 rake db:migrate CREATE TABLE `schema_migrations` ruby 安装 rmagick rails redirect_to render partial rails2.0快速体验 为gem添加源]]></description>
			<content:encoded><![CDATA[<p>rake db:schema:load RAILS_ENV=production</p>
<p>您可能感兴趣的文章<ol>
<li><a href='http://www.gagahappy.com/how-rails-caches-page-work/' rel='bookmark' title='rails 页面缓存路径'>rails 页面缓存路径</a></li>
<li><a href='http://www.gagahappy.com/the-different-between-include-and-extend-in-ruby/' rel='bookmark' title='ruby 中 include 与 extend 区别'>ruby 中 include 与 extend 区别</a></li>
<li><a href='http://www.gagahappy.com/rails3-0-gem-mysql2-lmysqlclient/' rel='bookmark' title='rails3.0 安装mysql2 失败，发生lmysqlclient 错误'>rails3.0 安装mysql2 失败，发生lmysqlclient 错误</a></li>
<li><a href='http://www.gagahappy.com/rails3-passwd-must-to-be-string-format/' rel='bookmark' title='rails3.0怪异的数据库密码配置'>rails3.0怪异的数据库密码配置</a></li>
<li><a href='http://www.gagahappy.com/rake-dbmigrate-create-table-schema_migrations/' rel='bookmark' title='rake db:migrate CREATE TABLE `schema_migrations`'>rake db:migrate CREATE TABLE `schema_migrations`</a></li>
<li><a href='http://www.gagahappy.com/ruby-install-rmagick/' rel='bookmark' title='ruby 安装 rmagick'>ruby 安装 rmagick</a></li>
<li><a href='http://www.gagahappy.com/rails-redirect_to/' rel='bookmark' title='rails redirect_to'>rails redirect_to</a></li>
<li><a href='http://www.gagahappy.com/render-partial/' rel='bookmark' title='render partial'>render partial</a></li>
<li><a href='http://www.gagahappy.com/rails-2-quick-show/' rel='bookmark' title='rails2.0快速体验'>rails2.0快速体验</a></li>
<li><a href='http://www.gagahappy.com/add-gem-sources/' rel='bookmark' title='为gem添加源'>为gem添加源</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gagahappy.com/rails-load-schema/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Resque生效的必要条件</title>
		<link>http://www.gagahappy.com/make-resque-work/</link>
		<comments>http://www.gagahappy.com/make-resque-work/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 14:38:21 +0000</pubDate>
		<dc:creator>moonfox</dc:creator>
				<category><![CDATA[程序开发]]></category>
		<category><![CDATA[resque]]></category>

		<guid isPermaLink="false">http://www.gagahappy.com/?p=3933</guid>
		<description><![CDATA[Resque生效的必要条件：启动redis-server，执行rake resque:work或resque:workers监听 No related posts.]]></description>
			<content:encoded><![CDATA[<p>Resque生效的必要条件：启动redis-server，执行rake resque:work或resque:workers监听</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.gagahappy.com/make-resque-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

