<?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; 程序开发</title>
	<atom:link href="http://www.gagahappy.com/category/development/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>Wed, 08 Feb 2012 03:22:28 +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>Eager load application classes</title>
		<link>http://www.gagahappy.com/eager-load-application-classes/</link>
		<comments>http://www.gagahappy.com/eager-load-application-classes/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 03:22:28 +0000</pubDate>
		<dc:creator>moonfox</dc:creator>
				<category><![CDATA[程序开发]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.gagahappy.com/?p=3969</guid>
		<description><![CDATA[# Eager load application classes def load_application_classes return if $rails_rake_task if configuration.cache_classes configuration.eager_load_paths.each do &#124;load_path&#124; matcher = /\A#{Regexp.escape(load_path)}(.*)\.rb\Z/ Dir.glob&#40;&#34;#{load_path}/**/*.rb&#34;&#41;.sort.each do &#124;file&#124; require_dependency file.sub&#40;matcher, '\1'&#41; end end end end 您可能感兴趣的文章 rails Rails::OrderedOptions ruby 中 include 与 extend 区别 ruby initialize 返回对象 rails redirect_to render partial validates_inclusion_of ruby 连接字符串 使用ri查看Rails的API belongs_to 选项中的:primary_key 为gem添加源]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">    <span style="color:#008000; font-style:italic;"># Eager load application classes</span>
    <span style="color:#9966CC; font-weight:bold;">def</span> load_application_classes
      <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#ff6633; font-weight:bold;">$rails_rake_task</span>
      <span style="color:#9966CC; font-weight:bold;">if</span> configuration.<span style="color:#9900CC;">cache_classes</span>
        configuration.<span style="color:#9900CC;">eager_load_paths</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>load_path<span style="color:#006600; font-weight:bold;">|</span>
          matcher = <span style="color:#006600; font-weight:bold;">/</span>\A<span style="color:#008000; font-style:italic;">#{Regexp.escape(load_path)}(.*)\.rb\Z/</span>
          <span style="color:#CC00FF; font-weight:bold;">Dir</span>.<span style="color:#9900CC;">glob</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;#{load_path}/**/*.rb&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">sort</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>file<span style="color:#006600; font-weight:bold;">|</span>
            require_dependency file.<span style="color:#CC0066; font-weight:bold;">sub</span><span style="color:#006600; font-weight:bold;">&#40;</span>matcher, <span style="color:#996600;">'<span style="color:#000099;">\1</span>'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
          <span style="color:#9966CC; font-weight:bold;">end</span>
        <span style="color:#9966CC; font-weight:bold;">end</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/rails-railsorderedoptions/' rel='bookmark' title='rails Rails::OrderedOptions'>rails Rails::OrderedOptions</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/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/validates_inclusion_of/' rel='bookmark' title='validates_inclusion_of'>validates_inclusion_of</a></li>
<li><a href='http://www.gagahappy.com/ruby-connect-string-method/' rel='bookmark' title='ruby 连接字符串'>ruby 连接字符串</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/eager-load-application-classes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>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>
		<item>
		<title>ubuntu下安装mysql出现FATAL ERROR: Could not find mysqld的处理</title>
		<link>http://www.gagahappy.com/ubuntu-intall-mysql-fatal-error-could-not-find-mysqld/</link>
		<comments>http://www.gagahappy.com/ubuntu-intall-mysql-fatal-error-could-not-find-mysqld/#comments</comments>
		<pubDate>Sun, 11 Dec 2011 07:20:47 +0000</pubDate>
		<dc:creator>moonfox</dc:creator>
				<category><![CDATA[数据库]]></category>
		<category><![CDATA[程序开发]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.gagahappy.com/?p=3922</guid>
		<description><![CDATA[错误信息: #./bin/mysql_install_db –user=mysql FATAL ERROR: Could not find mysqld The following directories were searched: /usr/libexec /usr/sbin /usr/bin If you compiled from source, you need to run ‘make install’to copy the software into the correct location ready for operation. If you are using a binary release, you must either be at the top of the level [...]]]></description>
			<content:encoded><![CDATA[<p>错误信息:<br />
#./bin/mysql_install_db –user=mysql</p>
<p>FATAL ERROR: Could not find mysqld</p>
<p>The following directories were searched:<br />
<span id="more-3922"></span><br />
/usr/libexec<br />
/usr/sbin<br />
/usr/bin</p>
<p>If you compiled from source, you need to run ‘make install’to copy the software into the correct location ready for operation.</p>
<p>If you are using a binary release, you must either be at the top of the level of the extracted archivem or pass the –basedir option pointing to that location.</p>
<p>解决办法：<br />
scripts/mysql_install_db &#8211;user=mysql &#8211;basedir=/usr/local/mysql<br />
（这里mysql是所使用的用户名，basedir是mysql的安装目录）</p>
<p>您可能感兴趣的文章<ol>
<li><a href='http://www.gagahappy.com/mysql-manager-of-pid-file-quit-without-updating-file/' rel='bookmark' title='mysql不能启动 Manager of pid-file quit without updating file.'>mysql不能启动 Manager of pid-file quit without updating file.</a></li>
<li><a href='http://www.gagahappy.com/mysql-select-strange-syntax/' rel='bookmark' title='mysql select 蹩脚的语法'>mysql select 蹩脚的语法</a></li>
<li><a href='http://www.gagahappy.com/phpmyadmin-need-a-phrase-password/' rel='bookmark' title='phpMyAdmin 配置文件现在需要一个短语密码'>phpMyAdmin 配置文件现在需要一个短语密码</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/mysql-scale-out/' rel='bookmark' title='mysql 横向扩展性'>mysql 横向扩展性</a></li>
<li><a href='http://www.gagahappy.com/mysql-create-user/' rel='bookmark' title='MySql用户创建、授权以及删除'>MySql用户创建、授权以及删除</a></li>
<li><a href='http://www.gagahappy.com/mysql-server-has-gone-away/' rel='bookmark' title='MySQL server has gone away'>MySQL server has gone away</a></li>
<li><a href='http://www.gagahappy.com/mysql-mysqldump-01/' rel='bookmark' title='MySQL中的mysqldump命令使用详解'>MySQL中的mysqldump命令使用详解</a></li>
<li><a href='http://www.gagahappy.com/mysql-my-cnf-01/' rel='bookmark' title='mysql my.cnf'>mysql my.cnf</a></li>
<li><a href='http://www.gagahappy.com/mysql-config/' rel='bookmark' title='mysql 配置文件'>mysql 配置文件</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gagahappy.com/ubuntu-intall-mysql-fatal-error-could-not-find-mysqld/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>redis 存入hash值</title>
		<link>http://www.gagahappy.com/redis-store-hash/</link>
		<comments>http://www.gagahappy.com/redis-store-hash/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 14:51:23 +0000</pubDate>
		<dc:creator>moonfox</dc:creator>
				<category><![CDATA[程序开发]]></category>
		<category><![CDATA[redis]]></category>

		<guid isPermaLink="false">http://www.gagahappy.com/?p=3915</guid>
		<description><![CDATA[redis> HMSET myhash field1 &#8220;Hello&#8221; field2 &#8220;World&#8221; redis> HMGET myhash field1 field2 您可能感兴趣的文章 redis-store的开发首选编辑器]]></description>
			<content:encoded><![CDATA[<p>redis>  HMSET myhash field1 &#8220;Hello&#8221; field2 &#8220;World&#8221;</p>
<p>redis>  HMGET myhash field1 field2</p>
<p>您可能感兴趣的文章<ol>
<li><a href='http://www.gagahappy.com/redis-store-editor/' rel='bookmark' title='redis-store的开发首选编辑器'>redis-store的开发首选编辑器</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gagahappy.com/redis-store-hash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

