<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>wilikeit (wi)</title>
    <link>https://ruby-china.org/wilikeit</link>
    <description/>
    <language>en-us</language>
    <item>
      <title>听说 Python 之父未来将把 Python 性能提升 5 倍</title>
      <description>&lt;p&gt;听说 python 之父将在 4 年内把 Python 速度提升 5 倍，即每年约提升 1.5 倍!
蛇叔 65 岁依然呆不住，加入微软，还专门成立团队 来提升 python 性能。&lt;/p&gt;</description>
      <author>wilikeit</author>
      <pubDate>Wed, 19 May 2021 11:31:24 +0800</pubDate>
      <link>https://ruby-china.org/topics/41282</link>
      <guid>https://ruby-china.org/topics/41282</guid>
    </item>
    <item>
      <title>请问用正则时，如何批量对特殊字符进行转义</title>
      <description>&lt;p&gt;比如：&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'[1]abc,def'&lt;/span&gt;
&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;=~&lt;/span&gt;&lt;span class="sr"&gt;/\[1\]/&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;[] 这种特殊字符少了，用\还好，要是多了就麻烦，请问有什么批量转义的方法吗，类似于 fgrep 命令会把 () [] 这种正则 符号当作普通字符&lt;/p&gt;</description>
      <author>wilikeit</author>
      <pubDate>Thu, 10 Dec 2020 15:10:27 +0800</pubDate>
      <link>https://ruby-china.org/topics/40664</link>
      <guid>https://ruby-china.org/topics/40664</guid>
    </item>
    <item>
      <title>用 ? 号代替双引号，少按键盘？</title>
      <description>&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sc"&gt;?a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sc"&gt;?b&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nb"&gt;p&lt;/span&gt; &lt;span class="n"&gt;arr&lt;/span&gt;  &lt;span class="c1"&gt;#输出：["a", "b"]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这样是不是少按键盘，不会有什么潜在的问题吧？&lt;/p&gt;</description>
      <author>wilikeit</author>
      <pubDate>Fri, 30 Mar 2018 22:37:14 +0800</pubDate>
      <link>https://ruby-china.org/topics/35369</link>
      <guid>https://ruby-china.org/topics/35369</guid>
    </item>
    <item>
      <title>%{} 是什么意思？</title>
      <description>&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;A&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="no"&gt;A&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;class_eval&lt;/span&gt; &lt;span class="sx"&gt;%{
  def self.hi
    puts "hi"
  end
}&lt;/span&gt;
&lt;span class="no"&gt;A&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;请问%{是什么意思？&lt;/p&gt;</description>
      <author>wilikeit</author>
      <pubDate>Wed, 28 Mar 2018 13:02:02 +0800</pubDate>
      <link>https://ruby-china.org/topics/35345</link>
      <guid>https://ruby-china.org/topics/35345</guid>
    </item>
    <item>
      <title>for 结合 Proc 使用时的作用域问题</title>
      <description>&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"hi"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s2"&gt;"hello"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="no"&gt;Proc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;
end

a.each do |m|
    puts m.call
end
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;输出：
hello
hello
怎么不是 hi、hello，何解？&lt;/p&gt;</description>
      <author>wilikeit</author>
      <pubDate>Thu, 01 Mar 2018 22:44:19 +0800</pubDate>
      <link>https://ruby-china.org/topics/35117</link>
      <guid>https://ruby-china.org/topics/35117</guid>
    </item>
    <item>
      <title>迭代中能否设计成不要双竖线？</title>
      <description>&lt;p&gt;如：&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;each&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
    &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;能否不要双竖线&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;each&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;
    &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;为什么一定要双竖线，这 2 个竖线真不好输入，为什么不能去掉呢？&lt;/p&gt;</description>
      <author>wilikeit</author>
      <pubDate>Sun, 25 Feb 2018 15:08:38 +0800</pubDate>
      <link>https://ruby-china.org/topics/35078</link>
      <guid>https://ruby-china.org/topics/35078</guid>
    </item>
    <item>
      <title>定义数组可以不要括号？</title>
      <description>&lt;p&gt;如：
arr=1,2,"hello"
puts arr.class  #out:Array
如果能这样定义数组，太方便了点，都不用写括号，不知道这样做可行不？&lt;/p&gt;</description>
      <author>wilikeit</author>
      <pubDate>Fri, 23 Feb 2018 22:37:37 +0800</pubDate>
      <link>https://ruby-china.org/topics/35062</link>
      <guid>https://ruby-china.org/topics/35062</guid>
    </item>
    <item>
      <title>请问 bundle install 时如何不升级 rails</title>
      <description>&lt;p&gt;我安装了 rails5.1.1，创建项目后，进入到项目目录，用 bundle install 后，发现 rails 升级到了 5.1.3，整了 1 下午也没解决，请问如何不升级呢？&lt;/p&gt;</description>
      <author>wilikeit</author>
      <pubDate>Fri, 01 Sep 2017 17:31:31 +0800</pubDate>
      <link>https://ruby-china.org/topics/33997</link>
      <guid>https://ruby-china.org/topics/33997</guid>
    </item>
  </channel>
</rss>
