<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>759803573 (王清山)</title>
    <link>https://ruby-china.org/759803573</link>
    <description/>
    <language>en-us</language>
    <item>
      <title>一张图清晰解释了方法调用</title>
      <description>&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/2018/026d49fe-9b96-4303-8626-b667a70de61f.png!large" title="" alt=""&gt;&lt;/p&gt;</description>
      <author>759803573</author>
      <pubDate>Tue, 18 Dec 2018 23:48:26 +0800</pubDate>
      <link>https://ruby-china.org/topics/37917</link>
      <guid>https://ruby-china.org/topics/37917</guid>
    </item>
    <item>
      <title>关于方法参数传递的问题，如何修改传过来得值</title>
      <description>&lt;p&gt;这是我再 leetcode 上遇见的一道题:
Rotate an array of n elements to the right by k steps.
For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4].&lt;/p&gt;

&lt;p&gt;我是这样完成的&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="c1"&gt;# @param {Integer[]} nums&lt;/span&gt;
&lt;span class="c1"&gt;# @param {Integer} k&lt;/span&gt;
&lt;span class="c1"&gt;# @return {void} Do not return anything, modify nums in-place instead.&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;rotate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
   &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;%=&lt;/span&gt;&lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;length&lt;/span&gt;    
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;k!&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;   
    &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;length&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;to_i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;to_i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;nums&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;  
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;问题是 nums 的值只在函数内改变了&lt;/p&gt;</description>
      <author>759803573</author>
      <pubDate>Wed, 01 Apr 2015 09:42:43 +0800</pubDate>
      <link>https://ruby-china.org/topics/24944</link>
      <guid>https://ruby-china.org/topics/24944</guid>
    </item>
    <item>
      <title>请问如何利用 ActiveRecord 一次插入多条数据?</title>
      <description>&lt;p&gt;数据量挺大的......&lt;/p&gt;</description>
      <author>759803573</author>
      <pubDate>Sun, 15 Mar 2015 18:37:38 +0800</pubDate>
      <link>https://ruby-china.org/topics/24661</link>
      <guid>https://ruby-china.org/topics/24661</guid>
    </item>
  </channel>
</rss>
