<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>FenRagwort (FenRagwort)</title>
    <link>https://ruby-china.org/FenRagwort</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>怎么样不用安装 XCode 安装 Ruby 啊</title>
      <description>&lt;p&gt;在 MacBook Pro 上，要用 RVM 装 Ruby 得先安装 XCode
我不是专业开发者，我根本用不上 XCode，1 个多 G 的软件啊&lt;/p&gt;

&lt;p&gt;有没有简单的只装 Ruby 最新版 1.9 的办法啊？  &lt;/p&gt;</description>
      <author>FenRagwort</author>
      <pubDate>Sat, 16 Jun 2012 16:57:36 +0800</pubDate>
      <link>https://ruby-china.org/topics/3848</link>
      <guid>https://ruby-china.org/topics/3848</guid>
    </item>
    <item>
      <title>想删除 RVM 自身用什么命令啊</title>
      <description>&lt;p&gt;如题
rvm uninstall 是删除安装的 ruby  &lt;/p&gt;</description>
      <author>FenRagwort</author>
      <pubDate>Fri, 15 Jun 2012 23:55:54 +0800</pubDate>
      <link>https://ruby-china.org/topics/3838</link>
      <guid>https://ruby-china.org/topics/3838</guid>
    </item>
    <item>
      <title>IO#read 的 buffer 参数主要有什么用途？</title>
      <description>&lt;p&gt;IO 类的 read 实例方法有一种用法：read(length, buffer)
设置 buffer 主要有什么用途？什么情况下需要用到 buffer 呢？  &lt;/p&gt;</description>
      <author>FenRagwort</author>
      <pubDate>Mon, 21 May 2012 15:46:21 +0800</pubDate>
      <link>https://ruby-china.org/topics/3404</link>
      <guid>https://ruby-china.org/topics/3404</guid>
    </item>
    <item>
      <title>Sublime Text 2 的 diff 格式是干什么用的？</title>
      <description>&lt;p&gt;选择格式时可以选这个，这个是比较什么的？   &lt;/p&gt;</description>
      <author>FenRagwort</author>
      <pubDate>Sun, 06 May 2012 20:50:53 +0800</pubDate>
      <link>https://ruby-china.org/topics/3111</link>
      <guid>https://ruby-china.org/topics/3111</guid>
    </item>
    <item>
      <title>Sublime Text 2 只能用 Python 编写插件？</title>
      <description>&lt;p&gt;对于一些文本处理的操作，Python 实在是没有 Ruby 好写啊   &lt;/p&gt;</description>
      <author>FenRagwort</author>
      <pubDate>Sun, 06 May 2012 20:48:17 +0800</pubDate>
      <link>https://ruby-china.org/topics/3110</link>
      <guid>https://ruby-china.org/topics/3110</guid>
    </item>
    <item>
      <title>Sublime Text 2 怎样直接运行代码？</title>
      <description>&lt;p&gt;菜单里找了半天没找着
想直接运行当前代码，该怎么办呢  &lt;/p&gt;</description>
      <author>FenRagwort</author>
      <pubDate>Mon, 23 Apr 2012 00:19:16 +0800</pubDate>
      <link>https://ruby-china.org/topics/2819</link>
      <guid>https://ruby-china.org/topics/2819</guid>
    </item>
    <item>
      <title>STDIN、STDOUT、STDERR 和 $stdin、$stdout、$stderr 的区别</title>
      <description>&lt;p&gt;STDIN 这一组以大写字母开头，是常量&lt;/p&gt;

&lt;p&gt;$stdin 这一组以$开头，是全局变量&lt;/p&gt;

&lt;p&gt;常量不可变，STDOUT 总指向屏幕显示（除非运行 ruby 时在命令行设置&amp;gt;out 2&amp;gt;err 之类）&lt;/p&gt;

&lt;p&gt;变量可变，所以$stdin 可以替换成别的 IO/File 对象 &lt;/p&gt;

&lt;p&gt;全局的输出方法，如 print puts 等，总是向$stdout 输出，而非向 STDOUT 输出，如： &lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="nb"&gt;print&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="c1"&gt;# 最开始时$stdout和STDOUT是一致的，输出到屏幕 &lt;/span&gt;

&lt;span class="vg"&gt;$stdout&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'output_file'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'w'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# $stdout指向另一个File对象&lt;/span&gt;
&lt;span class="nb"&gt;print&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="c1"&gt;# 这时输出到output_file了 &lt;/span&gt;

&lt;span class="vg"&gt;$stdout&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;STDOUT&lt;/span&gt;  &lt;span class="c1"&gt;# $stdout和STDOUT又指向同一个对象了&lt;/span&gt;
&lt;span class="nb"&gt;print&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="c1"&gt;# 又输出到屏幕了 &lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;STDOUT 和$stdout 有两套，并不重复，是对 Perl 的一种改进&lt;/p&gt;</description>
      <author>FenRagwort</author>
      <pubDate>Thu, 12 Apr 2012 15:19:46 +0800</pubDate>
      <link>https://ruby-china.org/topics/2545</link>
      <guid>https://ruby-china.org/topics/2545</guid>
    </item>
    <item>
      <title>请问 RVM 能安装 Ruby 的最新开发版本么？</title>
      <description>&lt;p&gt;就是 bugs.ruby-lang.org 的 ruby-trunk 的最新版
能用 RVM 安装么？   &lt;/p&gt;</description>
      <author>FenRagwort</author>
      <pubDate>Wed, 11 Apr 2012 12:07:11 +0800</pubDate>
      <link>https://ruby-china.org/topics/2523</link>
      <guid>https://ruby-china.org/topics/2523</guid>
    </item>
    <item>
      <title>Linux 新手请问 Ubuntu 安装到问题</title>
      <description>&lt;p&gt;在 Windows 下用 Wubi 安装的 Ubuntu
RVM 安装应该是成功了吧，可是 gem install 总不成功&lt;/p&gt;

&lt;p&gt;joey@ubuntu:~$ gem install sinatra
ERROR:  Loading command: install (LoadError)
    cannot load such file -- zlib
ERROR:  While executing gem ... (NameError)
    uninitialized constant Gem::Commands::InstallCommand&lt;/p&gt;

&lt;p&gt;都是这样的信息，应该怎么办啊？&lt;/p&gt;</description>
      <author>FenRagwort</author>
      <pubDate>Sun, 08 Apr 2012 23:53:08 +0800</pubDate>
      <link>https://ruby-china.org/topics/2469</link>
      <guid>https://ruby-china.org/topics/2469</guid>
    </item>
    <item>
      <title>设计 API 时，有时候很困扰</title>
      <description>&lt;p&gt;在返回 0、空数组、空字符串还是 nil 之间犹豫不定&lt;/p&gt;

&lt;p&gt;比如一个方法&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;foo&lt;/span&gt;
  &lt;span class="c1"&gt;# blah blah&lt;/span&gt;
  &lt;span class="n"&gt;return_array&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
  &lt;span class="n"&gt;return_array&lt;/span&gt; &lt;span class="k"&gt;unless&lt;/span&gt; &lt;span class="n"&gt;return_array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;empty?&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;最后这一句 return_array unless return_array.empty？要不要加呢？加了的话，如果运算得到的 return_array 是个空数组，那么就返回 nil，而不是 []。不加的话，永远返回一个数组。&lt;/p&gt;

&lt;p&gt;虽说返回什么确实根据实际情况来定，但还是免不了觉得这也可以，那也可以。有什么 best practice 来指导一下怎么样决定返回值比较好么？  &lt;/p&gt;</description>
      <author>FenRagwort</author>
      <pubDate>Sun, 08 Apr 2012 10:44:20 +0800</pubDate>
      <link>https://ruby-china.org/topics/2455</link>
      <guid>https://ruby-china.org/topics/2455</guid>
    </item>
    <item>
      <title>有谁试过用 Ruby 调用 Excel 画数据图？</title>
      <description>&lt;p&gt;Python 有 Matplotlib 可以画图，Ruby 没有&lt;/p&gt;

&lt;p&gt;我设想是否可以用 Ruby 调用 Excel 来画数据图&lt;/p&gt;

&lt;p&gt;有没有人这么做过，怎么样一个思路好呢？ &lt;/p&gt;</description>
      <author>FenRagwort</author>
      <pubDate>Sat, 07 Apr 2012 00:25:18 +0800</pubDate>
      <link>https://ruby-china.org/topics/2443</link>
      <guid>https://ruby-china.org/topics/2443</guid>
    </item>
    <item>
      <title>按一定的概率随机给出键，怎么实现好</title>
      <description>&lt;p&gt;比如有一个 hash 是这样的{a: 0.5, b: 0.15, c: 0.2,d: 0.15}，每个值是该键的概率
现在想随机取出一个键，取出的概率等于它的值，如:a 有 50% 的可能被取出，:c 有 20% 的可能性。
该怎么实现好呢？  &lt;/p&gt;</description>
      <author>FenRagwort</author>
      <pubDate>Sat, 31 Mar 2012 19:07:14 +0800</pubDate>
      <link>https://ruby-china.org/topics/2307</link>
      <guid>https://ruby-china.org/topics/2307</guid>
    </item>
    <item>
      <title>现在的 “热门帖子” 不合理</title>
      <description>&lt;p&gt;看了这么多天，几乎都没变化，但是实际评论增加也很少。
榜上的也未见得是多么有价值的，纯粹因为前期累积了评论，就下不来了，给新帖子上榜增加了很大的阻碍。
最好改为“24 小时内最活跃的帖子”，以 24 小时内的新增评论数作为上榜的标准。
同时恢复不分节点展示最新帖子的列表，到首页的人看见感兴趣的标题，自然会点进去看，有价值的回复或标上喜欢，这样榜单能时常更新，而不是现在这样，几个老帖子盘踞下不来。  &lt;/p&gt;</description>
      <author>FenRagwort</author>
      <pubDate>Fri, 30 Mar 2012 09:12:03 +0800</pubDate>
      <link>https://ruby-china.org/topics/2264</link>
      <guid>https://ruby-china.org/topics/2264</guid>
    </item>
    <item>
      <title>Ruby 标准库里有处理 zip 文件的模块么？</title>
      <description>&lt;p&gt;只需要对 zip 文件做很简单的处理，能不另外下载 gem 最好，Ruby 标准库里有处理 zip 文件的模块么？  &lt;/p&gt;</description>
      <author>FenRagwort</author>
      <pubDate>Thu, 29 Mar 2012 15:51:19 +0800</pubDate>
      <link>https://ruby-china.org/topics/2240</link>
      <guid>https://ruby-china.org/topics/2240</guid>
    </item>
  </channel>
</rss>
